Changeset 2078
- Timestamp:
- 11/28/07 03:07:02 (5 years ago)
- Location:
- lang/php/Cache/trunk
- Files:
-
- 3 modified
-
Handler.php (modified) (1 diff)
-
Resource/File.php (modified) (5 diffs)
-
Resource/Mirror.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/Cache/trunk/Handler.php
r1528 r2078 8 8 * By Using or Custumizing plugin, 9 9 * 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> 11 11 * @copyright 2005-2006 The Author 12 12 * @license PHP license -
lang/php/Cache/trunk/Resource/File.php
r1523 r2078 243 243 public function get( $id ) 244 244 { 245 $content = file_get_contents( $this->getFullPath( $id ) );245 $content = @file_get_contents( $this->getFullPath( $id ) ); 246 246 if ( !$content === false ) { 247 247 return $content; … … 261 261 public function getGroupList() 262 262 { 263 $lines = file_get_contents( $this->getGroupListFileName() );263 $lines = @file_get_contents( $this->getGroupListFileName() ); 264 264 $array = array(); 265 265 foreach ( explode( "\n", $lines ) as $line ) { … … 296 296 $groupnames = array( $groupnames ); 297 297 } 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 ) { 305 305 // $val[0] is cache id, $val[1] is group name 306 306 if ( $val[0] == $id && $val[1] == $groupname ) { 307 continue; 307 continue;//id is already exists in group 308 308 } else { 309 $ array[] = array( $id, $groupname );309 $_array[] = array( $id, $groupname ); 310 310 } 311 311 } 312 312 } 313 if ( $num != sizeof( $ array ) ) {314 return $this->saveGroupList( $ array );313 if ( $num != sizeof( $_array ) ) { 314 return $this->saveGroupList( $_array ); 315 315 } else { 316 316 return false; … … 433 433 public function getModifiedList() 434 434 { 435 $lines = file_get_contents( $this->_getModifiedListFileName() );435 $lines = @file_get_contents( $this->_getModifiedListFileName() ); 436 436 $array = array(); 437 437 foreach( explode( "\n", $lines ) as $line ){ … … 515 515 public function getLifeTimeList() 516 516 { 517 $lines = file_get_contents( $this->getLifeTimeFileName() );517 $lines = @file_get_contents( $this->getLifeTimeFileName() ); 518 518 $array = array(); 519 519 foreach( explode( "\n", $lines ) as $line ){ -
lang/php/Cache/trunk/Resource/Mirror.php
r1523 r2078 61 61 private function _target( $id = null ) 62 62 { 63 return mt_srand($id) % sizeof(sizeof($this->resources) );63 return intval( mt_srand() % sizeof($this->resources) ); 64 64 } 65 65 /**
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)