Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit fec6bda

Browse files
committed
Merge pull request #144 from midasplatform/5.3-compatibility
Restore 5.3 compatibility as much as possible
2 parents 3ee613c + e852490 commit fec6bda

10 files changed

Lines changed: 104 additions & 80 deletions

File tree

.codeclimate.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ engines:
3333
enabled: true
3434

3535
exclude_paths:
36-
- "core/public/js/jquery/*"
37-
- "data/*"
38-
- "docs/*"
39-
- "library/REST/*"
40-
- "library/SwaggerUI/*"
41-
- "log/*"
42-
- "modules/oai/library/oai/*"
43-
- "modules/statistics/public/js/googlemaps/*"
44-
- "modules/statistics/public/js/jquery/*"
45-
- "modules/visualize/public/js/jquery/*"
46-
- "modules/visualize/public/js/webgl/*"
47-
- "provisioning/*"
48-
- "tmp/*"
49-
- "utils/*"
50-
- "vendor/*"
36+
- 'core/public/js/jquery/*'
37+
- 'data/*'
38+
- 'docs/*'
39+
- 'library/REST/*'
40+
- 'library/SwaggerUI/*'
41+
- 'log/*'
42+
- 'modules/oai/library/oai/*'
43+
- 'modules/statistics/public/js/googlemaps/*'
44+
- 'modules/statistics/public/js/jquery/*'
45+
- 'modules/visualize/public/js/jquery/*'
46+
- 'modules/visualize/public/js/webgl/*'
47+
- 'provisioning/*'
48+
- 'tmp/*'
49+
- 'utils/*'
50+
- 'vendor/*'

.eslintrc

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,31 @@
1818
#=============================================================================
1919

2020
---
21+
root: true
22+
23+
env:
24+
browser: true
25+
jquery: true
26+
27+
extends: 'eslint:recommended'
28+
2129
rules:
2230
indent:
2331
- 2
2432
- 4
25-
quotes:
26-
- 2
27-
- single
33+
2834
linebreak-style:
2935
- 2
3036
- unix
31-
semi:
32-
- 2
33-
- always
3437

3538
no-unused-vars:
3639
- 2
3740
- argsIgnorePattern: ^_
3841

39-
env:
40-
browser: true
41-
jquery: true
42+
quotes:
43+
- 2
44+
- single
4245

43-
extends: 'eslint:recommended'
46+
semi:
47+
- 2
48+
- always

.styleci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ disabled:
2929
- phpdoc_types
3030
- phpdoc_var_without_name
3131

32-
3332
finder:
3433
exclude:
3534
- data

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ language: php
2323
sudo: false
2424

2525
php:
26+
- 5.3
2627
- 5.4
2728
- 5.5
2829
- 5.6
@@ -42,6 +43,7 @@ cache:
4243
before_install:
4344
- travis_retry composer self-update -n
4445
- if [[ $TRAVIS_PULL_REQUEST = false ]]; then composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN; fi
46+
- if [[ $TRAVIS_PHP_VERSION = 5.3 ]]; then sed -i '/uuid-console/d' composer.json; fi
4547
- if [[ $TRAVIS_PHP_VERSION = hhvm || $TRAVIS_PHP_VERSION = 7 ]]; then sed -i '/ext-xdebug/d' composer.json; fi
4648

4749
install:

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,25 @@ interface with existing workflows.
2727

2828
## Installation ##
2929

