In oracle data guard configuration, you need to setup one or more additional databases beside the primary database. These additional databases are called standby database. Up to nice standby database can be created for one primary database.
Using a backup of primary database you can set up standby database and then you can made standby database as part of data guard configuration. Once you configured standby database, data guard automatically maintains standby database by transmitting redo log from the primary database and then applying redo to the standby database.
A standby database can be of three types.
1)Physical Standby Database: A physical standby database is an identical copy of the primary database. The disk structures are also identical with primary database. It is kept synchronized with the primary database by Redo Apply- which means the redo data is received from the primary database and then redo is applied to the physical standby database.
Note that as of Oracle Database 11g release 1 (11.1), a physical standby database can receive and apply redo while it is open for read-only access. You can use physical standby database for query and reporting purpose along with data protection.
2)Logical Standby Database: A logical standby database is the same logical information of the primary database. The physical data structure need not to be same on the standby database. It is kept synchronized with the primary database by SQL Apply- which means the redo data is received from the primary database, transforms redo data into SQL statements and at last executes the SQL statements on the standby database.
You can use logical standby database for query and reporting purpose along with data protection. Also you have to facility to upgrade oracle database software and patch sets along with data protection with help of logical standby database.
3)Snapshot Standby Database: A snapshot standby database is a convertible copy of the physical standby database but the difference from the physical or logical standby database is, the redo data that it received does not apply into it. The redo is applied whenever it is converted back to the physical standby database. You can play with the snapshot standby database and while converting to physical standby database from snapshot standby database these local updates are discarded.
Note that in case of snapshot standby database, the time needed to perform a role transition is directly proportional to the amount of redo data that needs to be applied.
Related Documents
http://arjudba.blogspot.com/2009/04/what-is-oracle-data-guard.html
Friday, April 3, 2009
Different types of standby database in oracle data guard
| Reactions: |
Thursday, April 2, 2009
What is oracle data guard
Oracle data guard is the term(you can call it a feature too) used by oracle and this feature is integrated with oracle RDBMS. Data guard create, maintain, manage and monitor one/more extra databases -called standby database, beside production database. The goal is to survive production databases from any disasters, failure or data corruptions.
At first, an exact replica of production database is created, which referred to as standby database later. Data guard then maintains and keep up to date of these standby databases with of production database. If production database becomes unavailable then data guard can switch standby database to production role and thus minimize the downtime without any data loss.
In addition to availability of production database data guard gives other advantages. Like we can do real time query in standby database, do backup operation in it and thus minimize the load of production database.
There is no restriction about the location of the stand by databases. They can be located thousands miles away from the production database or can be within same room, provided they can communicate each-other.
The more features, configurations, advantage about oracle data guard will be discussed gradually.
Related Documents
http://arjudba.blogspot.com/2009/04/different-types-of-standby-database-in.html
At first, an exact replica of production database is created, which referred to as standby database later. Data guard then maintains and keep up to date of these standby databases with of production database. If production database becomes unavailable then data guard can switch standby database to production role and thus minimize the downtime without any data loss.
In addition to availability of production database data guard gives other advantages. Like we can do real time query in standby database, do backup operation in it and thus minimize the load of production database.
There is no restriction about the location of the stand by databases. They can be located thousands miles away from the production database or can be within same room, provided they can communicate each-other.
The more features, configurations, advantage about oracle data guard will be discussed gradually.
Related Documents
http://arjudba.blogspot.com/2009/04/different-types-of-standby-database-in.html
| Reactions: |
Wednesday, April 1, 2009
Object interface example in php
Think about your laptop or computer, you did not interact with the things that is inside within it. To on your machine you press the power button. Similarly you interact with your machine through mouse, keyboard etc. The methods through which you interact with the object togetherly forms an interface.
You can define an interface in this way. An interface is the group of related methods without bodies. Details implementation of the interface will be within classes that implements the interface.
Note that, all methods in the interface must be public as by it's nature and if a class implements an interface all the methods must be defined within the class. Interface methods does not tell how it will work that is details implementation of interface methods must be handle within the class that implements the interface; how that class will use the method.
You can't create instance of an interface. Interface can be subclassed.
To create an interface you have to use interface keyword followed by the curly brace. Methods declaration will be inside the curly brace. To implements an interface you have to use implements keyword with the class definition that will implement the interface.
Below is an example of using interface.
Related Documents
http://arjudba.blogspot.com/2009/03/abstract-class-and-abstract-method-with.html
http://arjudba.blogspot.com/2009/03/static-declaration-with-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
You can define an interface in this way. An interface is the group of related methods without bodies. Details implementation of the interface will be within classes that implements the interface.
Note that, all methods in the interface must be public as by it's nature and if a class implements an interface all the methods must be defined within the class. Interface methods does not tell how it will work that is details implementation of interface methods must be handle within the class that implements the interface; how that class will use the method.
You can't create instance of an interface. Interface can be subclassed.
To create an interface you have to use interface keyword followed by the curly brace. Methods declaration will be inside the curly brace. To implements an interface you have to use implements keyword with the class definition that will implement the interface.
Below is an example of using interface.
<?php
interface a{
public function method1();
}
interface b{
public function method2();
}
interface c extends a,b{
public function method3($name);
}
class d implements c{
public function method1(){
}
public function method2(){
}
public function method3($name){
}
}
?>
Related Documents
http://arjudba.blogspot.com/2009/03/abstract-class-and-abstract-method-with.html
http://arjudba.blogspot.com/2009/03/static-declaration-with-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
| Reactions: |
Tuesday, March 31, 2009
Abstract class and abstract method with example in php
In php, you can define a class as abstract class. In fact if you want to keep any method of a class as abstract that class must be declared as abstract class. So, there is both abstract classes and abstract methods.
A class defined as abstract class can't be instantiated, which means we can't create instance of that class but it can be subclassed. If methods are declared as abstract then they can't conatin implementation, that means without any braces and followed by semicolon(;) like,
abstract protected function display();
Abstract class may or may not include abstract methods.
When a subclass is inherited from abstract class all methods marked as abstract class declaration in the parent must be defined in the subclass.
The scope of the derived class method must be less restrictive than the scope of the base class method if it is declared as abstract method. For example, if base class abstract method is declared as protected then within derived class method or in other word the function implementation must be defined as either protected or public, but not private.
Below is an example of abstract class and abstract method in php,
An the output is,
Related Documents
http://arjudba.blogspot.com/2009/03/static-declaration-with-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
A class defined as abstract class can't be instantiated, which means we can't create instance of that class but it can be subclassed. If methods are declared as abstract then they can't conatin implementation, that means without any braces and followed by semicolon(;) like,
abstract protected function display();
Abstract class may or may not include abstract methods.
When a subclass is inherited from abstract class all methods marked as abstract class declaration in the parent must be defined in the subclass.
The scope of the derived class method must be less restrictive than the scope of the base class method if it is declared as abstract method. For example, if base class abstract method is declared as protected then within derived class method or in other word the function implementation must be defined as either protected or public, but not private.
Below is an example of abstract class and abstract method in php,
<?php
abstract class AbstractClass{
//Only abstract class declartion here. Implementation must be inside subclass
abstract protected function abstractTest1();
abstract protected function abstractTest2($suffix);
public function display(){
echo $this->abstractTest1();
}
}
class SubClass1 extends AbstractClass{
protected function abstractTest1(){
return "SubClass1";
}
public function abstractTest2($suffix){
return "SubClass1 ".$suffix;
}
}
class SubClass2 extends AbstractClass{
public function abstractTest1(){
return "SubClass2";
}
public function abstractTest2($suffix){
return "SubClass2 ".$suffix;
}
}
$subclass1Instance=new SubClass1();
$subclass1Instance->display(); //Protected method can be called here.
echo "<br />";
echo $subclass1Instance->abstractTest2("Class1");
echo "<br />";
$subclass2Instance=new SubClass2();
echo $subclass2Instance->abstractTest1(); //As we declared public so can be access here.
echo "<br />";
echo $subclass2Instance->abstractTest2("Class2");
?>
An the output is,
SubClass1
SubClass1 Class1
SubClass2
SubClass2 Class2
Related Documents
http://arjudba.blogspot.com/2009/03/static-declaration-with-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
| Reactions: |
Static declaration with example in php
In php, you can declare method or member of a class as static. If you do so then you can access the method/member without creating any instance.
In fact, if you declare a member of a class as static then that member can't be accessed with an instantiated class object. So you would not be able to access a static variable using arrow sign. However static method can be accessed via instantiation.
Another thing about static method is, the pseudo variable $this is not available inside the method declared as static.
Below is an example of static declaration with example in php.
And in browser the output is,
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
In fact, if you declare a member of a class as static then that member can't be accessed with an instantiated class object. So you would not be able to access a static variable using arrow sign. However static method can be accessed via instantiation.
Another thing about static method is, the pseudo variable $this is not available inside the method declared as static.
Below is an example of static declaration with example in php.
<?php
class StaticExample{
static $staticVariable=10;
static function staticMethod(){
echo "This method is declared as static";
}
}
echo StaticExample::$staticVariable;
echo "<br />";
StaticExample::staticMethod();
echo "<br />";
$staticExampleInstance=new StaticExample();
$staticExampleInstance->staticMethod();
echo "<br />";
echo $staticExampleInstance->staticVariable; //This is undefined, so no output will be displayed.
?>
And in browser the output is,
10
This method is declared as static
This method is declared as static
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
| Reactions: |
Monday, March 30, 2009
Public, protected and private scope in php
Prepend the public or private or protected keyword before a variable declaration define the scope of the variable.
If the variable is declared as public then that variable can be accessed from anywhere.
If the variable is declared as proteced then that variable can be accessed from parent class and inherited classes and the class that define the variable.
If variable is declared as private then it is only available within the class that defines it.
If neither public/private/protected keyword are specified in declaration then by default the method/variable becomes public.
Below is an example with these keywords.
And the output is,
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
If the variable is declared as public then that variable can be accessed from anywhere.
If the variable is declared as proteced then that variable can be accessed from parent class and inherited classes and the class that define the variable.
If variable is declared as private then it is only available within the class that defines it.
If neither public/private/protected keyword are specified in declaration then by default the method/variable becomes public.
Below is an example with these keywords.
<?php
class BaseClass{
public $publicVar='Public Variable ';
protected $protectedVar='Protected Variable ';
private $privateVar='Private Variable';
public function display(){
echo $this->publicVar;
echo $this->protectedVar;
echo $this->privateVar;
}
}
class DerivedClass extends BaseClass{
protected $protectedVar2='Protected Variable 2';
function display(){
echo $this->publicVar;
echo $this->protectedVar;
echo $this->protectedVar2;
echo $this->privateVar;
}
}
$baseInstance=new BaseClass();
echo $baseInstance->publicVar; //It will work as public
echo "<br />";
//echo $baseInstance->protectedVar; //Fatal error as protected can be accessed within base and derived class.
//echo "<br />";
//echo $baseInstance->privateVar; //Fatal error as private can be accessed within it's own class
//echo "<br />";
echo $baseInstance->display(); //show all three as display is the method of the class.
echo "<br />";
$derivedInstance=new DerivedClass();
echo $derivedInstance->display(); //private variable of base class will not be shown.
?>
And the output is,
Public Variable
Public Variable Protected Variable Private Variable
Public Variable Protected Variable Protected Variable 2
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html
| Reactions: |
Constructors and Destructors in php
From php5, constructors method can be declared within class. If you have declared a constructor in a class that the constructor method will be automatically called during creation of an instance of the class. So, you can declare a constructor whenver you think the initialization of an object must needed everytime after an instance is created.
Note that, you have both parent and child constructor corresponding to parent and child table. If you create an instance of the child table, parent constructor is not called implicitly. To call the parent constructor while creating child object, within child constructor you have to call parent constructor explicitly. Constructor is declared by keyword __construct (note that double underscore(__) is prepend before construct) and calling the parent constructor is done by parent::__construct().
As constructor is created for some initialization of the object, destructor comes for to destroy the object. Or in other word destructor is used to release any resources allocated by the object. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence.
Below is an example of using both constructor and destructor.
And the output on the browser is,
Note that parent constructor is not called with the creation of child instance. In other to do so we have to call it within child constructor as shown below.
And output is below.
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
Note that, you have both parent and child constructor corresponding to parent and child table. If you create an instance of the child table, parent constructor is not called implicitly. To call the parent constructor while creating child object, within child constructor you have to call parent constructor explicitly. Constructor is declared by keyword __construct (note that double underscore(__) is prepend before construct) and calling the parent constructor is done by parent::__construct().
As constructor is created for some initialization of the object, destructor comes for to destroy the object. Or in other word destructor is used to release any resources allocated by the object. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence.
Below is an example of using both constructor and destructor.
<?php
class ParentClass {
function __construct(){
echo "This is the parent constructor. ". get_class($this);
echo "<br />";
}
}
class ChildClass extends ParentClass{
function __construct(){
echo "This is the child constructor. ".get_class($this);
echo "<br />";
}
function __destruct() {
echo "Destroying child object ";
}
}
$childInstance=new ChildClass();
?>
And the output on the browser is,
This is the child constructor. ChildClass
Destroying child object
Note that parent constructor is not called with the creation of child instance. In other to do so we have to call it within child constructor as shown below.
<?php
class ParentClass {
function __construct(){
echo "This is the parent constructor. ". get_class($this);
echo "<br />";
}
}
class ChildClass extends ParentClass{
function __construct(){
parent::__construct();
echo "This is the child constructor. ".get_class($this);
echo "<br />";
}
function __destruct() {
echo "Destroying child object. ". get_class($this);
}
}
$childInstance=new ChildClass();
?>
And output is below.
This is the parent constructor. ChildClass
This is the child constructor. ChildClass
Destroying child object. ChildClass
Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
| Reactions: |
Sunday, March 29, 2009
require_once and include_once in php
The include_once parameter is almost same as include and the require_once parameter is almost same as require. Both of require and include is described with example in http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html. The only difference from include and require is that with require_once/include_once if the file is already included, it will not include again.
For example, if within your script you use below code then behavior will depend based on php version and OS type.
<?php
include_once 'test.php';
include_once 'Test.php';
?>
As of php 4.0 once test.php is included and then again Test.php is included regardless of OS. For case insensitive OS both test.php and Test.php point just one file but they are included twice. This behavior is changed in php 5.0. From php 5.0, on case insensitivity OS for example on windows machine test.php is included only once. But on unix file system they are included in each test.php and Test.php as they represent two different files.
Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html
For example, if within your script you use below code then behavior will depend based on php version and OS type.
<?php
include_once 'test.php';
include_once 'Test.php';
?>
As of php 4.0 once test.php is included and then again Test.php is included regardless of OS. For case insensitive OS both test.php and Test.php point just one file but they are included twice. This behavior is changed in php 5.0. From php 5.0, on case insensitivity OS for example on windows machine test.php is included only once. But on unix file system they are included in each test.php and Test.php as they represent two different files.
Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html
| Reactions: |
Require and Include parameter in Php
Suppose you have two php files named class1.php and class2.php and now from class1.php file you need to access the class class2 which is defined under class2.php.
With both include and require command you can include the class2.php and then uses the classes, objects, variables defined under class2.php.
Both "include" and "require" commands are almost identical except about how they handle failures. Both of them generates warning (E_WARNING) upon failure. But "require" results fatal error (E_ERROR) upon missing file and thus halt processing of the page. In contrast, "include" does processing rest of the lines of the file after issuing warning.
So if you want to process rest of the lines of the file after missing file then use include. If you want to halt processing rest of the lines of the file then use require.
Following is an example.
My class2.php file contents,
And my class1.php file contents,
Now in browser class1.php displays,
It is in Class1: Variable from class2 Momin Arju
This is include/require test
Let's now change the class1.php file as below:
Now on broswer running class2.php fails with message,
Warning: require(Classnotfound.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2
Fatal error: require() [function.require]: Failed opening required 'Classnotfound.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2
Replacing require by include and see the differences.
Warning: include(Classnotfound.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2
Warning: include() [function.include]: Failed opening 'Classnotfound.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2
It is in Class1: Variable from class2
Fatal error: Class 'Class2' not found in C:\xampp\htdocs\class1.php on line 5
Note that include display echos under class1.php but require does not.
Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
With both include and require command you can include the class2.php and then uses the classes, objects, variables defined under class2.php.
Both "include" and "require" commands are almost identical except about how they handle failures. Both of them generates warning (E_WARNING) upon failure. But "require" results fatal error (E_ERROR) upon missing file and thus halt processing of the page. In contrast, "include" does processing rest of the lines of the file after issuing warning.
So if you want to process rest of the lines of the file after missing file then use include. If you want to halt processing rest of the lines of the file then use require.
Following is an example.
My class2.php file contents,
<?php
$test1="Momin";
$test2="Arju";
class Class2{
function display(){
echo "This is include/require test";
}
}
?>
And my class1.php file contents,
<?php
require 'Class2.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>
Now in browser class1.php displays,
It is in Class1: Variable from class2 Momin Arju
This is include/require test
Let's now change the class1.php file as below:
<?php
require 'Classnotfound.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>
Now on broswer running class2.php fails with message,
Warning: require(Classnotfound.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2
Fatal error: require() [function.require]: Failed opening required 'Classnotfound.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2
Replacing require by include and see the differences.
<?php
include 'Classnotfound.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>
Warning: include(Classnotfound.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2
Warning: include() [function.include]: Failed opening 'Classnotfound.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2
It is in Class1: Variable from class2
Fatal error: Class 'Class2' not found in C:\xampp\htdocs\class1.php on line 5
Note that include display echos under class1.php but require does not.
Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
| Reactions: |
Autoloading Objects in php
You may have one php source file per class definition. For example Class1.php file contains Class1 definition, Class2.php contains Class2 definition, Class3.php conatins Class3 definition, etc. So to use those classes under different files you need to write a series of includes/ requires statements. In case of class/variable/method is not found it will search within the files mentioned inside includes/requires.
Sometimes so many includes/requires may be of pain tasks.
With php 5.0, you can avoid to include a list of includes/requires. You can use __autoload function and with this __autoload function the file will be automatically called in case you are trying to use a class/interface which hasn't been defined yet.
Note that exception thrown inside __autoload function can't be caught by catch block.
Below is an example of __autoload function.
My Class1.php
My Class2.php
My autoloading.php
If I run autoloading.php in the browser it will show,
1000
This is include/require test
Related Documents
http://arjudba.blogspot.com/2009/03/requireonce-and-includeonce-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html
Sometimes so many includes/requires may be of pain tasks.
With php 5.0, you can avoid to include a list of includes/requires. You can use __autoload function and with this __autoload function the file will be automatically called in case you are trying to use a class/interface which hasn't been defined yet.
Note that exception thrown inside __autoload function can't be caught by catch block.
Below is an example of __autoload function.
My Class1.php
<?php
class Class1{
public $a=1000;
}
?>
My Class2.php
<?php
$test1="Momin";
$test2="Arju";
class Class2{
function display(){
echo "This is include/require test";
}
}
?>
My autoloading.php
<?php
function __autoload($className){
require_once $className.'.php';
}
$class1Instance=new Class1();
echo $class1Instance->a;
echo "<br />";
$class2Instance=new Class2();
$class2Instance->display();
?>
If I run autoloading.php in the browser it will show,
1000
This is include/require test
Related Documents
http://arjudba.blogspot.com/2009/03/requireonce-and-includeonce-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html
| Reactions: |
Subscribe to:
Posts (Atom)
Tag Cloud
10.2g
10g
11g
11gR2
Abasa
About Oracle
Administration
Adsense
Alerts
Archival
ASM
ASP.Net
Audit
Audit Vault
Backup
Bangladesh
Block Corruption
Blogger
Browser
Bug
Business
Clone
Clusterware
Comments
Concepts
Connection
Controlfiles
Crime
CSS
Data Block
Data Dictionary
Data Guard
Data Mining
Data Pump
Data Type
Database Administration
Database Vault
DBConsole
Developer
Economics
EM
Excel
Exercise
Explain plan
Export
External Table
Facebook
Firefox
Firmware
Flashback
Forum
Functions
Games
Globalization Support
Grid Control
Hardware
History
HTML
IE
Import
Indexes
initializaion parameter
initialization parameter
Installation
Internals
Internet
Interview
isql*plus
Java
JavaScript
Job
Joins
Joke
Limitation
Linux
Listener
Logminer
Magento
Mail
Materialized View
Medical
Memory
Mobile
Money
Multimedia
MySQL
Net Services
Network
OCP
Operators
Oracle
Oracle Concepts
Oracle Recovery
OS
Others
OUI
Package
Packages
Parameters
Partitioning
Patchset
Performance
Perl
Pfile
Photos
PHP
PL/SQL
Profile
Pseudocolumns
Puzzle
Quiz
Quota
RAC
RAC Installation
Recovery
Recovery Problems
Redo Log
Reports
RMAN
Scripts
Security
SEO
Server Administration
SGA
Shell Script
Smarty
Social Marketing
Solaris
Spfile
SQL
SQL Tuning
SQL*Loader
Sql*Plus
Startup Problem
Streams
SwingBench
System Analysis
Tablespaces
Technology
Temp
TNS Error
Tools
Troubleshooting
Tuning
Undo
UNIX
Upgradation
Utilities
Version
Views
Vmware
Windows
Wordpress
XML