/** * @return string */ protected function _getComposerVendorDir() { $fileComposerJson = new CM_File($this->_dirRoot . 'composer.json'); $cacheKey = CM_CacheConst::ComposerVendorDir; $fileCache = new CM_Cache_Storage_File(); if (false === ($vendorDir = $fileCache->get($cacheKey)) || $fileComposerJson->getModified() > $fileCache->getCreateStamp($cacheKey)) { $vendorDir = rtrim($this->getComposer()->getConfig()->get('vendor-dir'), '/') . '/'; $fileCache->set($cacheKey, $vendorDir); } return $vendorDir; }
/** * @return array */ private function _getModulePaths() { $cacheKey = CM_CacheConst::Modules; $apcCache = new CM_Cache_Storage_Apc(); if (false === ($modulePaths = $apcCache->get($cacheKey))) { $fileCache = new CM_Cache_Storage_File(); $installation = new CM_App_Installation(DIR_ROOT); if ($installation->getUpdateStamp() > $fileCache->getCreateStamp($cacheKey) || false === ($modulePaths = $fileCache->get($cacheKey))) { $modulePaths = $installation->getModulePaths(); $fileCache->set($cacheKey, $modulePaths); } $apcCache->set($cacheKey, $modulePaths); } return $modulePaths; }