Files
roi-theme/wp-content/plugins/wp-database-tools/includes/data/class-wp-database-tools-database-data-table.php
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

113 lines
2.6 KiB
PHP
Executable File

<?php
/**
* Database functions
*
* @link https://raiolanetworks.es
* @since 1.0.0
*
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
*/
/**
* Contains the functionalities related to database management.
*
* This class defines all code necessary to manage the database functionalities.
*
* @since 1.0.0
* @package Wp_Database_Tools
* @subpackage Wp_Database_Tools/includes
* @author Raiola Networks <info@raiolanetworks.es>
*/
class Wp_Database_Tools_Database_Data_Table extends Wp_Database_Tools_Database_Data
{
/**
* The general data of database.
*
* @since 1.0.0
* @access protected
* @var int $data The general data of database.
*/
protected $row;
/**
* Indicates if the table is prefixed or not
*
* @since 1.0.0
* @access protected
* @var boolean $prefix Table has prefix.
*/
protected $prefix;
/**
* Table name without prefix
*
* @since 1.0.0
* @access protected
* @var string $name_without_prefix Table name without prefix.
*/
protected $name_without_prefix;
public function __construct($table, $feedback)
{
parent::__construct();
global $wpdb;
// table data
$this->row = $table->Rows;
// Common data
$this->name = $table->Name;
$this->id = $this->name;
$this->section = 'tables';
$this->size = $this->sum_size($table);
$this->format_size = $this->get_file_size_info( $this->size );
$this->format_size = $this->format_size['size'] . '' . $this->format_size['type'];
$this->set_feedback($feedback);
$this->check_regex();
$this->set_prefix($table->Name, $wpdb->prefix);
}
public function check_regex(){
$this->set_regex(false);
}
public function set_multiple($value){
$this->multiple = true;
}
public function return_object_vars(){
return get_object_vars($this);
}
public function set_prefix($name, $prefix){
if (str_starts_with($name, $prefix)) {
$this->name_without_prefix = substr($name, strlen($prefix));
}else{
$this->name_without_prefix = $name;
}
$this->prefix = ($prefix . $this->name_without_prefix == $name);
}
public function get_name()
{
return ($this->prefix) ? $this->name_without_prefix : $this->name;
}
public function get_name_without_prefix()
{
return $this->name_without_prefix;
}
}