PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.2
WebberZone Top 10 — Popular Posts v4.5.2
4.5.2 4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 All 118 releases
top-10 / vendor / jaybizzle / crawler-detect / export.php

export.php in WebberZone Top 10 — Popular Posts 4.5.2, at vendor/jaybizzle/crawler-detect/export.php

42 lines 997 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of Crawler Detect - the web crawler detection library.
5 *
6 * (c) Mark Beech <[email protected]>
7 *
8 * This source file is subject to the MIT license that is bundled
9 * with this source code in the file LICENSE.
10 */
11
12 require 'src/Fixtures/AbstractProvider.php';
13 require 'src/Fixtures/Crawlers.php';
14 require 'src/Fixtures/Exclusions.php';
15 require 'src/Fixtures/Headers.php';
16
17 $src = [
18 'Crawlers',
19 'Exclusions',
20 'Headers',
21 ];
22
23 foreach ($src as $class) {
24 $class = "Jaybizzle\\CrawlerDetect\\Fixtures\\$class";
25 $object = new $class;
26
27 outputJson($object);
28 outputTxt($object);
29 }
30
31 function outputJson($object)
32 {
33 $className = (new ReflectionClass($object))->getShortName();
34 file_put_contents("raw/$className.json", json_encode($object->getAll()).PHP_EOL);
35 }
36
37 function outputTxt($object)
38 {
39 $className = (new ReflectionClass($object))->getShortName();
40 file_put_contents("raw/$className.txt", implode(PHP_EOL, $object->getAll()).PHP_EOL);
41 }
42