mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-08 22:07:56 +00:00
update local snap storage paths
This commit is contained in:
parent
375a94a510
commit
efc66d5dab
@ -38,7 +38,7 @@ sphinxsearch
|
|||||||
* Deploy the database using [MySQL Workbench](https://www.mysql.com/products/workbench) project presented in the `/database` folder
|
* Deploy the database using [MySQL Workbench](https://www.mysql.com/products/workbench) project presented in the `/database` folder
|
||||||
* Install [Sphinx Search Server](https://sphinxsearch.com)
|
* Install [Sphinx Search Server](https://sphinxsearch.com)
|
||||||
* Configuration examples are placed at `/config` folder
|
* Configuration examples are placed at `/config` folder
|
||||||
* Make sure `/storage`, `/public/storage` folders writable
|
* Make sure `/storage`, `/public/snap` folders writable
|
||||||
* Set up the `/crontab` scripts by following [example](https://github.com/YGGverse/YGGo/blob/main/config/crontab.txt)
|
* Set up the `/crontab` scripts by following [example](https://github.com/YGGverse/YGGo/blob/main/config/crontab.txt)
|
||||||
|
|
||||||
#### JSON API
|
#### JSON API
|
||||||
|
@ -402,18 +402,23 @@ try {
|
|||||||
|
|
||||||
$time = time();
|
$time = time();
|
||||||
|
|
||||||
@mkdir('../public/storage/snap/hp/' . $queueHostPage->hostPageId, 755, true);
|
$dir = chunk_split($queueHostPage->hostPageId, 1, '/');
|
||||||
|
|
||||||
|
@mkdir('../public/snap/hp/' . $dir, 755, true);
|
||||||
|
|
||||||
$zip = new ZipArchive();
|
$zip = new ZipArchive();
|
||||||
|
|
||||||
if (true === $zip->open('../public/storage/snap/hp/' . $queueHostPage->hostPageId . '/' . $time . '.zip', ZipArchive::CREATE)) {
|
// Create new container
|
||||||
|
if (true === $zip->open('../public/snap/hp/' . $dir . $time . '.zip', ZipArchive::CREATE)) {
|
||||||
|
|
||||||
|
// Insert compressed snap data
|
||||||
if (true === $zip->addFromString($queueHostPage->hostPageId . '.' . $time . '.' . preg_replace('|^[A-z-]+/([A-z-]+).*|ui', '$1', Filter::mime($contentType)), $content)) {
|
if (true === $zip->addFromString($queueHostPage->hostPageId . '.' . $time . '.' . preg_replace('|^[A-z-]+/([A-z-]+).*|ui', '$1', Filter::mime($contentType)), $content)) {
|
||||||
|
|
||||||
|
// Update DB registry
|
||||||
$hostPagesSnapUrlAdded += $db->addHostPageSnapURL($queueHostPage->hostPageId,
|
$hostPagesSnapUrlAdded += $db->addHostPageSnapURL($queueHostPage->hostPageId,
|
||||||
$crc32data, // do not create duplicated content snaps
|
$crc32data, // do not create duplicated content snaps
|
||||||
$crc32host, // multi host storage with same timestamp / crc32data
|
$crc32host, // multi host storage with same timestamp / crc32data
|
||||||
'/storage/snap/hp/' . $queueHostPage->hostPageId . '/' . $time . '.zip', // public url
|
'/snap/hp/' . $dir . $time . '.zip', // public url
|
||||||
$time);
|
$time);
|
||||||
|
|
||||||
$zip->close();
|
$zip->close();
|
||||||
|
0
public/snap/index.html
Normal file
0
public/snap/index.html
Normal file
Loading…
Reference in New Issue
Block a user