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

Commit e852490

Browse files
author
Jamie Snape
committed
Restore 5.3 compatibility as much as possible
Supports composer install --no-dev only.
1 parent b142116 commit e852490

5 files changed

Lines changed: 44 additions & 24 deletions

File tree

.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/>

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
/**

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)