public function indexAction() { // TBD // List all objects? $pheanstalkClassRoot = APPLICATION_PATH . '/../contrib/Pheanstalk'; require_once $pheanstalkClassRoot . '/Pheanstalk/ClassLoader.php'; Pheanstalk_ClassLoader::register($pheanstalkClassRoot); $pheanstalk = new Pheanstalk('nurgle.nl'); $id = $pheanstalk->usetube('testtube')->put('stop'); print $id; exit; /* while($job = $pheanstalk->watch('testtube')->ignore('default')->reserve()) { echo " -- " . $job->getData() . "\n"; $pheanstalk->delete($job); } */ exit; /* $this->getResponse()->setHttpResponseCode(400); $data = array( 'code' => self::ERRNO_NO_ID, 'message' => self::ERRMSG_NO_ID, ); $this->_helper->json($data); */ }
// force classname to lowercase ... make sure we are standardizing it. $class = strtolower($classname); // load the gaia namespaced classes. if (substr($class, 0, 5) == 'gaia\\') { return include $gaia_path . strtr($class, '\\', '/') . '.php'; } // load facebook related classes. if ($class == 'facebook') { return @(include 'phar://' . __DIR__ . '/vendor/facebook.phar/facebook.php'); } if ($class == 'basefacebook') { return @(include 'phar://' . __DIR__ . '/vendor/facebook.phar/base_facebook.php'); } // load yaml vendor classes if ($class == 'sfyaml') { return @(include 'phar://' . __DIR__ . '/vendor/sfyaml.phar/sfYaml.php'); } // load pheanstalk if ($class == 'pheanstalk') { $base = 'phar://' . __DIR__ . '/vendor/pheanstalk.phar'; include $base . '/Pheanstalk/ClassLoader.php'; Pheanstalk_ClassLoader::register($base); include $base . '/Pheanstalk.php'; } // load predis namespaced classes. if (substr($class, 0, 7) == 'predis\\') { return include 'phar://' . __DIR__ . '/vendor/predis.phar/' . strtr($classname, '\\', '/') . '.php'; } // all done. }); });
<?php /** * @link https://github.com/ptrofimov/beanstalk_console * @link http://kr.github.com/beanstalkd/ * @author Petr Trofimov, Sergey Lysenko */ function __autoload($class) { require_once str_replace('_', '/', $class) . '.php'; } session_start(); require_once 'Pheanstalk/ClassLoader.php'; Pheanstalk_ClassLoader::register(dirname(__FILE__)); require_once 'BeanstalkInterface.class.php'; require_once dirname(__FILE__) . '/../config.php'; require_once dirname(__FILE__) . '/../src/Storage.php'; $GLOBALS['server'] = !empty($_GET['server']) ? $_GET['server'] : ''; $GLOBALS['action'] = !empty($_GET['action']) ? $_GET['action'] : ''; $GLOBALS['state'] = !empty($_GET['state']) ? $_GET['state'] : ''; $GLOBALS['count'] = !empty($_GET['count']) ? $_GET['count'] : ''; $GLOBALS['tube'] = !empty($_GET['tube']) ? $_GET['tube'] : ''; $GLOBALS['tplMain'] = !empty($_GET['tplMain']) ? $_GET['tplMain'] : ''; $GLOBALS['tplBlock'] = !empty($_GET['tplBlock']) ? $_GET['tplBlock'] : ''; class Console { public $interface; protected $_tplVars = array(); protected $_globalVar = array(); protected $_errors = array(); private $serversConfig = array();
<?php defined('SYSPATH') or die('No direct script access.'); // Load Zend's Autoloader if ($path = Kohana::find_file('vendor', 'pheanstalk/classes/Pheanstalk')) { ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname($path)); require_once "Pheanstalk/ClassLoader.php"; Pheanstalk_ClassLoader::register(dirname($path)); }
<?php /** * Pheanstalk init script. * Sets up include paths based on the directory this file is in. * Registers an SPL class autoload function. * * @author Paul Annesley * @package Pheanstalk * @licence http://www.opensource.org/licenses/mit-license.php */ $pheanstalkClassRoot = dirname(__FILE__) . '/classes'; require_once $pheanstalkClassRoot . '/Pheanstalk/ClassLoader.php'; Pheanstalk_ClassLoader::register($pheanstalkClassRoot);
/** * Carga bibliotecas de pheanstalk */ function _inicializa_pheanstalk() { $pheanstalkClassRoot = getcwd() . '/' . APPPATH . 'libraries/pheanstalk/classes'; require_once $pheanstalkClassRoot . '/Pheanstalk/ClassLoader.php'; Pheanstalk_ClassLoader::register($pheanstalkClassRoot); }