W praktyce metoda __call() wyglada tak:
<?php public function __call($function, $arg) { call_user_method_array($function, $this->driver, $arg); } ?>
Wywoluje ja w konstruktorze poprzez:
<?php public function __construct($dsn) { $this->ParseDsn($dsn); $this->LoadDriver(); $this->driver = new Driver(); # tutaj wywoluje Connect: # if($this->Connect($this->dsn)==false) { throw new Exception ('Unable to connect to the specified database. Database said: \"'./*$this->GetError($this->conn)*/mysql_error().'\".', E_DB_CONN); } } ?>
A metoda Connect w clasie Driver wyglada nastepujaco:
<?php function Connect($dsn) { return $db; } ?>
gdy sprawdzam co zwrocilo $this->Connect($this->dsn) (poprzez var_dump" title="Zobacz w manualu PHP" target="_manual) otrzymuje przyjemne NULL... czy ktos moze cos zaradzic?