This is a procedure I write to autoload a ZF1 project into a ZF2 based application, using Apigility as an example.
- PHP 5.4 or higher
- A ZF1 project, I'm using my demo application zfdemo as example
- Composer
- An IDE
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
awk '$9 == 404 {print $7}' ${1} | uniq -c | sort -rn | head |
<?php | |
namespace BMytest; | |
class ZendMailTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testRemovingHeadersFromMultipleMailObjects() | |
{ | |
$mail1 = new \Zend_Mail(); | |
$mail1->addHeader('foo', 'bar'); | |
$mail1->addHeader('x-mfo-mailid', uniqid()); |
<?php | |
namespace GeehNiblett; | |
use Zend\ModuleManager\Feature\AutoloaderProviderInterface; | |
use Zend\ModuleManager\Feature\ConfigProviderInterface; | |
class Module implements AutoloaderProviderInterface, ConfigProviderInterface | |
{ | |
public function init($moduleManager) | |
{ |
````php | |
<?php | |
$phoneNumber = '(202) 555-2041'; | |
$filterPhone = preg_repace('/[^0-9]+/','', $phoneNumber); | |
```` |
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit bootstrap="bootstrap.php" colors="true"> | |
<testsuites> | |
<testsuite name="zf2demo"> | |
<directory>./</directory> | |
</testsuite> | |
</testsuites> | |
<filter> | |
<whitelist> |
phpbook:zf2demo dragonbe$ php composer.phar install --dev | |
Loading composer repositories with package information | |
Installing dependencies | |
- Installing zendframework/zendframework (2.0.2) | |
Downloading: 100% | |
Loading composer repositories with package information | |
Installing dev dependencies | |
Nothing to install or update | |
zendframework/zendframework suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features) |
public function listCdnEndpoints() | |
{ | |
$context = new HttpCallContext(); | |
$context->setMethod(Resources::HTTP_GET); | |
$context->setPath($this->_getCdnEndpointsPath()); | |
$context->addStatusCode(Resources::STATUS_OK); | |
// echo '<pre>' . var_export($context,1) . '</pre>';die; | |
$response = $this->sendContext($context); |
<?php | |
class In2it_View_Helper_GoogleTracker extends Zend_View_Helper_Abstract | |
{ | |
public $view; | |
public function setView(Zend_View_Interface $view) | |
{ | |
return parent::setView($view); | |
} |