public function previewAction() { $p = $this->request->getPost(); $prefix = $p['prefix']; $tableName = $p['table_name']; if ($prefix) { $tableName = "{$prefix}_{$tableName}"; } $modelName = Strings::tableNameToModelName($tableName); $path = ApplicationConfig::getConfig('product')['path'] . '\\www'; $this->createModelConfigFile($path, $modelName, $p); $configPath = ApplicationConfig::getConfigPath('config.json'); $cmdLine = "--prefix={$prefix} --table={$tableName} --config=\"{$configPath}\""; $c = Python3::run("build_mvc.py", $cmdLine); $targetHost = ApplicationConfig::getConfig('product')['host']; $testListUrl = "{$targetHost}/{$modelName}"; parent::result(array('model' => $modelName, 'files' => json_decode($c), 'cmd_line' => $cmdLine, 'test_list_url' => $testListUrl, 'build' => $c)); }
/** * @param $pythonFile * @param $params * @return string */ public static function run($pythonFile, $params = false) { $builder = ApplicationConfig::getConfig('builder'); $builderPath = $builder['scripts-path']; return exec("python {$builderPath}\\{$pythonFile} {$params}"); }
private static function getFileUploadPath() { $path = ApplicationConfig::getConfig('product')['path'] . '\\www\\model\\file-upload\\'; return $path; }
public function __construct($di) { parent::__construct($di); $this->config = ApplicationConfig::getConfig(); self::$app = $this; }
public static function getEnumPath() { $productPath = ApplicationConfig::getConfig('product')['path']; $classNamePath = $productPath . '/www/defines'; return $classNamePath; }