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.'); }
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;
$eol = PHP_EOL;
$output = '';
$output = '';
$files = scandir('.');
$files = scandir(dirname(__FILE__));
foreach ($files as $file) {
foreach ($files as $file) {
if (substr($file,0,1) == '.' or substr($file,0,5) != 'fill_') { ; } //skip
if (substr($file,0,1) == '.' or substr($file,0,5) != 'fill_') { ; } //skip
else {
else {
if ($file == basename(__FILE__)) {
if ($file == basename(__FILE__)) {
; //skip, this is the current file
//skip, this is the current file
} else {
} else {
$output .= $file.$eol;
$output .= $eol.'Reading file: '.$file.$eol;
require_once $file;
require_once $file;
$function = basename($file,'.php');
$function = basename($file,'.php');
if (function_exists($function)) {
if (function_exists($function)) {
$output .= 'Executing function '.$function.$eol;
$output .= $eol.'Executing function '.$function.$eol;