> For the complete documentation index, see [llms.txt](https://doc.kaliphp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.kaliphp.com/overview-usage.md).

# 基础用法

`web/index.php`是程序的主入口，其中有几个关键配置

```
header('Content-Type: text/html; charset=utf-8');

require_once __DIR__ . '/vendor/autoload.php';

use kaliphp\kali;

// 开启debug调试模式（会输出异常, web是html格式化的调试信息，ajax/app是json）
define('SYS_DEBUG', true);
// 开启Chrome Logger页面调试
 define('SYS_CONSOLE', true);
// 当前环境：dev pre pub
define('SYS_ENV', 'dev');
// 系统维护中。。。
define('isMaintenance', false);

// APP目录
define('APPPATH', __DIR__.'/app');
// APP信息
$app_config = [
    'session_start'  => true,                               // 是否启用session
    'check_purview_handle' => ['model\mod_auth', 'auth'],   // 权限检查
    'menu_file'  => 'menu.xml',                             // 获取菜单和用户权限配置
];
kali::registry( $app_config );
tpl::assign('title', 'KaliPHP DEMO');
// 运行MVC
kali::run();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.kaliphp.com/overview-usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
