Browse Source

Cleaned up setup, made it automatic, no need to have config.php & db committed to github (i.e. respectful to existing local databases). Added sample database for sqlite.

pull/1/head
Jeremie Francois (on alpha) 4 years ago
parent
commit
85ab7516f9
  1. 3
      .gitignore
  2. 5
      README.md
  3. 2
      db_sample/README.md
  4. 4
      db_sample/config.php
  5. 0
      db_sample/todolist.db
  6. 3
      index.php
  7. 12
      setup.php

3
.gitignore

@ -2,5 +2,6 @@
.htaccess
.htusers
.idea
db/*
db/config.php
db/todolist*.db
tmp/*

5
README.md

@ -3,6 +3,10 @@
As the name suggests, this project is heavily based on an old but very well done ajax todolist
written by maxpozdeev/mytinytodo (http://www.mytinytodo.net/). It also works quite well on mobile phones.
If you are in a hurry, you may just rename the "db_sample/" folder in place of "db/", so it
bypasses the initial required call of "setup.php". This way you will see it in action quickly.
Otherwise you will be asked about what and how to configure the todo list.
My fork adds some important features, especially for *sharing with others*, including developers.
I wanted a small, fast, no-nonsense bugtracking system which anyone can understand, including my
clients and the end users.
@ -33,4 +37,3 @@ to change this but it helps keep things tidy. The grayed tags are "borrowed" fro
have a reason to use mysql). Backuped files are kept according to the main settings, and restoration
must be done manually if ever something terrible happens
- the sqlite sample file "db/todolist_sample_db_to_rename" can be renamed as "db/todolist.db" if you want to see it in action quickly. Without the file, a fresh, blank installation will be performed and the matching "db/config.php" will be overridden as well.

2
db_sample/README.md

@ -0,0 +1,2 @@
This folder is not used per set. You may want to rename it in place of db/ in order to start with
an example of an already configured database with a few informative entries.

4
db/config.php → db_sample/config.php

@ -8,7 +8,7 @@ $config['mysql.password'] = '';
$config['prefix'] = 'mtt_';
$config['url'] = '';
$config['mtt_url'] = '';
$config['title'] = 'TecRD todo';
$config['title'] = 'Sample TDX';
$config['lang'] = 'en';
$config['password'] = '';
$config['smartsyntax'] = 1;
@ -24,4 +24,4 @@ $config['dateformatshort'] = 'j M';
$config['template'] = 'default';
$config['showdate'] = 1;
$config['alientags'] = 1;
$config['dbbackup'] = 30;
$config['dbbackup'] = 0;

0
db/todolist_sample_db_to_rename → db_sample/todolist.db

3
index.php

@ -5,6 +5,9 @@
Licensed under the GNU GPL v2 license. See file COPYRIGHT for details.
*/
if(!is_file('db/config.php') || !is_file('db/todolist.db'))
die('Bad or missing configuration. Did you run the <a href="setup.php">setup?</a>');
require_once('./init.php');
$lang = Lang::instance();

12
setup.php

@ -8,6 +8,10 @@
set_exception_handler('myExceptionHandler');
if(!is_file('./db/config.php'))
copy('db_sample/config.php','db/config.php') or die ('Could not write to '.getcwd().
'/db/<br>Please create the directory, and make sure the web server can write to it.');
# Check old config file (prior v1.3)
require_once('./db/config.php');
if(!isset($config['db']))
@ -45,8 +49,8 @@ else
}
$lastDatabaseVersion = '1.4'; // the last *database* schema revision, hence rarely what get_version() returns!
echo '<html><head><meta name="robots" content="noindex,nofollow"><title>myTinyTodo '.get_version().' Setup</title></head><body>';
echo "<h1><b>myTinyTodo ".get_version()." Setup</b></h1><br><br>";
echo '<html><head><meta name="robots" content="noindex,nofollow"><title>myTDX '.get_version().' Setup</title></head><body>';
echo '<h1><b>myTDX '.get_version().' setup</b></h1><br><br>';
# determine current installed version
$this_db_ver = get_db_ver($db, $dbtype);
@ -225,7 +229,8 @@ if(!$this_db_ver)
}
elseif($this_db_ver == $lastDatabaseVersion)
{
exitMessage("Installed version does not require database update.");
exitMessage("Installed version does not require database update.".
'<br><br>Go to the <a href="index.php">index</a>.');
}
else
{
@ -264,6 +269,7 @@ else
}
}
echo "Done<br><br> <b>Attention!</b> Delete this file for security reasons.";
echo '<br><br>Go to the <a href="index.php">index</a>.';
printFooter();

Loading…
Cancel
Save