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
# d.o collaboration | |
- http://drupal.org/project/issues/webmasters | |
- http://drupal.org/project/issues/infrastructure | |
- http://drupal.org/project/issues/drupalorg | |
- http://drupal.org/project/issues/project | |
- http://drupal.org/project/issues/project_issue | |
# Code | |
- http://drupal.org/project/issues/git_dev | |
- http://drupal.org/project/issues/project_git_instructions |
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 | |
function config($name, $config_class = NULL, $storage_class = NULL) { | |
static $config_instances = array(), $storage_instances = array(); | |
// Set defaults. | |
if (!isset($config_class)) { | |
$config_class = 'Drupal\Core\Config\DrupalConfig'; | |
} | |
if (!isset($storage_class)) { |
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 Drupal\Core\Config; | |
use Drupal\Core\Config\StorageInterface; | |
class ConfigObject { | |
protected $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
$yaml = Yaml::dump('sun.settings.yml'): | |
id: my_settings | |
label: !!php/object:O:1:"t":1:{s:9:"*string";s:12:"Translate me";} | |
var_dump($parsed = Yaml::parse($yaml)): | |
array(2) { | |
["id"]=> | |
string(11) "my_settings" | |
["label"]=> | |
object(t)#34 (1) { |
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 bench.php | |
Peak memory before test: 422.43 KB | |
Iterations: 1,000,000 | |
nothing: 0.2577 seconds | |
function no_op(): 1.4858 seconds | |
!$value: 0.3877 seconds | |
$value === FALSE: 0.3837 seconds | |
FALSE === $value: 0.3868 seconds | |
$value == FALSE: 0.3889 seconds |
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 | |
* Contains Drupal\system\Tests\Module\ModuleEnable. | |
*/ | |
namespace Drupal\system\Tests\Module; | |
use Drupal\simpletest\WebTestBase; |
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 | |
/** | |
* This gist is no longer maintained - it is a proper repo now: | |
* | |
* @see https://github.com/sun/drupal-reinstall | |
*/ | |
# ██╗ ██╗██████╗ ██████╗ ███╗ ██╗ ██████╗ |
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 | |
* Contains \Drupal\Core\Utility\Site. | |
*/ | |
namespace Drupal\Core\Utility; | |
use Drupal\Component\Utility\Settings; |
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. | |
use Symfony\Component\HttpFoundation\Request; | |
const ITERATIONS = 1; | |
error_reporting(E_ALL | E_STRICT); | |
require_once 'core/vendor/autoload.php'; | |
require_once 'core/includes/bootstrap.inc'; |
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 | |
pd.test_id AS test_id, | |
-- Dataset is too large; sort in PHP instead. | |
pd.last_tested | |
FROM pift_data pd | |
-- Using an external aggregate as filter/join condition for a query | |
-- is the exact point where MySQL melts down :-/ | |
INNER JOIN ( | |
SELECT | |
MAX(pd2.test_id) AS maxid |
OlderNewer