PHP code example of free2one / hyperf-php-accessor

1. Go to this page and download the library: Download free2one/hyperf-php-accessor 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/ */

    

free2one / hyperf-php-accessor example snippets



namespace App;

use PhpAccessor\Attribute\Data;

#[Data]
class Entity
{
    private int $id;

    private string $name;
}



declare(strict_types=1);

use Psr\Log\LogLevel;

return [
    'is_dev_mode' => true, // 是否开启开发模式,本地开发时建议开启,否则无法配合ide插件使用
    'proxy_root_directory' => '.php-accessor',
    'log_level' => LogLevel::DEBUG,
    'max_concurrent_processes' => 2,  
    'max_files_per_process' => 200,   
];
console
php bin/hyperf.php vendor:publish free2one/hyperf-php-accessor
json
{
    "scripts":{
        "php-accessor": "@php vendor/bin/php-accessor generate"
    }
}