add scripts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors','off');
|
||||
ini_set('display_errors','on');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
if (isset($_SERVER['HTTP_HOST']))
|
||||
@@ -11,7 +11,8 @@ if (isset($_SERVER['HTTP_HOST']))
|
||||
else
|
||||
define('SITEPATH', dirname(__FILE__));
|
||||
|
||||
define('PDFDIR', '/vhosts/anpdf/app/pub/files/pdf/');
|
||||
define('PDFDIR', '/vhosts/anpdf/app/pub/files/pdf/');
|
||||
define('API', 'http://api.argumenti.ru/');
|
||||
|
||||
db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY');
|
||||
db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh');
|
||||
|
||||
@@ -8,5 +8,5 @@ require 'routes/price.php';
|
||||
_kuri();
|
||||
|
||||
function index_kuri(){
|
||||
return anpromo_kuri(1);
|
||||
return text_kuri(1);
|
||||
}
|
||||
@@ -72,6 +72,20 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
||||
include ('anpdf2.phtml');
|
||||
|
||||
|
||||
}
|
||||
|
||||
function text_kuri(){
|
||||
|
||||
$id = 659286;
|
||||
|
||||
$news = file_get_contents(API.'id/'.$id);
|
||||
print_r($news);
|
||||
|
||||
|
||||
|
||||
//view( 'views/antext.phtml',['news'=> $news] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
19
scripts/splitpdf.sh
Normal file
19
scripts/splitpdf.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
WORKDIR=~/arlemp/vhosts/anpdf/app/pub/files
|
||||
PDFDIR=$WORKDIR/pdf
|
||||
OUTDIR=$WORKDIR/pages
|
||||
|
||||
cd $PDFDIR
|
||||
|
||||
for file in *.pdf;
|
||||
do
|
||||
name="${file%.pdf}"
|
||||
PGEDIR="$OUTDIR/$name"
|
||||
|
||||
if [ ! -d "$PGEDIR" ]; then
|
||||
mkdir -p $PGEDIR
|
||||
docker run --name pdftk -it --rm --user $(id -u):$(id -g) -v "$WORKDIR:/workdir$WORKDIR" -w "/workdir$WORKDIR" masterforweb/pdftk pdftk "pdf/$file" burst output "pages/${name}/${name}-%02d.pdf";
|
||||
fi
|
||||
|
||||
done
|
||||
Reference in New Issue
Block a user