1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 12:18:14 +01:00

removed illuminate/filesystem depency

This commit is contained in:
Oliver Vogel 2013-03-24 18:03:59 +01:00
parent 90480ebe52
commit 7a7fcbba54
3 changed files with 3 additions and 31 deletions

View File

@ -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"

View File

@ -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
*

View File

@ -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');