Changeset 5399 for trunk/prototype/api/cache/MemoryCache.php
- Timestamp:
- 01/18/12 16:10:57 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype
-
Property
svn:ignore
set to
.links.php.kate-swp
-
Property
svn:ignore
set to
-
trunk/prototype/api/cache/MemoryCache.php
r5341 r5399 42 42 43 43 public function __construct($conf=Null) { 44 $this->_memcache = new Memcache();45 $this->_config = $conf;44 //$this->_memcache = new Memcache(); 45 // $this->_config = $conf; 46 46 47 47 // host, port, persistent, weight 48 if($conf!==Null){49 foreach ($conf as $c){50 $result = $this->_memcache->addServer($c[0], $c[1], $c[2], $c[3]);51 }52 }53 else{54 $this->_memcache->addServer('localhost', 11211);55 }48 // if($conf!==Null){ 49 // foreach ($conf as $c){ 50 // $result = $this->_memcache->addServer($c[0], $c[1], $c[2], $c[3]); 51 // } 52 // } 53 // else{ 54 // $this->_memcache->addServer('localhost', 11211); 55 // } 56 56 } 57 57 … … 67 67 public function put($id, $data, $expire=0, $compressed=false){ 68 68 69 ob_start();70 print_r( "criando $id e armazenando no cache" );71 $output = ob_get_clean();72 file_put_contents( "/tmp/cache.log", file_get_contents( "/tmp/cache.log" ) . $output . "\n" );73 69 74 70 // if($compressed) … … 89 85 // $return = $this->_memcache->get($id); 90 86 $return = false; 91 92 if( $return ){93 ob_start();94 print_r( "lendo $id do cache" );95 $output = ob_get_clean();96 file_put_contents( "/tmp/cache.log", file_get_contents( "/tmp/cache.log" ) . $output . "\n" );97 }98 87 99 88 return( $return );
Note: See TracChangeset
for help on using the changeset viewer.