/** * KYFileクラスのシングルトンです。 * * @return object KYFileのインスタンス * * @example private/library/example/instance.php */ public static function instance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
/** * コンストラクタ */ private function __construct() { // Load query $query_path = PATH_PRIVATE . "/query"; $file_list = KYFile::instance()->file_list($query_path); foreach ($file_list as $fileName) { if (substr(basename($fileName), -8) == ".sql.php") { include_once $query_path . "/{$fileName}"; } } }
/** * KYFileオブジェクトを返します。 * * @return object KYFileオブジェクト */ public static function file() { return KYFile::instance(); }