public function onEnvironmentUpdate(BaseEvent $event) { ConfigService::setConfigsPath(DC::getEnvironment()->getConfigRoot()); ConfigService::loadAllConfigs(); DC::getLogger()->setLogsPath(DC::getEnvironment()->getTmpRoot() . 'log'); DC::getAutoloader()->registerSharedPath(DC::getEnvironment()->getUserClassesRoot(), true); DC::getAutoloader()->registerSharedPath(DC::getEnvironment()->getUserClassesRoot() . 'db/bases'); DC::getAutoloader()->registerSharedPath(DC::getEnvironment()->getUserClassesRoot() . 'db/classes'); DC::getAutoloader()->registerNamespaceSharedPaths(DC::getEnvironment()->getUserClassesRoot() . 'classes/', true); FilesAbility::setBaseStoreLocation(DC::getEnvironment()->getUploadRoot()); }
protected static function putTestContent() { QC::executeSQL('SET FOREIGN_KEY_CHECKS = 0'); QC::executeSQL('DROP TABLE IF EXISTS brands'); $storagePath = __DIR__ . '/storage/'; $mo = ModelOperator::getInstance($storagePath); $mo->generateBasicStructure('Brand'); ModelStructure::getInstanceForModel('Brand')->addAbility('files', array('logo' => array('name' => 'original', 'multiple' => true), 'info' => array(), 'avatar' => array('sizes' => array('small' => array('size' => '100x100', 'method' => 'fitOut')))))->saveStructure(); $mo->generateAllModelClasses(); require_once $storagePath . 'bases/BaseBrand.php'; require_once $storagePath . 'classes/Brand.php'; $webRoot = __DIR__ . '/upload/'; FilesAbility::setBaseStoreLocation($webRoot); FSService::setWebRoot($webRoot); FSService::unlinkRecursive($webRoot); $mo->updateDBForAllModels(); }
public function _preAction() { $this->_moduleName = $this->request->getVar('moduleName'); $this->_moduleConfig = AdminService::getStructure($this->_moduleName); FilesAbility::setBaseStoreLocation(DC::getEnvironment()->getWebRoot() . 'upload/'); }