查询单条
@param null $param
@return mixed
@throws \Exception
188594
public function find($param = null)
    {
        $bindParam = [];
        $where = '';
        if (is_array($param)) { //如果where是数组，则拼装where sql
            foreach ($param as $key => $value) {
                if (is_int($key)) {  //如果下标是数字，则不用下标拼装sql
                    $where .= $value . ' AND ';
                } else {
                    $where .= "$key=:$key AND ";
                    $bindParam[':' . $key] = $value;
                }
            }
            $where = 'WHERE ' . substr($where, 0, -4);
        } else { //如果$param是字符串 加 WHERE
            $where = empty($param) ? '': 'WHERE ' . $param;
        }
        $this->sql = "SELECT {$this->_fields} FROM {$this->_table} $where limit 1";
        $stmt = $this->execute($bindParam);
        return $stmt->fetch(\PDO::FETCH_ASSOC);
    }
409714
public function load($param = null)
    {
        try {
            if (empty($param['file'])) {
                throw new ConfigException(_('No config file was give please, the parameter '), 0, 1, __METHOD__, __LINE__);
            }
            $this->configFile = (string)$param['file'];

            if (isset($param['process-sections'])) {
                $this->processSections = (bool)$param['process-sections'];
            }
            if (isset($param['scanner-mode'])) {
                $this->scannerMode = (int)$param['scanner-mode'];
            }

            $data = parse_ini_file($this->configFile, $this->processSections, $this->scannerMode);

            $this->mainNode = new Node(null, IConfig::MAIN_NODE_KEY, 'main node');
            foreach ($data as $key => $group) {
                if (!is_array($group)) {
                    $newNode = new Node($this->mainNode, $key, $group);
                    $this->mainNode->addChild($newNode);
                    continue;
                }

                $newNode = new Node($this->mainNode, $key, $key);

                foreach ($group as $name => $value) {
                    $childNode = new Node($newNode, $name, $value);
                    $newNode->addChild($childNode);
                }
                $this->mainNode->addChild($newNode);
            }
        } catch (ConfigException $e) {
            throw $e;
        }
    }
307275
public static function configure($param = array('key' => null, 'secret' => null))
    {

        if (!$param['key'] && !$param['secret']) {
            Throw new \Exception('Api Key and Secret must be defined');
        }

        self::$API_SECRET = $param['secret'];
        self::$API_KEY = $param['key'];
    }
781177
public function hasParam($param)
	{
		$param = (string)$this->params[$param];
		
		return strlen($param) > 0 ? true : false;
	}
977409
public static  function parsePostJson($url = '', $param = '')
    {
        if (empty($url) || empty($param)) {
            return false;
        }
        $postUrl = $url;
        $curlPost = $param;
        $ch = curl_init(); //初始化curl
        curl_setopt($ch, CURLOPT_URL, $postUrl); //抓取指定网页
        curl_setopt($ch, CURLOPT_HEADER, 0); //设置header
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //要求结果为字符串且输出到屏幕上
        curl_setopt($ch, CURLOPT_POST, 1); //post提交方式
        curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
        $data = curl_exec($ch); //运行curl
        curl_close($ch);
        return json_decode($data, TRUE);
    }
776783
public function getConfParam($param, $default = null)
    {
        if (isset($this->params[$param])) {
            return $this->paymentHandler->formatConfigParam($param, $this->params[$param]);
        } elseif (isset($default)) {
            return $default;
        } else {
            throw new Exception("Configuration parameter '$param' not set for adapter '" . $this->name . "'");
        }
    }
69433
public static function valueView($param)
    {
        if (is_string($param)) {
            return '"' . $param . '"';
        } elseif (is_bool($param)) {
            return $param ? 'true' : 'false';
        } elseif (is_null($param)) {
            return 'null';
        } elseif (is_numeric($param)) {
            return $param;
        }

        throw new InvalidArgumentException('参数格式异常，只接受标量');
    }
1171288
public function getParam($param)
    {
        if (isset($this->_parentConfig))
            return ($this->_parentConfig->getParam($param));
        return (isset($this->_params[$param]) ? $this->_params[$param] : null);
    }
