Skip to content

Instantly share code, notes, and snippets.

View weierophinney's full-sized avatar
⏯️

Matthew Weier O'Phinney weierophinney

⏯️
View GitHub Profile
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
@weierophinney
weierophinney / gist:1168465
Created August 24, 2011 16:30
Simple parser
$sxl = new SimpleXMLElement($url, 0, true);
$item = $sxl->item[0];
$link = (string) $item->link;
@weierophinney
weierophinney / gist:1348598
Created November 8, 2011 18:13
Prototype of module initialization listener system
<?php
interface Installable
{
public function install();
}
interface Upgradable
{
public function upgrade();
}
interface ConfigProvider
<?php
public function loadModule($moduleName)
{
if (!isset($this->loadedModules[$moduleName])) {
$class = $moduleName . '\Module';
$module = new $class;
$this->runModuleInit($module);
$this->mergeModuleConfig($module);
$this->loadedModules[$moduleName] = $module;
#!/bin/bash
# -------------------------------------------------------------
# Run phpUnit tests for a subset of Zend Framework
# -------------------------------------------------------------
# Author: Enrico Zimuel (enrico@zend.com)
# -------------------------------------------------------------
ZFPATH="/home/matthew/git/zf-standard/tests"
PHP="/home/matthew/svn/phpfarm/inst/bin/php-5.2.17"
PHPUNIT="/home/matthew/Downloads/dev/phpunit-3.4/phpunit/phpunit.php"
Acl/AclTest.php
Amf/AllTests.php
Application/AllTests.php
Auth/AllTests.php
Barcode/AllTests.php
Cache/AllTests.php
Captcha/AllTests.php
CodeGenerator/AllTests.php
Config/AllTests.php
Console/AllTests.php
<?php
array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
@weierophinney
weierophinney / GuestModule.php
Created December 5, 2011 22:34
Example listener for changing layouts
<?php
namespace Guest;
use Zend\EventManager\StaticEventManager;
class Module
{
public function init()
{
$events = StaticEventManager::getInstance();
<?php
if (!($env = getenv('APPLICATION_ENV'))) {
$env = 'local';
}
$glob = glob(__DIR__ . "/config/autoload/config.{global,$env}.php");