Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Introduce feature flags #1631

Merged
merged 24 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ jobs:
php: 7.1
env:
- WP_VERSION=latest
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- phpunit
- name: PHP 5.6/unit-tests/Latest WP
php: 5.6
env:
- WP_VERSION=latest
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- phpunit
- name: PHP Linting Check
php: 7.1
env:
- WP_TRAVISCI=phpcs
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- npm run lint:php
- name: Javascript Tests
Expand Down
12 changes: 5 additions & 7 deletions src/Domain/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,11 @@ protected function remove_core_blocks() {
* Define the global feature flag
*/
protected function define_feature_flag() {
$woo_options = parse_ini_file( __DIR__ . '/../../blocks.ini' );
$flag = 'stable';
if ( is_array( $woo_options ) && (
'experimental' === $woo_options['woocommerce_blocks_phase'] ||
'stable' === $woo_options['woocommerce_blocks_phase']
) ) {
$flag = sanitize_key( $woo_options['woocommerce_blocks_phase'] );
if ( getenv( 'WOOCOMMERCE_BLOCKS_PHASE' ) ) {
$flag = getenv( 'WOOCOMMERCE_BLOCKS_PHASE' );
senadir marked this conversation as resolved.
Show resolved Hide resolved
} else {
$woo_options = parse_ini_file( __DIR__ . '/../../blocks.ini' );
$flag = is_array( $woo_options ) && 'experimental' === $woo_options['woocommerce_blocks_phase'] ? 'experimental' : 'stable';
}
define( 'WOOCOMMERCE_BLOCKS_PHASE', $flag );
}
Expand Down