2017 © Pedro Peláez
 

library common-console-commands

Some common symfony console commands

image

centralapps/common-console-commands

Some common symfony console commands

  • Saturday, March 1, 2014
  • by mkpeacock
  • Repository
  • 1 Watchers
  • 0 Stars
  • 472 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Common Symfony Console Commands

This package provides some useful beanstalk related commands for a symfony console., (*1)

Included commands are:, (*2)

  • Delete beanstalk job (top of the queue is deleted)
  • Flush a tube
  • List tubes
  • Peek ready a tube
  • Get stats on a tube

Each command extends the AbstractPheanstalkCommand class, which provides a method for getting pheanstalk and setting a dependency injection container. Pheanstalk needs to be within an array or contained such as Pimple which implements \ArrayAccess with the key on pheanstalk., (*3)

Installation

Add the following to your composer.json file, (*4)

"centralapps/common-console-commands": "dev-master"

Install / update composer., (*5)

Setup

Create a console file within your application; you need to provide a setup pheanstalk object connected to your beanstalkd service., (*6)

#!/usr/bin/env php
<?php

require_once(__DIR__.'/vendor/autoload.php');
$container = array(
    'pheanstalk' => PHEANSTALK_GOES_HERE
);

$cli_application = new \Symfony\Component\Console\Application();

$commands = array(
    '\CentralApps\Commands\PheanstalkStatsCommand',
    '\CentralApps\Commands\PheanstalkListCommand',
    '\CentralApps\Commands\PheanstalkPeekReadyCommand',
    '\CentralApps\Commands\PheanstalkDeleteCommand',
    '\CentralApps\Commands\PheanstalkFlushCommand'
);

foreach ($commands as $command) {
    $command = new $command();

    if ($command instanceof \CentralApps\Commands\AcceptsContainerInterface) {
        $command->setContainer($container);
    }

    $cli_application->add($command);
}

$cli_application->run();

Usage

php console pheanstlk:list

The Versions

01/03 2014

dev-master

9999999-dev

Some common symfony console commands

  Sources   Download

MIT

The Requires

 

console commands pheanstalk

04/12 2013

v1.0

1.0.0.0

Some common symfony console commands

  Sources   Download

MIT

The Requires

 

console commands pheanstalk