- Note to lecturer
- Øivind's original readme
- Link to project description
Project should be running on http://tyk-www-project1.yngvehestem.no/ (which points to http://188.166.44.12/) in docker containers with auto-deployment capabilities.(Turned off)
- Yngve Hestem
- Kristian Sigtbakken Holm
- Thomas Løkkeborg
-
Place this repository a place where your webserver can see it (htdocs for example)
-
Run
composer install
to install dependencies of project-
To install composer:
sudo apt update sudo apt install composer sudo apt install php7.0-mbstring sudo apt install php7.0-xml
-
-
Add a
config.php
file to the root directory of the project. It is used to provide environment-dependant constants. It should look like the fileconfig_example.php
in docs. One way to make it is to run the commandcp docs/config_example.php config.php
. Alter theconfig.php
file to fit your environment. -
Configure your apache2 php.ini config file to reflect the sizes in
src/constants.php
. -
Import the contents of
docs/export_lowercase.sql
into two new databases, one for production and one for testing. (calledimt2291_project1_db
andimt2291_project1_test
for example) -
The project needs write access to the
uploadedFiles
directory.- Linux / Mac OS:
chown -R <apache2-user> uploadedFiles
. (In lampp the user isdaemon
| apache2 default user is www-data) - Windows: Dunno. Google it
- Linux / Mac OS:
- Do the steps above (the first step is unnecessary).
- The project also needs write access to the
db_data
directory. This is where the database will end up. - You need to have
docker
anddocker-compose
installed. docker-compose up -d
should now build and run the service. Checkdocker-compose.yml
file for details.- You need to import the database somehow.. this is not automatic.
docker exec -it <name-of-db-container> bash
while the service is running and adding it manually is one alternative. (fromdocs/export_lowercase.sql
)
Tests are placed under tests/
. Run all tests with ./vendor/bin/phpunit tests
. (Note that all tests except tests/FunctionalTest.php
are unit tests)
Documentation is found under docs/
in the root of the repository. You'll find a collection of documents we used during development of this site.
- All db connections should go through DB.php
- We write sql in the relevant classes (User-related sql inside UserManager.php etc.)
- Code should be tested and have
/**
-style comments where relevant - File issues before embarking on larger tasks
- Make one branch per issue you're working on (Unless it's a tiny issue)