Download the PHP package uecode/daemon-bundle without Composer

On this page you can find all versions of the php package uecode/daemon-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package daemon-bundle

Uecode DaemonBundle

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 & spawning standalone daemons

More info at:

DaemonBundle Config

THIS BUNDLE REQUIRES THE Uecode\Bundle\UecodeBundle (https://github.com/uecode/uecode-bundle)

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

composer.json

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

appKernel.php

Add The DaemonBundle to your kernel bootstrap sequence

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

    return $bundles;
}

config.yml

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

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: [email protected]
                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

<?php
namespace Uecode\Bundle\DaemonBundle\Command;

use \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use \Symfony\Component\Console\Input\InputInterface;
use \Symfony\Component\Console\Input\ArrayInput;
use \Symfony\Component\Console\Output\OutputInterface;
use \Symfony\Component\DependencyInjection\Container;

use \Uecode\Bundle\DaemonBundle\System\Daemon\Exception;
use \Uecode\Bundle\DaemonBundle\Service\DaemonService;

/**
 * Example Command class
 */
class ExampleCommand extends ExtendCommand
{
    /**
     * Configures the Command
     */
    protected function configure()
    {
        $this
            ->setName( 'example' )
            ->setDescription( 'Starts an example Daemon' )
            ->setHelp( 'Usage: <info>php app/console example start|stop|restart</info>' )
            ->addArgument( 'method', InputArgument::REQUIRED, 'start|stop|restart' );
    }

    /**
     * Sample Daemon Logic. Logs `Daemon is running!` every 5 seconds
     * @param \Symfony\Component\Console\Input\InputInterface   $input
     * @param \Symfony\Component\Console\Output\OutputInterface $output
     */
    protected function daemonLogic( InputInterface $input, OutputInterface $output )
    {
        // Do a little logging
        $this->container->get( 'logger' )->info( 'Daemon is running!' );
        // And then sleep for 5 seconds
        $this->daemon->iterate( 5 );
    }
}

Usage

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

aequasi@ue:~/example$ php app/console queue:start

aequasi@ue:~/example$ php app/console queue:stop

aequasi@ue:~/example$ php app/console queue:restart

Bitdeli Badge


All versions of daemon-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-json Version *
uecode/daemon Version ~1.0.2
uecode/uecode-bundle Version ~1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package uecode/daemon-bundle contains the following files

Loading the files please wait ....