spacing and quotes
This commit is contained in:
parent
9357017a39
commit
63ef15d247
|
@ -31,7 +31,7 @@ global $configvals;
|
|||
|
||||
$configFile = ZM_CONFIG;
|
||||
$localConfigFile = basename($configFile);
|
||||
if ( file_exists( $localConfigFile ) && filesize( $localConfigFile ) > 0 ) {
|
||||
if ( file_exists($localConfigFile) && filesize($localConfigFile) > 0 ) {
|
||||
if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) )
|
||||
print("Warning, overriding installed $localConfigFile file with local copy\n");
|
||||
else
|
||||
|
@ -52,10 +52,10 @@ if ( is_dir($configSubFolder) ) {
|
|||
$configvals = array_replace($configvals, process_configfile($filename));
|
||||
}
|
||||
} else {
|
||||
error_log("WARNING: ZoneMinder configuration subfolder found but is not readable. Check folder permissions on $configSubFolder.");
|
||||
error_log('WARNING: ZoneMinder configuration subfolder found but is not readable. Check folder permissions on '.$configSubFolder);
|
||||
}
|
||||
} else {
|
||||
error_log("WARNING: ZoneMinder configuration subfolder found but is not a directory. Check $configSubFolder.");
|
||||
error_log('WARNING: ZoneMinder configuration subfolder found but is not a directory. Check '.$configSubFolder);
|
||||
}
|
||||
|
||||
# Now that our array our finalized, define each key => value
|
||||
|
@ -67,73 +67,73 @@ foreach ( $configvals as $key => $value ) {
|
|||
//
|
||||
// This section is options normally derived from other options or configuration
|
||||
//
|
||||
define( 'ZMU_PATH', ZM_PATH_BIN.'/zmu' ); // Local path to the ZoneMinder Utility
|
||||
define('ZMU_PATH', ZM_PATH_BIN.'/zmu'); // Local path to the ZoneMinder Utility
|
||||
|
||||
//
|
||||
// If setup supports Video 4 Linux v2 and/or v1
|
||||
//
|
||||
define( 'ZM_HAS_V4L2', '@ZM_HAS_V4L2@' ); // V4L2 support enabled
|
||||
define( 'ZM_HAS_V4L1', '@ZM_HAS_V4L1@' ); // V4L1 support enabled
|
||||
define( 'ZM_HAS_V4L', '@ZM_HAS_V4L@' ); // V4L support enabled
|
||||
define('ZM_HAS_V4L2', '@ZM_HAS_V4L2@'); // V4L2 support enabled
|
||||
define('ZM_HAS_V4L1', '@ZM_HAS_V4L1@'); // V4L1 support enabled
|
||||
define('ZM_HAS_V4L', '@ZM_HAS_V4L@'); // V4L support enabled
|
||||
|
||||
//
|
||||
// If ONVIF support has been built in
|
||||
//
|
||||
define( 'ZM_HAS_ONVIF', '@ZM_HAS_ONVIF@' ); // ONVIF support enabled
|
||||
define('ZM_HAS_ONVIF', '@ZM_HAS_ONVIF@'); // ONVIF support enabled
|
||||
|
||||
//
|
||||
// If PCRE dev libraries are installed
|
||||
//
|
||||
define( 'ZM_PCRE', '@ZM_PCRE@' ); // PCRE support enabled
|
||||
define('ZM_PCRE', '@ZM_PCRE@'); // PCRE support enabled
|
||||
|
||||
//
|
||||
// Alarm states
|
||||
//
|
||||
define( 'STATE_IDLE', 0 );
|
||||
define( 'STATE_PREALARM', 1 );
|
||||
define( 'STATE_ALARM', 2 );
|
||||
define( 'STATE_ALERT', 3 );
|
||||
define( 'STATE_TAPE', 4 );
|
||||
define('STATE_IDLE', 0);
|
||||
define('STATE_PREALARM', 1);
|
||||
define('STATE_ALARM', 2);
|
||||
define('STATE_ALERT', 3);
|
||||
define('STATE_TAPE', 4);
|
||||
|
||||
//
|
||||
// DVR Control Commands
|
||||
//
|
||||
|
||||
define( 'MSG_CMD', 1 );
|
||||
define( 'MSG_DATA_WATCH', 2 );
|
||||
define( 'MSG_DATA_EVENT', 3 );
|
||||
define('MSG_CMD', 1);
|
||||
define('MSG_DATA_WATCH', 2);
|
||||
define('MSG_DATA_EVENT', 3);
|
||||
|
||||
define( 'CMD_NONE', 0 );
|
||||
define( 'CMD_PAUSE', 1 );
|
||||
define( 'CMD_PLAY', 2 );
|
||||
define( 'CMD_STOP', 3 );
|
||||
define( 'CMD_FASTFWD', 4 );
|
||||
define( 'CMD_SLOWFWD', 5 );
|
||||
define( 'CMD_SLOWREV', 6 );
|
||||
define( 'CMD_FASTREV', 7 );
|
||||
define( 'CMD_ZOOMIN', 8 );
|
||||
define( 'CMD_ZOOMOUT', 9 );
|
||||
define( 'CMD_PAN', 10 );
|
||||
define( 'CMD_SCALE', 11 );
|
||||
define( 'CMD_PREV', 12 );
|
||||
define( 'CMD_NEXT', 13 );
|
||||
define( 'CMD_SEEK', 14 );
|
||||
define( 'CMD_VARPLAY', 15 );
|
||||
define( 'CMD_QUIT', 17 );
|
||||
define( 'CMD_QUERY', 99 );
|
||||
define('CMD_NONE', 0);
|
||||
define('CMD_PAUSE', 1);
|
||||
define('CMD_PLAY', 2);
|
||||
define('CMD_STOP', 3);
|
||||
define('CMD_FASTFWD', 4);
|
||||
define('CMD_SLOWFWD', 5);
|
||||
define('CMD_SLOWREV', 6);
|
||||
define('CMD_FASTREV', 7);
|
||||
define('CMD_ZOOMIN', 8);
|
||||
define('CMD_ZOOMOUT', 9);
|
||||
define('CMD_PAN', 10);
|
||||
define('CMD_SCALE', 11);
|
||||
define('CMD_PREV', 12);
|
||||
define('CMD_NEXT', 13);
|
||||
define('CMD_SEEK', 14 );
|
||||
define('CMD_VARPLAY', 15);
|
||||
define('CMD_QUIT', 17);
|
||||
define('CMD_QUERY', 99);
|
||||
|
||||
//
|
||||
// These are miscellaneous options you won't normally need to change
|
||||
//
|
||||
define( 'MAX_EVENTS', 10 ); // The maximum number of events to show in the monitor event listing
|
||||
define( 'RATE_BASE', 100 ); // The additional scaling factor used to help get fractional rates in integer format
|
||||
define( 'SCALE_BASE', 100 ); // The additional scaling factor used to help get fractional scales in integer format
|
||||
define('MAX_EVENTS', 10); // The maximum number of events to show in the monitor event listing
|
||||
define('RATE_BASE', 100); // The additional scaling factor used to help get fractional rates in integer format
|
||||
define('SCALE_BASE', 100); // The additional scaling factor used to help get fractional scales in integer format
|
||||
|
||||
//
|
||||
// Date and time formats, not to be modified by language files
|
||||
//
|
||||
define( 'STRF_FMT_DATETIME_DB', '%Y-%m-%d %H:%M:%S' ); // Strftime format for database queries, don't change
|
||||
define( 'MYSQL_FMT_DATETIME_SHORT', '%y/%m/%d %H:%i:%S' ); // MySQL date_format shorter format for dates with time
|
||||
define('STRF_FMT_DATETIME_DB', '%Y-%m-%d %H:%M:%S'); // Strftime format for database queries, don't change
|
||||
define('MYSQL_FMT_DATETIME_SHORT', '%y/%m/%d %H:%i:%S'); // MySQL date_format shorter format for dates with time
|
||||
|
||||
require_once('database.php');
|
||||
require_once('logger.php');
|
||||
|
@ -197,15 +197,15 @@ if ( defined('ZM_TIMEZONE') and ZM_TIMEZONE )
|
|||
ini_set('date.timezone', ZM_TIMEZONE);
|
||||
|
||||
function process_configfile($configFile) {
|
||||
if ( is_readable( $configFile ) ) {
|
||||
if ( is_readable($configFile) ) {
|
||||
$configvals = array();
|
||||
|
||||
$cfg = fopen($configFile, 'r') or ZM\Error("Could not open config file: $configFile.");
|
||||
$cfg = fopen($configFile, 'r') or ZM\Error('Could not open config file: '.$configFile);
|
||||
while ( !feof($cfg) ) {
|
||||
$str = fgets($cfg, 256);
|
||||
if ( preg_match('/^\s*(#.*)?$/', $str) ) {
|
||||
continue;
|
||||
} else if ( preg_match( '/^\s*([^=\s]+)\s*=\s*[\'"]*(.*?)[\'"]*\s*$/', $str, $matches )) {
|
||||
} else if ( preg_match('/^\s*([^=\s]+)\s*=\s*[\'"]*(.*?)[\'"]*\s*$/', $str, $matches) ) {
|
||||
$configvals[$matches[1]] = $matches[2];
|
||||
} else {
|
||||
ZM\Error("Malformed line in config $configFile\n$str");
|
||||
|
@ -214,7 +214,7 @@ function process_configfile($configFile) {
|
|||
fclose($cfg);
|
||||
return $configvals;
|
||||
} else {
|
||||
error_log("WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on $configFile.");
|
||||
error_log('WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on '.$configFile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue