toin0u/digitalocean-silex 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

toin0u/digitalocean-silex

Composer 安装命令:

composer require toin0u/digitalocean-silex

包简介

DigitalOcean API PHP 5.3+ library for Silex

README 文档

README

This package allows you to use DigitalOcean in Silex.

Latest Stable Version Total Downloads Build Status Coverage Status SensioLabsInsight

Installation

It can be found on Packagist. The recommended way is through composer.

Edit compose.json and add:

{
    "require": {
        "toin0u/digitalocean-silex": "@stable"
    }
}

Protip: you should browse the toin0u/digitalocean-silex page to choose a stable version to use, avoid the @stable meta constraint.

And install dependecies:

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

Usage

Registering DigitalOceanServiceProvider is required.

<?php

use DigitalOcean\Silex\DigitalOceanServiceProvider;

// .. create $app
$app->register(new DigitalOceanServiceProvider(), array(
    'digitalocean.client_id' => 'YOUR_CLIENT_ID',
    'digitalocean.api_key'   => 'YOUR_API_KEY',
));

Then use the DigitalOcean API:

$digitalOcean = $app['digitalocean'];
$digitalocean->setAdapter(new \HttpAdapter\BuzzHttpAdapter());
$activeDroplets = $digitalOcean->droplets()->showAllActive();
var_dump($activeDroplets);

// object(stdClass)[61]
// public 'status' => string 'OK' (length=2)
// public 'droplets' =>
//     array (size=1)
//         0 =>
//             object(stdClass)[62]
//                 public 'id' => int 347553
//                 public 'name' => string 'foobar' (length=6)
//                 public 'image_id' => int 284212
//                 public 'size_id' => int 66
//                 public 'region_id' => int 4
//                 public 'backups_active' => boolean false
//                 public 'ip_address' => string '192.241.175.217' (length=15)
//                 public 'private_ip_address' => null
//                 public 'locked' => boolean false
//                 public 'status' => string 'active' (length=6)
//                 public 'created_at' => string '2013-01-07T01:37:21Z' (length=20)

Changelog

See the changelog file

Support

Please open an issues in github

Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant, version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/

License

DigitalOcean-silex is released under the MIT License. See the bundled LICENSE file for details.

统计信息

  • 总下载量: 55
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固