autoload

Yet another simple jQuery progress bar question

I want to modify this code so that the value is a variable and so that the progress bar refreshes in real time (or the smallest meter of time possible - milliseconds) I am going to "seed" the current time to drive the updates <script type="text/javascript"> $(function() { $("#container").progressbar({ value: 0 }); });...

jQuery Trigger event fires multiple times

I'm trying to get a jQuery lightbox to load up when a page loads. I got half way there. The lightbox opens when the page loads but then proceeds to open the link in the same window as a full page. How do I get it to stop at this point before loading the link in a separate window. jQuery: $(document).ready(function(){ $("a.greybox").b...

PHP Autloading in Namespaces

Hey everyone, 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 functions with a full qualified name e.g. \glue\common\is_email(). Thing is I have a function spl_autoload_register(array($import...

Autoloading Symfony classes in Zend_Framework

Hello, How to autoload Symfony classes in the app based on Zend Framework? Can I push some kind of Symfony autoloader to the Zend's Autoloader? I need to use some of the components like output escaper or dependency injection classes. ...

Some equivalent like autoload/Just-In-Time for non-OOP function libraries in php?

I'm working on a codebase with a lot of non-OO function libraries, and personally, I don't love php's java-inspired OO model. Unfortunately, I'm trying to solve the problem of the overhead that you get with a lot of included libraries, and see a lot of recommendation for autoloading. Which only works with classes. Is there any way to ...

How to masquerade child classes in parent class with autoloading (php)

I have a base class that is inherited by about ten subclasses. Most of these subclasses have very similar behavior, but I want to define specialized methods only for three of them. Is it possible to masquerade the existence of these classes, by autoloading the parent class every time an object of the child class is instantiated? This wa...

Autoloading classes when not in same directory as zend library

I've decided that rather than have a copy of the Zend Framework in each application's directory, I'd like to keep it on one location on the server, with the one copy used by all my websites. However, I'd like my app's custom classes to still be within the application folder. So a folder structure a bit like this: webroot |...library |...

How to open a prettyPhoto lightbox automatically when the page loads?

I am really new to Jquery and I have found several examples of opening a light box using cookies and the the onload feature. I am using the cookie example which works with fancybox, but I have been using prettyPhoto on all my sites and really do not want to change to fancybox. I have tried a dozen different ways to get this to work but...

If the file in __autoload has a Syntax Error, then the script stops without show a message

I have an __autoload function defined for load classes automatically, if that file has a syntax error, the script stops, simply stops... without error... function __autoload( $var_class ) { require_once( "$var_class.php" ); } echo "Before load..."; new ClassName(); echo "Hello world..."; Output: Before load... How to show de SYN...

php __autoload() and dynamic / runtime class definition - is there a way without eval?

Hi, I read this post after doing a search for related posts. I have a slightly different, but related problem. Is there a way WITHOUT EVAL() (because this is a bad idea - open for abuse if someone allows a user to supply the value that is used in eval, etc) such that you can define the structure of the class, for example: if(!class_e...

There is a way to use CLASS_EXISTS and __autoload without CRASH the script?

Example: ClassName.php <?php echo "This will crash all"; ?> In another file... foreach ($FILENAMES_WITHOUT_DOT_PHP as $name => $value) { if (class_exists( $value )) { echo "ClassName exists..."; } else { echo "ClassName doesn't exists...."; } } The output of this code is: This will crash all Instead o...

Conflict between Codeigniter AUtoload and Flourish Autoload functions

I am developing a web application, using the Codeigniter ( http://codeigniter.com/ ) framework plus the Flourish library (unframework) ( http://flourishlib.com/ ). I simply dropped the flourish folder into my application, then I created a flourish initialization and config files as instructed (these create the Flourish autoload). This ...

Change auto-load on scroll logic (prevent user from waiting)

Hi, Currently, I use the following logic to auto-load new posts from the database when the user reaches the bottom of the site: $(window).scroll(function() { if ($(window).scrollTop() == $(document).height() - $(window).height()) { last_msg_funtion(); } }); Fair enough. It does what it's supposed to do, but I'd like to change thi...

Using the PHP spl_autoload_register() with Codeigniter

Hello, Please how can I use spl_autoload_register() with Codeigniter? I need to do this because Im using Codeigniter with another framework which also uses autoload. I saw something here http://stackoverflow.com/questions/3710480/php-spl-autoload-register but I dont know how to target the CodeIgniter autoload. Im new to OOP and Code...

[closed/typo debugged, thanks :)] PHP global, nested/inherited autoload.

PHP 5.3.3-pl1-gentoo (cli) (built: Aug 17 2010 18:37:41) Hi all, I use a simple autoloader in my project's main file (index.php): require_once("./config.php"); require_once("./app.php"); require_once("./../shared/SqlTool.php"); function __autoload($className) { $fn = 'file-not-exists-for-{$className}'; if (file_exists("....

Can I inject google AJAX API autoload anywhere else than globally?

Hi, There is this issue I am struggling with. I know that the autoload for the google visualization geomap must be in the part of your document. The thing is every time I reload some other pages in my application the google reloads everything and this I want to take out. So I tried taking the : <script type="text/javascript" src="htt...

How unique is PHP's __autoload()?

PHP's __autoload() (documentation) is pretty interesting to me. Here's how it works: You try to use a class, like new Toast_Mitten()(footnote1) The class hasn't been loaded into memory. PHP pulls back its fist to sock you with an error. It pauses. "Wait," it says. "There's an __autoload() function defined." It runs it. In that function...

Reopen autoloaded class from within a Rails 3 plugin?

I have a Rails 3 app that defines some classes like normal. I am trying to figure out how to reopen one of those classes within a plugin (generated by "rails generate plugin ..."), and have both of the files (the file in the app itself and the file in the plugin) automatically reload on every request in development mode. A simple exampl...

Auto-load a module on python startup

I want IPython or the Python interpreter to auto-load a module when I start them. Is it possible? For example when I start IPython: $ ipython ... >>> from __future__ import division >>> from mymodule import * In [1]: Something like this. Thanks! ...

Rails3 not reloading code in lib while in development mode

THE SITUATION: I have code in lib/foo/bar.rb with a simple method defined as such: module Foo class Bar def test "FooBar" end end end In my helper, FooBarHelper, I have: require `lib/foo/bar` module FooBarHelper def test_foo_bar fb = Foo::Bar.new fb.test end end In my view, I call this helper method li...