|
|
@ -78,7 +78,7 @@ class Nex implements MessageComponentInterface |
|
|
|
// Route request |
|
|
|
// Route request |
|
|
|
switch (true) |
|
|
|
switch (true) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Item |
|
|
|
// Chanel item |
|
|
|
case (bool) preg_match('/\/(?<id>\d+)($|\.gmi)$/i', $request, $attribute): |
|
|
|
case (bool) preg_match('/\/(?<id>\d+)($|\.gmi)$/i', $request, $attribute): |
|
|
|
|
|
|
|
|
|
|
|
$lines = []; |
|
|
|
$lines = []; |
|
|
@ -145,7 +145,7 @@ class Nex implements MessageComponentInterface |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
// Chanel |
|
|
|
// Channel page |
|
|
|
case (bool) preg_match('/^\/(?<alias>.+)$/i', $request, $attribute): |
|
|
|
case (bool) preg_match('/^\/(?<alias>.+)$/i', $request, $attribute): |
|
|
|
|
|
|
|
|
|
|
|
$lines = []; |
|
|
|
$lines = []; |
|
|
@ -207,23 +207,35 @@ class Nex implements MessageComponentInterface |
|
|
|
// Not found |
|
|
|
// Not found |
|
|
|
default: |
|
|
|
default: |
|
|
|
|
|
|
|
|
|
|
|
$lines = []; |
|
|
|
// Try static route settings |
|
|
|
|
|
|
|
if (isset($this->_config->route->{$request})) |
|
|
|
// Get channels |
|
|
|
|
|
|
|
foreach ((array) $this->_database->getChannels() as $channel) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
$lines[] = sprintf( |
|
|
|
$response = file_get_contents( |
|
|
|
'=> /%s %s', |
|
|
|
$this->_config->route->{$request} |
|
|
|
$channel->alias, |
|
|
|
|
|
|
|
$channel->title |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Build response |
|
|
|
// Build site map |
|
|
|
$response = implode( |
|
|
|
else |
|
|
|
PHP_EOL, |
|
|
|
{ |
|
|
|
$lines |
|
|
|
$lines = []; |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Get channels |
|
|
|
|
|
|
|
foreach ((array) $this->_database->getChannels() as $channel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$lines[] = sprintf( |
|
|
|
|
|
|
|
'=> /%s %s', |
|
|
|
|
|
|
|
$channel->alias, |
|
|
|
|
|
|
|
$channel->title |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build response |
|
|
|
|
|
|
|
$response = implode( |
|
|
|
|
|
|
|
PHP_EOL, |
|
|
|
|
|
|
|
$lines |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Debug message event on enabled |
|
|
|
// Debug message event on enabled |
|
|
|