Ejdamm / market-board

A lighweight marketplace written with PHP Slim framework
MIT License
1 stars 0 forks source link

Market Board

Setup in Apache

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

Ref.

Install

Database migration

Database migration is done with phinx. First create your database manually. Then migrates will take care of tables. Usage:

Language

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');.

Remove old listings

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.