1313
1414class Configuration
1515{
16- const KEY_NumEntriesToCache = 'num_cache_entries ' ;
17- const DEFAULT_NumEntriesToCache = 200000 ;
16+ public const KEY_NUM_ENTRIES_TO_CACHE = 'num_cache_entries ' ;
17+ public const DEFAULT_NUM_ENTRIES_TO_CACHE = 200000 ;
1818
19- const KEY_AccessLogRegex = 'access_log_regex ' ;
20- const DEFAULT_AccessLogRegex = '/^(\S+) (\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+)\] \"(\S+) (.*?) (\S+)\" (\S+) (\S+) "([^"]*)" "([^"]*)" (\d+)$/ ' ;
19+ public const KEY_ACCESS_LOG_REGEX = 'access_log_regex ' ;
20+ public const DEFAULT_ACCESS_LOG_REGEX = '/^(\S+) (\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+)\] \"(\S+) (.*?) (\S+)\" (\S+) (\S+) "([^"]*)" "([^"]*)" (\d+)$/ ' ;
2121
22- const KEY_AccessLogRegexMatchEntry = 'regex_match_entry ' ;
23- const DEFAULT_AccessLogRegexMatchEntry = 14 ;
22+ public const KEY_ACCESS_LOG_REGEX_MATCH_ENTRY = 'regex_match_entry ' ;
23+ public const DEFAULT_ACCESS_LOG_REGEX_MATCH_ENTRY = 14 ;
2424
25- const KEY_AccessLogPath = 'access_log_path ' ;
26- const DEFAULT_AccessLogPath = '/var/log/httpd/access_log ' ;
25+ public const KEY_ACCESS_LOG_PATH = 'access_log_path ' ;
26+ public const DEFAULT_ACCESS_LOG_PATH = '/var/log/httpd/access_log ' ;
2727
2828 public function install ()
2929 {
@@ -36,17 +36,17 @@ public function install()
3636 $ cache = $ config ->DeviceDetectorCache ;
3737
3838 // we make sure to set a value only if none has been configured yet, eg in common config.
39- if (empty ($ cache [self ::KEY_NumEntriesToCache ])) {
40- $ cache [self ::KEY_NumEntriesToCache ] = self ::DEFAULT_NumEntriesToCache ;
39+ if (empty ($ cache [self ::KEY_NUM_ENTRIES_TO_CACHE ])) {
40+ $ cache [self ::KEY_NUM_ENTRIES_TO_CACHE ] = self ::DEFAULT_NUM_ENTRIES_TO_CACHE ;
4141 }
42- if (empty ($ cache [self ::KEY_AccessLogPath ])) {
43- $ cache [self ::KEY_AccessLogPath ] = self ::DEFAULT_AccessLogPath ;
42+ if (empty ($ cache [self ::KEY_ACCESS_LOG_PATH ])) {
43+ $ cache [self ::KEY_ACCESS_LOG_PATH ] = self ::DEFAULT_ACCESS_LOG_PATH ;
4444 }
45- if (empty ($ cache [self ::KEY_AccessLogRegex ])) {
46- $ cache [self ::KEY_AccessLogRegex ] = self ::DEFAULT_AccessLogRegex ;
45+ if (empty ($ cache [self ::KEY_ACCESS_LOG_REGEX ])) {
46+ $ cache [self ::KEY_ACCESS_LOG_REGEX ] = self ::DEFAULT_ACCESS_LOG_REGEX ;
4747 }
48- if (empty ($ cache [self ::KEY_AccessLogRegexMatchEntry ])) {
49- $ cache [self ::KEY_AccessLogRegexMatchEntry ] = self ::DEFAULT_AccessLogRegexMatchEntry ;
48+ if (empty ($ cache [self ::KEY_ACCESS_LOG_REGEX_MATCH_ENTRY ])) {
49+ $ cache [self ::KEY_ACCESS_LOG_REGEX_MATCH_ENTRY ] = self ::DEFAULT_ACCESS_LOG_REGEX_MATCH_ENTRY ;
5050 }
5151
5252 $ config ->DeviceDetectorCache = $ cache ;
@@ -66,31 +66,31 @@ public function uninstall()
6666 */
6767 public function getAccessLogPath ()
6868 {
69- return $ this ->getConfigValue (self ::KEY_AccessLogPath , self ::DEFAULT_AccessLogPath );
69+ return $ this ->getConfigValue (self ::KEY_ACCESS_LOG_PATH , self ::DEFAULT_ACCESS_LOG_PATH );
7070 }
7171
7272 /**
7373 * @return string
7474 */
7575 public function getAccessLogRegex ()
7676 {
77- return $ this ->getConfigValue (self ::KEY_AccessLogRegex , self ::DEFAULT_AccessLogRegex );
77+ return $ this ->getConfigValue (self ::KEY_ACCESS_LOG_REGEX , self ::DEFAULT_ACCESS_LOG_REGEX );
7878 }
7979
8080 /**
8181 * @return string
8282 */
8383 public function getRegexMatchEntry ()
8484 {
85- return (int )$ this ->getConfigValue (self ::KEY_AccessLogRegexMatchEntry , self ::DEFAULT_AccessLogRegexMatchEntry );
85+ return (int )$ this ->getConfigValue (self ::KEY_ACCESS_LOG_REGEX_MATCH_ENTRY , self ::DEFAULT_ACCESS_LOG_REGEX_MATCH_ENTRY );
8686 }
8787
8888 /**
8989 * @return string
9090 */
9191 public function getNumEntriesToCache ()
9292 {
93- return (int )$ this ->getConfigValue (self ::KEY_NumEntriesToCache , self ::DEFAULT_NumEntriesToCache );
93+ return (int )$ this ->getConfigValue (self ::KEY_NUM_ENTRIES_TO_CACHE , self ::DEFAULT_NUM_ENTRIES_TO_CACHE );
9494 }
9595
9696 private function getConfig ()
0 commit comments