Skip to content

Commit

Permalink
fix php version 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bakeiro committed Dec 14, 2022
1 parent cd80850 commit 0a9d569
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 16 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
}
],
"require": {
"php": ">=7.0",
"ext-openssl": "*"
"php": ">=8.0",
"ext-openssl": "*",
"ext-mbstring": "*"
},
"require-dev": {
"sunra/dbug": "^0.2.1",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public function pageNotFound(): void
"body" => "The page which you are looking for its not available, try searching in another place or try this later."
];

$this->output->load("common/pageNotFound", $data);
$this->output->load("common/PageNotFound", $data);
}
}
6 changes: 6 additions & 0 deletions src/common/view/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@
</footer>

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, {});
});
</script>
</body>
</html>
1 change: 1 addition & 0 deletions src/common/view/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<link href="/www/dist/src.css?v=<?= $this->cache_version; ?>" rel="stylesheet">

</head>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public function samplePage(): void
// $product_data = $product_model->getAllProducts();
$product_data = ["product_name" => "test product", "product_price" => "9000€", "product_description" => "this is a test product"];

$this->output->load("product/productDescription", $product_data);
$this->output->load("product/ProductDescription", $product_data);
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public function index(): void

$this->output->addJs("products");

$this->output->load("welcome/welcome");
$this->output->load("welcome/Welcome");
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion system/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"email_from" => "",

"system_default_time_zone" => "Europe/Madrid",
"system_debug_console" => true,
"system_debug_console" => false,
"system_execution_time" => microtime(true),
"system_cache_version" => 0001, // Refresh frontend cache
"system_allow_forms_without_csrf" => false,
Expand Down
8 changes: 5 additions & 3 deletions system/engine/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function parsePath(): array
$method = $url_split[2];

if (!$this->isValidPath($file, $class, $method)) {
$file = 'src/common/controller/commonController.php';
$file = 'src/common/controller/CommonController.php';
$method = 'pageNotFound';
$class = "Common\\commonController";
$class = "Common\\CommonController";
}

return [
Expand All @@ -63,6 +63,8 @@ private function isValidPath($file, $class, $method): bool
{
$is_controller_ok = true;
if (!file_exists($file)) {
echo 'aaaa';
echo $file;
$is_controller_ok = false;
}

Expand All @@ -86,7 +88,7 @@ private function getPathFromSeoUrl(string $url_action): string
if (in_array($url_action, array_keys($routes))) {
return $routes[$url_action];
} else {
return "common/common/pageNotFound";
return "common/common/PageNotFound";
}
}
}

0 comments on commit 0a9d569

Please sign in to comment.