/** * Auszuführender Cron-Code */ public function run() { if (!\fpcm\classes\baseconfig::asyncCronjobsEnabled()) { return false; } if (!is_writable(\fpcm\classes\baseconfig::$tempDir)) { trigger_error('Unable to cleanup ' . \fpcm\classes\baseconfig::$tempDir . '! Access denied!'); return false; } $tempFiles = glob(\fpcm\classes\baseconfig::$tempDir . '*'); if (!is_array($tempFiles) || !count($tempFiles)) { return true; } foreach ($tempFiles as $tempFile) { if ($tempFile == \fpcm\classes\baseconfig::$tempDir . 'index.html') { continue; } if (filectime($tempFile) + 3600 * 24 > time()) { continue; } if (is_dir($tempFile)) { \fpcm\model\files\ops::deleteRecursive($tempFile); continue; } unlink($tempFile); } \fpcm\classes\logs::syslogWrite('Temp files cleanup in ' . \fpcm\classes\baseconfig::$tempDir); return true; }
/** * Installer Step 7 */ protected function runStep7() { $res = true; if ($this->afterStepResult) { $res = \fpcm\classes\baseconfig::enableInstaller(false); $res = $res && \fpcm\model\files\ops::deleteRecursive(\fpcm\classes\baseconfig::$dbStructPath); } $this->view->assign('disableInstallerMsg', !$res); $this->view->assign('showNextButton', false); $cache = new \fpcm\classes\cache(); $cache->cleanup(); }
/** * Module deinstallieren, nur wenn deaktiviert * @param array $keys * @return boolean */ public function uninstallModules(array $keys) { $this->cache->cleanup(); $keys = array_intersect($keys, $this->getDisabledInstalledModules()); if (!count($keys)) { return false; } $res = true; foreach ($keys as $key) { $moduleClass = \fpcm\model\abstracts\module::getModuleClassName($key); if (!class_exists($moduleClass)) { continue; } $modObj = new $moduleClass($key, '', ''); if (!is_a($modObj, '\\fpcm\\model\\abstracts\\module')) { continue; } $res = $res && $modObj->runUninstall(); } $res = $res && $this->dbcon->delete($this->table, "(modkey = '" . implode("' OR modkey = '", $keys) . "') AND status = 0"); $lastKey = false; foreach ($keys as $key) { $res = $res && \fpcm\model\files\ops::deleteRecursive(\fpcm\classes\baseconfig::$moduleDir . $key); $lastKey = $key; } if (!$lastKey) { return $res; } $folders = glob(\fpcm\classes\baseconfig::$moduleDir . dirname($lastKey) . '/*', GLOB_ONLYDIR); if (!count($folders)) { $res = $res && \fpcm\model\files\ops::deleteRecursive(\fpcm\classes\baseconfig::$moduleDir . dirname($lastKey)); } return $res; }
/** * Prüfung von Dateisystem-Strukturen * @return bool */ private function checkFilesystem() { if (file_exists(\fpcm\classes\baseconfig::$viewsDir . 'logs/cronjobs.php')) { unlink(\fpcm\classes\baseconfig::$viewsDir . 'logs/cronjobs.php'); } if ($this->checkVersion('3.2.0', '>=')) { return true; } if (is_dir(\fpcm\classes\baseconfig::$dataDir . 'dbstruct')) { \fpcm\model\files\ops::deleteRecursive(\fpcm\classes\baseconfig::$dataDir . 'dbstruct'); } if (is_dir(\fpcm\classes\baseconfig::$dataDir . 'dbstruct')) { \fpcm\model\files\ops::deleteRecursive(\fpcm\classes\baseconfig::$dataDir . 'dbstruct'); } if (file_exists(\fpcm\classes\baseconfig::$jsPath . 'backupmgr.js')) { unlink(\fpcm\classes\baseconfig::$jsPath . 'backupmgr.js'); } $libPath = \fpcm\classes\loader::libGetFilePath('jquery', 'jquery-2.1.4.min.js'); if ($libPath) { unlink($libPath); } return true; }