我不跟ZF工具项目的内部足够的熟悉,但看看
AFAIK(这是不是很多)Zend的工具维护一个XML文件来跟踪你的项目。这是后续操作通过Zend Tool正确应用于您的项目所必需的。
的文档块为项目提供了create
动作说:
/**
* create()
*
* @param string $path
* @param string $nameOfProfile shortName=n
* @param string $fileOfProfile shortName=f
*/
如果没有两个可选的参数运行,该方法将最终创建
$newProfile = new Zend_Tool_Project_Profile(array(
'projectDirectory' => $path,
'profileData' => $profileData
));
与$profileDate
一个新的项目文件是默认配置文件的内容。如果您指定$fileOfProfile
,则可以覆盖配置文件并提供自己的文件,例如
if ($fileOfProfile != null && file_exists($fileOfProfile)) {
$profileData = file_get_contents($fileOfProfile);
}
显然,您必须提供文件的完整路径才能工作。另一种方法是提供一个文件标识符,然后Zend Tool将尝试在预定义的位置找到文件标识符。
$storage = $this->_registry->getStorage();
if ($profileData == '' && $nameOfProfile != null && $storage->isEnabled()) {
$profileData = $storage->get('project/profiles/' . $nameOfProfile . '.xml');
}
我不知道存储部分是关于什么。就像我说的,我不熟悉Zend Tool的内部工作。如果我理解正确,则可以使用附加的两个参数来加载新位置中的现有项目或自定义默认项目。
您可能想要浏览ChangeLog以了解更多信息。