芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/vendor/league/glide/src/Api/Api.php
setImageManager($imageManager); $this->setManipulators($manipulators); } /** * Set the image manager. * * @param ImageManager $imageManager Intervention image manager. */ public function setImageManager(ImageManager $imageManager) { $this->imageManager = $imageManager; } /** * Get the image manager. * * @return ImageManager Intervention image manager. */ public function getImageManager() { return $this->imageManager; } /** * Set the manipulators. * * @param array $manipulators Collection of manipulators. */ public function setManipulators(array $manipulators) { foreach ($manipulators as $manipulator) { if (!($manipulator instanceof ManipulatorInterface)) { throw new InvalidArgumentException('Not a valid manipulator.'); } } $this->manipulators = $manipulators; } /** * Get the manipulators. * * @return array Collection of manipulators. */ public function getManipulators() { return $this->manipulators; } /** * Perform image manipulations. * * @param string $source Source image binary data. * @param array $params The manipulation params. * * @return string Manipulated image binary data. */ public function run($source, array $params) { $image = $this->imageManager->make($source); foreach ($this->manipulators as $manipulator) { $manipulator->setParams($params); $image = $manipulator->run($image); } return $image->getEncoded(); } }