/**
  * Get metadata from this workspace
  *
  * @param string $path the directory where to create the sql files
  * @return array information about this workspace
  */
 public function getMetadata()
 {
     $Fields = array_merge(System::getSysInfo(), $this->getDBInfo());
     $Fields['WORKSPACE_NAME'] = $this->name;
     if (isset($this->dbHost)) {
         //TODO: This code stopped working with the refactoring
         //require_once ("propel/Propel.php");
         //G::LoadClass('dbConnections');
         //$dbConns = new dbConnections('');
         //$availdb = '';
         //foreach( $dbConns->getDbServicesAvailables() as $key => $val ) {
         //if(!empty($availdb))
         //  $availdb .= ', ';
         //  $availdb .= $val['name'];
         //}
         G::LoadClass('net');
         $dbNetView = new NET($this->dbHost);
         $dbNetView->loginDbServer($this->dbUser, $this->dbPass);
         try {
             $sMySQLVersion = $dbNetView->getDbServerVersion('mysql');
         } catch (Exception $oException) {
             $sMySQLVersion = 'Unknown';
         }
         $Fields['DATABASE'] = $dbNetView->dbName($this->dbAdapter) . ' (Version ' . $sMySQLVersion . ')';
         $Fields['DATABASE_SERVER'] = $this->dbHost;
         $Fields['DATABASE_NAME'] = $this->dbName;
         $Fields['AVAILABLE_DB'] = "Not defined";
         //$Fields['AVAILABLE_DB'] = $availdb;
     } else {
         $Fields['DATABASE'] = "Not defined";
         $Fields['DATABASE_SERVER'] = "Not defined";
         $Fields['DATABASE_NAME'] = "Not defined";
         $Fields['AVAILABLE_DB'] = "Not defined";
     }
     return $Fields;
 }
