Skip to content

Commit

Permalink
Merge pull request #3 from DasunNethsara-04/main
Browse files Browse the repository at this point in the history
namespaces changed
  • Loading branch information
DasunNethsara-04 authored Oct 24, 2024
2 parents fb203db + 7c844d7 commit f932f9e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Base application configs
APP_NAME="My App"
APP_URL=http://localhost:8000/
APP_VERSION="1.0.0"
APP_VERSION="1.1.0"

# database configs
DB_HOST="localhost"
Expand Down
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file contains the example environment variables for the application
# Base application configs
APP_NAME="<App Name>"
APP_URL=http://localhost:8000/
APP_VERSION="1.0.0"
APP_URL="http://localhost:8000/"
APP_VERSION="1.1.0"

# database configs
DB_HOST="<server IP>"
Expand Down
7 changes: 3 additions & 4 deletions App/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

namespace ZenithPHP\App;

use ZenithPHP\App\InitEnv;
use ZenithPHP\App\Router; // Correct namespace for Router
use ZenithPHP\Core\Http\InitEnv;
use ZenithPHP\Core\Http\Router;

InitEnv::load();


// Correct namespace for Router
Router::get('/', 'WelcomeController', 'index');
4 changes: 2 additions & 2 deletions App/InitEnv.php → Core/src/Http/InitEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// InitEnv.php

namespace ZenithPHP\App;
namespace ZenithPHP\Core\Http;

use Dotenv\Dotenv;

Expand All @@ -11,7 +11,7 @@ class InitEnv
public static function load(): void
{
// This loads the .env file located in the current directory (__DIR__)
$dotenv = Dotenv::createImmutable(__DIR__ . '/../');
$dotenv = Dotenv::createImmutable(__DIR__ . '/../../../');
$dotenv->load();

// DB info using $_ENV
Expand Down
2 changes: 1 addition & 1 deletion App/Router.php → Core/src/Http/Router.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ZenithPHP\App;
namespace ZenithPHP\Core\Http;

class Router
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Includes;
namespace ZenithPHP\Core\Includes;

use Random\RandomException;

Expand Down

0 comments on commit f932f9e

Please sign in to comment.