Skip to content

Commit

Permalink
Restructured application configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrebs committed Feb 11, 2018
1 parent 90b9a78 commit fdf60b8
Show file tree
Hide file tree
Showing 21 changed files with 137 additions and 89 deletions.
3 changes: 3 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Installation instructions can be found in the following directory:

data/docs/install.txt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Tobias Krebs
Copyright (c) 2018 Tobias Krebs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 7 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Documentation and installation instructions can be found in the following directory:

/data/docs/
data/docs/



Especially:

data/docs/install.txt
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ yourself.
Documentation and installation instructions can be found in the following directory:

```
/data/docs/
data/docs/
```

## Architecture
Expand All @@ -41,7 +41,9 @@ where you can find stable and (latest) development releases.

## Version

The current version (July, 2016) is 1.6.
The current version (February, 2018) is 1.6.2.

Version 1.6.2 changed the configuration behaviour and requires some manual changes (see data/docs/update.txt). Otherwise, the update will not work.

Version 1.6 introduced some requested features and fixed quite some bugs. It also introduced better support for custom translations and modules.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6
1.6.2
17 changes: 8 additions & 9 deletions config/application.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?php
/**
* Application configuration file
* Application configuration bootstrap
*/

/**
* Development mode
*
* If true, errors are displayed.
* If false, errors are silently logged to an error file.
*
* If true, certain caches will be enabled.
* Should be controlled via TAG constant in the init.php
*/
if (! defined('EP3_BS_DEV')) {
define('EP3_BS_DEV', false);
if (defined('EP3_BS_DEV_TAG')) {
define('EP3_BS_DEV', EP3_BS_DEV_TAG);
} else {
define('EP3_BS_DEV', true);
}

/**
Expand Down Expand Up @@ -40,10 +39,10 @@
/**
* Custom modules
*
* Place your own, custom or (third party) extra modules in the /modulex directory
* Place your own, custom or third party modules in the modulex/ directory
* and they will be loaded automatically.
*/
), include 'modules.php'),
), include 'modulexes.php'),

/**
* Some further internal settings,
Expand Down
16 changes: 2 additions & 14 deletions config/autoload/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,10 @@
/**
* Global application configuration
*
* Usually, you can leave this file as is and don't
* need to worry about its contents.
* Usually, you can leave this file as is
* and do not need to worry about its contents.
*/

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('error_log', getcwd() . '/data/log/errors.txt');

ini_set('display_errors', EP3_BS_DEV ? 1 : 0);
ini_set('display_startup_errors', EP3_BS_DEV ? 1 : 0);
ini_set('log_errors', EP3_BS_DEV ? 0 : 1);
ini_set('ignore_repeated_errors', 1);
ini_set('html_errors', EP3_BS_DEV ? 1 : 0);
ini_set('ignore_user_abort', EP3_BS_DEV ? 1 : 0);

ini_set('default_charset', 'UTF-8');

