feature : crawler fengchao video

This commit is contained in:
Default
2025-05-01 19:46:29 +08:00
parent e3aa99257a
commit 5fdd741c30
9 changed files with 1138 additions and 18 deletions

View File

@@ -10,7 +10,12 @@ use League\Flysystem\Local\LocalFilesystemAdapter;
class StorageCore
{
private static $instance = null;
/**
* Undocumented variable
*
* @var StorageCore
*/
private static $StorageCore = null;
/**
* Undocumented variable
@@ -19,7 +24,6 @@ class StorageCore
*/
private $Filesystem;
/**
* Undocumented variable
*
@@ -27,15 +31,20 @@ class StorageCore
*/
private $Adapter;
/**
* Undocumented variable
*
* @var string
*/
private $strLocationPath;
private function __construct()
{
$arrConfig = config('storage');
// $this->Adapter = new Local(
// $arrConfig['local']['dir']
// );
$this->strLocationPath = rtrim($arrConfig['local']['dir'], '/');
$this->Adapter = new LocalFilesystemAdapter($arrConfig['local']['dir']);
$this->Adapter = new LocalFilesystemAdapter($this->strLocationPath);
$this->Filesystem = new Filesystem($this->Adapter);
}
@@ -47,10 +56,10 @@ class StorageCore
*/
public static function getInstance(): self
{
if (self::$instance == null) {
self::$instance = new self();
if (self::$StorageCore == null) {
self::$StorageCore = new self();
}
return self::$instance;
return self::$StorageCore;
}
public function set($strKey, $strContent)
@@ -101,6 +110,7 @@ class StorageCore
public function getRealPath($strKey): string
{
return $this->Adapter->applyPathPrefix($strKey);
return $this->strLocationPath . $strKey;
// return $this->Adapter->applyPathPrefix($strKey);
}
}