-
Notifications
You must be signed in to change notification settings - Fork 0
/
zfx.php
32 lines (25 loc) · 838 Bytes
/
zfx.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__)).'/');
require APPLICATION_PATH.'Zfx/Zfx.php';
require 'Zend/Db.php';
require 'Zend/Config/Ini.php';
$section = 'production';
$template = 'default';
if (isset($argv[2])) {
$section = $argv[2];
}
if (isset($argv[3])) {
$template = $argv[3];
}
$config = new Zend_Config_Ini('application/configs/application.ini', $section);
$db = Zend_Db::factory($config->resources->db);
$zfx = new Zfx($argv[1]);
$zfx->getTablesFromZendDb($db)
->runZfControllers()
->runZfDbTables()
->runZfModels()
->createModelsAutoproperties(APPLICATION_PATH.'templates/default_autoproperties.php')
->extendModelsFromAutoproperties()
->runZfMappers()
->generateMappersFromTemplate(APPLICATION_PATH.'templates/'.$template.'_mapper.php');