// Create a request object or parse the URL
$request = \Symfony\Component\HttpFoundation\Request::create($urlWithoutToken);
// or get the current request.
// $request = $event->getRequest();
This file contains hidden or 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 | |
declare(strict_types=1); | |
function simpleGenerator() { | |
echo "The generator begins\n"; | |
for ($i = 0; $i < 3; ++$i) { | |
yield $i; | |
echo "Yielded $i\n"; |
This file contains hidden or 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\File\FileSystemInterface; | |
$directory = '/path/to/processed'; | |
\Drupal::service('file_system') | |
->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY); | |
\Drupal::service('file_system') |
We are going to replace "Make it at least 8 characters" from the user
core modules (core/modules/user/user.module
) with "Make it at least 12 characters".
/**
* Implements hook_element_info_alter().
*/
function <your_module>_element_info_alter(array &$types): void
{
if (isset($types['password_confirm'])) {
$types['password_confirm']['#process'][] = 'users_form_process_password_confirm';
ngrok creates a tunnel from the public internet to your local machine.
Sign up for an ngrok account https://dashboard.ngrok.com/
brew install ngrok/ngrok/ngrok
To configure the error messages visibility, set an appropriate configuration in the settings.php
file
// Show all error messages, including notices and coding standards warnings.
$config['system.logging']['error_level'] = 'verbose';
File: /path/to/docroot/sites/<SITE_NAME>/settings.php
.
Then clear the Drupal cache.
NewerOlder