#BeanstalkAPIBundle A Symfony2 bundle for the Beanstalkapp API
This bundle uses a slightly modified version of the Beanstalk PHP API
##Installation
-
Add this bundle and the sfBeanstalk-PHP-API library as submodules
$ git submodule add https://chrisbarr@github.com/chrisbarr/BeanstalkAPIBundle.git vendor/bundles/Beanstalkapp/BeanstalkAPIBundle $ git submodule add https://chrisbarr@github.com/chrisbarr/sfBeanstalk-PHP-API.git vendor/Beanstalk
-
Add the namespaces to the autoloader
// app/autoload.php $loader->registerNamespaces(array( // ... 'Beanstalk' => DIR.'/../vendor', 'Beanstalkapp' => DIR.'/../vendor/bundles' ));
-
Initialise the bundle
// app/AppKernel.php public function registerBundles() { return array( // ... new Beanstalkapp\BeanstalkAPIBundle\BeanstalkAPIBundle() ); }
-
Set the required config - all 3 parameters are required
// app/config/config.yml beanstalk_api: account: my_account username: chris password: pass
##Usage
All Beanstalk API methods are available through the beanstalkapi
service - see https://github.com/chrisbarr/sfBeanstalk-PHP-API for available methods
All methods return SimpleXMLElement
objects
<?php
$beanstalk = $this->get('beanstalkapi');
$plans = $beanstalk->find_all_plans();