Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #161 from narrowspark/issue-52-refactor-filesystem
Browse files Browse the repository at this point in the history
Issue 52 refactor filesystem
  • Loading branch information
prisis committed Feb 12, 2016
2 parents c4e73b1 + c449d17 commit f9282f8
Show file tree
Hide file tree
Showing 145 changed files with 3,804 additions and 2,903 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/vendor
.DS_Store
.php_cs.cache

composer.phar
composer.lock
.php_cs.cache
.DS_Store
Thumbs.db

/build/logs
/vendor
77 changes: 38 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
language: php

php:
- 5.6
- 7.0
- hhvm
sudo: false
dist: precise

env:
global:
- setup=basic
matrix:
- ADAPTER=Apc
- ADAPTER=Ev
addons:
apt_packages:
- parallel

services:
- memcached
Expand All @@ -19,48 +14,52 @@ services:

matrix:
include:
- php: hhvm
env: SETUP=basic
- php: 5.6
env: SETUP=basic
- php: 5.6
env: setup=lowest
env: SETUP=stable
- php: 5.6
env: setup=stable
env: SETUP=basic ADAPTER=Libevent
- php: 5.6
env: CHECK_CS=true SEND_COVERAGE=true
env: SETUP=basic ADAPTER=Ev
- php: 7.0
env: SETUP=lowest
- php: 7.0
env: SETUP=basic ADAPTER=Libuv
- php: 7.0
env: SETUP=basic ADAPTER=Uv
- php: 5.6
env: SETUP=basic CHECK_CS=true SEND_COVERAGE=true
fast_finish: true

cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer

