autoload Questions

5

Solved

I am new to php and I want to use php5's __autoload functionality in my code. I wrote below code in my index.php but I don't understand how and when I should call __autoload function. function __...
Fossette asked 3/10, 2012 at 5:46

2

Solved

I'm new to slim framework, and can't figure out how to use the autoloader to autoload my classes. I created a app/models/myclass.php but of course when I try to use it I get a class not found. I'm...
Shackleton asked 19/7, 2015 at 11:28

1

Solved

On Composer's autoload optimization page: Note: You should not enable any of these optimizations in development as they all will cause various problems when adding/removing classes. The performa...
Sacramentalist asked 26/4, 2018 at 5:17

2

Solved

My question is in three parts: Does putting in a use statement trigger the autoloader immediately, or does it wait until the class is used? (lazy-loading) If autoloading isn't done in a lazy-load...
Innis asked 26/4, 2018 at 13:10

3

I just need to autoload some classes, and I don't like the psr-0 namespace insanity (no offense). This used to work just fine in my project: "psr-0": { "": [ "app/controller/", "app/model/" ]...
Jurist asked 28/7, 2013 at 17:4

3

Solved

How do you list all of the autoload paths in Rails? In Rails console when I do this, it only lists the custom paths added to the config: $ rails c Loading development environment (Rails 3.2.9) 1.9....
Hanhana asked 29/11, 2012 at 15:27

12

Solved

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them? From github: A few changes were done in this commit: Do not a...
Traherne asked 28/7, 2010 at 19:36

1

Solved

I'm trying to add an old Bundle that I have built on Symfony 3.* to Symfony 4 but I get this error: The autoloader expected class "App\SBC\TiersBundle\Controller\ChantierController" to be defin...
Slover asked 18/2, 2018 at 9:2

1

Solved

A PHP 7.1 application uses composer's autoloader to find class definitions. The namespace mappings are defined in a composer.json file. The application also uses ICU module's ResourceBundle classe...
Deplete asked 18/2, 2018 at 15:27

3

Solved

I have had a slight problem with autoloading in my namespace. As shown on the PHP manual here: http://us.php.net/manual/en/language.namespaces.rules.php you should be able to autoload namespace fun...
Swill asked 4/9, 2010 at 12:31

5

Solved

I have the following php code: index.php <?php spl_autoload_extensions(".php"); spl_autoload_register(); use modules\standard as std; $handler = new std\handler(); $handler->delegate(); ?...
Simpleminded asked 19/5, 2010 at 0:40

1

Solved

I have been beating my head for a couple hours trying to figure out why the autoload is not working for "Authentication\auth()". The "dBase\db()" class is loading just fine, but i'm getting: Err...
Caz asked 19/12, 2017 at 1:14

3

Solved

I've set up two projects, an 'init' and a library, which is required by the init. They both have PSR-0 autoloads set, but the autoload values from the library are not added to the vendor/composer/a...
Ratib asked 6/5, 2013 at 22:6

2

Solved

Emacs has this seemingly very nice facility for building autoload files based on magic source code comments ("autoload cookies") of the form ;;;###autoload, which are to be placed on lines by thems...
Salol asked 5/1, 2011 at 19:36

4

Solved

This is my first question, besides I'm not english-native speaker, so sorry in advance for newbie mistakes... I'm starting with Symfony2, and I've been facing an autoload problem for a couple of d...
Matriculate asked 29/9, 2013 at 17:4

4

I've created a library folder within the app folder to add my own classes. This is the content of the file app/library/helper.php: <?php namespace Library; class MyHelper { public functio...
Scholem asked 10/8, 2015 at 11:7

5

According to the top comment on the PHP page spl_autoload_register( ) : Good news for PHP 5.3 users with namespaced classes: When you create a subfolder structure matching the namespaces of t...
Abrahamsen asked 1/6, 2015 at 9:8

3

Solved

I'm a little confused with how I should be using psr-4 autoloading in Composer. Let's say I've got a folder structure like this: / |- Core/ | - Router.php |- App/ | - Models | User.php |- composer...
Clementclementas asked 22/3, 2016 at 15:43

7

Solved

I have a tiny application that i need an autoloader for. I could easily use the symfony2 class loader but it seems like overkill. Is there a stable extremely lightweight psr-0 autloader out there?...
Bernardinabernardine asked 22/8, 2012 at 22:54

3

Solved

In the past I've used Perl's AUTOLOAD facility for implementing lazy loading of symbols into a namespace, and wanted the same functionality in python. Traditionally the closest you appear to ...
Gann asked 21/6, 2009 at 18:17

1

Solved

I am writing Guards to handle OAuth for my Symfony 3 application. As part of it, in one of my services, I need to generate an absolute URL to send to Twitter as the Callback URL. #services.yml .....
Valet asked 26/4, 2017 at 9:48

4

Solved

what is autoload in PHP?
Haswell asked 31/8, 2010 at 9:6

5

I'm working on a Rails 4.2 app and have just added app/services/fetch_artists.rb to the structure. Inside this file, I have defined a class FetchArtists; end. When trying to run rails r 'FetchArti...
Mcvay asked 30/9, 2015 at 18:37

1

Solved

I have a class that I put inside lib/network: module NetworkApi class NetworkProxy end end Then in another class, I referenced this class: network_proxy = ::NetworkApi::NetworkProxy.new(para...
Stegman asked 10/1, 2017 at 2:25

3

Solved

I'm working on a project and it's getting a little too hard for me... I explain. I need to parse PDF files with PHP, to analyse the content of those files. To do that, I use pdfparser.org library....
Glaydsglaze asked 20/12, 2016 at 8:47

© 2022 - 2024 — McMap. All rights reserved.