Skip to content

Commit

Permalink
=1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecc-business-account committed Jan 9, 2024
1 parent bc595d0 commit a499859
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ Now, lets configure the paths


## Changelog
* 2024-01-09 1.31
* 2023-11-13 1.30.1
* fixed a bug with fetch() when the url fetched is null
* updated .htaccess, so it works better with different situations.
Expand Down
6 changes: 3 additions & 3 deletions lib/RouteOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* @package RouteOne
* @copyright 2019-2023 Jorge Castro Castillo
* @license (dual licence lgpl v3 and commercial)
* @version 1.30.1 2023-11-13
* @version 1.31 2024-01-09
* @link https://github.com/EFTEC/RouteOne
*/
class RouteOne
{
public const VERSION = '1.30.1';
public const VERSION = '1.31';
/** @var RouteOne */
public static $instance;
/** @var string The name of the argument used by apache and nginx (by default it is req) */
Expand Down Expand Up @@ -299,7 +299,7 @@ public function clearPath(): void
public function addPath(string $path, ?string $name = null, ?callable $middleWare = null): RouteOne
{
if (!$path) {
throw new RuntimeException('Path must not be empty, use default value to set a root path');
throw new RuntimeException('Path must not be empty, use a path with a default value, example: {controller:root}');
}
$path = trim($path, '/');
$x0 = strpos($path, '{');
Expand Down
4 changes: 2 additions & 2 deletions lib/RouteOneCli.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php /** @noinspection UnknownInspectionInspection */

namespace eftec\routeone;

Expand Down Expand Up @@ -243,7 +243,7 @@ public function menuRouterOneHtaccess(): void
{
$file = $this->cli->getValue('routerfilename') . '.php';
$content = $this->openTemplate(__DIR__ . '/templates/htaccess_template.php');
$content = str_replace('route.php', $file, $content);
$content = str_replace('changeme.php', $file, $content);
$this->validateWriteFile('.htaccess', $content);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/templates/htaccess_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
# Send Requests To router
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^ index.php [L]
RewriteRule ^(.*)$ index.php?req=$1 [L]
#RewriteRule ^ changeme.php [L]
RewriteRule ^(.*)$ changeme.php?req=$1 [L,QSA]
</IfModule>

0 comments on commit a499859

Please sign in to comment.