diff options
| -rwxr-xr-x | server/Test/genTokenOptionsTest.php | 6 | ||||
| -rw-r--r-- | server/Test/imageTests.php | 5 | ||||
| -rwxr-xr-x | server/core/App.php | 4 | ||||
| -rw-r--r-- | server/core/Image.php | 55 |
4 files changed, 50 insertions, 20 deletions
diff --git a/server/Test/genTokenOptionsTest.php b/server/Test/genTokenOptionsTest.php index 54c22d2..d1571f0 100755 --- a/server/Test/genTokenOptionsTest.php +++ b/server/Test/genTokenOptionsTest.php @@ -1,8 +1,8 @@ <?php - include_once("../config.inc.php"); + include_once("/istic-openstack/server/config.inc.php"); require "../vendor/autoload.php"; - include_once("../core/Plugin_Api.php"); - include_once("../core/LibOverride/genTokenOptions.php"); + include_once("/istic-openstack/server/core/Plugin_Api.php"); + include_once("/istic-openstack/server/core/LibOverride/genTokenOptions.php"); $user = "admin"; $password = "ae5or6cn"; diff --git a/server/Test/imageTests.php b/server/Test/imageTests.php index c3089e3..94ff7b6 100644 --- a/server/Test/imageTests.php +++ b/server/Test/imageTests.php @@ -1,6 +1,6 @@ <?php require '../vendor/autoload.php'; -include('../index.php'); +include('/istic-openstack/server/init.php'); /* $options = Array(); @@ -31,6 +31,7 @@ $openstack = new OpenStack\OpenStack($options); //$servers = $compute->listServers(true); echo 'toto'; +$image = new Image($App); $opt = Array(); $opt['name'] = "Test"; @@ -46,7 +47,7 @@ $opt['minRam'] = 10; //Liste des images -$images = $imageObject->list_images(); +$images = $image->list_images(); echo "Images présentes :"; echo "</br>"; diff --git a/server/core/App.php b/server/core/App.php index dafdaad..09da394 100755 --- a/server/core/App.php +++ b/server/core/App.php @@ -1,6 +1,6 @@ <?php
-include_once("core/Plugin_Api.php");
-include_once("core/LibOverride/genTokenOptions.php");
+include_once("/istic-openstack/server/core/Plugin_Api.php");
+include_once("/istic-openstack/server/core/LibOverride/genTokenOptions.php");
class App{
diff --git a/server/core/Image.php b/server/core/Image.php index b83d155..3001eea 100644 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -1,26 +1,55 @@ <?php -ini_set('display_errors', 1); -date_default_timezone_set("Europe/Paris"); -class Image { +//require 'CoreInterface.php'; + +/** +* File containing the Image Class. +* +* @version 1.0 Initialisation of this file +* @since 1.0 Core application's file +* +* @author Yogg 'yogg at epsina . com' +* +* @todo Complete the functions with errors detection and finish the descriptions +*/ + + +/** +* Image Class of the back-end application +* +* ADD CLASS DESCRIPTION +* +*/ +class image{ + //implements Core + + /** @var App $app protected, contains the main app object */ + protected $app; + + /** @var OpenStack\Identity $libClass protected, contains the library Identity object */ + protected $libClass; - protected $oidentity; - //protected $plugins; + /** @var array $actions protected, contains the functions which can be call by the front-end */ + protected $actions = array(); + /** - * Constructor + * Image constructor * - * @param $openstack - * - * @param $options + * @param App $app the main app object * - **/ - public function __construct($ostack, $options){ //, $apiP - $this->oidentity = $ostack->imagesV2($options); - //$this->plugins = $apiP; + * @throws [Type] [<description>] + * + * @return Image + */ + public function __construct($app){ + $this->app = $app; + $this->libClass = $app->getLibClass("Image"); } + + /** * Details about an image * |
