diff --git a/bin/console b/bin/console index e97d952..943f50a 100755 --- a/bin/console +++ b/bin/console @@ -5,6 +5,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; use Deblan\Application; use Deblan\ConfigLoader; +use Guzzle\Service\Client; +use Deblan\Helper\LiveCoding; $app = new Application('LiveCoding CLI', '1'); @@ -12,4 +14,9 @@ $app->chdir(__DIR__.'/../'); $app->addCommandsPath('src/Deblan/Command/', 'Deblan\\Command'); $app->loadCommands(); $app->setConfigLoader(new ConfigLoader()); + +$app->getContainer()['livecoding'] = function() use ($app) { + return new LiveCoding($app); +}; + $app->run(); diff --git a/composer.json b/composer.json index 8fbc752..63dc464 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,8 @@ "symfony/finder": "^2.7", "symfony/console": "^2.7", "symfony/yaml": "^2.7", - "symfony/process": "^2.7" + "symfony/process": "^2.7", + "pimple/pimple": "^3.0", + "guzzle/guzzle": "^3.9" } } diff --git a/src/Deblan/Application.php b/src/Deblan/Application.php index 8ed87f0..20c0840 100644 --- a/src/Deblan/Application.php +++ b/src/Deblan/Application.php @@ -6,6 +6,7 @@ use ReflectionClass; use ReflectionException; use Symfony\Component\Console\Application as BaseApplication; use Symfony\Component\Finder\Finder; +use Pimple\Container; /** * Class Application @@ -17,6 +18,8 @@ class Application extends BaseApplication protected $configLoader; + protected $container; + public function addCommandsPath($path, $namespace) { $this->commandsPaths[$path] = trim($namespace, '\\'); @@ -99,4 +102,13 @@ class Application extends BaseApplication { return $this->getConfigLoader()->getConfig()['debug']; } + + public function getContainer() + { + if (null !== $this->container) { + return $this->container; + } + + return $this->container = new Container(); + } }