Changeset 16304


Ignore:
Timestamp:
2007/10/06 21:46:53 (16 years ago)
Author:
nanasess
Message:

エラーメッセージ修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/conf/conf.php

    r16293 r16304  
    5959function defineConstants() { 
    6060    $CONF_PHP_PATH = realpath( dirname( __FILE__) ); 
    61     $errorMessage = "data/conf/cache/mtb_constants.php が生成できません\n" 
    62         . "data/conf/cache/にユーザ書込み権限(777等)を付与して下さい。"; 
     61    $errorMessage = "<div style='color: #F00; font-weight: bold; " 
     62        . "background-color: #FEB; text-align: center'>" 
     63        . $CONF_PHP_PATH 
     64        . "/cacheにユーザ書込み権限(777等)を付与して下さい。</div>"; 
     65 
    6366    // 定数を設定 
    6467    if (is_file($CONF_PHP_PATH . "/cache/mtb_constants.php")) { 
     
    7073 
    7174        $mtb_constants = file_get_contents($CONF_PHP_PATH . "/mtb_constants_init.php"); 
    72         $handle = fopen($CONF_PHP_PATH . "/cache/mtb_constants.php", "w"); 
    73         if (!$handle) { 
     75        if (is_writable($CONF_PHP_PATH . "/cache/")) { 
     76            $handle = fopen($CONF_PHP_PATH . "/cache/mtb_constants.php", "w"); 
     77            if (!$handle) { 
     78                die($errorMessage); 
     79            } 
     80            if (fwrite($handle, $mtb_constants) === false) { 
     81                die($errorMessage); 
     82            } 
     83            fclose($handle); 
     84 
     85            require_once($CONF_PHP_PATH . "/cache/mtb_constants.php"); 
     86        } else { 
    7487            die($errorMessage); 
    7588        } 
    76         if (fwrite($handle, $mtb_constants) === false) { 
    77             die($errorMessage); 
    78         } 
    79         fclose($handle); 
    80  
    81         require_once($CONF_PHP_PATH . "/cache/mtb_constants.php"); 
    8289    } else { 
    8390        die($CONF_PHP_PATH . "/mtb_constants_init.php"); 
Note: See TracChangeset for help on using the changeset viewer.