<commit_before><?php
/**
 * Used as the basis for a command line script
 * @author visco
 * @package sb_Command
 */
class sb_Command_Base {

	/**
	 * The begin time of the script in order to calculate the total time required
	 *
	 * @var integer
	 */
	protected $start_time;

	/**
	 * The number of errors that occurred based on the message type error
	 * @var integer
	 */
	protected $number_of_errors = 0;

	public function __construct(){
		if(!Gateway::$command_line){
			die('You can only use this command from the terminal');
		}
		
		$this->start_time = microtime(true);
		$this->log(date('Y/m/d H:i:s')." - Begin Process ".__CLASS__);
		$this->set_memory_limit();
		$this->set_max_execution_time();


	}

	/**
	 * Sets the memory limit for the command
	 * @param integer $memory_in_MB
	 */
	public function set_memory_limit($memory_in_MB=200){
		ini_set('memory_limit', $memory_in_MB.'M');
	}

	/**
	 * Sets the maximum execution time for the script
	 * @param integer $time_in_seconds
	 */
	public function set_max_execution_time($time_in_seconds=3600){
		ini_set('max_execution_time',$time_in_seconds);<commit_msg>added on_start method check<commit_after><?php
/**
 * Used as the basis for a command line script
 * @author visco
 * @package sb_Command
 */
class sb_Command_Base {

	/**
	 * The begin time of the script in order to calculate the total time required
	 *
	 * @var integer
	 */
	protected $start_time;

	/**
	 * The number of errors that occurred based on the message type error
	 * @var integer
	 */
	protected $number_of_errors = 0;

	public function __construct(){
		if(!Gateway::$command_line){
			die('You can only use this command from the terminal');
		}
		
		$this->start_time = microtime(true);
		$this->log(date('Y/m/d H:i:s')." - Begin Process ".__CLASS__);
		$this->set_memory_limit();
		$this->set_max_execution_time();

		if(method_exists($this, 'on_start')){
			$this->on_start();
		}
	}

	/**
	 * Sets the memory limit for the command
	 * @param integer $memory_in_MB
	 */
	public function set_memory_limit($memory_in_MB=200){
		ini_set('memory_limit', $memory_in_MB.'M');
	}

	/**
	 * Sets the maximum execution time for the script
	 * @param integer $time_in_seconds
	 */
	public function set_max_execution_time($time_in_seconds=3600){
		ini_set('max_execution_time',$time_in_seconds);
{'fraction_non_alphanumeric': 0.12645161290322582, 'fraction_numerical': 0.006881720430107527, 'mean_word_length': 4.089715536105033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '2831007', 'n_tokens_mistral': 821, 'n_tokens_neox': 743, 'n_words': 211}