PHPackages                             uecode/daemon-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uecode/daemon-bundle

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

uecode/daemon-bundle
====================

Symfony2 Daemon Bundle

2.0.1(11y ago)135.5k10MITPHPPHP &gt;=5.3.0

Since Oct 15Pushed 11y ago5 watchersCompare

[ Source](https://github.com/uecode/daemon-bundle)[ Packagist](https://packagist.org/packages/uecode/daemon-bundle)[ Docs](https://github.com/uecode/daemon-bundle)[ RSS](/packages/uecode-daemon-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (8)Used By (0)

\#Uecode DaemonBundle #

DEPRECATED / NO LONGER SUPPORTING
=================================

[](#deprecated--no-longer-supporting)

Its now pretty easy to daemonize php commands using upstart, or init.d. Please use those instead of this, as you will get a lot more support.

\##Overview## DaemonBundle is a wrapper for the PEAR library System\_Daemon which was created by Kevin Vanzonneveld.

This will enable you to install the symfony bundle and easily convert your Symfony2 console scripts into system daemons.

pcntl is required to be configured in your PHP binary to use this. On my Ubuntu server I was able to install pcntl easily with the following command:

```
sudo apt-get install php-5.3-pcntl-zend-server

```

\##System\_Daemon PEAR package## System\_Daemon is a PHP class that allows developers to create their own daemon applications on Linux systems. The class is focussed entirely on creating &amp; spawning standalone daemons

More info at:

- [Blog Article: Create daemons in PHP](http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/)
- [Report Issues](http://pear.php.net/bugs/report.php?package=System_Daemon)
- [Package Statistics](http://pear.php.net/package-stats.php?pid=798&cid=37)
- [Package Home](http://pear.php.net/package/System_Daemon)

\##DaemonBundle Config##

THIS BUNDLE REQUIRES THE Uecode\\Bundle\\UecodeBundle ()

Place Uecode\\Bundle\\Daemonbundle in your src directory and do the following:

### composer.json

[](#composerjson)

```
"uecode/daemon-bundle": "dev-master",

```

### appKernel.php

[](#appkernelphp)

Add The DaemonBundle to your kernel bootstrap sequence

```
public function registerBundles()
{
    $bundles = array(
        //...
        new Uecode\Bundle\DaemonBundle\DaemonBundle(),
    );
    //...

    return $bundles;
}

```

### config.yml

[](#configyml)

By Default, system daemons have a sensible configuration. If you need to change any configuration setting , you could do it by adding this configuration to your project config. Only the values that need to be changed should be added, the bundle extension will merge your daemon configs into its defaults. YOU MUST HAVE AT LEAST THIS PIECE TO WORK

```
app/config.yml

#Uecode DaemonBundle Config
uecode:
    daemon:

```

### config.yml - Extras

[](#configyml---extras)

```
app/config.yml

#UecodeDaemonBundle Configuration Example
uecode:
    daemon:
        daemons:
            #creates a daemon using default options
            example: ~

            #an example of all the available options
            explicitexample:
                appName: example
                appDir: %kernel.root_dir%
                appDescription: Example of how to configure the DaemonBundle
                logDir: %kernel.logs_dir%
                authorName: Aaron Scherer
                authorEmail: aequasi@gmail.com
                appPidDir: %kernel.cache_dir%/daemons/
                sysMaxExecutionTime: 0
                sysMaxInputTime: 0
                sysMemoryLimit: 1024M
                appUser: apache
                appGroup: apache
                appRunAsGID: 1000
                appRunAsUID: 1000

```

\##Creating a Daemon##

\##Code## Make sure you extend \\Uecode\\Bundle\\DaemonBundle\\Command\\ExtendCommand

```
