ap / cpanel-bundle
Symfony ApCpanelBundle
1.0.0
2014-07-12 18:08 UTC
This package is not auto-updated.
Last update: 2024-09-28 16:20:35 UTC
README
易于使用的Cpanel API包
步骤 1:使用composer下载ApCpanelBundle
运行以下命令添加ApCpanelBundle
$ php composer.phar require ap/cpanel-bundle 'dev-master'
步骤 2:注册ApCpanelBundle
在kernel中启用该包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Ap\CpanelBundle(), ); }
步骤 3:配置ApCpanelBundle
编辑您的config.yml文件
ap_cpanel: domain: yourdomain.com whmusername: yourusername whmhash: yourhashahahsshshshshdfasdfkjasadfasdf....
示例
<?php public function someAction() { //.. $cpanel = $this->container->get('ap_cpanel.api'); $accountsJson = $cpanel->listaccts()->exec(); $result = json_decode($accountsJson, TRUE); //.. }