Skip to content

Commit 73b8edf

Browse files
authored
Update ImageManager.php
(Updating for L8)
1 parent 1f24d59 commit 73b8edf

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/Folklore/Image/ImageManager.php

+24-24
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function url($src, $width = null, $height = null, $options = array())
6161
$height = null;
6262
}
6363

64-
$config = $this->app['config'];
64+
$config = $this->container['config'];
6565
$url_parameter = isset($options['url_parameter']) ? $options['url_parameter']:$config['image.url_parameter'];
6666
$url_parameter_separator = isset($options['url_parameter_separator']) ? $options['url_parameter_separator']:$config['image.url_parameter_separator'];
6767
unset($options['url_parameter'],$options['url_parameter_separator']);
@@ -110,13 +110,13 @@ public function url($src, $width = null, $height = null, $options = array())
110110

111111
// Break the path apart and put back together again
112112
$parts = pathinfo($src);
113-
$host = isset($options['host']) ? $options['host']:$this->app['config']['image.host'];
113+
$host = isset($options['host']) ? $options['host']:$this->container['config']['image.host'];
114114
$dir = trim($parts['dirname'], '/');
115115

116116
$path = array();
117117
$path[] = rtrim($host, '/');
118118

119-
if ($prefix = $this->app['config']->get('image.write_path')) {
119+
if ($prefix = $this->container['config']->get('image.write_path')) {
120120
$path[] = trim($prefix, '/');
121121
}
122122

@@ -145,7 +145,7 @@ public function url($src, $width = null, $height = null, $options = array())
145145
public function make($path, $options = array())
146146
{
147147
//Get app config
148-
$config = $this->app['config'];
148+
$config = $this->container['config'];
149149

150150
// See if the referenced file exists and is an image
151151
if (!($path = $this->getRealPath($path))) {
@@ -227,16 +227,16 @@ public function make($path, $options = array())
227227
public function serve($path, $config = array())
228228
{
229229
//Use user supplied quality or the config value
230-
$quality = Arr::get($config, 'quality', $this->app['config']['image.quality']);
230+
$quality = Arr::get($config, 'quality', $this->container['config']['image.quality']);
231231
//if nothing works fallback to the hardcoded value
232232
$quality = $quality ?: $this->defaultOptions['quality'];
233233

234234
//Merge config with defaults
235235
$config = array_merge(array(
236236
'quality' => $quality,
237-
'custom_filters_only' => $this->app['config']['image.serve_custom_filters_only'],
238-
'write_image' => $this->app['config']['image.write_image'],
239-
'write_path' => $this->app['config']['image.write_path']
237+
'custom_filters_only' => $this->container['config']['image.serve_custom_filters_only'],
238+
'write_image' => $this->container['config']['image.write_image'],
239+
'write_path' => $this->container['config']['image.write_path']
240240
), $config);
241241

242242
$serve = new ImageServe($this, $config);
@@ -255,12 +255,12 @@ public function proxy($path, $config = array())
255255
{
256256
//Merge config with defaults
257257
$config = array_merge(array(
258-
'tmp_path' => $this->app['config']['image.proxy_tmp_path'],
259-
'filesystem' => $this->app['config']['image.proxy_filesystem'],
260-
'cache' => $this->app['config']['image.proxy_cache'],
261-
'cache_expiration' => $this->app['config']['image.proxy_cache_expiration'],
262-
'write_image' => $this->app['config']['image.proxy_write_image'],
263-
'cache_filesystem' => $this->app['config']['image.proxy_cache_filesystem']
258+
'tmp_path' => $this->container['config']['image.proxy_tmp_path'],
259+
'filesystem' => $this->container['config']['image.proxy_filesystem'],
260+
'cache' => $this->container['config']['image.proxy_cache'],
261+
'cache_expiration' => $this->container['config']['image.proxy_cache_expiration'],
262+
'write_image' => $this->container['config']['image.proxy_write_image'],
263+
'cache_filesystem' => $this->container['config']['image.proxy_cache_filesystem']
264264
), $config);
265265

266266
$serve = new ImageProxy($this, $config);
@@ -421,7 +421,7 @@ public function deleteManipulated($path)
421421
public function pattern($parameter = null, $pattern = null)
422422
{
423423
//Replace the {options} with the options regular expression
424-
$config = $this->app['config'];
424+
$config = $this->container['config'];
425425
$parameter = !isset($parameter) ? $config['image.url_parameter']:$parameter;
426426
$parameter = preg_replace('/\\\{\s*options\s*\\\}/', '([0-9a-zA-Z\(\),\-/._]+?)?', preg_quote($parameter));
427427

@@ -447,7 +447,7 @@ public function parse($path, $config = array())
447447
$config = array_merge(array(
448448
'custom_filters_only' => false,
449449
'url_parameter' => null,
450-
'url_parameter_separator' => $this->app['config']['image.url_parameter_separator']
450+
'url_parameter_separator' => $this->container['config']['image.url_parameter_separator']
451451
), $config);
452452

453453
$parsedOptions = array();
@@ -479,7 +479,7 @@ protected function parseOptions($option_path, $config = array())
479479
//Default config
480480
$config = array_merge(array(
481481
'custom_filters_only' => false,
482-
'url_parameter_separator' => $this->app['config']['image.url_parameter_separator']
482+
'url_parameter_separator' => $this->container['config']['image.url_parameter_separator']
483483
), $config);
484484

485485
$options = array();
@@ -563,9 +563,9 @@ public function getRealPath($path)
563563
}
564564

565565
//Get directories
566-
$dirs = $this->app['config']['image.src_dirs'];
567-
if ($this->app['config']['image.write_path']) {
568-
$dirs[] = $this->app['config']['image.write_path'];
566+
$dirs = $this->container['config']['image.src_dirs'];
567+
if ($this->container['config']['image.write_path']) {
568+
$dirs[] = $this->container['config']['image.write_path'];
569569
}
570570

571571
// Loop through all the directories files may be uploaded to
@@ -615,8 +615,8 @@ protected function getFiles($path, $withOriginal = true)
615615
$parts = pathinfo($path);
616616
$dirs = [$parts['dirname']];
617617
$dirs = [$parts['dirname']];
618-
if ($this->app['config']['image.write_path']) {
619-
$dirs[] = $this->app['config']['image.write_path'];
618+
if ($this->container['config']['image.write_path']) {
619+
$dirs[] = $this->container['config']['image.write_path'];
620620
}
621621
foreach ($dirs as $directory) {
622622
$files = scandir($directory);
@@ -838,7 +838,7 @@ protected function createGmagickDriver()
838838
*/
839839
public function getDefaultDriver()
840840
{
841-
return $this->app['config']['image.driver'];
841+
return $this->container['config']['image.driver'];
842842
}
843843

844844
/**
@@ -849,6 +849,6 @@ public function getDefaultDriver()
849849
*/
850850
public function setDefaultDriver($name)
851851
{
852-
$this->app['config']['image.driver'] = $name;
852+
$this->container['config']['image.driver'] = $name;
853853
}
854854
}

0 commit comments

Comments
 (0)