-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated and legacy code, migrate some syntax, cleanup #908
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# exit if any statement returns a non-true value | ||
set -e | ||
|
||
# determine path to this script | ||
readonly SELF_DIR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/" | ||
|
||
# source variables and functions files | ||
source "${SELF_DIR_PATH}inc-variables.bash" | ||
source "${SELF_DIR_PATH}inc-functions.bash" | ||
|
||
# | ||
# perform different operations depending on the environment | ||
# | ||
function main() | ||
{ | ||
out_main "Running 'exec-after' operations" | ||
|
||
send_coveralls_statistics | ||
} | ||
|
||
# go! | ||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# exit if any statement returns a non-true value | ||
set -e | ||
|
||
# determine path to this script | ||
readonly SELF_DIR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/" | ||
|
||
# source variables and functions files | ||
source "${SELF_DIR_PATH}inc-variables.bash" | ||
source "${SELF_DIR_PATH}inc-functions.bash" | ||
|
||
# | ||
# perform different operations depending on the environment | ||
# | ||
function main() | ||
{ | ||
out_main "Running 'exec-before' operations" | ||
|
||
if [[ ! ${TRAVIS_PHP_VERSION} = hhvm* ]]; then | ||
disable_php_memory_limit | ||
fi | ||
|
||
if [[ ${TRAVIS_PHP_VERSION} = hhvm* ]]; then | ||
enable_hhvm_php7_mode | ||
fi | ||
|
||
initialize_prestissimo | ||
} | ||
|
||
# go! | ||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# output text to console | ||
# | ||
function out_line() | ||
{ | ||
printf "[%d] %s...\n" $(date +%s) "${1}" | ||
} | ||
|
||
# | ||
# output main text to console | ||
# | ||
function out_main() | ||
{ | ||
out_line "${1^^}" | ||
} | ||
|
||
# | ||
# disable the php memory limit by setting it to "-1" | ||
# | ||
function disable_php_memory_limit() | ||
{ | ||
if [[ ! -d "$(dirname ${CONF_PATH_PHP7})" ]]; then | ||
return | ||
fi | ||
|
||
out_line "Disabling PHP memory limit in '${CONF_PATH_PHP7}'" | ||
echo "memory_limit = -1" >> "${CONF_PATH_PHP7}"; | ||
} | ||
|
||
# | ||
# enable the hhvm php7 mode by setting it to "1" | ||
# | ||
function enable_hhvm_php7_mode() | ||
{ | ||
out_line "Enabling HHVM PHP7 mode in '${CONF_PATH_HHVM}'" | ||
echo "hhvm.php7.all = 1" >> "${CONF_PATH_HHVM}" | ||
echo "hhvm.php7.scalar_types = 0" >> "${CONF_PATH_HHVM}" | ||
} | ||
|
||
# | ||
# configure the prestissimo package | ||
# | ||
function configure_prestissimo() | ||
{ | ||
local composer_reqs="${1}" | ||
local composer_orig="${TRAVIS_BUILD_DIR}/.travis/composer/config.json" | ||
local composer_dest="${HOME}/.composer/config.json" | ||
|
||
out_line "Configuring '${composer_reqs}' in '${composer_dest}'" | ||
if [[ ! -d "$(dirname ${composer_dest})" ]]; then | ||
mkdir "$(dirname ${composer_dest})" | ||
fi | ||
cp "${composer_orig}" "${composer_dest}" | ||
} | ||
|
||
# | ||
# require the prestissimo package using composer | ||
# | ||
function require_prestissimo() | ||
{ | ||
local composer_reqs="${1}" | ||
|
||
out_line "Requiring '${composer_reqs}'" | ||
composer global require "${composer_reqs}" | ||
} | ||
|
||
# | ||
# initialize the prestissimo package | ||
# | ||
function initialize_prestissimo() | ||
{ | ||
local composer_reqs="hirak/prestissimo:^0.3" | ||
|
||
configure_prestissimo "${composer_reqs}" | ||
require_prestissimo "${composer_reqs}" | ||
} | ||
|
||
# | ||
# send coveralls statistics using the required binary | ||
# | ||
function send_coveralls_statistics() | ||
{ | ||
local coveralls_bin="${TRAVIS_BUILD_DIR}/bin/coveralls" | ||
|
||
out_line "Sending Coveralls coverage using '${coveralls_bin}'" | ||
${coveralls_bin} -vvv | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# path to travis php configuration file | ||
CONF_PATH_PHP7="${HOME}/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" | ||
CONF_PATH_HHVM="/etc/hhvm/php.ini" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,30 +38,19 @@ class FileSystemLoader implements LoaderInterface | |
/** | ||
* @param MimeTypeGuesserInterface $mimeGuesser | ||
* @param ExtensionGuesserInterface $extensionGuesser | ||
* @param string[] $dataRoots | ||
* @param LocatorInterface $locator | ||
* @param string[] $rootPaths | ||
*/ | ||
public function __construct( | ||
MimeTypeGuesserInterface $mimeGuesser, | ||
ExtensionGuesserInterface $extensionGuesser, | ||
$dataRoots | ||
/* LocatorInterface $locator */ | ||
LocatorInterface $locator, | ||
array $rootPaths = [] | ||
) { | ||
$this->mimeTypeGuesser = $mimeGuesser; | ||
$this->extensionGuesser = $extensionGuesser; | ||
|
||
if (count($dataRoots) === 0) { | ||
throw new InvalidArgumentException('One or more data root paths must be specified.'); | ||
} | ||
|
||
if (func_num_args() >= 4 && false === ($this->locator = func_get_arg(3)) instanceof LocatorInterface) { | ||
throw new \InvalidArgumentException(sprintf('Method %s() expects a LocatorInterface for the forth argument.', __METHOD__)); | ||
} elseif (func_num_args() < 4) { | ||
@trigger_error(sprintf('Method %s() will have a forth `LocatorInterface $locator` argument in version 2.0. Not defining it is deprecated since version 1.7.2', __METHOD__), E_USER_DEPRECATED); | ||
$this->locator = new FileSystemLocator(); | ||
} | ||
|
||
$this->locator->setOptions(array('roots' => (array) $dataRoots)); | ||
$this->locator = $locator; | ||
$this->locator->setOptions(['roots' => $rootPaths]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why pass the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is a valid question and something I've considered changing, but the current configuration handling of these items is tied to the I'm not really positive how we should handle this moving forward and am very open to its discussion, but I do think that it is more appropriate to handle that in a PR of its own, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IDK: now you got me thinking maybe it should be fully handled in this PR; what do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you're making a signature change here I would solve the problem fully in this PR, instead of in another PR which breaks the signature a second time. People aren't supposed to be using 2.x yet I guess, but you never know 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have not found a straightforward solution to this, and based on my testing the solution will likely be quite large (only making this pull request even larger), so I don't forsee this issue being resolved by this pull request. See #908 (comment) for additional details. As for breaking changes (multiple times), I'm not too concerned about that; the whole point of having a development branch is to be able to actively develop on it. Those running the |
||
} | ||
|
||
/** | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: This deprecation notice needs to be amended to properly articulate the changes.