HosipLan

Untitled

Feb 28th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.  
  2. use Nette\Object;
  3. use Wkhtmltopdf\Document;
  4.  
  5. class WkhtmltopdfFactory extends Object
  6. {
  7.  
  8.     /**
  9.      * @var string
  10.      */
  11.     private $tempDir;
  12.  
  13.     /**
  14.      * @var string
  15.      */
  16.     private $executable;
  17.  
  18.  
  19.  
  20.     /**
  21.      * @param string $tempDir
  22.      * @param string $executable
  23.      */
  24.     public function __construct($tempDir, $executable)
  25.     {
  26.         if (!is_dir($this->tempDir = $tempDir)) {
  27.             mkdir($tempDir, 0777, TRUE);
  28.         }
  29.  
  30.         $this->executable = $executable;
  31.     }
  32.  
  33.  
  34.  
  35.     /**
  36.      * @return Document
  37.      */
  38.     public function create()
  39.     {
  40.         $document = new Document($this->tempDir);
  41.         $document::$executable = $this->executable;
  42.         return $document;
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment