클래스 ConfigReader { private static $ instance = NULL; protected $ configData = array(); PHP 및 싱글 톤 다시
public function getInstance()
{
if(self::$instance == NULL)
{
self::$instance == new ConfigReader();
}
return self::$instance;
}
public function getConfigValue($getName)
{
echo 'In function';
}
private function __construct()
{
$this->configData = %READ_FROM_DATABASE%;
}
private function __clone() {}
}
그리고 대한
:var_dump(ConfigReader::getInstance())
내가 가지고 :
NULL 나는 제발 도와주세요 ... 뇌에 의해 끊었다.