I am writing a PHP5 app which is to server multiple user at one time. I want to use AJAX for the UI. I also need to use certain imap functions. I have class in which I save the imap_stream as the following:
Code: Select all
class A{
protected _imap_connection;
protected function connectToServer($host, ...){
/*
* functions to handle connection
*/
$this->_imap_connection = $conn; //conn is the var for imap_open;
}
protected function doSth(){
// sth which needs info on imap_connection eg: imap_fetchbody
}
}
Code: Select all
class B extends A{
public function __construct(){
$this->doSth();
}
}