Skip to content

Commit

Permalink
Merge branch 'hotfix/cli' into develop
Browse files Browse the repository at this point in the history
Forward port #9
  • Loading branch information
weierophinney committed Aug 27, 2015
2 parents c466527 + c1371ea commit 329f104
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions bin/mwop.net.php
Expand Up @@ -14,9 +14,7 @@

define('VERSION', '0.0.1');

$config = include 'config/config.php';
$services = new ServiceManager(new Config($config['services']));
$services->setService('Config', $config);
$container = require 'config/services.php';

$routes = [
[
Expand All @@ -31,8 +29,8 @@
'defaults' => [
'output' => 'data/github-links.mustache',
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Github\Console\Fetch');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Github\Console\Fetch');
return $handler($route, $console);
},
],
Expand All @@ -47,8 +45,8 @@
'defaults' => [
'output' => 'data/tag-cloud.mustache',
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Blog\Console\TagCloud');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Blog\Console\TagCloud');
return $handler($route, $console);
},
],
Expand All @@ -65,8 +63,8 @@
'outputDir' => 'data/feeds',
'baseUri' => 'http://mwop.net/blog',
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Blog\Console\FeedGenerator');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Blog\Console\FeedGenerator');
return $handler($route, $console);
},
],
Expand All @@ -83,8 +81,8 @@
'path' => realpath(getcwd()),
'dbPath' => realpath(getcwd()) . '/data/posts.db',
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Blog\Console\SeedBlogDatabase');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Blog\Console\SeedBlogDatabase');
return $handler($route, $console);
},
],
Expand All @@ -99,8 +97,8 @@
'defaults' => [
'path' => realpath(getcwd()),
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Blog\Console\CachePosts');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Blog\Console\CachePosts');
return $handler($route, $console);
},
],
Expand All @@ -113,8 +111,8 @@
'--appId' => 'Zend Server application ID',
'--site' => 'Base URL of site to which to deploy',
],
'handler' => function ($route, $console) use ($services) {
$handler = $services->get('Mwop\Console\PrepPageCacheRules');
'handler' => function ($route, $console) use ($container) {
$handler = $container->get('Mwop\Console\PrepPageCacheRules');
return $handler($route, $console);
},
],
Expand Down

0 comments on commit 329f104

Please sign in to comment.