Oracle Consulting Oracle Training Oracle Support Development
Oracle Books
SQL Server Books
IT Books
Job Interview Books
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle


Privacy Policy




Oracle Tips by Burleson 

OO Magic

As in any OO implementation, there are few specific functions that perform special tasks.  For example, the _autoloadfunction is used to load the required class definition functions into the executing script.  In example13.php, there is the following line:


If there are several classes, each in its own definition file, those definition files have to be included into the script, each with its own ‘require_once’ line.

This can be awkward and cumbersome. If the PHP interpreter cannot find the definition of a given class $class_name, it will first try to execute function __autoload ($class_name). If the class $class_name is still not defined, the script will be terminated. Thus, the function is defined like this:

    function __autoload ($class_name) {

In example13.php, the programmer forgot to include OCI_Session.php. The script still works because the definition of the class OCI_Session is still included when the class is used. If all class definitions are kept in the files that have the same name as the class that is defined, it becomes unnecessary to write include statements for them as long as the function __autoloadin its above form exists within the script. Of course, the __autoload function can also be placed in an include file.

There are additional special functions in the PHP 5 object model that are outside the scope of this book. The next important part of this chapter deals with sessions.

See code depot for complete scripts

The above book excerpt is from:

Easy Oracle PHP

Create Dynamic Web Pages with Oracle Data

ISBN 0-9761573-0-6   

Mladen Gogala


Download your Oracle scripts now:

The definitive Oracle Script collection for every Oracle professional DBA

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster

Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   



 Copyright © 1996 -2017 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks

Hit Counter