Questions tagged as 'autoload'

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

"New" autoload PHP 7

I would like to understand the "new" autoload of PHP, in it I can choose the name I want to put? For example, in the old one, it was __autoload . In this case, can I put autoload_de_teste ? Another question is what does the spl...
asked by 30.10.2017 / 17:17
1
answer

Ignore folder and classes with __autoload

I have the following folder structure in my project: WithinappIhavethefollowingstructure: Andthefollowingnativefunctionofphptogiveautoloadinclasses:<?phprequire_once'/app/config.php';function__autoload($class_name){$folders=array('class',...
asked by 24.06.2017 / 16:21
1
answer

Composer Autoload is not working

Good evening (or any shift if you are from the future). Well, my problem is objective, but so far without a solution. I developed an entire project on my windows PC using XAMPP. As the system has several classes I'm using autoload of th...
asked by 19.06.2018 / 02:17
1
answer

I can not load classes using spl_autoload_register

I'm trying to load a class that is in another folder in the core.php file and I'm not getting My browser reports this message    Fatal error: Uncaught Error: Class 'Core' not found in   /var/www/html/cursophp/superAdvanced/mvc/views/index....
asked by 18.05.2018 / 14:45
0
answers

Autoload of composer does not find class 2

I saw a question similar to mine, but I tried the proposed solution and did not find the class at all. I'm already getting discouraged in using the composer autoloader. Important: My environment is Windows (Server 2016) with IIS. the physical...
asked by 27.05.2018 / 05:21
0
answers

require_once inside helper codeigniter

I installed the mpdf library via composer in codeigniter 2 and made a helper file where I call that library to generate the pdf. So inside that helper I call the autoload with require_once and it works perfectly locally. But when I went up in pr...
asked by 07.08.2018 / 22:11
0
answers

Migrating the site in Php 5.2 and the Autoloader for classes does not work

Good morning, I'm migrating the company website from a dev that was in LocalWeb to our LocalWeb hosting. I migrated the DB and the files, I made all the settings of notes, however the auloader function is not working returning the error "Not...
asked by 30.04.2018 / 15:43
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
1
answer

Fatal error: Can not redeclare spl_autoload_register ()

<?php function spl_autoload_register($class){require_once"{$class}.class.php";} class ConDB { private static $cnx; private function setConn() { return is_null(self::$cnx)? self::$cnx=new PDO("mysql:hos...
asked by 18.04.2018 / 15:59