This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* IGN Application Module | |
* | |
* @category Application | |
* @package Application_View | |
* @copyright Copyright (c) 2006-2011 IGN Entertainment, Inc. (http://corp.ign.com/) | |
*/ | |
namespace Application\View\Helper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace { | |
require_once 'ZendFramework/library/Zend/Loader/StandardAutoloader.php'; | |
$autoloader = new \Zend\Loader\StandardAutoloader; | |
spl_autoload_register(array($autoloader, 'autoload')); | |
$di = new Zend\Di\Di; | |
$di->configure( | |
new Zend\Di\Configuration( | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in ZF2 project, place this in ./bin directory | |
chdir(dirname(__DIR__)); | |
$zf2Path = (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library'); | |
require_once $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; | |
require_once $zf2Path . '/Zend/Loader/StandardAutoloader.php'; | |
use Zend\Loader\AutoloaderFactory; | |
use Zend\Loader\StandardAutoloader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
// Other component configuration (i.e. router, controller, view_manager | |
'di' => array( | |
'definition' => array( | |
'runtime' => array( | |
'enabled' => false, | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Convert "socalnick.dev.phantom.www.ign.com" or "www.ign.com" to "WwwIgnCom" | |
$filter = new Zend\Filter\FilterChain(array( | |
'filters' => array( | |
array( | |
'name' => 'pregReplace', | |
'options' => array( | |
'match' => '/^(.*phantom\.)?([^:]+)(:\d+)?$/i', | |
'replace' => '$2', | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'view_manager' => array( | |
'display_not_found_reason' => false, | |
'display_exceptions' => false, | |
'doctype' => 'HTML5', | |
'not_found_template' => 'error/404', | |
'exception_template' => 'error/index', | |
'template_map' => array( | |
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('ZF2_PATH', realpath(__DIR__ . '/../vendor/ZendFramework/library')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application; | |
use Zend\ModuleManager\ModuleManager; | |
use Zend\Mvc\ModuleRouteListener; | |
use Zend\Mvc\MvcEvent; | |
class Module | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iron_mq = require('iron_mq'); | |
var imq = new iron_mq.Client(); | |
var queueName = "query_smt"; | |
var queue = imq.queue(queueName); | |
var numMessagesCurrentlyProcessing = 0; | |
process.on( 'SIGINT', function() { | |
var num; | |
console.log( 'Received SIGINT (Crtl-C)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Poller, imq, imqClient, EventEmitter, util; | |
imq = require('iron_mq'); | |
imqClient = new imq.Client(); | |
EventEmitter = require('events').EventEmitter; | |
util = require('util'); | |
Poller = function Poller(queueName) { | |
// setup instance vars | |
this.queueName = queueName; | |
this.queue = imqClient.queue(this.queueName); |