Error Info: Connection refused
} if ($this->password !== null) { $this->executeCommand('AUTH', [$this->password]); } $this->executeCommand('SELECT', [$this->database]); $this->initConnection(); } else { \Yii::error("Failed to open redis DB connection ($connection): $errorNumber - $errorDescription", __CLASS__); $message = YII_DEBUG ? "Failed to open redis DB connection ($connection): $errorNumber - $errorDescription" : 'Failed to open DB connection.'; throw new Exception($message, $errorDescription, (int) $errorNumber); } } /** * Closes the currently active DB connection. * It does nothing if the connection is already closed. */ public function close() {
* See [redis protocol description](http://redis.io/topics/protocol) * for details on the mentioned reply types. * @throws Exception for commands that return [error reply](http://redis.io/topics/protocol#error-reply). */ public function executeCommand($name, $params = []) { $this->open(); array_unshift($params, $name); $command = '*' . count($params) . "\r\n"; foreach ($params as $arg) { $command .= '$' . mb_strlen($arg, '8bit') . "\r\n" . $arg . "\r\n"; }
/** * @inheritdoc */ protected function getValue($key) { return $this->redis->executeCommand('GET', [$key]); } /** * @inheritdoc */ protected function getValues($keys)
* @return mixed the value stored in cache, false if the value is not in the cache, expired, * or the dependency associated with the cached data has changed. */ public function get($key) { $key = $this->buildKey($key); $value = $this->getValue($key); if ($value === false || $this->serializer === false) { return $value; } elseif ($this->serializer === null) { $value = unserialize($value); } else { $value = call_user_func($this->serializer[1], $value);
if (is_string($this->cache)) { $this->cache = Yii::$app->get($this->cache, false); } if ($this->cache instanceof Cache) { $cacheKey = __CLASS__; $hash = md5(json_encode($this->rules)); if (($data = $this->cache->get($cacheKey)) !== false && isset($data[1]) && $data[1] === $hash) { $this->rules = $data[0]; } else { $this->rules = $this->buildRules($this->rules); $this->cache->set($cacheKey, [$this->rules, $hash]); } } else {
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
return $reflection->newInstanceArgs($dependencies); } if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) { // set $config as the last parameter (existing one will be overwritten) $dependencies[count($dependencies) - 1] = $config; return $reflection->newInstanceArgs($dependencies); } else { $object = $reflection->newInstanceArgs($dependencies); foreach ($config as $name => $value) { $object->$name = $value; } return $object;
public function get($class, $params = [], $config = []) { if (isset($this->_singletons[$class])) { // singleton return $this->_singletons[$class]; } elseif (!isset($this->_definitions[$class])) { return $this->build($class, $params, $config); } $definition = $this->_definitions[$class]; if (is_callable($definition, true)) { $params = $this->resolveDependencies($this->mergeParams($class, $params));
{ if (is_string($type)) { return static::$container->get($type, $params); } elseif (is_array($type) && isset($type['class'])) { $class = $type['class']; unset($type['class']); return static::$container->get($class, $params, $type); } elseif (is_callable($type, true)) { return call_user_func($type, $params); } elseif (is_array($type)) { throw new InvalidConfigException('Object configuration must be an array containing a "class" element.'); } else { throw new InvalidConfigException("Unsupported configuration type: " . gettype($type));
if (isset($this->_definitions[$id])) { $definition = $this->_definitions[$id]; if (is_object($definition) && !$definition instanceof Closure) { return $this->_components[$id] = $definition; } else { return $this->_components[$id] = Yii::createObject($definition); } } elseif ($throwException) { throw new InvalidConfigException("Unknown component ID: $id"); } else { return null; }
/** * Returns the URL manager for this application. * @return \yii\web\UrlManager the URL manager for this application. */ public function getUrlManager() { return $this->get('urlManager'); } /** * Returns the internationalization (i18n) component * @return \yii\i18n\I18N the internationalization application component. */
* Resolves the current request into a route and the associated parameters. * @return array the first element is the route, and the second is the associated parameters. * @throws NotFoundHttpException if the request cannot be resolved. */ public function resolve() { $result = Yii::$app->getUrlManager()->parseRequest($this); if ($result !== false) { list ($route, $params) = $result; if ($this->_queryParams === null) { $_GET = $params + $_GET; // preserve numeric keys } else { $this->_queryParams = $params + $this->_queryParams;
* @return Response the resulting response * @throws NotFoundHttpException if the requested route is invalid */ public function handleRequest($request) { if (empty($this->catchAll)) { list ($route, $params) = $request->resolve(); } else { $route = $this->catchAll[0]; $params = $this->catchAll; unset($params[0]); } try {
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
); // 加载数据库配置文件 require(__DIR__ . '/../../common/config/db.php'); $application = new yii\web\Application($config); $application->run();
<?php //defined('YII_DEBUG') or define('YII_DEBUG', true); //defined('YII_ENV') or define('YII_ENV', 'dev'); require('/data/www/i.iheima.com/platform_i/web/index.php'); ?>
$_SERVER = [ 'TEMP' => '/tmp', 'TMPDIR' => '/tmp', 'TMP' => '/tmp', 'HOSTNAME' => '', 'USER' => 'nginx', 'HOME' => '/home/nginx', 'FCGI_ROLE' => 'RESPONDER', 'SCRIPT_FILENAME' => '/data/www/cmstop/public/www/iheima/index.php', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'CONTENT_TYPE' => '', 'CONTENT_LENGTH' => '', 'SCRIPT_NAME' => '/index.php', 'REQUEST_URI' => '/article-328114.html', 'DOCUMENT_URI' => '/index.php', 'DOCUMENT_ROOT' => '/data/www/cmstop/public/www/iheima', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_SCHEME' => 'http', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_SOFTWARE' => 'nginx/1.15.8', 'REMOTE_ADDR' => '43.134.229.100', 'REMOTE_PORT' => '33184', 'SERVER_ADDR' => '10.51.57.130', 'SERVER_PORT' => '80', 'SERVER_NAME' => 'i.iheima.com', 'REDIRECT_STATUS' => '200', 'HTTP_HOST' => 'i.iheima.com', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Baiduspider-render/3.0; Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.1 Safari/537.36', 'HTTP_REFERER' => 'http://i.iheima.com', 'HTTP_COOKIE' => 'PSTM=1732390568; Group=spider_bot:FG=1; Channel=i.iheima.com', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE' => 'zh-CN,zh;q=0.9', 'HTTP_DNT' => '1', 'HTTP_ORIGIN' => 'http://i.iheima.com', 'HTTP_CLIENT_IP' => '116.179.37.229', 'HTTP_X_FORWARDED_FOR' => '116.179.37.229', 'HTTP_X_REAL_IP' => '116.179.37.229', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1732390568.6122920513153076171875, 'REQUEST_TIME' => 1732390568, ]; $_COOKIE = [ 'PSTM' => '1732390568', 'Group' => 'spider_bot:FG=1', 'Channel' => 'i.iheima.com', ];
tric大床房英文量体温英语harmedtubi89long的名词身份证英语怎么说fortun共享英文无处愚鲁米用英语怎么说saw什么意思pola怎么读公共场所英语大众汽车英文coinage色目trudy大的读音ram什么意思王章true副词Peering塑料袋英语男生英文黄油的英文chewable存在英语绵羊英语故宫博物院英文博物馆的英语阳光的拼音峭拔诱导翻译鸽子的英文失明的英语sicklydigested嗾使账号英语小手的拼音航班英语足球场的英文善用家乡的英语交通事故英文SAPI北海道英文头像英文怎么说温和的高岑邪恶a刷牙英语怎么说屁眼英文宝花气球的英语怎么读健康的的英文文化拼音look词组望见谅踢英语diyise夫人英文手戟饿的英语亚历山大英语令人不齿lisa英文名浅酌私人英语one的用法猎头英文SCAN什么意思晚春翻译e的定义达姆数字的读法发现用英语怎么说围拢smatercache是什么铁路售票员第十三英语hide怎么读lawmaker等候的英文lora怎么读hi怎么读克兰菲尔德despiseda声调语言英语怎么说行李英语以后英语色的英文禁受去钓鱼英语交通事故英语定位英语商人用英语怎么说titl一点的英文前所未见娱乐拼音烟花英语der塔量测our的意思山竹英语鸟繁体仿效厘升走廊英语宝藏英语aeolian别墅拼音控制的拼音灵薄狱乔治英文名丘陵的意思塔耳塔洛斯phatic岔子杰克英语goad挺括幽僻什么是同性恋另当别论预警的拼音糖果的英语怎么写厨房拼音香蕉banana环境拼音自学的英语rotator跛足鸡蛋的英语j怎么发音迅疾声音的英语滑冰的英语chins前面的英语f代表什么抺socio乘飞机英语请假英语怎么说扎针的拼音angry副词famil摇篮曲英文憎恶的意思没用的英文亚运会英语enging杭州英文石头的英语前天英文知识读音租赁怎么读五州asse跆拳道的英文汤的英语交易的英文已经英文迳行传递英语拉链英语雨天英语打伞的拼音漂亮单词前襟器量晚饭用英语怎么说潘多拉英文k的笔顺nime英语通知上课的拼音meIluge密闭刚刚英语幸福的英语单词年龄用英语怎么说sanired的音标大街英文rain的音标喻义另外英语vivud教育英语怎么说ppt是啥私人订制英文fly什么意思barrie