drush pm-uninstall MODULE -y
drush pm-enable MODULE -y
<?php | |
$a = [5, 10, 8, 7, 6, 5]; | |
$size = sizeof($a)/sizeof($a[0]); | |
$max_diff = -1; | |
$min_element = $a[0]; | |
for ($i=1; $i<$size; $i++) { |
<?php | |
$lengths = [6, 5, 4, 4, 2, 2, 8]; | |
$result = []; | |
while (true) { | |
$lengths = array_filter($lengths, function($a) { return ($a !== 0); }); | |
<?php | |
$a = [4, 1, 5, 7, 7, 4, 0, 1, 2, 3]; | |
$b = [5, 2, 4, 5, 9, 9, 5, 0, 1, 2, 3, 4]; | |
$result = $a; | |
foreach ($b as $el) { | |
<?php | |
$multisites = []; | |
if (is_file(DRUPAL_ROOT . '/sites/sites.php')) { | |
include DRUPAL_ROOT . '/sites/sites.php'; | |
$multisites = array_keys($sites); | |
$multisites[] = 'default'; |
<?php | |
$themesList = array_keys( \Drupal::service('theme_handler')->listInfo() ); |
<?php | |
$fid = $form_state->getValue('file'); | |
if (isset($fid[0]) && $fid[0] > 0) { | |
$file = \Drupal\file\Entity\File::load($fid[0]); | |
$file->setPermanent(); | |
$file->save(); |
<?php | |
\Drupal::service('theme_installer')->install('my_custom_theme'); | |
\Drupal::configFactory() | |
->getEditable('system.theme') | |
->set('default', 'my_custom_theme') | |
->save(); |
<?php | |
/** | |
* @file | |
* Local development override configuration feature. | |
* | |
* To activate this feature, copy and rename it such that its path plus | |
* filename is 'sites/yoursite.com/settings.local.php'. Then, go to the bottom | |
* of 'sites/yoursite.com/settings.php' and uncomment the commented lines that | |
* mention 'settings.local.php'. |