Changeset 7023

Show
Ignore:
Timestamp:
11/20/08 18:16:50 (7 weeks ago)
Author:
inureyes
Message:

refs #777

  • 세션, 데이터베이스 연결 관련 loading 시퀀스 소정 및 재작성
Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/dispatcher.php

    r7022 r7023  
    1616    exit; 
    1717} 
     18/// Initialize PHP environment. 
     19include(ROOT.'/library/environment/Needlworks.PHP.UnifiedEnvironment.php'); 
    1820 
    1921/// Initialize class loader. 
     
    6062); 
    6163Validator::validateArray($_SERVER, $basicIV); 
    62 if(isset($accessInfo)) { 
    63     $basicIV = array( 
    64         'fullpath' => array('string'), 
    65         'input'    => array('string'), 
    66         'position' => array('string'), 
    67         'root'     => array('string'), 
    68         'input'    => array('string', 'mandatory' => false) 
    69     ); 
    70     $accessInfo['fullpath'] = urldecode($accessInfo['fullpath']); 
    71     Validator::validateArray($accessInfo, $basicIV); 
     64 
     65/* Database Initialization (if necessary) */ 
     66if(POD::bind($config->database) === false) { 
     67    Respond::MessagePage('Problem with connecting database.<br /><br />Please re-visit later.'); 
     68    exit; 
    7269} 
    73  
    74 /* TODO: Database Initialization (if necessary) 
    75  
    7670 
    7771/* TODO: Parse virtual blog information (if necessary)*/ 
     
    8074$context->globalVariableParser(); 
    8175 
     76/* TODO: Include required files */ 
     77 
    8278/* TODO: Session management. (if necessary) */ 
     79if (!defined('NO_SESSION')) { 
     80    session_name(Session::getName()); 
     81    Session::set(); 
     82    session_set_save_handler( array('Session','open'), array('Session','close'), array('Session','read'), array('Session','write'), array('Session','destroy'), array('Session','gc') ); 
     83    session_cache_expire(1); 
     84    session_set_cookie_params(0, '/', $service['domain']); 
     85    if (session_start() !== true) { 
     86        header('HTTP/1.1 503 Service Unavailable'); 
     87    } 
     88} 
     89 
    8390/* TODO: ACL validation */ 
    8491 
  • trunk/library/context.php

    r7022 r7023  
    126126 
    127127        // TODO: Parse $_GET, $_POST, and etc./ 
     128         
     129        /// Validate URI information. 
     130        if(isset($accessInfo)) { 
     131            $basicIV = array( 
     132                'fullpath' => array('string'), 
     133                'input'    => array('string'), 
     134                'position' => array('string'), 
     135                'root'     => array('string'), 
     136                'input'    => array('string', 'mandatory' => false) 
     137            ); 
     138            $accessInfo['fullpath'] = urldecode($accessInfo['fullpath']); 
     139            Validator::validateArray($accessInfo, $basicIV); 
     140        } 
    128141        $this->accessInfo = $accessInfo; 
    129142    } 
  • trunk/library/data/Setting.php

    r7022 r7023  
    55 
    66global $__gCacheBlogSettings; // share blog.service.php 
     7$__gCacheBlogSettings = array(); 
     8 
    79class Setting { 
    810    function fetchConfigVal( $DATA ){ 
  • trunk/library/environment/Needlworks.PHP.Core.php

    r6987 r7023  
    158158 
    159159    static function lessenAsEncoding($str, $length = 255, $tail = '...') { 
    160         global $database; 
    161         if(!isset($database['utf8']) || empty($database['utf8']) || $database['utf8'] == true) 
     160        $charset = POD::charset(); 
     161        if(!empty($charset) && $charset == 'utf8') 
    162162            return UTF8::lessen($str, $length, $tail); 
    163163        else 
  • trunk/library/include.php

    r7014 r7023  
    4242/***** Pre-define basic components *****/ 
    4343$__coreLibrary = array( 
    44     'environment/Needlworks.PHP.UnifiedEnvironment', 
    45     //'environment/Needlworks.PHP.Core', 
    4644    'environment/Locale', 
    4745    'data/Core', 
  • trunk/library/initialize.php

    r7020 r7023  
    44/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 
    55 
    6 /** 
    7      Database I/O initialization. 
    8    -------------------------------- 
    9 **/ 
    10 if(!empty($database) && !empty($database["database"])) { 
    11     if(POD::bind($database) === false) { 
    12         Respond::MessagePage('Problem with connecting database.<br /><br />Please re-visit later.'); 
    13         exit; 
    14     } 
    15 } 
    16 $database['utf8'] = (POD::charset() == 'utf8') ? true : false; 
     6 
    177/** 
    188      Memcache module bind (if possible) 
     
    2414    $memcache->connect((isset($memcached['server']) && $memcached['server'] ? $memcached['server'] : 'localhost')); 
    2515endif; 
    26  
    27 /** 
    28    Path-dependent environment setting 
    29    ---------------------------------- 
    30 **/ 
    31 //require ROOT.'/library/suri.php'; 
    32  
    33 /* Session initializing */ 
    34 if (!defined('NO_SESSION')) { 
    35     session_name(Session::getName()); 
    36     Session::set(); 
    37     session_set_save_handler( array('Session','open'), array('Session','close'), array('Session','read'), array('Session','write'), array('Session','destroy'), array('Session','gc') ); 
    38     session_cache_expire(1); 
    39     session_set_cookie_params(0, '/', $service['domain']); 
    40     if (session_start() !== true) { 
    41         header('HTTP/1.1 503 Service Unavailable'); 
    42     } 
    43 } 
    4416 
    4517/* Get User information */ 
  • trunk/library/model/blog.service.php

    r7022 r7023  
    33/// All rights reserved. Licensed under the GPL. 
    44/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 
    5  
    6 // for Global Cache 
    7 $__gCacheBlogSettings = array(); 
    85 
    96function getBlogSettings($blogid) { 
  • trunk/library/model/common.plugin.php

    r7020 r7023  
    423423        if (($previewMode == false) && !is_null($sidebarAllOrders)) { 
    424424            setBlogSetting("sidebarOrder", serialize($sidebarAllOrders)); 
    425             Skin::purgeCache(); 
     425            BlogSkin::purgeCache(); 
    426426        } 
    427427    } 
  • trunk/library/settings.php

    r7022 r7023  
    8181        return $val; 
    8282    } 
     83     
     84    public function set($category, $name, $value) { 
     85        $this->$category[$name] = $value;    
     86    } 
    8387} 
    8488