PHPackages                             code-meme/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. code-meme/daemon-bundle

ActiveSymfony-bundle

code-meme/daemon-bundle
=======================

Symfony DoctrineBundle

06.6k1PHP

Since Jul 4Pushed 12y ago1 watchersCompare

[ Source](https://github.com/NicParry/CodeMemeDaemonBundle)[ Packagist](https://packagist.org/packages/code-meme/daemon-bundle)[ RSS](/packages/code-meme-daemon-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#CodeMemeDaemonBundle [![project status](https://camo.githubusercontent.com/987f533aa70b9f0da2fcc39fb0e9d6ff895239270056d92753935537ab1e749f/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f436f64654d656d652f436f64654d656d654461656d6f6e42756e646c652e706e67)](https://camo.githubusercontent.com/987f533aa70b9f0da2fcc39fb0e9d6ff895239270056d92753935537ab1e749f/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f436f64654d656d652f436f64654d656d654461656d6f6e42756e646c652e706e67) # ##Overview## CodeMemeDaemonBundle 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## Place CodeMeme\\Daemonbundle in your src directory and do the following:

### Deps

[](#deps)

add the bundle to your deps configuration

```
[CodeMemeDaemonBundle]
    git=http://github.com/CodeMeme/CodeMemeDaemonBundle.git
    target=/bundles/CodeMeme/Bundle/CodeMemeDaemonBundle

```

### autoload.php

[](#autoloadphp)

Add the following to your autoload.php file:

```
$loader->registerNamespaces(array(
    //...
    'CodeMeme'     => __DIR__.'/../vendor/bundles',
));

```

### appKernel.php

[](#appkernelphp)

Add The CodeMemeDaemonBundle to your kernel bootstrap sequence

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

    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.

```
app/config.yml

#CodeMemeDaemonBundle Configuration Example
code_meme_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
            logLocation: %kernel.logs_dir%/%kernel.environment%.example.log
            authorName: Jesse Greathouse
            authorEmail: jesse.greathouse@gmail.com
            appPidLocation: %kernel.cache_dir%/example/example.pid
            sysMaxExecutionTime: 0
            sysMaxInputTime: 0
            sysMemoryLimit: 1024M
            appUser: apache
            appGroup: apache
            appRunAsGID: 1000
            appRunAsUID: 1000

```

#### RunAs

[](#runas)

You can run the daemon as a different user or group depending on what is best for your application. By default it will resolve the user and group of the user who is running the daemon from the command console, but if you want to run as a different user you can use the appUser, appGroup or appRunAsGID, appRunAsUID options. Remember if you need to run as a different user you must start the daemon as sudo or a superuser.

To find out the group and user id of a specific user you can use the following commands.

```
jesse@picard:~/ninethousand.org$ id -u www-data
jesse@picard:~/ninethousand.org$ id -g www-data

```

\##Creating a Daemon## The Following links are examples of how to use a system daemon in an example project

- [Start Command](https://github.com/CodeMeme/CodeMemeDaemonBundle/blob/master/Command/ExampleStartCommand.php)
- [Stop Command](https://github.com/CodeMeme/CodeMemeDaemonBundle/blob/master/Command/ExampleStopCommand.php)
- [Restart Command](https://github.com/CodeMeme/CodeMemeDaemonBundle/blob/master/Command/ExampleRestartCommand.php)
- [Example Service Class](https://github.com/CodeMeme/CodeMemeDaemonBundle/blob/master/Service/ExampleControl.php)
- [Config of Control Service](https://github.com/CodeMeme/CodeMemeDaemonBundle/blob/master/Resources/config/daemon.xml)

\##Usage## Once you have Daemonized your symfony Console Commands, you can simply run them from the command line like so:

```
jesse@picard:~/codememe$ php app/console jobqueue:start

jesse@picard:~/codememe$ php app/console jobqueue:stop

jesse@picard:~/codememe$ php app/console jobqueue:restart

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf637a4a13f8f90f353465beef83db85e927b0050c170eec5fb97ffcc358a98f?d=identicon)[NicParry](/maintainers/NicParry)

---

Top Contributors

[![jessegreathouse](https://avatars.githubusercontent.com/u/439733?v=4)](https://github.com/jessegreathouse "jessegreathouse (13 commits)")[![vatson](https://avatars.githubusercontent.com/u/365720?v=4)](https://github.com/vatson "vatson (2 commits)")[![sgrodzicki](https://avatars.githubusercontent.com/u/712836?v=4)](https://github.com/sgrodzicki "sgrodzicki (1 commits)")

### Embed Badge

![Health badge](/badges/code-meme-daemon-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/code-meme-daemon-bundle/health.svg)](https://phpackages.com/packages/code-meme-daemon-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
