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 | |
/** | |
* @file | |
* Script to flush all caches in Drupal 8. | |
* | |
* Place this script into your Drupal document root; i.e., /cc.php | |
* and request it in your browser. | |
*/ |
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
diff --git a/sites/default/settings.php b/sites/default/settings.php | |
index b2ce930..9d0514e 100644 | |
--- a/sites/default/settings.php | |
+++ b/sites/default/settings.php | |
@@ -611,7 +611,8 @@ | |
* The 'bootstrap_config_storage' setting needs to be a callable that returns | |
* core.services.yml. | |
*/ | |
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); | |
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage'; |
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 | |
# Simple PHP 5.4+ bench script for CLI. | |
const ITERATIONS = 10000; | |
error_reporting(E_ALL | E_STRICT); | |
setlocale(LC_ALL, 'C'); | |
register_shutdown_function(function () { | |
echo PHP_EOL; | |
$memory_peak_end = memory_get_peak_usage(); |
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 | |
use Drupal\Core\DrupalKernel; | |
use Drupal\simpletest\TestDiscovery; | |
use Sun\StaticReflection\ReflectionClass; | |
use Sun\StaticReflection\ReflectionDocComment; | |
use Symfony\Component\HttpFoundation\Request; | |
$autoloader = require __DIR__ . '/../vendor/autoload.php'; |
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
$ echo "<?php var_dump(STDOUT);" > y.stdout | |
$ php y.stdout | |
resource(2) of type (stream) |
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
diff --git a/src/Util/PHP.php b/src/Util/PHP.php | |
index d3d36a0..e173775 100644 | |
--- a/src/Util/PHP.php | |
+++ b/src/Util/PHP.php | |
@@ -84,7 +84,7 @@ public function runTestJob($job, PHPUnit_Framework_Test $test, PHPUnit_Framework | |
$_result = $this->runJob($job); | |
$this->processChildResult( | |
- $test, $result, $_result['stdout'], $_result['stderr'] | |
+ $test, $result, $_result['result'], $_result['stdout'], $_result['stderr'] |
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 | |
# Simple PHP 5.4+ bench script for CLI. | |
const ITERATIONS = 1000; | |
const ARRAY_SIZE = 1000; | |
define('CONDITION', 'item' . (ARRAY_SIZE - 1)); | |
error_reporting(E_ALL | E_STRICT); | |
setlocale(LC_ALL, 'C'); | |
register_shutdown_function(function () { |
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 | |
$list = new SplDoublyLinkedList(); | |
// Comment this out to make it behave. | |
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); | |
$list->push('one'); | |
$list->push('two'); | |
foreach ($list as $key => $value) { |
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
### Keybase proof | |
I hereby claim: | |
* I am sun on github. | |
* I am sun (https://keybase.io/sun) on keybase. | |
* I have a public key whose fingerprint is 1292 4213 3E34 D0B0 68A6 DE4D 0AA6 11AF B3CA F936 | |
To claim this, I am signing this object: |
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
# Replace `define('...', '...');` with `const ... = ...;` | |
:%s/define( *'\(\w*\)',\( *\)'\([^']*\)' *);/const \1 =\2'\3';/ | |
# Replace `isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] :` with `$_SERVER['SERVER_NAME'] ??` | |
# Using different delimiters to match an underscore literally. | |
:%s!isset.*SERVER_NAME.*:!$_SERVER['SERVER_NAME'] ??! | |
# Convert line endings to Linux/Unix | |
:set ff=unix |