onexcrm / sysinfo
laravel项目完整的系统环境详细信息指南
v2.1.0
2023-03-13 19:14 UTC
README
用于获取完整系统环境详细信息的包
安装
不依赖于PHP版本和LARAVEL版本
步骤 1: 运行composer命令
composer require onexcrm/sysinfo
步骤 2: Laravel无自动发现
如果您不使用自动发现,请将ServiceProvider添加到config/app.php中的providers数组
Onex\Sysinfo\OnexSysinfoServiceProvider::class,
如果您想使用外观来记录消息,请在app.php中添加以下内容
'OnexSysinfo' => Onex\Sysinfo\Sysinfo\SysinfoClassFacade::class,
步骤 3: 发布包配置
php artisan vendor:publish --provider="Onex\Sysinfo\OnexSysinfoServiceProvider" --force
如何使用?
通过路由直接使用
- >>
只需安装并运行以下路由
Ex: http://your-website/onex/check-sysinfo Ex: http://:8000/onex/check-sysinfo
在控制器中作为助手使用
- >>>
只需安装并调用以下方法
>> Ex1: OnexSysinfo::getSystemInfo();
>> Ex2: OnexSysinfo::getAllPaths();
>> Ex3: OnexSysinfo::isStorageWritable();
>> Ex4: OnexSysinfo::isCacheWritable();
>> Ex5: OnexSysinfo::getAllEnvs();
>> Ex6: OnexSysinfo::getServerInfo();
>> Ex7: OnexSysinfo::howManyTablesInDB();
>> Ex8: OnexSysinfo::getAllTablesName();
>> Ex9: OnexSysinfo::getEnabledPhpExtensions();
您可以在“config/onex-sysinfo.php”中修改配置设置
/** If you want to disable the route then make it false */ 'is_route_enabled' => true,
/** If you want to change the route prefix */ 'route_prefix' => 'onex',
/** If you want to change the route name or path */ 'route_name' => 'check-sysinfo',
/** If you want to enable the securiry for access the system information * Then make it ('is_enabled') true and also you can set login-id and password */ 'authentication' => [ 'is_enabled' => env('ONEX_SYSINFO_AUTH_ENABLED', false), 'login_id' => env('ONEX_SYSINFO_ID', 'onexadmin'), 'password' => env('ONEX_SYSINFO_PASSWORD', 'onexpassword') ]
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件
发布问题:如果有
如果有任何问题,请联系我。