Questions tagged [autoload]

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

autoload
Filter by
Sorted by
Tagged with
1 vote
1 answer
900 views

Changing case of controller name

I have an application on my own computer (Kubuntu 13.10). When I use separate class to define routes everything works perfect. For instance, I have url backend/dictionaries which handled by module ...
pepper's user avatar
  • 1,752
0 votes
1 answer
127 views

how to configure tapestry module to autoload

Where is the pom.xml on step 5? How to configure the module to autoload? Thanks a lot.
Jerry's user avatar
  • 15
0 votes
1 answer
139 views

Autoload Random Pages [duplicate]

I have a repeating page loading function here, <script> var interval = 5; // in seconds var pages = [ 'http://example.com/index.php', 'http://example.com/about.php', 'http://...
Kiran RS's user avatar
  • 980
0 votes
0 answers
3k views

PHPExcel autoload with symfony 2.3.8

I have an issue in using PHPExcel with symfony 2.3.8, I have installed phpexcel through the following composer edit "require": { "phpoffice/phpexcel": "*" } Then in the command prompt I have ...
Kanagu's user avatar
  • 606
1 vote
3 answers
191 views

Auto redirecting to another pages at regular intervals

I want to create an application in PHP. concept is very simple, I want to just auto load every page randomly at a regular intervals. For example, if I entered to facebook.com, it would be auto load ...
Kiran RS's user avatar
  • 980
5 votes
1 answer
10k views

Fatal error in Autoloader.php on line 34 phpExcel

I want to use phpExcel, but when run the script I get this error: Fatal error: Uncaught exception 'PHPExcel_Exception' with message 'Multibyte function overloading in PHP must be disabled for string ...
Abduhafiz's user avatar
  • 3,386
0 votes
1 answer
587 views

Autoloading Custom Folder

