Skip to content

Commit

Permalink
Bug SAFeSEA#34/SAFeSEA#35, fixed respect/validation PHP dependency …
Browse files Browse the repository at this point in the history
…[iet:10301360]

* Minor re-format of Travis-CI YAML; README edits; Apache conf [iet:10302190]
  • Loading branch information
nfreear committed Feb 12, 2018
1 parent 9ea17ba commit dfe0721
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 129 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extras/documentation
*.sql.zip
composer.phar

.gitattributes
.editorconfig
node_modules/
package-lock.json
Expand Down
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ php: 7.0
git:
depth: 5

before_install:
- nvm install v8.1
- npm -v
before_install: nvm install v8.1

install:
- composer prepare
Expand All @@ -24,6 +22,6 @@ after_script:
- composer validate
- ls -alh
- ls -alh public_html/assets/
- git status
#- git status

# End.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Web frontend to the essay analyser and summariser — [pyEssayAnalyser][py].

Part of the [SafeSEA][] project.
(Grants: _[Open University][ou-grant], [Oxford University][ox-grant]_.)
(_Research [papers on ORO][oro-ss]._)
(_Research [papers on ORO][oro-ss]. [YouTube demo][yt-demo]_)

Built on [Slim PHP framework][slim].

Expand Down Expand Up @@ -45,7 +45,7 @@ composer test

## Database

To create and seed the MySQL database [tables][db], start typing:
To create and seed the [MySQL database tables][db], start typing:

```sh
composer cli-help
Expand Down Expand Up @@ -91,6 +91,8 @@ app/cli.php --create-tables

[safesea]: http://www.open.ac.uk/researchprojects/safesea/
"Supportive Automated Feedback for Short Essay Answers (SAFeSEA)."
[yt-demo]: https://youtu.be/7a3ATQPjpiM# "openEssayist Software Tool Demonstration, @ietou on YouTube"
[yt-intro]: https://youtu.be/a9l0ts1tgK4# "Introduction to openEssayist - Professor Denise Whitelock, @ietou on YouTube"
[oro-ss]: http://oro.open.ac.uk/cgi/search/archive/advanced?project_details_project_name=SafeSEA "'SafeSEA' on ORO (10 results)"
[oro-oe]: http://oro.open.ac.uk/cgi/search/archive/simple?meta=OpenEssayist& "'OpenEssayist' on ORO (8 results)"
[ou-grant]: http://gow.epsrc.ac.uk/NGBOViewGrant.aspx?GrantRef=EP/J005959/1
Expand Down
1 change: 1 addition & 0 deletions app/_data/openessayist.open.ac.uk-apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Legacy: SetHandler application/x-httpd-php
</FilesMatch>

ServerTokens Prod
NameVirtualHost *:80

<VirtualHost *:80>
Expand Down
11 changes: 6 additions & 5 deletions app/controllers/login.controller.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
/**
* OpenEssayist-slim.
* Login controller.
*
* @package OpenEssayist-slim
* @copyright © 2013-2018 The Open University. (Institute of Educational Technology)
*/

use Respect\Validation\Validator as v;
use Respect\Validation\Validator; // as v;
use IET_OU\SamsCAuth\SamsCAuth;

/**
Expand Down Expand Up @@ -98,15 +99,15 @@ public function index()

/*if ($this->app->request()->isPost()) {
try {
$usernameValidator = v::alnum()
$usernameValidator = Validator::alnum()
->noWhitespace()
->notEmpty();
//->length(4,22);
$usernameValidator->check($this->post('username'));
try {
v::alnum()
Validator::alnum()
->notEmpty()
//->length(3,11)
->check($this->post('password'));
Expand Down Expand Up @@ -281,7 +282,7 @@ protected static function getCurrentUrl()
}

/**
* Record each time a user sign in.
* Record each time a user signs in.
* @param object|int $user_id User model object, or user ID.
*/
protected function recordVisit($user_id)
Expand Down
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "iet-ou/openessayist-slim",
"description": "Web frontend to the essay analyser & summariser (pyEssayAnalyser). SafeSEA project. © 2013-2018 The Open University (IET). All rights reserved.",
"keywords": [ "SafeSEA", "EPSRC", "IET-OU", "OpenUniversity" ],
"keywords": [ "SafeSEA", "essay-analyser", "EPSRC", "IET-OU", "OpenUniversity" ],
"homepage": "http://www.open.ac.uk/researchprojects/safesea/",
"time": "2013-02-08",
"license": "proprietary",
"support": {
"source": "https://github.com/SAFeSEA/openEssayist-slim",
"source": "https://github.com/SAFeSEA/openEssayist-slim.git",
"email": "[email protected]"
},
"authors": [
Expand All @@ -19,7 +19,7 @@
"minimum-stability": "dev",
"autoload": { },
"repositories": [
{ "type": "composer", "url": "https://embed.open.ac.uk/iet-satis/" }
{ "type": "composer", "url": "https://embed.open.ac.uk/iet-satis/" }
],
"require": {
"php": ">=5.5.9",
Expand All @@ -29,7 +29,7 @@
"twig/twig": "1.35.*",
"j4mie/paris": "^1.5.6",
"j4mie/idiorm": "^1.5.5",
"respect/validation": "dev-develop",
"respect/validation": "^1.1.15",
"rmccue/requests": "^1.7.0",
"nfreear/composer-suggest": "^1.2"
},
Expand All @@ -41,11 +41,12 @@
"ext-zip": "*",
"ext-mycrypt": "*",
"iet-ou/sams-c-auth": "1.0.*-dev; ou-sams",
"respect/validation": "dev-develop#06224c04369e",
"slim/extras": "dev-develop#5bceb36"
},
"scripts": {
"cli-help": "app/cli.php --help",
"redhat-install": "yum install php php-mcrypt php-zip patch httpd mod_fcgid # No -y",
"redhat-install": "yum install php php-mcrypt php-zip patch nodejs httpd mod_fcgid # No -y",
"redhat-check": "yum install php* 2>/dev/null | grep 'already installed'",
"npm-install": "npm i",
"prepare": [
Expand All @@ -58,7 +59,8 @@
"chown": [ "chown -R nginx:nginx ./.cache", "chown -R nginx:nginx ./.logs" ],
"symlink-data": [ "cd public_html; ln -s ../_user_data/images user-images" ],
"_X_NO_patch": "patch -ub --verbose vendor/slim/extras/Slim/Extras/Views/Twig.php app/_data/vendor-slim-extras-Views-Twig-php--render-function.diff",
"copy-nginx": "cp -n app/_data/openessayist.open.ac.uk-nginx.conf /etc/nginx/sites-available/openessayist.open.ac.uk",
"copy-apache": "cp -n app/_data/openessayist.open.ac.uk-apache.conf /etc/httpd/conf.d/openessayist.open.ac.uk",
"copy-nginx": "cp -n app/_data/openessayist.open.ac.uk-nginx.conf /etc/nginx/sites-available/openessayist.open.ac.uk # Legacy.",
"copy-conf": "cp -n app/config.DIST.php app/config.php",
"copy-dotenv": "cp -n .env.DIST .env",
"_X_pip-install": "pip install git+https://github.com/google/mysql-tools.git@02d1854273#egg=mysql-tools",
Expand Down
Loading

0 comments on commit dfe0721

Please sign in to comment.