Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3249f3642e |
32
bin/console
32
bin/console
@@ -1,37 +1,23 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use DI\ContainerBuilder;
|
use Maintained\Application\Application;
|
||||||
use Maintained\Application\Command\ClearCacheCommand;
|
use Maintained\Application\Command\ClearCacheCommand;
|
||||||
use Maintained\Application\Command\ShowStatisticsCommand;
|
use Maintained\Application\Command\ShowStatisticsCommand;
|
||||||
use Maintained\Application\Command\UpdateStatisticsCommand;
|
use Maintained\Application\Command\UpdateStatisticsCommand;
|
||||||
use Maintained\Application\Command\WarmupCacheCommand;
|
use Maintained\Application\Command\WarmupCacheCommand;
|
||||||
use Symfony\Component\Console\Application;
|
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../.puli/GeneratedPuliFactory.php';
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
$modules = [
|
$app = new Application;
|
||||||
'error-handler',
|
|
||||||
'twig',
|
|
||||||
'app',
|
|
||||||
];
|
|
||||||
/** @var \Stratify\Framework\Application $app */
|
|
||||||
$app = new class([], $modules) extends \Stratify\Framework\Application
|
|
||||||
{
|
|
||||||
protected function createContainerBuilder(array $modules) : ContainerBuilder
|
|
||||||
{
|
|
||||||
$containerBuilder = parent::createContainerBuilder($modules);
|
|
||||||
$containerBuilder->useAnnotations(true);
|
|
||||||
return $containerBuilder;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
$container = $app->getContainer();
|
$container = $app->getContainer();
|
||||||
|
|
||||||
$application = new Application('isitmaintained');
|
$cli = $app->cli();
|
||||||
|
|
||||||
$application->add($container->get(ClearCacheCommand::class));
|
$cli->add($container->get(ClearCacheCommand::class));
|
||||||
$application->add($container->get(WarmupCacheCommand::class));
|
$cli->add($container->get(WarmupCacheCommand::class));
|
||||||
$application->add($container->get(ShowStatisticsCommand::class));
|
$cli->add($container->get(ShowStatisticsCommand::class));
|
||||||
$application->add($container->get(UpdateStatisticsCommand::class));
|
$cli->add($container->get(UpdateStatisticsCommand::class));
|
||||||
|
|
||||||
$application->run();
|
$cli->run();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"mnapoli/blackbox": "~0.4.0",
|
"mnapoli/blackbox": "~0.4.0",
|
||||||
"psr/log": "~1.0",
|
"psr/log": "~1.0",
|
||||||
"monolog/monolog": "~1.10",
|
"monolog/monolog": "~1.10",
|
||||||
"stratify/framework": "~0.1.2",
|
"stratify/framework": "~0.3.1",
|
||||||
"stratify/twig-module": "~0.1.1",
|
"stratify/twig-module": "~0.1.1",
|
||||||
"doctrine/annotations": "^1.2"
|
"doctrine/annotations": "^1.2"
|
||||||
},
|
},
|
||||||
|
|||||||
1178
composer.lock
generated
1178
composer.lock
generated
File diff suppressed because it is too large
Load Diff
64
puli.json
64
puli.json
@@ -16,6 +16,10 @@
|
|||||||
"install-path": "vendor/badges/poser",
|
"install-path": "vendor/badges/poser",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"coduo/phpspec-data-provider-extension": {
|
||||||
|
"install-path": "vendor/coduo/phpspec-data-provider-extension",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"container-interop/container-interop": {
|
"container-interop/container-interop": {
|
||||||
"install-path": "vendor/container-interop/container-interop",
|
"install-path": "vendor/container-interop/container-interop",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
@@ -28,6 +32,10 @@
|
|||||||
"install-path": "vendor/doctrine/cache",
|
"install-path": "vendor/doctrine/cache",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"doctrine/instantiator": {
|
||||||
|
"install-path": "vendor/doctrine/instantiator",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"doctrine/lexer": {
|
"doctrine/lexer": {
|
||||||
"install-path": "vendor/doctrine/lexer",
|
"install-path": "vendor/doctrine/lexer",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
@@ -52,14 +60,26 @@
|
|||||||
"install-path": "vendor/mnapoli/blackbox",
|
"install-path": "vendor/mnapoli/blackbox",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"mnapoli/silly": {
|
||||||
|
"install-path": "vendor/mnapoli/silly",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"monolog/monolog": {
|
"monolog/monolog": {
|
||||||
"install-path": "vendor/monolog/monolog",
|
"install-path": "vendor/monolog/monolog",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"paragonie/random_compat": {
|
||||||
|
"install-path": "vendor/paragonie/random_compat",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"php-di/invoker": {
|
"php-di/invoker": {
|
||||||
"install-path": "vendor/php-di/invoker",
|
"install-path": "vendor/php-di/invoker",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"php-di/kernel": {
|
||||||
|
"install-path": "vendor/php-di/kernel",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"php-di/php-di": {
|
"php-di/php-di": {
|
||||||
"install-path": "vendor/php-di/php-di",
|
"install-path": "vendor/php-di/php-di",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
@@ -68,6 +88,30 @@
|
|||||||
"install-path": "vendor/php-di/phpdoc-reader",
|
"install-path": "vendor/php-di/phpdoc-reader",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"phpdocumentor/reflection-common": {
|
||||||
|
"install-path": "vendor/phpdocumentor/reflection-common",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"phpdocumentor/reflection-docblock": {
|
||||||
|
"install-path": "vendor/phpdocumentor/reflection-docblock",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"phpdocumentor/type-resolver": {
|
||||||
|
"install-path": "vendor/phpdocumentor/type-resolver",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"phpspec/php-diff": {
|
||||||
|
"install-path": "vendor/phpspec/php-diff",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"phpspec/phpspec": {
|
||||||
|
"install-path": "vendor/phpspec/phpspec",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"phpspec/prophecy": {
|
||||||
|
"install-path": "vendor/phpspec/prophecy",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"psr/http-message": {
|
"psr/http-message": {
|
||||||
"install-path": "vendor/psr/http-message",
|
"install-path": "vendor/psr/http-message",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
@@ -100,6 +144,22 @@
|
|||||||
"install-path": "vendor/ramsey/uuid",
|
"install-path": "vendor/ramsey/uuid",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"sebastian/comparator": {
|
||||||
|
"install-path": "vendor/sebastian/comparator",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"sebastian/diff": {
|
||||||
|
"install-path": "vendor/sebastian/diff",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"sebastian/exporter": {
|
||||||
|
"install-path": "vendor/sebastian/exporter",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
|
"sebastian/recursion-context": {
|
||||||
|
"install-path": "vendor/sebastian/recursion-context",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"seld/jsonlint": {
|
"seld/jsonlint": {
|
||||||
"install-path": "vendor/seld/jsonlint",
|
"install-path": "vendor/seld/jsonlint",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
@@ -148,6 +208,10 @@
|
|||||||
"install-path": "vendor/symfony/process",
|
"install-path": "vendor/symfony/process",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
},
|
},
|
||||||
|
"symfony/yaml": {
|
||||||
|
"install-path": "vendor/symfony/yaml",
|
||||||
|
"installer": "composer"
|
||||||
|
},
|
||||||
"twig/twig": {
|
"twig/twig": {
|
||||||
"install-path": "vendor/twig/twig",
|
"install-path": "vendor/twig/twig",
|
||||||
"installer": "composer"
|
"installer": "composer"
|
||||||
|
|||||||
28
src/Maintained/Application/Application.php
Normal file
28
src/Maintained/Application/Application.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace Maintained\Application;
|
||||||
|
|
||||||
|
use DI\ContainerBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Matthieu Napoli <matthieu@mnapoli.fr>
|
||||||
|
*/
|
||||||
|
class Application extends \Stratify\Framework\Application
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$modules = [
|
||||||
|
'error-handler',
|
||||||
|
'twig',
|
||||||
|
'app',
|
||||||
|
];
|
||||||
|
|
||||||
|
parent::__construct($modules);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function configureContainerBuilder(ContainerBuilder $containerBuilder)
|
||||||
|
{
|
||||||
|
$containerBuilder->useAnnotations(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use DI\ContainerBuilder;
|
|
||||||
use Maintained\Application\Controller\BadgeController;
|
use Maintained\Application\Controller\BadgeController;
|
||||||
use Maintained\Application\Controller\HomeController;
|
use Maintained\Application\Controller\HomeController;
|
||||||
use Maintained\Application\Controller\ProjectCheckController;
|
use Maintained\Application\Controller\ProjectCheckController;
|
||||||
@@ -19,22 +18,17 @@ if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . preg_replace('#(\?.*)$
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../.puli/GeneratedPuliFactory.php';
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
$modules = [
|
|
||||||
'error-handler',
|
|
||||||
'twig',
|
|
||||||
'app',
|
|
||||||
];
|
|
||||||
|
|
||||||
$http = pipe([
|
$http = pipe([
|
||||||
ErrorHandlerMiddleware::class,
|
ErrorHandlerMiddleware::class,
|
||||||
MaintenanceMiddleware::class,
|
MaintenanceMiddleware::class,
|
||||||
|
|
||||||
router([
|
router([
|
||||||
'/' => route(HomeController::class, 'home'),
|
'/' => route(HomeController::class, 'home'),
|
||||||
'/check/{user}/{repository}' => route(ProjectCheckController::class, 'check-project'),
|
'/check/{user}/{repository}' => route(ProjectCheckController::class, 'check-project'),
|
||||||
'/project/{user}/{repository}' => route(ProjectController::class, 'project'),
|
'/project/{user}/{repository}' => route(ProjectController::class, 'project'),
|
||||||
'/badge/{badge}/{user}/{repository}.svg' => route(BadgeController::class, 'badge'),
|
'/badge/{badge}/{user}/{repository}.svg' => route(BadgeController::class, 'badge'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@@ -42,17 +36,6 @@ $http = pipe([
|
|||||||
Error404Middleware::class,
|
Error404Middleware::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** @var Application $app */
|
$app = new Application;
|
||||||
$app = new class($http, $modules) extends Application
|
|
||||||
{
|
|
||||||
protected function createContainerBuilder(array $modules) : ContainerBuilder
|
|
||||||
{
|
|
||||||
$containerBuilder = parent::createContainerBuilder($modules);
|
|
||||||
$containerBuilder->useAnnotations(true);
|
|
||||||
return $containerBuilder;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ErrorHandler::register($app->getContainer()->get(LoggerInterface::class));
|
ErrorHandler::register($app->getContainer()->get(LoggerInterface::class));
|
||||||
|
$app->http($http)->run();
|
||||||
$app->runHttp();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user