ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:30.56 GB of 70.42 GB (43.4%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ share/ php/ adodb/ - drwxr-xr-x

Directory:
Viewing file:     adodb-memcache.lib.inc.php (4.89 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

// security - hide paths
if (!defined('ADODB_DIR')) die();

global 
$ADODB_INCLUDED_MEMCACHE;
$ADODB_INCLUDED_MEMCACHE 1;

global 
$ADODB_INCLUDED_CSV;
if (empty(
$ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php');

/* 

  V5.06 16 Oct 2008  (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
  Whenever there is any discrepancy between the two licenses, 
  the BSD license will take precedence. See License.txt. 
  Set tabs to 4 for best viewing.
  
  Latest version is available at http://adodb.sourceforge.net

Usage:
  
$db = NewADOConnection($driver);
$db->memCache = true; /// should we use memCache instead of caching in files
$db->memCacheHost = array($ip1, $ip2, $ip3);
$db->memCachePort = 11211; /// this is default memCache port
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)

$db->Connect(...);
$db->CacheExecute($sql);
  
  Note the memcache class is shared by all connections, is created during the first call to Connect/PConnect.
  
  Class instance is stored in $ADODB_CACHE
*/

    
class ADODB_Cache_MemCache {
        var 
$createdir false// create caching directory structure?
        
        //-----------------------------
        // memcache specific variables
        
        
var $hosts;    // array of hosts
        
var $port 11211;
        var 
$compress false// memcache compression with zlib
        
        
var $_connected false;
        var 
$_memcache false;
        
        function 
ADODB_Cache_MemCache(&$obj)
        {
            
$this->hosts $obj->memCacheHost;
            
$this->port $obj->memCachePort;
            
$this->compress $obj->memCacheCompress;
        }
        
        
// implement as lazy connection. The connection only occurs on CacheExecute call
        
function connect(&$err)
        {
            if (!
function_exists('memcache_pconnect')) {
                
$err 'Memcache module PECL extension not found!';
                return 
false;
            }

            
$memcache = new MemCache;
            
            if (!
is_array($this->hosts)) $this->hosts = array($this->hosts);
        
            
$failcnt 0;
            foreach(
$this->hosts as $host) {
                if (!@
$memcache->addServer($host,$this->port,true)) {
                    
$failcnt += 1;
                }
            }
            if (
$failcnt == sizeof($this->hosts)) {
                
$err 'Can\'t connect to any memcache server';
                return 
false;
            }
            
$this->_connected true;
            
$this->_memcache $memcache;
            return 
true;
        }
        
        
// returns true or false. true if successful save
        
function writecache($filename$contents$debug$secs2cache)
        {
            if (!
$this->_connected) {
                
$err '';
                if (!
$this->connect($err) && $debugADOConnection::outp($err);
            }
            if (!
$this->_memcache) return false;
            
            if (!
$this->_memcache->set($filename$contents$this->compress$secs2cache)) {
                if (
$debugADOConnection::outp(" Failed to save data at the memcached server!<br>\n");
                return 
false;
            }
            
            return 
true;
        }
        
        
// returns a recordset
        
function readcache($filename, &$err$secs2cache$rsClass)
        {
            
$false false;
            if (!
$this->_connected$this->connect($err);
            if (!
$this->_memcache) return $false;
            
            
$rs $this->_memcache->get($filename);
            if (!
$rs) {
                
$err 'Item with such key doesn\'t exists on the memcached server.';
                return 
$false;
            }
            
            
// hack, should actually use _csv2rs
            
$rs explode("\n"$rs);
            unset(
$rs[0]);
            
$rs join("\n"$rs);
             
$rs unserialize($rs);
            if (! 
is_object($rs)) {
                
$err 'Unable to unserialize $rs';        
                return 
$false;
            }
            if (
$rs->timeCreated == 0) return $rs// apparently have been reports that timeCreated was set to 0 somewhere
            
            
$tdiff intval($rs->timeCreated+$secs2cache time());
            if (
$tdiff <= 2) {
                switch(
$tdiff) {
                    case 
2
                        if ((
rand() & 15) == 0) {
                            
$err "Timeout 2";
                            return 
$false;
                        }
                        break;
                    case 
1:
                        if ((
rand() & 3) == 0) {
                            
$err "Timeout 1";
                            return 
$false;
                        }
                        break;
                    default: 
                        
$err "Timeout 0";
                        return 
$false;
                }
            }
            return 
$rs;
        }
        
        function 
flushall($debug=false)
        {
            if (!
$this->_connected) {
                
$err '';
                if (!
$this->connect($err) && $debugADOConnection::outp($err);
            }
            if (!
$this->_memcache) return false;
            
            
$del $this->_memcache->flush();
            
            if (
$debug
                if (!
$delADOConnection::outp("flushall: failed!<br>\n");
                else 
ADOConnection::outp("flushall: succeeded!<br>\n");
                
            return 
$del;
        }
        
        function 
flushcache($filename$debug=false)
        {
            if (!
$this->_connected) {
                  
$err '';
                  if (!
$this->connect($err) && $debugADOConnection::outp($err); 
            } 
            if (!
$this->_memcache) return false;
  
            
$del $this->_memcache->delete($filename);
            
            if (
$debug
                if (!
$delADOConnection::outp("flushcache: $key entry doesn't exist on memcached server!<br>\n");
                else 
ADOConnection::outp("flushcache: $key entry flushed from memcached server!<br>\n");
                
            return 
$del;
        }
        
        
// not used for memcache
        
function createdir($dir$hash
        {
            return 
true;
        }
    }

?>
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.2025 seconds