Example #1
0
 public function __construct($path = null, array $options = [])
 {
     if (!$path) {
         if (!($path = static::$path)) {
             # Check which version we should use based on the current machine architecture
             $bin = "wkhtmltopdf-";
             if (posix_uname()["machine"][0] == "i") {
                 $bin .= "i386";
             } else {
                 $bin .= "amd64";
             }
             # Start in the directory that we are in
             $path = __DIR__;
             # Move up to the composer vendor directory
             $path .= "/../../..";
             # Add the wkhtmltopdf binary path
             $path .= "/h4cc/" . $bin . "/bin/" . $bin;
             static::$path = $path;
         }
     }
     parent::__construct($path, $options);
 }
 /**
  * @param \Illuminate\Filesystem\Filesystem
  * @param string $binary
  * @param array $options
  */
 public function __construct(Filesystem $fs, $binary, array $options, array $env)
 {
     parent::__construct($binary, $options, $env);
     $this->fs = $fs;
 }