aboutsummaryrefslogtreecommitdiff
path: root/lib/sfIsisImporterStats.class.php
diff options
context:
space:
mode:
authorSilvio <s1lv10@uol.com.br>2010-07-30 10:51:29 -0300
committerSilvio <s1lv10@uol.com.br>2010-07-30 10:51:29 -0300
commite2e83df93a77ff7d7597384a26d17a0aef2eb232 (patch)
treecbb95816a65cdf0dce9b7f76654004212a2da8fb /lib/sfIsisImporterStats.class.php
parent94d00beeab1f520159ddee0c81f3c57a8accb394 (diff)
downloadsf_isis_importer_plugin-e2e83df93a77ff7d7597384a26d17a0aef2eb232.tar.gz
sf_isis_importer_plugin-e2e83df93a77ff7d7597384a26d17a0aef2eb232.tar.bz2
Adding missing class files
Diffstat (limited to 'lib/sfIsisImporterStats.class.php')
-rw-r--r--lib/sfIsisImporterStats.class.php78
1 files changed, 78 insertions, 0 deletions
diff --git a/lib/sfIsisImporterStats.class.php b/lib/sfIsisImporterStats.class.php
new file mode 100644
index 0000000..d7dae34
--- /dev/null
+++ b/lib/sfIsisImporterStats.class.php
@@ -0,0 +1,78 @@
+<?php
+
+/**
+ * Statistics gathering for importing procedures.
+ */
+class sfIsisImporterStats
+{
+ /**
+ * @var $instance Singleton instance
+ */
+ private static $instance = null;
+
+ /**
+ * Get the singleton instance.
+ */
+ public static function getInstance()
+ {
+ if(self::$instance == null) {
+ self::$instance = new self;
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Constructor.
+ */
+ private function __construct()
+ {
+ $this->stats = array();
+ }
+
+ /**
+ * Simple accumulator.
+ *
+ * @param string $section Section name
+ */
+ public function increase($section)
+ {
+ $this->stats[$section]++;
+ }
+
+ /**
+ * Compute soundex.
+ *
+ * @param string $name Name
+ */
+ public function soundex($name) {
+ $this->stats['sounded'][soundex($name)] = $name;
+ }
+
+ /**
+ * Compute metaphone.
+ *
+ * @param string $name Name
+ */
+ public function metaphone($name) {
+ $this->stats['sounded'][metaphone($name)] = $name;
+ }
+
+ /**
+ * Compute similar words indexes.
+ *
+ * @param string $name Name
+ */
+ public function similar($name) {
+ $this->soundex($name);
+ $this->metaphone($name);
+ }
+
+ /**
+ * Display statistics.
+ *
+ * @todo Write and test
+ */
+ public function display() {
+ }
+}