aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/SemanticScuttle/Service.php')
-rw-r--r--src/SemanticScuttle/Service.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/SemanticScuttle/Service.php b/src/SemanticScuttle/Service.php
new file mode 100644
index 0000000..a537262
--- /dev/null
+++ b/src/SemanticScuttle/Service.php
@@ -0,0 +1,35 @@
+<?php
+class SemanticScuttle_Service
+{
+ /**
+ * SQL database object
+ *
+ * @var sql_db
+ */
+ protected $db;
+
+
+
+ /**
+ * Returns the single service instance
+ *
+ * @internal
+ * This function can be used once PHP 5.3 is minimum, because only
+ * 5.3 supports late static binding. For all lower php versions,
+ * we still need a copy of this method in each service class.
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
+ static $instance;
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
+ return $instance;
+ }
+
+}
+?> \ No newline at end of file