From 7a7fcbba541457cf35c8fc00ba1caa567839b881 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 24 Mar 2013 18:03:59 +0100 Subject: [PATCH] removed illuminate/filesystem depency --- composer.json | 3 +-- src/Intervention/Image/Image.php | 25 ++----------------------- tests/ImageTest.php | 6 ------ 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index a19e2e0d..984854f6 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,7 @@ "require": { "php": ">=5.3.0", "ext-gd": "*", - "illuminate/support": "4.0.x", - "illuminate/filesystem": "4.0.x" + "illuminate/support": "4.0.x" }, "suggest": { "intervention/imagecache": "Caching extension for the Intervention Image library" diff --git a/src/Intervention/Image/Image.php b/src/Intervention/Image/Image.php index d5ef0af5..cb55f554 100644 --- a/src/Intervention/Image/Image.php +++ b/src/Intervention/Image/Image.php @@ -4,7 +4,6 @@ namespace Intervention\Image; use Exception; use Closure; -use Illuminate\Filesystem\Filesystem; class Image { @@ -64,13 +63,6 @@ class Image */ public $filename; - /** - * Instance of Illuminate\Filesystem\Filesystem - * - * @var Filesystem - */ - protected $filesystem; - /** * Attributes of the original created image * @@ -95,9 +87,6 @@ class Image */ public function __construct($path = null, $width = null, $height = null, $bgcolor = null) { - // create filesystem - $this->filesystem = new Filesystem; - // set image properties if ( ! is_null($path)) { @@ -183,7 +172,7 @@ class Image */ private function setPropertiesFromPath($path) { - if ( ! $this->filesystem->exists($path)) { + if ( ! file_exists($path)) { throw new Exception("Image file ({$path}) not found"); } @@ -1286,7 +1275,7 @@ class Image public function save($path = null, $quality = 90) { $path = is_null($path) ? ($this->dirname .'/'. $this->basename) : $path; - file_put_contents($path, $this->data($this->filesystem->extension($path), $quality)); + file_put_contents($path, $this->data(pathinfo($path, PATHINFO_EXTENSION), $quality)); return $this; } @@ -1351,16 +1340,6 @@ class Image } } - /** - * Return filesystem object - * - * @return Filesystem - */ - public function getFilesystem() - { - return $this->filesystem; - } - /** * Returns image stream * diff --git a/tests/ImageTest.php b/tests/ImageTest.php index 7869cd37..2d909e64 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -9,12 +9,6 @@ class ImageTest extends PHPUnit_Framework_Testcase return new Image('public/test.jpg'); } - public function testFilesystemLibraryIsAvailable() - { - $img = new Image; - $this->assertInstanceOf('Illuminate\Filesystem\Filesystem', $img->getFilesystem()); - } - public function testConstructor() { $img = new Image('public/test.jpg');