Configure nginx with HTTP JavaScript module using the --add-module option:
./configure --add-module=<path-to-njs>/nginx
Alternatively, you can build a dynamic version of the njs module
./configure --add-dynamic-module=<path-to-njs>/nginx
| <?php | |
| return array( | |
| 'modules' => array( | |
| 'Application', | |
| /* ... */ | |
| ), | |
| 'module_listeners' => array( | |
| 'use_defaults' => true, /* false to disable them */ | |
| /* list additional module listeners to use here */ |
| <?php | |
| use Zend\EventManager\StaticEventManager; | |
| use Zend\Mvc\MvcEvent; | |
| use Locale; | |
| $events = StaticEventManager::getInstance(); | |
| $events->attach('Zend\Mvc\Application', 'route', function(MvcEvent $event){ | |
| $request = $event->getRequest(); | |
| $uri = $request->uri(); | |
| $baseUrlLength = strlen($request->getBaseUrl() ?: ''); |
| <?php | |
| return array ( | |
| 'Zend\\EventManager\\EventManager' => | |
| array ( | |
| 'instantiator' => | |
| array ( | |
| 'name' => NULL, | |
| 'parameters' => | |
| array ( | |
| 0 => |
| <?php | |
| namespace Application\Dic; | |
| use Zend\Di\Di; | |
| class Compiled extends Di | |
| { | |
| public function newInstance($name, array $params = array(), $isShared = true) |
| // zend framework è in /var/www/lib/Zend mentre il file che contiene l'autoloader è nella root | |
| <?php | |
| // Setting include_path to add library to included dirs | |
| set_include_path(realpath(__DIR__ . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR .'Zend'.DIRECTORY_SEPARATOR. 'library') . PATH_SEPARATOR . get_include_path()); | |
| // Initializing autoloader | |
| require_once 'Zend/Loader/Autoloader.php'; | |
| Zend_Loader_Autoloader::getInstance(); | |
| $dbh = new PDO('pgsql:user=garbezzano password=*a571992g* host=127.0.0.1 dbname=dbstrumenti'); | |
| ?> |
| The following tasks need to be done to finish the i18n component: | |
| ------------------------------------------------------------------------------ | |
| To finish translator: | |
| - Add Xliff translation loader with plural support if possible, see: | |
| https://wiki.oasis-open.org/xliff/XLIFF2.0/Feature/Plural%20Entries | |
| - Add Tmx translation loader (identify if plural support is available) | |
| - Complete unit tests | |
| ------------------------------------------------------------------------------ |
| <?php | |
| /** | |
| * @author Marco Pivetta <ocramius@gmail.com> | |
| */ | |
| class LazyLoadableObject | |
| { | |
| public $publicIdentifierField; | |
| protected $protectedIdentifierField; |
Configure nginx with HTTP JavaScript module using the --add-module option:
./configure --add-module=<path-to-njs>/nginx
Alternatively, you can build a dynamic version of the njs module
./configure --add-dynamic-module=<path-to-njs>/nginx
| <?php | |
| class ColorCLI { | |
| static $foreground_colors = array( | |
| 'bold' => '1', 'dim' => '2', | |
| 'black' => '0;30', 'dark_gray' => '1;30', | |
| 'blue' => '0;34', 'light_blue' => '1;34', | |
| 'green' => '0;32', 'light_green' => '1;32', | |
| 'cyan' => '0;36', 'light_cyan' => '1;36', |
| // This list of common devices was put together from various online sources by me, Jan Keromnes. | |
| // | |
| // The device features are: | |
| // - name: The device brand and model(s). | |
| // - width: The viewport width. | |
| // - height: The viewport height. | |
| // - pixelRatio: The screen's pixel ratio (e.g. HiDPI > 1). | |
| // - userAgent: The device's UserAgent string on the web. | |
| // - touch: Whether the device's screen is touch-enabled. | |
| // |