public function getDBData($newFolder = null) { $external = false; if (file_exists(Util::getRootPath() . "../../phynxConfig")) { $newFolder = Util::getRootPath() . "../../phynxConfig/"; $external = true; } if (file_exists(Util::getRootPath() . "../phynxConfig")) { $newFolder = Util::getRootPath() . "../phynxConfig/"; $external = true; } if ($newFolder == null) { $newFolder = Util::getRootPath() . "system/DBData/"; } $findFor = "*"; if (isset($_SERVER["HTTP_HOST"])) { $findFor = $_SERVER["HTTP_HOST"]; } $data = new mInstallation(); if ($newFolder != "") { $data->changeFolder($newFolder); } $data->setAssocV3("httpHost", "=", $findFor); #$data->loadCollectionV2(); $n = $data->getNextEntry(); if ($n == null) { #$data = new mInstallation(); #if($newFolder != "") $data->changeFolder($newFolder); $data = new mInstallation(); if ($newFolder != "") { $data->changeFolder($newFolder); } $data->setAssocV3("httpHost", "=", "*"); $n = $data->getNextEntry(); } if ($n != null) { $n->changeFolder($newFolder); $d = $n->getA(); } else { if (!isset($_SERVER["HTTP_CLOUD"])) { $I = new Installation(-1); $I->changeFolder($newFolder); $I->makeNewInstallation(); $d = $I->getA(); } } $I2 = new Installation(-1); $s = PMReflector::getAttributesArray($I2->newAttributes()); $t = array(); if (isset($d)) { foreach ($s as $key => $value) { $t[$value] = $d->{$value}; } } $t["external"] = $external; $rt = Environment::getS("databaseData", $t); return $rt; }
public function getDBData($newFolder = null) { if ($newFolder == null) { $newFolder = Util::getRootPath() . "system/DBData/"; } if (!isset($_SERVER["HTTP_HOST"])) { $_SERVER["HTTP_HOST"] = "*"; } $data = new mInstallation(); if ($newFolder != "") { $data->changeFolder($newFolder); } $data->setAssocV3("httpHost", "=", $_SERVER["HTTP_HOST"]); #$data->loadCollectionV2(); $n = $data->getNextEntry(); if ($n == null) { #$data = new mInstallation(); #if($newFolder != "") $data->changeFolder($newFolder); $data = new mInstallation(); if ($newFolder != "") { $data->changeFolder($newFolder); } $data->setAssocV3("httpHost", "=", "*"); $n = $data->getNextEntry(); } if ($n != null) { $n->changeFolder($newFolder); $d = $n->getA(); } else { $I = new Installation(-1); $I->changeFolder($newFolder); $I->makeNewInstallation(); $d = $I->getA(); } $I2 = new Installation(-1); $s = PMReflector::getAttributesArray($I2->newAttributes()); $t = array(); foreach ($s as $key => $value) { $t[$value] = $d->{$value}; } $rt = Environment::getS("databaseData", $t); return $rt; }
public function updateAllTables($echoStatus = false) { $return = parent::updateAllTables(); if ($echoStatus) { ksort($return); echo "<pre style=\"font-size:10px;padding:5px;overflow:auto;max-height:400px;\">"; foreach ($return as $plugin => $status) { echo phynx_mb_str_pad($plugin, 20) . ": {$status}\n"; } echo "</pre>"; } $message = "<p style=\"padding:10px;font-size:20px;color:green;margin-bottom:40px;text-align:center;\">Ihre Datenbank wurde erfolgreich aktualisiert.</p>"; $action = "userControl.doLogout();"; $B = new Button("Benutzer abmelden", "./plugins/Installation/abmelden.png", "icon"); $B->onclick($action); $html = $this->box($B, $action, "Jetzt normal<br />weiterarbeiten"); echo "{$message}<div style=\"width:350px;margin:auto;padding-bottom:40px;\">" . $html . "</div>"; }
*/ if (isset($argv[1])) { $_GET["cloud"] = $argv[1]; } if (isset($argv[2])) { $_SERVER["HTTP_HOST"] = $argv[2]; } session_name("ExtConnInstallation"); require_once realpath(dirname(__FILE__) . "/../../system/connect.php"); $absolutePathToPhynx = realpath(dirname(__FILE__) . "/../../") . "/"; $e = new ExtConn($absolutePathToPhynx); $e->addClassPath($absolutePathToPhynx . "/plugins/Installation"); $e->useDefaultMySQLData(); $e->useAdminUser(); $CH = Util::getCloudHost(); $I = new mInstallation(); $data = $I->updateAllTables(); $T = new HTMLTable(2); $T->setTableStyle("font-size:10px;font-family:sans-serif;"); $T->addColStyle(1, "vertical-align:top;"); foreach ($data as $k => $v) { $T->addRow(array($k, "<pre>" . trim($v) . "</pre>")); } $mimeMail2 = new PHPMailer(true, "", true); $mimeMail2->CharSet = "UTF-8"; $mimeMail2->Subject = "Installation Plugin"; $mimeMail2->From = $CH->emailAdmin; $mimeMail2->Sender = $CH->emailAdmin; $mimeMail2->FromName = "Cloud Server Cronjob"; $mimeMail2->Body = "<html><body>" . $T . "</body></html>"; $mimeMail2->IsHTML();