Fixed the rebuild mechanism to run directly without scripts

git-svn-id: file:///svn-source/pmgr/branches/hosted_migration_20130215@1024 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
Abijah
2013-02-16 00:09:39 +00:00
parent 26559f3c59
commit e9028b7558
3 changed files with 7 additions and 43 deletions

View File

@@ -1,5 +0,0 @@
@echo off
mysqldump --user=perki2_pmgruser --password=pmgrauth --opt perki2_pmgr > .pmgr_dev.sql
mysql --user=perki2_pmgruser --password=pmgrauth --database=perki2_pmgr_dev < .pmgr_dev.sql
del .pmgr_dev.sql
echo Build Complete!

View File

@@ -1,5 +0,0 @@
@echo off
mysqldump --user=perki2_pmgruser --password=pmgrauth --opt perki2_pmgr > .pmgr_sand.sql
mysql --user=perki2_pmgruser --password=pmgrauth --database=perki2_pmgr_sand < .pmgr_sand.sql
del .pmgr_sand.sql
echo Build Complete!

View File

@@ -4,31 +4,6 @@ class UtilController extends AppController {
var $uses = array();
/**************************************************************************
**************************************************************************
**************************************************************************
* function: reset_data
* - Development function. TO BE DELETED
*/
function reset_data() {
$this->layout = null;
$this->autoLayout = false;
$this->autoRender = false;
Configure::write('debug', '0');
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
echo "<P>" . date('r') . "\n";
//echo "<P>Script: $script" . "\n";
$handle = popen($script . ' 2>&1', 'r');
//echo "<P>Handle: $handle; " . gettype($handle) . "\n";
echo "<P><PRE>\n";
while (($read = fread($handle, 2096))) {
echo $read;
}
echo "</PRE>\n";
pclose($handle);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -40,21 +15,20 @@ class UtilController extends AppController {
$this->autoLayout = false;
$this->autoRender = false;
Configure::write('debug', '0');
$script = preg_replace('%/webroot/index.php$%',
'/build_'.$type.'box.cmd',
$_SERVER['SCRIPT_FILENAME']);
// REVISIT <AP>: 20090828
// Just use system call
$handle = popen($script . ' 2>&1', 'r');
$usrpass = '--user=perki2_pmgruser --password=pmgrauth';
$boxdb = 'perki2_pmgr_' . $type;
$handle = popen("mysqldump $usrpass --opt perki2_pmgr" .
" | mysql $usrpass --database=$boxdb", 'r');
while (($read = fread($handle, 2096))) {
// Do nothing
}
pclose($handle);
$url = $_SERVER['HTTP_REFERER'];
if (empty($url))
$url = "/";
if (empty($url) || $url == 'undefined')
$url = "/$type";
$this->redirect($url);
}