} if(substr(Yii::$app->session['reader_referrer'],-14)!= "book/recommend"){ Yii::$app->session['reader_referrer'] = "/v2/book-library/detail/id/".$id; } $sql = "SELECT flash_pagesize FROM books WHERE id=:id"; $sql_t = "SELECT title FROM books WHERE id=:id"; $res = Yii::$app->book->createCommand($sql)->bindValues([':id' => $id])->queryScalar(); $title = Yii::$app->book->createCommand($sql_t)->bindValues([':id' => $id])->queryScalar(); $text = file(FILE_URL . '/books/pages/' . $id . '/text/word.csv'); $str = ''; foreach ((array)$text as $row) { $row = chop($row); if(!$row){ $pages[] = $str; $str = ''; }elseif(substr($row, 0, 2) == '**'){ continue; }else{
} $sql = "SELECT flash_pagesize FROM books WHERE id=:id"; $sql_t = "SELECT title FROM books WHERE id=:id"; $res = Yii::$app->book->createCommand($sql)->bindValues([':id' => $id])->queryScalar(); $title = Yii::$app->book->createCommand($sql_t)->bindValues([':id' => $id])->queryScalar(); $text = file(FILE_URL . '/books/pages/' . $id . '/text/word.csv'); $str = ''; foreach ((array)$text as $row) { $row = chop($row); if(!$row){ $pages[] = $str; $str = '';
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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();
} else { $l = Yii::$app->getRequest()->getPreferredLanguage(['en-US', 'zh-TW', 'zh', 'zh-CN', 'zh']); Yii::$app->language = $l; } }); (new yii\web\Application($config))->run();
$_GET = [ 'id' => '1396', ]; $_SESSION = [ '__flash' => [], 'reader_referrerstory' => 'https://www.bookteller.com/main/reader/story/id/1396', 'reader_referrer' => '/v2/book-library/detail/id/1396', ];