what's the diff:
$application = new Zend_Application(...);
$application->bootstrap()->run();
$application = new Zend_Application(...);
$application->run();
why we need call ->bootstrape then call ->run? why not just call application->run ?
from the Zend Sources class:Zend_Application, file:application.php
public function bootstrap($resource = null)
{
$this->getBootstrap()->bootstrap($resource);
return $this;
}
public function run()
{
$this->getBootstrap()->run();
}
The first sample
$application = new Zend_Application(...);
$application->bootstrap()->run();
calls Zend_Application_Bootstrap_Bootstrap::bootstrap method which ends up loading all the resources.
Then it calls Zend_Application_Bootstrap_Bootstrap::run() which actually dispatches the request.
The second sample
$application = new Zend_Application(...);
$application->run();
according to the code above is skipping the first step, so it will try to run (dispatch the request) without actually loading the resources. This is how Zend describes bootstrapping and resources.