Skip to content

Commit

Permalink
Merge pull request #38 from berlinger-rarents/feat/composer_extra_config
Browse files Browse the repository at this point in the history
check composer's extra config for CDN URL
  • Loading branch information
jakoch authored Sep 29, 2016
2 parents 356d782 + daaf790 commit 70674da
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 156 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@

# Composer
/composer.phar
/composer.lock
/vendor

# Vagrant
.vagrant
Vagrantfile

.idea
.idea

/src/PhantomInstaller/PhantomBinary.php
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,20 @@ Possible values for

## Downloading from a mirror

The environment and server variable `PHANTOMJS_CDNURL` enables you to override
the default download location of the PhantomJS binary file.
You can override the default download location of the PhantomJS binary file by setting it in one of these locations. Listed in order of precedence (highest first):
* The environment variable `PHANTOMJS_CDNURL`
* The server variable `PHANTOMJS_CDNURL`
* At `$['extra']['jakoch/phantomjs-installer']['cdnurl']` in your composer.json. E.g.:
```json
"extra": {
"jakoch/phantomjs-installer": {
"cdnurl": "https://github.com/Medium/phantomjs/releases/download/v1.9.19/"
}
},
```

The default download location is Bitbucket: `https://bitbucket.org/ariya/phantomjs/downloads/`.
You don't need to set it explicitly. It's used, when `CDNURL` is not set.
You don't need to set it explicitly. It's used, when `PHANTOMJS_CDNURL` is not set.

You might use one of the following mirror URLs as a value for `PHANTOMJS_CDNURL`:
- `https://cnpmjs.org/downloads/` - USA, San Mateo (47.88.189.193)
Expand Down
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@
}
],
"require": {
"php": ">5.3",
"ext-bz2": "*",
"ext-openssl": "*"
},
"require-dev": {
"composer/composer": "^1.2",
"phpunit/phpunit": "^4.8"
},
"autoload": {
"psr-4": {
"PhantomInstaller\\Test\\" : "tests/"
},
"psr-0": {
"PhantomInstaller\\": "src/"
}
Expand Down
Loading

0 comments on commit 70674da

Please sign in to comment.