|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Controller Manager |
|
5
|
|
|
* |
|
6
|
|
|
* @category src\BackOffice |
|
7
|
|
|
* @package src\BackOffice\common |
|
8
|
|
|
* @author Judicaël Paquet <[email protected]> |
|
9
|
|
|
* @copyright Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93) |
|
10
|
|
|
* @license https://github.com/las93/uranium/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël |
|
11
|
|
|
* @version Release: 1.0.0 |
|
12
|
|
|
* @filesource https://github.com/las93/venus2 |
|
13
|
|
|
* @link https://github.com/las93 |
|
14
|
|
|
* @since 1.0 |
|
15
|
|
|
*/ |
|
16
|
|
|
namespace Venus\src\plugins\common; |
|
17
|
|
|
|
|
18
|
|
|
use \Venus\core\Config as Config; |
|
19
|
|
|
use \Venus\core\Controller as CoreController; |
|
20
|
|
|
use \Venus\src\Batch\Controller\Entity as Entity; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Controller Manager |
|
24
|
|
|
* |
|
25
|
|
|
* @category src\BackOffice |
|
26
|
|
|
* @package src\BackOffice\common |
|
27
|
|
|
* @author Judicaël Paquet <[email protected]> |
|
28
|
|
|
* @copyright Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93) |
|
29
|
|
|
* @license https://github.com/las93/uranium/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël |
|
30
|
|
|
* @version Release: 1.0.0 |
|
31
|
|
|
* @filesource https://github.com/las93/venus2 |
|
32
|
|
|
* @link https://github.com/las93 |
|
33
|
|
|
* @since 1.0 |
|
34
|
|
|
*/ |
|
35
|
|
|
abstract class Controller extends CoreController |
|
36
|
|
|
{ |
|
37
|
|
|
/** |
|
38
|
|
|
* Constructor |
|
39
|
|
|
* |
|
40
|
|
|
* @access public |
|
41
|
|
|
* @return object |
|
|
|
|
|
|
42
|
|
|
*/ |
|
43
|
|
|
public function __construct() |
|
44
|
|
|
{ |
|
45
|
|
|
parent::__construct(); |
|
46
|
|
|
|
|
47
|
|
|
$this->installDb = function() |
|
|
|
|
|
|
48
|
|
|
{ |
|
49
|
|
|
$oDb = Config::get('Db'); |
|
|
|
|
|
|
50
|
|
|
$oTables = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.preg_replace('/^.*\\\\([a-zA-Z0-9]+)$/', '$1', get_called_class()).DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'Db.conf')); |
|
51
|
|
|
|
|
52
|
|
|
$oDb->configuration->tables = $oTables; |
|
53
|
|
|
|
|
54
|
|
|
$aOptions = [ |
|
55
|
|
|
"p" => CREATE_PORTAL, |
|
56
|
|
|
"c" => true, |
|
57
|
|
|
"e" => true, |
|
58
|
|
|
"b" => json_encode($oDb) |
|
59
|
|
|
]; |
|
60
|
|
|
|
|
61
|
|
|
$oEntity = new Entity; |
|
62
|
|
|
$oEntity->runScaffolding($aOptions); |
|
63
|
|
|
}; |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.