View file.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
<?php | |
// If the URI has a scheme, don't override the umask - schemes can handle this | |
// issue in their own implementation. | |
if (file_uri_scheme($uri)) { | |
return _drupal_mkdir_call($uri, $mode, $recursive, $context); | |
} | |
// If recursive, create each missing component of the parent directory | |
// individually and set the mode explicitly to override the umask. | |
if ($recursive) { |
View document.patch
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
+++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.phpundefined | |
@@ -0,0 +1,106 @@ | |
+ /** | |
+ * Tries to upcast every variable to an entity type. | |
+ * | |
+ * If there is a type denoted in the route options it will try to upcast to | |
+ * it, if there is no definition in the options it will try to upcast to an | |
+ * entity type of that name. If the chosen enity type does not exists it will | |
+ * leave the variable untouched. | |
+ * If the entity type exist, but there is no entity with the given id it will |
View converters.html
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
<h2>Wildcard paths</h2> | |
<h3>Drupal 7</h3> | |
in modules/book/book.module: | |
<?php | |
function book_menu() { | |
$items['book/export/%/%'] = array( | |
'page callback' => 'book_export', | |
'page arguments' => array(2, 3), |
View entity.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
<?php | |
// Create a test entity to serialize. | |
$this->values = array( | |
'name' => $this->randomName(), | |
'user_id' => $GLOBALS['user']->uid, | |
'field_test_text' => array( | |
'value' => $this->randomName(), | |
'format' => 'full_html', | |
), | |
); |
View drupal-clean.bat
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: | |
cd D:\xampp\mysql\bin | |
mysql -u root < db-drop-create.sql | |
cd D:\xampp\htdocs\drupal-8\sites\default | |
rmdir /S /Q files | |
rm settings.php |
View db-drop-create.sql
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
DROP DATABASE `drupal-8`; | |
CREATE DATABASE `drupal-8`; |
View translation.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
<?php | |
public function translateString($name, $langcode, $source, $context) { | |
if ($name && $langcode && $source && $context) { | |
// If translations for a language have not been loaded yet. | |
if (!isset($this->translations[$name][$langcode])) { | |
// Preload all translations for this configuration name and language. | |
$this->translations[$name][$langcode] = array(); | |
foreach ($this->localeStorage->getTranslations(array('language' => $langcode, 'type' => 'configuration', 'name' => $name)) as $string){ | |
$this->translations[$name][$langcode][$string->context][$string->source] = $string; |
View config_translation.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
/** | |
* Submit handler to save config translation. | |
*/ | |
function config_translation_form_submit(&$form, &$form_state) { | |
$form_values = $form_state['values']; | |
$language = $form_values['language']; | |
$group = $form_values['group']; | |
foreach ($group->getNames() as $id => $name) { | |
$config = config('locale.config.' . $language->langcode . '.' . $name); |
View tour.tip.yml
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
tour.tip: | |
type: mapping | |
label: 'Tour tip' | |
mapping: | |
id: | |
type: string | |
label: 'ID' | |
plugin: | |
type: string | |
label: 'Plugin' |
OlderNewer