Changeset 2078

Show
Ignore:
Timestamp:
11/28/07 03:07:02 (5 years ago)
Author:
takuya
Message:

/lang/php/Cache キャッシュをファイルに蓄積するあたりを修正 とくにキャッシュの初期化

Location:
lang/php/Cache/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/php/Cache/trunk/Handler.php

    r1528 r2078  
    88 * By Using or Custumizing plugin, 
    99 * All type of data can be cached ( Text, PHP Object, JPEG Image..etc ) 
    10  * @author      takuya morioka <takuya..1st@gmail.com> 
     10 * @author      takuya morioka <hatena id:takuya_1st> 
    1111 * @copyright   2005-2006 The Author 
    1212 * @license     PHP license 
  • lang/php/Cache/trunk/Resource/File.php

    r1523 r2078  
    243243    public function get( $id ) 
    244244    { 
    245         $content = file_get_contents( $this->getFullPath( $id ) ); 
     245        $content = @file_get_contents( $this->getFullPath( $id ) ); 
    246246        if ( !$content === false ) { 
    247247            return $content; 
     
    261261    public function getGroupList() 
    262262    { 
    263         $lines = file_get_contents( $this->getGroupListFileName() ); 
     263        $lines = @file_get_contents( $this->getGroupListFileName() ); 
    264264        $array = array(); 
    265265        foreach ( explode( "\n", $lines ) as $line ) { 
     
    296296            $groupnames = array( $groupnames ); 
    297297        } 
    298         $array = $this->getGroupList(); 
    299         $num   = sizeof( $array ); 
    300         foreach ( $groupnames as $groupname ) { 
    301             if ( $num == 0 ) { 
    302                 $array[] = array( $id, $groupname ); 
    303             } 
    304             foreach ( $array as $val ) { 
     298        $_array = $this->getGroupList(); 
     299        $num   = sizeof( $_array ); 
     300        if ( $num == 0 ) { 
     301            $_array[] = array( $id, $groupname ); 
     302        } 
     303       foreach ( $groupnames as $groupname ) { 
     304            foreach ( $_array as $val ) { 
    305305                // $val[0] is cache id, $val[1] is group name 
    306306                if ( $val[0] == $id && $val[1] == $groupname ) { 
    307                     continue; 
     307                    continue;//id is already exists in group 
    308308                } else { 
    309                     $array[] = array( $id, $groupname ); 
     309                    $_array[] = array( $id, $groupname ); 
    310310                } 
    311311            } 
    312312        } 
    313         if ( $num != sizeof( $array ) ) { 
    314             return $this->saveGroupList( $array ); 
     313        if ( $num != sizeof( $_array ) ) { 
     314            return $this->saveGroupList( $_array ); 
    315315        } else { 
    316316            return false; 
     
    433433    public function getModifiedList() 
    434434    { 
    435         $lines = file_get_contents( $this->_getModifiedListFileName() ); 
     435        $lines = @file_get_contents( $this->_getModifiedListFileName() ); 
    436436        $array = array(); 
    437437        foreach( explode( "\n", $lines ) as $line ){ 
     
    515515    public function getLifeTimeList() 
    516516    { 
    517         $lines = file_get_contents( $this->getLifeTimeFileName() ); 
     517        $lines = @file_get_contents( $this->getLifeTimeFileName() ); 
    518518        $array = array(); 
    519519        foreach( explode( "\n", $lines ) as $line ){ 
  • lang/php/Cache/trunk/Resource/Mirror.php

    r1523 r2078  
    6161    private function _target( $id = null ) 
    6262    { 
    63         return mt_srand($id) % sizeof( sizeof($this->resources) ); 
     63        return intval( mt_srand() % sizeof($this->resources) ); 
    6464    } 
    6565    /**