Skip to content

Commit

Permalink
added symfony/process dependency and removed embedded Process class
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyb committed Jun 30, 2015
1 parent f29edc4 commit c166aa5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 146 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
phpunit.xml
build
composer.lock
vendor
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"php": ">=5.3.0",
"symfony/process": "~2.1"
},
"suggest": {
Expand Down
12 changes: 5 additions & 7 deletions src/Knp/Snappy/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Knp\Snappy;

use Knp\Snappy\Exception as Exceptions;
use Symfony\Component\Process\Process;

/**
* Base generator class for medias
Expand Down Expand Up @@ -463,13 +464,10 @@ protected function isAssociativeArray(array $array)
*/
protected function executeCommand($command)
{
if (class_exists('Symfony\Component\Process\Process')) {
$process = new \Symfony\Component\Process\Process($command, NULL, $this->env);
if ($this->timeout !== false) {
$process->setTimeout($this->timeout);
}
} else {
$process = new Process($command, $this->env);
$process = new Process($command, NULL, $this->env);

if ($this->timeout !== false) {
$process->setTimeout($this->timeout);
}

$process->run();
Expand Down
104 changes: 0 additions & 104 deletions src/Knp/Snappy/Process.php

This file was deleted.

31 changes: 0 additions & 31 deletions test/Knp/Snappy/ProcessTest.php

This file was deleted.

0 comments on commit c166aa5

Please sign in to comment.