30-
```
30+
```bash
3131
git clone https://github.com/midasplatform/Midas.git midas
3232
cd midas
3333
chmod a+w core/configs/ data/ log/ tmp/
3434
curl -sS https://getcomposer.org/installer | php
35+
```
36+
37+
For development (PHP version 5.4.0 or above):
38+
39+
```bash
3540
php composer.phar install
3641
```
3742

43+
For production (PHP version 5.3.9 or above):
44+
45+
```bash
46+
php composer.phar install --no-dev --optimize-autoloader
47+
```
48+
3849
Full installation documentation is available at
3950

4051
<https://midas-server.readthedocs.org/>

app.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ api_version: 1
2626
threadsafe: yes
2727

2828
handlers:
29-
- url: /(apple-touch-icon-.*\.png)$
30-
static_files: \1
31-
upload: apple-touch-icon-.*\.png$
32-
secure: always
29+
- url: /(apple-touch-icon-.*\.png)$
30+
static_files: \1
31+
upload: apple-touch-icon-.*\.png$
32+
secure: always
3333

34-
- url: /favicon\.ico$
35-
static_files: favicon.ico
36-
upload: favicon\.ico$
37-
secure: always
34+
- url: /favicon\.ico$
35+
static_files: favicon.ico
36+
upload: favicon\.ico$
37+
secure: always
3838

39-
- url: /(.*/(public|SwaggerUI)/.*\.(css|gif|ico|jpeg|jpg|js|map|png))$
40-
static_files: \1
41-
upload: .*\.(css|gif|ico|jpeg|jpg|js|map|png)$
42-
secure: always
39+
- url: /(.*/(public|SwaggerUI)/.*\.(css|gif|ico|jpeg|jpg|js|map|png))$
40+
static_files: \1
41+
upload: .*\.(css|gif|ico|jpeg|jpg|js|map|png)$
42+
secure: always
4343

44-
# Must enable the task scheduler module. The cron job is defined in cron.yaml.
45-
- url: /scheduler/run
46-
script: index.php
47-
login: admin
48-
secure: always
44+
# Must enable the task scheduler module. The cron job is defined in cron.yaml.
45+
- url: /scheduler/run
46+
script: index.php
47+
login: admin
48+
secure: always
4949

50-
- url: /.*
51-
script: index.php
52-
secure: always
50+
- url: /.*
51+
script: index.php
52+
secure: always
5353

5454
# Update with the bucket name and the project id. Also update php.ini with the bucket name.
5555
env_variables:
@@ -59,10 +59,10 @@ env_variables:
5959
midas_temp_path: gs://your-cloudstorage-bucket/tmp
6060

6161
skip_files:
62-
- ^(.*/)?.*/(\.DS_Store|\.htaccess|\.gitignore|CMakeLists\.txt|.*\.java)$
63-
- ^(.*/)?.*/\.sass-cache/.*
64-
- ^(.*/)?(\.codeclimate\.yml|\.coveralls\.yml|\.editorconfig|\.php_cs|\.php_cs\.cache|\.styleci\.yml|\.travis\.yml|AUTHORS|bower\.json|composer\.json|composer\.lock|composer\.phar|COPYRIGHT|CTestConfig\.cmake|LICENSE|mkdocs\.yml|phpunit\.xml\.dist|README\.md|requirements\.txt|Vagrantfile)$
65-
- ^(.*/)?core/configs/.*\.local\.ini$
66-
- ^(.*/)?(\.git|\.idea|\.vagrant|data|docs|env|log|provisioning|site|tests|tmp|utils)/.*
67-
- ^(.*/)?(core|modules/.*)/(database/(pgsql|sqlite)|tests)/.*
68-
- ^(.*/)?modules/(archive|batchmake|dicom.*|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.*
62+
- ^(.*/)?.*/(\.DS_Store|\.htaccess|\.gitignore|CMakeLists\.txt|.*\.java)$
63+
- ^(.*/)?.*/\.sass-cache/.*
64+
- ^(.*/)?(\.codeclimate\.yml|\.coveralls\.yml|\.editorconfig|\.php_cs|\.php_cs\.cache|\.styleci\.yml|\.travis\.yml|AUTHORS|bower\.json|composer\.json|composer\.lock|composer\.phar|COPYRIGHT|CTestConfig\.cmake|LICENSE|mkdocs\.yml|phpunit\.xml\.dist|README\.md|requirements\.txt|Vagrantfile)$
65+
- ^(.*/)?core/configs/.*\.local\.ini$
66+
- ^(.*/)?(\.git|\.idea|\.vagrant|data|docs|env|log|provisioning|site|tests|tmp|utils)/.*
67+
- ^(.*/)?(core|modules/.*)/(database/(pgsql|sqlite)|tests)/.*
68+
- ^(.*/)?modules/(archive|batchmake|dicom.*|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.*

composer.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@
1111
"source": "https://github.com/midasplatform/Midas"
1212
},
1313
"require": {
14-
"php": ">=5.3.23",
14+
"php": ">=5.3.9",
1515
"ext-gd": "*",
1616
"ext-json": "*",
17-
"erusev/parsedown-extra": "~0.7",
17+
"erusev/parsedown-extra": "^0.7.0",
1818
"francodacosta/phmagick": "0.4.*@dev",
19-
"google/apiclient": "~1.1",
20-
"intervention/image": "~2.3",
21-
"ircmaxell/random-lib": "~1.1",
22-
"maennchen/zipstream-php": "~0.3",
23-
"moontoast/math": "~1.1",
24-
"ramsey/uuid": "~3.0",
25-
"reprovinci/solr-php-client": "~1.0",
26-
"sendgrid/sendgrid": "~3.2",
27-
"zendframework/zendframework1": "~1.12"
19+
"google/apiclient": "^1.1.5",
20+
"intervention/image": "^2.2.2",
21+
"ircmaxell/random-lib": "^1.1.0",
22+
"maennchen/zipstream-php": "^0.3.0",
23+
"moontoast/math": "^1.1.0",
24+
"ramsey/uuid": ">=2.8.3 <4.0",
25+
"reprovinci/solr-php-client": "^1.0.3",
26+
"sendgrid/sendgrid": "^4.0.0",
27+
"zendframework/zendframework1": "^1.12.16"
2828
},
2929
"require-dev": {
3030
"ext-xdebug": "*",
31-
"fabpot/php-cs-fixer": "~1.10",
32-
"jokkedk/zfdebug": "~1.6",
33-
"leafo/scssphp": "~0.3",
31+
"fabpot/php-cs-fixer": "^1.10.2",
32+
"jokkedk/zfdebug": "^1.6.2",
33+
"leafo/scssphp": "^0.3.2",
3434
"phpcheckstyle/phpcheckstyle": "V0.14.1",
35-
"phpunit/dbunit": "~1.4",
36-
"phpunit/phpcov": "~2.0",
37-
"phpunit/phpunit": "~4.8",
38-
"ramsey/uuid-console": "~1.0",
39-
"satooshi/php-coveralls": "~0.6",
40-
"sensiolabs/security-checker": "~3.0",
41-
"symfony/console": "~2.7"
35+
"phpunit/dbunit": "^1.4.1",
36+
"phpunit/phpcov": "^2.0.2",
37+
"phpunit/phpunit": "^4.8.16",
38+
"ramsey/uuid-console": "^1.0.0",
39+
"satooshi/php-coveralls": "^0.6.1",
40+
"sensiolabs/security-checker": "^3.0.1",
41+
"symfony/console": "^2.7.5"
4242
},
4343
"suggest": {
4444
"ext-fileinfo": "*",

core/controllers/components/UuidComponent.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ class UuidComponent extends AppComponent
2828
*/
2929
public function generate()
3030
{
31-
return str_replace('-', '', \Ramsey\Uuid\Uuid::uuid4()->toString());
31+
if (class_exists('\Ramsey\Uuid\Uuid')) {
32+
$uuid = \Ramsey\Uuid\Uuid::uuid4();
33+
} else {
34+
$uuid = \Rhumsaa\Uuid\Uuid::uuid4();
35+
}
36+
37+
return str_replace('-', '', $uuid->toString());
3238
}
3339

3440
/**

cron.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
---
2121
# Must enable the task scheduler module.
2222
cron:
23-
- description: task scheduler job
24-
url: /scheduler/run
25-
schedule: every 12 minutes
23+
- description: task scheduler job
24+
url: /scheduler/run
25+
schedule: every 12 minutes

modules/javauploaddownload/controllers/UploadController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ public function gethttpuploadoffsetAction()
225225
$this->disableLayout();
226226
$this->disableView();
227227
$params = $this->getAllParams();
228-
$userId = explode('/', $params['uploadUniqueIdentifier'])[0];
228+
$userIds = explode('/', $params['uploadUniqueIdentifier']);
229+
$userId = $userIds[0];
229230

230231
if ($userId != $this->userSession->Dao->getUserId()) {
231232
echo '[ERROR]User id does not match upload token user id';

0 commit comments

Comments
 (0)