A show-and-tell project to show my students how to create a simple but extendable and maintainable web application in php.
- PHP´s internal server
- sqlite database
- composer autoload
- Clone the project.
git clone https://github.com/steffengrahl/simple-weblog-oop.git
- Go to the project directory.
cd simple-weblog-oop/
- Install composer locally in this project.
You can find the instructions at getcomposer.org
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php --install-dir=bin --filename=composer php -r "unlink('composer-setup.php');"
- Go to the public folder of the project
cd public/
- Run install command. This will prepare the database, copy the .env file and install all dependencies with composer
make install
- Start PHP´s internal server.
php -S localhost:8000
You don't have to create a database on your own. If you run the command make install
the database will be created with all needed tables and columns. If there is something wrong with your database please run the command make install-database
1 to reinstall again.
1 you will lose all data stored in your database