Skip to content

Commit bb3f3e7

Browse files
committed
Some examples added
1 parent 8af1c46 commit bb3f3e7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

example.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
// Composer autoloading
3+
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
4+
$loader = include __DIR__ . '/vendor/autoload.php';
5+
}
6+
7+
use ZendService\Gandi\Gandi;
8+
9+
try {
10+
$gandi = new Gandi();
11+
12+
$apiKey = 'xxxxxxxxxx';
13+
14+
// account info
15+
print_r($gandi->account->info(array($apiKey)));
16+
17+
// PASS vhost list
18+
print_r($gandi->paas->vhost->list(array($apiKey)));
19+
20+
// PASS vhost info
21+
print_r($gandi->paas->vhost->info(array($apiKey, 'github.narno.org')));
22+
23+
// PASS create (generic) vhost
24+
print_r($gandi->paas->vhost->create(array(
25+
$apiKey,
26+
array(
27+
'paas_id' => 00000,
28+
'vhost' => time() . '.narno.org',
29+
'override' => false,
30+
'zone_alter' => true,
31+
)
32+
)));
33+
} catch (Exception $e) {
34+
echo $e->getMessage();
35+
}

0 commit comments

Comments
 (0)