Questions tagged as 'php-autoload'

1
answer

Do php autoload functions make an object available to any part of the site in the same session, even in different sub directories?

I intend to make my code cleaner and so avoid using include or include_once all top of page. I would not like to use frameworks that already do this work as laravel for example. I want to create the "from the scratch" function....
asked by 27.04.2016 / 19:47
1
answer

composer extends class not found

How to use extends with composer autoloade? The way it is returned the following error: Fatal error: Class 'App\Modulos\Mail\Mail' not found in ...Google.php on line 7 Composer : "autoload": { "psr-4": { "App\": "app/" }...
asked by 25.10.2015 / 02:30
0
answers

Error Class not found with Composer

Well, folks, I'm doing a project here and giving me some problems, I think I'm mixing things up. I installed the composer to use autoload and other dependencies, but now I have a problem: The error you give me is as follows: Fatal error:...
asked by 18.02.2017 / 21:02
1
answer

Autoload of controllers using namespace

I'm trying to give a restructured in a personal microframework, before I did not use much pattern in the design structure, now I've thrown my whole backend in the source folder, and I'm using namespaces to separate the code. I'm having t...
asked by 17.09.2016 / 20:41
1
answer

Problem in autoload under test with PHPUnit and Composer in Windows

I'm having a problem with Composer in Windows 7. I developed a project with the following structure: Simpla_HTML |--/src | |--/Simpla | |--/Html | |--/Element.php /---tests | |--/Simpla | |--/Html |...
asked by 28.10.2015 / 15:50
1
answer

Auto load multiple directories

I have these functions: core / init.php: ... spl_autoload_register(function($class) { require_once ('libs/'.$class.'.php'); }); --- controllers / Images_Controller.php require_once "core/init.php"; require_once "models/Image.php"; r...
asked by 14.09.2015 / 18:26
2
answers

Autoload composer class not found

Good afternoon! I have a problem and I do not know how to solve it, so creating a mini application, using the autoload of the composer, but it is not working, it is giving the class does not exist. This is my structure: ├── app └── Conn...
asked by 18.07.2018 / 18:29
1
answer

PHP Moip class autoloader

How do I make this require 'vendor / autoload.php', it does not come in the documentation. <?php require 'vendor/autoload.php'; use Moip\Moip; use Moip\MoipBasicAuth; $endpoint = 'test.moip.com.br'; $token = '01010101010101010101010...
asked by 24.05.2015 / 20:50
1
answer

How to list all namespaces from a specific one?

I need to instantiate a class by just passing its name and trying to instantiate it in several different nemapaces until I can. I have a class with a namespace, but I can not get the namespace to instantiate it, but the problem is that this clas...
asked by 16.04.2018 / 17:06
0
answers

Problem in Autoload PHP

I'm starting in POO and SPL and recently I faced the following problem: I have the following file that does all bootstrapping of my application init.php , and in it I do autoload of all classes from the lib /...
asked by 10.10.2017 / 16:57