add Dockerfile
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
ini_set('display_errors','off');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function anpromo_kuri($page = 1, $scale = 1){
|
||||
|
||||
// $pdfile = 'https://argumenti.ru/templinks/md5files/f9598f88e667146d50d106eeedbd74c1.pdf';
|
||||
@@ -136,6 +132,7 @@ function promo_kuri($hash, $page = 1, $scale = 2, $promo = false){
|
||||
$id = $price['price_id'];
|
||||
$pdfile = "/file/$hash";
|
||||
$maxpage = 32;
|
||||
|
||||
if ($page > 1)
|
||||
$title = $price['pricename']."- $page";
|
||||
else
|
||||
@@ -159,4 +156,41 @@ function promo_kuri($hash, $page = 1, $scale = 2, $promo = false){
|
||||
include ('anpdf2.phtml');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function pdfscan_kuri(){
|
||||
|
||||
$pdfsql = "SELECT price_id, pricehash FROM price WHERE category_id = 1";
|
||||
$path = '~/vhosts/anpdf/pub/files/pages/';
|
||||
|
||||
|
||||
echo exec('whoami');
|
||||
|
||||
$pdfs = dbl_get($pdfsql);
|
||||
|
||||
|
||||
foreach($pdfs as $pdf){
|
||||
|
||||
$pagedir = $path.$pdf['pricehash'];
|
||||
|
||||
if(!is_dir($pagedir)) {
|
||||
mkdir($pagedir);
|
||||
$cmd = 'docker run --name pdftk -it --rm \
|
||||
--user $(id -u):$(id -g) \
|
||||
-v "$PDFDIR:/workdir/pdf" \
|
||||
-v "$OUTDIR:/workdir/pages" \
|
||||
-w "/workdir" \
|
||||
masterforweb/pdftk pdftk "pdf/$file" burst output "pages/${name}/${name}-%1d.pdf';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user