<commit_before><?php

namespace Routes;

use
\Atlantis as Atlantis,
\Nether as Nether;

use
\Nether\Avenue\Router as Router,
\Nether\Avenue\RouteHandler as Handler;

class Page
extends Atlantis\Site\PublicWeb
implements Nether\Avenue\Interfaces\RouteAcceptance {

	public static function
	WillHandleRequest(Router $Router, Handler $Handler):
	Bool {
	/*//
	@date 2020-05-27
	@implements Nether\Avenue\Interfaces\RouteAcceptance
	//*/

		$Path = trim($Router->GetPath());
		$Parts = explode('/',$Path);
		$Part = NULL;

		foreach($Parts as &$Part)
		$Part = Atlantis\Util\Filters::RouteSafeAlias($Part);

		////////

		$Path = join('/',$Parts);

		$Filename = sprintf(
			'%s/data/pages/%s.phtml',
			ProjectRoot,
			$Path
		);

		if(file_exists($Filename) && is_readable($Filename)) {
			Nether\Stash::Set('Route.Page.Filename',$Filename);
			return TRUE;
		}

		////////

		return FALSE;
	}

	public function
	Index(String $Path):
	Void {
	/*//
	@date 2020-05-27
	//*/

		(function($File){
			require($File);
			return;
		})(Nether\Stash::Get('Route.Page.Filename'));

		return;
	}

}<commit_msg>give Page pages access to things<commit_after><?php

namespace Routes;

use
\Atlantis as Atlantis,
\Nether as Nether;

use
\Nether\Avenue\Router as Router,
\Nether\Avenue\RouteHandler as Handler;

class Page
extends Atlantis\Site\PublicWeb
implements Nether\Avenue\Interfaces\RouteAcceptance {

	protected static
	?String $Filename = NULL;

	public static function
	WillHandleRequest(Router $Router, Handler $Handler):
	Bool {
	/*//
	@date 2020-05-27
	@implements Nether\Avenue\Interfaces\RouteAcceptance
	//*/

		$Path = trim($Router->GetPath());
		$Parts = explode('/',$Path);
		$Part = NULL;

		foreach($Parts as &$Part)
		$Part = Atlantis\Util\Filters::RouteSafeAlias($Part);

		////////

		$Path = join('/',$Parts);

		$Filename = sprintf(
			'%s/data/pages/%s.phtml',
			ProjectRoot,
			$Path
		);

		if(file_exists($Filename) && is_readable($Filename)) {
			static::$Filename = $Filename;
			return TRUE;
		}

		////////

		return FALSE;
	}

	public function
	Index(String $Path):
	Void {
	/*//
	@date 2020-05-27
	//*/

		(function(
			String $File,
			Atlantis\Site\PublicWeb $Route,
			Nether\Avenue\Router $Router,
			Nether\Surface $Surface,
			?Atlantis\User $User
		){
			require($File);
			return;
		})(
			static::$Filename,
			$this,
			$this->Router,
			$this->Surface,
			$this->User
		);

		return;
	}

}
{'fraction_non_alphanumeric': 0.1706611570247934, 'fraction_numerical': 0.013223140495867768, 'mean_word_length': 3.3779385171790235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '6910695', 'n_tokens_mistral': 1004, 'n_tokens_neox': 856, 'n_words': 169}