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 namespace Swoole\Model; /** * * @author Administrator * */ class Dict extends \..

Decoded Output download

<?php
namespace Swoole\Model;
/**
 * 
 * @author Administrator
 *
 */
class Dict extends \Swoole\Model
{
	public $table = 'swoole_dict';
	public $cache;
	public $_data;
	public $if_cache = false;
	public $cache_prefix = '';
	public $expire = 0;

	/**
	 * 
	 * @param $prefix
	 * @return unknown_type
	 */
	function setCachePrefix($prefix='swoole_dict_')
	{
	    $this->cache_prefix = $prefix;
	}
	/**
	 * 
	 * @param $cache
	 * @param $expire
	 * @return unknown_type
	 */
	function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
    /**
     * ID
     * @param $id
     * @return $value
     */
	function iget($id)
	{
		return $this->get($id)->get();
	}
    /**
     * ID
     * @param $fid
     * @param $order
     * @return unknown_type
     */
	function igets($fid=0,$order = 'id')
	{
		$gets['fid'] = $fid;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
    /**
     * 
     * @param $kpath
     * @param $order
     * @return $list
     */
	function pgets($kpath,$order='')
	{
		$gets['kpath'] = $kpath;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
    /**
     * 
     * @param $kpath
     * @param $order
     * @return $list
     */
	function pget($kpath,$kname)
	{
		$path = "$kpath/$kname";
		if($this->if_cache) $cache_data = $this->cache->get($this->cache_prefix.$path);
		else $cache_data = false;
		if($cache_data) return $cache_data;
		else
		{
			$get['kpath'] = $kpath;
			$get['limit'] = 1;
			$get['ckname'] = $kname;
			$res = 	$this->gets($get);
			if(empty($res))
			{
				Error::pecho("Not found $kpath/$kname");
				$de = debug_backtrace();
				foreach($de as $d)
				{
					echo $d['file'],':',$d['line'],"
<br />";
				}
				return false;
			}
			if($this->if_cache) $this->cache->set($this->cache_prefix.$path,$res[0],$this->expire);
			return $res[0];
		}
	}

	/**
	 * KEY
	 * @param $keyid
	 * @return unknown_type
	 */
	function kget($keyid)
	{
		if($this->if_cache) $cache_data = $this->cache->get($this->cache_prefix.$keyid);
		else $cache_data = false;
		if($cache_data) return $cache_data;
		else
		{
			$get['keyid'] = $keyid;
			$get['limit'] = 1;
			$data = $this->gets($get);
			if($this->if_cache) $this->cache->set($this->cache_prefix.$keyid,$data[0],$this->expire);
			return $data[0];
		}
	}
	/**
	 * KEY
	 * @param $keyid
	 * @return unknown_type
	 */
	function kgets($fkey)
	{
		$get['fkey'] = $fkey;
		$data = $this->gets($get);
		return $data;
	}
} ?>

Did this file decode correctly?

Original Code

<?php
namespace Swoole\Model;
/**
 * 
 * @author Administrator
 *
 */
class Dict extends \Swoole\Model
{
	public $table = 'swoole_dict';
	public $cache;
	public $_data;
	public $if_cache = false;
	public $cache_prefix = '';
	public $expire = 0;

	/**
	 * 
	 * @param $prefix
	 * @return unknown_type
	 */
	function setCachePrefix($prefix='swoole_dict_')
	{
	    $this->cache_prefix = $prefix;
	}
	/**
	 * 
	 * @param $cache
	 * @param $expire
	 * @return unknown_type
	 */
	function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
    /**
     * ID
     * @param $id
     * @return $value
     */
	function iget($id)
	{
		return $this->get($id)->get();
	}
    /**
     * ID
     * @param $fid
     * @param $order
     * @return unknown_type
     */
	function igets($fid=0,$order = 'id')
	{
		$gets['fid'] = $fid;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
    /**
     * 
     * @param $kpath
     * @param $order
     * @return $list
     */
	function pgets($kpath,$order='')
	{
		$gets['kpath'] = $kpath;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
    /**
     * 
     * @param $kpath
     * @param $order
     * @return $list
     */
	function pget($kpath,$kname)
	{
		$path = "$kpath/$kname";
		if($this->if_cache) $cache_data = $this->cache->get($this->cache_prefix.$path);
		else $cache_data = false;
		if($cache_data) return $cache_data;
		else
		{
			$get['kpath'] = $kpath;
			$get['limit'] = 1;
			$get['ckname'] = $kname;
			$res = 	$this->gets($get);
			if(empty($res))
			{
				Error::pecho("Not found $kpath/$kname");
				$de = debug_backtrace();
				foreach($de as $d)
				{
					echo $d['file'],':',$d['line'],"\n<br />";
				}
				return false;
			}
			if($this->if_cache) $this->cache->set($this->cache_prefix.$path,$res[0],$this->expire);
			return $res[0];
		}
	}

	/**
	 * KEY
	 * @param $keyid
	 * @return unknown_type
	 */
	function kget($keyid)
	{
		if($this->if_cache) $cache_data = $this->cache->get($this->cache_prefix.$keyid);
		else $cache_data = false;
		if($cache_data) return $cache_data;
		else
		{
			$get['keyid'] = $keyid;
			$get['limit'] = 1;
			$data = $this->gets($get);
			if($this->if_cache) $this->cache->set($this->cache_prefix.$keyid,$data[0],$this->expire);
			return $data[0];
		}
	}
	/**
	 * KEY
	 * @param $keyid
	 * @return unknown_type
	 */
	function kgets($fkey)
	{
		$get['fkey'] = $fkey;
		$data = $this->gets($get);
		return $data;
	}
}

Function Calls

None

Variables

None

Stats

MD5 1006064bd4824af7036b23e5b256dad9
Eval Count 0
Decode Time 124 ms