Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ engines:
enabled: true

exclude_paths:
- "core/public/js/jquery/*"
- "data/*"
- "docs/*"
- "library/REST/*"
- "library/SwaggerUI/*"
- "log/*"
- "modules/oai/library/oai/*"
- "modules/statistics/public/js/googlemaps/*"
- "modules/statistics/public/js/jquery/*"
- "modules/visualize/public/js/jquery/*"
- "modules/visualize/public/js/webgl/*"
- "provisioning/*"
- "tmp/*"
- "utils/*"
- "vendor/*"
- 'core/public/js/jquery/*'
- 'data/*'
- 'docs/*'
- 'library/REST/*'
- 'library/SwaggerUI/*'
- 'log/*'
- 'modules/oai/library/oai/*'
- 'modules/statistics/public/js/googlemaps/*'
- 'modules/statistics/public/js/jquery/*'
- 'modules/visualize/public/js/jquery/*'
- 'modules/visualize/public/js/webgl/*'
- 'provisioning/*'
- 'tmp/*'
- 'utils/*'
- 'vendor/*'
25 changes: 15 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,31 @@
#=============================================================================

---
root: true

env:
browser: true
jquery: true

extends: 'eslint:recommended'

rules:
indent:
- 2
- 4
quotes:
- 2
- single

linebreak-style:
- 2
- unix
semi:
- 2
- always

no-unused-vars:
- 2
- argsIgnorePattern: ^_

env:
browser: true
jquery: true
quotes:
- 2
- single

extends: 'eslint:recommended'
semi:
- 2
- always
1 change: 0 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ disabled:
- phpdoc_types
- phpdoc_var_without_name


finder:
exclude:
- data
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ language: php
sudo: false

php:
- 5.3
- 5.4
- 5.5
- 5.6
Expand All @@ -42,6 +43,7 @@ cache:
before_install:
- travis_retry composer self-update -n
- if [[ $TRAVIS_PULL_REQUEST = false ]]; then composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN; fi
- if [[ $TRAVIS_PHP_VERSION = 5.3 ]]; then sed -i '/uuid-console/d' composer.json; fi
- if [[ $TRAVIS_PHP_VERSION = hhvm || $TRAVIS_PHP_VERSION = 7 ]]; then sed -i '/ext-xdebug/d' composer.json; fi

install:
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,25 @@ interface with existing workflows.

## Installation ##

