<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
</include_path>
</component>
- <component name="PhpProjectSharedConfiguration" php_language_level="7" />
+ <component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
</project>
\ No newline at end of file
}
],
"require": {
- "php": ">=7.0.0",
+ "php": ">=8.0",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-dom": "*",
namespace Fluidbook\Tools\Jobs;
+use Cubist\Util\Files\Files;
use Fluidbook\Tools\PDF\PDFTools;
use Fluidbook\Tools\SVG\SVGTools;
{
protected $format = 'jpg';
/**
- * @var int
+ * @var int|string
*/
protected $resolution = 150;
/**
* @var string
*/
protected $version = 'html';
- /**
- * @var int
- */
- protected $page = 0;
- /**
- * @var string
- */
- protected $out;
+
/**
* @var ProcessPage
*/
}
/**
- * @param int $resolution
+ * @param int|string $resolution
*/
- public function setResolution(int $resolution)
+ public function setResolution(int|string $resolution)
{
$this->resolution = $resolution;
}
/**
- * @return int
+ * @return int|string
*/
- public function getResolution(): int
+ public function getResolution(): int|string
{
return $this->resolution;
}
return $this->job->getOut();
}
- /**
- * @param mixed $out
- */
- public function setOut($out)
- {
- $this->out = $out;
- }
/**
* @return string
sleep(10);
return $this->getPath();
}
+ Files::mkdir(dirname($lock));
touch($lock);
if ($this->getFormat() === 'svg') {
if ($this->isWithGraphics()) {
public function makeSVGFile($force = false)
{
- $svgFile = $this->out . '/html/fp' . $this->getPage() . '.svg';
+ $svgFile = $this->getOut() . '/html/fp' . $this->getPage() . '.svg';
if (!$force && file_exists($svgFile) && filesize($svgFile) > 0) {
return $svgFile;
}
protected function getSplittedPDFPage()
{
- $res = $this->out . 'pdf/p' . $this->getPage() . '.pdf';
+ $res = $this->getOut() . 'pdf/p' . $this->getPage() . '.pdf';
if (!file_exists($res)) {
$this->getJob()->splitDoc();
}
namespace Fluidbook\Tools\Jobs;
+use Cubist\Util\Files\Files;
use Fluidbook\Tools\PDF\Document;
use Fluidbook\Tools\PDF\PDFTools;
use Fluidbook\Tools\SVG\SVGTools;
* @param $document Document
* @param $page integer
* @param $out string
+ * @param ProcessFile[] $files
*/
public function __construct($document, $page, $out, $files = [])
{
{
start_measure('Split PDF');
- if (!file_exists($this->out . '/pdf') && !mkdir($concurrentDirectory = $this->out . '/pdf') && !is_dir($concurrentDirectory)) {
- throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
- }
+ Files::mkdir($this->out . '/pdf');
$pdftk = new CommandLine('pdftk');
$pdftk->setArg(null, $this->getPDFInput());
$pdftk->setArg(null, 'burst');
use Cubist\Util\CommandLine;
use Fluidbook\Tools\FluidbookTools;
+use Fluidbook\Tools\Jobs\ProcessFile;
use Fluidbook\Tools\Jobs\ProcessPage;
class Document
}
/**
- * @param $i
- * @param $dest
+ * @param $page int
+ * @param $dest string
+ * @param $files ProcessFile[]
+ * @param false $sync
*/
public function processPage($page, $dest, $files, $sync = false)
{
namespace Fluidbook\Tools\PDF;
use Cubist\Util\CommandLine;
+use Cubist\Util\Files\Files;
use DOMDocument;
use DOMNode;
use DOMXPath;
protected static function makeShotGS($in, $out, $page, $prefix = '', $resolution = 72, $quality = 90, $antialiasing = 4, $width = null, $height = null, $format = 'jpg')
{
- // Fabrication des thumbanails avec ghostscript
+ // Fabrication des thumbnails avec ghostscript
$gs = new CommandLine('gs', null, true);
$gs->setArg('-dBATCH');
$gs->setArg('-dNOPAUSE');
public static function makeShotPNM($in, $out, $page, $prefix = '', $resolution = 72, $quality = 90, $antialiasing = 4, $texts = true, $width = null, $height = null, $format = 'jpg')
{
- $tmp = cubeFiles::tempnam();
+ $tmp =Files::tempnam();
$antialiasing = $antialiasing ? 'yes' : 'no';
$freetype = $texts ? 'yes' : 'no';