<commit_before><?php
class cronjob
{
	/**
	 * file paths finded
	 *
	 * @var        array
	 */
	public $paths = [];

	/**
	 * Searches for the first match.
	 * sarch in all project and finde 'cronjob.php'
	 */
	public function find()
	{
		$this_dir = __DIR__;
		chdir($this_dir);
		chdir("../../../..");

		$path = realpath(''). DIRECTORY_SEPARATOR;

		$directory   = new \RecursiveDirectoryIterator($path);
		$flattened   = new \RecursiveIteratorIterator($directory);

		$files       = new \RegexIterator($flattened, "/cronjob\\.php$/");

		foreach($files as $file)
		{

			$file_name = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
			// var_dump($file_name);
			if($file_name === (__DIR__ . DIRECTORY_SEPARATOR . 'cronjob.php'))
			{
				// the file fined is this file!
				// never run this file when in this file!
			}
			else
			{
				$this->paths[] = $file_name;
			}
		}

	}

	/**
	 * exec all finded cronjob.php
	 */
	public function run()
	{
		$this->find();

		if(!empty($this->paths))
		{
			foreach ($this->paths as $key => $value)
			{
				if($value && is_string($value) && file_exists($value))
				{
					exec("php $value");
				}
			}
		}
	}
}

(new cronjob)->run();

?><commit_msg>set max depth for cronjob<commit_after><?php
class cronjob
{
	/**
	 * file paths finded
	 *
	 * @var        array
	 */
	public $paths = [];

	/**
	 * Searches for the first match.
	 * sarch in all project and finde 'cronjob.php'
	 */
	public function find()
	{
		$this_dir = __DIR__;
		chdir($this_dir);
		chdir("../../../..");

		$path = realpath(''). DIRECTORY_SEPARATOR;

		$directory   = new \RecursiveDirectoryIterator($path);
		$flattened   = new \RecursiveIteratorIterator($directory);
		$flattened->setMaxDepth(1);
		$files       = new \RegexIterator($flattened, "/cronjob\\.php$/");

		foreach($files as $file)
		{

			$file_name = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
			// var_dump($file_name);
			if($file_name === (__DIR__ . DIRECTORY_SEPARATOR . 'cronjob.php'))
			{
				// the file fined is this file!
				// never run this file when in this file!
			}
			else
			{
				$this->paths[] = $file_name;
			}
		}

	}

	/**
	 * exec all finded cronjob.php
	 */
	public function run()
	{
		$this->find();

		if(!empty($this->paths))
		{
			foreach ($this->paths as $key => $value)
			{
				if($value && is_string($value) && file_exists($value))
				{
					exec("php $value");
				}
			}
		}
	}
}

(new cronjob)->run();

?>
{'fraction_non_alphanumeric': 0.18292189397005262, 'fraction_numerical': 0.0004046944556859571, 'mean_word_length': 2.646017699115044, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '7225467', 'n_tokens_mistral': 1056, 'n_tokens_neox': 886, 'n_words': 189}