PHP code example of hyperf-apex / apex

1. Go to this page and download the library: Download hyperf-apex/apex library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hyperf-apex / apex example snippets


// config/autoload/logging.php
'channels' => [
    'default' => [/* Hyperf 骨架自带 */],
    'access' => [
        'handler' => [
            'class' => Monolog\Handler\StreamHandler::class,
            'constructor' => [
                'stream' => BASE_PATH . '/runtime/logs/access.log',
                'level' => Monolog\Level::Info,
            ],
        ],
        'formatter' => [
            'class' => Monolog\Formatter\LineFormatter::class,
            'constructor' => [],
        ],
    ],
],
bash
# 发布基础底座配置(access_log, integration, sql_log, startup_checks 等)
php bin/hyperf.php vendor:publish hyperf-apex/core --id=config

# 发布 ApiDoc 配置
php bin/hyperf.php vendor:publish hyperf-apex/apidoc --id=config

# 发布 Apifox 长连接契约导出配置(需先 composer f-apex/reliability --id=config
php bin/hyperf.php vendor:publish hyperf-apex/reliability --id=migrations

# 发布 Prometheus 监控配置
php bin/hyperf.php vendor:publish hyperf-apex/metrics --id=config

# 发布企业微信配置(多企业 corp_id / secret / 回调凭据)
php bin/hyperf.php vendor:publish hyperf-apex/wecom --id=config