public function loadResources($module, $session = 'development') { $this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION); $applicationConfigResource = $this->_loadedProfile->search('ApplicationConfigFile'); if (!$applicationConfigResource) { throw new Zend_Tool_Project_Exception('A project with an application config file is required to use this provider.'); } $zf = $applicationConfigResource->getAsZendConfig($session); foreach ($zf->resources->multidb as $name => $config) { //$this->_print($name); Zend_Registry::set('db.' . $name, $config); } $optionsAcl = $zf->resources->acl->toArray(); ZendT_Acl::setOptions($optionsAcl); $pathBase = $this->_loadedProfile->getAttribute('projectDirectory'); ZendT_Tool_Crud_MakeResources::make($pathBase, $module); $this->_print('Recursos carregados para o banco de dados'); }
/** * * @param type $pathBase * @param type $module */ public static function make($pathBase, $module) { self::$module = $module; self::$path = $pathBase; $resources = self::getResources(); require_once 'c:/appweb/htdocs/Mais/application/modules/auth/models/Recurso/Crud/Table.php'; require_once 'c:/appweb/htdocs/Mais/application/modules/auth/models/Recurso/Table.php'; $resource = new Auth_Model_Recurso_Table(); $resource->saveByLote($resources); }