2017 © Pedro Peláez
 

library laravel-webfaction

Webfaction API wrapper for Laravel

image

subdesign/laravel-webfaction

Webfaction API wrapper for Laravel

  • Monday, July 16, 2018
  • by bszalai
  • Repository
  • 2 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

DEPRECATION WARNING

Webfaction will end it's services possibly from May 2021, so the package won't be maintained in the future., (*1)

Laravel-Webfaction

Webfaction API wrapper for Laravel, (*2)

Requirements

Laravel 5.x, (*3)

Installation

Install with composer, (*4)

composer require subdesign/laravel-webfaction:^1.0.0

If you use Laravel 5.5+, you don't need to do the following two steps., (*5)

Add Service Provider to the config/app.php, (*6)

Subdesign\LaravelWebfaction\WebfactionServiceProvider::class,

Add Facade to the config/app.php, (*7)

'Webfaction' => Subdesign\LaravelWebfaction\Facades\Webfaction::class,

Publish the webfaction.php config file, (*8)

php artisan vendor:publish --provider="Subdesign\LaravelWebfaction\WebfactionServiceProvider"

Set the credentials and other data in the .env file, (*9)

WF_USERNAME=  
WF_PASSWORD=
WF_MACHINE=WebXXX
WF_DEBUG=false
WF_DEBUG_LEVEL=2

Where WF_USERNAME and WF_PASSWORD is your control panel username and password. If you have multiple machines, you can define the machine name WF_MACHINE like Web123 on which one you want to use the API. WF_DEBUG will show debug information in the response, with WF_DEBUG_LEVEL you can set debug verbosity. Values: 0, 1 and 2., (*10)

Dependency

The package has a dependency which is automatically installed: https://github.com/gggeek/phpxmlrpc, (*11)

Usage

You can find some examples here but all API methods described on https://docs.webfaction.com/xmlrpc-api/apiref.html.
You have to use API calls the same way as you find in the API documentation. Eg. list_disk_usage in docs is the method list_disk_usage() in the API call., (*12)

List disk usage:, (*13)

Webfaction::list_disk_usage();

On create methods, you have to pass an array of values (except session_id) in the order of the method description! session_id is dynamically set in the background., (*14)

Creating an app:, (*15)

Webfaction::create_app([
    "app_name",  // name of your app
    "static_php72",  // app type
    false, // autostart app with autostart.cgi
    "", // extra_info field content
    false // open port
]);

If you don't like Facades, you can use the helper:, (*16)

webfaction()->list_mailboxes();

Testing

Run, (*17)

composer test

Credits

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

16/07 2018

dev-master

9999999-dev https://github.com/subdesign/laravel-webfaction

Webfaction API wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Barna Szalai

laravel api php webfaction

10/07 2018

1.0.1

1.0.1.0 https://github.com/subdesign/laravel-webfaction

Webfaction API wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Barna Szalai

laravel api php webfaction

10/07 2018

1.0.0

1.0.0.0 https://github.com/subdesign/laravel-webfaction

Webfaction API wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Barna Szalai

laravel api php webfaction