ubc / examdb
Exam Database
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 11
Forks: 0
Open Issues: 2
Type:project
Requires
- php: >=5.4
- doctrine/cache: <1.6
- doctrine/common: <2.6
- doctrine/doctrine-bundle: 1.6.*
- doctrine/doctrine-cache-bundle: ~1.3
- doctrine/orm: ~2.4
- egeloen/lucene-search-bundle: ~2.0
- elao/web-profiler-extra-bundle: ~2.3
- gorg/cas-bundle: dev-auth-provider
- incenteev/composer-parameter-handler: ~2.0
- knplabs/knp-paginator-bundle: ~2.4@dev
- lexik/form-filter-bundle: ~4.0
- pagerfanta/pagerfanta: ~1.0
- sensio/buzz-bundle: ~1.1
- sensio/distribution-bundle: ~3.0
- sensio/framework-extra-bundle: ~3.0
- sensio/generator-bundle: ~2.5
- snc/redis-bundle: ~1.1
- stof/doctrine-extensions-bundle: 1.1.*
- symfony/assetic-bundle: 2.8.*
- symfony/css-selector: 2.8.*
- symfony/dom-crawler: 2.8.*
- symfony/monolog-bundle: ~2.8
- symfony/swiftmailer-bundle: 2.3.*
- symfony/symfony: 2.8.*
- twig/extensions: 1.3.*
- ubc/ltcommons-bundle: ~0.1.1
- zendframework/zend-cache: <2.5.2
- zendframework/zend-config: <2.6
- zendframework/zend-eventmanager: <2.5.2
- zendframework/zend-json: <2.5.2
- zendframework/zend-math: <2.5.2
- zendframework/zend-serializer: <2.6
- zendframework/zend-servicemanager: <2.6
- zendframework/zend-stdlib: <2.5.2
- zendframework/zendsearch: ~2.0
Requires (Dev)
- doctrine/data-fixtures: ~1.0
- h4cc/alice-fixtures-bundle: dev-master
- liip/functional-test-bundle: ~1.0@dev
- m6web/symfony2-coding-standard: ~1.1
- mikey179/vfsstream: ~1.4
- pdepend/pdepend: 1.1.*
- phing/phing: 2.*
- phpdocumentor/phpdocumentor: dev-master
- phpmd/phpmd: 1.*
- phpunit/phpunit: 4.5.*
- sebastian/phpcpd: *
- squizlabs/php_codesniffer: 1.5.*
- symfony/phpunit-bridge: ~3.0
- ubc/ctlt-coding-standard: 1.0
This package is not auto-updated.
Last update: 2021-08-07 00:42:29 UTC
README
Running in 5 mins
-
Register an account on Openshift.
-
Install CLI
-
Provision the application by running the following command:
rhc app create examdb php-5.4 mysql-5.5 phpmyadmin-4 --from-code=https://github.com/ubc/examdb.git
-
Setup custom parameters by custom environment variable: (for full list of available env variables, see app/config/params.php)s
rhc env set auth2_username=service_username auth2_password=service_password auth2_service_application=service_app -a examdb
-
Open the browser and enter the URL printed from the result of above command.
Detailed Version
1) Provision the Application
Provision a php application (phpmyadmin-4 is optional)
rhc app create examdb php-5.4 mysql-5.5 phpmyadmin-4 --from-code=https://github.com/ubc/examdb.git
Once the application is created, Openshift will give out the URL of the app, SSH address and git repo. Those information can be obtained by running the following command as well:
rhc app show examdb
The database parameters are setup in app/config/params.php, which is imported by app/config/config.yml.
2) Checking your System Configuration
Execute the check.php
script from the command line:
ssh OPENSHIFT_SSH_ADDRESS
cd $OPENSHIFT_REPO_DIR
php app/check.php
The script returns a status code of 0
if all mandatory requirements are met,
1
otherwise.
To access the config.php
script from a browser, a ssh tunnel has to be created
as config.php is only accessible from localhost
rhc port-forward
Then open the URL from the browser:
http://your_openshift_domain/config.php
If you get any warnings or recommendations, fix them before moving on.
3) To access other component directly
If mysql or other database is installed and you want to access it directly. E.g. using MySQLBench or other tools. You can use the port forward mentioned above.
rhc port-forward
The port will be forwarded to localhost and you can setup your tool to connect to localhost.
Development
Installation
-
Install Vagrant The project environment can be provision by Vagrant. Follow the instruction on the site to install vagrant first. Then install vagrant-hostmanager plugin if you want vagrant to manage your /etc/hosts for you.
vagrant plugin install vagrant-hostmanager vagrant plugin install vagrant-bindfs
Otherwise, you will need to manually add the following line to your /etc/hosts
127.0.0.1 examdb.dev
-
Checkout the Source
git clone git@github.com:ubc/examdb.git
-
Setup the Dev VM
cd examdb && vagrant up
-
Open a browser from host
http://examdb.dev:8089/app_dev.php
-
Develop!
Running Tests
bin/phing test
NOTES
-
Default username and password are both "admin"
-
When testing student features, the student user puid should be 12345678, which is the ID used in app/fixtures data for local SIS data repository
-
The test fixture contains two sections: MATH 101 and ENGL 100
-
Update dependencies: it may run into memory limits when running
composer update
, so use the following command:php -d memory_limit=-1 /path/to/composer update
-
to see changes if on production environment, then you'll need to run a few commands in console to see the changes (aka move from src folder to web folder)
php app/console cache:clear --env=prod
-
Default authentication for production is CAS and for development is internal login. To make the system work standalone (aka skipping out using CAS), you'll need to make a few changes:
- modify app/config/config_prod.yml and change security_cas.yml to security_internal.yml
-
To create a user from command line:
vagrant ssh cd /vagrant php app/console exam:user:create USERNAME PASSWORD ROLE_ADMIN
-
If there is an existing exam database, the search index has to be rebuild in order for search to function.
vagrant ssh cd /vagrant php app/console exam:index:build
-
Upgrade notes:
sudo su app cd /www_data/app git pull chmod 775 app/data/uploads app/data/uploads/documents