diff options
| author | Eole <EoleDev@outlook.fr> | 2016-04-27 22:52:25 +0200 |
|---|---|---|
| committer | Eole <EoleDev@outlook.fr> | 2016-04-27 22:52:25 +0200 |
| commit | f4d12bf72a943d6a8965f21a11eefbb05d2a5483 (patch) | |
| tree | 093d93a31fe998bf8c76829b79ed0ebd2eb43600 /server/doc/files/init.php.txt | |
| parent | 70cd5daaf18738776b0f9c45737cc6ab5579fff2 (diff) | |
Add Documentation
Diffstat (limited to 'server/doc/files/init.php.txt')
| -rw-r--r-- | server/doc/files/init.php.txt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/server/doc/files/init.php.txt b/server/doc/files/init.php.txt new file mode 100644 index 0000000..8bfc0aa --- /dev/null +++ b/server/doc/files/init.php.txt @@ -0,0 +1,59 @@ +<?php +/** + * File containing the initialisation of the API. + * + * @version 1.0 Initialisation of this file + * @since 1.0 Core application's file + * + * @author Eole 'eoledev at outlook . fr' + * + */ + +/* +* Include Main Api Class +*/ +include_once("core/App.php"); + +$user = ""; +$password = ""; +$project = ""; + + +//token processing +if(isset($_POST["token"])){ + + $token = $_POST["token"]; + +}else if(isset($_POST["user"]) && isset($_POST["password"]) && isset($_POST["project"]) ){ + + $user = $_POST["user"]; + $password = $_POST["password"]; + $project = $_POST["project"]; + +} + +//Library args +$Args = Array( + "user" => Array( + "name" => $user, + "password" => $password, + "domain" => Array( + "name" => "Default") + ), + "scope" => Array( + "project" => Array( + "name" => $project, + "domain" => Array( + "name" => "Default") + ) + ), + "authUrl" => $config["urlAuth"] +); + +//Init core Api +$App = new App($Args); + +if(isset($token)) + $App->setToken($token); +?> + |
