Init core class, Init plugin functionnality

This commit is contained in:
Eole 2016-01-25 23:36:23 +01:00
parent e17f02814d
commit ef05e8a90d
8 changed files with 46 additions and 0 deletions

1
server/core/Compute.php Normal file
View file

@ -0,0 +1 @@

1
server/core/Identity.php Normal file
View file

@ -0,0 +1 @@

1
server/core/Image.php Normal file
View file

@ -0,0 +1 @@

1
server/core/Network.php Normal file
View file

@ -0,0 +1 @@

13
server/core/Plugin.php Normal file
View file

@ -0,0 +1,13 @@
<?php
abstract class plugin{
public $api;
public function __construct($api){
$this->api = $api;
}
}

View file

@ -0,0 +1,24 @@
<?php
//Init plugin directory
if (!defined('RCUBE_PLUGINS_DIR')) {
define('RCUBE_PLUGINS_DIR', RCUBE_INSTALL_PATH . 'plugins/');
}
class plugin_api{
static protected $instance;
protected function __construct(){
}
static function getInstance(){
if(!self::$instance){
self::$instance = new plugin_api();
}
return self::$instance;
}
}

View file

@ -3,4 +3,7 @@
include_once("config.inc.php");
include_once("init.php");
$task = $_POST["task"];
$action = $_POST["action"];

View file

@ -1,5 +1,6 @@
<?php
include_once("config.inc.php");
include_once("core/Plugin_Api.php");
require "vendor/autoload.php";
//traitement requete, recuperation data
@ -32,4 +33,5 @@
$openstack_api = new OpenStack\OpenStack($Args);
$pluginApi = plugin_api::getInstance();
?>