/** * init() * * @return Zend_Tool_Project_Context_Zf_TestLibraryFile */ public function init() { $this->_forClassName = $this->_resource->getAttribute('forClassName'); $this->_filesystemName = ucfirst(ltrim(strrchr($this->_forClassName, '_'), '_')) . 'Test.php'; parent::init(); return $this; }
/** * init() * * @return Zend_Tool_Project_Context_Zf_TestApplicationControllerFile */ public function init() { $this->_forControllerName = $this->_resource->getAttribute('forControllerName'); $this->_filesystemName = ucfirst($this->_forControllerName) . 'ControllerTest.php'; parent::init(); return $this; }
/** * init() * */ public function init() { $this->_formName = $this->_resource->getAttribute('formName'); $this->_moduleName = $this->_resource->getAttribute('moduleName'); $this->_filesystemName = ucfirst($this->_formName) . '.php'; parent::init(); }
public function init() { parent::init(); $this->_applicationConfigFile = $this->_resource->getProfile()->search('ApplicationConfigFile'); $this->_applicationDirectory = $this->_resource->getProfile()->search('ApplicationDirectory'); if ($this->_applicationConfigFile === false || $this->_applicationDirectory === false) { throw new Exception('To use the BootstrapFile context, your project requires the use of both the "ApplicationConfigFile" and "ApplicationDirectory" contexts.'); } }
/** * init() is called after resources have been assembled, this effectively * gives a "resource" within a project a "context" to operate under. */ public function init() { $this->_modelName = $this->_resource->getAttribute('modelName'); $this->_moduleName = $this->_resource->getAttribute('moduleName'); $this->_adapter = $this->_resource->getAttribute('adapter'); $this->_tableName = $this->_resource->getAttribute('tableName'); $this->_filesystemName = ucfirst($this->_modelName) . '.php'; parent::init(); }
public function init() { if (null === $this->_migrationName) { list($sec, $msec) = explode(".", microtime(true)); $this->_migrationName = date('Ymd_His_') . sprintf("%02d", $msec); } $this->_filesystemName = $this->_migrationName . '.php'; parent::init(); }
/** * init() * * @return Zend_Tool_Project_Context_Zf_ViewScriptFile */ public function init() { if ($layoutName = $this->_resource->getAttribute('layoutName')) { $this->_layoutName = $layoutName; } else { throw new Exception('Either a forActionName or scriptName is required.'); } parent::init(); return $this; }
/** * init() * * @return Zend_Tool_Project_Context_Zf_ProjectProviderFile */ public function init() { $this->_projectProviderName = $this->_resource->getAttribute('projectProviderName'); $this->_actionNames = $this->_resource->getAttribute('actionNames'); $this->_filesystemName = ucfirst($this->_projectProviderName) . 'Provider.php'; if (strpos($this->_actionNames, ',')) { $this->_actionNames = explode(',', $this->_actionNames); } else { $this->_actionNames = $this->_actionNames ? array($this->_actionNames) : array(); } parent::init(); return $this; }
/** * init() * * @return Zend_Tool_Project_Context_Zf_ViewScriptFile */ public function init() { if ($forActionName = $this->_resource->getAttribute('forActionName')) { $this->_forActionName = $forActionName; $this->_filesystemName = $this->_convertActionNameToFilesystemName($forActionName) . '.phtml'; } elseif ($scriptName = $this->_resource->getAttribute('scriptName')) { $this->_scriptName = $scriptName; $this->_filesystemName = $scriptName . '.phtml'; } else { throw new Exception('Either a forActionName or scriptName is required.'); } parent::init(); return $this; }
public function init() { parent::init(); $applicationConfigFile = $this->_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); } }
/** * save() * * Proxy to create * * @return Zend_Tool_Project_Context_System_ProjectProfileFile */ public function save() { parent::create(); return $this; }
/** * init() * * @return Zend_Tool_Project_Context_Zf_ApplicationConfigFile */ public function init() { $this->_type = $this->_resource->getAttribute('type'); parent::init(); return $this; }
/** * init() * */ public function init() { $this->_version = $this->_resource->getAttribute('version'); parent::init(); }
/** * init() * */ public function init() { $this->_className = $this->_resource->getAttribute('name') ? $this->_resource->getAttribute('name') : $this->_filesystemName; $this->_filesystemName = ucfirst($this->_className) . '.php'; parent::init(); }
/** * Initialize * * @return Zend_Tool_Project_Context_Zf_ControllerFile */ public function init() { parent::init(); $this->setFilesystemName($this->_resource->getAttribute('fileName') . '.php'); return $this; }
public static function copyFileContent(Zend_Tool_Project_Context_Filesystem_File $resource) { $path = realpath(__DIR__ . '/templates/project') . '/'; if ($resource->getResource()->getAttribute('sourceName')) { $template = $resource->getResource()->getAttribute('sourceName'); } else { $template = $resource->getResource()->getAttribute('filesystemName'); } /** @noinspection PhpToStringImplementationInspection */ if (Dfi_File::isReadable($path . $template)) { return file_get_contents($path . $template); } else { throw new ZFscaffold_ZfTool_Exception('template defined but not found: ' . $template, self::MSG_ERROR); } }