Coding Challenge for Ecancer
To setup this code base you will need to:
- checkout the develop branch
- install the composer dependencies
- setup your database credentials for migrations
- this should be setup in the phinx.yml file
- setup your database credentials for the app/website
- this will be in site/ini/database.ini
- ensure write permissions set on site/cache/
- this should be 777 - chmod -R 777 site/cache
- create your blank/empty database
- the system won't create it for you!
- run the migrations
- we use phinx to keep our databases in-sync
- setup a virtual host in Apache
- you will need AllowOverride All on to allow our .htaccess rules to take effect
- add the new domain name in to your /etc/hosts file
- you will need to sudo to do this - sudo vim /etc/hosts
This challenge is based upon elements of the legacy codebase you will be working on from time to time.
The framework itself is quite big and complicated so we have only ported over a few of the bare essential classes.
We will be looking to see your approach to solving the problems and how confident you are working with the PHP code.
Ideally you should try and work within the constraints of the existing codebase and framework. But we are open-minded to other solutions and libraries that may compliment what we have already.
Majority of the logic should live in the includes/ directory.
From the includes/ directory you should see:
- a core/ directory - this contains the core framework
- a site-core/ directory - this contains your classes and user classes
In the migrations/ directory we have loaded in our test data using the phinx library. This library can be fetched using composer.
All configuration should live in the site/ini/ directory. You will need to add your database credentials to the site/ini/database.ini file - under the development heading.
The site/ directory also contains images and cache folders. The video thumbnails are in the site/cache/development/images/ directory. You will need to give write permissions to the site/cache/ directory.
All view/template logic should live in the includes/site-core/display/ directory. These templates should get called from their controller.
As we said this is a legacy codebase, and we've tried to port across the bare essentials of the codebase.
If you receive lots of debug messages or error messages and you are sure your code is working, you can disable the custom error handler by setting Debug = 0 in site/ini/debug.ini.
If you do fix any bugs please let us know what you've fixed.
Make modifications to the existing Videos homepage.
Order the Videos in the table by the PublicationDate column.
See: includes/site-core/classes/controllers/class_controller_videos.php
Use your own judgement and add more Video data from the database to the HTML table on the Video Homepage.
Create a new Video Gallery page that displays 5 of the most recent video's thumbnails.
To do this you will need to use the siteVideoToImage link table, this database query is already coded for you.
To create the thumbnail you'll need to look at the clsImage class. You should use the funFetch method.
We don't mind how we get your code...
- If you forked this repository you can send in a pull-request on github.
- If we've sent you this challenge as a Zip file or directly:
- you can send it back to us as a Zip via email.
- you can send us a dropbox link.
If emailing your code please email technical@goramandvincent.com.