Esempio n. 1
0
<?php

require zend_deployment_library_path('ZendServerDeploymentHelper') . '/deph.php';
$deph = new DepH();
#$debugger = $deph->getDebugger();
#$debugger->start('10.0.3.1');
$log = $deph->get('log');
$params = $deph->getParams();
/* 
 * DB SETTINGS
 */
$tplFilename = __DIR__ . '/templates/db.local.php';
$path = $deph->getPath();
$targetFile = $path->getAppsDir() . '/phundament/custom/config/db.local.php';
$template = $deph->getTemplate();
$template->write($tplFilename, $targetFile, [], []);
/*
 * new Module
 */
$tplFilename = __DIR__ . '/templates/module.local.php';
$path = $deph->getPath();
$targetFile = $path->getAppsDir() . '/phundament/custom/config/' . $params->get('MODULE_NAME') . '.local.php';
$search = ['#MODULE_NAME#', '#MODULE_DB_HOST#', '#MODULE_DB_PORT#', '#MODULE_DB_NAME#', '#MODULE_DB_USER#', '#MODULE_DB_PASS#'];
$replace = [$params->get('MODULE_NAME'), $params->get('MODULE_DB_HOST'), $params->get('MODULE_DB_PORT'), $params->get('MODULE_DB_NAME'), $params->get('MODULE_DB_USER'), $params->get('MODULE_DB_PASS')];
$template = $deph->getTemplate();
$template->write($tplFilename, $targetFile, $search, $replace);
/*
 * new Module Class
 */
$tplFilename = __DIR__ . '/templates/Module.php';
$path = $deph->getPath();
Esempio n. 2
0
<?php

require zend_deployment_library_path('ZendServerDeploymentHelper') . '/deph.php';
$deph = new DepH();
$sql = __DIR__ . '/templates/phundament.sql';
$params = $deph->getParams();
$mysqlClient = $params->get('MYSQL_CLIENT_PATH');
$user = $params->get('DB_USER');
$pass = $params->get('DB_PASS');
$host = $params->get('DB_HOST');
$port = $params->get('DB_PORT');
$shell = $deph->getShell();
$shell->exec("{$mysqlClient} -u {$user} -p{$pass} -h {$host} -P {$port} < {$sql}");
Esempio n. 3
0
<?php

require zend_deployment_library_path('ZendServerDeploymentHelper') . '/deph.php';
$deph = new DepH();
#$debugger = $deph->getDebugger();
#$debugger->start('10.0.3.1');
$log = $deph->get('log');
$path = $deph->getPath();
$params = $deph->getParams();
$persistentAssests = $path->getAppsDir() . '/phundament/web/assets';
$packageAssets = $params->getApplicationBaseDir() . '/web/assets';
$persistentRuntime = $path->getAppsDir() . '/phundament/runtime';
$packageRuntime = $params->getApplicationBaseDir() . '/runtime';
$path->createWriteableDir($persistentAssests);
$path->createWriteableDir($persistentRuntime);
$shell = $deph->getShell();
$uid = $params->getWebserverUid();
$gid = $params->getWebserverGid();
$shell->exec("mv {$packageAssets}/* {$persistentAssests}");
$shell->exec("rm -rf {$packageAssets}");
$shell->exec("ln -s {$persistentAssests} {$packageAssets}");
$shell->exec("chown -R {$uid}:{$gid} {$persistentAssests}");
$shell->exec("chmod -R 0775 {$persistentAssests}");
$shell->exec("mv {$packageRuntime}/* {$persistentRuntime}");
$shell->exec("rm -rf {$packageRuntime}");
$shell->exec("ln -s {$persistentRuntime} {$packageRuntime}");
$shell->exec("chown -R {$uid}:{$gid} {$persistentRuntime}");
$shell->exec("chmod -R 0775 {$persistentRuntime}");
/*
 * prepare dirs for code generation from giiant
 */