1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
xscan_htaccess.php
См. документацию.
1<?php
2
4
5 public $doc_root = null;
6 public $start_time = null;
7 public $time_limit = null;
8 public $break_point = null;
9 public $skip_path = null;
10 public $found = false;
11 public $result = [];
12
13 function __construct(array $result = [])
14 {
15 $this->doc_root = rtrim($_SERVER['DOCUMENT_ROOT'], '/');
16 $this->start_time = time();
17
18 $mem = (int)ini_get('memory_limit');
19 $this->time_limit = ini_get('max_execution_time') ?: 30;
20 $this->time_limit = min($this->time_limit, 30);
21 $this->time_limit = $this->time_limit * 0.7;
22
23 $this->result = $result;
24
25 }
26
27
28 function Search($path)
29 {
30 $path = str_replace('\\', '/', $path);
31 do
32 {
33 $path = str_replace('//', '/', $path, $flag);
34 }
35 while ($flag);
36
37 if ($this->start_time && time() - $this->start_time > $this->time_limit)
38 {
39 if (!$this->break_point)
40 {
41 $this->break_point = $path;
42 }
43 return;
44 }
45
46 if ($this->skip_path && !$this->found)
47 {
48 if (strpos($this->skip_path, dirname($path)) !== 0)
49 {
50 return;
51 }
52
53 if ($this->skip_path == $path)
54 {
55 $this->found = true;
56 }
57 }
58
59 if (is_dir($path)) // dir
60 {
61 $p = realpath($path);
62
63 if (is_link($path))
64 {
65 $d = dirname($path);
66 if (strpos($p, $d) !== false || strpos($d, $p) !== false)
67 {
68 return true;
69 }
70 }
71
72 $dir = opendir($path);
73
74 while ($item = readdir($dir))
75 {
76 if ($item == '.' || $item == '..')
77 {
78 continue;
79 }
80
81 $this->Search($path . '/' . $item);
82 }
83 closedir($dir);
84 }
85 elseif (preg_match('/\.htaccess$/', $path))
86 {
87 if (!$this->skip_path || $this->found)
88 {
89 $this->result[] = $path;
90 }
91 }
92 }
93}
$path
Определения access_edit.php:21
Search($path)
Определения xscan_htaccess.php:28
__construct(array $result=[])
Определения xscan_htaccess.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$p
Определения group_list_element_edit.php:23
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$dir
Определения quickway.php:303