This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/plain'); | |
# Normal server environment | |
ini_set('display_errors', 'Off'); | |
error_reporting(0); | |
$test = 'TEST VALUE'; | |
function test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
table_name, | |
ROUND(KBS/POWER(1024,1), 2) KBs, | |
ROUND(KBS/POWER(1024,2), 2) MBs | |
FROM | |
( | |
SELECT | |
table_name, SUM(index_length) KBS | |
FROM information_schema.tables | |
WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace cases; | |
use PHPUnit\Framework\TestCase; | |
class PhpIniConfigurationsTest extends TestCase | |
{ | |
/** | |
* Most common configurations | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE test; | |
DROP TABLE IF EXISTS apache_logs; | |
CREATE TABLE apache_logs ( | |
log_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log ID', | |
processing_time INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Processing time in milliseconds', | |
http_status INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'HTTP status code', | |
request_method VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Request URL (GET/POST)', | |
access_url TEXT NOT NULL COMMENT 'URLs accessed', | |
PRIMARY KEY (log_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/plain'); | |
/** | |
* Build an array to loop. | |
*/ | |
$time0 = microtime(true); | |
for($i=9999; $i>0; --$i) | |
{ | |
$values[] = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[XDebug] | |
; Debug: http://localhost/?XDEBUG_SESSION=debug | |
; Trace: http://localhost/?XDEBUG_TRACE=debug | |
; Profile: XDEBUG_PROFILE cookie | |
; | |
; http://localhost/?XDEBUG_SESSION=debug&XDEBUG_TRACE=debug&XDEBUG_PROFILE=debug | |
; | |
; Firefox Plugin: The easiest Xdebug - by - Nikita Nikitin | |
; https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/ | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class trap | |
{ | |
public static function parameters($mixed) | |
{ | |
file_put_contents('/tmp/parameters-'.date('YmdH').'.log', "\r\n\r\n".print_r($mixed, true), FILE_APPEND); | |
} | |
public static function sql($mixed) | |
{ | |
file_put_contents('/tmp/sql-'.date('YmdH').'.log', "\r\n\r\n".print_r($mixed, true), FILE_APPEND); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
TABLE_NAME, TABLE_COMMENT | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE | |
TABLE_SCHEMA=DATABASE() | |
AND TABLE_TYPE='BASE TABLE' | |
ORDER BY | |
TABLE_NAME | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CONCAT('DROP TABLE `', t.table_name,'`;') drop_sql | |
FROM information_schema.TABLES t | |
WHERE | |
t.table_schema = DATABASE() | |
AND t.table_name LIKE 'wp\_%' | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/plain'); | |
/** | |
* Fix to: Maximum execution time of 30 seconds exceeded. | |
* Loop can fail in-between otherwise. | |
*/ | |
set_time_limit(0); | |
$mysqli = new MySQLi('localhost', 'USERNAME', 'PASSWORD', 'test'); |