<commit_before><?php
/**
 * actions on an individual site
 *
 */

use Terminus\Utils;
use Terminus\Auth;
use Terminus\SiteFactory;
use Terminus\Site;
use \Guzzle\Http\Client;

class Site_Command extends Terminus_Command {

  public function __construct() {
    parent::__construct();
  }

  protected $_headers = false;

  /**
   *
   * ## Options
   *
   * --site=<site>
   * : site to create branch of

   * --branch=<branch>
   * : name of new branch
   *
   * ## EXAMPLES
   *
   * @subcommand branch-create
  **/
  public function branch_create($args, $assoc_args) {
    $site = SiteFactory::instance($assoc_args['site']);
    $branch = preg_replace('#[-_\s]+#',"",@$assoc_args['branch']);
    $branch = $site->createBranch($branch);
  }

  /**
   * ## Options
   *
   * --site=<site>
   * : site to use
   *
   * [--env=<env>]
   * : Environment to clear
   *
   * ## EXAMPLES
   *  terminus site clear-caches --site=test
   *
   * @subcommand clear-caches
   */
  public function clear_caches($args, $assoc_args) {
      $site = SiteFactory::instance($assoc_args['site']);
      $response = $site->environment('dev')->workflow("clear_cache");
      $this->waitOnWorkFlow('sites', $site->getId(), $response->id);
      Terminus::success("Caches cleared");
  }

  /**
   * ## Options
   *
   * --site=<site>
   * : name of the site to work with
   *
   * --env=<env>
   * : environment to check
   *
   * [--filter]
   * : Use a regex to filter the diffstat for certain files
   *
   * [--nocache]
   * : bypass the local cache
   *
   * [--bash]
   * : bash friendly output
   *
   * ## EXAMPLES
   *  terminus site diffstat --site=test --env=dev
   *
   */
  public function diffstat($args, $assoc_args) {<commit_msg>Add environment prompt<commit_after><?php
/**
 * actions on an individual site
 *
 */

use Terminus\Utils;
use Terminus\Auth;
use Terminus\SiteFactory;
use Terminus\Site;
use \Guzzle\Http\Client;

class Site_Command extends Terminus_Command {

  public function __construct() {
    parent::__construct();
  }

  protected $_headers = false;

  /**
   *
   * ## Options
   *
   * --site=<site>
   * : site to create branch of

   * --branch=<branch>
   * : name of new branch
   *
   * ## EXAMPLES
   *
   * @subcommand branch-create
  **/
  public function branch_create($args, $assoc_args) {
    $site = SiteFactory::instance($assoc_args['site']);
    $branch = preg_replace('#[-_\s]+#',"",@$assoc_args['branch']);
    $branch = $site->createBranch($branch);
  }

  /**
   * ## Options
   *
   * --site=<site>
   * : site to use
   *
   * [--env=<env>]
   * : Environment to clear
   *
   * ## EXAMPLES
   *  terminus site clear-caches --site=test
   *
   * @subcommand clear-caches
   */
  public function clear_caches($args, $assoc_args) {
      $site = SiteFactory::instance($assoc_args['site']);
      $env = $this->getValidEnv($site->getName(), @$assoc_args['env']);
      $response = $site->environment($env)->workflow("clear_cache");
      $this->waitOnWorkFlow('sites', $site->getId(), $response->id);
      Terminus::success("Caches cleared");
  }

  /**
   * ## Options
   *
   * --site=<site>
   * : name of the site to work with
   *
   * --env=<env>
   * : environment to check
   *
   * [--filter]
   * : Use a regex to filter the diffstat for certain files
   *
   * [--nocache]
   * : bypass the local cache
   *
   * [--bash]
   * : bash friendly output
   *
   * ## EXAMPLES
   *  terminus site diffstat --site=test --env=dev
   *
   */
  public function diffstat($args, $assoc_args) {
{'fraction_non_alphanumeric': 0.17148526077097506, 'fraction_numerical': 0.0, 'mean_word_length': 2.718651211801897, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '771847', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1213, 'n_words': 253}