fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15432] more on db


From: sigurdne
Subject: [Fmsystem-commits] [15432] more on db
Date: Mon, 8 Aug 2016 12:56:03 +0000 (UTC)

Revision: 15432
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15432
Author:   sigurdne
Date:     2016-08-08 12:56:03 +0000 (Mon, 08 Aug 2016)
Log Message:
-----------
more on db

Modified Paths:
--------------
    trunk/frontend/inc/class.bofellesdata.inc.php
    trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php
    trunk/property/inc/class.db_oci8.inc.php
    trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php
    trunk/property/inc/cron/default/synkroniser_med_boei.php
    trunk/rental/inc/class.bofellesdata.inc.php

Modified: trunk/frontend/inc/class.bofellesdata.inc.php
===================================================================
--- trunk/frontend/inc/class.bofellesdata.inc.php       2016-08-08 12:30:41 UTC 
(rev 15431)
+++ trunk/frontend/inc/class.bofellesdata.inc.php       2016-08-08 12:56:03 UTC 
(rev 15432)
@@ -67,7 +67,11 @@
                                return false;
                        }
 
-                       $db = createObject('phpgwapi.db', null, null, true);
+//                     $db = createObject('phpgwapi.db', null, null, true);
+                       /*
+                        * pdo for oracle is deprecated for php7 - switch to 
oci8/adodb
+                        */
+                       $db = createObject('phpgwapi.db_adodb', null, null, 
true);
 
                        $db->debug = 
!!$config->config_data['external_db_debug'];
                        $db->Host = $config->config_data['external_db_host'];

Modified: trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php
===================================================================
--- trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php        2016-08-08 
12:30:41 UTC (rev 15431)
+++ trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php        2016-08-08 
12:56:03 UTC (rev 15432)
@@ -84,7 +84,8 @@
                                return false;
                        }
 
-                       $db = createObject('phpgwapi.db', null, null, true);
+//                     $db = createObject('phpgwapi.db', null, null, true);
+                       $db = createObject('phpgwapi.db_adodb', null, null, 
true);
 
                        $db->debug = 
!!$config->config_data['external_db_debug'];
                        $db->Host = $config->config_data['external_db_host'];

Modified: trunk/property/inc/class.db_oci8.inc.php
===================================================================
--- trunk/property/inc/class.db_oci8.inc.php    2016-08-08 12:30:41 UTC (rev 
15431)
+++ trunk/property/inc/class.db_oci8.inc.php    2016-08-08 12:56:03 UTC (rev 
15432)
@@ -865,7 +865,7 @@
 
                        function __construct( $query = "" )
                        {
-                               $this->db_oci8($query);
+                               parent::__construct($query);
                        }
                }
        }

Modified: 
trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php
===================================================================
--- trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php   
2016-08-08 12:30:41 UTC (rev 15431)
+++ trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php   
2016-08-08 12:56:03 UTC (rev 15432)
@@ -248,9 +248,7 @@
                                return false;
                        }
 
-//                     $db = createObject('phpgwapi.db', null, null, true);
-                       $db = createObject('property.db_oci8');
-
+                       $db = createObject('phpgwapi.db_adodb', null, null, 
true);
                        $db->debug = false;
                        $db->Host = 
$this->config->config_data['fellesdata']['host'];
                        $db->Port = 
$this->config->config_data['fellesdata']['port'];
@@ -341,8 +339,8 @@
                                $name = $db->f('ORG_NAVN', true);
                                $this->names[$org_unit_id] = $name;
                        }
-
-//                     _debug_array($this->names);
+//                     _debug_array($db);
+//                     _debug_array($this->names);die();
                        $sql = "SELECT V_ORG_ENHET.ORG_ENHET_ID, 
V_ORG_ENHET.ORG_NAVN, V_ORG_ENHET.TJENESTESTED, V_ORG_ENHET.ORG_NIVAA FROM 
V_ORG_ENHET"
                                . " WHERE V_ORG_ENHET.ORG_NIVAA = 1 ORDER BY 
V_ORG_ENHET.ORG_NAVN ASC";
 
@@ -368,21 +366,8 @@
                function get_org_unit_ids_children( $org_unit_id )
                {
                        $org_unit_id = (int)$org_unit_id;
-                       /*
-                        * FIXME: doe not work for db_oci8;
-                        */
-//                     $db = clone($this->db);
-                       $db = createObject('property.db_oci8');
+                       $db = clone($this->db);
 
-                       $db->debug = false;
-                       $db->Host = $this->db->Host;
-                       $db->Port = $this->db->Port;
-                       $db->Type = $this->db->Type;
-                       $db->Database = $this->db->Database;
-                       $db->User = $this->db->User;
-                       $db->Password = $this->db->Password;
-                       $db->connect();
-
                        $sql = "SELECT V_ORG_KNYTNING.*, 
ANT_ENHETER_UNDER,V_ORG_ENHET.ORG_NAVN, V_ORG_ENHET.TJENESTESTED, ORG_NIVAA 
FROM V_ORG_KNYTNING"
                                . " JOIN V_ORG_ENHET ON 
(V_ORG_ENHET.ORG_ENHET_ID = V_ORG_KNYTNING.ORG_ENHET_ID_KNYTNING ) WHERE 
V_ORG_KNYTNING.ORG_ENHET_ID_KNYTNING={$org_unit_id}";
 
@@ -390,6 +375,7 @@
 
                        while ($db->next_record())
                        {
+//                             _debug_array($db->Record);
                                $child_org_unit_id = $db->f('ORG_ENHET_ID');
                                $arbeidssted = $db->f('TJENESTESTED');
                                $this->unit_ids[] = array
@@ -407,6 +393,6 @@
                                        
$this->get_org_unit_ids_children($child_org_unit_id);
                                }
                        }
