示例#1
0
 /**
  * verifyDataSource, verifies if data is accessable and 
  * contains what we need
  *
  * @param arrProperties array in: Properties wish list.
  * @return integer Error stat
  */
 public function verifyDataSource()
 {
     global $content;
     if ($this->_streamCfgObj == null) {
         if (isset($content['Sources'][$this->_mySourceID]['ObjRef'])) {
             // Obtain and get the Config Object
             $this->_streamCfgObj = $content['Sources'][$this->_mySourceID]['ObjRef'];
             // Fix Filename manually for FILE LOGSTREAM!
             if ($content['Sources'][$this->_mySourceID]['SourceType'] == SOURCE_DISK) {
                 $this->_streamCfgObj->FileName = CheckAndPrependRootPath($content['Sources'][$this->_mySourceID]['DiskFile']);
             }
         } else {
             return ERROR_SOURCENOTFOUND;
         }
     }
     if ($this->_streamObj == null) {
         // Create LogStream Object
         $this->_streamObj = $this->_streamCfgObj->LogStreamFactory($this->_streamCfgObj);
     }
     // Check datasource and return result
     $res = $this->_streamObj->Verify();
     return $res;
 }
示例#2
0
 if (!isset($content['SourceViewID'])) {
     $content['ISERROR'] = true;
     $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_VIEW']);
 } else {
     // Disk Params
     if ($content['SourceType'] == SOURCE_DISK) {
         if (!isset($content['SourceLogLineType'])) {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_LOGLINETYPE']);
         } else {
             if (!isset($content['SourceDiskFile'])) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_SYSLOGFILE']);
             } else {
                 // Get plain filename for testing!
                 $content['SourceDiskFileTesting'] = CheckAndPrependRootPath(DB_StripSlahes($content['SourceDiskFile']));
                 /*
                 // Take as it is if rootpath!
                 if (
                 		( ($pos = strpos($content['SourceDiskFileTesting'], "/")) !== FALSE && $pos == 0) ||
                 		( ($pos = strpos($content['SourceDiskFileTesting'], "\\\\")) !== FALSE && $pos == 0) ||
                 		( ($pos = strpos($content['SourceDiskFileTesting'], ":\\")) !== FALSE ) ||
                 		( ($pos = strpos($content['SourceDiskFileTesting'], ":/")) !== FALSE )
                 	)
                 {
                 	// Nothing really todo
                 	true;
                 }
                 else // prepend basepath!
                 	$content['SourceDiskFileTesting'] = $gl_root_path . $content['SourceDiskFileTesting'];
                 */