SYSTEMPATH/Database/BaseConnection.php at line 407
400 break;
401 }
402 }
403 }
404
405 // We still don't have a connection?
406 if (! $this->connID) {
407 throw new DatabaseException(sprintf(
408 'Unable to connect to the database.%s%s',
409 PHP_EOL,
410 implode(PHP_EOL, $connectionErrors)
411 ));
412 }
413 }
414
Backtrace Server Request Response Files Memory
SYSTEMPATH/Database/BaseConnection.php : 577 — CodeIgniter\Database\BaseConnection->initialize ()
570 * @todo BC set $queryClass default as null in 4.1
571 */
572 public function query(string $sql, $binds = null, bool $setEscapeFlags = true, string $queryClass = '')
573 {
574 $queryClass = $queryClass ?: $this->queryClass;
575
576 if (empty($this->connID)) {
577 $this->initialize();
578 }
579
580 /**
581 * @var Query $query
582 */
583 $query = new $queryClass($this);
584
APPPATH/Core/View.php : 2212 — CodeIgniter\Database\BaseConnection->query ( arguments )
2205 }
2206 $sql = str_replace($this->_select_rt_name, 'sum('.$system['sum'].') as ct', $sql);
2207 break;
2208 }
2209 }
2210
2211 // 执行SQL
2212 $query = $mysql->query($sql);
2213
2214 if (!$query) {
2215 return 'SQL查询解析不正确:'.$sql;
2216 }
2217
2218 // 查询结果
2219 $data = $all ? $query->getResultArray() : $query->getRowArray();
APPPATH/Core/View.php : 1946 — Phpcmf\View->_query ( arguments )
1939 $sql_limit = "LIMIT {$system['num']}";
1940 }
1941
1942 $system['order'] = $this->_set_orders_field_prefix($system['order'], $_order); // 给排序字段加上表前缀
1943 $sql = "SELECT " .$this->_get_select_field($system['field'] ? $system['field'] : '*') . " FROM $sql_from " . ($sql_where ? "WHERE $sql_where" : "") . ($system['order'] == "null" || !$system['order'] ? "" : " ORDER BY {$system['order']}") . " $sql_limit";
1944 }
1945
1946 $data = $this->_query($sql, $system);
1947
1948 // 缓存查询结果
1949 if (is_array($data) && $data) {
1950 // 模块表的系统字段
1951 $fields['inputtime'] = ['fieldtype' => 'Date'];
1952 $fields['updatetime'] = ['fieldtype' => 'Date'];
1953 // 格式化显示自定义字段内容
/usr/home/xyu……/htdocs/cache/template/template_pc_default_home_index.html.cache.php : 26 — Phpcmf\View->list_tag ( arguments )
19
20
21
22
23
24
25
26 list_tag("action=module module=article thumb=1 num=5"); if ($list_return) extract($list_return, EXTR_OVERWRITE); $count=dr_count($return); if (is_array($return)) { $key=-1; foreach ($return as $t) { $key++; $is_first=$key==0 ? 1 : 0;$is_last=$count==$key+1 ? 1 : 0; ?>
27
28
29
30
31
32
33
include APPPATH/Core/View.php — include()
APPPATH/Control/Home.php : 21 — Phpcmf\View->display ( arguments )
14
15 ob_start();
16 \Phpcmf\Service::V()->assign([
17 'indexc' => 1,
18 'fix_html_now_url' => defined('IS_MOBILE') && IS_MOBILE ? SITE_MURL : SITE_URL,
19 ]);
20 \Phpcmf\Service::V()->assign(\Phpcmf\Service::L('Seo')->index());
21 \Phpcmf\Service::V()->display('index.html');
22 $html = ob_get_clean();
23
24 // 开启过首页静态时
25 if ($this->site_info[SITE_ID]['SITE_INDEX_HTML'] && !defined('SC_HTML_FILE')) {
26 if (IS_CLIENT) {
27 // 自定义终端
28 $file = \Phpcmf\Service::L('html')->get_webpath(SITE_ID, 'site', IS_CLIENT.'/index.html');
APPPATH/Control/Home.php : 60 — Phpcmf\Control\Home->_index ()
53 $this->_json(0, '禁止提交,请检查提交地址是否有误');
54 }
55
56 // 挂钩点 网站首页时
57 \Phpcmf\Hooks::trigger('cms_index');
58 \Phpcmf\Service::L('Router')->is_redirect_url(dr_url_prefix('/'));
59
60 $this->_index();
61 }
62
63 /**
64 * 404 页面
65 */
66 public function s404() {
67 if (IS_DEV) {
SYSTEMPATH/CodeIgniter.php : 824 — Phpcmf\Control\Home->index ()
817 {
818 // If this is a console request then use the input segments as parameters
819 $params = defined('SPARKED') ? $this->request->getSegments() : $this->router->params(); // @phpstan-ignore-line
820
821 if (method_exists($class, '_remap')) {
822 $output = $class->_remap($this->method, ...$params);
823 } else {
824 $output = $class->{$this->method}(...$params);
825 }
826
827 $this->benchmark->stop('controller');
828
829 return $output;
830 }
831
SYSTEMPATH/CodeIgniter.php : 410 — CodeIgniter\CodeIgniter->runController ( arguments )
403 if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {
404 throw PageNotFoundException::forMethodNotFound($this->method);
405 }
406
407 // Is there a "post_controller_constructor" event?
408 Events::trigger('post_controller_constructor');
409
410 $returned = $this->runController($controller);
411 } else {
412 $this->benchmark->stop('controller_constructor');
413 $this->benchmark->stop('controller');
414 }
415
416 // If $returned is a string, then the controller output something,
417 // probably a view, instead of echoing it directly. Send it along
SYSTEMPATH/CodeIgniter.php : 318 — CodeIgniter\CodeIgniter->handleRequest ( arguments )
311 $this->response->pretend($this->useSafeOutput)->send();
312 $this->callExit(EXIT_SUCCESS);
313
314 return;
315 }
316
317 try {
318 return $this->handleRequest($routes, $cacheConfig, $returnResponse);
319 } catch (RedirectException $e) {
320 $logger = Services::logger();
321 $logger->info('REDIRECTED ROUTE at ' . $e->getMessage());
322
323 // If the route is a 'redirect' route, it throws
324 // the exception with the $to as the message
325 $this->response->redirect(base_url($e->getMessage()), 'auto', $e->getCode());
APPPATH/Init.php : 486 — CodeIgniter\CodeIgniter->run ()
479 $env = new DotEnv(COREPATH);
480 $env->load();
481
482 helper('url');
483
484 $app = new \Phpcmf\Extend\CodeIgniter(new App());
485 $app->initialize();
486 $app->run();
require /usr/home/xyu……/htdocs/index.php — require()