[Git][codeigniterpower/codeigniterpower][master] 3 commits: Fix property _create_table_if in Postgres forge class respect the rest of DB classes

0 views
Skip to first unread message

Герхард PICCORO Lenz McKAY (@mckaygerhard)

unread,
Feb 6, 2024, 12:01:51 PMFeb 6
to venenux...@googlegroups.com

Герхард PICCORO Lenz McKAY pushed to branch master at codeigniterpower / codeigniterpower

Commits:

  • ba80269b
    by mckaygerhard at 2024-02-06T12:24:59-04:00
    Fix property _create_table_if in Postgres forge class respect the rest of DB classes
    
  • 9e1e1a1f
    by mckaygerhard at 2024-02-06T12:33:05-04:00
    Fix replace when php does not property interpreted null values for text
    
    * mostly need for php8 only..
    
  • 6530fd66
    by mckaygerhard at 2024-02-06T12:55:55-04:00
    Fix php8/php7 compat for xml_parser_create that nows returns object
    
    * this function returns an XMLParser instance on php8;
      previously, a resource was returned, or false on failure.
      so i just compare php versions and use thep roperty on
    

4 changed files:

Changes:

  • appsys/database/drivers/postgre/postgre_forge.php
    ... ... @@ -87,7 +87,7 @@ class CI_DB_postgre_forge extends CI_DB_forge {
    87 87
     
    
    88 88
     		if (version_compare($this->db->version(), '9.0', '>'))
    
    89 89
     		{
    
    90
    -			$this->create_table_if = 'CREATE TABLE IF NOT EXISTS';
    
    90
    +			$this->_create_table_if = 'CREATE TABLE IF NOT EXISTS';
    
    91 91
     		}
    
    92 92
     	}
    
    93 93
     
    

  • appsys/helpers/text_helper.php
    ... ... @@ -424,6 +424,8 @@ if ( ! function_exists('convert_accented_characters'))
    424 424
     			$array_to = array_values($foreign_characters);
    
    425 425
     		}
    
    426 426
     
    
    427
    +		$str = (gettype($str) === 'NULL') ? '' : $str;
    
    428
    +
    
    427 429
     		return preg_replace($array_from, $array_to, $str);
    
    428 430
     	}
    
    429 431
     }
    

  • appsys/libraries/Xmlrpc.php
    ... ... @@ -1153,7 +1153,10 @@ class XML_RPC_Message extends CI_Xmlrpc
    1153 1153
     		//-------------------------------------
    
    1154 1154
     
    
    1155 1155
     		$parser = xml_parser_create($this->xmlrpc_defencoding);
    
    1156
    -		$pname = (string) $parser;
    
    1156
    +		if (version_compare(PHP_VERSION, '7.2.0') >= 0)
    
    1157
    +			$pname = spl_object_id($parser);
    
    1158
    +		else
    
    1159
    +			$pname = (string) $parser;
    
    1157 1160
     		$this->xh[$pname] = array(
    
    1158 1161
     			'isf'		=> 0,
    
    1159 1162
     			'ac'		=> '',
    
    ... ... @@ -1281,7 +1284,10 @@ class XML_RPC_Message extends CI_Xmlrpc
    1281 1284
     	 */
    
    1282 1285
     	public function open_tag($the_parser, $name)
    
    1283 1286
     	{
    
    1284
    -		$the_parser = (string) $the_parser;
    
    1287
    +		if (version_compare(PHP_VERSION, '7.2.0') >= 0)
    
    1288
    +			$the_parser = spl_object_id($the_parser);
    
    1289
    +		else
    
    1290
    +			$the_parser = (string) $the_parser;
    
    1285 1291
     
    
    1286 1292
     		// If invalid nesting, then return
    
    1287 1293
     		if ($this->xh[$the_parser]['isf'] > 1) return;
    
    ... ... @@ -1382,7 +1388,10 @@ class XML_RPC_Message extends CI_Xmlrpc
    1382 1388
     	 */
    
    1383 1389
     	public function closing_tag($the_parser, $name)
    
    1384 1390
     	{
    
    1385
    -		$the_parser = (string) $the_parser;
    
    1391
    +		if (version_compare(PHP_VERSION, '7.2.0') >= 0)
    
    1392
    +			$the_parser = spl_object_id($the_parser);
    
    1393
    +		else
    
    1394
    +			$the_parser = (string) $the_parser;
    
    1386 1395
     
    
    1387 1396
     		if ($this->xh[$the_parser]['isf'] > 1) return;
    
    1388 1397
     
    
    ... ... @@ -1516,7 +1525,10 @@ class XML_RPC_Message extends CI_Xmlrpc
    1516 1525
     	 */
    
    1517 1526
     	public function character_data($the_parser, $data)
    
    1518 1527
     	{
    
    1519
    -		$the_parser = (string) $the_parser;
    
    1528
    +		if (version_compare(PHP_VERSION, '7.2.0') >= 0)
    
    1529
    +			$the_parser = spl_object_id($the_parser);
    
    1530
    +		else
    
    1531
    +			$the_parser = (string) $the_parser;
    
    1520 1532
     
    
    1521 1533
     		if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already
    
    1522 1534
     
    

  • appsys/libraries/Xmlrpcs.php
    ... ... @@ -234,7 +234,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc {
    234 234
     
    
    235 235
     		$parser = xml_parser_create($this->xmlrpc_defencoding);
    
    236 236
     		$parser_object = new XML_RPC_Message('filler');
    
    237
    -		$pname = (string) $parser;
    
    237
    +		if (version_compare(PHP_VERSION, '7.2.0') >= 0)
    
    238
    +			$pname = spl_object_id($parser);
    
    239
    +		else
    
    240
    +			$pname = (string) $parser;
    
    238 241
     
    
    239 242
     		$parser_object->xh[$pname] = array(
    
    240 243
     			'isf' => 0,
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help

Reply all
Reply to author
Forward
0 new messages