copy file cache
This commit is contained in:
@@ -11,6 +11,8 @@ if (isset($_SERVER['HTTP_HOST']))
|
||||
else
|
||||
define('SITEPATH', dirname(__FILE__));
|
||||
|
||||
define('PDFDIR', '/vhosts/app/pub/files/pdf/');
|
||||
|
||||
db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY');
|
||||
db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh');
|
||||
|
||||
|
||||
@@ -18,8 +18,12 @@ function anfilename($id){
|
||||
|
||||
|
||||
|
||||
|
||||
function file_kuri($hash) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$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");
|
||||
echo "file not found";
|
||||
return False;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$id = $price['price_id'];
|
||||
$pdfile = anfilename($id);
|
||||
$newF = PDFDIR.$hash.'.pdf';
|
||||
if (!file_exists($newF))
|
||||
copy($pdfile, $newF);
|
||||
|
||||
$request = $_SERVER['REQUEST_URI'];
|
||||
$filename = basename($request);
|
||||
|
||||
Reference in New Issue
Block a user