getArchivePath()); } return $fileHash; } /** * * @return bool|string false if fail */ public static function getPackageArchivePath() { static $archivePath = null; if (is_null($archivePath)) { $path = DUPX_INIT . '/' . InstDescMng::getInstance()->getName(InstDescMng::TYPE_ARCHIVE_CONFIG); if (!file_exists($path)) { throw new Exception('PACKAGE ERROR: can\'t read package path: ' . $path); } else { $archivePath = $path; } } return $archivePath; } /** * Returns a save-to-edit wp-config file * * @return string */ public static function getWpconfigArkPath() { return InstallerOrigFileMng::getInstance()->getEntryStoredPath(ServerConfigs::CONFIG_ORIG_FILE_WPCONFIG_ID); } /** * * @return string */ public static function getManualExtractFile(): string { return DUPX_INIT . '/' . InstDescMng::getInstance()->getName(InstDescMng::TYPE_MANUAL_EXTRACT); } /** * * @return string */ public static function getWpconfigSamplePath() { static $path = null; if (is_null($path)) { $path = DUPX_INIT . '/assets/wp-config-sample.php'; } return $path; } /** * Get path to directory with SQL dump files * * @return string */ public static function getSqlDumpDirPath() { static $path = null; if (is_null($path)) { $path = DUPX_INIT . '/' . dirname(InstDescMng::getInstance()->getName(InstDescMng::TYPE_DB_DUMP)); } return $path; } /** * * @return string */ public static function getIndexPath() { static $path = null; if (is_null($path)) { $path = DUPX_INIT . '/' . InstDescMng::getInstance()->getName(InstDescMng::TYPE_INDEX); } return $path; } /** * * @return string */ public static function getScanJsonPath() { static $path = null; if (is_null($path)) { $path = DUPX_INIT . '/' . InstDescMng::getInstance()->getName(InstDescMng::TYPE_SCAN); } return $path; } /** * Returns the index manager * * @return FileIndexManager */ public static function getIndexManager() { static $indexManager = null; if (is_null($indexManager)) { $indexManager = new FileIndexManager(self::getIndexPath()); } return $indexManager; } }