self::INSTALL_TOOL_ENABLE_FILE_LIFETIME) { return true; } return false; } /** * Updates the last modification of the ENABLE_INSTALL_TOOL file */ protected static function extendInstallToolEnableFileLifetime() { $enableFile = self::getInstallToolEnableFilePath(); // Extend the age of the ENABLE_INSTALL_TOOL file by one hour if (is_file($enableFile)) { $couldTouch = @touch($enableFile); if (!$couldTouch) { // If we can't remove the creation method will call us again. if (self::removeInstallToolEnableFile()) { self::createInstallToolEnableFile(); } } } } /** * Returns the path to the INSTALL_TOOL_ENABLE file * * @return string */ protected static function getInstallToolEnableFilePath() { return Environment::getPublicPath() . '/' . self::INSTALL_TOOL_ENABLE_FILE_PATH; } /** * Returns the paths to the FIRST_INSTALL files * * @return array */ protected static function getFirstInstallFilePaths() { $files = array_filter(scandir(Environment::getPublicPath() . '/'), function ($file) { return @is_file(Environment::getPublicPath() . '/' . $file) && preg_match('~^' . self::FIRST_INSTALL_FILE_PATH . '.*~i', $file); }); return $files; } }