/var/www/technexus/src/Controllers/Blog.php
return (new Admin())->handle($request);
case 'api':
return (new API())->handle($request);
case 'media':
return (new Media())->handle($request);
case 'logout':
return $this->logout();
case '.rss':
return (new RSS())->handle($request);
case '':
return $this->home($request);
break;
case 'topics':
return $this->topics();
case ctype_digit($action):
// year of posts
if (strlen($action) == 4) {
$year = $action;
}
// month of posts
if (ctype_digit($this->peekPath()) && strlen($this->peekPath()) == 2) {
$month = $this->shiftPath();
}
// single post
if ($this->peekPath()) {
$permalink = $this->shiftPath();
}
if (!$permalink && !$month) {
return $this->year($year);
}
if (!$permalink) {
Arguments
"Return value of technexus\Controllers\Blog::handle() must be an instance of Psr\Http\Message\ResponseInterface, null returned"
/var/www/technexus/src/Controllers/Main.php
* @uses Blog::handleRequest()
* @return void
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/site.LOCK')) {
echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/down.html');
exit;
}
/*
* This is to make sure any page that loads
* through Apache's ErrorDocument returns 200
* instead of 404.
*/
header('HTTP/1.0 200 OK');
//header('X-Powered-By: PHP/' . phpversion() . ' Div Framework (http://emr.ge) Henry\'s Revision');
$blog = new Blog();
return $blog->handle($request);
}
}
/var/www/technexus/src/App.php
return true;
}
}
return false;
}
/**
* Gets difference between process start and now in microseconds.
*
* @return void
*/
public function getLoadTime()
{
return (microtime(true)-DIVERGENCE_START);
}
public function handleRequest()
{
$main = new Main();
$response = $main->handle(ServerRequest::fromGlobals());
(new Emitter($response))->emit();
}
}
/var/www/technexus/bootstrap/router.php
<?php
/**
* This file is part of the Divergence package.
*
* (c) Henry Paradiz <henry.paradiz@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$app->handleRequest();
/var/www/technexus/public/index.php
<?php
require(__DIR__.'/../bootstrap/autoload.php');
require(__DIR__.'/../bootstrap/app.php');
require(__DIR__.'/../bootstrap/router.php');
Arguments
"/var/www/technexus/bootstrap/router.php"