- If not using DrupalConsole you will need to add the
vlucas/phpdotenv
dependency to load the.env
file. You can do that using composer:
composer require vlucas/phpdotenv
- Add the
TRAEFIK_HOST
value to/etc/hosts
<?php | |
namespace Drupal\MODULE\Plugin\Commerce\CheckoutPane; | |
use Drupal\commerce_shipping\Entity\ShipmentInterface; | |
use Drupal\commerce_shipping\Entity\ShippingMethod; | |
use Drupal\commerce_shipping\Plugin\Commerce\CheckoutPane\ShippingInformation; | |
use Drupal\Core\Entity\Entity\EntityFormDisplay; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; |
<?php | |
namespace Drupal\MODULE\EventSubscriber; | |
use Drupal\commerce_order\Entity\Order; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Drupal\commerce_cart\Event\CartEntityAddEvent; | |
use Drupal\commerce_cart\Event\CartEvents; | |
use Drupal\Core\StringTranslation\StringTranslationTrait; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
<?php | |
namespace Drupal\scholarrx_reports\Plugin\Commerce\ReportType; | |
use Drupal\commerce_order\Adjustment; | |
use Drupal\commerce_order\Entity\OrderInterface; | |
use Drupal\commerce_order\Entity\OrderItemInterface; | |
use Drupal\commerce_promotion\Entity\CouponInterface; | |
use Drupal\commerce_promotion\Entity\Promotion; | |
use Drupal\commerce_reports\Annotation\CommerceReportType; |
<?php | |
/** | |
* @When I switch to the frame by selector "[title=:arg1]" | |
*/ | |
public function switchToIFrameFromSelector($iframeSelector) { | |
$function = <<<JS | |
(function(){var iframe = document.querySelector("$iframeSelector");iframe.name = "iframeToSwitchTo";})() | |
JS; | |
try { |
function encryptData($data) { | |
$plainText = json_encode($data); | |
$bytesToBeEncrypted = $plainText; | |
$passwordBytes = utf8_encode("p@SSword"); | |
$passwordBytes = hash('sha256', $passwordBytes, true); | |
$saltBytes = array(1,2,3,4,5,6,7,8); | |
$saltBytesstring = ""; |
<?php | |
/** | |
* @file | |
* Contains \Drupal\example_module\Controller\ExampleModuleController. | |
*/ | |
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php | |
namespace Drupal\example_module\Controller; |
<?php | |
// https://snipt.net/public/tag/php/?page=3 | |
$countries = array( | |
"AF" => array("country" => "Afghanistan", "continent" => "Asia"), | |
"AX" => array("country" => "Åland Islands", "continent" => "Europe"), | |
"AL" => array("country" => "Albania", "continent" => "Europe"), | |
"DZ" => array("country" => "Algeria", "continent" => "Africa"), | |
"AS" => array("country" => "American Samoa", "continent" => "Oceania"), |
If you should encounter the problem that some translations are wrongly translated with the equal source language string (for example in our case there were German translations for "Author" translated with "Author" or "Published" with "Published"), you may use the following snippet to list them.
SELECT s.lid,s.source, t.translation FROM `locales_source` s
INNER JOIN locales_target t
WHERE s.lid=t.lid AND CONVERT(s.source USING utf8) = CONVERT(t.translation USING utf8)
AND t.customized=1
To finally delete them, you may use something like this, but make a backup before and know what you're doing!