I have a folder in app/models called form_objects. It contains a file called scoped_search.rb that defines a class: class ScopedSearch end In application.rb I have: config.autoload_paths += %W(#{...
Undistraction's user avatar
0 votes
2 answers
74 views

loading class with __autoload

I'm trying to write my site in Controller-Model-View convention without using any framework but I have a problem with __autoload function. Here's my source_folder/model/database.class.php file: <?...
Arkadiusz Galler's user avatar
12 votes
2 answers
3k views

I do not understand why someone need composer? [closed]

I think there is no need to include composer for loading any library etc. Loading some libraries is not hard task. Its easy to include... Download library > extract > put into your project > use it ...
thomas's user avatar
  • 341
2 votes
1 answer
908 views

Symfony autoloader component doesn't load my classes

I'm trying to setup symfony class loader component for one of my projects. When I try to create a new object from the Logger class I get Fatal error: Class 'MyPrefix\Log\Logger' not found in /usr/...
DRON's user avatar
  • 93
0 votes
1 answer
1k views

Code Igniter Composer Twitter Bootstrap

Could somebody please explain to me how to integrate Twitter Bootstrap in Codeingniter 2.14 via Composer? I've included composer's autoloader into index.php like so: /************ COMPOSER AUTOLOADER ...
Andriy Haydash's user avatar
0 votes
3 answers
3k views

Phalcon MVC model Exception

I'm trying to create an API with Phalcon for the first time. I have been followed the tutorial "http://docs.phalconphp.com/en/latest/reference/tutorial-rest.html", but encountered a problem. I've been ...
user3079839's user avatar
1 vote
1 answer
1k views

Running a PHPUnit Test yields "Class Not Found" Error

This is a question on PHP Unit Test giving me a Class Not Found Error. Background I am using Zend Studio 10.5 to develop a Zend Framework 2 application. I have a few modules loaded, including ...
Dennis's user avatar
  • 8,019
0 votes
1 answer
1k views

Reinit composer autoload

After updating via the Composer i want to initialize the application and send it events "scripts": { "post-update-cmd": [ "Acme\\Bundle\\DemoBundle\\Composer\\ScriptHandler::notify" ...
ghost404's user avatar
  • 319
2 votes
2 answers
425 views

Symfony2 - Composer class loader instance in controller

Is there a way to get the composer autoloader instance inside a Symfony2 Controller?
Steffen Brem's user avatar
  • 1,758
-1 votes
1 answer
3k views

Composer Autoloading PHP

I need help with composer autoloader. Well in my opinion I have set up everything correctly, but still I am having an error "class has been not found". So maybe someone here will be able to help me. ...
Dariss's user avatar
  • 1,258
0 votes
1 answer
64 views

PHP: Can the __autoload stack be persistent?

I think this cannot be done do to the fact the PHP is a stateless language. But I will ask anyway... I've created a home-grown MVC framework. The classes are all namespaced. On initial load I ...
Neil Girardi's user avatar
  • 4,697
0 votes
1 answer
167 views

spl_autoload and same filenames in different directories

The problem I am facing is that spl_autoload($class) passed in spl_autoload_register callback, will not load classnames which refer to the same filename, but in different directories. What I want to ...
Royal Bg's user avatar
  • 6,999
8 votes
4 answers
7k views

How to add case insensitive autoloading using composer generated classmap?

I have legacy project which has declartions and class usings in different cases. I want upgrade source to modern state. First I want to replace legacy autoloading by composer autoloading. But ...
sectus's user avatar
  • 15.7k
0 votes
1 answer
216 views

How to load stuff in /lib in a thread safe way?

I tried config.autoload_paths += Dir["#{config.root}/lib/**/"] and config.eager_load_paths += Dir["#{config.root}/lib/**/"] but keep getting the uninitialized constant error. I assume this has to do ...
randomguy's user avatar
  • 12.1k
0 votes
2 answers
843 views

Code Igniter Auto Load With custom name

i want to know is there way that I can pass my custom class name in autoload class Example: in a controller i know we can do this $this->load->library('parser','','my_parser') but ...
ahmad05's user avatar
  • 448
2 votes
0 answers
971 views

PHP & MVC: Trouble dynamically creating appropriate MVC Classes

I'm trying to build a CMS using the MVC pattern. The structure of my CMS is as follows: ->index.php: entry point. Contains the appropriate includes and creates the frontController which takes a ...
iLoveWagons's user avatar
  • 1,111
0 votes
2 answers
1k views

How to autoload a custom class in Zend Framework 2?

I'm using zend framework2 skeleton, and I'm trying to add my own classes behind vendor folder. The problem is: I don't know how to prepare the classes to be loaded on demand (autoloaded) only when I'...
ebr's user avatar
  • 37
0 votes
1 answer
77 views

php use one direction back

I'm trying to get working use. My file is in /application/controllers/indexController.php use application\models\Database; class IndexController extends Controller { public function ...
user3005741's user avatar
3 votes
2 answers
653 views

Where should I add autoload cookies in my Emacs Lisp package? Is there a definitive guide?

I maintain a somewhat popular Emacs package (ido-ubiquitous), and I would like to add the ;;;###autoload comments to my package so that it does not need to be loaded until its mode is activated. I ...
Ryan C. Thompson's user avatar
2 votes
1 answer
214 views

PHP Namespaces strange behaviour. Calling PDO method and __autoload is trigerred again?

I've following class and initPDO fails after adding setAttribute namespace DBInterface; class DBInterface { protected function initPDO() { $dsn = sprintf('sqlsrv:Server=%s;Database=%s', ...
Tom Raganowicz's user avatar
0 votes
2 answers
682 views

Joomla class autoloading

I'm trying to extend a Joomla class, and I know that Joomla supports autoloading of classes. But if I have a class like class MyClass extends JModelList where do I need to save this file so it ...
user101289's user avatar
  • 10.1k
1 vote
2 answers
2k views

How to create a standalone command line app with the Symfony2 ClassLoader and Console

I am trying to write a command line app using the Symfony2 Console and ClassLoader Components. This is a screenshot of my code hierarchy and the script being called Here is the CLI script: #!/usr/bin/...
Patrick's user avatar
  • 3,172
2 votes
3 answers
7k views

PHPUnit is giving me autoload.php not found exception

UPDATE I've fixed the problem, It was all about the right permissions in app/cache and app/logs. When I try to run PHPUnit in symfony2, Using this command phpunit -c app/ i get this huge error ...
Rafael Adel's user avatar
  • 7,735
1 vote
1 answer
967 views

JavaScript Autoloader: How To Recover From Errors

I have a proof-of-concept working for a JavaScript autoloader, but it currently suffers from a major flaw: it requires the code to be re-executed in its entirety rather than simply trying again from ...
VirtuosiMedia's user avatar
0 votes
1 answer
274 views

Autoloader Error after updating to Zend Framework 2.2.5

As a warning I am not a programmer. I inherited an application which uses Zend Framework and needs to be updated and I'm trying to do my best here. I will really appreciate if you can provide ...
vGeek's user avatar
  • 1
0 votes
3 answers
768 views

Geting a file name without the ".jpg" part

Ok I am using slimbox2 and want the user to be able to save a Hi-Res version of the image. Adding this to the .js file allows the EXACT same image to be saved with a link in the title: // ...
sraifk's user avatar
  • 33
1 vote
1 answer
2k views

Error with autoloader after using migration tool

I'm using the artisan tool in order to manage my DB schema. My project is developped with the Laravel framework and a SQLite DB. Yesterday I've tried to delete one of my migrations. I used the ...
Fractaliste's user avatar
  • 5,857
0 votes
2 answers
69 views

How I can use the Autoloading in PHP?

hi i learn php now and I test the Autoloading but it don't work. I have two files: start.php and myClass.php. The files I have in the path ./xampp/htdocs and I want If I start start.php use the ...
Tarasov's user avatar
  • 3,665
1 vote
0 answers
295 views

Google App Engine PHP SDK Libraries Include Error

Excuse my ignorance and possibly blindness... maybe I've been staring at this way too long. I have a Zend Framework app running on Google App Engine, and since this morning, a lot of the ...
rodrigo-silveira's user avatar
2 votes
1 answer
5k views

PHP autoload namespace

I want to autoload my classes putting only the namespace + the filename. Example: directories skeleton: \var\www |_ foo | |_ A.php | |_ B.php | |_ index.php A.php: <?php ...
cuarti's user avatar
  • 189
0 votes
2 answers
2k views

ZF2 namespace and file system

I have standard Application module in ZF2. It's configured by default, I didn't change anything. I just added some stuff: module/ Application/ src/ Application/ Entity/ ...
oleh.meleshko's user avatar
0 votes
2 answers
1k views

Why isn't CodeIgniter autoloading my package?

In my application/config/config.php, I want to autoload my library package: /* | ------------------------------------------------------------------- | Auto-load Packges | ----------------------------...
NobleUplift's user avatar
  • 5,797
0 votes
1 answer
136 views

Classes autoload using namespaces for parent and children

I read several articles about using namespaces in php but I didn't get it yet. I have 3 files: script.php and dog.php are located in same root folder, abstr. class animals.php is located in cls ...
NGix's user avatar
  • 2,632
0 votes
1 answer
337 views

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's user avatar
  • 128
1 vote
1 answer
150 views

What is the best practice for using non-namespaced classes within namespaced class

I am creating a library using the wonderful new namespacing features that PHP has implemented in recent updates. However, I need to use the simple_html_dom.php class from within one of my classes. I'm ...
Pastor Bones's user avatar
  • 7,291
0 votes
1 answer
235 views

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 ...
Pavel K.'s user avatar
  • 6,747
1 vote
1 answer
555 views

Using spl_autoload_register

Must I put the following lines in each PHP file I create to use autoloader? Or there is a solution to do it once, inside "index.php" of the application for example, and instantiate the classes in ...
user1889867's user avatar
1 vote
0 answers
77 views

Closures instance inside closure

I'm trying to figure out if my autoload function is the last loader, so that i can throw an exception. Of course i could make a loader class and check the class, but where is than fun in that. ...
user2946560's user avatar
0 votes
1 answer
3k views

Class Comment not found Laravel 4

Im trying to add a comment system to my laravel app. But I can't seem to get it working. I have two models class Post extends \Eloquent { protected $table = 'posts'; public function comments() ...
boortmans's user avatar
  • 1,158
5 votes
1 answer
5k views

LogicException error: Passed array does not specify an existing static method

here to ask is any error for my autoloader class/function with spl_autoload_register? appreciate for helping. here is my code <?php namespace system\core; // if(!defined('IN_APP')){ // ...
geass's user avatar
  • 63
1 vote
1 answer
466 views

TinyMVC PDO layer raising error on database query

When I use the built in PDO layer in TinyMVC to request records from a table, it returns the following error: Array Error: 0 Message: Unknown file 'register_view.php' File:{redacted}tinymvc\sysfiles\...
prog_24's user avatar
  • 781
0 votes
1 answer
112 views

PSR-0 Autoload Error

I want use composer for my projects. My project structure: src Easycache Common Cache Cache.php CacheInterface.php ... Namespace ...
kemal's user avatar
  • 371

1
26 27
28
29 30
41