PHP Web Server
Some common ones:
<?php | |
/* existing stuffs */ | |
class Module | |
{ | |
/* more existing stuffs */ | |
public function getServiceConfig() | |
{ | |
return array( |
<?php | |
'factories' => array( | |
'My\Service\BankAccount' => function($serviceManager) { | |
$bankAccountService = new My\Service\BankAccount($serviceManager->get('Doctrine\ORM\EntityManager')->getRepository('My\Entity\BankAccount')); | |
return $bankAccountService; | |
}, | |
), |
<?php | |
'logger1' => function ($sm) { | |
$logger = new Zend\Log\Logger(); | |
$writer = new Zend\Log\Writer\Stream(APP_PATH . '/data/logs/app.log'); | |
$formatter = new Zend\Log\Formatter\Simple( | |
'%timestamp% %priorityName% (%priority%): %message%', | |
'd.m.Y H:i:s'); | |
$writer->setFormatter($formatter); | |
$logger->addWriter($writer); |
<?php | |
// Hostname route | |
'front-ent' => array( | |
'type' => 'Hostname', | |
'options' => array( | |
'route' => ':subdomain.' . BASE_DOMAIN, | |
'constrains' => [ | |
'subdomain' => '[a-zA-Z0-9\-]+', | |
], | |
'defaults' => array( |
//Module.php | |
<?php | |
namespace VendorName\LibraryName; | |
class Module | |
{ | |
public function getAutoloaderConfig() | |
{ | |
return array( |