mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 18:14:26 +02:00
Restored JSON core image generator for performance
PDO SQLite was performing unacceptably poorly. Let's just load the entire integrity image into RAM…
This commit is contained in:
@@ -12,10 +12,6 @@ require_once("e_file_inspector.php");
|
||||
class e_file_inspector_sqlphar extends e_file_inspector
|
||||
{
|
||||
private $coreImage;
|
||||
private $currentVersion;
|
||||
|
||||
private $defaultDirsCache;
|
||||
private $customDirsCache;
|
||||
|
||||
/**
|
||||
* e_file_inspector_sqlphar constructor.
|
||||
@@ -87,26 +83,7 @@ class e_file_inspector_sqlphar extends e_file_inspector
|
||||
return $this->currentVersion = $statement->fetchColumn();
|
||||
}
|
||||
|
||||
private function pathToDefaultPath($path)
|
||||
{
|
||||
if (!$this->customDirsCache)
|
||||
{
|
||||
$this->defaultDirsCache = e107::getInstance()->defaultDirs();
|
||||
$customDirs = e107::getInstance()->e107_dirs ? e107::getInstance()->e107_dirs : [];
|
||||
$this->customDirsCache = array_diff_assoc($customDirs, $this->defaultDirsCache);
|
||||
}
|
||||
foreach ($this->customDirsCache as $dirType => $customDir)
|
||||
{
|
||||
if (!isset($this->defaultDirsCache[$dirType])) continue;
|
||||
|
||||
$defaultDir = $this->defaultDirsCache[$dirType];
|
||||
if ($customDir === $defaultDir) continue;
|
||||
|
||||
if (substr($path, 0, strlen($customDir)) === $customDir)
|
||||
$path = $defaultDir . substr($path, strlen($customDir));
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy file to destination with low memory footprint
|
||||
|
Reference in New Issue
Block a user