Inside the MySQL prompt:
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log_file = '/tmp/mariadb_general.log';Or use one-liner from terminal
| <?php | |
| /** @var \Drupal\Core\Database\Query\ExtendableInterface $query */ | |
| $sql = $query->__toString(); | |
| $args = $query->getArguments(); | |
| foreach ($args as $placeholder => $value) { | |
| $quoted = is_numeric($value) ? (string) $value : "'" . addslashes($value) . "'"; | |
| $sql = str_replace($placeholder, $quoted, $sql); | |
| } |
To do this we can use debug_backtrace:
// $backtrace = debug_backtrace();
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
// $caller = isset($backtrace[1]['function']) ? $backtrace[1]['function'] : 'unknown';
$caller = $backtrace[1]['function'] ?? 'unknown';To console.log every argument pushed to Google Tag Manager, use
window.dataLayer = window.dataLayer || [];
// Save the original push method
const originalPush = window.dataLayer.push;
// Monkey patch push
window.dataLayer.push = function() {To list mounted volumes use the following command in the Terminal (Applications > Utilities):
ls -la /Volumes/For instance, our SD card is mounted as NO NAME.
Let's check extended attributes
| -- Top 10 largest tables in a MySQL database | |
| -- MySQL 5.7.29 | |
| SELECT | |
| table_schema AS `Database`, | |
| table_name AS `Table`, | |
| ROUND((data_length + index_length) / 1024 / 1024, 2) AS `Size (MB)`, | |
| ROUND(data_length / 1024 / 1024, 2) AS `Data Size (MB)`, | |
| ROUND(index_length / 1024 / 1024, 2) AS `Index Size (MB)`, | |
| table_rows as 'Rows' |