public function loadRoutes()
	{
		if ($this->bound('router')) {
			/**
			 * Use Cached Routes if Available
			 */

			if ($this['config']->get('routes.cache') && $this['files']->exists($this['config']->get('routes.compiled'))) {
				$contents = $this['files']->get($this['config']->get('routes.compiled'));
				if (!empty($contents)) {
					//Get Cached Routes & Set Them
					$this['router']->setRoutes(unserialize(base64_decode($contents)));
				}
			} else {
				//Assign Router to Simple Variable for Include
				$route = $this['router'];
				$response = $this['response'];
				//Include Routes
				if($this['files']->exists($this->base_path . '/app/Http/routes.php')){

					require_once $this->base_path . '/app/Http/routes.php';
				}
			}
			/**
			 * Store Cached Routes
			 */
			if ($this['config']->get('routes.cache') && !$this['files']->exists($this['config']->get('routes.compiled'))) {
				try {
					//Set Routes Cache
					if (!$this['files']->exists($this['config']->get('routes.compiled'))) {
						$allRoutes = $this['router']->getRoutes();
						//If Routes then Serialize
						if (count($allRoutes) > 0) {
							foreach ($allRoutes as $routeObject) {
								$routeObject->prepareForSerialization();
							}
						}
						//Store Routes in Cache
						$this['files']->put($this['config']->get('routes.compiled'), base64_encode(serialize($allRoutes)));
					}
				} catch (\Exception $exception) {
					if (!empty($exception->getMessage())) {
						add_action('admin_notices', function () use ($exception) {
							?>
							<div class="error notice">
								<p>&#9888; <?php echo $exception->getMessage(); ?></p>
								<p><em><? echo 'Route caching cannot serialize closures'; ?>.</em></p>
							</div>
							<?php
						});
					}
				}
			}
		}
	}
public function loadRoutes()
	{
		if ($this->bound('router')) {
			/**
			 * Use Cached Routes if Available
			 */

			if ($this['config']->get('routes.cache') && $this['files']->exists($this['config']->get('routes.compiled'))) {
				$contents = $this['files']->get($this['config']->get('routes.compiled'));
				if (!empty($contents)) {
					//Get Cached Routes & Set Them
					$this['router']->setRoutes(unserialize(base64_decode($contents)));
				}
			} else {
				//Assign Router to Simple Variable for Include
				$route = $this['router'];
				$response = $this['response'];
				//Include Routes
				if($this['files']->exists($this->base_path . '/app/Http/routes.php')){

					require_once $this->base_path . '/app/Http/routes.php';
				}
			}
			/**
			 * Store Cached Routes
			 */
			if ($this['config']->get('routes.cache') && !$this['files']->exists($this['config']->get('routes.compiled'))) {
				try {
					//Set Routes Cache
					if (!$this['files']->exists($this['config']->get('routes.compiled'))) {
						$allRoutes = $this['router']->getRoutes();
						//If Routes then Serialize
						if (count($allRoutes) > 0) {
							foreach ($allRoutes as $routeObject) {
								$routeObject->prepareForSerialization();
							}
						}
						//Store Routes in Cache
						$this['files']->put($this['config']->get('routes.compiled'), base64_encode(serialize($allRoutes)));
					}
				} catch (\Exception $exception) {
					if (!empty($exception->getMessage())) {
						add_action('admin_notices', function () use ($exception) {
							?>
							<div class="error notice">
								<p>&#9888; <?php echo $exception->getMessage(); ?></p>
								<p><em><? echo 'Route caching cannot serialize closures'; ?>.</em></p>
							</div>
							<?php
						});
					}
				}
			}
		}
	}
public function loadRoutes ( ) { if ( $ this -> bound ( 'router' ) ) { /**
			 * Use Cached Routes if Available
			 */ if ( $ this [ 'config' ] -> get ( 'routes.cache' ) && $ this [ 'files' ] -> exists ( $ this [ 'config' ] -> get ( 'routes.compiled' ) ) ) { $ contents = $ this [ 'files' ] -> get ( $ this [ 'config' ] -> get ( 'routes.compiled' ) ) ; if ( ! empty ( $ contents ) ) { //Get Cached Routes & Set Them $ this [ 'router' ] -> setRoutes ( unserialize ( base64_decode ( $ contents ) ) ) ; } } else { //Assign Router to Simple Variable for Include $ route = $ this [ 'router' ] ; $ response = $ this [ 'response' ] ; //Include Routes if ( $ this [ 'files' ] -> exists ( $ this -> base_path . '/app/Http/routes.php' ) ) { require_once $ this -> base_path . '/app/Http/routes.php' ; } } /**
			 * Store Cached Routes
			 */ if ( $ this [ 'config' ] -> get ( 'routes.cache' ) && ! $ this [ 'files' ] -> exists ( $ this [ 'config' ] -> get ( 'routes.compiled' ) ) ) { try { //Set Routes Cache if ( ! $ this [ 'files' ] -> exists ( $ this [ 'config' ] -> get ( 'routes.compiled' ) ) ) { $ allRoutes = $ this [ 'router' ] -> getRoutes ( ) ; //If Routes then Serialize if ( count ( $ allRoutes ) > 0 ) { foreach ( $ allRoutes as $ routeObject ) { $ routeObject -> prepareForSerialization ( ) ; } } //Store Routes in Cache $ this [ 'files' ] -> put ( $ this [ 'config' ] -> get ( 'routes.compiled' ) , base64_encode ( serialize ( $ allRoutes ) ) ) ; } } catch ( \ Exception $ exception ) { if ( ! empty ( $ exception -> getMessage ( ) ) ) { add_action ( 'admin_notices' , function ( ) use ( $ exception ) { ?>
							<div class="error notice">
								<p>&#9888; <?php echo $ exception -> getMessage ( ) ; ?> < / p > < p > < em > < ? echo 'Route caching cannot serialize closures' ; ?>.</em></p>
							</div>
							<?php } ) ; } } } } }
Load Routes into Router
Load Routes into Router