From 80460f544763398f211c519251229991db0106a1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 5 May 2016 19:16:10 +0200 Subject: [PATCH] Server Correction --- server/Test/AppTestClass.php | 3 --- server/core/Automating.php | 10 +++++----- server/core/Compute.php | 2 +- server/core/Identity.php | 2 +- server/core/Image.php | 2 +- server/core/LibOverride/genTokenOptions.php | 6 ++++-- server/core/Network.php | 2 +- server/core/NetworkLayer3.php | 2 +- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/server/Test/AppTestClass.php b/server/Test/AppTestClass.php index 972d9b4..39e855b 100755 --- a/server/Test/AppTestClass.php +++ b/server/Test/AppTestClass.php @@ -1,5 +1,4 @@ tokenPost = NULL; $this->tokenClass = new genTokenOptions($args); $this->openstack = new OpenStack\OpenStack(['authUrl' => $args["authUrl"]]); - $this->pluginsApi = plugin_api::getInstance(); $this->errorClass = new errorManagement($this); $this->output = array(); diff --git a/server/core/Automating.php b/server/core/Automating.php index 27dd018..5319d2d 100755 --- a/server/core/Automating.php +++ b/server/core/Automating.php @@ -9,11 +9,11 @@ * */ -include("Image.php"); -include("Network.php"); -include("Compute.php"); -include("NetworkLayer3.php"); -include("CoreInterface.php"); +require_once("Image.php"); +require_once("Network.php"); +require_once("Compute.php"); +require_once("NetworkLayer3.php"); +require_once("CoreInterface.php"); /** * automating Class of the back-end application diff --git a/server/core/Compute.php b/server/core/Compute.php index 7783fde..7d019f5 100755 --- a/server/core/Compute.php +++ b/server/core/Compute.php @@ -11,7 +11,7 @@ use OpenCloud\Common\Error; -include("CoreInterface.php"); +require_once("CoreInterface.php"); /** * Compute Class of the back-end application * diff --git a/server/core/Identity.php b/server/core/Identity.php index 112c9e3..b3b89a7 100755 --- a/server/core/Identity.php +++ b/server/core/Identity.php @@ -9,7 +9,7 @@ */ use OpenCloud\Common\Error; -include("CoreInterface.php"); +require_once("CoreInterface.php"); /** * Identity Class of the back-end application * diff --git a/server/core/Image.php b/server/core/Image.php index b256d4c..9ad9f0a 100755 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -14,7 +14,7 @@ use OpenCloud\Common\Error\BaseError; use OpenCloud\Common\Error\NotImplementedError; use OpenCloud\Common\Error\UserInputError; -include("CoreInterface.php"); +require_once("CoreInterface.php"); /** * Image Class of the back-end application diff --git a/server/core/LibOverride/genTokenOptions.php b/server/core/LibOverride/genTokenOptions.php index 7134887..b833757 100755 --- a/server/core/LibOverride/genTokenOptions.php +++ b/server/core/LibOverride/genTokenOptions.php @@ -35,6 +35,8 @@ class genTokenOptions private $backup = []; /** @var GuzzleHttp\Client $httpClient private, contains a default Client to construct some OpenStack library object */ private $httpClient; + + private $directory = __DIR__; /** * genTokenOptions constructor @@ -385,7 +387,7 @@ class genTokenOptions */ private function saveBackup($name, $data){ $token = $this->serializeToken($data["token"]); - $ret = file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved'])); + $ret = file_put_contents($this->directory."/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved'])); if($ret === FALSE) die("Internal Server Error : File Rights"); $this->backup['time'] = $token['time']; @@ -505,7 +507,7 @@ class genTokenOptions * @return OpenCloud\Common\Auth\Token the token unserialized */ private function unserializeToken($tokenSerialized){ - $Saved = file_get_contents("core/LibOverride/projectTokenData/".$this->backup["project"]); + $Saved = file_get_contents($this->directory."/projectTokenData/".$this->backup["project"]); if($Saved === FALSE) die("Internal Server Error : File Access"); $Saved = unserialize($Saved); diff --git a/server/core/Network.php b/server/core/Network.php index b244e4e..23f4d41 100755 --- a/server/core/Network.php +++ b/server/core/Network.php @@ -13,7 +13,7 @@ use OpenCloud\Common\Error\BaseError; use OpenCloud\Common\Error\NotImplementedError; use OpenCloud\Common\Error\UserInputError; -include("CoreInterface.php"); +require_once("CoreInterface.php"); /** * Network Class of the back-end application diff --git a/server/core/NetworkLayer3.php b/server/core/NetworkLayer3.php index 35bf707..8b48c1b 100755 --- a/server/core/NetworkLayer3.php +++ b/server/core/NetworkLayer3.php @@ -14,7 +14,7 @@ use OpenCloud\Common\Error\BaseError; use OpenCloud\Common\Error\NotImplementedError; use OpenCloud\Common\Error\UserInputError; -include("CoreInterface.php"); +require_once("CoreInterface.php"); /** * networkLayer3 Class of the back-end application