__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace WP_Statistics\Service\Database\Operations;
/**
* Handles inspection of database tables.
*
* This class provides functionality to check the existence of a specified table
* in the database.
*/
class Inspect extends AbstractTableOperation
{
/**
* Executes the table inspection operation.
*
* @return $this
*/
public function execute()
{
$this->validateTableName();
$this->setFullTableName();
$this->inspectTable();
return $this;
}
/**
* Determines whether the table exists in the database.
*
* @return bool True if the table exists; false otherwise.
*/
private function inspectTable()
{
if (isset($this->result[$this->fullName])) {
return $this->result[$this->fullName];
}
$query = $this->wpdb->prepare('SHOW TABLES LIKE %s', $this->fullName);
$value = $this->wpdb->get_var($query);
$exists = !empty($value);
$this->result[$this->fullName] = $exists;
return $exists;
}
/**
* Retrieves the result of the table inspection.
*
* @return bool|null True if table exists, false if not, or null if not executed yet.
*/
public function getResult()
{
return isset($this->result[$this->fullName]) ? $this->result[$this->fullName] : null;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AbstractTableOperation.php | File | 1.76 KB | 0644 |
|
| Create.php | File | 2.18 KB | 0644 |
|
| Drop.php | File | 1.28 KB | 0644 |
|
| Insert.php | File | 6.22 KB | 0644 |
|
| Inspect.php | File | 1.34 KB | 0644 |
|
| InspectColumns.php | File | 1.82 KB | 0644 |
|
| Repair.php | File | 3.17 KB | 0644 |
|
| Select.php | File | 5.97 KB | 0644 |
|
| Update.php | File | 5.25 KB | 0644 |
|