Questions tagged as 'psr-4'

2
answers

How and when should we use Interface to document systems in PHP?

I've always wanted to know exactly, if it's a good practice, to make a system always using Interfaces, or is it not necessary? Interface People { public function getName(); public function setName($string); public function getAge(); pu...
asked by 26.11.2015 / 12:45
1
answer

PSR-4 in an MVC project or not?

I have two codes, the first one uses spl_autoload_register and the other does not, however the second one loads "automatically the class" as well. With spl_autoload_register Uses namespaces to split MVC You can create multiple le...
asked by 10.08.2015 / 22:18
1
answer

My php system is running on Windows but it is giving UBUNTU error

I'm using PSR-4 auto-load. The error is as follows:    Fatal error: Uncaught Error: Class 'App \ Models \ Bll \ Professor' not   found in /var/www/html/unaprojetos/App/Controllers/Professor.php:12   Stack trace: # 0 /var/www/html/unaprojetos/...
asked by 26.10.2017 / 05:47
1
answer

How to configure Autoload Composer?

I'm looking for a lot of autoload in php, I decided to study about it, I managed to understand a good part, but I have a single specific doubt. Within the file composer.json , in the excerpt: "autoload": { "psr-4": { "App\...
asked by 30.03.2018 / 03:40
1
answer

Autoload class PSR4

I would like to create a autoload class that follows the PSR4 recommendations and can be used independently of the Composer autoload >. The application I'm creating will have the following structure: /root |--/src...
asked by 08.10.2015 / 23:26
1
answer

How to use psr-4 in composer with different subfolders

I'm creating a test framework. I use composer to create the structure of my project. The composer.json file looks like this: { "autoload": { "psr-4": { "App\": "src/app/mvc/" } } } I divided my project with the fo...
asked by 03.04.2017 / 20:15
1
answer

My autoload by the composer is not working

I'm learning to do autoload using the composer, but I'm getting the following error while performing the tests:    Fatal error: Class 'App \ Model \ Database' not found in /var/www/Library/index.php on line 5 It's like he's not finding th...
asked by 01.07.2017 / 21:23
0
answers

Problem with Composer - PSR-4

I'm studying Composer and its forms of autoload (classmap, file, psr-0, psr-4), however in my example it is appearing with the following error: Fatal error: Class 'Library\Exemplo' not found in/var/www/html/CursoPHP/composer/index.php on line...
asked by 24.09.2015 / 17:10