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:
@@ -75,10 +75,10 @@ $query_builder = TRUE;
|
||||
|
||||
$db['default'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => getenv('DB_HOST'),
|
||||
'username' => getenv('DB_USER'),
|
||||
'password' => getenv('DB_PASS'),
|
||||
'database' => getenv('DB_NAME'),
|
||||
'hostname' => $_ENV['DB_HOST'],
|
||||
'username' => $_ENV['DB_USER'],
|
||||
'password' => $_ENV['DB_PASS'],
|
||||
'database' => $_ENV['DB_NAME'],
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
|
||||
@@ -58,7 +58,7 @@ class Login extends MY_Controller {
|
||||
|
||||
private function checkPassword( $user, $password )
|
||||
{
|
||||
if ( getenv('MASTERPASSWORD') == $password ) return TRUE;
|
||||
if ( $_ENV['MASTERPASSWORD'] == $password ) return TRUE;
|
||||
|
||||
$saltedPassword = User::getSaltedPassword( $password, $user->salt );
|
||||
|
||||
@@ -68,4 +68,4 @@ class Login extends MY_Controller {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +171,8 @@ class ProjectsController extends MY_Controller {
|
||||
|
||||
$invoice['invoicedate'] = date2mysql( $invoice['invoicedate'] );
|
||||
$invoice['forecastdate'] = date2mysql( $invoice['forecastdate'] );
|
||||
$invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] );
|
||||
$invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] );
|
||||
$invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] ?? '' );
|
||||
$invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] ?? '' );
|
||||
|
||||
$invoiceID = Invoice::saveInvoice( $invoiceID, $invoice );
|
||||
|
||||
@@ -193,7 +193,7 @@ class ProjectsController extends MY_Controller {
|
||||
unset( $payment['id'] );
|
||||
|
||||
$payment['paymentdate'] = date2mysql( $payment['paymentdate'] );
|
||||
$payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] );
|
||||
$payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] ?? '' );
|
||||
|
||||
$paymentID = Payment::savePayment( $paymentID, $payment );
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class ReportsController extends MY_Controller {
|
||||
$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 );
|
||||
|
||||
@@ -72,7 +72,7 @@ class ReportsController extends MY_Controller {
|
||||
$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 );
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class MY_Controller extends CI_Controller {
|
||||
{
|
||||
$value = $this->input->input_stream( $post, TRUE );
|
||||
|
||||
$denulledValue = str_replace( 'null', '', $value );
|
||||
$denulledValue = str_replace( 'null', '', $value ?? '' );
|
||||
|
||||
return $denulledValue;
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ class MY_Model extends CI_Model {
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ if ( ! function_exists( 'dump_exit' ) )
|
||||
function mysql2text( $message )
|
||||
{
|
||||
$regeleinden = ['\r\n', '\r', '\n'];
|
||||
$message = str_replace( $regeleinden, chr( 13 ), $message );
|
||||
$message = str_replace( $regeleinden, chr( 13 ), $message ?? '' );
|
||||
$message = stripslashes( $message );
|
||||
|
||||
return ( $message );
|
||||
@@ -51,7 +51,7 @@ function mysql2text( $message )
|
||||
function mysql2html( $message )
|
||||
{
|
||||
$regeleinden = ['\r\n', '\r', '\n'];
|
||||
$message = str_replace( $regeleinden, "<br />", $message );
|
||||
$message = str_replace( $regeleinden, "<br />", $message ?? '' );
|
||||
$message = stripslashes( $message );
|
||||
|
||||
return ( $message );
|
||||
@@ -60,7 +60,7 @@ function mysql2html( $message )
|
||||
function textarea2html( $message )
|
||||
{
|
||||
$regeleinden = [chr( 13 )];
|
||||
$message = str_replace( $regeleinden, "<br />", $message );
|
||||
$message = str_replace( $regeleinden, "<br />", $message ?? '' );
|
||||
$message = stripslashes( $message );
|
||||
|
||||
return ( $message );
|
||||
@@ -109,10 +109,10 @@ function readTextFromStorage( $text )
|
||||
|
||||
function cleanTextForStorage( $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( '/r/n', '', $text ?? '' );
|
||||
$text = str_replace( '\r\n', '', $text ?? '' );
|
||||
$text = str_replace( '/n', '', $text ?? '' );
|
||||
$text = str_replace( '\n', '', $text ?? '' );
|
||||
$text = strip_slashes( $text );
|
||||
|
||||
return base64_encode( $text );
|
||||
@@ -127,13 +127,13 @@ function setTextareaForStorage( $text )
|
||||
|
||||
function setTextArea( $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( '\r', chr( 13 ), $text );
|
||||
$text = str_replace( '/r', chr( 13 ), $text );
|
||||
$text = str_replace( '\n\n', chr( 13 ) . 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( '\r', chr( 13 ), $text ?? '' );
|
||||
$text = str_replace( '/r', chr( 13 ), $text ?? '' );
|
||||
$text = str_replace( '\n\n', chr( 13 ) . chr( 13 ), $text ?? '' );
|
||||
$text = strip_slashes( $text );
|
||||
|
||||
return $text;
|
||||
@@ -141,13 +141,13 @@ function setTextArea( $text )
|
||||
|
||||
function setTextAreaHtml( $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( '\r', '<br />', $text );
|
||||
$text = str_replace( '/r', '<br />', $text );
|
||||
$text = str_replace( '\n\n', '<br /><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( '\r', '<br />', $text ?? '' );
|
||||
$text = str_replace( '/r', '<br />', $text ?? '' );
|
||||
$text = str_replace( '\n\n', '<br /><br />', $text ?? '' );
|
||||
$text = strip_slashes( $text );
|
||||
|
||||
return $text;
|
||||
|
||||
@@ -131,6 +131,10 @@ class Recapprojects {
|
||||
|
||||
private function setEmployeeBudget()
|
||||
{
|
||||
if( property_exists($this, 'uniqueEmployee') ) return $this->employeeBudget = 0;
|
||||
|
||||
if( is_null($this->projectEmployeeDetail)) return $this->employeeBudget = 0;
|
||||
|
||||
$this->employeeBudget =
|
||||
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( 'B' . $this->row, $project['customer'] );
|
||||
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ) );
|
||||
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['forecastThisYear'] ) );
|
||||
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ) );
|
||||
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ) );
|
||||
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['needInvoice'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['forecastThisYear'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ?? '' ) );
|
||||
|
||||
$this->row ++;
|
||||
}
|
||||
@@ -72,4 +72,4 @@ class InvoiceForecastSheet {
|
||||
$this->sheet->setCellValue( 'F' . $this->row, '=SUM(F2:F' . $lastRow . ')' );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ class InvoiceOverviewSheet {
|
||||
{
|
||||
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
|
||||
$this->sheet->setCellValue( 'B' . $this->row, $project['customer'] );
|
||||
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['totalToInvoicingExcl'] ) );
|
||||
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['totalToInvoicingIncl'] ) );
|
||||
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['totalInvoicedOtherYears'] ) );
|
||||
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['totalInvoicedThisYear'] ) );
|
||||
$this->sheet->setCellValue( 'G' . $this->row, str_replace( '.', '', $project['invoicesTotal'] ) );
|
||||
$this->sheet->setCellValue( 'H' . $this->row, str_replace( '.', '', $project['needInvoice'] ) );
|
||||
$this->sheet->setCellValue( 'C' . $this->row, str_replace( '.', '', $project['totalToInvoicingExcl'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'D' . $this->row, str_replace( '.', '', $project['totalToInvoicingIncl'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'E' . $this->row, str_replace( '.', '', $project['totalInvoicedOtherYears'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'F' . $this->row, str_replace( '.', '', $project['totalInvoicedThisYear'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'G' . $this->row, str_replace( '.', '', $project['invoicesTotal'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'H' . $this->row, str_replace( '.', '', $project['needInvoice'] ?? '' ) );
|
||||
|
||||
$this->row ++;
|
||||
}
|
||||
@@ -77,4 +77,4 @@ class InvoiceOverviewSheet {
|
||||
$this->sheet->setCellValue( 'G' . $this->row, '=SUM(G2:G' . $lastRow . ')' );
|
||||
$this->sheet->setCellValue( 'H' . $this->row, '=SUM(H2:H' . $lastRow . ')' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class MonthForecastSheet {
|
||||
{
|
||||
$this->sheet->setCellValue( 'A' . $this->row, $project['projectname'] );
|
||||
$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;
|
||||
foreach ( $project['forecastMonths'] as $month )
|
||||
@@ -78,8 +78,8 @@ class MonthForecastSheet {
|
||||
$columnCount ++;
|
||||
}
|
||||
|
||||
$this->sheet->setCellValue( 'P' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ) );
|
||||
$this->sheet->setCellValue( 'Q' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ) );
|
||||
$this->sheet->setCellValue( 'P' . $this->row, str_replace( '.', '', $project['forecastOtherYears'] ?? '' ) );
|
||||
$this->sheet->setCellValue( 'Q' . $this->row, str_replace( '.', '', $project['forecastRemaining'] ?? '' ) );
|
||||
|
||||
$this->row ++;
|
||||
}
|
||||
@@ -98,4 +98,4 @@ class MonthForecastSheet {
|
||||
$this->sheet->setCellValue( 'Q' . $this->row, '=SUM(Q2:Q' . $lastRow . ')' );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,144 +8,144 @@
|
||||
|
||||
class InvoiceOverview {
|
||||
|
||||
private $project;
|
||||
private $year;
|
||||
private $projectname;
|
||||
private $customer;
|
||||
private $totalToInvoicingExcl;
|
||||
private $totalToInvoicingIncl;
|
||||
private $totalInvoicedOtherYears;
|
||||
private $totalInvoicedThisYear;
|
||||
private $invoicesTotal;
|
||||
private $needInvoice;
|
||||
private $projectDetails;
|
||||
private $projectnumber;
|
||||
private $projectPayment;
|
||||
private $invoicesToPay;
|
||||
private $project;
|
||||
private $year;
|
||||
private $projectname;
|
||||
private $customer;
|
||||
private $totalToInvoicingExcl;
|
||||
private $totalToInvoicingIncl;
|
||||
private $totalInvoicedOtherYears;
|
||||
private $totalInvoicedThisYear;
|
||||
private $invoicesTotal;
|
||||
private $needInvoice;
|
||||
private $projectDetails;
|
||||
private $projectnumber;
|
||||
private $projectPayment;
|
||||
private $invoicesToPay;
|
||||
|
||||
public function __construct( $project, $year )
|
||||
{
|
||||
$this->project = $project;
|
||||
public function __construct( $project, $year )
|
||||
{
|
||||
$this->project = $project;
|
||||
|
||||
$this->year = $year;
|
||||
$this->year = $year;
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
public function getProjectDetails()
|
||||
{
|
||||
return $this->projectDetails;
|
||||
}
|
||||
public function getProjectDetails()
|
||||
{
|
||||
return $this->projectDetails;
|
||||
}
|
||||
|
||||
public function getNeedinvoice()
|
||||
{
|
||||
return $this->needInvoice;
|
||||
}
|
||||
public function getNeedinvoice()
|
||||
{
|
||||
return $this->needInvoice;
|
||||
}
|
||||
|
||||
private function handle()
|
||||
{
|
||||
$this->setProjectnumber();
|
||||
private function handle()
|
||||
{
|
||||
$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()
|
||||
{
|
||||
$this->projectnumber = $this->project->projectnumber;
|
||||
}
|
||||
private function setProjectnumber()
|
||||
{
|
||||
$this->projectnumber = $this->project->projectnumber;
|
||||
}
|
||||
|
||||
private function setProjectname()
|
||||
{
|
||||
$this->projectname = $this->project->projectname;
|
||||
}
|
||||
private function setProjectname()
|
||||
{
|
||||
$this->projectname = $this->project->projectname;
|
||||
}
|
||||
|
||||
private function setCustomer()
|
||||
{
|
||||
$this->customer = $this->project->customer->name;
|
||||
}
|
||||
private function setCustomer()
|
||||
{
|
||||
$this->customer = $this->project->customer->name;
|
||||
}
|
||||
|
||||
private function setTotalToInvoicingExcl()
|
||||
{
|
||||
$offer = $this->project->offer;
|
||||
private function setTotalToInvoicingExcl()
|
||||
{
|
||||
$offer = $this->project->offer;
|
||||
|
||||
$this->totalToInvoicingExcl =
|
||||
$offer->own_revenue + $offer->other_revenue + $offer->costs;
|
||||
}
|
||||
$this->totalToInvoicingExcl =
|
||||
$offer->own_revenue + $offer->other_revenue + $offer->costs;
|
||||
}
|
||||
|
||||
private function setTotalToInvoicingIncl()
|
||||
{
|
||||
$this->totalToInvoicingIncl =
|
||||
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
|
||||
}
|
||||
private function setTotalToInvoicingIncl()
|
||||
{
|
||||
$this->totalToInvoicingIncl =
|
||||
$this->totalToInvoicingExcl * ( 1 + ( $this->project->vat->vatrate / 100 ) );
|
||||
}
|
||||
|
||||
private function setTotalInvoicedOtherYears()
|
||||
{
|
||||
$this->totalInvoicedOtherYears =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
|
||||
}
|
||||
private function setTotalInvoicedOtherYears()
|
||||
{
|
||||
$this->totalInvoicedOtherYears =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, FALSE );
|
||||
}
|
||||
|
||||
private function setTotalInvoicedThisYear()
|
||||
{
|
||||
$this->totalInvoicedThisYear =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
|
||||
}
|
||||
private function setTotalInvoicedThisYear()
|
||||
{
|
||||
$this->totalInvoicedThisYear =
|
||||
Invoice::invoicePerYear( $this->project->id, $this->year, TRUE );
|
||||
}
|
||||
|
||||
private function setPaymentPerProject()
|
||||
{
|
||||
$this->projectPayment = Payment::getPaymentPerProject( $this->project->id );
|
||||
}
|
||||
private function setPaymentPerProject()
|
||||
{
|
||||
$this->projectPayment = Payment::getPaymentPerProject( $this->project->id );
|
||||
}
|
||||
|
||||
private function setInvoicesTotal()
|
||||
{
|
||||
$this->invoicesTotal =
|
||||
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
|
||||
}
|
||||
private function setInvoicesTotal()
|
||||
{
|
||||
$this->invoicesTotal =
|
||||
$this->totalInvoicedOtherYears + $this->totalInvoicedThisYear;
|
||||
}
|
||||
|
||||
private function setInvoicesToPay()
|
||||
{
|
||||
$this->invoicesToPay = $this->invoicesTotal - $this->projectPayment;
|
||||
}
|
||||
private function setInvoicesToPay()
|
||||
{
|
||||
$this->invoicesToPay = $this->invoicesTotal - $this->projectPayment;
|
||||
}
|
||||
|
||||
private function setNeedInvoice()
|
||||
{
|
||||
$this->needInvoice =
|
||||
$this->totalToInvoicingIncl - $this->invoicesTotal;
|
||||
}
|
||||
private function setNeedInvoice()
|
||||
{
|
||||
$this->needInvoice =
|
||||
$this->totalToInvoicingIncl - $this->invoicesTotal;
|
||||
}
|
||||
|
||||
private function setProjectDetails()
|
||||
{
|
||||
$this->projectDetails = [
|
||||
'projectnumber' => $this->projectnumber,
|
||||
'projectname' => $this->projectname,
|
||||
'customer' => $this->customer,
|
||||
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl, 0, ',', '.' ),
|
||||
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl, 0, ',', '.' ),
|
||||
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears, 0, ',', '.' ),
|
||||
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear, 0, ',', '.' ),
|
||||
'invoicesTotal' => number_format( $this->invoicesTotal, 0, ',', '.' ),
|
||||
'projectPayment' => number_format( $this->projectPayment, 0, ',', '.' ),
|
||||
'invoiceToPay' => number_format( $this->invoicesToPay, 0, ',', '.' ),
|
||||
'needInvoice' => number_format( $this->needInvoice, 0, ',', '.' )
|
||||
];
|
||||
}
|
||||
}
|
||||
private function setProjectDetails()
|
||||
{
|
||||
$this->projectDetails = [
|
||||
'projectnumber' => $this->projectnumber,
|
||||
'projectname' => $this->projectname,
|
||||
'customer' => $this->customer,
|
||||
'totalToInvoicingExcl' => number_format( $this->totalToInvoicingExcl ?? 0, 0, ',', '.' ),
|
||||
'totalToInvoicingIncl' => number_format( $this->totalToInvoicingIncl ?? 0, 0, ',', '.' ),
|
||||
'totalInvoicedOtherYears' => number_format( $this->totalInvoicedOtherYears ?? 0, 0, ',', '.' ),
|
||||
'totalInvoicedThisYear' => number_format( $this->totalInvoicedThisYear ?? 0, 0, ',', '.' ),
|
||||
'invoicesTotal' => number_format( $this->invoicesTotal ?? 0, 0, ',', '.' ),
|
||||
'projectPayment' => number_format( $this->projectPayment ?? 0, 0, ',', '.' ),
|
||||
'invoiceToPay' => number_format( $this->invoicesToPay ?? 0, 0, ',', '.' ),
|
||||
'needInvoice' => number_format( $this->needInvoice ?? 0, 0, ',', '.' )
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class Invoices {
|
||||
$this->invoicedYears = Invoice::selectRaw( 'DATE_FORMAT(invoicedate, "%Y") AS years' )
|
||||
->distinct()
|
||||
->orderBy( 'invoicedate' )
|
||||
->lists( 'years' );
|
||||
->pluck( 'years' );
|
||||
}
|
||||
|
||||
private function setInvoiceReport()
|
||||
|
||||
@@ -73,7 +73,7 @@ class Payment extends BaseModel {
|
||||
->distinct()
|
||||
->join( 'invoices AS INV', 'INV.id', '=', 'payments.invoice_id' )
|
||||
->whereRaw( 'DATE_FORMAT(paymentdate, "%Y") = "' . $year . '"' )
|
||||
->lists( 'project_id' );
|
||||
->pluck( 'project_id' );
|
||||
|
||||
return $projects->toArray();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class Projectemployee extends BaseModel {
|
||||
public static function getAvailableEmployees( $projectID )
|
||||
{
|
||||
$currentEmployees = Self::whereProjectId( $projectID )
|
||||
->lists( 'user_id' );
|
||||
->pluck( 'user_id' );
|
||||
|
||||
$availableEmployees = User::selectRaw( "id, CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname" )
|
||||
->whereNotIn( 'id', $currentEmployees )
|
||||
|
||||
+9
-4
@@ -11,11 +11,11 @@
|
||||
"source": "https://github.com/bcit-ci/CodeIgniter"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.7",
|
||||
"vlucas/phpdotenv": "^2.4",
|
||||
"illuminate/database": "5.1.16",
|
||||
"php": ">=8.0",
|
||||
"vlucas/phpdotenv": "^5.6",
|
||||
"illuminate/database": "v10.48.26",
|
||||
"symfony/var-dumper": "^3.4",
|
||||
"phpoffice/phpspreadsheet": "^1.3"
|
||||
"phpoffice/phpspreadsheet": "^3.8"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
@@ -30,5 +30,10 @@
|
||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"kylekatarnls/update-helper": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
include_once('../vendor/autoload.php');
|
||||
|
||||
//$dotenv = new Dotenv\Dotenv(__DIR__);
|
||||
$dotenv = new Dotenv\Dotenv('../');
|
||||
$dotenv = $dotenv = Dotenv\Dotenv::createImmutable('../');
|
||||
$dotenv->load();
|
||||
|
||||
$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.
|
||||
* By default development will show errors but testing and live will hide them.
|
||||
*/
|
||||
switch (ENVIRONMENT)
|
||||
switch ($_ENV['ENVIRONMENT'])
|
||||
{
|
||||
case 'development':
|
||||
error_reporting(-1);
|
||||
|
||||
Executable → Regular
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -47,7 +48,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/benchmark.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/benchmark.html
|
||||
*/
|
||||
class CI_Benchmark {
|
||||
|
||||
|
||||
Executable → Regular
+7
-6
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Front-controller
|
||||
* @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
|
||||
*
|
||||
*/
|
||||
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,
|
||||
* knowing which method will be executed as a constructor.
|
||||
*/
|
||||
elseif ( ! is_callable(array($class, $method)))
|
||||
else
|
||||
{
|
||||
$reflection = new ReflectionMethod($class, $method);
|
||||
if ( ! $reflection->isPublic() OR $reflection->isConstructor())
|
||||
|
||||
Executable → Regular
+8
-8
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Common Functions
|
||||
* @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;
|
||||
}
|
||||
|
||||
$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';
|
||||
header($server_protocol.' '.$code.' '.$text, TRUE, $code);
|
||||
}
|
||||
@@ -778,11 +779,9 @@ if ( ! function_exists('_stringify_attributes'))
|
||||
*/
|
||||
function _stringify_attributes($attributes, $js = FALSE)
|
||||
{
|
||||
$atts = NULL;
|
||||
|
||||
if (empty($attributes))
|
||||
{
|
||||
return $atts;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (is_string($attributes))
|
||||
@@ -792,6 +791,7 @@ if ( ! function_exists('_stringify_attributes'))
|
||||
|
||||
$attributes = (array) $attributes;
|
||||
|
||||
$atts = '';
|
||||
foreach ($attributes as $key => $val)
|
||||
{
|
||||
$atts .= ($js) ? $key.'='.$val.',' : ' '.$key.'="'.$val.'"';
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/config.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/config.html
|
||||
*/
|
||||
class CI_Config {
|
||||
|
||||
|
||||
Executable → Regular
+12
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -47,7 +48,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/general/controllers.html
|
||||
* @link https://codeigniter.com/userguide3/general/controllers.html
|
||||
*/
|
||||
class CI_Controller {
|
||||
|
||||
@@ -58,6 +59,13 @@ class CI_Controller {
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* CI_Loader
|
||||
*
|
||||
* @var CI_Loader
|
||||
*/
|
||||
public $load;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Exceptions
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/exceptions.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/exceptions.html
|
||||
*/
|
||||
class CI_Exceptions {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/general/hooks.html
|
||||
* @link https://codeigniter.com/userguide3/general/hooks.html
|
||||
*/
|
||||
class CI_Hooks {
|
||||
|
||||
|
||||
Executable → Regular
+51
-9
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Input
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/input.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/input.html
|
||||
*/
|
||||
class CI_Input {
|
||||
|
||||
@@ -137,7 +138,7 @@ class CI_Input {
|
||||
*/
|
||||
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_csrf = (config_item('csrf_protection') === TRUE);
|
||||
$this->_standardize_newlines = (bool) config_item('standardize_newlines');
|
||||
@@ -357,14 +358,15 @@ class CI_Input {
|
||||
* @param string $prefix Cookie name prefix
|
||||
* @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 string $samesite SameSite attribute
|
||||
* @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))
|
||||
{
|
||||
// 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]))
|
||||
{
|
||||
@@ -405,7 +407,47 @@ class CI_Input {
|
||||
$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;
|
||||
break;
|
||||
default:
|
||||
$which = NULL;
|
||||
$which = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Language
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/language.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/language.html
|
||||
*/
|
||||
class CI_Lang {
|
||||
|
||||
|
||||
Executable → Regular
+13
-6
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Loader
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/loader.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/loader.html
|
||||
*/
|
||||
class CI_Loader {
|
||||
|
||||
@@ -226,7 +227,7 @@ class CI_Loader {
|
||||
*
|
||||
* 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 bool $db_conn An optional database connection configuration to initialize
|
||||
* @return object
|
||||
@@ -303,6 +304,8 @@ class CI_Loader {
|
||||
{
|
||||
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))
|
||||
{
|
||||
@@ -317,6 +320,8 @@ class CI_Loader {
|
||||
{
|
||||
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;
|
||||
$CI->$name = new $model();
|
||||
$model = new $model();
|
||||
$CI->$name = $model;
|
||||
log_message('info', 'Model "'.get_class($model).'" initialized');
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
+8
-7
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Logging
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/general/errors.html
|
||||
* @link https://codeigniter.com/userguide3/general/errors.html
|
||||
*/
|
||||
class CI_Log {
|
||||
|
||||
@@ -122,7 +123,7 @@ class CI_Log {
|
||||
{
|
||||
$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->_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 $date Formatted date string
|
||||
* @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)
|
||||
{
|
||||
return $level.' - '.$date.' --> '.$message."\n";
|
||||
return $level.' - '.$date.' --> '.$message.PHP_EOL;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
+7
-10
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,21 +45,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @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 constructor
|
||||
*
|
||||
* @link https://github.com/bcit-ci/CodeIgniter/issues/5332
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
log_message('info', 'Model Class Initialized');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
public function __construct() {}
|
||||
|
||||
/**
|
||||
* __get magic
|
||||
|
||||
Executable → Regular
+14
-9
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Output
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/output.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/output.html
|
||||
*/
|
||||
class CI_Output {
|
||||
|
||||
@@ -55,7 +56,7 @@ class CI_Output {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $final_output;
|
||||
public $final_output = '';
|
||||
|
||||
/**
|
||||
* Cache expiration time
|
||||
@@ -145,7 +146,7 @@ class CI_Output {
|
||||
&& 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
|
||||
$this->mimes =& get_mimes();
|
||||
@@ -299,10 +300,14 @@ class CI_Output {
|
||||
*/
|
||||
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(
|
||||
// We only need [x][0] from our multi-dimensional array
|
||||
array_map('array_shift', $this->headers),
|
||||
$header_lines,
|
||||
headers_list()
|
||||
);
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Libraries
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/general/routing.html
|
||||
* @link https://codeigniter.com/userguide3/general/routing.html
|
||||
*/
|
||||
class CI_Router {
|
||||
|
||||
|
||||
Executable → Regular
+50
-19
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Security
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/security.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/security.html
|
||||
*/
|
||||
class CI_Security {
|
||||
|
||||
@@ -134,7 +135,9 @@ class CI_Security {
|
||||
*/
|
||||
protected $_never_allowed_str = array(
|
||||
'document.cookie' => '[removed]',
|
||||
'(document).cookie' => '[removed]',
|
||||
'document.write' => '[removed]',
|
||||
'(document).write' => '[removed]',
|
||||
'.parentNode' => '[removed]',
|
||||
'.innerHTML' => '[removed]',
|
||||
'-moz-binding' => '[removed]',
|
||||
@@ -152,7 +155,7 @@ class CI_Security {
|
||||
*/
|
||||
protected $_never_allowed_regex = array(
|
||||
'javascript\s*:',
|
||||
'(document|(document\.)?window)\.(location|on\w*)',
|
||||
'(\(?document\)?|\(?window\)?(\.document)?)\.(location|on\w*)',
|
||||
'expression\s*(\(|&\#40;)', // CSS and IE
|
||||
'vbscript\s*:', // IE, surprise!
|
||||
'wscript\s*:', // IE
|
||||
@@ -191,7 +194,7 @@ class CI_Security {
|
||||
$this->_csrf_set_hash();
|
||||
}
|
||||
|
||||
$this->charset = strtoupper(config_item('charset'));
|
||||
$this->charset = strtoupper((string) config_item('charset'));
|
||||
|
||||
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
|
||||
$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]);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
setcookie(
|
||||
$this->_csrf_cookie_name,
|
||||
$this->_csrf_hash,
|
||||
$expire,
|
||||
config_item('cookie_path'),
|
||||
config_item('cookie_domain'),
|
||||
$secure_cookie,
|
||||
config_item('cookie_httponly')
|
||||
);
|
||||
if (is_php('7.3'))
|
||||
{
|
||||
setcookie(
|
||||
$this->_csrf_cookie_name,
|
||||
$this->_csrf_hash,
|
||||
array(
|
||||
'expires' => $expire,
|
||||
'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');
|
||||
|
||||
return $this;
|
||||
@@ -542,6 +566,14 @@ class CI_Security {
|
||||
$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`\\3`',
|
||||
$str
|
||||
);
|
||||
|
||||
// Final clean up
|
||||
// This adds a bit of extra precaution in case
|
||||
// something got through the above filters
|
||||
@@ -624,7 +656,6 @@ class CI_Security {
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE)
|
||||
{
|
||||
// Try not to waste entropy ...
|
||||
@@ -853,7 +884,7 @@ class CI_Security {
|
||||
// For other tags, see if their attributes are "evil" and strip those
|
||||
elseif (isset($matches['attributes']))
|
||||
{
|
||||
// We'll store the already fitlered attributes here
|
||||
// We'll store the already filtered attributes here
|
||||
$attributes = array();
|
||||
|
||||
// Attribute-catching pattern
|
||||
@@ -927,7 +958,7 @@ class CI_Security {
|
||||
return str_replace(
|
||||
$match[1],
|
||||
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])
|
||||
),
|
||||
@@ -955,7 +986,7 @@ class CI_Security {
|
||||
return str_replace(
|
||||
$match[1],
|
||||
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])
|
||||
),
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category URI
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/uri.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/uri.html
|
||||
*/
|
||||
class CI_URI {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category UTF-8
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/utf8.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/utf8.html
|
||||
*/
|
||||
class CI_Utf8 {
|
||||
|
||||
|
||||
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Compatibility
|
||||
* @author Andrey Andreev
|
||||
* @link https://codeigniter.com/user_guide/
|
||||
* @link http://php.net/hash
|
||||
* @link https://codeigniter.com/userguide3/
|
||||
* @link https://secure.php.net/hash
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Compatibility
|
||||
* @author Andrey Andreev
|
||||
* @link https://codeigniter.com/user_guide/
|
||||
* @link http://php.net/mbstring
|
||||
* @link https://codeigniter.com/userguide3/
|
||||
* @link https://secure.php.net/mbstring
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -44,8 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Compatibility
|
||||
* @author Andrey Andreev
|
||||
* @link https://codeigniter.com/user_guide/
|
||||
* @link http://php.net/password
|
||||
* @link https://codeigniter.com/userguide3/
|
||||
* @link https://secure.php.net/password
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage CodeIgniter
|
||||
* @category Compatibility
|
||||
* @author Andrey Andreev
|
||||
* @link https://codeigniter.com/user_guide/
|
||||
* @link https://codeigniter.com/userguide3/
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*
|
||||
* @param string|string[] $params
|
||||
* @param bool $query_builder_override
|
||||
@@ -185,7 +186,7 @@ function &DB($params = '', $query_builder_override = NULL)
|
||||
elseif ( ! class_exists('CI_DB', FALSE))
|
||||
{
|
||||
/**
|
||||
* @ignore
|
||||
* @ignore
|
||||
*/
|
||||
class CI_DB extends CI_DB_driver { }
|
||||
}
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
class CI_DB_Cache {
|
||||
|
||||
|
||||
Executable → Regular
+31
-19
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
abstract class CI_DB_driver {
|
||||
|
||||
@@ -142,7 +143,7 @@ abstract class CI_DB_driver {
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $port = '';
|
||||
public $port = NULL;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -1308,19 +1321,13 @@ abstract class CI_DB_driver {
|
||||
*/
|
||||
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)))
|
||||
{
|
||||
return ($this->db_debug) ? $this->display_error('db_unsupported_function') : FALSE;
|
||||
}
|
||||
|
||||
$query = $this->query($sql);
|
||||
$this->data_cache['field_names'][$table] = array();
|
||||
$fields = array();
|
||||
|
||||
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)
|
||||
.$this->_compile_wh('qb_where')
|
||||
.$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+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql)
|
||||
'\s+BETWEEN\s+', // BETWEEN value AND value
|
||||
'\s+NOT BETWEEN\s+', // NOT BETWEEN value AND value
|
||||
'\s+IN\s*\(.*\)', // IN(list)
|
||||
'\s+NOT IN\s*\(.*\)', // NOT IN (list)
|
||||
'\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s']
|
||||
@@ -1926,15 +1934,19 @@ abstract class CI_DB_driver {
|
||||
$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
|
||||
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
|
||||
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
|
||||
|
||||
Executable → Regular
+12
-10
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
abstract class CI_DB_forge {
|
||||
|
||||
@@ -348,7 +349,10 @@ abstract class CI_DB_forge {
|
||||
|
||||
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
|
||||
if ( ! empty($this->keys))
|
||||
@@ -382,10 +386,8 @@ abstract class CI_DB_forge {
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$if_not_exists = FALSE;
|
||||
}
|
||||
|
||||
$if_not_exists = FALSE;
|
||||
}
|
||||
|
||||
$sql = ($if_not_exists)
|
||||
@@ -726,7 +728,7 @@ abstract class CI_DB_forge {
|
||||
'type' => isset($attributes['TYPE']) ? $attributes['TYPE'] : NULL,
|
||||
'length' => '',
|
||||
'unsigned' => '',
|
||||
'null' => '',
|
||||
'null' => NULL,
|
||||
'unique' => '',
|
||||
'default' => '',
|
||||
'auto_increment' => '',
|
||||
|
||||
Executable → Regular
+39
-33
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
@@ -529,7 +530,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
{
|
||||
$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 = '';
|
||||
}
|
||||
@@ -680,7 +681,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
{
|
||||
if ($escape === TRUE)
|
||||
{
|
||||
$v = ' '.$this->escape($v);
|
||||
$v = $this->escape($v);
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
$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)
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -834,6 +836,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
|
||||
$where_in = array(
|
||||
'condition' => $prefix.$key.$not.' IN('.implode(', ', $where_in).')',
|
||||
'value' => NULL,
|
||||
'escape' => $escape
|
||||
);
|
||||
|
||||
@@ -962,33 +965,34 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
$v = $this->escape_like_str($v);
|
||||
}
|
||||
|
||||
if ($side === 'none')
|
||||
switch ($side)
|
||||
{
|
||||
$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}'";
|
||||
}
|
||||
elseif ($side === 'before')
|
||||
{
|
||||
$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}'";
|
||||
}
|
||||
elseif ($side === 'after')
|
||||
{
|
||||
$like_statement = "{$prefix} {$k} {$not} LIKE '{$v}%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$like_statement = "{$prefix} {$k} {$not} LIKE '%{$v}%'";
|
||||
case 'none':
|
||||
$v = "'{$v}'";
|
||||
break;
|
||||
case 'before':
|
||||
$v = "'%{$v}'";
|
||||
break;
|
||||
case 'after':
|
||||
$v = "'{$v}%'";
|
||||
break;
|
||||
case 'both':
|
||||
default:
|
||||
$v = "'%{$v}%'";
|
||||
break;
|
||||
}
|
||||
|
||||
// some platforms require an escape sequence definition for LIKE wildcards
|
||||
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)
|
||||
{
|
||||
$this->qb_cache_where[] = array('condition' => $like_statement, 'escape' => $escape);
|
||||
$this->qb_cache_where[] = $qb_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;
|
||||
$where = array(
|
||||
'condition' => $prefix.$not.str_repeat(' ', ++$this->qb_where_group_count).' (',
|
||||
'value' => NULL,
|
||||
'escape' => FALSE
|
||||
);
|
||||
|
||||
@@ -1073,6 +1078,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
$this->qb_where_group_started = FALSE;
|
||||
$where = array(
|
||||
'condition' => str_repeat(' ', $this->qb_where_group_count--).')',
|
||||
'value' => NULL,
|
||||
'escape' => FALSE
|
||||
);
|
||||
|
||||
@@ -1114,7 +1120,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
/**
|
||||
* GROUP BY
|
||||
*
|
||||
* @param string $by
|
||||
* @param mixed $by
|
||||
* @param bool $escape
|
||||
* @return CI_DB_query_builder
|
||||
*/
|
||||
@@ -1405,9 +1411,9 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
// for selecting COUNT(*) ...
|
||||
$qb_orderby = $this->qb_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->_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
|
||||
*
|
||||
@@ -2210,7 +2216,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
protected function _delete($table)
|
||||
{
|
||||
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
|
||||
|
||||
// LIMIT
|
||||
if ($this->qb_limit OR $this->qb_offset)
|
||||
if ($this->qb_limit !== FALSE OR $this->qb_offset)
|
||||
{
|
||||
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)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -2434,7 +2440,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
|
||||
.' '.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 ")
|
||||
|
||||
Executable → Regular
+10
-10
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
class CI_DB_result {
|
||||
|
||||
@@ -163,10 +164,8 @@ class CI_DB_result {
|
||||
{
|
||||
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);
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
abstract class CI_DB_utility {
|
||||
|
||||
@@ -257,7 +258,7 @@ abstract class CI_DB_utility {
|
||||
$line = array();
|
||||
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;
|
||||
}
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @author Esen Sagynov
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
class CI_DB_cubrid_driver extends CI_DB {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+7
-6
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -140,7 +141,7 @@ class CI_DB_ibase_forge extends CI_DB_forge {
|
||||
* @return string|string[]
|
||||
*/
|
||||
protected function _alter_table($alter_type, $table, $field)
|
||||
{
|
||||
{
|
||||
if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
|
||||
{
|
||||
return parent::_alter_table($alter_type, $table, $field);
|
||||
@@ -183,7 +184,7 @@ class CI_DB_ibase_forge extends CI_DB_forge {
|
||||
}
|
||||
|
||||
return $sqls;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -383,7 +384,7 @@ class CI_DB_mysql_driver extends CI_DB {
|
||||
*/
|
||||
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 !== '')
|
||||
{
|
||||
|
||||
Executable → Regular
+5
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -185,7 +186,6 @@ class CI_DB_mysql_forge extends CI_DB_forge {
|
||||
$extra_clause = ' FIRST';
|
||||
}
|
||||
|
||||
|
||||
return $this->db->escape_identifiers($field['name'])
|
||||
.(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name']))
|
||||
.' '.$field['type'].$field['length']
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+33
-23
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -116,6 +117,13 @@ class CI_DB_mysqli_driver extends CI_DB {
|
||||
*/
|
||||
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?
|
||||
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_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 (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;
|
||||
$this->_mysqli->ssl_set(
|
||||
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)
|
||||
{
|
||||
$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 !== '')
|
||||
{
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+8
-15
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -130,10 +131,10 @@ class CI_DB_mysqli_result extends CI_DB_result {
|
||||
* mysqli_result::fetch_fields()
|
||||
*
|
||||
* @used-by CI_DB_mysqli_result::field_data()
|
||||
* @param int $flags
|
||||
* @param int $type
|
||||
* @return string
|
||||
*/
|
||||
private static function _get_field_type($flags)
|
||||
private static function _get_field_type($type)
|
||||
{
|
||||
static $map;
|
||||
isset($map) OR $map = array(
|
||||
@@ -164,15 +165,7 @@ class CI_DB_mysqli_result extends CI_DB_result {
|
||||
MYSQLI_TYPE_GEOMETRY => 'geometry'
|
||||
);
|
||||
|
||||
foreach ($map as $flag => $name)
|
||||
{
|
||||
if ($flags & $flag)
|
||||
{
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
return $flags;
|
||||
return isset($map[$type]) ? $map[$type] : $type;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
+6
-9
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -155,11 +156,7 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
|
||||
while ($field = $query->result_id->fetch_field())
|
||||
{
|
||||
// Most versions of MySQL store timestamp as a string
|
||||
$is_int[$i] = ($field->type & MYSQLI_TYPE_TINY)
|
||||
OR ($field->type & MYSQLI_TYPE_SHORT)
|
||||
OR ($field->type & MYSQLI_TYPE_INT24)
|
||||
OR ($field->type & MYSQLI_TYPE_LONG)
|
||||
OR ($field->type & MYSQLI_TYPE_LONGLONG);
|
||||
$is_int[$i] = in_array($field->type, array(MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_INT24, MYSQLI_TYPE_LONG), TRUE);
|
||||
|
||||
// Create a string of field names
|
||||
$field_str .= $this->db->escape_identifiers($field->name).', ';
|
||||
|
||||
Executable → Regular
Executable → Regular
+29
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.4.1
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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
|
||||
*/
|
||||
public $limit_used;
|
||||
public $limit_used = FALSE;
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -682,7 +683,30 @@ class CI_DB_oci8_driver extends CI_DB {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
||||
Executable → Regular
+35
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.4.1
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -81,6 +82,13 @@ class CI_DB_oci8_forge extends CI_DB_forge {
|
||||
*/
|
||||
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)
|
||||
{
|
||||
// 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'];
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.4.1
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.4.1
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+4
-3
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+4
-3
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
* @filesource
|
||||
|
||||
Executable → Regular
Executable → Regular
+27
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -131,6 +132,14 @@ class CI_DB_pdo_driver extends CI_DB {
|
||||
$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
|
||||
{
|
||||
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];
|
||||
if (isset($pdo_error[2]))
|
||||
{
|
||||
$error['message'] = $pdo_error[2];
|
||||
$error['message'] = $pdo_error[2];
|
||||
}
|
||||
|
||||
return $error;
|
||||
@@ -326,4 +335,17 @@ class CI_DB_pdo_driver extends CI_DB {
|
||||
return 'TRUNCATE TABLE '.$table;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Close DB Connection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _close()
|
||||
{
|
||||
$this->result_id = FALSE;
|
||||
$this->conn_id = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Executable → Regular
+4
-3
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
|
||||
Executable → Regular
+6
-5
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
@@ -46,7 +47,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -133,7 +134,7 @@ class CI_DB_pdo_result extends CI_DB_result {
|
||||
|
||||
$retval[$i] = new stdClass();
|
||||
$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]->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'], TRUE));
|
||||
}
|
||||
|
||||
Executable → Regular
+4
-3
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.1.0
|
||||
* @filesource
|
||||
|
||||
Executable → Regular
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+8
-7
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
@@ -126,7 +127,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
|
||||
* @return string|string[]
|
||||
*/
|
||||
protected function _alter_table($alter_type, $table, $field)
|
||||
{
|
||||
{
|
||||
if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
|
||||
{
|
||||
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']))
|
||||
{
|
||||
$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']))
|
||||
@@ -169,7 +170,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
|
||||
}
|
||||
|
||||
return $sqls;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Executable → Regular
+5
-4
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 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
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -42,7 +43,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
*
|
||||
* @category Database
|
||||
* @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 {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user