ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6886


Ignore:
Timestamp:
May 1, 2008, 2:08:25 AM (11 years ago)
Author:
ebihara
Message:

OpenPNE_Img::get_raw_img4db() の引き上げ

Location:
OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib/OpenPNE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib/OpenPNE/Img.php

    r6859 r6886  
    177177    function get_raw_img()
    178178    {
    179         return $this->get_raw_img4db();
    180     }
    181 
    182     /**
    183      * DBから画像バイナリを取得
    184      *
    185      * @access protected
    186      */
    187     function get_raw_img4db()
    188     {
    189         include_once 'OpenPNE/DB.php';
    190         $db =& new OpenPNE_DB($this->dsn);
    191 
    192         $sql = 'SELECT bin, type FROM c_image WHERE filename = ?';
    193         $params = array($this->requests['filename']);
    194 
    195         if ($c_image = $db->get_row($sql, $params)) {
    196             if ($c_image['type']) {
    197                 $this->generator->setSourceFormat($c_image['type']);
    198             }
    199             return base64_decode($c_image['bin']);
    200         } else {
    201             return false;
    202         }
     179        return $this->storage->getRawImage($this->dsn, $this->requests['filename']);
    203180    }
    204181
  • OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib/OpenPNE/Img/Storage.php

    r6843 r6886  
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
     6
     7include_once 'OpenPNE/DB.php';
    68
    79/**
     
    1618    {
    1719    }
     20
     21    function getRawImage($dsn, $filename)
     22    {
     23        $db =& new OpenPNE_DB($dsn);
     24
     25        $sql = 'SELECT bin, type FROM c_image WHERE filename = ?';
     26        $params = array($filename);
     27
     28        if ($c_image = $db->get_row($sql, $params)) {
     29/*            if ($c_image['type']) {
     30                $this->generator->setSourceFormat($c_image['type']);
     31            }*/
     32            return base64_decode($c_image['bin']);
     33        } else {
     34            return false;
     35        }
     36    }
    1837}
    1938
Note: See TracChangeset for help on using the changeset viewer.