Skip to content

Instantly share code, notes, and snippets.

View MichaelGooden's full-sized avatar

Michael Gooden MichaelGooden

  • Port Elizabeth, South Africa
View GitHub Profile
<?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(
@MichaelGooden
MichaelGooden / jqm-patch.md
Created June 2, 2012 13:24 — forked from eddiemonge/jqm-patch.md
jQuery Mobile Bug Patching

Tips for jQuery Mobile Bug Patching

Requirements:

PHP Web Server

Some common ones: