예제 #1
0
 /**
  * init()
  *
  * @return \Zend\Tool\Project\Context\Zf\ActionMethod
  */
 public function init()
 {
     $this->_actionName = $this->_resource->getAttribute('actionName');
     $this->_resource->setAppendable(false);
     $this->_controllerResource = $this->_resource->getParentResource();
     if (!$this->_controllerResource->getContext() instanceof ControllerFile) {
         throw new Exception\RuntimeException('ActionMethod must be a sub resource of a ControllerFile');
     }
     // make the ControllerFile node appendable so we can tack on the actionMethod.
     $this->_resource->getParentResource()->setAppendable(true);
     $this->_controllerPath = $this->_controllerResource->getContext()->getPath();
     return $this;
 }
예제 #2
0
 public function getApplicationInstance()
 {
     if ($this->_applicationInstance == null) {
         if ($this->_applicationConfigFile->getContext()->exists()) {
             define('APPLICATION_PATH', $this->_applicationDirectory->getPath());
             $applicationOptions = array();
             $applicationOptions['config'] = $this->_applicationConfigFile->getPath();
             $this->_applicationInstance = new \Zend\Application\Application('development', $applicationOptions);
         }
     }
     return $this->_applicationInstance;
 }