Add Documentation

This commit is contained in:
Eole 2016-04-27 22:52:25 +02:00
parent 70cd5daaf1
commit f4d12bf72a
106 changed files with 23934 additions and 0 deletions

View file

@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-254102993"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-254102993" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>config.inc.php</h1>
<p><em>File containing global config options for the API.</em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Eole 'eoledev at outlook . fr'</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/config.inc.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,22 @@
<?php
/**
* File containing global config options for the API.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
*/
date_default_timezone_set('Europe/Paris');
$config = Array();
$config["modules_enabled"] = "";
$config["urlAuth"] = "http://148.60.11.31:5000/v3";
$config["tokenTime"] = 60; //minutes
?>

View file

@ -0,0 +1,261 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1654814049"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1654814049" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>App.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/App.html">App</a></td>
<td><em>App Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/App.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,261 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-766001636"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-766001636" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>Automating.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/automating.html">automating</a></td>
<td><em>automating Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/Automating.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-834773263"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-834773263" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>Compute.php</h1>
<p><em>File containing the compute Class.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/compute.html">compute</a></td>
<td><em>Compute Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>bhupi</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/Compute.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,261 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-3515293"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-3515293" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>CoreInterface.php</h1>
<p><em>File containing Core Interface.</em></p>
<h2>Interfaces</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/Core.html">Core</a></td>
<td><em>Interface for the main classes of the API</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/CoreInterface.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1748589392"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1748589392" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>ErrorManagement.php</h1>
<p><em>File containing the errorManagement Class.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/errorManagement.html">errorManagement</a></td>
<td><em>errorManagement Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Eole 'eoledev at outlook . fr', Evan Pisani 'yogg at epsina . com'</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/ErrorManagement.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,254 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1978375365"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1978375365" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>Identity.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/Identity.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1922334974"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1922334974" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>Image.php</h1>
<p><em>File containing the Image Class.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/image.html">image</a></td>
<td><em>Image Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Evan Pisani 'yogg at epsina . com'</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/Image.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,292 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1345315769"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1345315769" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core/LibOverride</small>genTokenOptions.php</h1>
<p><em>File containing the override of the authentication for the Library.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/genTokenOptions.html">genTokenOptions</a></td>
<td><em>genTokenOptions Class</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Eole 'eoledev at outlook . fr'</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
<p>Check with the API, the condition and test the revoke token implementation</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/LibOverride/genTokenOptions.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-456645722"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-456645722" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>Network.php</h1>
<p><em>File containing the Image Class.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/network.html">network</a></td>
<td><em>Network Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>KABIR Othmane</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/Network.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,284 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1037181298"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1037181298" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>core</small>NetworkLayer3.php</h1>
<p><em>File containing the networkLayer3 Class.</em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/networkLayer3.html">networkLayer3</a></td>
<td><em>networkLayer3 Class of the back-end application</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
version
</th>
<td>
<p>Initialisation of this file</p>
</td>
</tr>
<tr>
<th>
since
</th>
<td>
<p>Core application's file</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Evan Pisani 'yogg at epsina . com'</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/core/NetworkLayer3.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,245 @@
<?php
/**
* File containing the identity Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
*/
/*
* Library token management override
*/
include_once("core/LibOverride/genTokenOptions.php");
include_once("core/ErrorManagement.php");
//Library loading
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
use OpenCloud\Common\Error\NotImplementedError;
use OpenCloud\Common\Error\UserInputError;
/**
* App Class of the back-end application
*
* This class allow the communication between the front-end application and
* the library which allow to send requests to an Openstack instance.
*
*/
class App{
/** @var OpenStack\OpenStack $openstack protected, contains the main library object */
protected $openstack;
/** @var Array $postParams protected, contains the post parameters */
protected $postParams;
/** @var genTokenOptions $tokenClass protected, contains the class object for the authentication override of the library */
protected $tokenClass;
/** @var String $tokenPost protected, contains the token given in parameter */
protected $tokenPost;
/** @var errorManagement $errorClass protected, contains the errorManagement object */
protected $errorClass;
/** @var Array $output protected, contains the result for the API call */
protected $output;
/**
* App constructor
*
* @param Array $args Args for the OpenStack Library
*
* @return App object
*/
public function __construct($args){
$this->tokenPost = NULL;
$this->tokenClass = new genTokenOptions($args);
$this->openstack = new OpenStack\OpenStack(['authUrl' => $args["authUrl"]]);
$this->errorClass = new errorManagement($this);
$this->output = array();
$this->postParams = $_POST;
}
/**
* Set the class var $tokenPost and load the token
* into the genTokenOptions Class
*
* @param String $token token to be set
*
*/
public function setToken($token){
$this->tokenPost = $token;
$this->tokenClass->loadBackup($this->tokenPost);
}
/**
* Check the expiration of the token
*
* @return Boolean if the token is not expired
*/
public function checkToken(){
return $this->tokenClass->checkToken();
}
/**
* Get the service Class given the name in parameter
*
* @param String $service Name of the service
*
* @return Core object
*/
public function getLibClass($service){
switch($service){
case "Identity":
if($this->tokenPost == NULL) $this->tokenClass->genIdentityToken();
$opt = $this->tokenClass->getOptions($service);
return $this->openstack->identityV3($opt);
break;
case "Image":
if($this->tokenPost == NULL) $this->tokenClass->genImageToken();
$opt = $this->tokenClass->getOptions($service);
return $this->openstack->imagesV2($opt);
break;
case "Network":
if($this->tokenPost == NULL) $this->tokenClass->genNetworkToken();
$opt = $this->tokenClass->getOptions($service);
return $this->openstack->networkingV2($opt);
break;
case "Compute":
if($this->tokenPost == NULL) $this->tokenClass->genComputeToken();
$opt = $this->tokenClass->getOptions($service);
return $this->openstack->computeV2($opt);
break;
case "NetworkLayer3":
if($this->tokenPost == NULL) $this->tokenClass->genNetworkToken();
$opt = $this->tokenClass->getOptions('Network');
return $this->openstack->networkingV2ExtLayer3($opt);
break;
}
}
/**
* Generate the token for the different services in OpenStack
*
* @return void
*/
public function authenticate(){
try{
$this->tokenClass->genIdentityToken();
$this->tokenClass->genComputeToken();
$this->tokenClass->genImageToken();
$this->tokenClass->genNetworkToken();
$this->setOutput("token", $this->tokenClass->getBackup());
}catch(BadResponseError $e){
$this->errorClass->BadResponseHandler($e);
}catch(UserInputError $e){
$this->errorClass->UserInputHandler($e);
}catch(BaseError $e){
$this->errorClass->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->errorClass->NotImplementedHandler($e);
}
}
/**
* Revoke the openstack services' token
*
* @return void
*/
public function deauthenticate(){
try{
$this->tokenClass->revokeComputeToken();
$this->tokenClass->revokeImageToken();
$this->tokenClass->revokeNetworkToken();
$this->tokenClass->revokeIdentityToken();
$this->setOutput("deauthenticate", "Ok");
}catch(BadResponseError $e){
$this->errorClass->BadResponseHandler($e);
}catch(UserInputError $e){
$this->errorClass->UserInputHandler($e);
}catch(BaseError $e){
$this->errorClass->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->errorClass->NotImplementedHandler($e);
}
}
/**
* Retrieve a post parameter given its name
*
* @param String $name Expected post parameter's name
*
* @return Object Post value
*/
public function getPostParam($name){
if(isset($this->postParams[$name])){
return $this->postParams[$name];
}else{
$this->setOutput("Error", "Missing parameter ".$name);
}
}
/**
* Set a post parameter for automating task
*
* @param String $param Name for the Post entry
* @param Object $value Value for the Post entry
*
* @return void
*/
public function setPostParam($param, $value){
$this->postParams[$param] = $value;
}
/**
* Set a new output message
*
* @param String $key Array key for the message
* @param Array $out Message's value
*
* @return void
*/
public function setOutput($key, $out){
$this->output[$key] = $out;
}
/**
* Retrieve the errorManagement instance Object
*
* @return errorManagement object
*/
public function getErrorInstance(){
return $this->errorClass;
}
/**
* Output the messages to be send to the client
*
* @return void
*/
public function show(){
echo json_encode($this->output);
}
}