-                       unset($db);
+//                     unset($db);
                }
        }
\ No newline at end of file

Modified: trunk/property/inc/cron/default/synkroniser_med_boei.php
===================================================================
--- trunk/property/inc/cron/default/synkroniser_med_boei.php    2016-08-08 
12:30:41 UTC (rev 15431)
+++ trunk/property/inc/cron/default/synkroniser_med_boei.php    2016-08-08 
12:56:03 UTC (rev 15432)
@@ -49,28 +49,24 @@
                        $this->like = $this->db->like;
                        $this->left_join = " LEFT JOIN ";
 
-                       if (isset($this->db->adodb) && $this->db->adodb)
+                       $this->db_boei = createObject('phpgwapi.db_adodb', 
null, null, true);
+                       $this->db_boei->Host = 
$GLOBALS['external_db']['boei']['db_host'];
+                       $this->db_boei->Type = 
$GLOBALS['external_db']['boei']['db_type'];
+                       $this->db_boei->Database = 
$GLOBALS['external_db']['boei']['db_name'];
+                       $this->db_boei->Port = 
$GLOBALS['external_db']['boei']['db_port'];
+                       $this->db_boei->User = 
$GLOBALS['external_db']['boei']['db_user'];
+                       $this->db_boei->Password = 
$GLOBALS['external_db']['boei']['db_pass'];
+                       $this->db_boei->Halt_On_Error = 'yes';
+
+                       try
                        {
-                               $this->db_boei = CreateObject('phpgwapi.db', 
false, $GLOBALS['external_db']['boei']['db_type']);
-                               $this->db_boei->Host = 
$GLOBALS['external_db']['boei']['db_host'];
-                               $this->db_boei->Type = 
$GLOBALS['external_db']['boei']['db_type'];
-                               $this->db_boei->Database = 
$GLOBALS['external_db']['boei']['db_name'];
-                               $this->db_boei->User = 
$GLOBALS['external_db']['boei']['db_user'];
-                               $this->db_boei->Password = 
$GLOBALS['external_db']['boei']['db_pass'];
-                               $this->db_boei->Halt_On_Error = 'yes';
                                $this->db_boei->connect();
                        }
-                       else
+                       catch (Exception $e)
                        {
-                               $this->db_boei = 
CreateObject('property.db_mssql');
-                               $this->db_boei->Host = 
$GLOBALS['external_db']['boei']['db_host'];
-                               $this->db_boei->Type = 
$GLOBALS['external_db']['boei']['db_type'];
-                               $this->db_boei->Database = 
$GLOBALS['external_db']['boei']['db_name'];
-                               $this->db_boei->User = 
$GLOBALS['external_db']['boei']['db_user'];
-                               $this->db_boei->Password = 
$GLOBALS['external_db']['boei']['db_pass'];
-                               $this->db_boei->Halt_On_Error = 'yes';
+                               $status = lang('unable_to_connect_to_database');
                        }
-
+       
                        $this->db_boei2 = clone($this->db_boei);
                        $this->db2 = clone($this->db);
                }
@@ -145,7 +141,6 @@
                function update_table_eier()
                {
                        $metadata = $this->db_boei->metadata('Eier');
-//_debug_array($metadata);
                        $metadata = $this->db->metadata('boei_eier');
 //_debug_array($metadata);
                        if (!$metadata)

Modified: trunk/rental/inc/class.bofellesdata.inc.php
===================================================================
--- trunk/rental/inc/class.bofellesdata.inc.php 2016-08-08 12:30:41 UTC (rev 
15431)
+++ trunk/rental/inc/class.bofellesdata.inc.php 2016-08-08 12:56:03 UTC (rev 
15432)
@@ -94,7 +94,11 @@
                                return false;
                        }
 
-                       $db = createObject('phpgwapi.db', null, null, true);
+//                     $db = createObject('phpgwapi.db', null, null, true);
+                       /*
+                        * pdo for oracle is deprecated for php7 - switch to 
oci8/adodb
+                        */
+                       $db = createObject('phpgwapi.db_adodb', null, null, 
true);
 
                        $db->debug = 
!!$config->config_data['external_db_debug'];
                        $db->Host = $config->config_data['external_db_host'];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]