Most voted "autoload" questions
18 questions
Sort by count of
-
5
votes1
answer553
viewsHow to configure Autoload Composer?
I am facing a lot with this autoload in php, I decided to study about it, I could understand a good part, but I have only one very specific doubt. Inside the archive composer.json, in the stretch:…
-
4
votes1
answer5136
views"New" autoload from 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. That in case, I can put autoload_de_teste ? Another…
-
2
votes2
answers470
viewsHow to use namespaces without classes with autoload from Composer?
I’m trying to use the classless namespaces with the Poser autoload, but I believe it is failing, for example: /Foo/Bar.php namespace Foo\Bar { function baz() { echo 'Funcionou'; } } /index php.…
-
1
votes1
answer59
viewsIgnore folder and classes with __autoload
I have the following folder structure in my project: Within app I have the following structure: And the following native function of the php to give auto load in the classes: <?php require_once…
-
1
votes1
answer369
viewsI am unable to load the 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 it My browser informs this message Fatal error: Uncaught Error: Class 'Core' not found in…
-
1
votes0
answers62
viewsAutoload of the Poser does not find class 2
I saw a question similar to mine, but I tried the proposed solution and it does not find the class at all. I’m already getting discouraged in using the Poser autoloader. Important: My environment is…
-
1
votes1
answer531
viewsAutoload of Poser is not working
Good night (or any shift in case you’re from the future). Well, my problem is objective, but so far unsolved. I developed an entire project on my windows PC using XAMPP. As the system has several…
-
0
votes1
answer291
viewsMy autoload by Poser is not working
I am learning to autoload using Composer, but am getting the following error while running the tests: Fatal error: Class 'App Model Database' not found in /var/www/Library/index.php on line 5 it’s…
-
0
votes0
answers641
viewsClass not found in namespace
I’m trying to use a class by using the namespace, but it always generates this error: Fatal error: Uncaught Error: Class 'Database\connect' not found in…
-
0
votes1
answer221
viewsAutoload no Javascript
I’m starting in Front End and wanted to know the best technique and tool/library to load dependency files on Javascript. I feel I could add in my html just a file . js and in this file control the…
-
0
votes1
answer56
viewsCan you list all namespaces from a specific one?
I need to instantiate a class by just passing her name and trying to instantiate her at several different nemapaces until I do. The Framework does not accept instantiating any class without the…
-
0
votes0
answers146
viewsI cannot mount autoload with PSR-4 for multiple folders and subfolders
I’m trying to pass a project to MVC and then created the following structure: pasta_projeto -App --Controllers ---Classes --Models ---Classes --views ---html -vendor --Controller ---Action.php…
-
0
votes1
answer1411
viewsFatal error: Cannot 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…
-
0
votes0
answers29
viewsrequire_once in helper codeigniter
I installed the mpdf library via Composer in codeigniter 2 and made a helper file where I call this library to generate the pdf. So within this helper I call autoload with require_once and it works…
-
0
votes1
answer92
viewsComposer - files autoload - does not work
My code in Composer.json looks like this { "name": "testesocial/vinicius", "description": "Login com facebook", "type": "project", "minimum-stability": "stable", "autoload": { "psr-4": { "Source\\":…
-
0
votes0
answers20
viewsHow to change __autoload to spl_autoload_register using array?
I know there’s a lot of websites about it. But I confess that I searched and did not understand. The point is that this site is old and was on a server needed to change it to newer version of PHP.…
-
-1
votes1
answer30
viewsError finding class in application using namespace
I am implementing the namespace with psr-4 in a small PHP application and it turns out that he is not finding the class Mvc\Controller\MyController and I don’t understand the cause The folder…
-
-4
votes1
answer34
viewsComposer PHP: how to load "repositories" after "autoload"
I have a question/problem regarding php Composer. Come on, my PHP projects are now mostly using Composer, to "modularize" some parts I started using the property repositories on Composer.json. I’m…