viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

fix namespace issue in GroupIterator, a=chris

Chris Pollett [2015-07-02 05:Jul:nd]
fix namespace issue in GroupIterator, a=chris
Filename
library/index_bundle_iterators/GroupIterator.php
models/ProfileModel.php
models/datasources/PdoManager.php
diff --git a/library/index_bundle_iterators/GroupIterator.php b/library/index_bundle_iterators/GroupIterator.php
index 2bc500a00..101dbe746 100644
--- a/library/index_bundle_iterators/GroupIterator.php
+++ b/library/index_bundle_iterators/GroupIterator.php
@@ -381,7 +381,7 @@ class GroupIterator extends IndexBundleIterator
                 $out_pages[$hash_url][self::HASH_SUM_SCORE];
             if ($add_lookup) {
                 $prefix = ($is_location) ? "location:" : "info:";
-                $word_key = $prefix.base64Hash($hash_url);
+                $word_key = $prefix.L\base64Hash($hash_url);
                 array_unshift($out_pages[$hash_url][self::SUMMARY_OFFSET],
                     [$word_key, $group_infos[0][self::CRAWL_TIME]]);
             }
diff --git a/models/ProfileModel.php b/models/ProfileModel.php
index 805c6dbee..b1a5595e2 100755
--- a/models/ProfileModel.php
+++ b/models/ProfileModel.php
@@ -595,10 +595,10 @@ EOT;
         $host = str_ireplace("database=".$dbinfo['DB_NAME'],"",
             $host); // informix, ibm (use connection string DSN)
         $host = str_replace(";;",";", $host);
-        $conn = @$test_dbm->connect($host, $dbinfo['DB_USER'],
+        $host = trim($host);
+        $conn = $test_dbm->connect($host, $dbinfo['DB_USER'],
             $dbinfo['DB_PASSWORD'], "");
         if ($conn === false) {return false;}
-
         //check if can select db or if not create it
         $q = "";
         if (isset($test_dbm->special_quote)) {
diff --git a/models/datasources/PdoManager.php b/models/datasources/PdoManager.php
index 1cddd8efa..747dd220e 100644
--- a/models/datasources/PdoManager.php
+++ b/models/datasources/PdoManager.php
@@ -30,6 +30,8 @@
  */
 namespace seekquarry\yioop\models\datasources;

+use PDO;
+use PDOException;
 use seekquarry\yioop\library as L;

 if (!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
@@ -80,12 +82,12 @@ class PdoManager extends DatasourceManager
         $db_password = DB_PASSWORD, $db_name = DB_NAME)
     {
         try {
-            $this->pdo = new \PDO($db_host, $db_user, $db_password);
-        } catch (\PDOException $e) {
+            $db_host = $db_host;
+            $this->pdo = new PDO($db_host, $db_user, $db_password);
+        } catch (PDOException $e) {
             $this->pdo = false;
             L\crawlLog('Connection failed: ' . $e->getMessage());
         }
-
         $this->to_upper_dbms = false;
         if (stristr($db_host, 'PGSQL')) {
             $this->to_upper_dbms = 'PGSQL';
ViewGit