Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Bug #7, PHP-lint and travis-ci fixes [iet:10993886]
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed Jan 2, 2019
1 parent cd6da7e commit 93a0e68
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# .gitignore

composer.phar
composer.lock
/vendor/*
/node_modules/*

/framework/tables.sql
/site/config/config.php
Expand All @@ -20,4 +22,4 @@ composer.lock

._git

#End.
# End.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# see http://about.travis-ci.org/docs/user/languages/php/
language: php
php:
#- 5.5
- 5.6
#- 7.0
#- 5.6
- 7.1
#- hhvm

git:
depth: 3

before_install:
- composer self-update
- composer --version
#- composer self-update
#- composer --version

install:
- composer install
Expand All @@ -24,7 +23,9 @@ script:
- composer lint
- ./vendor/bin/phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php index.php

after_script: composer test

notifications:
#- [email protected]

#End.
# End.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"source": "https://github.com/IET-OU/jisc-workload"
},
"require": {
"php": ">=5.4.0"
"php": ">= 5.6.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.5",
Expand All @@ -30,7 +30,7 @@
"cp -n site/config/config.DIST.php site/config/config.php"
],
"lint": [
"./vendor/bin/parallel-lint --exclude vendor ."
"parallel-lint --exclude vendor ."
],
"test": [
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php framework/base/CController.*",
Expand Down
12 changes: 10 additions & 2 deletions framework/controllers/CCourseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ function actionView() {
}
else {
$faculties = CFacultyModel::loadByAttributes(array('deleted'=>null,'institutionId'=>$this->application->user->institutionId))->getObjectArray();
if(count($faculties) > 0) $courses = CCourseModel::loadByAttributes(array('deleted'=>null,'facultyId'=>array('in',array_keys($faculties)),array('order by'=>'`created` desc'))->getObjectArray();
else $courses = array();

if(count($faculties) > 0) {
$courses = CCourseModel::loadByAttributes(array(
'deleted' => null,
'facultyId' => array('in', array_keys($faculties)),
array('order by' => '`created` desc')
))->getObjectArray();
} else {
$courses = array();
}
}
$this->attachViewToRegion('main','course','view',array('courses'=>$courses));
$this->render();
Expand Down
2 changes: 1 addition & 1 deletion framework/views/default/googleAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', <?php echo json_encode($analyticsId) ?>, 'auto');
ga('send', 'pageview');
Expand Down

0 comments on commit 93a0e68

Please sign in to comment.