Web-based consultation rounds
The tool is written with multi-project support. It means that one database can be used by several projects running as separate instances. Some entities such as consultations and articles can be shared, others are project specific.
utf8mb4_unicode_ci
encoding⚠ If there is a problem loading assets such as JS and CSS files, it is likely caused by error in the application/configs/config.local.ini
in the directive resources.frontController.baseUrl
. If app is running in subfolder, it should be set to /subdir-name
otherwise leave it as /
.
The preferred installation method is using the bundled installation wizard.
$ robo create:install-zip
command in the root folder of the cloned repository where the RoboFile.php
is located. install
directory. This is not necessary if the app is to be accessed on domain matching http[s]://devel.*
(see Development).The tool uses the Robo task runner to perform the build. It is invoked by running the $ robo build
command in the root folder where the RoboFile.php
is located. The following tools are needed:
Once the application has been built, several environment-specific settings have to be configured.
application/configs/config.local.ini
application/configs/phinx.local.yml
You can use files application/configs/config.local-example.ini
and application/configs/phinx.local-example.yml
as a template and edit the values.
Optionally set the APPLICATION_ENV
in index.php
to development
.
/
/runtime/logs/
/runtime/sessions/
/runtime/cache/
/www/media/consultations/
/www/media/folders/
/www/image_cache/
install
directory. This is not necessary if the app is to be accessed on domain matching http[s]://devel.*
(see Development).
composer install
npm install
npm install
grunt
mysql -u <db_user> -h <db_host> -p <db_name> < data/create-installation.sql
$ vendor/bin/robo phinx:migrate production
Ensure the var
mysql -u <db_user> -h <db_host> -p <db_name> < data/create-project.sql
@project_code
in the SQL script is set to whatever is specified in the setting project
in application/configs/config.local.ini
.
data/create-sample-data.sql
Due to security reasons the
data/create-admin.sql
create-admin.sql
script creates an admin with no password. Password can be reset using the forgotten password feature of the application itself or the file can be manually tweaked to insert the correct password hash directly.Regardless of the installation method, the following tasks must be done:
Set up cronjobs. There are three ways to do it:
application/cli.php cron
via CLI./cron/execute/key/<secret_cron_key>
. <secret_cron_key>
is defined in cron.key
entry inapplication/config/config.local.ini
and is used to prevent unauthorized users from triggering the task.cron.key
entry in application/config/config.local.ini
setting empty. This means that cronjobs might be run with some probability on every request to the site. This feature is disabled in development mode.Copy the file VERSION-example.txt
to VERSION.txt
and optionally update the new file. The content is used to inform the users of which version of the tool they are using.
Before you start updating your project, it is recommended to shut it down and display to users the error page with HTTP status 503 (Temporarily unavailable).
Check if there is the table named phinxlog
in your database. If not, your version is not probably compatible with update
$ robo create:update-zip
command in the root folder of the cloned repository where the RoboFile.php
is located.application/configs/config.local.ini
application/configs/phinx.local.yml
www/media
runtime/logs
.htaccess
file in the root of the project.htaccess
file in the www
directoryruntime
directory:cache
sessions
www/runMigrations.php
script to allow run DB migrations. You can edit this script in your FTP client or locally and then upload it if your client does not provide this functionality./www/runMigrations.php
in the browser. Be aware of result of this operation displayed in the browser. In case the execution time limit in PHP is reached and phinx migration manager could not complete all migrations, the project may stop working. Please try to execute migrations again to complete the rest of them and pay attention to what phinx migration manager returns in its output to the browser.die()
to prevent running DB migrations script.$ cp -R project_dir backup_dir
$ mysqldump -h 127.0.0.1 database_name > backup_dir/db_dump.sql
.
in the update package folder. $ mv tool-update/* project_dir/
$ cp backup_dir/application/configs/phinx.local.yml project_dir/application/configs
$ cp backup_dir/application/configs/config.local.ini project_dir/application/configs
$ cp -R backup_dir/www/media project_dir/www/media
$ cp backup_dir/.htaccess project_dir
$ cp backup_dir/www/.htaccess project_dir/www
$ cp backup_dir/runtime/logs project_dir/runtime
runtime
directory:$ mkdir -m 755 runtime/cache
$ mkdir -m 755 runtime/sessions
$ vendor/bin/phinx migrate -c application/configs/phinx.local.yml -e production
Upgrading the tool version consists of the following steps:
$ robo build
$ robo phinx:migrate production
to apply database patchesThe recommended way to develop the tool is using Docker. The application in development mode is served at http://devel.localhost
. First run of Docker can take a few minutes.
To build the documentation locally follow: https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/
The docker-compose
tool is needed.
$ docker-compose up
to start server$ docker-compose stop
to stop serverIt is recommended to use docker-compose-sync
for better performance.
Installation guide for specific operating system can be found on following websites:
docker-compose
command is part of Docker and it is not required to install it again.
./docker-compose-sync.sh start
to start server./docker-compose-sync.sh stop
to stop serverThis functionality requires some third party components, which are included.
Interactive maps are provided by javascript library Leaflet. Map tiles source url is set in application config.ini in the section osm.data_server_url. This is the endpoint, where the JS library retrieves map tiles from.
Static maps images with marker for previews are rendered with built-in PHP service, which uses the same endpoint for retrieving and caching the map tiles.
There is no need to have any account or another kind of authorization to access map tiles on free servers. There are also no strict quotas for usage. For better insurance of availability it is possible to host OSM data on the own server or use some commercial solution.
If the application runs over secured connection (https), the geolocation service provided by a web browser API is used in JS library to locate users. In case the application runs over http, this functionality will be probably unavailable.
Open Street Map (OSM) are licensed by Open Data Commons Open Database License (ODbL) and by Creative Commons 2.0 (CC-BY-SA)
This application uses external libraries and third party software. The list of all required software packages is available in special definition files.
composer.json
package.json
Licenses of used libraries and other third party software are available usually on the package manager web page or in the package repository.
composer.json
) visit please packagist.org and insert the name of the packagepackage.json
) visit please www.npmjs.com