```
```bash
git clone https://github.com/midasplatform/Midas.git midas
cd midas
chmod a+w core/configs/ data/ log/ tmp/
curl -sS https://getcomposer.org/installer | php
```

For development (PHP version 5.4.0 or above):

```bash
php composer.phar install
```

For production (PHP version 5.3.9 or above):

```bash
php composer.phar install --no-dev --optimize-autoloader
```

Full installation documentation is available at

<https://midas-server.readthedocs.org/>
Expand Down
54 changes: 27 additions & 27 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ api_version: 1
threadsafe: yes

handlers:
- url: /(apple-touch-icon-.*\.png)$
static_files: \1
upload: apple-touch-icon-.*\.png$
secure: always
- url: /(apple-touch-icon-.*\.png)$
static_files: \1
upload: apple-touch-icon-.*\.png$
secure: always

- url: /favicon\.ico$
static_files: favicon.ico
upload: favicon\.ico$
secure: always
- url: /favicon\.ico$
static_files: favicon.ico
upload: favicon\.ico$
secure: always

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

# Must enable the task scheduler module. The cron job is defined in cron.yaml.
- url: /scheduler/run
script: index.php
login: admin
secure: always
# Must enable the task scheduler module. The cron job is defined in cron.yaml.
- url: /scheduler/run
script: index.php
login: admin
secure: always

- url: /.*
script: index.php
secure: always
- url: /.*
script: index.php
secure: always

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

skip_files:
- ^(.*/)?.*/(\.DS_Store|\.htaccess|\.gitignore|CMakeLists\.txt|.*\.java)$
- ^(.*/)?.*/\.sass-cache/.*
- ^(.*/)?(\.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)$
- ^(.*/)?core/configs/.*\.local\.ini$
- ^(.*/)?(\.git|\.idea|\.vagrant|data|docs|env|log|provisioning|site|tests|tmp|utils)/.*
- ^(.*/)?(core|modules/.*)/(database/(pgsql|sqlite)|tests)/.*
- ^(.*/)?modules/(archive|batchmake|dicom.*|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.*
- ^(.*/)?.*/(\.DS_Store|\.htaccess|\.gitignore|CMakeLists\.txt|.*\.java)$
- ^(.*/)?.*/\.sass-cache/.*
- ^(.*/)?(\.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)$
- ^(.*/)?core/configs/.*\.local\.ini$
- ^(.*/)?(\.git|\.idea|\.vagrant|data|docs|env|log|provisioning|site|tests|tmp|utils)/.*
- ^(.*/)?(core|modules/.*)/(database/(pgsql|sqlite)|tests)/.*
- ^(.*/)?modules/(archive|batchmake|dicom.*|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.*
42 changes: 21 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@
"source": "https://github.com/midasplatform/Midas"
},
"require": {
"php": ">=5.3.23",
"php": ">=5.3.9",
"ext-gd": "*",
"ext-json": "*",
"erusev/parsedown-extra": "~0.7",
"erusev/parsedown-extra": "^0.7.0",
"francodacosta/phmagick": "0.4.*@dev",
"google/apiclient": "~1.1",
"intervention/image": "~2.3",
"ircmaxell/random-lib": "~1.1",
"maennchen/zipstream-php": "~0.3",
"moontoast/math": "~1.1",
"ramsey/uuid": "~3.0",
"reprovinci/solr-php-client": "~1.0",
"sendgrid/sendgrid": "~3.2",
"zendframework/zendframework1": "~1.12"
"google/apiclient": "^1.1.5",
"intervention/image": "^2.2.2",
"ircmaxell/random-lib": "^1.1.0",
"maennchen/zipstream-php": "^0.3.0",
"moontoast/math": "^1.1.0",
"ramsey/uuid": ">=2.8.3 <4.0",
"reprovinci/solr-php-client": "^1.0.3",
"sendgrid/sendgrid": "^4.0.0",
"zendframework/zendframework1": "^1.12.16"
},
"require-dev": {
"ext-xdebug": "*",
"fabpot/php-cs-fixer": "~1.10",
"jokkedk/zfdebug": "~1.6",
"leafo/scssphp": "~0.3",
"fabpot/php-cs-fixer": "^1.10.2",
"jokkedk/zfdebug": "^1.6.2",
"leafo/scssphp": "^0.3.2",
"phpcheckstyle/phpcheckstyle": "V0.14.1",
"phpunit/dbunit": "~1.4",
"phpunit/phpcov": "~2.0",
"phpunit/phpunit": "~4.8",
"ramsey/uuid-console": "~1.0",
"satooshi/php-coveralls": "~0.6",
"sensiolabs/security-checker": "~3.0",
"symfony/console": "~2.7"
"phpunit/dbunit": "^1.4.1",
"phpunit/phpcov": "^2.0.2",
"phpunit/phpunit": "^4.8.16",
"ramsey/uuid-console": "^1.0.0",
"satooshi/php-coveralls": "^0.6.1",
"sensiolabs/security-checker": "^3.0.1",
"symfony/console": "^2.7.5"
},
"suggest": {
"ext-fileinfo": "*",
Expand Down
8 changes: 7 additions & 1 deletion core/controllers/components/UuidComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ class UuidComponent extends AppComponent
*/
public function generate()
{
return str_replace('-', '', \Ramsey\Uuid\Uuid::uuid4()->toString());
if (class_exists('\Ramsey\Uuid\Uuid')) {
$uuid = \Ramsey\Uuid\Uuid::uuid4();
} else {
$uuid = \Rhumsaa\Uuid\Uuid::uuid4();
}

return str_replace('-', '', $uuid->toString());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
---
# Must enable the task scheduler module.
cron:
- description: task scheduler job
url: /scheduler/run
schedule: every 12 minutes
- description: task scheduler job
url: /scheduler/run
schedule: every 12 minutes
3 changes: 2 additions & 1 deletion modules/javauploaddownload/controllers/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ public function gethttpuploadoffsetAction()
$this->disableLayout();
$this->disableView();
$params = $this->getAllParams();
$userId = explode('/', $params['uploadUniqueIdentifier'])[0];
$userIds = explode('/', $params['uploadUniqueIdentifier']);
$userId = $userIds[0];

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