Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed some errors

  • Loading branch information...
commit f16d2463b9f1a415f8dd1c5a103dc19eacd517d6 1 parent 073ab98
@jessegreathouse jessegreathouse authored
View
11 DependencyInjection/CodeMemeDaemonExtension.php
@@ -6,6 +6,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader;
use CodeMeme\Bundle\CodeMemeDaemonBundle\CodeMemeDaemonBundleException;
@@ -50,7 +51,7 @@ private function getDefaultConfig($name)
'logLocation' => '%kernel.logs_dir%/%kernel.environment%.' . $name . '.daemon.log',
'authorName' => 'CodeMeme',
'authorEmail' => 'symfony2.kernel@127.0.0.1',
- 'appPidLocation' => '%kernel.cache_dir%/'. $name . '/' . $name . '.daemon.pid';
+ 'appPidLocation' => '%kernel.cache_dir%/'. $name . '/' . $name . '.daemon.pid',
'sysMaxExecutionTime' => 0,
'sysMaxInputTime' => 0,
'sysMemoryLimit' => '1024M',
@@ -62,23 +63,23 @@ private function _init($config, $container)
{
//merges each configured daemon with default configs
//and makes sure the pid directory is writable
- $cacheDir = $container->getParameter('kernel.cache_dir') .
+ $cacheDir = $container->getParameter('kernel.cache_dir');
$filesystem = $container->get('codememe.daemon.filesystem');
foreach ($config['daemons'] as $name => $cnf)
{
+ if (NULL == $cnf) $cnf = array();
try {
$filesystem->mkdir($cacheDir . '/'. $name . '/', 0777);
} catch (CodeMemeDaemonBundleException $e) {
echo 'CodeMemeDaemonBundle exception: ', $e->getMessage(), "\n";
}
-
+
$container->setParameter($name.'.daemon.options',
array_merge($this->getDefaultConfig($name), $cnf));
$container->setDefinition($name.'.daemon', new Definition(
$container->getParameter('codememe.daemon.class'),
- $container->getParameter($name.'.daemon.options'),
- ));
+ $container->getParameter($name.'.daemon.options')));
}
}
View
2  Resources/config/daemon.xml
@@ -7,7 +7,7 @@
<parameters>
<parameter key="codememe.daemon.filesystem.class">Symfony\Component\HttpKernel\Util\Filesystem</parameter>
<parameter key="codememe.daemon.class">CodeMeme\Bundle\CodeMemeDaemonBundle\Daemon</parameter>
- <parameter key="example.control.class">CodeMeme\Bundle\CodeMemeDaemonBundle\Service\ExampleControl.php</parameter>
+ <parameter key="example.control.class">CodeMeme\Bundle\CodeMemeDaemonBundle\Service\ExampleControl</parameter>
</parameters>
<services>
Please sign in to comment.
Something went wrong with that request. Please try again.