PHP code example of wpbones / flags

1. Go to this page and download the library: Download wpbones/flags library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wpbones / flags example snippets




if (!defined('ABSPATH')) {
    exit();
}

return [
  /*
  |--------------------------------------------------------------------------
  | Logging Configuration
  |--------------------------------------------------------------------------
  |
  | Here you may configure the log settings for your plugin.
  |
  | Available Settings: "single", "daily", "errorlog".
  |
  | Set to false or 'none' to stop logging.
  |
  */

  'log' => 'errorlog',

  'log_level' => 'debug',

  /*
  |--------------------------------------------------------------------------
  | Flags package path Configuration
  |--------------------------------------------------------------------------
  |
  | Here you may configure the flags path for your plugin.
  |
  */
  'flags' => [
      'path' => 'config/flags.yaml',
  ],
  ...

wpbones_flags()->get('example.enabled', false);

use WpBones\Flags\Flags;

$flags = new Flags();
$flags->get('example.enabled', false);

use WpBones\Flags\Flags;

Flags::get('example.enabled', false);

wpbones_flags('config/flags.yaml')->get('logger.enabled', false);

wpbones_flags()->withPath('config/flags.yaml')->get('logger.enabled', false);

use WpBones\Flags\Flags;

$flags = new Flags();
$flags->withPath('config/flags.yaml')->get('logger.enabled', false);

use WpBones\Flags\Flags;

Flags::withPath('config/flags.yaml')->get('logger.enabled', false);