copy file cache
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
vendor
|
vendor
|
||||||
|
pdf/
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ if (isset($_SERVER['HTTP_HOST']))
|
|||||||
else
|
else
|
||||||
define('SITEPATH', dirname(__FILE__));
|
define('SITEPATH', dirname(__FILE__));
|
||||||
|
|
||||||
|
define('PDFDIR', '/vhosts/app/pub/files/pdf/');
|
||||||
|
|
||||||
db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY');
|
db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY');
|
||||||
db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh');
|
db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh');
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,12 @@ function anfilename($id){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function file_kuri($hash) {
|
function file_kuri($hash) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
||||||
|
|
||||||
@@ -27,10 +31,15 @@ function file_kuri($hash) {
|
|||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
echo "file not found";
|
echo "file not found";
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$id = $price['price_id'];
|
$id = $price['price_id'];
|
||||||
$pdfile = anfilename($id);
|
$pdfile = anfilename($id);
|
||||||
|
$newF = PDFDIR.$hash.'.pdf';
|
||||||
|
if (!file_exists($newF))
|
||||||
|
copy($pdfile, $newF);
|
||||||
|
|
||||||
$request = $_SERVER['REQUEST_URI'];
|
$request = $_SERVER['REQUEST_URI'];
|
||||||
$filename = basename($request);
|
$filename = basename($request);
|
||||||
|
|||||||
Reference in New Issue
Block a user