2017 © Pedro Peláez
 

library zf2-php-resque

PHP Resque Worker in zf2

image

saurabhaec/zf2-php-resque

PHP Resque Worker in zf2

  • Friday, September 11, 2015
  • by saurabhaec
  • Repository
  • 1 Watchers
  • 2 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ZF2 PHP Resque Worker in zf2

Dependency, (*1)

  1. redis server

Instalation, (*2)

  1. move file resquezf2.global.php.dist from config folder to globle config folder and rename file to resquezf2.global.php
  2. add Resquezf2 in application.config.php file at moduel section to load this moudle.
  3. load Resque Library; add this line to your module.php
    require_once APPLICATION_PATH."/module/Resquezf2/src/Resquezf2/vendor/autoload.php";
  4. if you are useing BjyAuthorize moduel then add this line to your moduel.php to desable its for commond line rout
        $request = $e->getTarget()->getServiceManager()->get('Request'); 
            if ($request instanceof ConsoleRequest) {
                //throw new RuntimeException('You can only use this action from a console!');
                // console desable BjyAuthorize
            }else{
    
                //bjyauthorise navigation
                $authorize = $e->getTarget()->getServiceManager()->get('BjyAuthorizeServiceAuthorize');
                $acl = $authorize->getAcl();
                $role = $authorize->getIdentity();  
    
                // var_dump($acl , $role); exit();
                $parentRoles = $authorize->getIdentityProvider()->getIdentityRoles(); 
                \Zend\View\Helper\Navigation::setDefaultAcl($acl);
                \Zend\View\Helper\Navigation::setDefaultRole($role); 
    
            }
          
    otherwise skip this .
  5. run worker in commond line
    php public/index.php run-worker
  6. #Add job in queue
    \Resque::setBackend('localhost:6379'); 
    
    $args = array( ); 
    \Resque::enqueue('zf2-php-resque', 'Resquezf2\Model\Job', $args );
    
  7. you can also create your own class in model location.

The Versions

11/09 2015

dev-master

9999999-dev https://github.com/saurabhaec/zf2-php-resque

PHP Resque Worker in zf2

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3

 

zf2