1 | <?php |
||
13 | class SitemapBuilder |
||
14 | { |
||
15 | const BASE_PATH = 'https://doc.owncloud.com/server'; |
||
16 | const PRIORITY = 0.8; |
||
17 | const VERSION = '10.0'; |
||
18 | const FILEPATH_PREFIX_REGEX = '/.*(?=user_manual|admin_manual|developer_manual)/'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $basePath; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $version; |
||
29 | |||
30 | /** |
||
31 | * @var float |
||
32 | */ |
||
33 | private $priority; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $changeFrequency; |
||
39 | |||
40 | /** |
||
41 | * SitemapBuilder constructor. |
||
42 | * @param string $basePath |
||
43 | * @param string $version |
||
44 | * @param float|string $priority |
||
45 | * @param string $changeFrequency |
||
46 | */ |
||
47 | public function __construct( |
||
58 | |||
59 | /** |
||
60 | * Build a list of URLs from the files of the required filetype retrieved |
||
61 | * @param string $path |
||
62 | * @param string $extension |
||
63 | * @return array |
||
64 | */ |
||
65 | public function getSitemapUrlList($path, $extension) |
||
74 | |||
75 | /** |
||
76 | * Generated a valid sitemap.xml string from the list of files supplied |
||
77 | * @param array $fileList |
||
78 | * @return string |
||
79 | */ |
||
80 | public function generateSiteMapXml($fileList) |
||
97 | |||
98 | /** |
||
99 | * Convert a list of retrieved files to an equivalent list of URLs |
||
100 | * |
||
101 | * @param \Traversable $iterator |
||
102 | * @param string $extension |
||
103 | * @return array |
||
104 | */ |
||
105 | private function convertFilesToUrls(\Traversable $iterator, $extension) |
||
120 | } |
||
121 |