123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
-
- $incdir = dirname(__FILE__).'/../../main/inc/';
- require $incdir.'global.inc.php';
- if (PHP_SAPI != 'cli') { die('This demo-data filling script can only be run from the command line. Please launch it from the command line using: php5 fill_all.php. To enable it from your browser (very highly dangerous), remove the first line of code from the "logic" section of this file.'); }
- $eol = PHP_EOL;
- $output = '';
- $files = scandir(dirname(__FILE__));
- foreach ($files as $file) {
- if (substr($file,0,1) == '.' or substr($file,0,5) != 'fill_') { ; }
- else {
- if ($file == basename(__FILE__)) {
-
- } else {
- $output .= $eol.'Reading file: '.$file.$eol;
- require_once $file;
- $function = basename($file,'.php');
- if (function_exists($function)) {
- $output .= $eol.'Executing function '.$function.$eol;
- $function();
- } else {
-
- }
- }
- }
- }
- echo $output.$eol;
- echo "Done all$eol";
|