1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 16:46:50 +02:00

CoreImage: API rework

This commit is contained in:
Nick Liu
2020-03-23 22:40:28 -05:00
parent 76bb9f6ad8
commit b425b4e45d
7 changed files with 331 additions and 323 deletions

View File

@@ -14,13 +14,19 @@ class e_file_inspector_sqlphar extends e_file_inspector
private $coreImage;
/**
* e_file_inspector_sqlphar constructor.
* @param $pharFilePath string Absolute path to the file inspector database
*/
public function __construct($pharFilePath = null)
{
if ($pharFilePath === null) $pharFilePath = e_ADMIN . "core_image.php";
Phar::loadPhar($pharFilePath, "core_image.phar");
parent::__construct($pharFilePath);
}
/**
* @inheritDoc
*/
public function loadDatabase()
{
Phar::loadPhar($this->database, "core_image.phar");
$tmpFile = tmpfile();
$tmpFilePath = stream_get_meta_data($tmpFile)['uri'];
$this->copyUrlToResource("phar://core_image.phar/core_image.sqlite", $tmpFile);
@@ -84,7 +90,6 @@ class e_file_inspector_sqlphar extends e_file_inspector
}
/**
* Copy file to destination with low memory footprint
* @param $source string URL of the source