_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path); if ($profile !== false) { require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('A project already exists here'); } $profileData = null; if ($fileOfProfile != null && file_exists($fileOfProfile)) { $profileData = file_get_contents($fileOfProfile); } $storage = $this->_registry->getStorage(); if ($profileData == '' && $nameOfProfile != null && $storage->isEnabled()) { $profileData = $storage->get('project/profiles/' . $nameOfProfile . '.xml'); } if ($profileData == '') { $profileData = $this->_getDefaultProfile(); } $newProfile = new Zend_Tool_Project_Profile(array( 'projectDirectory' => $path, 'profileData' => $profileData )); $newProfile->loadFromData(); $this->_registry->getResponse()->appendContent('Creating project at ' . $path); foreach ($newProfile->getIterator() as $resource) { $resource->create(); } } public function show() { $this->_registry->getResponse()->appendContent('You probably meant to run "show project.info".', array('color' => 'yellow')); } public function showInfo() { $profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE); if (!$profile) { $this->_registry->getResponse()->appendContent('No project found.'); } else { $this->_registry->getResponse()->appendContent('Working with project located at: ' . $profile->getAttribute('projectDirectory')); } } protected function _getDefaultProfile() { $data = << EOS; return $data; } }