ap/cpanel-bundle

Symfony ApCpanelBundle

1.0.0 2014-07-12 18:08 UTC

This package is not auto-updated.

Last update: 2024-04-27 13:25:53 UTC


README

Easy to use Cpanel API bundle

Step 1: Download ApCpanelBundle using composer

Add ApCpanelBundle by running the command:

$ php composer.phar require ap/cpanel-bundle 'dev-master'

Step 2: Register the ApCpanelBundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Ap\CpanelBundle(),
    );
}

Step 3: Configure the ApCpanelBundle

Edit your config.yml:

ap_cpanel:
    domain: yourdomain.com
    whmusername: yourusername
    whmhash: yourhashahahsshshshshdfasdfkjasadfasdf....

Example:

<?php

public function someAction()
{
//..    
	$cpanel = $this->container->get('ap_cpanel.api');
	
    $accountsJson = $cpanel->listaccts()->exec();
    
    $result   = json_decode($accountsJson, TRUE);
//..    
}