protected function postEventsActions(array $executed_events_ids, $queue_name) { $this->site_cache->restoreOwnership(); // Since generating aliases may be costly, do it only once everything else is processed if ($this->backend_aliases->aliasesNeedUpdate()) { $this->backend_aliases->update(); } // Update CVS root allow file once everything else is processed if ($this->backend_cvs->getCVSRootListNeedUpdate()) { $this->backend_cvs->CVSRootListUpdate(); } // Update SVN root definition for Apache once everything else is processed if ($this->backend_svn->getSVNApacheConfNeedUpdate()) { $this->backend_svn->generateSVNApacheConf(); // Need to refresh apache (graceful) system('/sbin/service httpd graceful'); } // Update system user and group caches once everything else is processed if ($this->backend_system->getNeedRefreshUserCache()) { $this->backend_system->refreshUserCache(); } if ($this->backend_system->getNeedRefreshGroupCache()) { $this->backend_system->refreshGroupCache(); } $this->triggerApplicationOwnerEventsProcessing(); }
private function userHomeSanityCheck(BackendSystem $backend_system) { $dao = new UserDao(); $users = $dao->searchByStatus(array(PFUser::STATUS_ACTIVE, PFUser::STATUS_RESTRICTED))->instanciateWith(array(UserManager::instance(), 'getUserInstanceFromRow')); foreach ($users as $user) { $backend_system->userHomeSanityCheck($user); } }
/** * Return a BackendSystem instance * * Let plugins propose their own backend. If none provided, use the default one. * * @return BackendSystem */ public static function getSystem() { $backend = null; $params = array('backend' => &$backend); EventManager::instance()->processEvent('backend_factory_get_system', $params); if ($backend === null) { $backend = BackendSystem::instance(); } return $backend; }
public function setUp() { parent::setUp(); ForgeConfig::store(); ForgeConfig::set('sys_http_user', 'codendiadm'); $this->plugin = stub('Plugin')->getServiceShortname()->returns('docman'); $this->retriever = mock('Docman_SystemCheckProjectRetriever'); $logger = mock('BackendLogger'); $backend = BackendSystem::instance(); $this->root_dir_path = dirname(__FILE__) . '/_fixtures/'; $plugin_info = stub('DocmanPluginInfo')->getPropertyValueForName('docman_root')->returns($this->root_dir_path); stub($this->plugin)->getPluginInfo()->returns($plugin_info); $this->system_check = new Docman_SystemCheck($this->plugin, $this->retriever, $backend, $logger); }
/** * Physically move one file from release area to staging * * The file is renamed during the move with its file id to avoid override * if someone upload and delete 2 times (or more) the same file in the same * release * * @param FRSFile $file * @param BackendSystem $backend * * @return Boolean */ public function moveDeletedFileToStagingArea($file, $backend) { $stagingPath = $this->getStagingPath($file); $stagingDir = dirname($stagingPath); $moveStatus = true; $dao = $this->_getFRSFileDao(); if (!is_dir($stagingDir)) { $moveStatus = mkdir($stagingDir, 0750, true); } $moveStatus = $dao->setFileInDeletedList($file->getFileId()) && $moveStatus; if (file_exists($file->getFileLocation())) { $moveStatus = rename($file->getFileLocation(), $stagingPath) && $moveStatus; } else { $dao->setPurgeDate($file->getFileId(), $_SERVER['REQUEST_TIME']); $backend->log("File " . $file->getFileLocation() . "(" . $file->getFileID() . ") doesn't exist. It cannot be moved to staging area. Marked as purged", Backend::LOG_WARNING); $moveStatus = false; } if (!$moveStatus) { $backend->log("Error while moving file " . $file->getFileLocation() . "(" . $file->getFileID() . ") to staging area", Backend::LOG_ERROR); } if (!$this->deleteEmptyReleaseDirectory($file, $backend)) { $moveStatus = false; } return $moveStatus; }
function testConstructor() { $backend = BackendSystem::instance(); }
public function proccess_system_check($params) { $docman_system_check = new Docman_SystemCheck($this, new Docman_SystemCheckProjectRetriever(new Docman_SystemCheckDao()), BackendSystem::instance(), $params['logger']); $docman_system_check->process(); }