ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
old-remove-require-once.php
Go to the documentation of this file.
1#!/usr/bin/php
2<?php
3
4chdir(dirname(__FILE__));
5require_once 'common.php';
7
8echo "Please do not run this script. It is here for historical purposes only.";
10
19chdir(dirname(__FILE__) . '/../tests/HTMLPurifier');
20$FS = new FSTools();
21
22$files = $FS->globr('.', '*.php');
23foreach ($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
An exception for terminatinating execution or to throw for unit testing.
Filesystem tools not provided by default; can recursively create, copy and delete folders.
Definition: FSTools.php:11
assertCli()
Definition: common.php:3
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file