Code Monkey home page Code Monkey logo

vmware-vcloud-sdk-php's Introduction

vmware-vcloud-sdk-php

VMware vCloud SDK for PHP - original code v5.1.2 - Repository for importing with Composer

=======

Usage

Step 1. Install Composer (skip if already installed)

Go to your folder root and execute:

curl -sS https://getcomposer.org/installer | php

If the installation work correctly, this should display:

#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /mnt/hgfs/Documents/sandbox/vcloud/composer.phar
Use it: php composer.phar

At this step, you should have the following files in your project's folder:

$ls -Al
- composer.phar (~900 kB)

Then, execute:

[ ! -e composer.json ] && echo -e '{\n  \n}' > composer.json && php composer.phar install

If the installation work correctly, this should display:

Loading composer repositories with package information
Installing dependencies (including require-dev)
Nothing to install or update
Generating autoload files

At this step, you should have the following files in your project's folder:

$ ls -Al
- composer.phar (~900 kB)
- composer.json (7 B)
- vendor
  - autoload.php (~182 B)
  - composer
    - autoload_classmap.php (~150 B)
    - autoload_namespaces.php (~150 B)
    - autoload_real.php (~1 kB)
    - ClassLoader.php (~7 kB)

Step 2. Edit your composer.json

following lines to your composer.json:

"require": {
  "vmware/vcloud-sdk": "*"
}

Step 3. Update dependencies

php composer.phar update

If the installation work correctly, this should display:

Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Updating dependencies (including require-dev)
  - Installing vmware/vcloud-sdk (5.1.2 8f2e517)
    Cloning 8f2e517dd3e5c858d7729148bac526414d1444e3

  - Installing pear-pear.php.net/xml_util (1.2.1)
    Downloading: 100%
  - Installing pear-pear.php.net/console_getopt (1.3.1)
    Downloading: 100%
  - Installing pear-pear.php.net/structures_graph (1.0.4)
    Downloading: 100%
  - Installing pear-pear.php.net/archive_tar (1.3.11)
    Downloading: 100%
  - Installing pear-pear.php.net/pear (1.9.4)
    Downloading: 100%
  - Installing pear-pear.php.net/net_url2 (2.0.0)
    Downloading: 100%
  - Installing pear-pear.php.net/http_request2 (2.1.1)
    Downloading: 100%
Writing lock file
Generating autoload files

Step 4. Use it!

Now, you should be able to use VMware vCloud SDK for PHP by simply use the following PHP code:

require_once 'vendor/autoload.php';


$host = '192.168.0.100';

$auth = array(
  'username' => 'username@organization',
  'password' => 'password',
);

$httpConfig = array(
    'proxy_host' => null,
    'proxy_port' => null,
    'proxy_user' => null,
    'proxy_password' => null,
    'ssl_verify_peer' => false,
    'ssl_verify_host' => false,
    'ssl_cafile'  => null,
  );

echo 'Authenticating on ' . $host . '... ';
$service = VMware_VCloud_SDK_Service::getService();
try {
  $result = $service->login($host, $auth, $httpConfig);
  echo "OK\n";
}
catch(Exception $e) {
  echo 'NOK - ' . $e->getMessage() . "\n";
  exit(1);
}

...

License

See vCloudSDKforPHP-License.docx

Setup a development environment

This section is intented for contributors would would fork this project.

1/a. Install Composer (skip if already installed)

curl -sS https://getcomposer.org/installer | php

If the installation work correctly, this should display:

#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /mnt/hgfs/Documents/sandbox/vcloud/composer.phar
Use it: php composer.phar

1/b. Upgrade Composer (skip if freshly installed)

php composer.phar self-update

This will upgrade Composer to the latest version. If Composer is already up-to-date, this will display:

You are using the latest composer version.

2. Install/upgrade dependencies

php composer.phar install

If the installation work correctly, this should display something like:

Loading composer repositories with package information
Initializing PEAR repository http://pear2.php.net
Installing dependencies (including require-dev)
  - Installing pear-pear2.php.net/pear2_http_request (0.1.0)
    Downloading: 100%
Writing lock file
Generating autoload files

vmware-vcloud-sdk-php's People

Contributors

amercier avatar blufe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.