diff --git a/install/conf-sample.php b/install/conf-sample.php new file mode 100644 index 0000000..ab2c843 --- /dev/null +++ b/install/conf-sample.php @@ -0,0 +1,16 @@ + diff --git a/install/db/data.db b/install/db/data.db index 751f6e0..fb0bb0d 100644 --- a/install/db/data.db +++ b/install/db/data.db Binary files differ diff --git a/install/install.php b/install/install.php index e60611a..3db3490 100644 --- a/install/install.php +++ b/install/install.php @@ -2,13 +2,8 @@ if(!file_exists("conf.php")) { echo ">>> NOTE:\n>>> The file conf.php must be edited specifically for this system\n"; - echo ">>> The default file has been created for you.\n>>> Please edit the file to match your system\n"; - $data = ""; - file_put_contents( "conf.php", $data); + echo ">>> The default file has been created for you.\n>>> Please edit the file to match your system\n"; + copy( "conf-sample.php", "conf.php" ); exit; } @@ -20,4 +15,21 @@ exit; } +if(!isset($path_project)){ + echo ">>> ERROR:\n"; + echo "The path to the projectmust be set. Please edit/correct conf.php\n"; + exit; +} + +if(!file_exists( "$path_website/data" )) { + // create the data directory + mkdir( "$path_website/data" ); +} + +if(!file_exists( "$path_website/data/data.db" )) { + // copy over the empty database + copy( "$path_project/install/db/data.db", "$path_website/data/data.db" ); +} + + ?>