| 1 |
lars |
1 |
<?php
|
|
|
2 |
/*
|
|
|
3 |
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
4 |
*
|
|
|
5 |
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
|
6 |
* You may not use this file except in compliance with the License.
|
|
|
7 |
* A copy of the License is located at
|
|
|
8 |
*
|
|
|
9 |
* http://aws.amazon.com/apache2.0
|
|
|
10 |
*
|
|
|
11 |
* or in the "license" file accompanying this file. This file is distributed
|
|
|
12 |
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
|
13 |
* express or implied. See the License for the specific language governing
|
|
|
14 |
* permissions and limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
/*%******************************************************************************************%*/
|
|
|
19 |
// CLASS
|
|
|
20 |
|
|
|
21 |
/**
|
|
|
22 |
* Contains a series of methods that provide information about the SDK.
|
|
|
23 |
*
|
|
|
24 |
* @version 2010.10.01
|
|
|
25 |
* @license See the included NOTICE.md file for more information.
|
|
|
26 |
* @copyright See the included NOTICE.md file for more information.
|
|
|
27 |
* @link http://aws.amazon.com/php/ PHP Developer Center
|
|
|
28 |
*/
|
|
|
29 |
class CFInfo
|
|
|
30 |
{
|
|
|
31 |
/**
|
|
|
32 |
* Gets information about the web service APIs that the SDK supports.
|
|
|
33 |
*
|
|
|
34 |
* @return array An associative array containing service classes and API versions.
|
|
|
35 |
*/
|
|
|
36 |
public static function api_support()
|
|
|
37 |
{
|
|
|
38 |
$existing_classes = get_declared_classes();
|
|
|
39 |
|
|
|
40 |
foreach (glob(dirname(dirname(__FILE__)) . '/services/*.class.php') as $file)
|
|
|
41 |
{
|
|
|
42 |
include $file;
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
$with_sdk_classes = get_declared_classes();
|
|
|
46 |
$new_classes = array_diff($with_sdk_classes, $existing_classes);
|
|
|
47 |
$filtered_classes = array();
|
|
|
48 |
$collect = array();
|
|
|
49 |
|
|
|
50 |
foreach ($new_classes as $class)
|
|
|
51 |
{
|
|
|
52 |
if (strpos($class, 'Amazon') !== false)
|
|
|
53 |
{
|
|
|
54 |
$filtered_classes[] = $class;
|
|
|
55 |
}
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
$filtered_classes = array_values($filtered_classes);
|
|
|
59 |
|
|
|
60 |
foreach ($filtered_classes as $class)
|
|
|
61 |
{
|
|
|
62 |
$obj = new $class();
|
|
|
63 |
$collect[get_class($obj)] = $obj->api_version;
|
|
|
64 |
unset($obj);
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
return $collect;
|
|
|
68 |
}
|
|
|
69 |
}
|