Changeset 21583


Ignore:
Timestamp:
2012/03/04 04:46:21 (12 years ago)
Author:
Seasoft
Message:

#1603 (プラグイン機能(エンジン部分))

  • 互換性のない旧プラグイン機能を削除

#1607 (未使用定義の削除)
#1605 (PHP4向けコードの除去、PHP5向けのコード最適化)

Location:
branches/version-2_12-dev
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_Query.php

    r21582 r21583  
    10381038        $arrStartInfo = array( 
    10391039            'http_request_id'   => $arrInfo['http_request_id'], 
    1040             'time_start'        => SC_Utils_Ex::sfMicrotimeFloat(), 
     1040            'time_start'        => microtime(true), 
    10411041            'count'             => ++$arrInfo['count'], 
    10421042        ); 
     
    10681068        $msg = "[execute end {$arrStartInfo['http_request_id']}#{$arrStartInfo['count']}]\n"; 
    10691069 
    1070         $timeEnd = SC_Utils_Ex::sfMicrotimeFloat(); 
     1070        $timeEnd = microtime(true); 
    10711071        $timeExecTime = $timeEnd - $arrStartInfo['time_start']; 
    10721072 
  • branches/version-2_12-dev/data/class/SC_View.php

    r21573 r21583  
    6161 
    6262        if (ADMIN_MODE == '1') { 
    63             $this->time_start = SC_Utils_Ex::sfMicrotimeFloat(); 
     63            $this->time_start = microtime(true); 
    6464        } 
    6565    } 
     
    9595        $res =  $this->_smarty->fetch($template); 
    9696        if (ADMIN_MODE == '1') { 
    97             $time_end = SC_Utils_Ex::sfMicrotimeFloat(); 
     97            $time_end = microtime(true); 
    9898            $time = $time_end - $this->time_start; 
    9999            $res .= '処理時間: ' . sprintf('%.3f', $time) . '秒'; 
     
    159159        $this->_smarty->display($template); 
    160160        if (ADMIN_MODE == '1') { 
    161             $time_end = SC_Utils_Ex::sfMicrotimeFloat(); 
     161            $time_end = microtime(true); 
    162162            $time = $time_end - $this->time_start; 
    163163            echo '処理時間: ' . sprintf('%.3f', $time) . '秒'; 
  • branches/version-2_12-dev/data/class/pages/LC_Page.php

    r21582 r21583  
    8686    function init() { 
    8787        // 開始時刻を設定する。 
    88         $this->timeStart = SC_Utils_Ex::sfMicrotimeFloat(); 
     88        $this->timeStart = microtime(true); 
    8989 
    9090        $this->tpl_authority = $_SESSION['authority']; 
     
    166166        // エラー画面の表示では $this->timeStart が出力されない 
    167167        if (defined('PAGE_DISPLAY_TIME_LOG_MODE') && PAGE_DISPLAY_TIME_LOG_MODE == true && isset($this->timeStart)) { 
    168             $timeEnd = SC_Utils_Ex::sfMicrotimeFloat(); 
     168            $timeEnd = microtime(true); 
    169169            $timeExecTime = $timeEnd - $this->timeStart; 
    170170            if (defined('PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float)PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME) { 
  • branches/version-2_12-dev/data/class/pages/LC_Page_Index.php

    r21469 r21583  
    5454        parent::process(); 
    5555        $this->action(); 
     56        // class_exists('xxx'); 
     57        // 0/0; 
     58        // new xxx; 
     59        // $objQuery = new SC_Query_Ex(); 
     60        // $objQuery->select('***'); 
     61        // trigger_error('試験的なエラー発生です。'); 
    5662        $this->sendResponse(); 
    5763    } 
  • branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php

    r21582 r21583  
    4141    function init() { 
    4242        // 開始時刻を設定する。 
    43         $this->timeStart = SC_Utils_Ex::sfMicrotimeFloat(); 
     43        $this->timeStart = microtime(true); 
    4444 
    4545        $this->tpl_authority = $_SESSION['authority']; 
  • branches/version-2_12-dev/data/class/util/SC_Utils.php

    r21582 r21583  
    17441744 
    17451745    /** 
    1746      * プラグインが配置されているディレクトリ(フルパス)を取得する 
    1747      * 
    1748      * @param string $file プラグイン情報ファイル(info.php)のパス 
    1749      * @return SimpleXMLElement プラグイン XML 
    1750      */ 
    1751     function sfGetPluginFullPathByRequireFilePath($file) { 
    1752         return str_replace('\\', '/', dirname($file)) . '/'; 
    1753     } 
    1754  
    1755     /** 
    1756      * プラグインのパスを取得する 
    1757      * 
    1758      * @param string $pluginFullPath プラグインが配置されているディレクトリ(フルパス) 
    1759      * @return SimpleXMLElement プラグイン XML 
    1760      */ 
    1761     function sfGetPluginPathByPluginFullPath($pluginFullPath) { 
    1762         return basename(rtrim($pluginFullPath, '/')); 
    1763     } 
    1764  
    1765     /** 
    1766      * プラグイン情報配列の基本形を作成する 
    1767      * 
    1768      * @param string $file プラグイン情報ファイル(info.php)のパス 
    1769      * @return array プラグイン情報配列 
    1770      */ 
    1771     function sfMakePluginInfoArray($file) { 
    1772         $fullPath = SC_Utils_Ex::sfGetPluginFullPathByRequireFilePath($file); 
    1773  
    1774         return 
    1775             array( 
    1776                 // パス 
    1777                 'path' => SC_Utils_Ex::sfGetPluginPathByPluginFullPath($fullPath), 
    1778                 // プラグイン名 
    1779                 'name' => '未定義', 
    1780                 // フルパス 
    1781                 'fullpath' => $fullPath, 
    1782                 // バージョン 
    1783                 'version' => null, 
    1784                 // 著作者 
    1785                 'auther' => '未定義', 
    1786             ) 
    1787         ; 
    1788     } 
    1789  
    1790     /** 
    1791      * プラグイン情報配列を取得する 
    1792      * 
    1793      * TODO include_once を利用することで例外対応をサボタージュしているのを改善する。 
    1794      * 
    1795      * @param string $path プラグインのディレクトリ名 
    1796      * @return array プラグイン情報配列 
    1797      */ 
    1798     function sfGetPluginInfoArray($path) { 
    1799         return (array)include_once PLUGIN_REALDIR . "$path/plugin_info.php"; 
    1800     } 
    1801  
    1802     /** 
    1803      * プラグイン XML を読み込む 
    1804      * 
    1805      * TODO 空だったときを考慮 
    1806      * 
    1807      * @return SimpleXMLElement プラグイン XML 
    1808      * @deprecated 
    1809      */ 
    1810     function sfGetPluginsXml() { 
    1811         return simplexml_load_file(PLUGIN_REALDIR . 'plugins.xml'); 
    1812     } 
    1813  
    1814     /** 
    1815      * プラグイン XML を書き込む 
    1816      * 
    1817      * @param SimpleXMLElement $pluginsXml プラグイン XML 
    1818      * @return integer ファイルに書き込まれたバイト数を返します。 
    1819      * @deprecated 
    1820      */ 
    1821     function sfPutPluginsXml($pluginsXml) { 
    1822         if (version_compare(PHP_VERSION, '5.0.0', '>')) { 
    1823             return; 
    1824         } 
    1825  
    1826         $xml = $pluginsXml->asXML(); 
    1827         if (strlen($xml) == 0) trigger_error('', E_USER_ERROR); 
    1828  
    1829         $return = file_put_contents(PLUGIN_REALDIR . 'plugins.xml', $pluginsXml->asXML()); 
    1830         if ($return === false) trigger_error('', E_USER_ERROR); 
    1831         return $return; 
    1832     } 
    1833  
    1834     function sfLoadPluginInfo($filenamePluginInfo) { 
    1835         return (array)include_once $filenamePluginInfo; 
    1836     } 
    1837  
    1838     /** 
    1839      * 現在の Unix タイムスタンプを float (秒単位) でマイクロ秒まで返す 
    1840      * 
    1841      * PHP4の上位互換用途。 
    1842      * @param SimpleXMLElement $pluginsXml プラグイン XML 
    1843      * @return integer ファイルに書き込まれたバイト数を返します。 
     1746     * 前方互換用 
     1747     * 
     1748     * @deprecated 2.12.0 microtime(true) を使用する。 
    18441749     */ 
    18451750    function sfMicrotimeFloat() { 
    1846         $microtime = microtime(true); 
    1847         if (is_string($microtime)) { 
    1848             list($usec, $sec) = explode(' ', microtime()); 
    1849             return (float)$usec + (float)$sec; 
    1850         } 
    1851         return $microtime; 
     1751        trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); 
     1752        return microtime(true); 
    18521753    } 
    18531754 
  • branches/version-2_12-dev/data/mtb_constants_init.php

    r21582 r21583  
    383383/** 画像リネーム設定 (商品画像のみ) (true:リネームする、false:リネームしない) */ 
    384384define('IMAGE_RENAME', true); 
    385 /** プラグインディレクトリ */ 
    386 define('PLUGIN_DIR', "plugins/"); 
    387 /** プラグイン保存先 */ 
    388 define('PLUGIN_REALDIR', USER_REALDIR . PLUGIN_DIR); 
    389 /** プラグイン URL */ 
    390 define('PLUGIN_URL', USER_URL . PLUGIN_DIR); 
    391385/** プラグイン保存先 */ 
    392386define('PLUGIN_UPLOAD_REALDIR', DATA_REALDIR . "downloads/plugin/"); 
    393387/** プラグイン外部ファイル保存先 */ 
    394388define('PLUGIN_HTML_REALDIR', HTML_REALDIR . "plugin/"); 
    395 /** プラグイン・ディレクトリパーミッション */ 
    396 define('PLUGIN_DIR_PERMISSION', 0777); 
    397389/** プラグインファイル一時保存先 */ 
    398390define('PLUGIN_TEMP_REALDIR', HTML_REALDIR . "upload/temp_plugin/"); 
    399391/** アップロード一時ディレクトリ */ 
    400392define('DOWNLOADS_TEMP_DIR', DATA_REALDIR . "downloads/tmp/"); 
    401 /** プラグイン 外部ファイルURL */ 
    402 define('PLUGIN_HTML_URL', USER_URL . PLUGIN_DIR); 
    403393/** プラグインファイル登録可能拡張子(カンマ区切り) */ 
    404394define('PLUGIN_EXTENSION', "tar,tar.gz"); 
  • branches/version-2_12-dev/html/install/sql/insert_data.sql

    r21582 r21583  
    12251225INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('OPTION_FAVOFITE_PRODUCT', '1', 523, 'お気に入り商品登録(有効:1 無効:0)'); 
    12261226INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('IMAGE_RENAME', 'true', 525, '画像リネーム設定 (商品画像のみ) (true:リネームする、false:リネームしない)'); 
    1227 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_DIR', '"plugins/"', 600, 'プラグインディレクトリ'); 
    1228 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_REALDIR', 'USER_REALDIR . PLUGIN_DIR', 601, 'プラグイン保存先'); 
    1229 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_URL', 'USER_URL . PLUGIN_DIR', 602, 'プラグイン URL'); 
    12301227INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_UPLOAD_REALDIR', 'DATA_REALDIR . "downloads/plugin/"', 604, 'プラグイン保存先'); 
    12311228INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_HTML_REALDIR', 'HTML_REALDIR . "plugin/"', 605, 'プラグイン外部ファイル保存先'); 
    1232 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_DIR_PERMISSION', '0777', 607, 'プラグイン・ディレクトリパーミッション'); 
    12331229INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_TEMP_REALDIR', 'HTML_REALDIR . "upload/temp_plugin/"', 608, 'プラグインファイル一時保存先'); 
    12341230INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('DOWNLOADS_TEMP_DIR', 'DATA_REALDIR . "downloads/tmp/"', 609, 'アップロード一時ディレクトリ'); 
    1235 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_HTML_URL', 'USER_URL . PLUGIN_DIR', 610, 'プラグイン 外部ファイルURL'); 
    12361231INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PLUGIN_EXTENSION', '"tar,tar.gz"', 611, 'プラグインファイル登録可能拡張子(カンマ区切り)'); 
    12371232INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR', 'DOWNLOADS_TEMP_DIR . "plugin_update/"', 612, 'プラグイン一時展開用ディレクトリ(アップデート用)'); 
Note: See TracChangeset for help on using the changeset viewer.