Questions tagged [autoload]

autoload is a language convention which allows missing classes or method dependencies to be loaded on-demand.

autoload is implemented differently among languages which include it:

  • Perl's AUTOLOAD allows you to dynamically interpret method calls.
  • PHP's __autoload loads classes. To handle missing methods, the __call() magic method may be used.
  • Ruby's autoload command loads modules.
1633 questions
0
votes
1 answer

Autoload for PHP App Engine to load sdk classes

Is there a existing module or file to manage autoloading of sdk classes when using PHP GAE ? This would avoid to require a file when using a class of the google sdk. Thank you for any clue.
ip512
  • 128
  • 2
  • 9
0
votes
1 answer

rails 3 won't autoload one helper from another helper

I have a custom helpers path lib/helpers, which i autoload by adding following in application.rb: config.autoload_paths += %W(classes helpers).map{|dir| "#{Rails.root}/lib/#{dir}"} One of the helpers, VideoHelper, utilizes FileHelper in one of it's…
Pavel K.
  • 6,697
  • 8
  • 49
  • 80
0
votes
1 answer

PSR-0 Autoload Error

I want use composer for my projects. My project structure: src Easycache Common Cache Cache.php CacheInterface.php ... Namespace namespace…
kemal
  • 371
  • 2
  • 4
  • 14
0
votes
1 answer

PHP autoloader and namespaces

Ordinarily I see complex autoloading solutions that require the user to hydrate them with a pre-defined set of paths/directories with which to look through when autoloading a class. Or they have a complex glob-like search which then builds a cache…
AgmLauncher
  • 7,070
  • 8
  • 41
  • 67
0
votes
1 answer

Restler 3 RC4 and Amazon Web Services (AWS)

I was having trouble getting the autoload working with Restler 3 RC4 and Amazon Web Services (AWS). Arul provided a fix which worked beautifully. $loader = require_once…
jecz
  • 21
  • 1
  • 7
0
votes
2 answers

How to use autoload classmaps for libraries in Zend Framework 2?

With the Zend Framework Tool (ZFTool) one can make the application faster, using the classmap- (instead of the namespace-) based class loading (s. here). $ cd /path/to/my_project $ cd module/MyModule/ $ zf classmap generate . ./autoload_classmap.php…
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
1 answer

FuelPHP's Autoloader is failing to find classes

I'm having a problem with FuelPHP failing to autoload classes. On my staging server (Ubuntu, PHP 5.3.10) it is unable to find custom classes in the fuel/app/classes directory, and it also can't run oil test (I get the error message sh: 1: phpunit:…
Nick F
  • 9,781
  • 7
  • 75
  • 90
0
votes
1 answer

PHP Autoload - File Found - Class Fatal Error

I have a function on load that checks a users login status. Here is a small chunk of the code... // // user is logged in, get user info $user = Model\User::getByKey($_COOKIE['ukey']); if($user->field('id') >= 1 || !isset($status)) { // //…
bbullis
  • 532
  • 7
  • 20
0
votes
1 answer

Why does the ZF2 autoloader build the path wrongly?

I have an application with some modules. One of them is CourseSearch. Now I want to add a further one, the SportsPartnerSearch. Since these two modules are very similar to each other, I simply "cloned" / copied the CourseSearch and replaced all…
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
2 answers

Implementing Interface and Autoloading Classes

I have a issue, i have the following interface (http://pastebin.com/c11xbdxh) and i have the following class which implements the interface above (http://pastebin.com/m1zGNfSm). I am using the following autoload function in order to load the classes…
user747588
0
votes
1 answer

Restler3 RC4: api-list stays empty

I've got a problem with new Restler3 RC4: My API list in resource.json is just empty: { "apiVersion": "1", "swaggerVersion": "1.1", "basePath": "xxxxxx/API/index.php", "apis": [ ] } But by uncommenting the…
user1289915
0
votes
1 answer

loading a class from a parent namespace

i'm working on an application in a modular way, that is, i have a interface and i want to make an unit test for all the classes that implement that interface so i made an abstract class that have all the logic implemented(testing if the class is…
0
votes
1 answer

PHP: see which file uses __autoload?

In PHP I'm using the __autoload function, where I can see which class is being called. I wish to be able to see what file is actually calling the class. Is this possible ? In the documentation at http://php.net/manual/en/language.oop5.autoload.php…
Dylan
  • 9,129
  • 20
  • 96
  • 153
0
votes
2 answers

Magento DOMPDF autoloading iisue

I see following entries in my log file: 2013-08-28T17:45:09+00:00 ERR (3): Warning: include(DOMPDF.php) [function.include]: failed to open stream: No such file or directory in…
Damir Mitrovic
  • 618
  • 1
  • 5
  • 14
0
votes
1 answer

How to handle external sub prototype with local AUTOLOAD in Perl

I'm having an issue with the following scenario. I'm writting a class that uses AUTOLOAD somtimes to call functions from another module (not mine). This other module use a few functions where prototypes are defined. One example is this: sub…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
1 2 3
99
100