Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php // +---------------------------------------------------------------------- // | Thin..

Decoded Output download

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------

/**
 * Think 
 */

defined('TEMP_PATH')    or define('TEMP_PATH',      RUNTIME_PATH.'Temp/'); // 
defined('DATA_PATH')    or define('DATA_PATH',      RUNTIME_PATH.'Data/'); // 

/**
 *  
 * @param string|array $name 
 * @param mixed $value 
 * @param mixed $default 
 * @return mixed
 */
function C($name=null, $value=null,$default=null) {
    static $_config = array();
    //
    $convention = array(
        /*  */
        'DB_TYPE'               =>  '',     // 
        'DB_HOST'               =>  '', // 
        'DB_NAME'               =>  '',          // 
        'DB_USER'               =>  '',      // 
        'DB_PWD'                =>  '',          // 
        'DB_PORT'               =>  '',        // 
        'DB_PREFIX'             =>  '',    // 
        'DB_PARAMS'          	=>  array(), // 
        'DB_FIELDS_CACHE'       =>  true,        // 
        'DB_CHARSET'            =>  'utf8',      // utf8
        'DB_DEPLOY_TYPE'        =>  0, // :0 (),1 ()
        'DB_RW_SEPARATE'        =>  false,       //  
        'DB_MASTER_NUM'         =>  1, //  
        'DB_SLAVE_NO'           =>  '', // 

        /*  */
        'DATA_CACHE_TIME'       =>  0,      //  0
        'DATA_CACHE_COMPRESS'   =>  false,   // 
        'DATA_CACHE_CHECK'      =>  false,   // 
        'DATA_CACHE_PREFIX'     =>  '',     // 
        'DATA_CACHE_TYPE'       =>  'File',  // ,:File|Db|Apc|Memcache|Shmop|Sqlite|Xcache|Apachenote|Eaccelerator
        'DATA_CACHE_PATH'       =>  TEMP_PATH,//  (File)
        'DATA_CACHE_KEY'        =>  '',	// KEY (File)    
        'DATA_CACHE_SUBDIR'     =>  false,    //  ()
        'DATA_PATH_LEVEL'       =>  1,        // 
        'DATA_CACHE_TABLE'      =>  'cache_db', // 
    );
    $_config = Yaf_Registry::get("config")->think->toArray();
    $_config = array_merge($convention, $_config);
    // 
    if (empty($name)) {
        return $_config;
    }
    // 
    if (is_string($name)) {
        if (!strpos($name, '.')) {
            $name = strtoupper($name);
            if (is_null($value))
                return isset($_config[$name]) ? $_config[$name] : $default;
            $_config[$name] = $value;
            return null;
        }
        // 
        $name = explode('.', $name);
        $name[0]   =  strtoupper($name[0]);
        if (is_null($value))
            return isset($_config[$name[0]][$name[1]]) ? $_config[$name[0]][$name[1]] : $default;
        $_config[$name[0]][$name[1]] = $value;
        return null;
    }
    // 
    if (is_array($name)){
        $_config = array_merge($_config, array_change_key_case($name,CASE_UPPER));
        return null;
    }
    return null; // 
}

/**
 * 
 * @param string $msg 
 * @param integer $code  0
 * @return void
 */
function E($msg, $code=0) {
    throw new YAF_Exception($msg, $code);
}

/**
 *   
 * @param string $name 
 * @param mixed $value 
 * @param string $path 
 * @return mixed
 */
function F($name, $value='', $path=DATA_PATH) {
    static $_cache  =   array();
    $filename       =   $path . $name . '.php';
    if ('' !== $value) {
        if (is_null($value)) {
            // 
            if(false !== strpos($name,'*')){
                return false; // TODO 
            }else{
                unset($_cache[$name]);
                return Storage::unlink($filename,'F');
            }
        } else {
            Storage::put($filename,serialize($value),'F');
            // 
            $_cache[$name]  =   $value;
            return null;
        }
    }
    // 
    if (isset($_cache[$name]))
        return $_cache[$name];
    if (Storage::has($filename,'F')){
        $value      =   unserialize(Storage::read($filename,'F'));
        $_cache[$name]  =   $value;
    } else {
        $value          =   false;
    }
    return $value;
}

/**
 * 
 * @param mixed $name 
 * @param mixed $value 
 * @param mixed $options 
 * @return mixed
 */
function S($name,$value='',$options=null) {
    static $cache   =   '';
    if(is_array($options)){
        // 
        $type       =   isset($options['type'])?$options['type']:'';
        $cache      =   Cache::getInstance($type,$options);
    }elseif(is_array($name)) { // 
        $type       =   isset($name['type'])?$name['type']:'';
        $cache      =   Cache::getInstance($type,$name);
        return $cache;
    }elseif(empty($cache)) { // 
        $cache      =   Cache::getInstance();
    }
    if(''=== $value){ // 
        return $cache->get($name);
    }elseif(is_null($value)) { // 
        return $cache->rm($name);
    }else { // 
        if(is_array($options)) {
            $expire     =   isset($options['expire'])?$options['expire']:NULL;
        }else{
            $expire     =   is_numeric($options)?$options:NULL;
        }
        return $cache->set($name, $value, $expire);
    }
}

/**
 * PHP
 * @param mixed $mix 
 * @return string
 */
function to_guid_string($mix) {
    if (is_object($mix)) {
        return spl_object_hash($mix);
    } elseif (is_resource($mix)) {
        $mix = get_resource_type($mix) . strval($mix);
    } else {
        $mix = serialize($mix);
    }
    return md5($mix);
} ?>

Did this file decode correctly?

Original Code

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------

