trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);
if (TYPO3_DLOG) {
return NULL;
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
}
if (empty($encrypted) || empty($hash)) {
return NULL;
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid parameters given for decryption', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
return;
}
@ -253,7 +263,13 @@ class tx_dlf_helper {
if ($hashed !== $hash) {
return NULL;
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid hash "'.$hash.'" given for decryption', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
}
@ -276,9 +292,13 @@ class tx_dlf_helper {
// Check for PHP extension "mcrypt".
if (!extension_loaded('mcrypt')) {
trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);
if (TYPO3_DLOG) {
return NULL;
t3lib_div::devLog('[tx_dlf_helper->encrypt('.$string.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
trigger_error('No "index_name" with UID '.$uid.' found for PID '.$pid.' in TABLE '.$table, E_USER_WARNING);
if (TYPO3_DLOG) {
return '';
t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] No "index_name" with UID "'.$uid.'" and PID "'.$pid.'" found in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
trigger_error('Language code "'.$code.'" not found', E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Language code "'.$code.'" not found in ISO-639 table', $this->extKey, SYSLOG_SEVERITY_NOTICE);
}
return $code;
@ -466,7 +520,7 @@ class tx_dlf_helper {
*/
public static function getURN($base, $id) {
$concordance = array(
$concordance = array(
'0' => 1,
'1' => 2,
'2' => 3,
@ -511,7 +565,11 @@ class tx_dlf_helper {
if (preg_match('/[^a-z0-9:-]/', $urn)) {
trigger_error('Invalid chars in URN', E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->getURN('.$base.', '.$id.')] Invalid chars in given parameters', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return '';
@ -559,23 +617,31 @@ class tx_dlf_helper {
*
* @access public
*
* @param string $key: Session key for retrieval
* @param string $key: Session data key for retrieval
*
* @return mixed Session value for given key or NULL on failure
t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Invalid key "'.$key.'" for session data retrieval', $this->extKey, SYSLOG_SEVERITY_WARNING);
public static function translate($index_name, $table, $pid) {
// Save parameters for logging purposes.
$_index_name = $index_name;
$_pid = $pid;
// Load labels into static variable for future use.
static $labels = array ();
// Sanitize input.
$pid = max(intval($pid), 0);
if (!$pid) {
trigger_error('No PID given for translations', E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] Invalid PID "'.$pid.'" for translation', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return $index_name;
@ -841,13 +858,21 @@ class tx_dlf_helper {
} else {
trigger_error('There are no entries with PID '.$pid.' in table '.$table.' or you are not allowed to access them', E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translation with PID "'.$pid.'" available in table "'.$table.'" or translation not accessible', $this->extKey, SYSLOG_SEVERITY_NOTICE);
}
}
} else {
trigger_error('The table '.$table.' is not allowed for translation', E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translations available for table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
trigger_error('Could not load multi-volume work with UID '.$doc->parentid, E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentid.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.stored AS stored,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.autocomplete AS autocomplete,tx_dlf_metadata.boost AS boost',
@ -92,11 +92,18 @@ class tx_dlf_list implements t3lib_Singleton {
*/
public function remove($position) {
// Save parameter for logging purposes.
$_position = $position;
$position = intval($position);
if ($position <0||$position>= $this->count) {
trigger_error('No valid list position for removal', E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
@ -122,12 +129,21 @@ class tx_dlf_list implements t3lib_Singleton {
*/
public function move($position, $steps) {
// Save parameters for logging purposes.
$_position = $position;
$_steps = $steps;
$position = intval($position);
// Check if list position is valid.
if ($position <0||$position>= $this->count) {
trigger_error('Invalid list position '.$position, E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
@ -138,7 +154,11 @@ class tx_dlf_list implements t3lib_Singleton {
// Check if moving given amount of steps is possible.
if (($position + $steps) <0||($position+$steps)>= $this->count) {
trigger_error('Element at position '.$position.' can not be moved '.$steps.' steps', E_USER_WARNING);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
@ -273,6 +293,14 @@ class tx_dlf_list implements t3lib_Singleton {
$this->elements = $newOrder;
} else {
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_list->sort('.$by.', ['.($asc ? 'TRUE' : 'FALSE').'])] Sorted list elements do not match unsorted elements', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
}
}
@ -400,17 +428,21 @@ class tx_dlf_list implements t3lib_Singleton {
*/
public function __get($var) {
$_method = '_get'.ucfirst($var);
$method = '_get'.ucfirst($var);
if (!property_exists($this, $var) || !method_exists($this, $method)) {
if (!property_exists($this, $var) || !method_exists($this, $_method)) {
if (TYPO3_DLOG) {
trigger_error('There is no get function for property '.$var, E_USER_ERROR);
t3lib_div::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
} else {
return $this->$_method();
return $this->$method();
}
@ -428,15 +460,19 @@ class tx_dlf_list implements t3lib_Singleton {
*/
public function __set($var, $value) {
$_method = '_set'.ucfirst($var);
$method = '_set'.ucfirst($var);
if (!property_exists($this, $var) || !method_exists($this, $method)) {
if (!property_exists($this, $var) || !method_exists($this, $_method)) {
if (TYPO3_DLOG) {
trigger_error('There is no set function for property '.$var, E_USER_ERROR);
t3lib_div::devLog('[tx_dlf_list->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) {
@ -193,13 +197,21 @@ abstract class tx_dlf_plugin extends tslib_pibase {
} else {
trigger_error('Failed to load document with record ID '.$this->piVars['recordId'], E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
}
} else {
trigger_error('No UID or PID given for document', E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Invalid UID "'.$this->piVars['id'].'" or PID "'.$this->conf['pages'].'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
}
@ -304,7 +316,7 @@ abstract class tx_dlf_plugin extends tslib_pibase {
}
/* No xclasses for abstract classes!
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {
trigger_error('Could not find Solr core with UID '.$core, E_USER_NOTICE);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Invalid UID "'.$_core.'" for Apache Solr core', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
return;
@ -146,7 +153,11 @@ class tx_dlf_solr {
} else {
trigger_error('Could not connect to Solr server with core "'.$core.'"', E_USER_ERROR);
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Could not connect to Apache Solr server with core "'.$core.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
}
return;
@ -191,7 +202,7 @@ class tx_dlf_solr {
}
/* No xclasses for static classes!
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {