Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / ezyang / htmlpurifier / maintenance / old-remove-require-once.php
1 #!/usr/bin/php
2 <?php
3
4 chdir(dirname(__FILE__));
5 require_once 'common.php';
6 assertCli();
7
8 echo "Please do not run this script. It is here for historical purposes only.";
9 exit;
10
11 /**
12  * @file
13  * Removes leading includes from files.
14  *
15  * @note
16  *      This does not remove inline includes; those must be handled manually.
17  */
18
19 chdir(dirname(__FILE__) . '/../tests/HTMLPurifier');
20 $FS = new FSTools();
21
22 $files = $FS->globr('.', '*.php');
23 foreach ($files as $file) {
24     if (substr_count(basename($file), '.') > 1) continue;
25     $old_code = file_get_contents($file);
26     $new_code = preg_replace("#^require_once .+[\n\r]*#m", '', $old_code);
27     if ($old_code !== $new_code) {
28         file_put_contents($file, $new_code);
29     }
30 }
31
32 // vim: et sw=4 sts=4