View file

@ -0,0 +1,134 @@
<?php
/**
* File containing the Automating Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Evan Pisani 'yogg at epsina . com', bhupi
*
*/
include("Image.php");
include("Network.php");
include("Compute.php");
include("NetworkLayer3.php");
include("CoreInterface.php");
/**
* automating Class of the back-end application
*
* Contains the different function to automate some action
*
*/
class automating implements Core{
/** @var App $compute protected, contains a Core compute object */
protected $compute;
/** @var App $image protected, contains a Core image object */
protected $image;
/** @var App $network protected, contains a Core network object */
protected $network;
/** @var App $networkLayer3 protected, contains a Core networkLayer3 object */
protected $networkLayer3;
/** @var App $app protected, contains the main app object */
protected $app;
/**
* automating class constructor
*
* @param App $app the main app object
*
* @return automating Object
*/
public function __construct($app){
$this->app = $app;
$compute = new Compute($app);
$image = new Image($app);
$network = new Network($app);
$networkLayer3 = new NetworkLayer3($app);
}
/**
* Execute an action
*
* @param String $action name of another function of this class
*
* @return void
*/
public function action($action){
$this->{$action.""}();
}
/**
* create a new server and associate a public ip
*
* @param String $networkId the id of the network where the server will be created
* @param String $imageName name of the new image
* @param String $serverName name ofthe new server
* @param String $flavor kind of server
*
* @return void
*/
private function createPublicServer()
{
$networkId = $this->app->getPostParam('networkId');
$imageName = $this->app->getPostParam('imageName');
$serverName = $this->app->getPostParam('serverName');
$flavor = $this->app->getPostParam('flavor');
if(!isset($imageName)){
$this->app->setOutput("Error", "Incorrect imageName parameter");
}
else if(!isset($serverName)){
$this->app->setOutput("Error", "Incorrect serverName parameter");
}
else if(!isset($flavor)){
$this->app->setOutput("Error", "Incorrect flavor parameter");
}
else{
// Création image
$opt = array();
$opt['name'] = $imageName;
$image->setPostParam('opt', $opt);
$image->action("createImage");
$image = json_decode($this->app->show(), true)["Images"];
// Création server
$compute->setPostParam('name', $serverName);
$compute->setPostParam('imageId', $image['id']);
$compute->setPostParam('flavorId', $flavor);
$compute->action("createServer");
$server = json_decode($this->app->show(), true)["Compute"];
// liste des adresses ip publiques diponibles
$networkLayer3->action("listFloatingIp");
$listFloatingIp = json_decode($App->show(), true)["NetworkLayer3"];
$ip = null;
foreach ($listFloatingIp as $f) {
if(strcmp($f['status'], "DOWN")){
$ip = $f;
}
}
// Si pas d'ip publique disponible on en créé une
if(!isset($ip)){
// Ajout adresse IP public
$optIp = array();
$opt['floatingNetworkId'] = $networkId;
$floatingIp->setPostParam('opt', $optIp);
$networkLayer3->action("createFloatingIp");
$ip = json_decode($App->show(), true)["NetworkLayer3"];
}
// Association de l'ip publique au serveur
/*
* API non diponible pour le moment
*/
}
}
}
?>

View file