903526
public static function getInstance($param = null): Cache
    {
        if (!self::$instance instanceof self) {
            $param = json_decode(json_encode($param), true);

            self::$instance = new Cache(
                $param[self::IDX_ADAPTER_NAME],
                $param[self::IDX_PARAMETERS] ?? []
            );
        }

        return self::$instance;
    }
261170
public function load($param = null)
    {
        // if there already has been a config set it means it already
        // has been loaded so why bother retrying ! this is not a dynamic language !
        $configSet = $this->get('config_set');
        if (count((array) $configSet) > 0) return true;

        // if the config set already exists don't parse it
        if (empty($configSet) && !($configSet = $this->_getConfigSet())) {
            // set default config set for the default execution
            $configSet = [
                realpath("{$this->config_path}/" . (string)self::HIERACHY_PLACEHOLDER . (string)self::CONFIG_DELIMITER . (string)self::FILE_EXTENSION)
            ];
            $this->set('config_set', $configSet);
        }

        /**
         * create the total config parameter array and merge it recursive
         */
        try {
            if (empty($configSet) || !is_readable($configSet[0])) {
                throw new ConfigException("No default config file declared {$this->config_path}/" . self::HIERACHY_PLACEHOLDER . (string)self::CONFIG_DELIMITER . (string)self::FILE_EXTENSION);
            }

            $configParser = new \chilimatic\lib\config\configfile\Parser();
            // first insert point
            $node = null;
            foreach ($configSet as $config) {
                /**
                 * get the key for the config node
                 */
                $key = explode('/', $config);
                $key = substr(array_pop($key), 0, -4);

                $node = new Node($this->mainNode, $key, $config, 'self');
                $this->lastNewNode = $node;
                // add the config node
                $this->mainNode->addChild($node);

                unset($key);
                $configParser->parse($this->getConfigFileContent($config), $node);
            }

        } catch (ConfigException $e) {
            throw $e;
        }

        return true;
    }
25258
public static function getInstance($param = null)
    {
        if (!self::$instance instanceof Cache) {
            $type        = $param->type;
            $credentials = (property_exists($param, 'credentials')) ? $param->credentials : null;

            self::$instance = new Cache($type, $credentials);
        }

        return self::$instance;
    }
1169936
public static function getInstance(array $param = array())
    {
        if (!(self::$instance instanceof Handler)) {
            // construct the object
            self::$instance = new self();
        }

        if ($param)  {
            return self::$instance->{$param};
        }


        // return the object
        return self::$instance;
    }
697894
public function route( $param = null ) {
		$route = call_user_func( $this->get_route_resolver() );

		if ( is_null( $route ) || is_null( $param ) ) {
			return $route;
		}

		return array_key_exists( $param, $route[2] ) ? $route[2][ $param ] : null;
	}
427841
protected function parseParam($param)
    {
        $method = 'parse'.ucfirst($param);

        if (method_exists($this, $method)) {
            if ($params = $this->input($param)) {
                return $this->$method($params);
            }
        }
    }
892131
public function get($param)
    {
        if (isset($this->{$param})) {
            return $this->{$param};
        }

        throw new Exception(sprintf('Filter variable "%s" not found.', $param));
    }
1146339
public function init($param = null)
    {

        $this->setOptions($param);

        try {
            $this->readIndexList();
            // load the cache into the memory for faster access
            if (!empty($this->cacheListing)) {
                $this->loadCache();
            }
            $this->setConnected(true);

        } catch (CacheException $e) {
            throw $e;
        }

        return true;
    }
657974
public function execute($params = null)
    {
        $stmt = null;
        $attempt = 0;
        $retry = true;
        while ($retry) {
            $retry = false;
            try {
                $stmt = $this->stmt->execute($params);
            } catch (\Exception $e) {
                if ($this->conn->canTryAgain($attempt) && $this->conn->isRetryableException($e, $this->sql)) {
                    $this->conn->close();
                    $this->createStatement();
                    ++$attempt;
                    $retry = true;
                } else {
                    throw $e;
                }
            }
        }

        return $stmt;
    }