replace function deprecated in php 5.3
| | |
| | | $filepath = dirname($file);
|
| | | if (is_dir($filepath)) return true;
|
| | |
|
| | | $dirs = split('[\\/]', $filepath);
|
| | | $dirs = preg_split('/[\\/]/', $filepath);
|
| | | $currpath;
|
| | | foreach ($dirs as $dir) {
|
| | | $currpath .= $dir .'/';
|
| | |
| | | return $passed; |
| | | } |
| | | if (is_string($exts)) { |
| | | if (eregi("\.". $exts ."$", $filename)) { |
| | | if (preg_match("/\.". $exts ."$/i", $filename)) { |
| | | $passed = TRUE; |
| | | return $passed; |
| | | } |
| | | } else if (is_array($exts)) { |
| | | foreach ($exts as $theExt) { |
| | | if (eregi("\.". $theExt ."$", $filename)) { |
| | | if (preg_match("/\.". $theExt ."$/i", $filename)) { |
| | | $passed = TRUE; |
| | | return $passed; |
| | | } |
| | |
| | | |
| | | switch (strtolower($this->OPTIONS['UNKNOWNS'])) { |
| | | case 'comment': |
| | | $comment = addcslashes('<!-- unknown variable '.ereg_replace('<!--|-->', '', $wholetag).'//-->', '"'); |
| | | $comment = addcslashes('<!-- unknown variable '.preg_replace('/<!--|-->/', '', $wholetag).'//-->', '"'); |
| | | $retstr .= ' else { print("'.$comment.'"); $this->_setUnknown("'.$varname.'"); }'; |
| | | return $retstr; |
| | | break; |
| | |
| | | * @return boolean
|
| | | */
|
| | | function setCacheExtension($str = null) {
|
| | | if ($str == null || !ereg('^[a-z0-9]+$', strtolower($str))) return false;
|
| | | if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false;
|
| | | $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str);
|
| | | return true;
|
| | | }
|
| | |
| | | $filepath = dirname($file);
|
| | | if (is_dir($filepath)) return true;
|
| | |
|
| | | $dirs = split('[\\/]', $filepath);
|
| | | $dirs = preg_split('/[\\/]/', $filepath);
|
| | | $currpath;
|
| | | foreach ($dirs as $dir) {
|
| | | $currpath .= $dir .'/';
|
| | |
| | | $memInfo = explode("\n", $miData); |
| | | |
| | | foreach($memInfo as $line){ |
| | | $part = split(":", $line); |
| | | $part = preg_split("/:/", $line); |
| | | $key = trim($part[0]); |
| | | $tmp = explode(" ", trim($part[1])); |
| | | $value = 0; |
| | |
| | | $cpuInfo = explode("\n", $cpuData); |
| | | |
| | | foreach($cpuInfo as $line){ |
| | | $part = split(":", $line); |
| | | $part = preg_split("/:/", $line); |
| | | $key = trim($part[0]); |
| | | $value = trim($part[1]); |
| | | $data[$key] = $value; |