Skip to content
Snippets Groups Projects
Commit 5ac0f0d5 authored by Kenneth Ezekiel's avatar Kenneth Ezekiel
Browse files

mod: docker for env and autoloader

parent adf04dd8
No related merge requests found
version: "3.3" version: "3.3"
services: services:
web: web:
env_file:
- .env
container_name: tubes-1-letterpaw container_name: tubes-1-letterpaw
build: . build: .
image: tubes-1:latest image: tubes-1:latest
...@@ -18,6 +20,8 @@ services: ...@@ -18,6 +20,8 @@ services:
volumes: volumes:
- .:/var/www/html/ - .:/var/www/html/
db: db:
env_file:
- .env
container_name: tubes-1-database container_name: tubes-1-database
image: mysql:latest image: mysql:latest
restart: unless-stopped restart: unless-stopped
......
<?php
use app\base\BaseController;
spl_autoload_register(function ($className) {
if (!str_starts_with($className, "app\\")) {
return;
}
$className = substr($className, 4);
$className = str_replace("\\", "/", $className);
$class = __DIR__ . "/src/" . "{$className}.php";
include_once($class);
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment