Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegrunwell committed Jun 27, 2018
2 parents ee618b7 + f547b83 commit 94d7014
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 7 deletions.
11 changes: 6 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/

root = true

[*.php]
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: false
sudo: true
dist: trusty
language: php

Expand All @@ -13,5 +13,9 @@ php:
install:
- composer install --prefer-dist

before_script:
- sudo mkdir -p "/etc/php/${TRAVIS_PHP_VERSION}/mods-available"

script:
- ./vendor/bin/phpunit
- shellcheck bin/*.sh
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2018-06-27

* Attempt to automatically create `runkit.ini` files upon installation ([#1]).
* Add a `name` attribute to the `<testsuite>` node, fixing some Travis build errors ([#2]).
* Document that root access might be necessary to run the installer ([#3]).
* Include [Shellcheck](https://www.shellcheck.net/) as part of the continuous integration process.

## [1.0.0] - 2018-03-29

* Initial public release.

[Unreleased]: https://github.com/stevegrunwell/runkit7-installer/compare/master...develop
[1.1.0]: https://github.com/stevegrunwell/runkit7-installer/releases/tag/v1.1.0
[1.0.0]: https://github.com/stevegrunwell/runkit7-installer/releases/tag/v1.0.0
[#1]: https://github.com/stevegrunwell/runkit7-installer/issues/1
[#2]: https://github.com/stevegrunwell/runkit7-installer/issues/2
[#3]: https://github.com/stevegrunwell/runkit7-installer/issues/3
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Then, either in a development environment or as part of your <abbr title="Contin
$ ./vendor/bin/install-runkit.sh
```

> **Note:** If you receive permission issues, you may need to run the command above prefixed with `sudo`.
If you wish to install a specific version of Runkit7, you may pass the version number to the script as an argument:

```sh
Expand Down
14 changes: 14 additions & 0 deletions bin/install-runkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ echo "\\033[0;33mInstalling Runkit7...\\033[0;m"
download "https://github.com/runkit7/runkit7/releases/download/${RUNKIT_VERSION}/runkit-${RUNKIT_VERSION}.tgz" "$DOWNLOAD_FILENAME" \
&& pecl install "$DOWNLOAD_FILENAME" \
&& rm "$DOWNLOAD_FILENAME"

# Create runkit.ini files for each version of PHP.
MODS=$(find /etc/php/ -name "mods-available" -type d)
for DIR in $MODS; do
if [ ! -f "$DIR/runkit.ini" ]; then
echo "extension=runkit.so" | sudo tee "$DIR/runkit.ini" > /dev/null \
&& echo "Created ${DIR}/runkit.ini"
fi
done

# Attempt to enable the Runkit PHP module.
if [ "$(command -v phpenmod)" ]; then
sudo phpenmod runkit && echo "\\033[0;32mRunkit7 has been installed and activated!\\033[0;0m"
fi
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite>
<testsuite name="Core">
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>
Expand Down
6 changes: 6 additions & 0 deletions tests/InstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ public function testInstallsRunkit()
'Expected the Runkit extension to not yet be loaded.'
);

$version = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;

exec(dirname(__DIR__) . '/bin/install-runkit.sh', $output, $exitCode);

$this->assertEquals(0, $exitCode, 'Expected an exit code of 0:' . $this->quoteShellOutput($output));
$this->assertTrue(
(bool) preg_match('/^runkit\s/m', shell_exec('pecl list')),
'The Runkit extension should have been loaded.'
);
$this->assertTrue(
file_exists('/etc/php/' . $version . '/mods-available/runkit.ini'),
'Expected a runkit.ini file to be created for PHP ' . $version . '.'
);
}

/**
Expand Down

0 comments on commit 94d7014

Please sign in to comment.