Enable mod_rewrite module sudo a2enmod rewrite
Setup a virtual host in /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/market-board/public
ServerName market-board
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/market-board/public">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Restart apache2 systemctl restart apache2
composer install
inside the git repository root folder.chown www-data:www-data logs/app.log
Database migration is done with phinx. First create your database manually. Then migrates will take care of tables. Usage:
scripts/phinx.sh create <MyTable>
(Note CamelCase)
scripts/phinx.sh migrate
will migrate whatever config that is written under the function create()
in db/migrate
scripts/phinx.sh rollback
will rollback whatever config that is written create()
in resources/db/migrate
scripts/phinx.sh migrate -e dev -t 0
will reset all migrationsscripts/phinx.sh seed:create YourSeedName
(Note camelCase).scripts/phinx.sh seed:run
scripts/phinx.sh seed:run -s <yourSeedClass>
scripts/phinx.sh seed:run -s DefaultLanguage
All labels and messages are defined in the database to easy change wordings or language. To make a new set of strings
copy the DefaultLanguage.php file in resources/db/seeds/language and replace the words. If you edit the default file directly
you risk to overwrite it upon an code update. As for now it is not possible to change language from the UI. Do it by
change from default to your own language in index.php or set it in the session $this->session->set('language', 'english');
.
There is a script to remove listings older than n days. Run it from command line with php ./scripts/ListingsHelper.php DAYS
.
Be careful when running this. if DAYS is set to -1 all listings will be removed. Use cronjob to automatically cleanup old listings.