Changeset 17477 for branches


Ignore:
Timestamp:
2008/07/29 20:55:08 (18 years ago)
Author:
Seasoft
Message:

定数「HTML2DATA_DIR」と「DATA_PATH」が別々に定義されているのを常に「HTML2DATA_DIR」から生成するように変更。ディレクトリ構成の変更に柔軟に対応できることを目論む。

Location:
branches/comu-ver2/html
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/html/admin/require.php

    r17182 r17477  
    2121 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
    2222 */ 
    23 $include_dir = realpath(dirname( __FILE__)); 
    24 require_once($include_dir . "/../define.php"); 
     23 
     24$include_dir = realpath(dirname( __FILE__)) . '/'; 
     25 
     26if (!defined("HTML_PATH")) { 
     27    define("HTML_PATH", realpath($include_dir . '../') . '/'); 
     28} 
     29 
     30require_once(HTML_PATH . "define.php"); 
     31 
     32if (!defined("DATA_PATH")) { 
     33    define("DATA_PATH", HTML_PATH . HTML2DATA_DIR); 
     34} 
     35 
    2536if (!defined("CLASS_PATH")) { 
    2637    /** クラスパス */ 
    27     define("CLASS_PATH", $include_dir . "/.." . HTML2DATA_DIR . "class/"); 
     38    define("CLASS_PATH", DATA_PATH . "class/"); 
    2839} 
    2940 
    3041if (!defined("CLASS_EX_PATH")) { 
    3142    /** クラスパス */ 
    32     define("CLASS_EX_PATH", $include_dir . "/.." . HTML2DATA_DIR . "class_extends/"); 
     43    define("CLASS_EX_PATH", DATA_PATH . "class_extends/"); 
    3344} 
    3445 
    3546if (!defined("CACHE_PATH")) { 
    3647    /** キャッシュ生成ディレクトリ */ 
    37     define("CACHE_PATH", $include_dir . "/.." . HTML2DATA_DIR . "cache/"); 
     48    define("CACHE_PATH", DATA_PATH . "cache/"); 
    3849} 
    3950require_once(CLASS_EX_PATH . "SC_Initial_Ex.php"); 
     
    4253$objInit->init(); 
    4354 
    44 require_once($include_dir . "/.." . HTML2DATA_DIR . "include/module.inc"); 
     55 
     56require_once(DATA_PATH . "include/module.inc"); 
    4557require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 
    4658require_once(CLASS_EX_PATH . "util_extends/SC_Utils_Ex.php"); 
     
    6779require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Session_Ex.php"); 
    6880 
    69 require_once($include_dir . "/.." . HTML2DATA_DIR . "module/Mail.php"); 
    70 require_once($include_dir . "/.." . HTML2DATA_DIR . "module/Mail/mime.php"); 
     81require_once(DATA_PATH . "module/Mail.php"); 
     82require_once(DATA_PATH . "module/Mail/mime.php"); 
    7183 
    7284// インストールチェック 
     
    7587// セッションハンドラ開始 
    7688$objSession = new SC_Helper_Session_Ex(); 
     89 
    7790// セッション初期化・開始 
    7891require_once CLASS_PATH . 'session/SC_SessionFactory.php'; 
  • branches/comu-ver2/html/define.php

    r15745 r17477  
    11<?php 
    22/** HTMLディレクトリからのDATAディレクトリの相対パス */ 
    3 define("HTML2DATA_DIR", "/../data/"); 
     3define("HTML2DATA_DIR", "../data/"); 
    44 
    55/** DATA ディレクトリから HTML ディレクトリの相対パス */ 
    6 define("DATA_DIR2HTML", "/../html/"); 
     6define("DATA_DIR2HTML", "../html/"); 
    77 
    88/* 
  • branches/comu-ver2/html/install/index.php

    r17419 r17477  
    2323require_once("../require.php"); 
    2424$INSTALL_DIR = realpath(dirname( __FILE__)); 
    25 require_once("../" . HTML2DATA_DIR . "module/Request.php"); 
     25require_once(DATA_PATH . "module/Request.php"); 
    2626 
    2727define("INSTALL_LOG", "./temp/install.log"); 
     
    382382    // プログラムで書込みされるファイル・ディレクトリ 
    383383    $arrWriteFile = array( 
    384         ".." . HTML2DATA_DIR . "install.php", 
    385         "../user_data", 
    386         "../cp", 
    387         "../upload", 
    388         ".." . HTML2DATA_DIR . "cache/", 
    389         ".." . HTML2DATA_DIR . "class/", 
    390         ".." . HTML2DATA_DIR . "Smarty/", 
    391         ".." . HTML2DATA_DIR . "logs/", 
    392         ".." . HTML2DATA_DIR . "downloads/" 
     384        DATA_PATH . "install.php", 
     385        HTML_PATH . "user_data", 
     386        HTML_PATH . "cp", 
     387        HTML_PATH . "upload", 
     388        DATA_PATH . "cache/", 
     389        DATA_PATH . "class/", 
     390        DATA_PATH . "Smarty/", 
     391        DATA_PATH . "logs/", 
     392        DATA_PATH . "downloads/" 
    393393    ); 
    394394 
     
    434434    // 権限エラー等が発生していない場合 
    435435    if(!$err_file) { 
    436         $path = ".." . HTML2DATA_DIR . "Smarty/templates_c/admin"; 
     436        $path = DATA_PATH . "Smarty/templates_c/admin"; 
    437437        if(!file_exists($path)) { 
    438438            mkdir($path); 
    439439        } 
    440         $path = ".." . HTML2DATA_DIR . "Smarty/templates_c/mobile"; 
     440        $path = DATA_PATH . "Smarty/templates_c/mobile"; 
    441441        if(!file_exists($path)) { 
    442442            mkdir($path); 
    443443        } 
    444         $path = "../upload/temp_template"; 
     444        $path = HTML_PATH . "upload/temp_template"; 
    445445        if(!file_exists($path)) { 
    446446            mkdir($path); 
    447447        } 
    448         $path = "../upload/save_image"; 
     448        $path = HTML_PATH . "upload/save_image"; 
    449449        if(!file_exists($path)) { 
    450450            mkdir($path); 
    451451        } 
    452         $path = "../upload/temp_image"; 
     452        $path = HTML_PATH . "upload/temp_image"; 
    453453        if(!file_exists($path)) { 
    454454            mkdir($path); 
    455455        } 
    456         $path = "../upload/graph_image"; 
     456        $path = HTML_PATH . "upload/graph_image"; 
    457457        if(!file_exists($path)) { 
    458458            mkdir($path); 
    459459        } 
    460         $path = "../upload/mobile_image"; 
     460        $path = HTML_PATH . "upload/mobile_image"; 
    461461        if(!file_exists($path)) { 
    462462            mkdir($path); 
    463463        } 
    464         $path = "../upload/csv"; 
     464        $path = HTML_PATH . "upload/csv"; 
    465465        if(!file_exists($path)) { 
    466466            mkdir($path); 
    467467        } 
    468         $path = ".." . HTML2DATA_DIR . "downloads/module"; 
     468        $path = DATA_PATH . "downloads/module"; 
    469469        if(!file_exists($path)) { 
    470470            mkdir($path); 
    471471        } 
    472         $path = ".." . HTML2DATA_DIR . "downloads/update"; 
     472        $path = DATA_PATH . "downloads/update"; 
    473473        if(!file_exists($path)) { 
    474474            mkdir($path); 
     
    497497    $objPage->tpl_mode = 'step0_1'; 
    498498    // ファイルコピー 
    499     $objPage->copy_mess = SC_Utils_Ex::sfCopyDir("./user_data/", "../user_data/", $objPage->copy_mess); 
    500     $objPage->copy_mess = SC_Utils_Ex::sfCopyDir("./save_image/", "../upload/save_image/", $objPage->copy_mess); 
    501     return $objPage; 
    502 } 
    503  
    504 // STEP0_2画面の表示(ファイルのコピー) 
    505 function lfDispStep0_2($objPage) { 
    506     global $objWebParam; 
    507     global $objDBParam; 
    508     // hiddenに入力値を保持 
    509     $objPage->arrHidden = $objWebParam->getHashArray(); 
    510     // hiddenに入力値を保持 
    511     $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray()); 
    512     $objPage->arrHidden['db_skip'] = $_POST['db_skip']; 
    513     $objPage->arrHidden['agreement'] = $_POST['agreement']; 
    514     $objPage->tpl_mainpage = 'step0_1.tpl'; 
    515     $objPage->tpl_mode = 'step0_1'; 
    516     // ファイルコピー 
    517     $objPage->copy_mess =  SC_Utils_Ex::sfCopyDir("./user_data/", "../user_data/", $objPage->copy_mess); 
    518     $objPage->copy_mess =  SC_Utils_Ex::sfCopyDir("./save_image/", "../upload/save_image/", $objPage->copy_mess); 
     499    $objPage->copy_mess = SC_Utils_Ex::sfCopyDir("./user_data/", HTML_PATH . "user_data/", $objPage->copy_mess); 
     500    $objPage->copy_mess = SC_Utils_Ex::sfCopyDir("./save_image/", HTML_PATH . "upload/save_image/", $objPage->copy_mess); 
    519501    return $objPage; 
    520502} 
     
    623605    global $objDb; 
    624606 
    625     if(defined('HTML_PATH')) { 
    626         $install_dir = HTML_PATH; 
    627     } else { 
    628         $install_dir = realpath(dirname( __FILE__) . "/../") . "/"; 
    629     } 
    630  
    631607    if(defined('SITE_URL')) { 
    632608        $normal_url = SITE_URL; 
     
    658634    $objWebParam->addParam("管理者:ログインID", "login_id", MTEXT_LEN, "", array("EXIST_CHECK","EXIST_CHECK", "ALNUM_CHECK")); 
    659635    $objWebParam->addParam("管理者:パスワード", "login_pass", MTEXT_LEN, "", array("EXIST_CHECK","EXIST_CHECK", "ALNUM_CHECK")); 
    660     $objWebParam->addParam("インストールディレクトリ", "install_dir", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $install_dir); 
    661636    $objWebParam->addParam("URL(通常)", "normal_url", MTEXT_LEN, "", array("EXIST_CHECK","URL_CHECK","MAX_LENGTH_CHECK"), $normal_url); 
    662637    $objWebParam->addParam("URL(セキュア)", "secure_url", MTEXT_LEN, "", array("EXIST_CHECK","URL_CHECK","MAX_LENGTH_CHECK"), $secure_url); 
     
    812787    global $objWebParam; 
    813788    global $objDBParam; 
    814  
    815     $root_dir = $objWebParam->getValue('install_dir'); 
    816     $root_dir = str_replace("\\", "/", $root_dir); 
    817     // 語尾に'/'をつける 
    818     if (!ereg("/$", $root_dir)) { 
    819         $root_dir = $root_dir . "/"; 
    820     } 
    821  
     789    global $INSTALL_DIR; 
     790     
    822791    $normal_url = $objWebParam->getValue('normal_url'); 
    823792    // 語尾に'/'をつける 
     
    835804    $url_dir = ereg_replace("^https?://[a-zA-Z0-9_:~=&\?\.\-]+", "", $normal_url); 
    836805 
    837     $data_path = SC_Utils_Ex::sfRmDupSlash($root_dir . HTML2DATA_DIR); 
    838     $data_path = str_replace("\\", "/", realpath($data_path)); 
    839     // 語尾に'/'をつける 
    840     if (!ereg("/$", $data_path)) { 
    841         $data_path = $data_path . "/"; 
    842     } 
    843  
    844     $filepath = $data_path . "install.php"; 
     806    $filepath = DATA_PATH . "install.php"; 
    845807 
    846808    $config_data = 
    847809    "<?php\n". 
    848810    "    define ('ECCUBE_INSTALL', 'ON');\n" . 
    849     "    define ('HTML_PATH', '" . $root_dir . "');\n" . 
    850811    "    define ('SITE_URL', '" . $normal_url . "');\n" . 
    851812    "    define ('SSL_URL', '" . $secure_url . "');\n" . 
     
    858819    "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" . 
    859820    "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" . 
    860     "    define ('DATA_PATH', '".$data_path."');\n" . 
    861821    "    define ('MOBILE_HTML_PATH', HTML_PATH . 'mobile/');\n" . 
    862822    "    define ('MOBILE_SITE_URL', SITE_URL . 'mobile/');\n" . 
     
    869829        fclose($fp); 
    870830    } 
    871 /* install_mobile.incは使用しない用に変更 
    872  
    873     // モバイル版の設定ファイル install_mobile.inc を作成する。 
    874     $filepath = $data_path . "install_mobile.inc"; 
    875  
    876     $config_data = 
    877     "<?php\n". 
    878     "    define ('ECCUBE_INSTALL', 'ON');\n" . 
    879     "    define ('HTML_PATH', '" . $root_dir . "mobile/');\n" . 
    880     "    define ('PC_HTML_PATH', '" . $root_dir . "');\n" . 
    881     "    define ('SITE_URL', '" . $normal_url . "mobile/');\n" . 
    882     "    define ('PC_SITE_URL', '" . $normal_url . "');\n" . 
    883     "    define ('SSL_URL', '" . $secure_url . "mobile/');\n" . 
    884     "    define ('PC_SSL_URL', '" . $secure_url . "');\n" . 
    885     "    define ('URL_DIR', '" . $url_dir . "mobile/');\n" . 
    886     "    define ('PC_URL_DIR', '" . $url_dir . "');\n" . 
    887     "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" . 
    888     "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" . 
    889     "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" . 
    890     "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" . 
    891     "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" . 
    892     "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" . 
    893     "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" . 
    894     "    define ('DATA_PATH', '".$data_path."');\n" . 
    895     "?>"; 
    896  
    897     if($fp = fopen($filepath,"w")) { 
    898         fwrite($fp, $config_data); 
    899         fclose($fp); 
    900     } 
    901 */ 
    902831} 
    903832 
  • branches/comu-ver2/html/install/templates/step1.tpl

    r16724 r17477  
    7979    <table width="500" border="0" cellspacing="1" cellpadding="8" summary=" "> 
    8080        <tr> 
    81             <td bgcolor="#f2f1ec" width="150" class="fs12n">HTMLパス<span class="red">※</span></td> 
    82             <td bgcolor="#ffffff" width="332" class="fs12"> 
    83             <!--{assign var=key value="install_dir"}--> 
    84             <span class="red"><!--{$arrErr[$key]}--></span> 
    85             <input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|escape}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="40" class="box40" /> 
    86             </td> 
    87         </tr> 
    88         <tr> 
    8981            <td bgcolor="#f2f1ec" width="150" class="fs12n">URL(通常)<span class="red">※</span></td> 
    9082            <td bgcolor="#ffffff" width="332" class="fs12"> 
  • branches/comu-ver2/html/mobile/require.php

    r17137 r17477  
    2121 * along with this program; if not, write to the Free Software 
    2222 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     23 */ 
    2324 
    24  */ 
    25 $include_dir = realpath(dirname( __FILE__)); 
    26 require_once($include_dir . "/../define.php"); 
     25$include_dir = realpath(dirname( __FILE__)) . '/'; 
     26 
     27if (!defined("HTML_PATH")) { 
     28    define("HTML_PATH", realpath($include_dir . '../') . '/'); 
     29} 
     30 
     31require_once(HTML_PATH . "define.php"); 
     32 
     33if (!defined("DATA_PATH")) { 
     34    define("DATA_PATH", HTML_PATH . HTML2DATA_DIR); 
     35} 
     36 
    2737if (!defined("CLASS_PATH")) { 
    2838    /** クラスパス */ 
    29     define("CLASS_PATH", $include_dir . "/.." . HTML2DATA_DIR . "class/"); 
     39    define("CLASS_PATH", DATA_PATH . "class/"); 
    3040} 
    3141 
    3242if (!defined("CLASS_EX_PATH")) { 
    3343    /** クラスパス */ 
    34     define("CLASS_EX_PATH", $include_dir . "/.." . HTML2DATA_DIR . "class_extends/"); 
     44    define("CLASS_EX_PATH", DATA_PATH . "class_extends/"); 
    3545} 
    3646 
    3747if (!defined("CACHE_PATH")) { 
    3848    /** キャッシュ生成ディレクトリ */ 
    39     define("CACHE_PATH", $include_dir . "/.." . HTML2DATA_DIR . "cache/"); 
     49    define("CACHE_PATH", DATA_PATH . "cache/"); 
    4050} 
    4151require_once(CLASS_EX_PATH . "SC_Initial_Mobile_Ex.php"); 
     
    4454$objInit->init(); 
    4555 
    46 require_once($include_dir . "/.." . HTML2DATA_DIR . "include/module.inc"); 
     56 
     57require_once(DATA_PATH . "include/module.inc"); 
    4758require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 
    4859require_once(CLASS_EX_PATH . "util_extends/SC_Utils_Ex.php"); 
     
    7586require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Session_Ex.php"); 
    7687require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mail_Ex.php"); 
    77 include_once($include_dir . "/require_plugin.php"); 
     88include_once($include_dir . "require_plugin.php"); 
    7889 
    7990// セッションハンドラ開始 
  • branches/comu-ver2/html/require.php

    r17137 r17477  
    2222 */ 
    2323 
    24 $include_dir = realpath(dirname( __FILE__)); 
    25 require_once($include_dir . "/define.php"); 
     24$include_dir = realpath(dirname( __FILE__)) . '/'; 
     25 
     26if (!defined("HTML_PATH")) { 
     27    define("HTML_PATH", realpath($include_dir) . '/'); 
     28} 
     29 
     30require_once(HTML_PATH . "define.php"); 
     31 
     32if (!defined("DATA_PATH")) { 
     33    define("DATA_PATH", HTML_PATH . HTML2DATA_DIR); 
     34} 
     35 
    2636if (!defined("CLASS_PATH")) { 
    2737    /** クラスパス */ 
    28     define("CLASS_PATH", $include_dir . HTML2DATA_DIR . "class/"); 
     38    define("CLASS_PATH", DATA_PATH . "class/"); 
    2939} 
    3040 
    3141if (!defined("CLASS_EX_PATH")) { 
    3242    /** クラスパス */ 
    33     define("CLASS_EX_PATH", $include_dir . HTML2DATA_DIR . "class_extends/"); 
     43    define("CLASS_EX_PATH", DATA_PATH . "class_extends/"); 
    3444} 
    3545 
    3646if (!defined("CACHE_PATH")) { 
    3747    /** キャッシュ生成ディレクトリ */ 
    38     define("CACHE_PATH", $include_dir . HTML2DATA_DIR . "cache/"); 
     48    define("CACHE_PATH", DATA_PATH . "cache/"); 
    3949} 
    4050require_once(CLASS_EX_PATH . "SC_Initial_Ex.php"); 
     
    4454 
    4555 
    46 require_once($include_dir . HTML2DATA_DIR . "include/module.inc"); 
     56require_once(DATA_PATH . "include/module.inc"); 
    4757require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 
    4858require_once(CLASS_EX_PATH . "util_extends/SC_Utils_Ex.php"); 
     
    7686require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mail_Ex.php"); 
    7787require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mobile_Ex.php"); 
    78 include_once($include_dir . "/require_plugin.php"); 
     88include_once($include_dir . "require_plugin.php"); 
    7989 
    8090// セッションハンドラ開始 
Note: See TracChangeset for help on using the changeset viewer.