Skip to content

Commit

Permalink
Merge pull request #662 from tighten/jbk/service-providers
Browse files Browse the repository at this point in the history
Refactor container bootstrapping to use service providers
  • Loading branch information
bakerkretzmar authored Nov 11, 2022
2 parents f05c667 + 39ce3af commit fdf6db6
Show file tree
Hide file tree
Showing 25 changed files with 617 additions and 323 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Rename SnapshotTest to SnapshotsTest
45b422424a03c24ad2aed0af2bd0648ba4eb4e17

# Move dotenv file snapshot test
a2f33e083680337ba53704e4daf8c2d9ed2ac2f8
35 changes: 22 additions & 13 deletions jigsaw
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/usr/bin/env php
<?php

use TightenCo\Jigsaw\Console\BuildCommand;
use TightenCo\Jigsaw\Console\InitCommand;
use TightenCo\Jigsaw\Console\ServeCommand;
use TightenCo\Jigsaw\Jigsaw;

require_once(__DIR__ . '/jigsaw-core.php');

$app = new Symfony\Component\Console\Application('Jigsaw', '1.4.0');
$app->add($container[InitCommand::class]);
$app->add(new BuildCommand($container));
$app->add(new ServeCommand($container));
Jigsaw::addUserCommands($app, $container);
$app->run();
define('JIGSAW_START', microtime(true));

if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
}

if (file_exists(getcwd() . '/vendor/autoload.php')) {
require getcwd() . '/vendor/autoload.php';
}

$app = new TightenCo\Jigsaw\Container;

$app->bootstrapWith([]);

$application = new Symfony\Component\Console\Application('Jigsaw', '1.4.0');
$application->add($app[TightenCo\Jigsaw\Console\InitCommand::class]);
$application->add(new TightenCo\Jigsaw\Console\BuildCommand($app));
$application->add(new TightenCo\Jigsaw\Console\ServeCommand($app));

TightenCo\Jigsaw\Jigsaw::addUserCommands($application, $app);

$application->run();
218 changes: 0 additions & 218 deletions jigsaw-core.php

This file was deleted.

Loading

0 comments on commit fdf6db6

Please sign in to comment.