I have created a set of objects needed to control my site in index.php, one called configObj which has all the config methods
and one called $secObj which holds some simple security methods,
My problem is how can I acces the meathods within the secObj from a meathod in the configObj, without creating another instance secObj
index.php
Code: Select all
// create new security object
$secObj = new security();
// create a new config object
$configObj = new config();Code: Select all
$this->dbPass = $secObj->encrypt($this->dbPass);
$this->dbUser = $secObj->encrypt($this->dbUser);
$this->dbHost = $secObj->encrypt($this->dbHost);
$this->dbName = $secObj->encrypt($this->dbName);Code: Select all
function encrypt($string){
$out = "encrypeted: ".$string;
return $out;
}