/**
 * Think 
 */

defined('TEMP_PATH')    or define('TEMP_PATH',      RUNTIME_PATH.'Temp/'); // 
defined('DATA_PATH')    or define('DATA_PATH',      RUNTIME_PATH.'Data/'); // 

/**
 *  
 * @param string|array $name 
 * @param mixed $value 
 * @param mixed $default 
 * @return mixed
 */
function C($name=null, $value=null,$default=null) {
    static $_config = array();
    //
    $convention = array(
        /*  */
        'DB_TYPE'               =>  '',     // 
        'DB_HOST'               =>  '', // 
        'DB_NAME'               =>  '',          // 
        'DB_USER'               =>  '',      // 
        'DB_PWD'                =>  '',          // 
        'DB_PORT'               =>  '',        // 
        'DB_PREFIX'             =>  '',    // 
        'DB_PARAMS'          	=>  array(), // 
        'DB_FIELDS_CACHE'       =>  true,        // 
        'DB_CHARSET'            =>  'utf8',      // utf8
        'DB_DEPLOY_TYPE'        =>  0, // :0 (),1 ()
        'DB_RW_SEPARATE'        =>  false,       //  
        'DB_MASTER_NUM'         =>  1, //  
        'DB_SLAVE_NO'           =>  '', // 

        /*  */
        'DATA_CACHE_TIME'       =>  0,      //  0
        'DATA_CACHE_COMPRESS'   =>  false,   // 
        'DATA_CACHE_CHECK'      =>  false,   // 
        'DATA_CACHE_PREFIX'     =>  '',     // 
        'DATA_CACHE_TYPE'       =>  'File',  // ,:File|Db|Apc|Memcache|Shmop|Sqlite|Xcache|Apachenote|Eaccelerator
        'DATA_CACHE_PATH'       =>  TEMP_PATH,//  (File)
        'DATA_CACHE_KEY'        =>  '',	// KEY (File)    
        'DATA_CACHE_SUBDIR'     =>  false,    //  ()
        'DATA_PATH_LEVEL'       =>  1,        // 
        'DATA_CACHE_TABLE'      =>  'cache_db', // 
    );
    $_config = Yaf_Registry::get("config")->think->toArray();
    $_config = array_merge($convention, $_config);
    // 
    if (empty($name)) {
        return $_config;
    }
    // 
    if (is_string($name)) {
        if (!strpos($name, '.')) {
            $name = strtoupper($name);
            if (is_null($value))
                return isset($_config[$name]) ? $_config[$name] : $default;
            $_config[$name] = $value;
            return null;
        }
        // 
        $name = explode('.', $name);
        $name[0]   =  strtoupper($name[0]);
        if (is_null($value))
            return isset($_config[$name[0]][$name[1]]) ? $_config[$name[0]][$name[1]] : $default;
        $_config[$name[0]][$name[1]] = $value;
        return null;
    }
    // 
    if (is_array($name)){
        $_config = array_merge($_config, array_change_key_case($name,CASE_UPPER));
        return null;
    }
    return null; // 
}

/**
 * 
 * @param string $msg 
 * @param integer $code  0
 * @return void
 */
function E($msg, $code=0) {
    throw new YAF_Exception($msg, $code);
}

/**
 *   
 * @param string $name 
 * @param mixed $value 
 * @param string $path 
 * @return mixed
 */
function F($name, $value='', $path=DATA_PATH) {
    static $_cache  =   array();
    $filename       =   $path . $name . '.php';
    if ('' !== $value) {
        if (is_null($value)) {
            // 
            if(false !== strpos($name,'*')){
                return false; // TODO 
            }else{
                unset($_cache[$name]);
                return Storage::unlink($filename,'F');
            }
        } else {
            Storage::put($filename,serialize($value),'F');
            // 
            $_cache[$name]  =   $value;
            return null;
        }
    }
    // 
    if (isset($_cache[$name]))
        return $_cache[$name];
    if (Storage::has($filename,'F')){
        $value      =   unserialize(Storage::read($filename,'F'));
        $_cache[$name]  =   $value;
    } else {
        $value          =   false;
    }
    return $value;
}

/**
 * 
 * @param mixed $name 
 * @param mixed $value 
 * @param mixed $options 
 * @return mixed
 */
function S($name,$value='',$options=null) {
    static $cache   =   '';
    if(is_array($options)){
        // 
        $type       =   isset($options['type'])?$options['type']:'';
        $cache      =   Cache::getInstance($type,$options);
    }elseif(is_array($name)) { // 
        $type       =   isset($name['type'])?$name['type']:'';
        $cache      =   Cache::getInstance($type,$name);
        return $cache;
    }elseif(empty($cache)) { // 
        $cache      =   Cache::getInstance();
    }
    if(''=== $value){ // 
        return $cache->get($name);
    }elseif(is_null($value)) { // 
        return $cache->rm($name);
    }else { // 
        if(is_array($options)) {
            $expire     =   isset($options['expire'])?$options['expire']:NULL;
        }else{
            $expire     =   is_numeric($options)?$options:NULL;
        }
        return $cache->set($name, $value, $expire);
    }
}

/**
 * PHP
 * @param mixed $mix 
 * @return string
 */
function to_guid_string($mix) {
    if (is_object($mix)) {
        return spl_object_hash($mix);
    } elseif (is_resource($mix)) {
        $mix = get_resource_type($mix) . strval($mix);
    } else {
        $mix = serialize($mix);
    }
    return md5($mix);
}

Function Calls

defined 1

Variables

None

Stats

MD5 b53c0791a21465d4137a207c6c60bba9
Eval Count 0
Decode Time 101 ms