2017 © Pedro Peláez
 

library phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

image

mattdanger/phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

  • Thursday, June 2, 2016
  • by mattdanger
  • Repository
  • 2 Watchers
  • 0 Stars
  • 493 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

phalcon-semaphore

Simple semaphore component for Phalcon PHP, (*1)

Requirements

  • Phalcon v1.4.x

Installation

Install using Composer:, (*2)

{
    "require": {
        "mattdanger/phalcon-semaphore": "1.*"
    }
}

Create a database table semaphore with this schema:, (*3)

CREATE TABLE `semaphore` (
  `name` varchar(255) NOT NULL DEFAULT '',
  `value` varchar(255) DEFAULT NULL,
  `timestamp` datetime DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Then add the service:, (*4)

$di->set('semaphore', '\PhalconSemaphore\Semaphore');

If you want to use a different database table name you can initialize the service like this:, (*5)

$di->set('semaphore', function() use ($config){
  return new \PhalconSemaphore\Semaphore('my_table_name');
}, true);

Usage


$this->semaphore->run(string $class, $string method, int $expiration_hours, array $args); // Example without method parameters $this->semaphore->run('MyNamespace\Models\Stat', 'calculate', 1); // Example with method parameters $this->semaphore->run('MyNamespace\Models\Stat', 'calculate', 1, array($arg1, $arg2, ...));

The Versions

02/06 2016

dev-master

9999999-dev https://github.com/mattdanger/phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

phalcon

02/06 2016

dev-develop

dev-develop https://github.com/mattdanger/phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

phalcon

02/06 2016

v1.1.0

1.1.0.0 https://github.com/mattdanger/phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

phalcon

21/04 2016

v1.0

1.0.0.0 https://github.com/mattdanger/phalcon-semaphore

Simple semaphore component for Phalcon v1.4.x

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

phalcon