|
@@ -10,6 +10,52 @@ use Twig_Loader_Filesystem;
|
10
|
10
|
class LuGenerator {
|
11
|
11
|
private $_pdo;
|
12
|
12
|
|
|
13
|
+ private $_config = array("dbo" =>
|
|
14
|
+ array(
|
|
15
|
+ "namespace" => 'App\Http\DBO',
|
|
16
|
+ "folder" => '../app/Http/DBO',
|
|
17
|
+ "mode" => 0775
|
|
18
|
+ ),
|
|
19
|
+ "models" =>
|
|
20
|
+ array(
|
|
21
|
+ "namespace" => 'App\Http\DataAccess\Models',
|
|
22
|
+ "folder" => '../app/Http/DataAccess/Models',
|
|
23
|
+ "mode" => 0775
|
|
24
|
+ ),
|
|
25
|
+ "sp" =>
|
|
26
|
+ array(
|
|
27
|
+ "namespace" => 'App\Http\DataAccess\SP',
|
|
28
|
+ "folder" => '../app/Http/DataAccess/SP',
|
|
29
|
+ "mode" => 0775
|
|
30
|
+ ),
|
|
31
|
+ "dataaccess" =>
|
|
32
|
+ array(
|
|
33
|
+ "namespace" => 'App\Http\DataAccess',
|
|
34
|
+ "folder" => '../app/Http/DataAccess',
|
|
35
|
+ "mode" => 0775
|
|
36
|
+ ),
|
|
37
|
+ "business" =>
|
|
38
|
+ array(
|
|
39
|
+ "namespace" => 'App\Http\Business',
|
|
40
|
+ "folder" => '../app/Http/Business',
|
|
41
|
+ "mode" => 0775
|
|
42
|
+ )
|
|
43
|
+ );
|
|
44
|
+ /**
|
|
45
|
+ * @return array
|
|
46
|
+ */
|
|
47
|
+ public function getConfig()
|
|
48
|
+ {
|
|
49
|
+ return $this->_config;
|
|
50
|
+ }
|
|
51
|
+ /**
|
|
52
|
+ * @param array $config
|
|
53
|
+ */
|
|
54
|
+ public function setConfig($config)
|
|
55
|
+ {
|
|
56
|
+ $this->_config = $config;
|
|
57
|
+ }
|
|
58
|
+
|
13
|
59
|
public function __construct($db_connection, $db_database, $db_host, $db_port, $db_username, $db_password)
|
14
|
60
|
{
|
15
|
61
|
$dsn = $db_connection . ":dbname=" . $db_database . ";host="
|
|
@@ -217,19 +263,19 @@ ORDER BY parameters.ordinal_position;");
|
217
|
263
|
mkdir($dir, $dir_mode, true);
|
218
|
264
|
}
|
219
|
265
|
|
220
|
|
- public function run($dir_mode, $dbo_dir, $model_dir, $sp_dir, $manager_dir, $business_dir)
|
|
266
|
+ public function run()
|
221
|
267
|
{
|
222
|
|
- $dbo_dir .= "/";
|
223
|
|
- $model_dir .= "/";
|
224
|
|
- $sp_dir .= "/";
|
225
|
|
- $manager_dir .= "/";
|
226
|
|
- $business_dir .= "/";
|
|
268
|
+ $dbo_dir = $this->_config["dbo"]["folder"] . "/";
|
|
269
|
+ $model_dir = $this->_config["models"]["folder"] . "/";
|
|
270
|
+ $sp_dir = $this->_config["sp"]["folder"] . "/";
|
|
271
|
+ $manager_dir = $this->_config["dataaccess"]["folder"] . "/";
|
|
272
|
+ $business_dir = $this->_config["business"]["folder"] . "/";
|
227
|
273
|
|
228
|
|
- $this->mkdir($dbo_dir, $dir_mode);
|
229
|
|
- $this->mkdir($model_dir, $dir_mode);
|
230
|
|
- $this->mkdir($sp_dir, $dir_mode);
|
231
|
|
- $this->mkdir($manager_dir, $dir_mode);
|
232
|
|
- $this->mkdir($business_dir, $dir_mode);
|
|
274
|
+ $this->mkdir($dbo_dir, $this->_config["dbo"]["mode"]);
|
|
275
|
+ $this->mkdir($model_dir, $this->_config["models"]["mode"]);
|
|
276
|
+ $this->mkdir($sp_dir, $this->_config["sp"]["mode"]);
|
|
277
|
+ $this->mkdir($manager_dir, $this->_config["dataaccess"]["mode"]);
|
|
278
|
+ $this->mkdir($business_dir, $this->_config["business"]["mode"]);
|
233
|
279
|
|
234
|
280
|
$tables = $this->getTables();
|
235
|
281
|
if (!is_null($tables)) {
|