adding a include file to include commen files

This commit is contained in:
Mikki Sørensen 2018-03-10 01:44:51 +01:00
parent 4c3b99938b
commit 0dedf64140

26
scripts/lib/include.php Normal file
View File

@ -0,0 +1,26 @@
<?php
// ------------------------------------------------------------ //
// Array of files to include
// ------------------------------------------------------------ //
$includes = array(
"functions",
"cli_mode",
"web_mode",
);
// ------------------------------------------------------------ //
// Include the php files in the array
// ------------------------------------------------------------ //
foreach ($includes as $key => $value)
{
//Always finde the correct path
$dir_path = __FILE__;
$dir_path = str_replace("include.php", "", $dir_path);
require_once $dir_path . $value . ".php";
}
?>