This commit is contained in:
Antonio de la Rosa 2016-04-08 04:40:32 +02:00
parent 545286bd4e
commit 82c5f8b7a0
3 changed files with 29 additions and 6 deletions

View file

@ -4,6 +4,7 @@ namespace PhangoApp\PhaModels\CoreFields;
use PhangoApp\PhaModels\CoreFields\CharField;
use PhangoApp\PhaUtils\Utils;
use PhangoApp\PhaI18n\I18n;
class IpField extends CharField {

View file

@ -51,6 +51,13 @@ class SQLClass {
return $num_rows;
}
static public function free_result($result)
{
}
static public function webtsys_close( $idconnection )
{

View file

@ -521,7 +521,7 @@ class Webmodel {
public function connect_to_db()
{
include(__DIR__.'/Databases/'.Webmodel::$type_db.'.php');
include_once(__DIR__.'/Databases/'.Webmodel::$type_db.'.php');
if(!SQLClass::webtsys_connect( Webmodel::$host_db[$this->db_selected], Webmodel::$login_db[$this->db_selected], Webmodel::$pass_db[$this->db_selected] , $this->db_selected))
{
@ -863,7 +863,7 @@ class Webmodel {
public function insert($post, $safe_query=0, $cache_name='')
{
$this->post=&$post;
//$this->post=$post;
$this->set_phango_connection();
@ -944,7 +944,7 @@ class Webmodel {
public function update($post, $safe_query=0, $cache_name='')
{
$this->post=&$post;
$this->post=$post;
$this->set_phango_connection();
@ -956,6 +956,7 @@ class Webmodel {
$arr_fields=array();
//Unset the id field from the model for security
if(!$this->modify_id)
@ -2340,6 +2341,20 @@ class Webmodel {
}
/**
* Close connection, you need this if use ReactPHP or some
*
*/
public function close()
{
Webmodel::$connection_func[$this->db_selected]='connect_to_db';
return SQLClass::webtsys_close(Webmodel::$connection[$this->db_selected]);
}
}