mirror of
https://github.com/Intervention/image.git
synced 2025-08-11 08:24:02 +02:00
removed illuminate/filesystem depency
This commit is contained in:
@@ -14,8 +14,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0",
|
"php": ">=5.3.0",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"illuminate/support": "4.0.x",
|
"illuminate/support": "4.0.x"
|
||||||
"illuminate/filesystem": "4.0.x"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"intervention/imagecache": "Caching extension for the Intervention Image library"
|
"intervention/imagecache": "Caching extension for the Intervention Image library"
|
||||||
|
@@ -4,7 +4,6 @@ namespace Intervention\Image;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
|
||||||
|
|
||||||
class Image
|
class Image
|
||||||
{
|
{
|
||||||
@@ -64,13 +63,6 @@ class Image
|
|||||||
*/
|
*/
|
||||||
public $filename;
|
public $filename;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instance of Illuminate\Filesystem\Filesystem
|
|
||||||
*
|
|
||||||
* @var Filesystem
|
|
||||||
*/
|
|
||||||
protected $filesystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attributes of the original created image
|
* Attributes of the original created image
|
||||||
*
|
*
|
||||||
@@ -95,9 +87,6 @@ class Image
|
|||||||
*/
|
*/
|
||||||
public function __construct($path = null, $width = null, $height = null, $bgcolor = null)
|
public function __construct($path = null, $width = null, $height = null, $bgcolor = null)
|
||||||
{
|
{
|
||||||
// create filesystem
|
|
||||||
$this->filesystem = new Filesystem;
|
|
||||||
|
|
||||||
// set image properties
|
// set image properties
|
||||||
if ( ! is_null($path)) {
|
if ( ! is_null($path)) {
|
||||||
|
|
||||||
@@ -183,7 +172,7 @@ class Image
|
|||||||
*/
|
*/
|
||||||
private function setPropertiesFromPath($path)
|
private function setPropertiesFromPath($path)
|
||||||
{
|
{
|
||||||
if ( ! $this->filesystem->exists($path)) {
|
if ( ! file_exists($path)) {
|
||||||
throw new Exception("Image file ({$path}) not found");
|
throw new Exception("Image file ({$path}) not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1286,7 +1275,7 @@ class Image
|
|||||||
public function save($path = null, $quality = 90)
|
public function save($path = null, $quality = 90)
|
||||||
{
|
{
|
||||||
$path = is_null($path) ? ($this->dirname .'/'. $this->basename) : $path;
|
$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;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -1351,16 +1340,6 @@ class Image
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return filesystem object
|
|
||||||
*
|
|
||||||
* @return Filesystem
|
|
||||||
*/
|
|
||||||
public function getFilesystem()
|
|
||||||
{
|
|
||||||
return $this->filesystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns image stream
|
* Returns image stream
|
||||||
*
|
*
|
||||||
|
@@ -9,12 +9,6 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
|||||||
return new Image('public/test.jpg');
|
return new Image('public/test.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFilesystemLibraryIsAvailable()
|
|
||||||
{
|
|
||||||
$img = new Image;
|
|
||||||
$this->assertInstanceOf('Illuminate\Filesystem\Filesystem', $img->getFilesystem());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testConstructor()
|
public function testConstructor()
|
||||||
{
|
{
|
||||||
$img = new Image('public/test.jpg');
|
$img = new Image('public/test.jpg');
|
||||||
|
Reference in New Issue
Block a user