_resource->getProfile()->search('ApplicationConfigFile'); $applicationDirectory = $this->_resource->getProfile()->search('ApplicationDirectory'); if (($applicationConfigFile === false) || ($applicationDirectory === false)) { throw new Exception('To use the BootstrapFile context, your project requires the use of both the "ApplicationConfigFile" and "ApplicationDirectory" contexts.'); } if ($applicationConfigFile->getContext()->exists()) { define('APPLICATION_PATH', $applicationDirectory->getPath()); $applicationOptions = array(); $applicationOptions['config'] = $applicationConfigFile->getPath(); $this->_applicationInstance = new Zend_Application( 'development', $applicationOptions ); } } /** * getContents() * * @return array */ public function getContents() { $codeGenFile = new Zend_CodeGenerator_Php_File(array( 'classes' => array( new Zend_CodeGenerator_Php_Class(array( 'name' => 'Bootstrap', 'extendedClass' => 'Zend_Application_Bootstrap_Bootstrap', )), ) )); return $codeGenFile->generate(); } }