1
0
Fork
You've already forked symfony-bootstrap
0
A small library to create and bootstrap an application using Symfony components.
  • PHP 100%
2026年03月19日 14:40:55 -04:00
config add services.yml file 2025年03月27日 13:23:07 -04:00
src code cleanup 2026年03月19日 14:40:46 -04:00
.gitignore init composer 2025年03月25日 21:25:23 -04:00
composer.json update license in composer.json 2025年04月13日 22:34:09 +00:00
LICENSE add license 2025年04月13日 19:38:43 +00:00
README.md updating readme 2026年03月19日 14:40:55 -04:00

Pixiekat's Symfony Bootstrap Library

This is a basic library which bootstraps an application using Symfony Components.

Installation

composer require pixiekat\symfony-bootstrap:^1.0 or view the releases page on Codeberg.

Usage

Define your routes for your application.

use Symfony\Component\Routing\Annotation\Route;
#[Route(path: '/foo', name: 'foo', methods: ['GET'])]

Then create the application.

try {
 $app = (new \Pixiekat\SymfonyBootstrap\Bootstrap)->createApplication('dev');
 $response = $app->getResponse(['error_pages_dir' => '/errors']) ;
 $response->send();
}
catch (Exception $e) {
 throw \Exception('Could not bootstrap.');
}

Pull services from the container with $app->getContainer().

Services

You can define services within <root>/config/services.yml. The Application class will read them in when bootstrapping.

services:last_fm_client:class:Barryvanveen\Lastfm\Lastfmarguments:- '@http.client'- '%env(LAST_FM_API_KEY)%'app_last_fm_manager:class:App\Service\LastFmManagerarguments:- '%env(LAST_FM_API_KEY)%'- '%env(LAST_FM_USER)%'- '@cache.app'- '@logger'- '@last_fm_client'app.twig.last_fm_now_playing_extension:class:App\Twig\LastFmNowPlayingExtensionarguments:- '@app_last_fm_manager'- '@app.cache'- '@request'- '@logger'tags:- {name:twig.extension }

Doctrine

Doctrine is available as doctrine.orm.entity_manager or using $app->getDoctrine().

Add your DB connection string as environment variable DATABASE_URL.

Add your migrations.yml to <root>/config/.

table_storage:table_name:doctrine_migration_versionsversion_column_name:versionversion_column_length:191executed_at_column_name:executed_atexecution_time_column_name:execution_timemigrations_paths:'App\Migrations':./../migrationsall_or_nothing:truetransactional:truecheck_database_platform:trueorganize_migrations:noneconnection:nullem:null

Add your Entities to <root>/src/Entity.

Add your Repositories to <root>/src/Repository.

Caveats

This is a very rudimentary project mostly designed for me that's a proof of concept in constant development but feel free to request anything or pull request. :)

License

Anyway this project is licensed under the Anti-Capitalist Software License so basically I don't care if you use this as long as you're not in law enforcement, immigration enforcement, or the military.

Free Palestine. Human beings aren't illegal. Fuck borders.

Contact Me

You can find me on Bluesky mostly. I don't bite. <3