add Dockerfile

This commit is contained in:
Andrey Kuvshinov
2020-05-08 13:22:22 +03:00
parent e7696b44cf
commit 797ebaa707
11 changed files with 120 additions and 100 deletions

View File

@@ -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';
}
}
}