Difference between revisions of "Core/singleton"
From PunchCMS
(New page: ====== PCMS_Client::singleton(dsn, punchId, basePath) ====== === Overview === Instansiate the CMS object using the database connectionstring, punch account id and website base path. This i...) |
|||
Line 1: | Line 1: | ||
+ | __NOTOC__ | ||
====== PCMS_Client::singleton(dsn, punchId, basePath) ====== | ====== PCMS_Client::singleton(dsn, punchId, basePath) ====== | ||
=== Overview === | === Overview === |
Revision as of 00:03, 24 December 2008
PCMS_Client::singleton(dsn, punchId, basePath)
Overview
Instansiate the CMS object using the database connectionstring, punch account id and website base path. This is done only once. For the rest of the code execution an instance of the CMS object can be obtained by using the PCMS_Client::getInstance() call.
Arguments
- dsn** [string]\\
Should be a valid database ConnectionString.
- punchId** [string]\\
The account string generated by the CMS.
- basePath** [string]\\
Absolute path to the root folder of the website.
Returns
The CMS object instance.
Example
$strDSN = "mysql://user:password@localhost/database?charset=utf8";
$strAccount = "dfg8979r";
$strPath = dirname(__FILE__) . "/";
$objCms = PCMS_Client::singleton($strDSN, $strAccount, $strPath);