Abel Hoogeveen
bc6136525b
The Factory class is the central point for class communication in FuzeWorks. When someone needs to load, for instance, the layout class, one has to do the following: $factory = Factory::getInstance(); $layout = $factory->layout; The Factory class allows the user to replace dependencies on the fly. It is possible for a class to replace a dependency, like Logger, on the fly by calling the $factory->newInstance('Logger'); or the $factory->setInstance('Logger', $object); This allows for creative ways to do dependency injection, or keep classes separated. It is also possible to load a cloned instance of the Factory class, so that all properties are independant as well, all to suit your very needs.
76 lines
1.5 KiB
YAML
76 lines
1.5 KiB
YAML
before_script:
|
|
# Install dependencies
|
|
- bash CI/docker_install.sh > /dev/null
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
build:composer:
|
|
image: php:5.6
|
|
stage: build
|
|
script:
|
|
- curl -sS https://getcomposer.org/installer | php
|
|
- php composer.phar install
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/
|
|
|
|
test:5.4:
|
|
image: php:5.4
|
|
script:
|
|
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/
|
|
allow_failure: true
|
|
|
|
test:5.5:
|
|
image: php:5.5
|
|
script:
|
|
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/
|
|
allow_failure: true
|
|
|
|
test:5.6:
|
|
stage: test
|
|
image: php:5.6
|
|
script:
|
|
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/
|
|
|
|
test:7.0:
|
|
stage: test
|
|
image: php:7.0
|
|
script:
|
|
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/
|
|
|
|
release:
|
|
stage: deploy
|
|
image: php:5.6
|
|
only:
|
|
- master
|
|
script:
|
|
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
|
|
- vendor/bin/apigen generate -s . -d 'build/phpdoc' --todo --title 'FuzeWorks Build' --exclude 'tests/*','build/*','vendor/*','CI/*'
|
|
artifacts:
|
|
name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
|
|
paths:
|
|
- build/
|
|
cache:
|
|
key: "$CI_BUILD_REF/$CI_BUILD_REF_NAME"
|
|
paths:
|
|
- vendor/ |