Update database and helper functionality in CodeIgniter

Revised database drivers, query builder, and file/inflector helpers for improved consistency and functionality. Updated copyrights, links, and standardized function names including deprecating `is_countable` in favor of `word_is_countable`. Added support for new SQL features and optimized query handling.
This commit is contained in:
2025-01-22 18:50:26 +01:00
parent a8dfcfae4c
commit 453a5a89a5
219 changed files with 2041 additions and 1324 deletions
+4 -4
View File
@@ -75,10 +75,10 @@ $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => getenv('DB_HOST'), 'hostname' => $_ENV['DB_HOST'],
'username' => getenv('DB_USER'), 'username' => $_ENV['DB_USER'],
'password' => getenv('DB_PASS'), 'password' => $_ENV['DB_PASS'],
'database' => getenv('DB_NAME'), 'database' => $_ENV['DB_NAME'],
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => FALSE, 'pconnect' => FALSE,
+1 -1
View File
@@ -58,7 +58,7 @@ class Login extends MY_Controller {
private function checkPassword( $user, $password ) private function checkPassword( $user, $password )
{ {
if ( getenv('MASTERPASSWORD') == $password ) return TRUE; if ( $_ENV['MASTERPASSWORD'] == $password ) return TRUE;
$saltedPassword = User::getSaltedPassword( $password, $user->salt ); $saltedPassword = User::getSaltedPassword( $password, $user->salt );
@@ -171,8 +171,8 @@ class ProjectsController extends MY_Controller {
$invoice['invoicedate'] = date2mysql( $invoice['invoicedate'] ); $invoice['invoicedate'] = date2mysql( $invoice['invoicedate'] );
$invoice['forecastdate'] = date2mysql( $invoice['forecastdate'] ); $invoice['forecastdate'] = date2mysql( $invoice['forecastdate'] );
$invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] ); $invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] ?? '' );
$invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] ); $invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] ?? '' );
$invoiceID = Invoice::saveInvoice( $invoiceID, $invoice ); $invoiceID = Invoice::saveInvoice( $invoiceID, $invoice );
@@ -193,7 +193,7 @@ class ProjectsController extends MY_Controller {
unset( $payment['id'] ); unset( $payment['id'] );
$payment['paymentdate'] = date2mysql( $payment['paymentdate'] ); $payment['paymentdate'] = date2mysql( $payment['paymentdate'] );
$payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] ); $payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] ?? '' );
$paymentID = Payment::savePayment( $paymentID, $payment ); $paymentID = Payment::savePayment( $paymentID, $payment );
@@ -63,7 +63,7 @@ class ReportsController extends MY_Controller {
$this->json( $result ); $this->json( $result );
} }
public function getInvoiceOverview( $year = FALSE, $orderType, $orderDirection, $archive ) public function getInvoiceOverview( $year, $orderType, $orderDirection, $archive )
{ {
$invoices = new Invoices( $year, $orderType, $orderDirection, $archive ); $invoices = new Invoices( $year, $orderType, $orderDirection, $archive );
@@ -72,7 +72,7 @@ class ReportsController extends MY_Controller {
$this->json( $invoiceReport ); $this->json( $invoiceReport );
} }
public function createInvoicesSpreadsheet( $year = FALSE, $orderType, $orderDirection, $archive ) public function createInvoicesSpreadsheet( $year, $orderType, $orderDirection, $archive )
{ {
$invoices = new Invoices( $year, $orderType, $orderDirection, $archive ); $invoices = new Invoices( $year, $orderType, $orderDirection, $archive );
+1 -1
View File
@@ -59,7 +59,7 @@ class MY_Controller extends CI_Controller {
{ {
$value = $this->input->input_stream( $post, TRUE ); $value = $this->input->input_stream( $post, TRUE );
$denulledValue = str_replace( 'null', '', $value ); $denulledValue = str_replace( 'null', '', $value ?? '' );
return $denulledValue; return $denulledValue;
} }
+1 -1
View File
@@ -396,7 +396,7 @@ class MY_Model extends CI_Model {
} }
function clean_input($post){ function clean_input($post){
return str_replace('null', '', $this->db->escape_str($this->input->post($post), TRUE)); return str_replace('null', '', $this->db->escape_str($this->input->post($post) ?? '', TRUE));
} }
} }
+21 -21
View File
@@ -42,7 +42,7 @@ if ( ! function_exists( 'dump_exit' ) )
function mysql2text( $message ) function mysql2text( $message )
{ {
$regeleinden = ['\r\n', '\r', '\n']; $regeleinden = ['\r\n', '\r', '\n'];
$message = str_replace( $regeleinden, chr( 13 ), $message ); $message = str_replace( $regeleinden, chr( 13 ), $message ?? '' );
$message = stripslashes( $message ); $message = stripslashes( $message );
return ( $message ); return ( $message );
@@ -51,7 +51,7 @@ function mysql2text( $message )
function mysql2html( $message ) function mysql2html( $message )
{ {
$regeleinden = ['\r\n', '\r', '\n']; $regeleinden = ['\r\n', '\r', '\n'];
$message = str_replace( $regeleinden, "<br />", $message ); $message = str_replace( $regeleinden, "<br />", $message ?? '' );
$message = stripslashes( $message ); $message = stripslashes( $message );
return ( $message ); return ( $message );
@@ -60,7 +60,7 @@ function mysql2html( $message )
function textarea2html( $message ) function textarea2html( $message )
{ {
$regeleinden = [chr( 13 )]; $regeleinden = [chr( 13 )];
$message = str_replace( $regeleinden, "<br />", $message ); $message = str_replace( $regeleinden, "<br />", $message ?? '' );
$message = stripslashes( $message ); $message = stripslashes( $message );
return ( $message ); return ( $message );
@@ -109,10 +109,10 @@ function readTextFromStorage( $text )
function cleanTextForStorage( $text ) function cleanTextForStorage( $text )
{ {
$text = str_replace( '/r/n', '', $text ); $text = str_replace( '/r/n', '', $text ?? '' );
$text = str_replace( '\r\n', '', $text ); $text = str_replace( '\r\n', '', $text ?? '' );
$text = str_replace( '/n', '', $text ); $text = str_replace( '/n', '', $text ?? '' );
$text = str_replace( '\n', '', $text ); $text = str_replace( '\n', '', $text ?? '' );
$text = strip_slashes( $text ); $text = strip_slashes( $text );
return base64_encode( $text ); return base64_encode( $text );
@@ -127,13 +127,13 @@ function setTextareaForStorage( $text )
function setTextArea( $text ) function setTextArea( $text )
{ {
$text = str_replace( '/r/n', chr( 13 ), $text ); $text = str_replace( '/r/n', chr( 13 ), $text ?? '' );
$text = str_replace( '\r\n', chr( 13 ), $text ); $text = str_replace( '\r\n', chr( 13 ), $text ?? '' );
$text = str_replace( '/n', chr( 13 ), $text ); $text = str_replace( '/n', chr( 13 ), $text ?? '' );
$text = str_replace( '\n', chr( 13 ), $text ); $text = str_replace( '\n', chr( 13 ), $text ?? '' );
$text = str_replace( '\r', chr( 13 ), $text ); $text = str_replace( '\r', chr( 13 ), $text ?? '' );
$text = str_replace( '/r', chr( 13 ), $text ); $text = str_replace( '/r', chr( 13 ), $text ?? '' );
$text = str_replace( '\n\n', chr( 13 ) . chr( 13 ), $text ); $text = str_replace( '\n\n', chr( 13 ) . chr( 13 ), $text ?? '' );
$text = strip_slashes( $text ); $text = strip_slashes( $text );
return $text; return $text;
@@ -141,13 +141,13 @@ function setTextArea( $text )
function setTextAreaHtml( $text ) function setTextAreaHtml( $text )
{ {
$text = str_replace( '/r/n', '<br />', $text ); $text = str_replace( '/r/n', '<br />', $text ?? '' );
$text = str_replace( '\r\n', '<br />', $text ); $text = str_replace( '\r\n', '<br />', $text ?? '' );
$text = str_replace( '/n', '<br />', $text ); $text = str_replace( '/n', '<br />', $text ?? '' );
$text = str_replace( '\n', '<br />', $text ); $text = str_replace( '\n', '<br />', $text ?? '' );
$text = str_replace( '\r', '<br />', $text ); $text = str_replace( '\r', '<br />', $text ?? '' );
$text = str_replace( '/r', '<br />', $text ); $text = str_replace( '/r', '<br />', $text ?? '' );
$text = str_replace( '\n\n', '<br /><br />', $text ); $text = str_replace( '\n\n', '<br /><br />', $text ?? '' );
$text = strip_slashes( $text ); $text = strip_slashes( $text );
return $text; return $text;
@@ -131,6 +131,10 @@ class Recapprojects {
private function setEmployeeBudget() private function setEmployeeBudget()
{ {
if( property_exists($this, 'uniqueEmployee') ) return $this->employeeBudget = 0;
if( is_null($this->projectEmployeeDetail)) return $this->employeeBudget = 0;
$this->employeeBudget = $this->employeeBudget =
is_null( $this->projectEmployeeDetail['budget'] ) ? 0 : $this->projectEmployeeDetail['budget']; is_null( $this->projectEmployeeDetail['budget'] ) ? 0 : $this->projectEmployeeDetail['budget'];
} }
@@ -54,10 +54,10 @@ class InvoiceForecastSheet {
{ {
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] ); $this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
$this->sheet->setCellValue( 'B' . $this->row, $project['customer'] ); $this->sheet->setCellValue( 'B' . $this->row, $project['customer'] );
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ) ); $this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ?? '' ) );
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['forecastThisYear'] ) ); $this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['forecastThisYear'] ?? '' ) );
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ) ); $this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ?? '' ) );
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ) ); $this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ?? '' ) );
$this->row ++; $this->row ++;
} }
@@ -56,12 +56,12 @@ class InvoiceOverviewSheet {
{ {
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] ); $this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
$this->sheet->setCellValue( 'B' . $this->row, $project['customer'] ); $this->sheet->setCellValue( 'B' . $this->row, $project['customer'] );
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['totalToInvoicingExcl'] ) ); $this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['totalToInvoicingExcl'] ?? '' ) );
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['totalToInvoicingIncl'] ) ); $this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['totalToInvoicingIncl'] ?? '' ) );
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['totalInvoicedOtherYears'] ) ); $this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['totalInvoicedOtherYears'] ?? '' ) );
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['totalInvoicedThisYear'] ) ); $this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['totalInvoicedThisYear'] ?? '' ) );
$this->sheet->setCellValue( 'G' . $this->row, str_replace( '.', '', $project['invoicesTotal'] ) ); $this->sheet->setCellValue( 'G' . $this->row, str_replace( '.', '', $project['invoicesTotal'] ?? '' ) );
$this->sheet->setCellValue( 'H' . $this->row, str_replace( '.', '', $project['needInvoice'] ) ); $this->sheet->setCellValue( 'H' . $this->row, str_replace( '.', '', $project['needInvoice'] ?? '' ) );
$this->row ++; $this->row ++;
} }
@@ -67,7 +67,7 @@ class MonthForecastSheet {
{ {
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] ); $this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
$this->sheet->setCellValue( 'B' . $this->row, $project['customer'] ); $this->sheet->setCellValue( 'B' . $this->row, $project['customer'] );
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ) ); $this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ?? '' ) );
$columnCount = 0; $columnCount = 0;
foreach ( $project['forecastMonths'] as $month ) foreach ( $project['forecastMonths'] as $month )
@@ -78,8 +78,8 @@ class MonthForecastSheet {
$columnCount ++; $columnCount ++;
} }
$this->sheet->setCellValue( 'P' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ) ); $this->sheet->setCellValue( 'P' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ?? '' ) );
$this->sheet->setCellValue( 'Q' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ) ); $this->sheet->setCellValue( 'Q' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ?? '' ) );
$this->row ++; $this->row ++;
} }
@@ -8,144 +8,144 @@
class InvoiceOverview { class InvoiceOverview {
private $project; private $project;
private $year; private $year;
private $projectname; private $projectname;
private $customer; private $customer;
private $totalToInvoicingExcl; private $totalToInvoicingExcl;
private $totalToInvoicingIncl; private $totalToInvoicingIncl;
private $totalInvoicedOtherYears; private $totalInvoicedOtherYears;
private $totalInvoicedThisYear; private $totalInvoicedThisYear;
private $invoicesTotal; private $invoicesTotal;
private $needInvoice; private $needInvoice;
private $projectDetails; private $projectDetails;
private $projectnumber; private $projectnumber;
private $projectPayment; private $projectPayment;
private $invoicesToPay; private $invoicesToPay;
public function __construct( $project, $year ) public function __construct( $project, $year )
{ {
$this->project = $project; $this->project = $project;
$this->year = $year; $this->year = $year;
$this->handle(); $this->handle();
} }
public function getProjectDetails() public function getProjectDetails()
{ {
return $this->projectDetails; return $this->projectDetails;
} }
public function getNeedinvoice() public function getNeedinvoice()
{ {
return $this->needInvoice; return $this->needInvoice;
} }
private function handle() private function handle()
{ {
$this->setProjectnumber(); $this->setProjectnumber();
$this->setProjectname(); $this->setProjectname();
$this->setCustomer(); $this->setCustomer();
$this->setTotalToInvoicingExcl(); $this->setTotalToInvoicingExcl();
$this->setTotalToInvoicingIncl(); $this->setTotalToInvoicingIncl();
$this->setTotalInvoicedOtherYears(); $this->setTotalInvoicedOtherYears();
$this->setTotalInvoicedThisYear(); $this->setTotalInvoicedThisYear();
$this->setPaymentPerProject(); $this->setPaymentPerProject();
$this->setInvoicesTotal(); $this->setInvoicesTotal();
$this->setInvoicesToPay(); $this->setInvoicesToPay();
$this->setNeedInvoice(); $this->setNeedInvoice();
$this->setProjectDetails(); $this->setProjectDetails();
} }
private function setProjectnumber() private function setProjectnumber()
{ {
$this->projectnumber = $this->project->projectnumber; $this->projectnumber = $this->project->projectnumber;
} }
private function setProjectname() private function setProjectname()
{ {
$this->projectname = $this->project->projectname; $this->projectname = $this->project->projectname;
} }
private function setCustomer() private function setCustomer()
{ {
$this->customer = $this->project->customer->name; $this->customer = $this->project->customer->name;
} }
private function setTotalToInvoicingExcl() private function setTotalToInvoicingExcl()
{ {
$offer = $this->project->offer; $offer = $this->project->offer;
$this->totalToInvoicingExcl = $this->totalToInvoicingExcl =
$offer->own_revenue + $offer->other_revenue + $offer->costs; $offer->own_revenue + $offer->other_revenue + $offer->costs;
} }
private function setTotalToInvoicingIncl() private function setTotalToInvoicingIncl()
{ {
$this->totalToInvoicingIncl = $this->totalToInvoicingIncl =
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) ); $this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
} }
private function setTotalInvoicedOtherYears() private function setTotalInvoicedOtherYears()
{ {
$this->totalInvoicedOtherYears = $this->totalInvoicedOtherYears =
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE ); Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
} }
private function setTotalInvoicedThisYear() private function setTotalInvoicedThisYear()
{ {
$this->totalInvoicedThisYear = $this->totalInvoicedThisYear =
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE ); Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
} }
private function setPaymentPerProject() private function setPaymentPerProject()
{ {
$this->projectPayment = Payment::getPaymentPerProject( $this->project->id ); $this->projectPayment = Payment::getPaymentPerProject( $this->project->id );
} }
private function setInvoicesTotal() private function setInvoicesTotal()
{ {
$this->invoicesTotal = $this->invoicesTotal =
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear; $this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
} }
private function setInvoicesToPay() private function setInvoicesToPay()
{ {
$this->invoicesToPay = $this->invoicesTotal - $this->projectPayment; $this->invoicesToPay = $this->invoicesTotal - $this->projectPayment;
} }
private function setNeedInvoice() private function setNeedInvoice()
{ {
$this->needInvoice = $this->needInvoice =
$this->totalToInvoicingIncl - $this->invoicesTotal; $this->totalToInvoicingIncl - $this->invoicesTotal;
} }
private function setProjectDetails() private function setProjectDetails()
{ {
$this->projectDetails = [ $this->projectDetails = [
'projectnumber' => $this->projectnumber, 'projectnumber' => $this->projectnumber,
'projectname' => $this->projectname, 'projectname' => $this->projectname,
'customer' => $this->customer, 'customer' => $this->customer,
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ), 'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl ?? 0, 0, ',', '.' ),
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl, 0, ',', '.' ), 'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl ?? 0, 0, ',', '.' ),
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears, 0, ',', '.' ), 'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears ?? 0, 0, ',', '.' ),
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear, 0, ',', '.' ), 'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear ?? 0, 0, ',', '.' ),
'invoicesTotal' => number_format( $this->invoicesTotal, 0, ',', '.' ), 'invoicesTotal' => number_format( $this->invoicesTotal ?? 0, 0, ',', '.' ),
'projectPayment' => number_format( $this->projectPayment, 0, ',', '.' ), 'projectPayment' => number_format( $this->projectPayment ?? 0, 0, ',', '.' ),
'invoiceToPay' => number_format( $this->invoicesToPay, 0, ',', '.' ), 'invoiceToPay' => number_format( $this->invoicesToPay ?? 0, 0, ',', '.' ),
'needInvoice' => number_format( $this->needInvoice, 0, ',', '.' ) 'needInvoice' => number_format( $this->needInvoice ?? 0, 0, ',', '.' )
]; ];
} }
} }
@@ -116,7 +116,7 @@ class Invoices {
$this->invoicedYears = Invoice::selectRaw( 'DATE_FORMAT(invoicedate, "%Y") AS years' ) $this->invoicedYears = Invoice::selectRaw( 'DATE_FORMAT(invoicedate, "%Y") AS years' )
->distinct() ->distinct()
->orderBy( 'invoicedate' ) ->orderBy( 'invoicedate' )
->lists( 'years' ); ->pluck( 'years' );
} }
private function setInvoiceReport() private function setInvoiceReport()
+1 -1
View File
@@ -73,7 +73,7 @@ class Payment extends BaseModel {
->distinct() ->distinct()
->join( 'invoices AS INV', 'INV.id', '=', 'payments.invoice_id' ) ->join( 'invoices AS INV', 'INV.id', '=', 'payments.invoice_id' )
->whereRaw( 'DATE_FORMAT(paymentdate, "%Y") = "' . $year . '"' ) ->whereRaw( 'DATE_FORMAT(paymentdate, "%Y") = "' . $year . '"' )
->lists( 'project_id' ); ->pluck( 'project_id' );
return $projects->toArray(); return $projects->toArray();
} }
@@ -26,7 +26,7 @@ class Projectemployee extends BaseModel {
public static function getAvailableEmployees( $projectID ) public static function getAvailableEmployees( $projectID )
{ {
$currentEmployees = Self::whereProjectId( $projectID ) $currentEmployees = Self::whereProjectId( $projectID )
->lists( 'user_id' ); ->pluck( 'user_id' );
$availableEmployees = User::selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" ) $availableEmployees = User::selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" )
->whereNotIn( 'id', $currentEmployees ) ->whereNotIn( 'id', $currentEmployees )
+9 -4
View File
@@ -11,11 +11,11 @@
"source": "https://github.com/bcit-ci/CodeIgniter" "source": "https://github.com/bcit-ci/CodeIgniter"
}, },
"require": { "require": {
"php": ">=5.3.7", "php": ">=8.0",
"vlucas/phpdotenv": "^2.4", "vlucas/phpdotenv": "^5.6",
"illuminate/database": "5.1.16", "illuminate/database": "v10.48.26",
"symfony/var-dumper": "^3.4", "symfony/var-dumper": "^3.4",
"phpoffice/phpspreadsheet": "^1.3" "phpoffice/phpspreadsheet": "^3.8"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
@@ -30,5 +30,10 @@
"paragonie/random_compat": "Provides better randomness in PHP 5.x" "paragonie/random_compat": "Provides better randomness in PHP 5.x"
}, },
"require-dev": { "require-dev": {
},
"config": {
"allow-plugins": {
"kylekatarnls/update-helper": true
}
} }
} }
+2 -2
View File
@@ -8,7 +8,7 @@
include_once('../vendor/autoload.php'); include_once('../vendor/autoload.php');
//$dotenv = new Dotenv\Dotenv(__DIR__); //$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv = new Dotenv\Dotenv('../'); $dotenv = $dotenv = Dotenv\Dotenv::createImmutable('../');
$dotenv->load(); $dotenv->load();
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'ENVIRONMENT']); $dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'ENVIRONMENT']);
@@ -78,7 +78,7 @@ $dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'ENVIRONMENT']);
* Different environments will require different levels of error reporting. * Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them. * By default development will show errors but testing and live will hide them.
*/ */
switch (ENVIRONMENT) switch ($_ENV['ENVIRONMENT'])
{ {
case 'development': case 'development':
error_reporting(-1); error_reporting(-1);
Executable → Regular
View File
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -47,7 +48,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/benchmark.html * @link https://codeigniter.com/userguide3/libraries/benchmark.html
*/ */
class CI_Benchmark { class CI_Benchmark {
Executable → Regular
+7 -6
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Front-controller * @category Front-controller
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
*/ */
/** /**
@@ -55,7 +56,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @var string * @var string
* *
*/ */
const CI_VERSION = '3.1.6'; const CI_VERSION = '3.1.13';
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
@@ -434,7 +435,7 @@ if ( ! is_php('5.4'))
* ReflectionMethod::isConstructor() is the ONLY reliable check, * ReflectionMethod::isConstructor() is the ONLY reliable check,
* knowing which method will be executed as a constructor. * knowing which method will be executed as a constructor.
*/ */
elseif ( ! is_callable(array($class, $method))) else
{ {
$reflection = new ReflectionMethod($class, $method); $reflection = new ReflectionMethod($class, $method);
if ( ! $reflection->isPublic() OR $reflection->isConstructor()) if ( ! $reflection->isPublic() OR $reflection->isConstructor())
Executable → Regular
+8 -8
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Common Functions * @category Common Functions
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
*/ */
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@@ -565,7 +566,7 @@ if ( ! function_exists('set_status_header'))
return; return;
} }
$server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2'), TRUE)) $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0'), TRUE))
? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
header($server_protocol.' '.$code.' '.$text, TRUE, $code); header($server_protocol.' '.$code.' '.$text, TRUE, $code);
} }
@@ -778,11 +779,9 @@ if ( ! function_exists('_stringify_attributes'))
*/ */
function _stringify_attributes($attributes, $js = FALSE) function _stringify_attributes($attributes, $js = FALSE)
{ {
$atts = NULL;
if (empty($attributes)) if (empty($attributes))
{ {
return $atts; return NULL;
} }
if (is_string($attributes)) if (is_string($attributes))
@@ -792,6 +791,7 @@ if ( ! function_exists('_stringify_attributes'))
$attributes = (array) $attributes; $attributes = (array) $attributes;
$atts = '';
foreach ($attributes as $key => $val) foreach ($attributes as $key => $val)
{ {
$atts .= ($js) ? $key.'='.$val.',' : ' '.$key.'="'.$val.'"'; $atts .= ($js) ? $key.'='.$val.',' : ' '.$key.'="'.$val.'"';
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/config.html * @link https://codeigniter.com/userguide3/libraries/config.html
*/ */
class CI_Config { class CI_Config {
Executable → Regular
+12 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -47,7 +48,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/controllers.html * @link https://codeigniter.com/userguide3/general/controllers.html
*/ */
class CI_Controller { class CI_Controller {
@@ -58,6 +59,13 @@ class CI_Controller {
*/ */
private static $instance; private static $instance;
/**
* CI_Loader
*
* @var CI_Loader
*/
public $load;
/** /**
* Class constructor * Class constructor
* *
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Exceptions * @category Exceptions
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/exceptions.html * @link https://codeigniter.com/userguide3/libraries/exceptions.html
*/ */
class CI_Exceptions { class CI_Exceptions {
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/hooks.html * @link https://codeigniter.com/userguide3/general/hooks.html
*/ */
class CI_Hooks { class CI_Hooks {
Executable → Regular
+51 -9
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Input * @category Input
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/input.html * @link https://codeigniter.com/userguide3/libraries/input.html
*/ */
class CI_Input { class CI_Input {
@@ -137,7 +138,7 @@ class CI_Input {
*/ */
public function __construct() public function __construct()
{ {
$this->_allow_get_array = (config_item('allow_get_array') === TRUE); $this->_allow_get_array = (config_item('allow_get_array') !== FALSE);
$this->_enable_xss = (config_item('global_xss_filtering') === TRUE); $this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
$this->_enable_csrf = (config_item('csrf_protection') === TRUE); $this->_enable_csrf = (config_item('csrf_protection') === TRUE);
$this->_standardize_newlines = (bool) config_item('standardize_newlines'); $this->_standardize_newlines = (bool) config_item('standardize_newlines');
@@ -357,14 +358,15 @@ class CI_Input {
* @param string $prefix Cookie name prefix * @param string $prefix Cookie name prefix
* @param bool $secure Whether to only transfer cookies via SSL * @param bool $secure Whether to only transfer cookies via SSL
* @param bool $httponly Whether to only makes the cookie accessible via HTTP (no javascript) * @param bool $httponly Whether to only makes the cookie accessible via HTTP (no javascript)
* @param string $samesite SameSite attribute
* @return void * @return void
*/ */
public function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL) public function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL, $samesite = NULL)
{ {
if (is_array($name)) if (is_array($name))
{ {
// always leave 'name' in last place, as the loop will break otherwise, due to $$item // always leave 'name' in last place, as the loop will break otherwise, due to $$item
foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'name') as $item) foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'name', 'samesite') as $item)
{ {
if (isset($name[$item])) if (isset($name[$item]))
{ {
@@ -405,7 +407,47 @@ class CI_Input {
$expire = ($expire > 0) ? time() + $expire : 0; $expire = ($expire > 0) ? time() + $expire : 0;
} }
setcookie($prefix.$name, $value, $expire, $path, $domain, $secure, $httponly); isset($samesite) OR $samesite = config_item('cookie_samesite');
if (isset($samesite))
{
$samesite = ucfirst(strtolower($samesite));
in_array($samesite, array('Lax', 'Strict', 'None'), TRUE) OR $samesite = 'Lax';
}
else
{
$samesite = 'Lax';
}
if ($samesite === 'None' && ! $secure)
{
log_message('error', $name.' cookie sent with SameSite=None, but without Secure attribute.');
}
if ( ! is_php('7.3'))
{
$maxage = $expire - time();
if ($maxage < 1)
{
$maxage = 0;
}
$cookie_header = 'Set-Cookie: '.$prefix.$name.'='.rawurlencode($value);
$cookie_header .= ($expire === 0 ? '' : '; Expires='.gmdate('D, d-M-Y H:i:s T', $expire)).'; Max-Age='.$maxage;
$cookie_header .= '; Path='.$path.($domain !== '' ? '; Domain='.$domain : '');
$cookie_header .= ($secure ? '; Secure' : '').($httponly ? '; HttpOnly' : '').'; SameSite='.$samesite;
header($cookie_header);
return;
}
$setcookie_options = array(
'expires' => $expire,
'path' => $path,
'domain' => $domain,
'secure' => $secure,
'httponly' => $httponly,
'samesite' => $samesite,
);
setcookie($prefix.$name, $value, $setcookie_options);
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -565,7 +607,7 @@ class CI_Input {
$which = FILTER_FLAG_IPV6; $which = FILTER_FLAG_IPV6;
break; break;
default: default:
$which = NULL; $which = 0;
break; break;
} }
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Language * @category Language
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/language.html * @link https://codeigniter.com/userguide3/libraries/language.html
*/ */
class CI_Lang { class CI_Lang {
Executable → Regular
+13 -6
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Loader * @category Loader
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/loader.html * @link https://codeigniter.com/userguide3/libraries/loader.html
*/ */
class CI_Loader { class CI_Loader {
@@ -226,7 +227,7 @@ class CI_Loader {
* *
* Loads and instantiates models. * Loads and instantiates models.
* *
* @param string $model Model name * @param mixed $model Model name
* @param string $name An optional object name to assign to * @param string $name An optional object name to assign to
* @param bool $db_conn An optional database connection configuration to initialize * @param bool $db_conn An optional database connection configuration to initialize
* @return object * @return object
@@ -303,6 +304,8 @@ class CI_Loader {
{ {
throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model"); throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model");
} }
log_message('info', 'CI_Model class loaded');
} }
elseif ( ! class_exists('CI_Model', FALSE)) elseif ( ! class_exists('CI_Model', FALSE))
{ {
@@ -317,6 +320,8 @@ class CI_Loader {
{ {
throw new RuntimeException($app_path.$class.".php exists, but doesn't declare class ".$class); throw new RuntimeException($app_path.$class.".php exists, but doesn't declare class ".$class);
} }
log_message('info', config_item('subclass_prefix').'Model class loaded');
} }
} }
@@ -350,7 +355,9 @@ class CI_Loader {
} }
$this->_ci_models[] = $name; $this->_ci_models[] = $name;
$CI->$name = new $model(); $model = new $model();
$CI->$name = $model;
log_message('info', 'Model "'.get_class($model).'" initialized');
return $this; return $this;
} }
Executable → Regular
+8 -7
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Logging * @category Logging
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/errors.html * @link https://codeigniter.com/userguide3/general/errors.html
*/ */
class CI_Log { class CI_Log {
@@ -122,7 +123,7 @@ class CI_Log {
{ {
$config =& get_config(); $config =& get_config();
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
$this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/'; $this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/';
$this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '') $this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '')
@@ -247,11 +248,11 @@ class CI_Log {
* @param string $level The error level * @param string $level The error level
* @param string $date Formatted date string * @param string $date Formatted date string
* @param string $message The log message * @param string $message The log message
* @return string Formatted log line with a new line character '\n' at the end * @return string Formatted log line with a new line character at the end
*/ */
protected function _format_line($level, $date, $message) protected function _format_line($level, $date, $message)
{ {
return $level.' - '.$date.' --> '.$message."\n"; return $level.' - '.$date.' --> '.$message.PHP_EOL;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
Executable → Regular
+7 -10
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,21 +45,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/config.html * @link https://codeigniter.com/userguide3/libraries/config.html
*/ */
class CI_Model { class CI_Model {
/** /**
* Class constructor * Class constructor
* *
* @link https://github.com/bcit-ci/CodeIgniter/issues/5332
* @return void * @return void
*/ */
public function __construct() public function __construct() {}
{
log_message('info', 'Model Class Initialized');
}
// --------------------------------------------------------------------
/** /**
* __get magic * __get magic
Executable → Regular
+14 -9
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Output * @category Output
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/output.html * @link https://codeigniter.com/userguide3/libraries/output.html
*/ */
class CI_Output { class CI_Output {
@@ -55,7 +56,7 @@ class CI_Output {
* *
* @var string * @var string
*/ */
public $final_output; public $final_output = '';
/** /**
* Cache expiration time * Cache expiration time
@@ -145,7 +146,7 @@ class CI_Output {
&& extension_loaded('zlib') && extension_loaded('zlib')
); );
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
// Get mime types for later // Get mime types for later
$this->mimes =& get_mimes(); $this->mimes =& get_mimes();
@@ -299,10 +300,14 @@ class CI_Output {
*/ */
public function get_header($header) public function get_header($header)
{ {
// Combine headers already sent with our batched headers // We only need [x][0] from our multi-dimensional array
$header_lines = array_map(function ($headers)
{
return array_shift($headers);
}, $this->headers);
$headers = array_merge( $headers = array_merge(
// We only need [x][0] from our multi-dimensional array $header_lines,
array_map('array_shift', $this->headers),
headers_list() headers_list()
); );
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Libraries * @category Libraries
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/routing.html * @link https://codeigniter.com/userguide3/general/routing.html
*/ */
class CI_Router { class CI_Router {
Executable → Regular
+50 -19
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category Security * @category Security
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/security.html * @link https://codeigniter.com/userguide3/libraries/security.html
*/ */
class CI_Security { class CI_Security {
@@ -134,7 +135,9 @@ class CI_Security {
*/ */
protected $_never_allowed_str = array( protected $_never_allowed_str = array(
'document.cookie' => '[removed]', 'document.cookie' => '[removed]',
'(document).cookie' => '[removed]',
'document.write' => '[removed]', 'document.write' => '[removed]',
'(document).write' => '[removed]',
'.parentNode' => '[removed]', '.parentNode' => '[removed]',
'.innerHTML' => '[removed]', '.innerHTML' => '[removed]',
'-moz-binding' => '[removed]', '-moz-binding' => '[removed]',
@@ -152,7 +155,7 @@ class CI_Security {
*/ */
protected $_never_allowed_regex = array( protected $_never_allowed_regex = array(
'javascript\s*:', 'javascript\s*:',
'(document|(document\.)?window)\.(location|on\w*)', '(\(?document\)?|\(?window\)?(\.document)?)\.(location|on\w*)',
'expression\s*(\(|&\#40;)', // CSS and IE 'expression\s*(\(|&\#40;)', // CSS and IE
'vbscript\s*:', // IE, surprise! 'vbscript\s*:', // IE, surprise!
'wscript\s*:', // IE 'wscript\s*:', // IE
@@ -191,7 +194,7 @@ class CI_Security {
$this->_csrf_set_hash(); $this->_csrf_set_hash();
} }
$this->charset = strtoupper(config_item('charset')); $this->charset = strtoupper((string) config_item('charset'));
log_message('info', 'Security Class Initialized'); log_message('info', 'Security Class Initialized');
} }
@@ -226,6 +229,7 @@ class CI_Security {
// Check CSRF token validity, but don't error on mismatch just yet - we'll want to regenerate // Check CSRF token validity, but don't error on mismatch just yet - we'll want to regenerate
$valid = isset($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name]) $valid = isset($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name])
&& is_string($_POST[$this->_csrf_token_name]) && is_string($_COOKIE[$this->_csrf_cookie_name])
&& hash_equals($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name]); && hash_equals($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name]);
// We kill this since we're done and we don't want to pollute the _POST array // We kill this since we're done and we don't want to pollute the _POST array
@@ -269,15 +273,35 @@ class CI_Security {
return FALSE; return FALSE;
} }
setcookie( if (is_php('7.3'))
$this->_csrf_cookie_name, {
$this->_csrf_hash, setcookie(
$expire, $this->_csrf_cookie_name,
config_item('cookie_path'), $this->_csrf_hash,
config_item('cookie_domain'), array(
$secure_cookie, 'expires' => $expire,
config_item('cookie_httponly') 'path' => config_item('cookie_path'),
); 'domain' => config_item('cookie_domain'),
'secure' => $secure_cookie,
'httponly' => config_item('cookie_httponly'),
'samesite' => 'Strict'
)
);
}
else
{
$domain = trim(config_item('cookie_domain'));
header('Set-Cookie: '.$this->_csrf_cookie_name.'='.$this->_csrf_hash
.'; Expires='.gmdate('D, d-M-Y H:i:s T', $expire)
.'; Max-Age='.$this->_csrf_expire
.'; Path='.rawurlencode(config_item('cookie_path'))
.($domain === '' ? '' : '; Domain='.$domain)
.($secure_cookie ? '; Secure' : '')
.(config_item('cookie_httponly') ? '; HttpOnly' : '')
.'; SameSite=Strict'
);
}
log_message('info', 'CSRF cookie sent'); log_message('info', 'CSRF cookie sent');
return $this; return $this;
@@ -542,6 +566,14 @@ class CI_Security {
$str $str
); );
// Same thing, but for "tag functions" (e.g. eval`some code`)
// See https://github.com/bcit-ci/CodeIgniter/issues/5420
$str = preg_replace(
'#(alert|prompt|confirm|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)`(.*?)`#si',
'\\1\\2&#96;\\3&#96;',
$str
);
// Final clean up // Final clean up
// This adds a bit of extra precaution in case // This adds a bit of extra precaution in case
// something got through the above filters // something got through the above filters
@@ -624,7 +656,6 @@ class CI_Security {
return $output; return $output;
} }
if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE)
{ {
// Try not to waste entropy ... // Try not to waste entropy ...
@@ -853,7 +884,7 @@ class CI_Security {
// For other tags, see if their attributes are "evil" and strip those // For other tags, see if their attributes are "evil" and strip those
elseif (isset($matches['attributes'])) elseif (isset($matches['attributes']))
{ {
// We'll store the already fitlered attributes here // We'll store the already filtered attributes here
$attributes = array(); $attributes = array();
// Attribute-catching pattern // Attribute-catching pattern
@@ -927,7 +958,7 @@ class CI_Security {
return str_replace( return str_replace(
$match[1], $match[1],
preg_replace( preg_replace(
'#href=.*?(?:(?:alert|prompt|confirm)(?:\(|&\#40;)|javascript:|livescript:|mocha:|charset=|window\.|document\.|\.cookie|<script|<xss|d\s*a\s*t\s*a\s*:)#si', '#href=.*?(?:(?:alert|prompt|confirm)(?:\(|&\#40;|`|&\#96;)|javascript:|livescript:|mocha:|charset=|window\.|\(?document\)?\.|\.cookie|<script|<xss|d\s*a\s*t\s*a\s*:)#si',
'', '',
$this->_filter_attributes($match[1]) $this->_filter_attributes($match[1])
), ),
@@ -955,7 +986,7 @@ class CI_Security {
return str_replace( return str_replace(
$match[1], $match[1],
preg_replace( preg_replace(
'#src=.*?(?:(?:alert|prompt|confirm|eval)(?:\(|&\#40;)|javascript:|livescript:|mocha:|charset=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si', '#src=.*?(?:(?:alert|prompt|confirm|eval)(?:\(|&\#40;|`|&\#96;)|javascript:|livescript:|mocha:|charset=|window\.|\(?document\)?\.|\.cookie|<script|<xss|base64\s*,)#si',
'', '',
$this->_filter_attributes($match[1]) $this->_filter_attributes($match[1])
), ),
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category URI * @category URI
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/uri.html * @link https://codeigniter.com/userguide3/libraries/uri.html
*/ */
class CI_URI { class CI_URI {
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.0.0 * @since Version 2.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries * @subpackage Libraries
* @category UTF-8 * @category UTF-8
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/utf8.html * @link https://codeigniter.com/userguide3/libraries/utf8.html
*/ */
class CI_Utf8 { class CI_Utf8 {
Executable → Regular
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Compatibility * @category Compatibility
* @author Andrey Andreev * @author Andrey Andreev
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
* @link http://php.net/hash * @link https://secure.php.net/hash
*/ */
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Executable → Regular
View File
Executable → Regular
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Compatibility * @category Compatibility
* @author Andrey Andreev * @author Andrey Andreev
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
* @link http://php.net/mbstring * @link https://secure.php.net/mbstring
*/ */
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Executable → Regular
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Compatibility * @category Compatibility
* @author Andrey Andreev * @author Andrey Andreev
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
* @link http://php.net/password * @link https://secure.php.net/password
*/ */
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage CodeIgniter * @subpackage CodeIgniter
* @category Compatibility * @category Compatibility
* @author Andrey Andreev * @author Andrey Andreev
* @link https://codeigniter.com/user_guide/ * @link https://codeigniter.com/userguide3/
*/ */
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Executable → Regular
View File
Executable → Regular
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
* *
* @param string|string[] $params * @param string|string[] $params
* @param bool $query_builder_override * @param bool $query_builder_override
@@ -185,7 +186,7 @@ function &DB($params = '', $query_builder_override = NULL)
elseif ( ! class_exists('CI_DB', FALSE)) elseif ( ! class_exists('CI_DB', FALSE))
{ {
/** /**
* @ignore * @ignore
*/ */
class CI_DB extends CI_DB_driver { } class CI_DB extends CI_DB_driver { }
} }
Executable → Regular
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_Cache { class CI_DB_Cache {
Executable → Regular
+31 -19
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
abstract class CI_DB_driver { abstract class CI_DB_driver {
@@ -142,7 +143,7 @@ abstract class CI_DB_driver {
* *
* @var int * @var int
*/ */
public $port = ''; public $port = NULL;
/** /**
* Persistent connection flag * Persistent connection flag
@@ -890,6 +891,18 @@ abstract class CI_DB_driver {
// -------------------------------------------------------------------- // --------------------------------------------------------------------
/**
* Returns TRUE if a transaction is currently active
*
* @return bool
*/
public function trans_active()
{
return (bool) $this->_trans_depth;
}
// --------------------------------------------------------------------
/** /**
* Begin Transaction * Begin Transaction
* *
@@ -1308,19 +1321,13 @@ abstract class CI_DB_driver {
*/ */
public function list_fields($table) public function list_fields($table)
{ {
// Is there a cached result?
if (isset($this->data_cache['field_names'][$table]))
{
return $this->data_cache['field_names'][$table];
}
if (FALSE === ($sql = $this->_list_columns($table))) if (FALSE === ($sql = $this->_list_columns($table)))
{ {
return ($this->db_debug) ? $this->display_error('db_unsupported_function') : FALSE; return ($this->db_debug) ? $this->display_error('db_unsupported_function') : FALSE;
} }
$query = $this->query($sql); $query = $this->query($sql);
$this->data_cache['field_names'][$table] = array(); $fields = array();
foreach ($query->result_array() as $row) foreach ($query->result_array() as $row)
{ {
@@ -1342,10 +1349,10 @@ abstract class CI_DB_driver {
} }
} }
$this->data_cache['field_names'][$table][] = $row[$key]; $fields[] = $row[$key];
} }
return $this->data_cache['field_names'][$table]; return $fields;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -1528,7 +1535,7 @@ abstract class CI_DB_driver {
return 'UPDATE '.$table.' SET '.implode(', ', $valstr) return 'UPDATE '.$table.' SET '.implode(', ', $valstr)
.$this->_compile_wh('qb_where') .$this->_compile_wh('qb_where')
.$this->_compile_order_by() .$this->_compile_order_by()
.($this->qb_limit ? ' LIMIT '.$this->qb_limit : ''); .($this->qb_limit !== FALSE ? ' LIMIT '.$this->qb_limit : '');
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -1570,6 +1577,7 @@ abstract class CI_DB_driver {
'\s+EXISTS\s*\(.*\)', // EXISTS(sql) '\s+EXISTS\s*\(.*\)', // EXISTS(sql)
'\s+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql) '\s+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql)
'\s+BETWEEN\s+', // BETWEEN value AND value '\s+BETWEEN\s+', // BETWEEN value AND value
'\s+NOT BETWEEN\s+', // NOT BETWEEN value AND value
'\s+IN\s*\(.*\)', // IN(list) '\s+IN\s*\(.*\)', // IN(list)
'\s+NOT IN\s*\(.*\)', // NOT IN (list) '\s+NOT IN\s*\(.*\)', // NOT IN (list)
'\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s'] '\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s']
@@ -1926,15 +1934,19 @@ abstract class CI_DB_driver {
$i++; $i++;
} }
// dbprefix may've already been applied, with or without the identifier escaped
$ec = '(?<ec>'.preg_quote(is_array($this->_escape_char) ? $this->_escape_char[0] : $this->_escape_char).')?';
isset($ec[0]) && $ec .= '?'; // Just in case someone has disabled escaping by forcing an empty escape character
// Verify table prefix and replace if necessary // Verify table prefix and replace if necessary
if ($this->swap_pre !== '' && strpos($parts[$i], $this->swap_pre) === 0) if ($this->swap_pre !== '' && preg_match('#^'.$ec.preg_quote($this->swap_pre).'#', $parts[$i]))
{ {
$parts[$i] = preg_replace('/^'.$this->swap_pre.'(\S+?)/', $this->dbprefix.'\\1', $parts[$i]); $parts[$i] = preg_replace('#^'.$ec.preg_quote($this->swap_pre).'(\S+?)#', '\\1'.$this->dbprefix.'\\2', $parts[$i]);
} }
// We only add the table prefix if it does not already exist // We only add the table prefix if it does not already exist
elseif (strpos($parts[$i], $this->dbprefix) !== 0) else
{ {
$parts[$i] = $this->dbprefix.$parts[$i]; preg_match('#^'.$ec.preg_quote($this->dbprefix).'#', $parts[$i]) OR $parts[$i] = $this->dbprefix.$parts[$i];
} }
// Put the parts back together // Put the parts back together
Executable → Regular
+12 -10
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
abstract class CI_DB_forge { abstract class CI_DB_forge {
@@ -348,7 +349,10 @@ abstract class CI_DB_forge {
if (($result = $this->db->query($sql)) !== FALSE) if (($result = $this->db->query($sql)) !== FALSE)
{ {
isset($this->db->data_cache['table_names']) && $this->db->data_cache['table_names'][] = $table; if (isset($this->db->data_cache['table_names']))
{
$this->db->data_cache['table_names'][] = $table;
}
// Most databases don't support creating indexes from within the CREATE TABLE statement // Most databases don't support creating indexes from within the CREATE TABLE statement
if ( ! empty($this->keys)) if ( ! empty($this->keys))
@@ -382,10 +386,8 @@ abstract class CI_DB_forge {
{ {
return TRUE; return TRUE;
} }
else
{ $if_not_exists = FALSE;
$if_not_exists = FALSE;
}
} }
$sql = ($if_not_exists) $sql = ($if_not_exists)
@@ -726,7 +728,7 @@ abstract class CI_DB_forge {
'type' => isset($attributes['TYPE']) ? $attributes['TYPE'] : NULL, 'type' => isset($attributes['TYPE']) ? $attributes['TYPE'] : NULL,
'length' => '', 'length' => '',
'unsigned' => '', 'unsigned' => '',
'null' => '', 'null' => NULL,
'unique' => '', 'unique' => '',
'default' => '', 'default' => '',
'auto_increment' => '', 'auto_increment' => '',
+39 -33
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
abstract class CI_DB_query_builder extends CI_DB_driver { abstract class CI_DB_query_builder extends CI_DB_driver {
@@ -529,7 +530,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{ {
$type = strtoupper(trim($type)); $type = strtoupper(trim($type));
if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE)) if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER', 'FULL OUTER', 'FULL'), TRUE))
{ {
$type = ''; $type = '';
} }
@@ -680,7 +681,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{ {
if ($escape === TRUE) if ($escape === TRUE)
{ {
$v = ' '.$this->escape($v); $v = $this->escape($v);
} }
if ( ! $this->_has_operator($k)) if ( ! $this->_has_operator($k))
@@ -698,10 +699,11 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL'); $k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL');
} }
$this->{$qb_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape); ${$qb_key} = array('condition' => $prefix.$k, 'value' => $v, 'escape' => $escape);
$this->{$qb_key}[] = ${$qb_key};
if ($this->qb_caching === TRUE) if ($this->qb_caching === TRUE)
{ {
$this->{$qb_cache_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape); $this->{$qb_cache_key}[] = ${$qb_key};
$this->qb_cache_exists[] = substr($qb_key, 3); $this->qb_cache_exists[] = substr($qb_key, 3);
} }
@@ -834,6 +836,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$where_in = array( $where_in = array(
'condition' => $prefix.$key.$not.' IN('.implode(', ', $where_in).')', 'condition' => $prefix.$key.$not.' IN('.implode(', ', $where_in).')',
'value' => NULL,
'escape' => $escape 'escape' => $escape
); );
@@ -962,33 +965,34 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$v = $this->escape_like_str($v); $v = $this->escape_like_str($v);
} }
if ($side === 'none') switch ($side)
{ {
$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}'"; case 'none':
} $v = "'{$v}'";
elseif ($side === 'before') break;
{ case 'before':
$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}'"; $v = "'%{$v}'";
} break;
elseif ($side === 'after') case 'after':
{ $v = "'{$v}%'";
$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}%'"; break;
} case 'both':
else default:
{ $v = "'%{$v}%'";
$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}%'"; break;
} }
// some platforms require an escape sequence definition for LIKE wildcards // some platforms require an escape sequence definition for LIKE wildcards
if ($escape === TRUE && $this->_like_escape_str !== '') if ($escape === TRUE && $this->_like_escape_str !== '')
{ {
$like_statement .= sprintf($this->_like_escape_str, $this->_like_escape_chr); $v .= sprintf($this->_like_escape_str, $this->_like_escape_chr);
} }
$this->qb_where[] = array('condition' => $like_statement, 'escape' => $escape); $qb_where = array('condition' => "{$prefix} {$k} {$not} LIKE {$v}", 'value' => NULL, 'escape' => $escape);
$this->qb_where[] = $qb_where;
if ($this->qb_caching === TRUE) if ($this->qb_caching === TRUE)
{ {
$this->qb_cache_where[] = array('condition' => $like_statement, 'escape' => $escape); $this->qb_cache_where[] = $qb_where;
$this->qb_cache_exists[] = 'where'; $this->qb_cache_exists[] = 'where';
} }
} }
@@ -1013,6 +1017,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$prefix = (count($this->qb_where) === 0 && count($this->qb_cache_where) === 0) ? '' : $type; $prefix = (count($this->qb_where) === 0 && count($this->qb_cache_where) === 0) ? '' : $type;
$where = array( $where = array(
'condition' => $prefix.$not.str_repeat(' ', ++$this->qb_where_group_count).' (', 'condition' => $prefix.$not.str_repeat(' ', ++$this->qb_where_group_count).' (',
'value' => NULL,
'escape' => FALSE 'escape' => FALSE
); );
@@ -1073,6 +1078,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$this->qb_where_group_started = FALSE; $this->qb_where_group_started = FALSE;
$where = array( $where = array(
'condition' => str_repeat(' ', $this->qb_where_group_count--).')', 'condition' => str_repeat(' ', $this->qb_where_group_count--).')',
'value' => NULL,
'escape' => FALSE 'escape' => FALSE
); );
@@ -1114,7 +1120,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
/** /**
* GROUP BY * GROUP BY
* *
* @param string $by * @param mixed $by
* @param bool $escape * @param bool $escape
* @return CI_DB_query_builder * @return CI_DB_query_builder
*/ */
@@ -1405,9 +1411,9 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
// for selecting COUNT(*) ... // for selecting COUNT(*) ...
$qb_orderby = $this->qb_orderby; $qb_orderby = $this->qb_orderby;
$qb_cache_orderby = $this->qb_cache_orderby; $qb_cache_orderby = $this->qb_cache_orderby;
$this->qb_orderby = $this->qb_cache_orderby = NULL; $this->qb_orderby = $this->qb_cache_orderby = array();
$result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR $this->qb_limit OR $this->qb_offset) $result = ($this->qb_distinct === TRUE OR ! empty($this->qb_groupby) OR ! empty($this->qb_cache_groupby) OR ! empty($this->qb_having) OR $this->qb_limit OR $this->qb_offset)
? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results") ? $this->query($this->_count_string.$this->protect_identifiers('numrows')."\nFROM (\n".$this->_compile_select()."\n) CI_count_all_results")
: $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows'))); : $this->query($this->_compile_select($this->_count_string.$this->protect_identifiers('numrows')));
@@ -1433,7 +1439,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
// -------------------------------------------------------------------- // --------------------------------------------------------------------
/** /**
* Get_Where * get_where()
* *
* Allows the where clause, limit and offset to be added directly * Allows the where clause, limit and offset to be added directly
* *
@@ -2210,7 +2216,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
protected function _delete($table) protected function _delete($table)
{ {
return 'DELETE FROM '.$table.$this->_compile_wh('qb_where') return 'DELETE FROM '.$table.$this->_compile_wh('qb_where')
.($this->qb_limit ? ' LIMIT '.$this->qb_limit : ''); .($this->qb_limit !== FALSE ? ' LIMIT '.$this->qb_limit : '');
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -2360,7 +2366,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.$this->_compile_order_by(); // ORDER BY .$this->_compile_order_by(); // ORDER BY
// LIMIT // LIMIT
if ($this->qb_limit OR $this->qb_offset) if ($this->qb_limit !== FALSE OR $this->qb_offset)
{ {
return $this->_limit($sql."\n"); return $this->_limit($sql."\n");
} }
@@ -2395,7 +2401,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
} }
elseif ($this->{$qb_key}[$i]['escape'] === FALSE) elseif ($this->{$qb_key}[$i]['escape'] === FALSE)
{ {
$this->{$qb_key}[$i] = $this->{$qb_key}[$i]['condition']; $this->{$qb_key}[$i] = $this->{$qb_key}[$i]['condition'].(isset($this->{$qb_key}[$i]['value']) ? ' '.$this->{$qb_key}[$i]['value'] : '');
continue; continue;
} }
@@ -2434,7 +2440,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
.' '.trim($matches[3]).$matches[4].$matches[5]; .' '.trim($matches[3]).$matches[4].$matches[5];
} }
$this->{$qb_key}[$i] = implode('', $conditions); $this->{$qb_key}[$i] = implode('', $conditions).(isset($this->{$qb_key}[$i]['value']) ? ' '.$this->{$qb_key}[$i]['value'] : '');
} }
return ($qb_key === 'qb_having' ? "\nHAVING " : "\nWHERE ") return ($qb_key === 'qb_having' ? "\nHAVING " : "\nWHERE ")
Executable → Regular
+10 -10
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_result { class CI_DB_result {
@@ -163,10 +164,8 @@ class CI_DB_result {
{ {
return $this->result_object(); return $this->result_object();
} }
else
{ return $this->custom_result_object($type);
return $this->custom_result_object($type);
}
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -336,7 +335,8 @@ class CI_DB_result {
if ($type === 'object') return $this->row_object($n); if ($type === 'object') return $this->row_object($n);
elseif ($type === 'array') return $this->row_array($n); elseif ($type === 'array') return $this->row_array($n);
else return $this->custom_row_object($n, $type);
return $this->custom_row_object($n, $type);
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -382,7 +382,7 @@ class CI_DB_result {
*/ */
public function custom_row_object($n, $type) public function custom_row_object($n, $type)
{ {
isset($this->custom_result_object[$type]) OR $this->custom_result_object($type); isset($this->custom_result_object[$type]) OR $this->custom_result_object[$type] = $this->custom_result_object($type);
if (count($this->custom_result_object[$type]) === 0) if (count($this->custom_result_object[$type]) === 0)
{ {
Executable → Regular
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
abstract class CI_DB_utility { abstract class CI_DB_utility {
@@ -257,7 +258,7 @@ abstract class CI_DB_utility {
$line = array(); $line = array();
foreach ($row as $item) foreach ($row as $item)
{ {
$line[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure; $line[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, (string) $item).$enclosure;
} }
$out .= implode($delim, $line).$newline; $out .= implode($delim, $line).$newline;
} }
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author Esen Sagynov * @author Esen Sagynov
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_cubrid_driver extends CI_DB { class CI_DB_cubrid_driver extends CI_DB {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author Esen Sagynov * @author Esen Sagynov
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_cubrid_forge extends CI_DB_forge { class CI_DB_cubrid_forge extends CI_DB_forge {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author Esen Sagynov * @author Esen Sagynov
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_cubrid_result extends CI_DB_result { class CI_DB_cubrid_result extends CI_DB_result {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author Esen Sagynov * @author Esen Sagynov
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_cubrid_utility extends CI_DB_utility { class CI_DB_cubrid_utility extends CI_DB_utility {
View File
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_ibase_driver extends CI_DB { class CI_DB_ibase_driver extends CI_DB {
+7 -6
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_ibase_forge extends CI_DB_forge { class CI_DB_ibase_forge extends CI_DB_forge {
@@ -140,7 +141,7 @@ class CI_DB_ibase_forge extends CI_DB_forge {
* @return string|string[] * @return string|string[]
*/ */
protected function _alter_table($alter_type, $table, $field) protected function _alter_table($alter_type, $table, $field)
{ {
if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
{ {
return parent::_alter_table($alter_type, $table, $field); return parent::_alter_table($alter_type, $table, $field);
@@ -183,7 +184,7 @@ class CI_DB_ibase_forge extends CI_DB_forge {
} }
return $sqls; return $sqls;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_ibase_result extends CI_DB_result { class CI_DB_ibase_result extends CI_DB_result {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_ibase_utility extends CI_DB_utility { class CI_DB_ibase_utility extends CI_DB_utility {
View File
View File
View File
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mssql_driver extends CI_DB { class CI_DB_mssql_driver extends CI_DB {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mssql_forge extends CI_DB_forge { class CI_DB_mssql_forge extends CI_DB_forge {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mssql_result extends CI_DB_result { class CI_DB_mssql_result extends CI_DB_result {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mssql_utility extends CI_DB_utility { class CI_DB_mssql_utility extends CI_DB_utility {
View File
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysql_driver extends CI_DB { class CI_DB_mysql_driver extends CI_DB {
@@ -383,7 +384,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/ */
protected function _list_tables($prefix_limit = FALSE) protected function _list_tables($prefix_limit = FALSE)
{ {
$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database); $sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;
if ($prefix_limit !== FALSE && $this->dbprefix !== '') if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{ {
+5 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysql_forge extends CI_DB_forge { class CI_DB_mysql_forge extends CI_DB_forge {
@@ -185,7 +186,6 @@ class CI_DB_mysql_forge extends CI_DB_forge {
$extra_clause = ' FIRST'; $extra_clause = ' FIRST';
} }
return $this->db->escape_identifiers($field['name']) return $this->db->escape_identifiers($field['name'])
.(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name'])) .(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name']))
.' '.$field['type'].$field['length'] .' '.$field['type'].$field['length']
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysql_result extends CI_DB_result { class CI_DB_mysql_result extends CI_DB_result {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysql_utility extends CI_DB_utility { class CI_DB_mysql_utility extends CI_DB_utility {
View File
+33 -23
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysqli_driver extends CI_DB { class CI_DB_mysqli_driver extends CI_DB {
@@ -116,6 +117,13 @@ class CI_DB_mysqli_driver extends CI_DB {
*/ */
public function db_connect($persistent = FALSE) public function db_connect($persistent = FALSE)
{ {
// PHP 8.1 changes default error handling mode from silent to exceptions - reverse that
if (is_php('8.1'))
{
$mysqli_driver = new mysqli_driver();
$mysqli_driver->report_mode = MYSQLI_REPORT_OFF;
}
// Do we have a socket path? // Do we have a socket path?
if ($this->hostname[0] === '/') if ($this->hostname[0] === '/')
{ {
@@ -167,26 +175,28 @@ class CI_DB_mysqli_driver extends CI_DB {
empty($this->encrypt['ssl_capath']) OR $ssl['capath'] = $this->encrypt['ssl_capath']; empty($this->encrypt['ssl_capath']) OR $ssl['capath'] = $this->encrypt['ssl_capath'];
empty($this->encrypt['ssl_cipher']) OR $ssl['cipher'] = $this->encrypt['ssl_cipher']; empty($this->encrypt['ssl_cipher']) OR $ssl['cipher'] = $this->encrypt['ssl_cipher'];
if (isset($this->encrypt['ssl_verify']))
{
$client_flags |= MYSQLI_CLIENT_SSL;
if ($this->encrypt['ssl_verify'])
{
defined('MYSQLI_OPT_SSL_VERIFY_SERVER_CERT') && $this->_mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, TRUE);
}
// Apparently (when it exists), setting MYSQLI_OPT_SSL_VERIFY_SERVER_CERT
// to FALSE didn't do anything, so PHP 5.6.16 introduced yet another
// constant ...
//
// https://secure.php.net/ChangeLog-5.php#5.6.16
// https://bugs.php.net/bug.php?id=68344
elseif (defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
{
$client_flags |= MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;
}
}
if ( ! empty($ssl)) if ( ! empty($ssl))
{ {
if (isset($this->encrypt['ssl_verify']))
{
if ($this->encrypt['ssl_verify'])
{
defined('MYSQLI_OPT_SSL_VERIFY_SERVER_CERT') && $this->_mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, TRUE);
}
// Apparently (when it exists), setting MYSQLI_OPT_SSL_VERIFY_SERVER_CERT
// to FALSE didn't do anything, so PHP 5.6.16 introduced yet another
// constant ...
//
// https://secure.php.net/ChangeLog-5.php#5.6.16
// https://bugs.php.net/bug.php?id=68344
elseif (defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
{
$client_flags |= MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;
}
}
$client_flags |= MYSQLI_CLIENT_SSL; $client_flags |= MYSQLI_CLIENT_SSL;
$this->_mysqli->ssl_set( $this->_mysqli->ssl_set(
isset($ssl['key']) ? $ssl['key'] : NULL, isset($ssl['key']) ? $ssl['key'] : NULL,
@@ -427,7 +437,7 @@ class CI_DB_mysqli_driver extends CI_DB {
*/ */
protected function _list_tables($prefix_limit = FALSE) protected function _list_tables($prefix_limit = FALSE)
{ {
$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database); $sql = 'SHOW TABLES FROM '.$this->_escape_char.$this->database.$this->_escape_char;
if ($prefix_limit !== FALSE && $this->dbprefix !== '') if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{ {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysqli_forge extends CI_DB_forge { class CI_DB_mysqli_forge extends CI_DB_forge {
+8 -15
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysqli_result extends CI_DB_result { class CI_DB_mysqli_result extends CI_DB_result {
@@ -130,10 +131,10 @@ class CI_DB_mysqli_result extends CI_DB_result {
* mysqli_result::fetch_fields() * mysqli_result::fetch_fields()
* *
* @used-by CI_DB_mysqli_result::field_data() * @used-by CI_DB_mysqli_result::field_data()
* @param int $flags * @param int $type
* @return string * @return string
*/ */
private static function _get_field_type($flags) private static function _get_field_type($type)
{ {
static $map; static $map;
isset($map) OR $map = array( isset($map) OR $map = array(
@@ -164,15 +165,7 @@ class CI_DB_mysqli_result extends CI_DB_result {
MYSQLI_TYPE_GEOMETRY => 'geometry' MYSQLI_TYPE_GEOMETRY => 'geometry'
); );
foreach ($map as $flag => $name) return isset($map[$type]) ? $map[$type] : $type;
{
if ($flags & $flag)
{
return $name;
}
}
return $flags;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
+6 -9
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_mysqli_utility extends CI_DB_utility { class CI_DB_mysqli_utility extends CI_DB_utility {
@@ -155,11 +156,7 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
while ($field = $query->result_id->fetch_field()) while ($field = $query->result_id->fetch_field())
{ {
// Most versions of MySQL store timestamp as a string // Most versions of MySQL store timestamp as a string
$is_int[$i] = ($field->type & MYSQLI_TYPE_TINY) $is_int[$i] = in_array($field->type, array(MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_INT24, MYSQLI_TYPE_LONG), TRUE);
OR ($field->type & MYSQLI_TYPE_SHORT)
OR ($field->type & MYSQLI_TYPE_INT24)
OR ($field->type & MYSQLI_TYPE_LONG)
OR ($field->type & MYSQLI_TYPE_LONGLONG);
// Create a string of field names // Create a string of field names
$field_str .= $this->db->escape_identifiers($field->name).', '; $field_str .= $this->db->escape_identifiers($field->name).', ';
View File
+29 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.4.1 * @since Version 1.4.1
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
/** /**
@@ -97,7 +98,7 @@ class CI_DB_oci8_driver extends CI_DB {
* *
* @var bool * @var bool
*/ */
public $limit_used; public $limit_used = FALSE;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -682,7 +683,30 @@ class CI_DB_oci8_driver extends CI_DB {
*/ */
protected function _close() protected function _close()
{ {
if (is_resource($this->curs_id))
{
oci_free_statement($this->curs_id);
}
if (is_resource($this->stmt_id))
{
oci_free_statement($this->stmt_id);
}
oci_close($this->conn_id); oci_close($this->conn_id);
} }
// --------------------------------------------------------------------
/**
* We need to reset our $limit_used hack flag, so it doesn't propagate
* to subsequent queries.
*
* @return void
*/
protected function _reset_select()
{
$this->limit_used = FALSE;
parent::_reset_select();
}
} }
+35 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.4.1 * @since Version 1.4.1
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_oci8_forge extends CI_DB_forge { class CI_DB_oci8_forge extends CI_DB_forge {
@@ -81,6 +82,13 @@ class CI_DB_oci8_forge extends CI_DB_forge {
*/ */
protected $_unsigned = FALSE; protected $_unsigned = FALSE;
/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';
// -------------------------------------------------------------------- // --------------------------------------------------------------------
/** /**
@@ -152,7 +160,29 @@ class CI_DB_oci8_forge extends CI_DB_forge {
*/ */
protected function _attr_auto_increment(&$attributes, &$field) protected function _attr_auto_increment(&$attributes, &$field)
{ {
// Not supported - sequences and triggers must be used instead if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE && stripos($field['type'], 'number') !== FALSE && version_compare($this->db->version(), '12.1', '>='))
{
$field['auto_increment'] = ' GENERATED ALWAYS AS IDENTITY';
}
}
// --------------------------------------------------------------------
/**
* Process column
*
* @param array $field
* @return string
*/
protected function _process_column($field)
{
return $this->db->escape_identifiers($field['name'])
.' '.$field['type'].$field['length']
.$field['unsigned']
.$field['default']
.$field['auto_increment']
.$field['null']
.$field['unique'];
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.4.1 * @since Version 1.4.1
* @filesource * @filesource
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_oci8_result extends CI_DB_result { class CI_DB_oci8_result extends CI_DB_result {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.4.1 * @since Version 1.4.1
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_oci8_utility extends CI_DB_utility { class CI_DB_oci8_utility extends CI_DB_utility {
View File
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_odbc_driver extends CI_DB_driver { class CI_DB_odbc_driver extends CI_DB_driver {
+4 -3
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_odbc_result extends CI_DB_result { class CI_DB_odbc_result extends CI_DB_result {
+4 -3
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.3.0 * @since Version 1.3.0
* @filesource * @filesource
View File
+27 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_driver extends CI_DB { class CI_DB_pdo_driver extends CI_DB {
@@ -131,6 +132,14 @@ class CI_DB_pdo_driver extends CI_DB {
$this->options[PDO::ATTR_PERSISTENT] = TRUE; $this->options[PDO::ATTR_PERSISTENT] = TRUE;
} }
// From PHP8.0, default PDO::ATTR_ERRMODE is changed
// from PDO::ERRMODE_SILENT to PDO::ERRMODE_EXCEPTION
// as https://wiki.php.net/rfc/pdo_default_errmode
if ( ! isset($this->options[PDO::ATTR_ERRMODE]))
{
$this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
}
try try
{ {
return new PDO($this->dsn, $this->username, $this->password, $this->options); return new PDO($this->dsn, $this->username, $this->password, $this->options);
@@ -302,7 +311,7 @@ class CI_DB_pdo_driver extends CI_DB {
$error['code'] = isset($pdo_error[1]) ? $pdo_error[0].'/'.$pdo_error[1] : $pdo_error[0]; $error['code'] = isset($pdo_error[1]) ? $pdo_error[0].'/'.$pdo_error[1] : $pdo_error[0];
if (isset($pdo_error[2])) if (isset($pdo_error[2]))
{ {
$error['message'] = $pdo_error[2]; $error['message'] = $pdo_error[2];
} }
return $error; return $error;
@@ -326,4 +335,17 @@ class CI_DB_pdo_driver extends CI_DB {
return 'TRUNCATE TABLE '.$table; return 'TRUNCATE TABLE '.$table;
} }
// --------------------------------------------------------------------
/**
* Close DB Connection
*
* @return void
*/
protected function _close()
{
$this->result_id = FALSE;
$this->conn_id = FALSE;
}
} }
+4 -3
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
+6 -5
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_result extends CI_DB_result { class CI_DB_pdo_result extends CI_DB_result {
@@ -133,7 +134,7 @@ class CI_DB_pdo_result extends CI_DB_result {
$retval[$i] = new stdClass(); $retval[$i] = new stdClass();
$retval[$i]->name = $field['name']; $retval[$i]->name = $field['name'];
$retval[$i]->type = $field['native_type']; $retval[$i]->type = isset($field['native_type']) ? $field['native_type'] : null;
$retval[$i]->max_length = ($field['len'] > 0) ? $field['len'] : NULL; $retval[$i]->max_length = ($field['len'] > 0) ? $field['len'] : NULL;
$retval[$i]->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'], TRUE)); $retval[$i]->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'], TRUE));
} }
+4 -3
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 2.1.0 * @since Version 2.1.0
* @filesource * @filesource
View File
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_4d_driver extends CI_DB_pdo_driver { class CI_DB_pdo_4d_driver extends CI_DB_pdo_driver {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_4d_forge extends CI_DB_pdo_forge { class CI_DB_pdo_4d_forge extends CI_DB_pdo_forge {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_cubrid_driver extends CI_DB_pdo_driver { class CI_DB_pdo_cubrid_driver extends CI_DB_pdo_driver {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_cubrid_forge extends CI_DB_pdo_forge { class CI_DB_pdo_cubrid_forge extends CI_DB_pdo_forge {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_dblib_forge extends CI_DB_pdo_forge { class CI_DB_pdo_dblib_forge extends CI_DB_pdo_forge {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_firebird_driver extends CI_DB_pdo_driver { class CI_DB_pdo_firebird_driver extends CI_DB_pdo_driver {
+8 -7
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge { class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
@@ -126,7 +127,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
* @return string|string[] * @return string|string[]
*/ */
protected function _alter_table($alter_type, $table, $field) protected function _alter_table($alter_type, $table, $field)
{ {
if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
{ {
return parent::_alter_table($alter_type, $table, $field); return parent::_alter_table($alter_type, $table, $field);
@@ -150,7 +151,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
if ( ! empty($field[$i]['default'])) if ( ! empty($field[$i]['default']))
{ {
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name']) $sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default']; .' SET '.$field[$i]['default'];
} }
if (isset($field[$i]['null'])) if (isset($field[$i]['null']))
@@ -169,7 +170,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
} }
return $sqls; return $sqls;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers * @subpackage Drivers
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_ibm_driver extends CI_DB_pdo_driver { class CI_DB_pdo_ibm_driver extends CI_DB_pdo_driver {
+5 -4
View File
@@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * This content is released under the MIT License (MIT)
* *
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology * Copyright (c) 2019 - 2022, CodeIgniter Foundation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License * @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 3.0.0 * @since Version 3.0.0
* @filesource * @filesource
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* *
* @category Database * @category Database
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/ * @link https://codeigniter.com/userguide3/database/
*/ */
class CI_DB_pdo_ibm_forge extends CI_DB_pdo_forge { class CI_DB_pdo_ibm_forge extends CI_DB_pdo_forge {

Some files were not shown because too many files have changed in this diff Show More