BUG - Notices found in the heartbeat call
- The attribute "workspaces" not defined in the class "serverConfiguration" - Define the missing attribute in the class
This commit is contained in:
@@ -53,6 +53,7 @@ class serverConf {
|
|||||||
var $logins;
|
var $logins;
|
||||||
private $lanDirection;
|
private $lanDirection;
|
||||||
private $lanLanguage;
|
private $lanLanguage;
|
||||||
|
public $workspaces = array();
|
||||||
|
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ switch ($request) {
|
|||||||
}
|
}
|
||||||
//Build Data to be sent
|
//Build Data to be sent
|
||||||
$params=buildData();
|
$params=buildData();
|
||||||
|
|
||||||
//Send the information
|
//Send the information
|
||||||
postHeartBeat($params);
|
postHeartBeat($params);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -29,14 +29,14 @@ function validateConnectivity($url){
|
|||||||
$sContent = file_get_conditional_contents($url);
|
$sContent = file_get_conditional_contents($url);
|
||||||
$sw_connect=true;
|
$sw_connect=true;
|
||||||
//if ($sContent == '' || $sContent === false || strpos ( $sContent, 'address location' ) === false ) { 4
|
//if ($sContent == '' || $sContent === false || strpos ( $sContent, 'address location' ) === false ) { 4
|
||||||
if ($sContent == '' || $sContent === false ) {
|
if ($sContent == '' || $sContent === false ) {
|
||||||
$sw_connect=false;
|
$sw_connect=false;
|
||||||
}
|
}
|
||||||
return $sw_connect;
|
return $sw_connect;
|
||||||
}
|
}
|
||||||
function file_get_conditional_contents($szURL){
|
function file_get_conditional_contents($szURL){
|
||||||
|
|
||||||
|
|
||||||
$pCurl = curl_init ();
|
$pCurl = curl_init ();
|
||||||
curl_setopt ( $pCurl, CURLOPT_URL, $szURL );
|
curl_setopt ( $pCurl, CURLOPT_URL, $szURL );
|
||||||
curl_setopt ( $pCurl, CURLOPT_RETURNTRANSFER, true );
|
curl_setopt ( $pCurl, CURLOPT_RETURNTRANSFER, true );
|
||||||
@@ -46,24 +46,24 @@ function file_get_conditional_contents($szURL){
|
|||||||
//To avoid SSL error
|
//To avoid SSL error
|
||||||
curl_setopt ( $pCurl, CURLOPT_SSL_VERIFYHOST, 0 );
|
curl_setopt ( $pCurl, CURLOPT_SSL_VERIFYHOST, 0 );
|
||||||
curl_setopt ( $pCurl, CURLOPT_SSL_VERIFYPEER, 0);
|
curl_setopt ( $pCurl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
|
||||||
//To avoid timeouts
|
//To avoid timeouts
|
||||||
curl_setopt ( $pCurl, CURLOPT_CONNECTTIMEOUT, 10 );
|
curl_setopt ( $pCurl, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||||
curl_setopt ( $pCurl, CURLOPT_TIMEOUT, 20 );
|
curl_setopt ( $pCurl, CURLOPT_TIMEOUT, 20 );
|
||||||
|
|
||||||
curl_setopt ( $pCurl, CURLOPT_NOPROGRESS, FALSE);
|
curl_setopt ( $pCurl, CURLOPT_NOPROGRESS, FALSE);
|
||||||
curl_setopt ( $pCurl, CURLOPT_VERBOSE, TRUE);
|
curl_setopt ( $pCurl, CURLOPT_VERBOSE, TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$szContents = curl_exec($pCurl);
|
$szContents = curl_exec($pCurl);
|
||||||
$aInfo = curl_getinfo($pCurl);
|
$aInfo = curl_getinfo($pCurl);
|
||||||
|
|
||||||
$curl_session = curl_getinfo($pCurl, CURLINFO_HTTP_CODE);
|
$curl_session = curl_getinfo($pCurl, CURLINFO_HTTP_CODE);
|
||||||
$headers = curl_getinfo ( $pCurl );
|
$headers = curl_getinfo ( $pCurl );
|
||||||
$header = substr ( $szContents, 0, $headers ['header_size'] );
|
$header = substr ( $szContents, 0, $headers ['header_size'] );
|
||||||
$content = substr ( $szContents, $headers ['header_size'] );
|
$content = substr ( $szContents, $headers ['header_size'] );
|
||||||
|
|
||||||
|
|
||||||
if($aInfo['http_code'] === 200)
|
if($aInfo['http_code'] === 200)
|
||||||
{
|
{
|
||||||
@@ -74,10 +74,10 @@ function file_get_conditional_contents($szURL){
|
|||||||
}
|
}
|
||||||
function buildData(){
|
function buildData(){
|
||||||
require_once ("classes/model/Users.php");
|
require_once ("classes/model/Users.php");
|
||||||
|
|
||||||
G::LoadClass("serverConfiguration");
|
G::LoadClass("serverConfiguration");
|
||||||
G::LoadClass("system");
|
G::LoadClass("system");
|
||||||
|
|
||||||
$oServerConf = &serverConf::getSingleton();
|
$oServerConf = &serverConf::getSingleton();
|
||||||
|
|
||||||
$os = '';
|
$os = '';
|
||||||
@@ -88,11 +88,11 @@ function buildData(){
|
|||||||
fclose ( $fp );
|
fclose ( $fp );
|
||||||
}
|
}
|
||||||
$os .= " (" . PHP_OS . ")";
|
$os .= " (" . PHP_OS . ")";
|
||||||
|
|
||||||
$params = array ();
|
$params = array ();
|
||||||
$params ['ip'] = getenv ( 'SERVER_ADDR' );
|
$params ['ip'] = getenv ( 'SERVER_ADDR' );
|
||||||
$oServerConf->setHeartbeatProperty('HB_BEAT_INDEX',intval($oServerConf->getHeartbeatProperty('HB_BEAT_INDEX','HEART_BEAT_CONF'))+1,'HEART_BEAT_CONF');
|
$oServerConf->setHeartbeatProperty('HB_BEAT_INDEX',intval($oServerConf->getHeartbeatProperty('HB_BEAT_INDEX','HEART_BEAT_CONF'))+1,'HEART_BEAT_CONF');
|
||||||
|
|
||||||
$params ['index'] = $oServerConf->getHeartbeatProperty('HB_BEAT_INDEX','HEART_BEAT_CONF');//$this->index;
|
$params ['index'] = $oServerConf->getHeartbeatProperty('HB_BEAT_INDEX','HEART_BEAT_CONF');//$this->index;
|
||||||
$params ['beatType'] = is_null($oServerConf->getHeartbeatProperty('HB_BEAT_TYPE','HEART_BEAT_CONF'))?"starting":$oServerConf->getHeartbeatProperty('HB_BEAT_TYPE','HEART_BEAT_CONF');//1;//$this->beatType;
|
$params ['beatType'] = is_null($oServerConf->getHeartbeatProperty('HB_BEAT_TYPE','HEART_BEAT_CONF'))?"starting":$oServerConf->getHeartbeatProperty('HB_BEAT_TYPE','HEART_BEAT_CONF');//1;//$this->beatType;
|
||||||
$params ['date'] = date ( 'Y-m-d H:i:s' );
|
$params ['date'] = date ( 'Y-m-d H:i:s' );
|
||||||
@@ -106,7 +106,7 @@ function buildData(){
|
|||||||
}else{
|
}else{
|
||||||
$params ['pmProduct'] = 'PMCE';
|
$params ['pmProduct'] = 'PMCE';
|
||||||
}
|
}
|
||||||
|
|
||||||
$params ['logins'] = $oServerConf->logins;
|
$params ['logins'] = $oServerConf->logins;
|
||||||
$params ['workspaces'] = serialize ( $oServerConf->getWSList () );
|
$params ['workspaces'] = serialize ( $oServerConf->getWSList () );
|
||||||
$params ['plugins'] = serialize ( $oServerConf->getPluginsList () );
|
$params ['plugins'] = serialize ( $oServerConf->getPluginsList () );
|
||||||
@@ -115,23 +115,23 @@ function buildData(){
|
|||||||
if($licInfo=$oServerConf->getProperty('LICENSE_INFO')){
|
if($licInfo=$oServerConf->getProperty('LICENSE_INFO')){
|
||||||
$params ['license'] = serialize ( $licInfo );
|
$params ['license'] = serialize ( $licInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
$criteria->addSelectColumn("COUNT(USERS.USR_UID) AS USERS_NUMBER");
|
$criteria->addSelectColumn("COUNT(USERS.USR_UID) AS USERS_NUMBER");
|
||||||
$criteria->add(UsersPeer::USR_UID, null, Criteria::ISNOTNULL);
|
$criteria->add(UsersPeer::USR_UID, null, Criteria::ISNOTNULL);
|
||||||
|
|
||||||
$rs = UsersPeer::doSelectRS($criteria);
|
$rs = UsersPeer::doSelectRS($criteria);
|
||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
|
|
||||||
$params["users"] = $row["USERS_NUMBER"];
|
$params["users"] = $row["USERS_NUMBER"];
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$ee = null;
|
$ee = null;
|
||||||
|
|
||||||
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION")) {
|
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION")) {
|
||||||
$ee = trim(file_get_contents(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION"));
|
$ee = trim(file_get_contents(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION"));
|
||||||
}
|
}
|
||||||
@@ -141,80 +141,80 @@ function buildData(){
|
|||||||
|
|
||||||
$ee = (!($details == null))? $details->iVersion : null;
|
$ee = (!($details == null))? $details->iVersion : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$params["ee"] = $ee;
|
$params["ee"] = $ee;
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$addonNumber = 0;
|
$addonNumber = 0;
|
||||||
$addonEnabledNumber = 0;
|
$addonEnabledNumber = 0;
|
||||||
|
|
||||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
|
|
||||||
$arrayAddon = array();
|
$arrayAddon = array();
|
||||||
|
|
||||||
if (file_exists(PATH_DATA_SITE . "ee")) {
|
if (file_exists(PATH_DATA_SITE . "ee")) {
|
||||||
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
|
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
|
||||||
|
|
||||||
$arrayAddon["enterprise"] = array("sFilename" => "enterprise-1.tar");
|
$arrayAddon["enterprise"] = array("sFilename" => "enterprise-1.tar");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($arrayAddon as $addon) {
|
foreach ($arrayAddon as $addon) {
|
||||||
$sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-"));
|
$sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-"));
|
||||||
|
|
||||||
if (file_exists(PATH_PLUGINS . $sFileName . ".php")) {
|
if (file_exists(PATH_PLUGINS . $sFileName . ".php")) {
|
||||||
$addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php");
|
$addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php");
|
||||||
$enabled = 0;
|
$enabled = 0;
|
||||||
|
|
||||||
if ($addonDetails) {
|
if ($addonDetails) {
|
||||||
$enabled = ($addonDetails->enabled)? 1 : 0;
|
$enabled = ($addonDetails->enabled)? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($enabled == 1) {
|
if ($enabled == 1) {
|
||||||
$addonEnabledNumber = $addonEnabledNumber + 1;
|
$addonEnabledNumber = $addonEnabledNumber + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$addonNumber = $addonNumber + 1;
|
$addonNumber = $addonNumber + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$params["addonNumber"] = $addonNumber;
|
$params["addonNumber"] = $addonNumber;
|
||||||
$params["addonEnabledNumber"] = $addonEnabledNumber;
|
$params["addonEnabledNumber"] = $addonEnabledNumber;
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$licenseID = null;
|
$licenseID = null;
|
||||||
$licenseType = null;
|
$licenseType = null;
|
||||||
$licenseDomainWorkspace = null;
|
$licenseDomainWorkspace = null;
|
||||||
$licenseNumber = 0;
|
$licenseNumber = 0;
|
||||||
|
|
||||||
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "class.pmLicenseManager.php")) {
|
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "class.pmLicenseManager.php") && class_exists('enterprisePlugin')) {
|
||||||
$licenseManager = &pmLicenseManager::getSingleton();
|
$licenseManager = &pmLicenseManager::getSingleton();
|
||||||
|
|
||||||
preg_match("/^license_(.*).dat$/", $licenseManager->file, $matches);
|
preg_match("/^license_(.*).dat$/", $licenseManager->file, $matches);
|
||||||
|
|
||||||
$licenseID = $matches[1];
|
$licenseID = $matches[1];
|
||||||
$licenseType = $licenseManager->type;
|
$licenseType = $licenseManager->type;
|
||||||
$licenseDomainWorkspace = $licenseManager->info["DOMAIN_WORKSPACE"];
|
$licenseDomainWorkspace = $licenseManager->info["DOMAIN_WORKSPACE"];
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
$criteria->addSelectColumn("COUNT(LICENSE_MANAGER.LICENSE_UID) AS LICENSE_NUMBER");
|
$criteria->addSelectColumn("COUNT(LICENSE_MANAGER.LICENSE_UID) AS LICENSE_NUMBER");
|
||||||
$criteria->add(LicenseManagerPeer::LICENSE_UID, null, Criteria::ISNOTNULL);
|
$criteria->add(LicenseManagerPeer::LICENSE_UID, null, Criteria::ISNOTNULL);
|
||||||
|
|
||||||
$rs = LicenseManagerPeer::doSelectRS($criteria);
|
$rs = LicenseManagerPeer::doSelectRS($criteria);
|
||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$licenseNumber = ($row["LICENSE_NUMBER"] > 0)? $row["LICENSE_NUMBER"] : count(glob(PATH_DATA_SITE . "licenses" . PATH_SEP . "*.dat"));
|
$licenseNumber = ($row["LICENSE_NUMBER"] > 0)? $row["LICENSE_NUMBER"] : count(glob(PATH_DATA_SITE . "licenses" . PATH_SEP . "*.dat"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$params["licenseID"] = $licenseID;
|
$params["licenseID"] = $licenseID;
|
||||||
$params["licenseType"] = $licenseType;
|
$params["licenseType"] = $licenseType;
|
||||||
$params["licenseDomainWorkspace"] = $licenseDomainWorkspace;
|
$params["licenseDomainWorkspace"] = $licenseDomainWorkspace;
|
||||||
$params["licenseNumber"] = $licenseNumber;
|
$params["licenseNumber"] = $licenseNumber;
|
||||||
|
|
||||||
///////
|
///////
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
@@ -225,9 +225,9 @@ function buildData(){
|
|||||||
$oServerConf = & serverConf::getSingleton ();
|
$oServerConf = & serverConf::getSingleton ();
|
||||||
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+2 hour" ),'HEART_BEAT_CONF');
|
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+2 hour" ),'HEART_BEAT_CONF');
|
||||||
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF');
|
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF');
|
||||||
|
|
||||||
$heartBeatUrl = $oServerConf->getHeartbeatProperty('HB_BEAT_URL','HEART_BEAT_CONF');
|
$heartBeatUrl = $oServerConf->getHeartbeatProperty('HB_BEAT_URL','HEART_BEAT_CONF');
|
||||||
|
|
||||||
$ch = curl_init ();
|
$ch = curl_init ();
|
||||||
curl_setopt ( $ch, CURLOPT_URL, $heartBeatUrl );
|
curl_setopt ( $ch, CURLOPT_URL, $heartBeatUrl );
|
||||||
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
|
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||||
@@ -239,12 +239,12 @@ function buildData(){
|
|||||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
|
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
|
||||||
|
|
||||||
curl_setopt ( $ch, CURLOPT_POST, 1 );
|
curl_setopt ( $ch, CURLOPT_POST, 1 );
|
||||||
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $params );
|
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $params );
|
||||||
|
|
||||||
//To avoid timeouts
|
//To avoid timeouts
|
||||||
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||||
curl_setopt ( $ch, CURLOPT_TIMEOUT, 20 );
|
curl_setopt ( $ch, CURLOPT_TIMEOUT, 20 );
|
||||||
|
|
||||||
$response = curl_exec ( $ch );
|
$response = curl_exec ( $ch );
|
||||||
$curl_session = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$curl_session = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
$headers = curl_getinfo ( $ch );
|
$headers = curl_getinfo ( $ch );
|
||||||
@@ -257,16 +257,16 @@ function buildData(){
|
|||||||
$oServerConf->resetLogins ();
|
$oServerConf->resetLogins ();
|
||||||
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+7 day" ),'HEART_BEAT_CONF');
|
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+7 day" ),'HEART_BEAT_CONF');
|
||||||
//Reset Errors
|
//Reset Errors
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Catch the error
|
//Catch the error
|
||||||
|
|
||||||
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+1 day" ),'HEART_BEAT_CONF');
|
$oServerConf->setHeartbeatProperty('HB_NEXT_BEAT_DATE',strtotime ( "+1 day" ),'HEART_BEAT_CONF');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
||||||
$ch = curl_init ();
|
$ch = curl_init ();
|
||||||
curl_setopt ( $ch, CURLOPT_URL, $heartBeatUrl );
|
curl_setopt ( $ch, CURLOPT_URL, $heartBeatUrl );
|
||||||
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
|
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||||
@@ -278,7 +278,7 @@ function buildData(){
|
|||||||
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
|
curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
|
||||||
|
|
||||||
curl_setopt ( $ch, CURLOPT_POST, 1 );
|
curl_setopt ( $ch, CURLOPT_POST, 1 );
|
||||||
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $params );
|
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $params );
|
||||||
|
|
||||||
//To avoid timeouts
|
//To avoid timeouts
|
||||||
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||||
|
|||||||
Reference in New Issue
Block a user