before_script:
- sleep 15
- mongo mydb_test --eval 'db.addUser("travis", "test");'
- if [ $TRAVIS_PHP_VERSION = 5.* ]; then (echo "yes" | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> "$INI_FILE"); fi
- if [ $TRAVIS_PHP_VERSION = 7.* ]; then (echo "yes" | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> "$INI_FILE"); fi
- if [ $TRAVIS_PHP_VERSION != hhvm ]; then echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- if [[ $TRAVIS_PHP_VERSION = 5.* && $ADAPTER = Libevent ]]; then (echo "yes" | pecl install "channel://pecl.php.net/libevent-0.1.0"); fi
- if [[ $TRAVIS_PHP_VERSION = 5.* && $ADAPTER = Ev ]]; then (echo "yes" | pecl install ev); fi
- if [[ $TRAVIS_PHP_VERSION = 7.* && $ADAPTER = Libuv ]]; then (mkdir libuv && (curl -L https://github.com/libuv/libuv/archive/v1.6.1.tar.gz | tar xzf -) && cd libuv-1.6.1 && ./autogen.sh && ./configure --prefix=$(readlink -f `pwd`/../libuv) && make && make install && cd ..); fi
- if [[ $TRAVIS_PHP_VERSION = 7.* && $ADAPTER = Uv ]]; then (git clone https://github.com/bwoebi/php-uv && cd php-uv && phpize && ./configure --with-uv=$(readlink -f `pwd`/../libuv) && make install && (echo "extension = uv.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) && cd ..); fi

before_install:
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then phpenv config-rm xdebug.ini; fi
- composer self-update
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d
- if [ -f build/travis/php/$TRAVIS_PHP_VERSION.sh]; then ./build/travis/php/$TRAVIS_PHP_VERSION.sh; fi
- travis_retry composer self-update # Run allways composer update
- if [ "$TRAVIS_PHP_VERSION" = hhvm ]; then composer global require hirak/prestissimo; fi # Now composer can install components parallel

install:
- if [ $setup = 'basic' ]; then travis_retry composer install --no-interaction --prefer-source; fi
- if [ $setup = 'stable' ]; then travis_retry composer update --prefer-source --no-interaction --prefer-stable; fi
- if [ $setup = 'lowest' ]; then travis_retry composer update --prefer-source --no-interaction --prefer-lowest --prefer-stable; fi
- if [ "$SETUP" = 'basic' ]; then travis_retry composer install --no-interaction --prefer-source --no-progress --profile; fi
- if [ "$SETUP" = 'stable' ]; then travis_retry composer update --prefer-source --no-interaction --prefer-stable --no-progress --profile; fi
- if [ "$SETUP" = 'lowest' ]; then travis_retry composer update --prefer-source --no-interaction --prefer-lowest --prefer-stable --no-progress --profile; fi

before_script:
- chmod a+x ./build/travis/runTest.sh && chmod a+x ./build/travis/runTests.sh && chmod a+x ./build/travis/all.sh && chmod a+x ./build/travis/php/5.x.sh && chmod a+x ./build/travis/php/7.x.sh && chmod a+x ./build/travis/php/hhvm.sh && chmod a+x ./build/travis/script.sh && chmod a+x ./build/travis/after_success.sh
- sleep 15
- mongo mydb_test --eval 'db.addUser("travis", "test");'
- ./build/travis/all.sh
- if [ "$TRAVIS_PHP_VERSION" = 5.6 ]; then ./build/travis/php/5.x.sh; fi
- if [ "$TRAVIS_PHP_VERSION" = 7.0 ]; then ./build/travis/php/7.x.sh; fi
- if [ "$TRAVIS_PHP_VERSION" = hhvm ]; then ./build/travis/php/hhvm.sh; fi

script:
- mkdir -p build/logs
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose --diff --dry-run; fi
- vendor/bin/phpunit -c phpunit.xml.dist
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then vendor/bin/humbug; fi
- ./build/travis/script.sh

after_success:
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/coverage.xml; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm && CHECK_CS != true && SEND_COVERAGE != true ]]; then bash <(curl -s https://codecov.io/bash); fi

sudo: false
- ./build/travis/after_success.sh
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ git subsplit publish src/Viserio/Http:git@github.com:viserio/http.git
git subsplit publish src/Viserio/Log:git@github.com:viserio/log.git
git subsplit publish src/Viserio/Mail:git@github.com:viserio/mail.git
git subsplit publish src/Viserio/Middleware:git@github.com:viserio/middleware.git
git subsplit publish src/Viserio/Parsers:git@github.com:viserio/parsers.git
git subsplit publish src/Viserio/Pipeline:git@github.com:viserio/pipeline.git
git subsplit publish src/Viserio/Queue:git@github.com:viserio/queue.git
git subsplit publish src/Viserio/Routing:git@github.com:viserio/routing.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ git subsplit publish --heads="master 0.10.0-dev" --no-tags src/Viserio/Http:git@
git subsplit publish --heads="master 0.10.0-dev" --no-tags src/Viserio/Log:git@github.com:viserio/log.git
git subsplit publish --heads="master 0.10.0-dev" --no-tags src/Viserio/Mail:git@github.com:viserio/mail.git
git subsplit publish --heads="master 0.10.0-dev" --no-tags src/Viserio/Middleware:git@github.com:viserio/middleware.git
git subsplit publish --heads="0.10.0-dev" --no-tags src/Viserio/Pipeline:git@github.com:viserio/parsers.git
git subsplit publish --heads="0.10.0-dev" --no-tags src/Viserio/Pipeline:git@github.com:viserio/pipeline.git
git subsplit publish --heads="0.10.0-dev" --no-tags src/Viserio/Queue:git@github.com:viserio/queue.git
git subsplit publish --heads="master 0.10.0-dev" --no-tags src/Viserio/Routing:git@github.com:viserio/routing.git
Expand Down
11 changes: 11 additions & 0 deletions build/travis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build Scripts

This directory contains the scripts that travis uses to build the project.

The scripts in [the php directory](php/) are ran when travis is testing the given version. [`all.sh`](php/all.sh) is ran for every version.

Tests are ran using [`runTests.sh`](runTests.sh). This file grabs all the sub projects, and runs [`runTest.sh`](runTest.sh).
[`runTest.sh`](runTest.sh) goes into each directory, installs composer (ignoring platform reqs), and then runs the tests.

After running tests on all of the sub projects, [`runTests.sh`](runTests.sh) runs tests on the entire [`narrowspark/framework`](https://github.com/narrowspark/framework) repository,
and then sends code coverage reports out to [Codecov](https://codecov.io/github/narrowspark/framework).
8 changes: 8 additions & 0 deletions build/travis/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# Send coverage to scrutinizer
if [[ "$TRAVIS_PHP_VERSION" != hhvm && "$CHECK_CS" = true && "$SEND_COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
if [[ "$TRAVIS_PHP_VERSION" != hhvm && "$CHECK_CS" = true && "$SEND_COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/coverage.xml; fi

# Run codecov
if [[ "$TRAVIS_PHP_VERSION" != hhvm && "$CHECK_CS" = true && "$SEND_COVERAGE" = true ]]; then bash <(curl -s https://codecov.io/bash); fi
7 changes: 7 additions & 0 deletions build/travis/all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Disable xdebug when hhvm or when SEND_COVERAGE is false
if [[ "$TRAVIS_PHP_VERSION" != hhvm && "$CHECK_CS" != true && "$SEND_COVERAGE" != true ]]; then phpenv config-rm xdebug.ini; fi

# Doing something with phpenv
if [ "$TRAVIS_PHP_VERSION" != hhvm ]; then phpenv config-add ./build/travis/php/php.ini; fi
7 changes: 7 additions & 0 deletions build/travis/php/5.x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Install libevent
if [ "$ADAPTER" = Libevent ]; then (echo "yes" | pecl install "channel://pecl.php.net/libevent-0.1.0"); fi

# Install ev
if [ "$ADAPTER" = Ev ]; then (echo "yes" | pecl install ev); fi
10 changes: 10 additions & 0 deletions build/travis/php/7.x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# Install Libuv
if [ "$ADAPTER" = Libuv ]; then (mkdir libuv && (curl -L https://github.com/libuv/libuv/archive/v1.6.1.tar.gz | tar xzf -) && cd libuv-1.6.1 && ./autogen.sh && ./configure --prefix=$(readlink -f `pwd`/../libuv) && make && make install && cd ..); fi

# Install Uv
if [ "$ADAPTER" = Uv ]; then (git clone https://github.com/bwoebi/php-uv && cd php-uv && phpize && ./configure --with-uv=$(readlink -f `pwd`/../libuv) && make install && (echo "extension = uv.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) && cd ..); fi

# Remove flysystem-azure
composer remove league/flysystem-azure --dev --no-update
3 changes: 3 additions & 0 deletions build/travis/php/hhvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

# Don't need anything yet
File renamed without changes.
17 changes: 17 additions & 0 deletions build/travis/runTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

SLUG=$(grep -Pho 'viserio/[A-Za-z-\.]+' $1/composer.json | xargs | awk '{print $1}')
printf "\n\n************ Running tests for $SLUG ************\n\n"

cd $1
composer install --no-interaction --prefer-source --ignore-platform-reqs --quiet

TEST="./vendor/bin/phpunit $2"

printf "Command: $TEST\n\n"
if [ "$TRAVIS_PHP_VERSION" == '7.0' ]
then
phpdbg -qrr $TEST
else
sh -c "$TEST"
fi
22 changes: 22 additions & 0 deletions build/travis/runTests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Run for each components
COMPONENTS=$(find src/Viserio/ -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
if [ command -v parallel >/dev/null 2>&1 ]
then
# Exists
echo $COMPONENTS | parallel --gnu './build/travis/runTest.sh {}'

else
# Doesn't Exist
echo $COMPONENTS | xargs -n 1 ./build/travis/runTest.sh
fi

# Fail out if the tests above failed
if [ $? > 0 ]; then exit $?; fi

# Run for main repo. Generate coverage
COVERAGE=coverage.xml
if [[ -f $COVERAGE && "$CHECK_CS" = true && "$SEND_COVERAGE" = true ]]; then rm $COVERAGE; fi

./build/travis/runTest.sh ./ --coverage-clover=$COVERAGE
5 changes: 5 additions & 0 deletions build/travis/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

mkdir -p build/logs
./build/travis/runTests.sh
if [[ "$TRAVIS_PHP_VERSION" != hhvm && "$CHECK_CS" != true && "$SEND_COVERAGE" != true ]]; then vendor/bin/humbug; fi
56 changes: 0 additions & 56 deletions build/viserio-split-faster.sh

This file was deleted.

Loading

0 comments on commit f9282f8

Please sign in to comment.