mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-24 13:34:25 +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
|
||||
* Install [Sphinx Search Server](https://sphinxsearch.com)
|
||||
* 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)
|
||||
|
||||
#### JSON API
|
||||
|
@ -402,18 +402,23 @@ try {
|
||||
|
||||
$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();
|
||||
|
||||
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)) {
|
||||
|
||||
// Update DB registry
|
||||
$hostPagesSnapUrlAdded += $db->addHostPageSnapURL($queueHostPage->hostPageId,
|
||||
$crc32data, // do not create duplicated content snaps
|
||||
$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);
|
||||
|
||||
$zip->close();
|
||||
|
0
public/snap/index.html
Normal file
0
public/snap/index.html
Normal file
Loading…
x
Reference in New Issue
Block a user