_loadProfile(self::NO_PROFILE_THROW_EXCEPTION); $configFileResource = $profile->search('ApplicationConfigFile'); $zc = $configFileResource->getAsZendConfig('production'); if ($zc->appnamespace == $classNamePrefix) { throw new Zend_Tool_Project_Exception('The requested name ' . $classNamePrefix . ' is already the prefix.'); } // remove the old $configFileResource->removeStringItem('appnamespace', 'production'); $configFileResource->create(); // add the new $configFileResource->addStringItem('appnamespace', $classNamePrefix, 'production', true); $configFileResource->create(); // update the project profile $applicationDirectory = $profile->search('ApplicationDirectory'); $applicationDirectory->setClassNamePrefix($classNamePrefix); // note to the user $this->_registry->getResponse()->appendContent('application.ini updated with new appnamespace ' . $classNamePrefix); $this->_registry->getResponse()->appendContent('Note: All existing models will need to be altered to this new namespace by hand', array('color' => 'yellow')); // store profile $this->_storeProfile(); } }