Skip to the relevant sections if needed.
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
See discussion at https://www.drupal.org/project/drupal/issues/937442
- Check if this can be done better with https://www.agoradesign.at/blog/why-running-drupalentitydefinitionupdatemanager-applyupdates-update-hooks-bad
- https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityDefinitionUpdateManager.php/function/EntityDefinitionUpdateManager%3A%3AupdateFieldStorageDefinition/8.2.x
This workaround is based on code from "Address" contrib module: https://www.drupal.org/project/address Thanks to @bojanz who initially wrote it here: https://git.drupalcode.org/project/address/-/blob/8.x-1.x/address.install
If you need an extended and specific version of this topic, read this article:
*Functional testing for Browser in Drupal 8-9 using PHPUnit
- David Rodríguez, @davidjguru.
- Contact at [email protected]
- Website: https://therussianlullaby.com
In this snippet I've gathered some examples and cases about how to get taxonomy terms programmatically in Drupal, using always the same method and the same mechanics: get terms and then processing it in order to get only the required under certain criteria.
- David Rodríguez, @davidjguru.
- Contact at [email protected]
- Website: https://therussianlullaby.com
Permission denied (publickey)
Seems a very common error in Gitlab.com or any Gitlab implementation. Last night I spend 4/5 hours without sleeping to solve the error.
Cloning into 'server'...
Permission denied (publickey).
fatal: Could not read from remote repository.
# Sets CORS headers for request from example1.com and example2.com pages | |
# for both SSL and non-SSL | |
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0 | |
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN | |
Header set Access-Control-Allow-Credentials "true" env=ORIGIN | |
# Always set Vary: Origin when it's possible you may send CORS headers | |
Header merge Vary Origin |
name: Modal Form Example | |
type: module | |
description: 'Modal Form Example module' | |
package: Example | |
version: VERSION | |
core: 8.x |
use Drupal\node\NodeInterface; | |
use Drupal\Core\Template\Attribute; | |
use Drupal\Core\Url; | |
/** | |
* Implements hook_preprocess_page() for page.html.twig. | |
*/ | |
function THEME_preprocess_page(&$vars) { | |
// Add sitename and slogan to page. | |
$vars['site_name'] = \Drupal::config('system.site')->get('name'); |