Exemple #2
0
 private function _getSystemInfo()
 {
     G::LoadClass("system");
     if (getenv('HTTP_CLIENT_IP')) {
         $ip = getenv('HTTP_CLIENT_IP');
     } else {
         if (getenv('HTTP_X_FORWARDED_FOR')) {
             $ip = getenv('HTTP_X_FORWARDED_FOR');
         } else {
             $ip = getenv('REMOTE_ADDR');
         }
     }
     $redhat = '';
     if (file_exists('/etc/redhat-release')) {
         $fnewsize = filesize('/etc/redhat-release');
         $fp = fopen('/etc/redhat-release', 'r');
         $redhat = trim(fread($fp, $fnewsize));
         fclose($fp);
     }
     $redhat .= " (" . PHP_OS . ")";
     if (defined("DB_HOST")) {
         G::LoadClass('net');
         G::LoadClass('dbConnections');
         $dbNetView = new NET(DB_HOST);
         $dbNetView->loginDbServer(DB_USER, DB_PASS);
         $dbConns = new dbConnections('');
         $availdb = '';
         foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
             if ($availdb != '') {
                 $availdb .= ', ';
             }
             $availdb .= $val['name'];
         }
         try {
             $sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
         } catch (Exception $oException) {
             $sMySQLVersion = '?????';
         }
     }
     if (file_exists(PATH_HTML . "lib/versions")) {
         $versions = json_decode(file_get_contents(PATH_HTML . "lib/versions"), true);
         $pmuiVer = $versions["pmui_ver"];
         $mafeVer = $versions["mafe_ver"];
         $pmdynaformVer = $versions["pmdynaform_ver"];
     } else {
         $pmuiVer = $mafeVer = $pmdynaformVer = "(unknown)";
     }
     $sysSection = G::loadTranslation('ID_SYSTEM_INFO');
     $pmSection = G::LoadTranslation('ID_PROCESS_INFORMATION');
     $properties = array();
     $ee = class_exists('pmLicenseManager') ? " - Enterprise Edition" : '';
     $systemName = 'ProcessMaker';
     if (defined('SYSTEM_NAME')) {
         $systemName = SYSTEM_NAME;
     }
     $properties[] = array($systemName . ' Ver.', System::getVersion() . $ee, $pmSection);
     $properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection);
     $properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection);
     $properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection);
     if (file_exists(PATH_DATA . 'log/upgrades.log')) {
         $properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), '<a href="#" onclick="showUpgradedLogs(); return false;">' . G::LoadTranslation('ID_UPGRADE_VIEW_LOG') . '</a>', $pmSection);
     } else {
         $properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation('ID_UPGRADE_NEVER_UPGRADE'), $pmSection);
     }
     $properties[] = array(G::LoadTranslation('ID_OPERATING_SYSTEM'), $redhat, $sysSection);
     $properties[] = array(G::LoadTranslation('ID_TIME_ZONE'), defined('TIME_ZONE') ? TIME_ZONE : "Unknown", $sysSection);
     $properties[] = array(G::LoadTranslation('ID_WEB_SERVER'), getenv('SERVER_SOFTWARE'), $sysSection);
     $properties[] = array(G::LoadTranslation('ID_SERVER_NAME'), getenv('SERVER_NAME'), $pmSection);
     $properties[] = array(G::LoadTranslation('ID_SERVER_IP'), $this->lookup($ip), $sysSection);
     $properties[] = array(G::LoadTranslation('ID_PHP_VERSION'), phpversion(), $sysSection);
     if (defined("DB_HOST")) {
         $properties[] = array(G::LoadTranslation('ID_DATABASE'), $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')', $pmSection);
         $properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER'), DB_HOST, $pmSection);
         $properties[] = array(G::LoadTranslation('ID_DATABASE_NAME'), DB_NAME, $pmSection);
         $properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB'), $availdb, $sysSection);
     } else {
         $properties[] = array(G::LoadTranslation('ID_DATABASE'), "Not defined", $pmSection);
         $properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER'), "Not defined", $pmSection);
         $properties[] = array(G::LoadTranslation('ID_DATABASE_NAME'), "Not defined", $pmSection);
         $properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB'), "Not defined", $sysSection);
     }
     $properties[] = array(G::LoadTranslation('ID_WORKSPACE'), defined("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
     $properties[] = array(G::LoadTranslation('ID_SERVER_PROTOCOL'), getenv('SERVER_PROTOCOL'), $sysSection);
     $properties[] = array(G::LoadTranslation('ID_SERVER_PORT'), getenv('SERVER_PORT'), $sysSection);
     //$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
     $properties[] = array(G::LoadTranslation('ID_SERVER_NAME'), getenv('SERVER_ADDR'), $sysSection);
     $properties[] = array(G::LoadTranslation('ID_USER_BROWSER'), getenv('HTTP_USER_AGENT'), $sysSection);
     return $properties;
 }
Exemple #3
0
function get_infoOnPM($workspace)
{
    $infoPM = array();
    $Fields = getSysInfo();
    $Fields['WORKSPACE_NAME'] = $workspace;
    if (defined("DB_HOST")) {
        G::LoadClass('net');
        G::LoadClass('dbConnections');
        $dbNetView = new NET(DB_HOST);
        $dbNetView->loginDbServer(DB_USER, DB_PASS);
        $dbConns = new dbConnections('');
        $availdb = '';
        foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
            if ($availdb != '') {
                $availdb .= ', ';
            }
            $availdb .= $val['name'];
        }
        try {
            $sMySQLVersion = $dbNetView->getDbServerVersion('mysql');
        } catch (Exception $oException) {
            $sMySQLVersion = 'Unknown';
        }
        $Fields['DATABASE'] = $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')';
        $Fields['DATABASE_SERVER'] = DB_HOST;
        $Fields['DATABASE_NAME'] = DB_NAME;
        $Fields['AVAILABLE_DB'] = $availdb;
    } else {
        $Fields['DATABASE'] = "Not defined";
        $Fields['DATABASE_SERVER'] = $info_db['adap'];
        $Fields['DATABASE_NAME'] = "Not defined";
        $Fields['AVAILABLE_DB'] = "Not defined";
    }
    $info_db = get_DirDB($workspace);
    $Fields['MYSQL_DATA_DIR'] = $info_db['datadir'];
    $Fields['PLUGINS_LIST'] = get_plugins();
    $Fields['DB_ADAPTER'] = $info_db['DB_ADAPTER'];
    $Fields['DB_HOST'] = $info_db['DB_HOST'];
    $Fields['DB_NAME'] = $info_db['DB_NAME'];
    $Fields['DB_USER'] = $info_db['DB_USER'];
    $Fields['DB_PASS'] = $info_db['DB_PASS'];
    $Fields['DB_RBAC_HOST'] = $info_db['DB_RBAC_HOST'];
    $Fields['DB_RBAC_NAME'] = $info_db['DB_RBAC_NAME'];
    $Fields['DB_RBAC_USER'] = $info_db['DB_RBAC_USER'];
    $Fields['DB_RBAC_PASS'] = $info_db['DB_RBAC_PASS'];
    $Fields['DB_REPORT_HOST'] = $info_db['DB_REPORT_HOST'];
    $Fields['DB_REPORT_NAME'] = $info_db['DB_REPORT_NAME'];
    $Fields['DB_REPORT_USER'] = $info_db['DB_REPORT_USER'];
    $Fields['DB_REPORT_PASS'] = $info_db['DB_REPORT_PASS'];
    $infoPM = $Fields;
    return $infoPM;
}
Exemple #4
0
 private function _getSystemInfo()
 {
     G::LoadClass("system");
     if (getenv('HTTP_CLIENT_IP')) {
         $ip = getenv('HTTP_CLIENT_IP');
     } else {
         if (getenv('HTTP_X_FORWARDED_FOR')) {
             $ip = getenv('HTTP_X_FORWARDED_FOR');
         } else {
             $ip = getenv('REMOTE_ADDR');
         }
     }
     $redhat = '';
     if (file_exists('/etc/redhat-release')) {
         $fnewsize = filesize('/etc/redhat-release');
         $fp = fopen('/etc/redhat-release', 'r');
         $redhat = trim(fread($fp, $fnewsize));
         fclose($fp);
     }
     $redhat .= " (" . PHP_OS . ")";
     if (defined("DB_HOST")) {
         G::LoadClass('net');
         G::LoadClass('dbConnections');
         $dbNetView = new NET(DB_HOST);
         $dbNetView->loginDbServer(DB_USER, DB_PASS);
         $dbConns = new dbConnections('');
         $availdb = '';
         foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
             if ($availdb != '') {
                 $availdb .= ', ';
             }
             $availdb .= $val['name'];
         }
         try {
             $sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
         } catch (Exception $oException) {
             $sMySQLVersion = '?????';
         }
     }
     $sysSection = G::loadTranslation('ID_SYSTEM_INFO');
     $pmSection = 'ProcessMaker Information';
     $properties = array();
     $ee = class_exists('pmLicenseManager') ? " - Enterprise Edition" : '';
     $properties[] = array('ProcessMaker Ver.', System::getVersion() . $ee, $pmSection);
     $properties[] = array('Operating System', $redhat, $sysSection);
     $properties[] = array('Time Zone', defined('TIME_ZONE') ? TIME_ZONE : "Unknown", $sysSection);
     $properties[] = array('Web Server', getenv('SERVER_SOFTWARE'), $sysSection);
     $properties[] = array('Server Name', getenv('SERVER_NAME'), $pmSection);
     $properties[] = array('Server IP Address', $this->lookup($ip), $sysSection);
     $properties[] = array('PHP Version', phpversion(), $sysSection);
     if (defined("DB_HOST")) {
         $properties[] = array('Data Base', $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')', $pmSection);
         $properties[] = array('Data Base Server', DB_HOST, $pmSection);
         $properties[] = array('Data Base Name', DB_NAME, $pmSection);
         $properties[] = array('Available DB Engines', $availdb, $sysSection);
     } else {
         $properties[] = array('Data Base', "Not defined", $pmSection);
         $properties[] = array('Data Base Server', "Not defined", $pmSection);
         $properties[] = array('Data Base Name', "Not defined", $pmSection);
         $properties[] = array('Available DB Engines', "Not defined", $sysSection);
     }
     $properties[] = array('Workspace', defined("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
     $properties[] = array('Server Protocol', getenv('SERVER_PROTOCOL'), $sysSection);
     $properties[] = array('Server Port', getenv('SERVER_PORT'), $sysSection);
     //$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
     $properties[] = array('Server Addr.', getenv('SERVER_ADDR'), $sysSection);
     $properties[] = array('User\'s Browser', getenv('HTTP_USER_AGENT'), $sysSection);
     return $properties;
 }
Exemple #5
0
    $availdb = '';
    foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
        if ($availdb != '') {
            $availdb .= ', ';
        }
        $availdb .= $val['name'];
    }
    try {
        $sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
    } catch (Exception $oException) {
        $sMySQLVersion = '?????';
    }
}
$Fields['SYSTEM'] = $redhat;
if (defined("DB_HOST")) {
    $Fields['DATABASE'] = $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')';
    $Fields['DATABASE_SERVER'] = DB_HOST;
    $Fields['DATABASE_NAME'] = DB_NAME;
    $Fields['AVAILABLE_DB'] = $availdb;
} else {
    $Fields['DATABASE'] = "Not defined";
    $Fields['DATABASE_SERVER'] = "Not defined";
    $Fields['DATABASE_NAME'] = "Not defined";
    $Fields['AVAILABLE_DB'] = "Not defined";
}
$eeT = "";
if (class_exists('pmLicenseManager')) {
    $eeT = " - Enterprise Edition";
}
$Fields['PHP'] = phpversion();
$Fields['FLUID'] = System::getVersion() . $eeT;