return array(
'db' => array(
'driver' => 'pdo_mysql',
Expand Down
6 changes: 2 additions & 4 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* and provide the email address the system should use.
*/

ini_set('date.timezone', 'America/New_York');

return array(
'db' => array(
'database' => '?',
Expand All @@ -28,7 +26,7 @@ return array(
'port' => 'auto', // for 'smtp' type only, otherwise remove or leave as is
),
'i18n' => array(
'locale' => 'en-US',
'currency' => 'USD',
'locale' => 'de-DE',
'currency' => 'EUR',
),
);
38 changes: 37 additions & 1 deletion config/init.php.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
<?php

define('EP3_BS_DEV', true);
/**
* Testing and development mode
*
* If true, errors are displayed.
* If false, errors are silently logged into the error file.
*
* If true, certain caches will be enabled.
*
* Should be true during initial testing and false when actually using the system.
*/
define('EP3_BS_DEV_TAG', true);

/**
* Timezone of the people using the system
*
* An overview of available timezones can be found here:
* http://php.net/manual/en/timezones.php
*/
ini_set('date.timezone', 'Europe/Berlin');



/**
* The following settings are more technical and can usually be ignored.
*/

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('error_log', getcwd() . '/data/log/errors.txt');

ini_set('display_errors', EP3_BS_DEV_TAG ? 1 : 0);
ini_set('display_startup_errors', EP3_BS_DEV_TAG ? 1 : 0);
ini_set('log_errors', EP3_BS_DEV_TAG ? 0 : 1);
ini_set('ignore_repeated_errors', 1);
ini_set('html_errors', EP3_BS_DEV_TAG ? 1 : 0);
ini_set('ignore_user_abort', EP3_BS_DEV_TAG ? 1 : 0);

ini_set('default_charset', 'UTF-8');
File renamed without changes.
10 changes: 4 additions & 6 deletions config/setup.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Setup configuration file
* Setup configuration bootstrap
*
* Don't worry about this file. It is irrelevant for the actual system
* and is only used for the first setup.
Expand All @@ -9,11 +9,9 @@
/**
* Development mode
*
* Should always be true in this context!
* Should always be enabled during setup
*/
if (! defined('EP3_BS_DEV')) {
define('EP3_BS_DEV', true);
}
define('EP3_BS_DEV', true);

/**
* Setup configuration array
Expand All @@ -39,4 +37,4 @@
'module_map_cache_key' => 'ep3-bs-setup',
'cache_dir' => getcwd() . '/data/cache/',
),
);
);
2 changes: 1 addition & 1 deletion data/docs/install-extra-modules.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Simply copy custom or (third party) extra modules in the /modulex directory and they will be loaded automatically.
Simply copy custom or (third party) extra modules in the modulex directory and they will be loaded automatically.
26 changes: 17 additions & 9 deletions data/docs/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,38 @@ continue with installation.

0. Install dependencies via composer



--- Installation ---

1. Setup local configuration
- rename /config/autoload/local.php.dist to local.php
- rename config/init.php.dist to init.php
- edit init.php

- rename config/autoload/local.php.dist to local.php
- edit local.php

2. Enable (recursively) UNIX write permission for
- /data/cache/
- /data/log/
- /data/session/
- /public/docs-client/upload/
- /public/imgs-client/upload/
- data/cache/
- data/log/
- data/session/
- public/docs-client/upload/
- public/imgs-client/upload/

3. Setup the database via setup.php

4. Delete setup tool
- /public/setup.php
- public/setup.php

5. Delete any files in the following directory
- data/cache/

5. Customize public files (optional)
6. Customize public files (optional)
- css-client/default.css (custom color scheme)
- imgs-client/icons/fav.ico
- imgs-client/layout/logo.png (75x75)

6. Have fun! :)
7. Have fun! :)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Notes on the architecture:

- index.php changes working directory, loads and registers the standard autoloader and invokes the application init()
method with the application's global config (which essentially determines which modules to load,
where to find them and which other global config files should be loaded and merged with each module config)
Expand Down Expand Up @@ -37,4 +35,4 @@ Notes on the architecture:
* determine controller from RouteMatch
* if found and dispatchable, call it, otherwise trigger dispatch.error
3. render
4. finish
4. finish
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
On new release:

- Update features
- Update documentation

Expand All @@ -8,4 +6,4 @@ On new release:
- VERSION
- Update package

- Update demo
- Update demo
4 changes: 0 additions & 4 deletions data/docs/todo-events.txt

This file was deleted.

5 changes: 2 additions & 3 deletions data/docs/todo.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Short Term:

- Allow bookings without registration (i.e. inline registration)

Long Term:
- Events should be able to have participants (requires respective tables and managers)
- Participation process like booking process

- Introduce testing via PHPUnit/Selenium
- Introduce maintenance cronjob
Expand Down
57 changes: 39 additions & 18 deletions data/docs/update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,62 @@ First backup your database and project directory!



--- Update to 1.6.2 ---

There have been some internal changes to the configuration directory. Replace the following files:

- config/init.php.dist
- config/init.php
(and edit it according to your needs; if it does not yet exist, create it by copying init.php.dist)

- data/docs/*

- public/index.php

- vendor/*
(alternatively, you may update dependencies via composer after replacing the composer.json)

- All single files in the project root directory



--- Update to 1.6 ---

Replace the following directories and files with the new ones:

- /config/application.php
- /config/modules.php
- /config/setup.php
- config/application.php
- config/modules.php
- config/setup.php

- /data/res/ (if you have custom translations you *can* now place them in /data/res/i18n-custom/ )
- data/res/
(if you have custom translations you *can* now place them in data/res/i18n-custom/)

- /module/
- /modulex/
- module/
- modulex/

- /public/js/
- /public/index.php
- public/js/
- public/index.php



--- Update to 1.4 / 1.5 ---

Replace the following directories and files with the new ones:

- /data/res/
- data/res/

- /module/
- module/

- /public/css/
- /public/docs/
- /public/imgs/
- /public/js/
- /public/misc/
- /public/vendor/
- public/css/
- public/docs/
- public/imgs/
- public/js/
- public/misc/
- public/vendor/
- index.php

- /vendor/ (alternatively, you may update dependencies via composer after replacing the composer.json)
- vendor/
(alternatively, you may update dependencies via composer after replacing the composer.json)

- All single files in the project root directory

Expand All @@ -46,7 +67,7 @@ Replace the following directories and files with the new ones:

After every update you should delete all files within the

- /data/cache/
- data/cache/

directory.

Expand Down
Loading

0 comments on commit fdf60b8

Please sign in to comment.