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

Commit

Permalink
Restore 5.3 compatibility as much as possible
Browse files Browse the repository at this point in the history
Supports composer install --no-dev only.
  • Loading branch information
Jamie Snape committed Oct 23, 2015
1 parent b142116 commit e852490
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
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
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
42 changes: 21 additions & 21 deletions composer.json
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
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
3 changes: 2 additions & 1 deletion modules/javauploaddownload/controllers/UploadController.php
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

0 comments on commit e852490

Please sign in to comment.