@ -0,0 +1,674 @@
<?php
/**
* File containing the compute Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author bhupi
*
*/
use OpenCloud\Common\Error;
include("CoreInterface.php");
/**
* Compute Class of the back-end application
*
* Management of Servers
*
*/
class compute implements Core
{
/** @var App $app protected, contains the main app object */
protected $app;
/** @var OpenStack\Compute $libClass protected, contains the library Compute object */
protected $libClass;
/**
* Compute constructor
*
* @param App $args the main app object
*
* @return compute Object
*/
public function __construct($app)
{
$this->app = $app;
$this->libClass = $app->getLibClass("Compute");
}
/**
* Execute an action
*
* @param String $action name of another function of this class
*
* @return void
*/
public function action($action){
$this->{$action.""}();
}
/**
* List servers.
*
* @return void
*/
public function listServers()
{
try{
$serverList = $this->libClass->listServers(true);
$servers = Array();
foreach($serverList as $server){
$servers[$server->id] = Array();
$server->flavor->retrieve();
$server->image->retrieve();
$server->retrieve();
$servers[$server->id]["id"] = $server->id;
$servers[$server->id]["name"] = $server->name;
$servers[$server->id]["image"] = $server->image;
$servers[$server->id]["ram"] = $server->flavor->ram;
$servers[$server->id]["disk"] = $server->flavor->disk;
$servers[$server->id]["flavor"] = $server->flavor;
$servers[$server->id]["status"] = $server->status;
$servers[$server->id]["created"] = $server->created;
$servers[$server->id]["updated"] = $server->updated;
$servers[$server->id]["ipv4"] = $server->ipv4;
$servers[$server->id]["ipv6"] = $server->ipv6;
$servers[$server->id]["progress"] = $server->progress;
$servers[$server->id]["hostId"] = $server->hostId;
$servers[$server->id]["tenantId"] = $server->tenantId;
$servers[$server->id]["userId"] = $server->userId;
$servers[$server->id]["taskState"] = $server->taskState;
$servers[$server->id]["addresses"] = $server->addresses;
$servers[$server->id]["links"] = $server->links;
$servers[$server->id]["metadata"] = $server->metadata;
}
$this->app->setOutput("Servers", $servers);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* List flavors.
*
* @return void
*/
public function listFlavors()
{
try{
$flavorList = $this->libClass->listFlavors();
$flavors = Array();
foreach($flavorList as $flavor){
$flavors[$flavor->id] = Array();
$flavor->retrieve();
$flavors[$flavor->id]["id"] = $flavor->id;
$flavors[$flavor->id]["name"] = $flavor->name;
$flavors[$flavor->id]["ram"] = $flavor->ram;
$flavors[$flavor->id]["disk"] = $flavor->disk;
$flavors[$flavor->id]["vcpus"] = $flavor->vcpus;
$flavors[$flavor->id]["links"] = $flavor->links;
}
$this->app->setOutput("Flavors", $flavors);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* List images.
*
* @return void
*/
public function listImages()
{
try{
$imageList = $this->libClass->listImages();
$images = Array();
foreach($imageList as $image){
$images[$image->id] = Array();
$image->retrieve();
$images[$image->id]["id"] = $image->id;
$images[$image->id]["name"] = $image->name;
$images[$image->id]["status"] = $image->status;
$images[$image->id]["created"] = $image->created;
$images[$image->id]["updated"] = $image->updated;
$images[$image->id]["minDisk"] = $image->minDisk;
$images[$image->id]["minRam"] = $image->minRam;
$images[$image->id]["progress"] = $image->progress;
$images[$image->id]["links"] = $image->links;
$images[$image->id]["metadata"] = $image->metadata;
}
$this->app->setOutput("Images", $images);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Get server details.
*
* @return void
*/
public function getServer()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->retrieve();
$this->app->setOutput("MyServer", $server);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Get flavor details.
*
* @return void
*/
public function getFlavor()
{
try{
$flavorId = $this->app->getPostParam("flavorId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Flavor ID is missing!");
return;
}
$opt = array('id' => $flavorId);
$flavor = $this->libClass->getFlavor($opt);
$flavor->retrieve();
$this->app->setOutput("MyFlavor", $flavor);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Get image details.
* @return array
*/
public function getImage()
{
try{
$imageId = $this->app->getPostParam("imageId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Image ID is missing!");
return;
}
$opt = array('id' => $imageId);
$image = $this->libClass->getImage($opt);
$image->retrieve();
$this->app->setOutput("MyImage", $image);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Create server.
*
* @return void
*/
public function createServer()
{
try{
$name = $this->app->getPostParam("name");
$imageId = $this->app->getPostParam("imageId");
$flavorId = $this->app->getPostParam("flavorId");
if(!isset($name) || !isset($imageId) || !isset($flavorId)){
$this->app->setOutput("Error", "Server name OR image ID OR flavor ID is missing.");
return;
}
$opt = array('name' => $name, 'imageId' => $imageId, 'flavorId' => $flavorId);
$server = $this->libClass->createServer($opt);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* update a server
*
* @return void
*/
public function updateServer()
{
try{
$serverId = $this->app->getPostParam("serverId");
$newName = $this->app->getPostParam("newName");
$newIpv4 = $this->app->getPostParam("newIpv4");
$newIpv6 = $this->app->getPostParam("newIpv6");
if(!isset($serverId)|| !(isset($newName) || isset($newIpv4) || isset($newIpv6)) ){
$this->app->setOutput("Error", "You'll have to provide server ID and the new attribute(IP(v4/v6)/Name) you desire to update!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
if (isset($newName)){
if(isset($newIpv4)){
if(isset($newIpv6)){
$attr = array('name' => $newName, 'accessIPv4' => $newIPv4, 'accessIPv6' => $newIpv6);
}
else $attr = array('name' => $newName, 'accessIPv4' => $newIPv4);
}
else $attr = array('name' => $newName);
}
$server->update($attr);
$this->app->setOutput("Success", $serverId." has been updated successfully.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Delete a server
*
* @return void
*/
public function deleteServer()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->delete();
$this->app->setOutput("Success", $serverId." has been deleted successfully.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Change the password of a server
*
* @return void
*/
public function changePassword()
{
try{
$serverId = $this->app->getPostParam("serverId");
$password = $this->app->getPostParam("newPassword");
if(!isset($serverId) || !isset($password)){
$this->app->setOutput("Error", "Server ID or new password missing.");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->changePassword($password);
$this->app->setOutput("Success", "Password for ".$serverId." has been updated successfully.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Reboot a server
*
* @return void
*/
public function reboot()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->reboot();
$this->app->setOutput("Success", $serverId." has been deleted successfully.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Rebuild a server
*
* @return void
*/
public function rebuild()
{
$serverId = $this->app->getPostParam("serverId");
$imageId = $this->app->getPostParam("imageId");
$newName = $this->app->getPostParam("newName");
$adminPass = $this->app->getPostParam("adminPass");
if(!isset($serverId)|| !isset($imageId) || isset($newName) || isset($adminPass)) {
$this->app->setOutput("Error", "You'll have to provide server ID and the new image, name and admin password!");
return;
try{
$serverId = $this->app->getPostParam("serverId");
$imageId = $this->app->getPostParam("imageId");
$newName = $this->app->getPostParam("newName");
$adminPass = $this->app->getPostParam("adminPass");
if(!isset($serverId)|| !isset($imageId) || isset($newName) || isset($adminPass)){
$this->app->setOutput("Error", "You'll have to provide server ID and the new image, name and admin password!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$attr = array('imageId' => $imageId, 'name' => $newName, 'adminPass' => $adminPass);
$server->rebuild($attr);
$this->app->setOutput("Success", $serverId." has been rebuilt successfully with the new image.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Resize a server
*
* A call to this method has to be followed by either confirmResize or revertResize
*
* @return void
*/
public function resize()
{
try{
$serverId = $this->app->getPostParam("serverId");
$newFlavorId = $this->app->getPostParam("newFlavorId");
if(!isset($serverId)|| !isset($flavorId)){
$this->app->setOutput("Error", "You'll have to provide server ID and the new flavor ID!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->resize($newFlavorId);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Confirm resize operation on a server
*
* @return void
*/
public function confirmResize()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->confirmResize();
$this->app->setOutput("Success", $serverId." has been resized successfully as the new flavor.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Revert resize operation on a server
*
* @return void
*/
public function revertResize()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$server->revertResize();
$this->app->setOutput("Success", $serverId." : resize operation has been reverted to the old flavor.");
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* List private and public addresses of a server
*
* @return void
*/
public function listAddresses()
{
try{
$serverId = $this->app->getPostParam("serverId");
if(!isset($serverId)){
$this->app->setOutput("Error", "Server ID is missing!");
return;
}
$opt = array('id' => $serverId);
$server = $this->libClass->getServer($opt);
$addresses = $server->listAddresses();
$this->app->setOutput("Addresses", $addresses);
}
catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}
catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}
catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}
catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}
catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}

View file

@ -0,0 +1,26 @@
<?php
/**
* File containing Core Interface.
*
*/
/**
* Interface for the main classes of the API
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*/
interface Core{
/**
* Execute an action in the class
*
* @param String $action Function to be called
*
* @return void
*/
public function action($action);
}

View file

@ -0,0 +1,128 @@
<?php
/**
* File containing the errorManagement Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr', Evan Pisani 'yogg at epsina . com'
*
*/
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
use OpenCloud\Common\Error\NotImplementedError;
use OpenCloud\Common\Error\UserInputError;
/**
* errorManagement Class of the back-end application
*
* Management of error
*
*/
Class errorManagement{
/** @var App $app protected, contains the main app object */
protected $app;
/**
* ErrorManagemement constructor
*
* @param App $args the main app object
*
* @return ErrorManagement Object
*/
public function __construct($args){
$this->app = $args;
}
/**
* Put an error message corresponding to a base error in the output
*
* @param Exception $error the exception triggered
*
* @return void
*/
public function BaseErrorHandler($error){
$this->app->setOutput("Error", "BaseError");
}
/**
* Put an error message corresponding to a bad response in function of the status code in the output
*
* @param Exception $error the exception triggered
*
* @return void
*/
public function BadResponseHandler($error){
$statusCode = $error->getResponse()->getStatusCode();
switch ($statusCode) {
case 400:
$this->app->setOutput("Error", "Invalid input.");
break;
case 401:
$this->app->setOutput("Error", "Authentification failed.");
break;
case 403:
$this->app->setOutput("Error", "Operation forbidden.");
break;
case 404:
$this->app->setOutput("Error", "Ressource not found.");
break;
case 500:
$this->app->setOutput("Error", "Internal server error, please contact an administrator.");
break;
case 503:
$this->app->setOutput("Error", "Service unvailable for the moment.");
break;
default:
$this->app->setOutput("Error", "Unknow error, please contact an administrator.");
break;
}
}
/**
* Put an error message corresponding to a not implemented yet error in the output
*
* @param Exception $error the exception triggered
*
* @return void
*/
public function NotImplementedHandler($error){
$this->app->setOutput("Error", "Internal error (not implemented yet), please contact an administrator");
}
/**
* Put an error message corresponding to a user input error in the output
*
* @param Exception $error the exception triggered
*
* @return void
*/
public function UserInputHandler($error){
$this->app->setOutput("Error", "UserInputError");
}
/**
* Put an error message corresponding to an other error in the output
*
* @param Exception $error the exception triggered
*
* @return void
*/
public function OtherException($error){
$this->app->setOutput("Error", $error->getMessage());
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,682 @@
<?php
/**
* File containing the Image Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Evan Pisani 'yogg at epsina . com'
*
*/
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
use OpenCloud\Common\Error\NotImplementedError;
use OpenCloud\Common\Error\UserInputError;
include("CoreInterface.php");
/**
* Image Class of the back-end application
*
* Management of images
*
*/
class image implements Core{
/** @var App $app protected, contains the main app object */
protected $app;
/** @var OpenStack\Image $libClass protected, contains the library Image object */
protected $libClass;
/**
* Image constructor
*
* @param App $app the main app object
*
* @return image Object
*/
public function __construct($app){
if(!isset($app)){
$this->app->setOutput("Error", "Incorrect parameter app");
}
$this->app = $app;
$this->libClass = $app->getLibClass("Image");
}
/**
* Execute an action
*
* @param String $action name of another function of this class
*
* @return void
*/
public function action($action){
$this->{$action.""}();
}
/**
* Create a new image
*
* @param array $opt Options for the image creation (name is required, others are optionals)
*
* @return void
*/
private function createImage(){
$opt = $this->app->getPostParam("opt");
if(!isset($opt)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
$options = Array();
// Check the image name
if(isset($opt['name'])){
$imagesList = $this->listImage();
if(isset($imagesList)){
foreach($imagesList as $image){
if(strcmp($image->name, $opt['name']) == 0){ // if the image name already exists -> error
$this->app->setOutput("Error", "Image name already exists");
}
}
}
$options['name'] = $opt['name'];
}
else{
$this->app->setOutput("Error", "Missing parameter 'name' for the new image");
}
// Check optionals arguments
if(isset($opt['id'])){ // UUID : nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn
if($this->libClass->getImage($opt['id']) != null){ // if the id already exists -> error
$this->app->setOutput("Error", "Image id already exists");
}
$options['id'] = $opt['id'];
}
if(isset($opt['visibility'])){ // public, private
$options['visibility'] = $opt['visibility'];
}
if(isset($opt['tags'])){ // list
$options['tags'] = $opt['tags'];
}
if(isset($opt['containerFormat'])){ // string : ami, ari, aki, bare, ovf, ova, docker
$options['containerFormat'] = $opt['containerFormat'];
}
if(isset($opt['diskFormat'])){ // string : ami, ari, aki, vhd, vmdk, raw, qcow2, vdi, iso
$options['diskFormat'] = $opt['diskFormat'];
}
if(isset($opt['minDisk'])){ //int
$options['minDisk'] = $opt['minDisk'];
}
if(isset($opt['minRam'])){ // int
$options['minRam'] = $opt['minRam'];
}
if(isset($opt['protected'])){ // boolean
$options['protected'] = $opt['protected'];
}
if(isset($opt['properties'])){ // type dict
$options['properties'] = $opt['properties'];
}
$image = $this->libClass->createImage($options);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $image);
}
/**
* List the images of the server
*
* @return void
*/
private function listImage(){
try{
$result = array();
$l = $this->libClass->listImages();
foreach($l as $tmp){
$result[] = $tmp;
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $result);
}
/**
* Details about an image
*
* @param String $id Identifier of the image
*
* @return void
*/
private function detailsImage(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
else{
$this->app->setOutput("Images", $image);
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Update informations about an image
*
* @param String $id id of the image
* @param array $opt Options for the image creation
*
* @return void
*/
private function updateImage(){
$id = $this->app->getPostParam("id");
$opt = $this->app->getPostParam("opt");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
else if(!isset($opt)){
$this->app->setOutput("Error", "Incorrect opt parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$options = Array();
// Voir vérification des types
if(isset($opt['name'])){ //string
$options['name'] = $opt['name'];
}
if(isset($opt['minDisk'])){ //int
$options['minDisk'] = $opt['minDisk'];
}
if(isset($opt['minRam'])){ // int
$options['minRam'] = $opt['minRam'];
}
if(isset($opt['protected'])){ // boolean
$options['protected'] = $opt['protected'];
}
if(isset($opt['visibility'])){ // public, private
$options['visibility'] = $opt['visibility'];
}
if(isset($opt['tags'])){ // list
$options['tags'] = $opt['tags'];
}
$image->update($options);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $image);
}
}
/**
* Delete an image
*
* @param String $id Identifier of the image
*
* @return void
*/
private function deleteImage(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Image doesn't exist");
}
else{
try{
$service = $this->libClass;
$image = $this->libClass->getImage($id);
if($image == null){ // if the image doesn't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$image->delete();
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Reactive an image
*
* @param String $id Identifier of the image
*
* @return void
*/
private function reactivateImage(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter");
}
else
{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$image->reactivate();
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Desactivaate an image
*
* @param String $id Identifier of the image
*
* @return void
*/
private function desactivateImage(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter");
}
else
{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$image->deactivate();
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Upload an image
*
* @param String $id Identifier of the image
* @param String $file_name Path of the image
*
* @return void
*/
private function uploadImage(){
$id = $this->app->getPostParam("id");
$file_name = $this->app->getPostParam("file_name");
$file = $this->app->getPostParam("file");
error_log(print_r($file, true), 0);
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
else if(!isset($file_name)){
$this->app->setOutput("Error", "Incorrect file name parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$stream = \GuzzleHttp\Psr7\stream_for($file);
$image->uploadData($stream);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Download an image
*
* @param String $id Identifier of the image
*
* @return void
*/
private function downloadImage(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$stream = $image->downloadData();
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $stream);
}
}
/**
* Add a member to image
*
* @param String $image_id Identifier of the image
* @param String $member_id Identifier of the member
*
* @return void
*/
private function addMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
$this->app->setOutput("Error", "Incorrect image id parameter");
}
else if(!isset($member_id)){
$this->app->setOutput("Error", "Incorrect member id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$member_id = $image->addMember($member_id);
$this->app->setOutput("Images", $member_id);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* List members of an image
*
* @param String $image_id identifier of the image
*
* @return void
*/
private function listMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
$this->app->setOutput("Error", "Incorrect image id parameter");
}
else if(!isset($member_id)){
$this->app->setOutput("Error", "Incorrect member id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($image_id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$members = $image->listMembers();
if($members == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "No member");
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $members);
}
}
/**
* Show details of a member of an image
*
* @param String $image_id Identifier of the image
* @param String $member_id Identifier of the member
*
* @return void
*/
private function detailMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
$this->app->setOutput("Error", "Incorrect image id parameter");
}
else if(!isset($member_id)){
$this->app->setOutput("Error", "Incorrect member id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$member = $image->getMember($member_id);
if($member == null){ // if the member don't exists -> error
$this->app->setOutput("Error", "Member doesn't exist");
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
$this->app->setOutput("Images", $member);
}
}
/**
* Remove a member of an image
*
* @param String $image_id Identifier of the image
* @param String $member_id Identifier of the member
*
* @return void
*/
private function removeMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
if(!isset($image_id)){
$this->app->setOutput("Error", "Incorrect image id parameter");
}
else if(!isset($member_id)){
$this->app->setOutput("Error", "Incorrect member id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$member = $image->getMember($member_id);
if($member == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Member doesn't exist");
}
$member->delete();
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
/**
* Update a member of an image
*
* @param String $image_id Identifier of the image
* @param String $member_id Identifier of the member
* @param String $status New status for the member
*
* @return void
**/
private function updateMemberImage(){
$image_id = $this->app->getPostParam("image_id");
$member_id = $this->app->getPostParam("member_id");
$status = $this->app->getPostParam("status");
if(!isset($image_id)){
$this->app->setOutput("Error", "Incorrect image id parameter");
}
else if(!isset($member_id)){
$this->app->setOutput("Error", "Incorrect member id parameter");
}
else{
try{
$service = $this->libClass;
$image = $service->getImage($id);
if($image == null){ // if the image don't exists -> error
$this->app->setOutput("Error", "Image doesn't exist");
}
$member = $image->getMember($member_id);
if($member == null){ // if the member don't exists -> error
$this->app->setOutput("Error", "Member doesn't exist");
}
$member->updateStatus($status);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}
}
?>

View file

@ -0,0 +1,581 @@
<?php
/**
* File containing the override of the authentication for the Library.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
* @todo Check with the API, the condition and test the revoke token implementation
*/
use GuzzleHttp\Client;
use OpenCloud\Common\Transport\HandlerStack;
use OpenCloud\Common\Transport\Middleware;
use OpenStack\Identity\v3\Service;
use OpenStack\Identity\v3\Api;
use OpenCloud\Common\Auth\Token;
use OpenCloud\Common\Transport\Utils;
use OpenStack\Identity\v3\Models;
/**
* genTokenOptions Class
*
* This class allow the generation of tokens for openstack, and to inject
* those tokens into the library. Which allow to do a proper login only once
* and not for each request
*
*/
class genTokenOptions
{
/** @var Array $optionsGlobal private, contains the options common for the different tokens */
private $optionsGlobal;
/** @var Array $backup private, contains all the informations about the different tokens. It contains the information send to the clients */
private $backup = [];
/** @var GuzzleHttp\Client $httpClient private, contains a default Client to construct some OpenStack library object */
private $httpClient;
/**
* genTokenOptions constructor
*
* @param Array $options Options to create the objects in the library
* AuthUrl is the main options required
*
* @return genTokenOptions Object
*/
public function __construct($options){
$stack = HandlerStack::create();
$httpClient = new Client([
'base_uri' => Utils::normalizeUrl($options['authUrl']),
'handler' => $stack,
]);
$this->httpClient = $httpClient;
$options['identityService'] = Service::factory($httpClient);
$options['authHandler'] = function () use ($options) {
return $options['identityService']->generateToken($options);
};
$this->optionsGlobal['Common'] = $options;
}
/**
* Add a debug for the library
*
* @param array $options Debug options, cf library
* @param HandlerStack $stack pointer to a HandlerStack object
*
* @return void
*/
private function addDebugMiddleware(array $options, HandlerStack &$stack)
{
if (!empty($options['debugLog'])
&& !empty($options['logger'])
&& !empty($options['messageFormatter'])
) {
$stack->push(GuzzleMiddleware::log($options['logger'], $options['messageFormatter']));
}
}
/**
* Check the expiration time of a token
*
* @return boolean if the token is not expired
*/
public function checkToken(){
return $this->backup['time'] > time();
}
/**
* Generate a new token for the Identity service
*
* @return void
*/
public function genIdentityToken(){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'false';
$options['catalogType'] = 'false';
$options['region'] = 'RegionOne';
//list($token, $baseUrl) = $options['identityService']->authenticate($options);
$baseUrl = $options["authUrl"];
$token = $options['identityService']->generateToken($options);
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Identity', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Identity'] = $options;
}
/**
* Revoke the token for the Identity Service
*
* @return void
*/
public function revokeIdentityToken(){
$token = $this->unserializeToken($this->backup['Identity']['token']);
$this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
}
/**
* Load a token for the Identity Service
*
* @param String $opt serialized token
*
* @return void
*/
public function loadIdentityBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'false';
$options['catalogType'] = 'false';
$options['region'] = 'RegionOne';
$this->backup['Identity'] = $opt;
$token = $this->unserializeToken($this->backup['Identity']['token']);
$baseUrl = $this->backup['Identity']['baseUrl'];
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Identity', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Identity'] = $options;
}
/**
* Generate a new token for the Image service
*
* @return void
*/
public function genImageToken(){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'glance';
$options['catalogType'] = 'image';
$options['region'] = 'RegionOne';
list($token, $baseUrl) = $options['identityService']->authenticate($options);
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Image', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Image'] = $options;
}
/**
* Revoke the token for the Image Service
*
* @return void
*/
public function revokeImageToken(){
$token = $this->unserializeToken($this->backup['Image']['token']);
$this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
}
/**
* Load a token for the Image Service
*
* @param String $opt serialized token
*
* @return void
*/
public function loadImageBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'glance';
$options['catalogType'] = 'image';
$options['region'] = 'RegionOne';
$this->backup['Image'] = $opt;
$token = $this->unserializeToken($this->backup['Image']['token']);
$baseUrl = $this->backup['Image']['baseUrl'];
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Image', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Image'] = $options;
}
/**
* Generate a new token for the Metwork service
*
* @return void
*/
public function genNetworkToken(){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'neutron';
$options['catalogType'] = 'network';
$options['region'] = 'RegionOne';
list($token, $baseUrl) = $options['identityService']->authenticate($options);
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Network', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Network'] = $options;
}
/**
* Revoke the token for the Network Service
*
* @return void
*/
public function revokeNetworkToken(){
$token = $this->unserializeToken($this->backup['Network']['token']);
$this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
}
/**
* Load a token for the Network Service
*
* @param String $opt serialized token
*
* @return void
*/
public function loadNetworkBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'neutron';
$options['catalogType'] = 'network';
$options['region'] = 'RegionOne';
$this->backup['Network'] = $opt;
$token = $this->unserializeToken($this->backup['Network']['token']);
$baseUrl = $this->backup['Network']['baseUrl'];
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Network', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Network'] = $options;
}
/**
* Generate a new token for the Compute service
*
* @return void
*/
public function genComputeToken(){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'nova';
$options['catalogType'] = 'compute';
$options['region'] = 'RegionOne';
list($token, $baseUrl) = $options['identityService']->authenticate($options);
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Compute', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Compute'] = $options;
}
/**
* Revoke the token for the Compute Service
*
* @return void
*/
public function revokeComputeToken(){
$token = $this->unserializeToken($this->backup['Compute']['token']);
$this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
}
/**
* Load a token for the Compute Service
*
* @param String $opt serialized token
*
* @return void
*/
public function loadComputeBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'nova';
$options['catalogType'] = 'compute';
$options['region'] = 'RegionOne';
$this->backup['Compute'] = $opt;
$token = $this->unserializeToken($this->backup['Compute']['token']);
$baseUrl = $this->backup['Compute']['baseUrl'];
$stack = HandlerStack::create();
$stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
'handler' => $stack,
]);
$this->saveBackup('Compute', array('token' => $token, 'baseUrl' => $baseUrl ));
$this->optionsGlobal['Compute'] = $options;
}
/**
* Save the token given a service name
*
* @param String $name name of the service to save
* @param Array $data token and baseUrl for the service
*
* @return void
*/
private function saveBackup($name, $data){
$token = $this->serializeToken($data["token"]);
$ret = file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved']));
if($ret === FALSE)
die("Internal Server Error : File Rights");
$this->backup['time'] = $token['time'];
$this->backup["roles"] = $token["roles"];
$this->backup["project"] = $token['saved']["project"]["name"];
$this->backup["user"] = $token["user"];
$this->backup[$name] = array('token' => $token["token"], 'baseUrl' => $data["baseUrl"] );
}
/**
* Retrieve the tokens saved
*
* @return String tokens serialized
*/
public function getBackup(){
return serialize($this->backup);
}
/**
* Load tokens into the library
*
* @param String $back tokens serialized
*
* @return void
*/
public function loadBackup($back){
$backup = unserialize($back);
$this->backup['time'] = $backup['time'];
$this->backup["roles"] = $backup["roles"];
$this->backup["project"] = $backup["project"];
$this->backup["user"] = $backup["user"];
$this->loadComputeBackup($backup["Compute"]);
$this->loadIdentityBackup($backup["Identity"]);
$this->loadImageBackup($backup["Image"]);
$this->loadNetworkBackup($backup["Network"]);
}
/**
* Retrieve the common options for a service
*
* @param String $service name of the service
*
* @return array Options to create the library class corresponding to this service
*/
public function getOptions($service){
return $this->optionsGlobal[$service];
}
/**
* Serialize a given token
*
* @param Array $token token to be serialized
*
* @return String token serialized
*/
private function serializeToken($token){
global $config;
$tokenSerialized = [];
$tokenSerialized["token"]["methods"] = serialize($token->methods);
$tokenSerialized["roles"] = [];
foreach($token->roles as $role){
$tokenSerialized["roles"][$role->id]["links"] = serialize($role->links);
$tokenSerialized["roles"][$role->id]["name"] = serialize($role->name);
}
$tokenSerialized["token"]["expires"] = serialize($token->expires);
$tokenSerialized['saved']["project"]["domainId"] = serialize($token->project->domainId);
$tokenSerialized['saved']["project"]["parentId"] = serialize($token->project->parentId);
$tokenSerialized['saved']["project"]["enabled"] = serialize($token->project->enabled);
$tokenSerialized['saved']["project"]["description"] = serialize($token->project->description);
$tokenSerialized['saved']["project"]["id"] = serialize($token->project->id);
$tokenSerialized['saved']["project"]["links"] = serialize($token->project->links);
$tokenSerialized['saved']["project"]["name"] = $token->project->name;
$tokenSerialized['saved']["catalog"] = array();
foreach($token->catalog->services as $service){
$tokenSerialized['saved']["catalog"][$service->id]["name"] = serialize($service->name);
$tokenSerialized['saved']["catalog"][$service->id]["description"] = serialize($service->description);
$tokenSerialized['saved']["catalog"][$service->id]["type"] = serialize($service->type);
foreach($service->endpoints as $end){
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["interface"] = serialize($end->interface);
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["name"] = serialize($end->name);
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["serviceId"] = serialize($end->serviceId);
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["region"] = serialize($end->region);
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["links"] = serialize($end->links);
$tokenSerialized['saved']["catalog"][$service->id]["endpoints"][$end->id]["url"] = serialize($end->url);
}
$tokenSerialized['saved']["catalog"][$service->id]["links"] = serialize($service->links);
}
$tokenSerialized["token"]["extras"] = serialize($token->extras);
$tokenSerialized["user"]["domainId"] = serialize($token->user->domainId);
$tokenSerialized["user"]["defaultProjectId"] = serialize($token->user->defaultProjectId);
$tokenSerialized["user"]["id"] = serialize($token->user->id);
$tokenSerialized["user"]["email"] = serialize($token->user->email);
$tokenSerialized["user"]["enabled"] = serialize($token->user->enabled);
$tokenSerialized["user"]["description"] = serialize($token->user->description);
$tokenSerialized["user"]["links"] = serialize($token->user->links);
$tokenSerialized["user"]["name"] = serialize($token->user->name);
$tokenSerialized["token"]["issued"] = serialize($token->issued);
$tokenSerialized["token"]["id"] = serialize($token->id);
$tokenSerialized['time'] = time()+$config['tokenTime']*60;
return $tokenSerialized;
}
/**
* Unserialize a token
*
* Unserialize a token and recreate the architecture of the library token
*
* @param String $tokenSerialized the token to be unserialized
*
* @return OpenCloud\Common\Auth\Token the token unserialized
*/
private function unserializeToken($tokenSerialized){
$Saved = file_get_contents("core/LibOverride/projectTokenData/".$this->backup["project"]);
if($Saved === FALSE)
die("Internal Server Error : File Access");
$Saved = unserialize($Saved);
$api = new Api();
$token = new Models\Token($this->httpClient, $api);
$token->methods = unserialize($tokenSerialized["methods"]);
$token->roles = [];
foreach($this->backup["roles"] as $key => $role){
$tmp = new Models\Role($this->httpClient, $api);
$tmp->id = $key;
$tmp->links = unserialize($role["links"]);
$tmp->name = unserialize($role["name"]);
$token->roles[] = $tmp;
}
$token->expires = unserialize($tokenSerialized["expires"]);
$token->project = new Models\Project($this->httpClient, $api);
$token->project->domainId = unserialize($Saved["project"]["domainId"]);
$token->project->parentId = unserialize($Saved["project"]["parentId"]);
$token->project->enabled = unserialize($Saved["project"]["enabled"]);
$token->project->description = unserialize($Saved["project"]["description"]);
$token->project->id = unserialize($Saved["project"]["id"]);
$token->project->links = unserialize($Saved["project"]["links"]);
$token->project->name = $Saved["project"]["name"];
$token->catalog = new Models\Catalog($this->httpClient, $api);
$token->catalog->services = [];
foreach($Saved["catalog"] as $key => $service){
$tmp = new Models\Service($this->httpClient, $api);
$tmp->id = $key;
$tmp->name = unserialize($service["name"]);
$tmp->description = unserialize($service["description"]);
$tmp->type = unserialize($service["type"]);
$tmp->endpoints = [];
foreach($service["endpoints"] as $key => $end){
$tmpEnd = new Models\Endpoint($this->httpClient, $api);
$tmpEnd->id = $key;
$tmpEnd->interface = unserialize($end["interface"]);
$tmpEnd->name = unserialize($end["name"]);
$tmpEnd->serviceId = unserialize($end["serviceId"]);
$tmpEnd->region = unserialize($end["region"]);
$tmpEnd->links = unserialize($end["links"]);
$tmpEnd->url = unserialize($end["url"]);
$tmp->endpoints[] = $tmpEnd;
}
$tmp->links = unserialize($service["links"]);
$token->catalog->services[] = $tmp;
}
$token->extras = unserialize($tokenSerialized["extras"]);
$token->user = new Models\User($this->httpClient, $api);
$token->user->domainId = unserialize($this->backup["user"]["domainId"]);
$token->user->defaultProjectId = unserialize($this->backup["user"]["defaultProjectId"]);
$token->user->id = unserialize($this->backup["user"]["id"]);
$token->user->email = unserialize($this->backup["user"]["email"]);
$token->user->enabled = unserialize($this->backup["user"]["enabled"]);
$token->user->links = unserialize($this->backup["user"]["links"]);
$token->user->name = unserialize($this->backup["user"]["name"]);
$token->user->description = unserialize($this->backup["user"]["description"]);
$token->issued = unserialize($tokenSerialized["issued"]);
$token->id = unserialize($tokenSerialized["id"]);
return $token;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,532 @@
<?php
/**
* File containing the networkLayer3 Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Evan Pisani 'yogg at epsina . com'
*
*/
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
use OpenCloud\Common\Error\NotImplementedError;
use OpenCloud\Common\Error\UserInputError;
include("CoreInterface.php");
/**
* networkLayer3 Class of the back-end application
*
* Management of networkLayer3
*
*/
class networkLayer3 implements Core{
/** @var App $app protected, contains the main app object */
protected $app;
/** @var OpenStack\NetworkLayer3 $libClass protected, contains the library NetworkLayer3 object */
protected $libClass;
/**
* networkLayer3 constructor
*
* @param App $app the main app object
*
* @return networkLayer3 Object
*/
public function __construct($app){
if(!isset($app)){
$this->app->setOutput("Error", "Incorrect parameter app");
}
$this->app = $app;
$this->libClass = $app->getLibClass("NetworkLayer3");
}
/**
* Execute an action
*
* @param String $action name of another function of this class
*
* @return void
*/
public function action($action){
$this->{$action.""}();
}
/**
* List floatingip
*
* @return void
*/
private function listFloatingIp(){
try{
$result = array();
$l = $this->libClass->listFloatingIps();
error_log(var_export($l, true), 0);
foreach ($l as $tmp) {
$result[] = $tmp;
}
$this->app->setOutput("NetworkLayer3", $result);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Create a new floating IP adress
*
* @param array $opt Options for the floating ip creation (floatingNetworkId is required)
*
* @return void
*/
private function createFloatingIp(){
$opt = $this->app->getPostParam("opt");
if(!isset($opt)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
$floatingip = $this->libClass->createFloatingIp($opt);
if(!isset($floatingip)){
$this->app->setOutput("Error", "Unknowing error during floating ip creation");
}else{
$this->app->setOutput("NetworkLayer3", $floatingip);
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Show floatingip details
*
* @param String id the id of the floatingip
*
* @return void
*/
private function getFloatingIp(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of floating IPs
$res = array();
$l = $this->libClass->listFloatingIps();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknow id");
}else{ // If id exists
$res = $this->libClass->getFloatingIp($id);
$this->app->setOutput("NetworkLayer3", $res);
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Update floating ip
*
* @param id the id of the floatingip to update
*
* @return void
*/
private function updateFloatingIp(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of floating IPs
$res = array();
$l = $this->libClass->listFloatingIps();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknowing floatingip id");
}else{
$result->update();
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Delete a floating ip
*
* @param string floatingip_id the floating-ip id to delete
*
* @return void
*/
private function deleteFloatingIp(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of floating IPs
$res = array();
$l = $this->libClass->listFloatingIps();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknowing floatingip id");
}else{
$result->delete();
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Retrieve a floating ip
*
* @param string floatingip_id the floating-ip id to retrieve
*
* @return void
*/
private function retrieveFloatingIp(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of floating IPs
$res = array();
$l = $this->libClass->listFloatingIps();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknowing floatingip id");
}else{
$result->retrieve();
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Create a new router
*
* @param array $opt Options for the new router
* externalGatewayInfo[] required (only the param networkId in the tab)
* adminStateUp (optionnal)
* name (optionnal)
*
* @return void
*/
private function createRouter(){
$opt = $this->app->getPostParam("opt");
if(!isset($opt)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
$router = $this->libClass->createRouter($opt);
if(!isset($router)){
$this->app->setOutput("Error", "Unknowing error during floating ip creation");
}else{
$this->app->setOutput("NetworkLayer3", $router);
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* List routers
*
* @return void
*/
private function listRouters(){
try{
$result = array();
$l = $this->libClass->listRouters();
foreach ($l as $tmp) {
$result[] = $tmp;
}
$this->app->setOutput("NetworkLayer3", $result);
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Show router details
*
* @param String id the id of the router
*
* @return void
*/
private function getRouter(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of routers
$res = array();
$l = $this->libClass->listRouters();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknow id");
}else{ // If id exists
$res = $this->libClass->getRouter($id);
$this->app->setOutput("NetworkLayer3", $res);
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Delete a router
*
* @param string router the router to delete
*
* @return void
*/
private function deleteRouter(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of routers
$res = array();
$l = $this->libClass->listRouters();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknowing router id");
}else{
$result->delete();
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
/**
* Update router
*
* @param id the id of the floatingip to update
*
* @return void
*/
private function updateRouter(){
$id = $this->app->getPostParam("id");
if(!isset($id)){
$this->app->setOutput("Error", "Incorrect parameter opt");
}
try{
// List of floating IPs
$res = array();
$l = $this->libClass->listRouters();
foreach ($l as $tmp) {
$res[] = $tmp;
}
// Verification if id exists
$result = null;
foreach ($res as $f) {
if(strcmp($f->id, $id)){
$result = $f;
}
}
if(!isset($result)){ // If id doesn't exists
$this->app->setOutput("Error", "Unknowing floatingip id");
}else{
$result->update();
}
}catch(BadResponseError $e){
$this->app->getErrorInstance()->BadResponseHandler($e);
}catch(UserInputError $e){
$this->app->getErrorInstance()->UserInputHandler($e);
}catch(BaseError $e){
$this->app->getErrorInstance()->BaseErrorHandler($e);
}catch(NotImplementedError $e){
$this->app->getErrorInstance()->NotImplementedHandler($e);
}catch(Exception $e){
$this->app->getErrorInstance()->OtherException($e);
}
}
}

254
server/doc/files/index.html Normal file
View file

@ -0,0 +1,254 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1729739287"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1729739287" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>index.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/index.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,91 @@
<?php
/**
* File containing the code for the API door.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
*/
/*
*/
//loading dependencies
require "vendor/autoload.php";
//Include general config file
include_once("config.inc.php");
//Include API initialisation
include_once("init.php");
if(isset($_POST["task"]) && isset($_POST["action"])){
$task = $_POST["task"];
$action = $_POST["action"];
}else if(isset($_POST["task"]) && $_POST["task"] == "Authenticate" || $_POST["task"] == "Deauthenticate"){
$task = $_POST["task"];
}else{
$App->setOutput("Error", "Invalid Request!");
$App->show();
exit();
}
//Authentification and deauthentification request
if($task == "Authenticate"){
$App->authenticate();
$App->show();
}else if($task == "Deauthenticate"){
$App->deauthenticate();
$App->show();
}else if($App->checkToken()){
//Task switcher and task's file loader
switch($task)
{
case "identity":
include_once("core/Identity.php");
$identityObject = new identity($App);
$identityObject->action($action);
$App->show();
break;
case "network":
include_once("core/Network.php");
$networkObject = new network($App);
$networkObject->action($action);
$App->show();
break;
case "image":
include_once("core/Image.php");
$imageObject = new image($App);
$imageObject->action($action);
$App->show();
break;
case "compute":
include_once("core/Compute.php");
$computeObject = new compute($App);
$computeObject->action($action);
$App->show();
break;
case "networkLayer3":
include_once("core/NetworkLayer3.php");
$computeObject = new networkLayer3($App);
$computeObject->action($action);
$App->show();
break;
}
}else{
//Request without authentication
$App->setOutput("Error", "Token Invalide");
$App->show();
}

254
server/doc/files/init.html Normal file
View file

@ -0,0 +1,254 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>API Documentation</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">API Documentation</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">5</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">62</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-700368005"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-700368005" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="interface"><a href="../classes/Core.html">Core</a></li>
<li class="class"><a href="../classes/App.html">App</a></li>
<li class="class"><a href="../classes/automating.html">automating</a></li>
<li class="class"><a href="../classes/compute.html">compute</a></li>
<li class="class"><a href="../classes/errorManagement.html">errorManagement</a></li>
<li class="class"><a href="../classes/genTokenOptions.html">genTokenOptions</a></li>
<li class="class"><a href="../classes/image.html">image</a></li>
<li class="class"><a href="../classes/network.html">network</a></li>
<li class="class"><a href="../classes/networkLayer3.html">networkLayer3</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>init.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/init.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on April 27th, 2016 at 20:51.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View file

@ -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);
?>