Init core class, Init plugin functionnality
This commit is contained in:
parent
e17f02814d
commit
ef05e8a90d
8 changed files with 46 additions and 0 deletions
1
server/core/Compute.php
Normal file
1
server/core/Compute.php
Normal file
|
@ -0,0 +1 @@
|
|||
|
1
server/core/Identity.php
Normal file
1
server/core/Identity.php
Normal file
|
@ -0,0 +1 @@
|
|||
|
1
server/core/Image.php
Normal file
1
server/core/Image.php
Normal file
|
@ -0,0 +1 @@
|
|||
|
1
server/core/Network.php
Normal file
1
server/core/Network.php
Normal file
|
@ -0,0 +1 @@
|
|||
|
13
server/core/Plugin.php
Normal file
13
server/core/Plugin.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
abstract class plugin{
|
||||
|
||||
public $api;
|
||||
|
||||
public function __construct($api){
|
||||
|
||||
$this->api = $api;
|
||||
|
||||
}
|
||||
|
||||
}
|
24
server/core/Plugin_Api.php
Normal file
24
server/core/Plugin_Api.php
Normal 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;
|
||||
}
|
||||
}
|
|
@ -3,4 +3,7 @@
|
|||
include_once("config.inc.php");
|
||||
include_once("init.php");
|
||||
|
||||
$task = $_POST["task"];
|
||||
$action = $_POST["action"];
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue