コード例 #1
0
ファイル: Object.php プロジェクト: hamaco/phwittr-on-xoops
 public static function setConfig(array $config)
 {
     if (isset($config["thumbnailSizes"])) {
         sort($config["thumbnailSizes"], SORT_NUMERIC);
     }
     self::$config = array_merge(self::$config, $config);
 }
コード例 #2
0
ファイル: Processor.php プロジェクト: hamaco/phwittr-on-xoops
 public function execute($bus)
 {
     $this->imanage = new Imanage_Object();
     $bus->set("imanage", $this->imanage);
     $request = $bus->get("request");
     $uri = $request->getUri();
     if ($request->isGet() && $request->hasGetValue("name")) {
         $result = null;
         if ($uri === Imanage_Addon::THUMBNAIL_URI) {
             $result = $this->imanage->thumbnail($request->fetchGetValue("name"), $request->fetchGetValue("size"));
         } elseif ($uri === Imanage_Addon::DISPLAY_URI) {
             $result = $this->imanage->display($request->fetchGetValue("name"));
         }
         if ($result !== null) {
             if ($result) {
                 // output image.
                 exit;
             } else {
                 $bus->get("response")->getStatus()->setCode(Sabel_Response::NOT_FOUND);
             }
         }
     }
 }
コード例 #3
0
ファイル: Addon.php プロジェクト: hamaco/phwittr-on-xoops
 public function execute($bus)
 {
     $bus->getProcessorList()->insertNext("router", "imanage", new Imanage_Processor("imanage"));
     Imanage_Object::setConfig(array("maximumFileSize" => 700, "defaultThumbnailSize" => 48, "thumbnailSizes" => array(24, 48)));
 }