- Timestamp:
- 03/03/08 22:05:59 (5 years ago)
- Location:
- lang/php/Cache/trunk
- Files:
-
- 4 modified
-
Cache/Handler.php (modified) (2 diffs)
-
Cache/Handler/Resource/File.php (modified) (2 diffs)
-
Cache/Utils.php (modified) (2 diffs)
-
tests/Cache_Test.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/Cache/trunk/Cache/Handler.php
r6899 r7420 154 154 //キャッシュをドライバから読み出す、Templateメソッド 155 155 protected function readCache($id) { 156 if( $this->temp["id"]&& $this->temp["id"] === $id ) {156 if( isset($this->temp["id"]) && $this->temp["id"] === $id ) { 157 157 $data = $this->temp; 158 158 }else { … … 165 165 $this->temp=$data; 166 166 } 167 var_dump($this->temp); 167 168 return $data["content"]; 168 169 } -
lang/php/Cache/trunk/Cache/Handler/Resource/File.php
r7154 r7420 71 71 * @access public 72 72 */ 73 public function __construct( $ini )73 public function __construct( $ini=array() ) 74 74 { 75 75 foreach ( $ini as $key => $val ) { … … 594 594 $array[$line[0]] = $line[1]; 595 595 } 596 return $array;596 return sizeof($array)!=0 ? $array: null ; 597 597 } 598 598 /** -
lang/php/Cache/trunk/Cache/Utils.php
r6956 r7420 16 16 //require_once "Cache/Handler.php"; 17 17 //require_once "Cache/Handler/Resource/File.php"; 18 18 //TODO:File.php以外も使えるようにする。 19 19 function cache_get_contents($id, $path=null){ 20 20 //モジュールを確認 … … 24 24 $path = $path ? $path : $_SERVER["TMP"]; 25 25 $handler = new Cache_Handler(); 26 $handler->setResource(new Cache_Handler_Resource_File( $path));26 $handler->setResource(new Cache_Handler_Resource_File( array("path"=>$path))); 27 27 return $handler->getCache($id);; 28 28 } -
lang/php/Cache/trunk/tests/Cache_Test.php
r6957 r7420 12 12 require_once ("Cache/Utils.php"); 13 13 14 15 cache_put_contents( "test", "test1" );16 14 $id = "test_id_01"; 15 cache_put_contents( $id, "test1", "c:/cache" ); 16 $cache = cache_get_contents($id, "c:/cache");
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)