roave / zf2-for-1 Goto Github PK
View Code? Open in Web Editor NEWEnables using Zend Framework 2 features in a Zend Framework 1 application.
License: BSD 2-Clause "Simplified" License
Enables using Zend Framework 2 features in a Zend Framework 1 application.
License: BSD 2-Clause "Simplified" License
The basic features mention
What if my ZF2 modules don't need this? I thought about bootstrapping zf2 first and all remaining resources only in the case that it makes a fallback to ZF1. To do that i had to make some modifications.
index.php
$application->bootstrap('Zf2')->run();
\Zf2for1_Resource_Zf2 called a blank bootstrap()
before the fallback, based on a triggered zf2 event.
public function onBootstrap()
{
return;
}
\Zf2for1\Application\Zf2Bootstrap so i put it into the other event (and also moved the part with the frontcontroller).
public function run()
{
$application = $this->getResource('zf2');
$config = $application->getServiceManager()->get('Config');
if ($config['zf2_for_1']['silent_zf1_fallback'] === true) {
$application->getEventManager()->attach('zf1', array($this, 'parentRun'));
}
return $application->run();
}
public function parentRun($event)
{
$this->bootstrap();
$front = $this->getResource('frontcontroller');
$front->setParam('bootstrap', $this);
return Zend_Application_Bootstrap_Bootstrap::run();
}
I guess now even if a ZF2 module would need ZF1 resources it could just chain the call bootstrap('X')->getResource('X')
while ZF1 modules can work as they were.
Any good reasons against this?
CLI integration in fallback mode needs to be investigated
Current fallback setup disables
Hi simple clone it and configure well. While running , it will through exception.
Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "error"; resolver could not resolve to a file' in /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:499 Stack trace: #0 /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/View/View.php(205): Zend\View\Renderer\PhpRenderer->render(Object(Zend\View\Model\ViewModel)) #1 /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/View/View.php(233): Zend\View\View->render(Object(Zend\View\Model\ViewModel)) #2 /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/View/View.php(198): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel)) #3 /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php(102): Zend\View\View->render(Object(Zend\View\Model\ViewModel)) #4 [internal function]: Zend\Mvc\View in /var/www/zf2-for-1-example/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php on line 499
How do i resolve this?.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.