Some severe classloading issue
- ttrepper
- Member | 11
Hi all, I am sorry if that's the wrong forum of if I have misunderstood something but I have a strange error and feel being stuck. I have started with this example: "":https://github.com/…ples/fifteen
Here is what I have:
folder structure is:
\
\index.php <- taken from doc. Entry point from webserver/browser
\app
\app\Bootstrap.php <- taken from doc
\vendor
\vendor\bin
\vendor\composer
\vendor\nette
\vendor\tracy
The content is for index.php (taken from here: "":https://github.com/…ww/index.php)
<?php
use App\Bootstrap;
require ('vendor/autoload.php');
App\Bootstrap::boot(); <----- here I get the Class "App\Bootstrap" not found exception
The content of Bootstrap.php (taken from here: "":https://github.com/…ootstrap.php)
namespace App;
use Nette\Bootstrap\Configurator;
class Bootstrap {
public static function boot() : void { //simplified
echo ("TEST");
}
}
Sorry for bothering – pretty sure it's a simple thing but I don't see it. Any help or pointing me to the right direction is highly appreciated please.
Thanks a lot in advance,
Thomas
- ttrepper
- Member | 11
Thank you @nightfish. No – I have not but I can add it. 😃 My composer.json looks like this:
{
"require": {
"tracy/tracy": "^2.10",
"nette/forms": "^3.1",
"nette/database": "^3.1",
"nette/bootstrap": "^3.2",
"nette/mail": "^4.0",
"nette/application": "^3.1"
}
}
In the example
"autoload": {
"psr-4": {
"App\\": "app"
}
},
Do I have to use the exact same block? What does “psr-4” mean?
Thank you very much in advance,
Thomas
- flowthentic
- Member | 2
What I can see on your code that namespace App is not
use
d…
Either use App
and call your
App\Bootstrap::boot()
With use App\Bootstrap
call Bootstrap::boot()
Or you can rawly call \App\Bootstrap::boot()
as well.