copy file cache
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
vendor
|
||||
pdf/
|
||||
|
||||
|
||||
@@ -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,9 +18,13 @@ function anfilename($id){
|
||||
|
||||
|
||||
|
||||
|
||||
function file_kuri($hash) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
||||
|
||||
if (!isset($price['price_id'])){
|
||||
@@ -29,8 +33,13 @@ function file_kuri($hash) {
|
||||
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