BUG 0000 Support for php 5.2 in Solr implementation
Add support for php 5.2 in Solr implementation: - Exception function has two parameters - use of function call_user_func
This commit is contained in:
@@ -53,7 +53,7 @@ if (! defined ( 'PATH_HOME' )) {
|
|||||||
G::LoadSystem ( 'dvEditor' );
|
G::LoadSystem ( 'dvEditor' );
|
||||||
G::LoadSystem ( 'table' );
|
G::LoadSystem ( 'table' );
|
||||||
G::LoadSystem ( 'pagedTable' );
|
G::LoadSystem ( 'pagedTable' );
|
||||||
G::LoadSystem ( 'system' );
|
G::LoadClass ( 'system' );
|
||||||
require_once ("propel/Propel.php");
|
require_once ("propel/Propel.php");
|
||||||
require_once ("creole/Creole.php");
|
require_once ("creole/Creole.php");
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ if (! defined ( 'SYS_SYS' )) {
|
|||||||
// ****************************************
|
// ****************************************
|
||||||
// read initialize file
|
// read initialize file
|
||||||
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
|
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
|
||||||
$config = System::getSystemConfiguration ( PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'env.ini' );
|
$config = System::getSystemConfiguration ('', '', SYS_SYS);
|
||||||
define ( 'MEMCACHED_ENABLED', $config ['memcached'] );
|
define ( 'MEMCACHED_ENABLED', $config ['memcached'] );
|
||||||
define ( 'MEMCACHED_SERVER', $config ['memcached_server'] );
|
define ( 'MEMCACHED_SERVER', $config ['memcached_server'] );
|
||||||
define ( 'TIME_ZONE', $config ['time_zone'] );
|
define ( 'TIME_ZONE', $config ['time_zone'] );
|
||||||
@@ -208,7 +208,8 @@ function processWorkspace() {
|
|||||||
global $sLastExecution;
|
global $sLastExecution;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($solrConf = System::solrEnv () !== false) {
|
|
||||||
|
if (($solrConf = System::solrEnv (SYS_SYS)) !== false) {
|
||||||
G::LoadClass ( 'AppSolr' );
|
G::LoadClass ( 'AppSolr' );
|
||||||
$oAppSolr = new AppSolr ( $solrConf ['solr_enabled'], $solrConf ['solr_host'], $solrConf ['solr_instance'] );
|
$oAppSolr = new AppSolr ( $solrConf ['solr_enabled'], $solrConf ['solr_host'], $solrConf ['solr_instance'] );
|
||||||
$oAppSolr->reindexAllApplications ();
|
$oAppSolr->reindexAllApplications ();
|
||||||
|
|||||||
@@ -15,10 +15,24 @@ require_once "classes/model/AppSolrQueue.php";
|
|||||||
|
|
||||||
class InvalidIndexSearchTextException extends Exception {
|
class InvalidIndexSearchTextException extends Exception {
|
||||||
// Redefine the exception so message isn't optional
|
// Redefine the exception so message isn't optional
|
||||||
public function __construct($message, $code = 0, Exception $previous = null) {
|
public function __construct($message, $code = 0) {
|
||||||
// some code
|
// some code
|
||||||
// make sure everything is assigned properly
|
// make sure everything is assigned properly
|
||||||
parent::__construct ( $message, $code, $previous );
|
parent::__construct ( $message, $code);
|
||||||
|
}
|
||||||
|
|
||||||
|
// custom string representation of object
|
||||||
|
public function __toString() {
|
||||||
|
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ApplicationWithoutDelegationRecordsException extends Exception {
|
||||||
|
// Redefine the exception so message isn't optional
|
||||||
|
public function __construct($message, $code = 0) {
|
||||||
|
// some code
|
||||||
|
// make sure everything is assigned properly
|
||||||
|
parent::__construct ( $message, $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
// custom string representation of object
|
// custom string representation of object
|
||||||
@@ -720,6 +734,7 @@ class AppSolr {
|
|||||||
'workspace' => $this->solrInstance,
|
'workspace' => $this->solrInstance,
|
||||||
'document' => $xmlDoc
|
'document' => $xmlDoc
|
||||||
);
|
);
|
||||||
|
|
||||||
$oSolrUpdateDocument = Entity_SolrUpdateDocument::CreateForRequest ( $data );
|
$oSolrUpdateDocument = Entity_SolrUpdateDocument::CreateForRequest ( $data );
|
||||||
|
|
||||||
G::LoadClass ( 'searchIndex' );
|
G::LoadClass ( 'searchIndex' );
|
||||||
@@ -760,11 +775,14 @@ class AppSolr {
|
|||||||
$xmlDoc .= "<add>\n";
|
$xmlDoc .= "<add>\n";
|
||||||
// echo "APP Uids to index \n";
|
// echo "APP Uids to index \n";
|
||||||
foreach ( $aaAPPUIDs as $aAPPUID ) {
|
foreach ( $aaAPPUIDs as $aAPPUID ) {
|
||||||
$result = $this->getApplicationIndexData ( $aAPPUID ['APP_UID'] );
|
try {
|
||||||
|
$result = $this->getApplicationIndexData ( $aAPPUID ['APP_UID'] );
|
||||||
if ($result == null)
|
}
|
||||||
|
catch(ApplicationWithoutDelegationRecordsException $e){
|
||||||
|
//exception trying to get application information
|
||||||
|
//skip and continue with the next application
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
$documentInformation = $result [0];
|
$documentInformation = $result [0];
|
||||||
$dynaformFieldTypes = $result [1];
|
$dynaformFieldTypes = $result [1];
|
||||||
$lastUpdateDate = $result [2];
|
$lastUpdateDate = $result [2];
|
||||||
@@ -1049,7 +1067,7 @@ class AppSolr {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach ( $UnSerializedCaseData as $k => $value ) {
|
foreach ( $UnSerializedCaseData as $k => $value ) {
|
||||||
if (! is_array ( $value ) && $value != '' && $k != 'SYS_LANG' && $k != 'SYS_SKIN' && $k != 'SYS_SYS') {
|
if (!is_array ( $value ) && !is_object($value) && $value != '' && $k != 'SYS_LANG' && $k != 'SYS_SKIN' && $k != 'SYS_SYS') {
|
||||||
// search the field type in array of dynaform fields
|
// search the field type in array of dynaform fields
|
||||||
if (! empty ( $dynaformFieldTypes ) && array_key_exists ( trim ( $k ), $dynaformFieldTypes )) {
|
if (! empty ( $dynaformFieldTypes ) && array_key_exists ( trim ( $k ), $dynaformFieldTypes )) {
|
||||||
$type = $dynaformFieldTypes [trim ( $k )];
|
$type = $dynaformFieldTypes [trim ( $k )];
|
||||||
@@ -1157,7 +1175,6 @@ class AppSolr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getApplicationIndexData($AppUID) {
|
function getApplicationIndexData($AppUID) {
|
||||||
|
|
||||||
G::LoadClass ( 'memcached' );
|
G::LoadClass ( 'memcached' );
|
||||||
|
|
||||||
// get all the application data
|
// get all the application data
|
||||||
@@ -1166,7 +1183,7 @@ class AppSolr {
|
|||||||
// this case occurs when the application doesn't have related delegation
|
// this case occurs when the application doesn't have related delegation
|
||||||
// records.
|
// records.
|
||||||
if (empty ( $allAppDbData ) || ! isset ( $allAppDbData [0] )) {
|
if (empty ( $allAppDbData ) || ! isset ( $allAppDbData [0] )) {
|
||||||
throw new Exception ( "Application without delegation records. APP_UID: " . $AppUID );
|
throw new ApplicationWithoutDelegationRecordsException ( "Application without delegation records. APP_UID: " . $AppUID );
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the application information
|
// copy the application information
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
|
|
||||||
// get total number of documents in registry
|
// get total number of documents in registry
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/select/?q=*:*";
|
$solrIntruct .= "/select/?q=*:*";
|
||||||
$solrIntruct .= self::SOLR_VERSION;
|
$solrIntruct .= self::SOLR_VERSION;
|
||||||
@@ -54,7 +54,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
// verify the result of solr
|
// verify the result of solr
|
||||||
$responseSolrTotal = json_decode ( $responseTotal, true );
|
$responseSolrTotal = json_decode ( $responseTotal, true );
|
||||||
if ($responseSolrTotal['responseHeader']['status'] != 0) {
|
if ($responseSolrTotal['responseHeader']['status'] != 0) {
|
||||||
throw new Exception ( "Error returning the total number of documents in Solr." );
|
throw new Exception ( "Error returning the total number of documents in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
$numTotalDocs = $responseSolrTotal ['response'] ['numFound'];
|
$numTotalDocs = $responseSolrTotal ['response'] ['numFound'];
|
||||||
return $numTotalDocs;
|
return $numTotalDocs;
|
||||||
@@ -101,7 +101,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
$filters .= '&fq=' . urlencode ( $value );
|
$filters .= '&fq=' . urlencode ( $value );
|
||||||
}
|
}
|
||||||
|
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/select/?q=$query";
|
$solrIntruct .= "/select/?q=$query";
|
||||||
$solrIntruct .= "&echoParams=none";
|
$solrIntruct .= "&echoParams=none";
|
||||||
@@ -123,7 +123,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
// decode
|
// decode
|
||||||
$responseSolr = json_decode ( $response, true );
|
$responseSolr = json_decode ( $response, true );
|
||||||
if ($responseSolr['responseHeader']['status'] != 0) {
|
if ($responseSolr['responseHeader']['status'] != 0) {
|
||||||
throw new Exception ( "Error executing query to Solr." );
|
throw new Exception ( "Error executing query to Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $responseSolr;
|
return $responseSolr;
|
||||||
@@ -142,7 +142,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
return;
|
return;
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $solrUpdateDocument->workspace;
|
$solrIntruct .= $solrUpdateDocument->workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -154,12 +154,11 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
curl_setopt ( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
|
curl_setopt ( $handler, CURLOPT_BINARYTRANSFER, TRUE ); // --data-binary
|
||||||
curl_setopt ( $handler, CURLOPT_POSTFIELDS, $solrUpdateDocument->document ); // data
|
curl_setopt ( $handler, CURLOPT_POSTFIELDS, $solrUpdateDocument->document ); // data
|
||||||
$response = curl_exec ( $handler );
|
$response = curl_exec ( $handler );
|
||||||
|
|
||||||
curl_close ( $handler );
|
curl_close ( $handler );
|
||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error updating document in Solr." );
|
throw new Exception ( "Error updating document in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +175,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
return;
|
return;
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -192,7 +191,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error commiting changes in Solr." );
|
throw new Exception ( "Error commiting changes in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +209,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -226,7 +225,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error rolling back changes in Solr." );
|
throw new Exception ( "Error rolling back changes in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +243,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -260,7 +259,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error optimizing changes in Solr." );
|
throw new Exception ( "Error optimizing changes in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +269,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/admin/luke?numTerms=0&wt=json";
|
$solrIntruct .= "/admin/luke?numTerms=0&wt=json";
|
||||||
|
|
||||||
@@ -281,7 +280,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
// decode
|
// decode
|
||||||
$responseSolr = json_decode ( $response, true );
|
$responseSolr = json_decode ( $response, true );
|
||||||
if ($responseSolr['responseHeader']['status'] != 0) {
|
if ($responseSolr['responseHeader']['status'] != 0) {
|
||||||
throw new Exception ( "Error getting index fields in Solr." );
|
throw new Exception ( "Error getting index fields in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
return $responseSolr;
|
return $responseSolr;
|
||||||
}
|
}
|
||||||
@@ -301,7 +300,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -318,7 +317,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error deleting all documents in Solr." );
|
throw new Exception ( "Error deleting all documents in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +336,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$solrIntruct = '';
|
$solrIntruct = '';
|
||||||
// get configuration information in base to workspace parameter
|
// get configuration information in base to workspace parameter
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/update";
|
$solrIntruct .= "/update";
|
||||||
|
|
||||||
@@ -354,7 +353,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
$swOk = strpos ( $response, '<int name="status">0</int>' );
|
||||||
if (! $swOk) {
|
if (! $swOk) {
|
||||||
throw new Exception ( "Error deleting document in Solr." );
|
throw new Exception ( "Error deleting document in Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,7 +402,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
|
|
||||||
$resultFormat = '&wt=json';
|
$resultFormat = '&wt=json';
|
||||||
|
|
||||||
$solrIntruct = $this->solrHost;
|
$solrIntruct = (substr($this->solrHost, -1) == "/")?$this->solrHost:$this->solrHost . "/";
|
||||||
$solrIntruct .= $workspace;
|
$solrIntruct .= $workspace;
|
||||||
$solrIntruct .= "/select/?q=$query";
|
$solrIntruct .= "/select/?q=$query";
|
||||||
$solrIntruct .= "&echoParams=none";
|
$solrIntruct .= "&echoParams=none";
|
||||||
@@ -424,7 +423,7 @@ class BpmnEngine_SearchIndexAccess_Solr {
|
|||||||
// decode
|
// decode
|
||||||
$responseSolr = json_decode ( $response, true );
|
$responseSolr = json_decode ( $response, true );
|
||||||
if ($responseSolr['responseHeader']['status'] != 0) {
|
if ($responseSolr['responseHeader']['status'] != 0) {
|
||||||
throw new Exception ( "Error getting faceted list from Solr." );
|
throw new Exception ( "Error getting faceted list from Solr." . $solrIntruct);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $responseSolr;
|
return $responseSolr;
|
||||||
|
|||||||
@@ -1008,7 +1008,7 @@ class System {
|
|||||||
return $cities;
|
return $cities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSystemConfiguration($globalIniFile = '', $wsIniFile = '')
|
public static function getSystemConfiguration($globalIniFile = '', $wsIniFile = '', $wsName = '')
|
||||||
{
|
{
|
||||||
$readGlobalIniFile = false;
|
$readGlobalIniFile = false;
|
||||||
$readWsIniFile = false;
|
$readWsIniFile = false;
|
||||||
@@ -1019,12 +1019,15 @@ class System {
|
|||||||
|
|
||||||
if (empty($wsIniFile)) {
|
if (empty($wsIniFile)) {
|
||||||
if (defined('PATH_DB')) { // if we're on a valid workspace env.
|
if (defined('PATH_DB')) { // if we're on a valid workspace env.
|
||||||
$uriParts = explode('/', getenv("REQUEST_URI"));
|
if (empty($wsName)) {
|
||||||
|
$uriParts = explode('/', getenv("REQUEST_URI"));
|
||||||
|
|
||||||
if (substr($uriParts[1], 0, 3 ) == 'sys') {
|
if (substr($uriParts[1], 0, 3 ) == 'sys') {
|
||||||
$wsName = substr($uriParts[1], 3);
|
$wsName = substr($uriParts[1], 3);
|
||||||
$wsIniFile = PATH_DB . $wsName . PATH_SEP . 'env.ini';
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$wsIniFile = PATH_DB . $wsName . PATH_SEP . 'env.ini';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1121,9 +1124,14 @@ class System {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function solrEnv()
|
function solrEnv($sysName = '')
|
||||||
{
|
{
|
||||||
$conf = System::getSystemConfiguration();
|
if (empty($sysName)) {
|
||||||
|
$conf = System::getSystemConfiguration();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$conf = System::getSystemConfiguration('', '', $sysName);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($conf['solr_enabled']) || !isset($conf['solr_host']) || !isset($conf['solr_instance'])) {
|
if (!isset($conf['solr_enabled']) || !isset($conf['solr_host']) || !isset($conf['solr_instance'])) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ class Entity_Base {
|
|||||||
// get aliases from class
|
// get aliases from class
|
||||||
$className = get_class ( $this );
|
$className = get_class ( $this );
|
||||||
if (method_exists ( $className, 'GetAliases' )) {
|
if (method_exists ( $className, 'GetAliases' )) {
|
||||||
$aliases = $className::GetAliases ();
|
$aliases = call_user_func(array($className, 'GetAliases'));
|
||||||
|
//$aliases = $className::GetAliases ();
|
||||||
foreach ( $this as $field => $value )
|
foreach ( $this as $field => $value )
|
||||||
if (isset ( $aliases [$field] )) {
|
if (isset ( $aliases [$field] )) {
|
||||||
// echo "Field exists in Aliases: " . $field . "\n";
|
// echo "Field exists in Aliases: " . $field . "\n";
|
||||||
@@ -84,8 +85,8 @@ class Entity_Base {
|
|||||||
// get aliases from class
|
// get aliases from class
|
||||||
$className = get_class ( $this );
|
$className = get_class ( $this );
|
||||||
if (method_exists ( $className, 'GetAliases' )) {
|
if (method_exists ( $className, 'GetAliases' )) {
|
||||||
$aliases = $className::GetAliases ();
|
$aliases = call_user_func(array($className, 'GetAliases'));
|
||||||
|
//$aliases = $className::GetAliases ();
|
||||||
foreach ( $this as $field => $value )
|
foreach ( $this as $field => $value )
|
||||||
if (isset ( $aliases [$field] ))
|
if (isset ( $aliases [$field] ))
|
||||||
$this->{$field} = $aAliasData [$aliases [$field]];
|
$this->{$field} = $aAliasData [$aliases [$field]];
|
||||||
@@ -107,7 +108,8 @@ class Entity_Base {
|
|||||||
$aliases = array ();
|
$aliases = array ();
|
||||||
$swAliases = false;
|
$swAliases = false;
|
||||||
if (method_exists ( $className, 'GetAliases' )) {
|
if (method_exists ( $className, 'GetAliases' )) {
|
||||||
$aliases = $className::GetAliases ();
|
$aliases = call_user_func(array($className, 'GetAliases'));
|
||||||
|
//$aliases = $className::GetAliases ();
|
||||||
$swAliases = true;
|
$swAliases = true;
|
||||||
}
|
}
|
||||||
// use object properties or aliases to initialize
|
// use object properties or aliases to initialize
|
||||||
|
|||||||
Reference in New Issue
Block a user