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
\Drupal::service('page_cache_kill_switch')->trigger(); |
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
# Exec as root | |
docker-compose exec --user root -T php sh -c "chown -R www-data:www-data ." | |
# Exec as regular | |
docker-compose exec -T php sh -c "composer --version" |
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
sudo certbot certonly --manual --preferred-challenges=http |
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
# Start an app (in background) based on docker-compose.yml: | |
docker-compose up -d | |
# List of running containers (including names): | |
docker-compose ps | |
# Check logs: | |
docker-compose logs [CONTAINER_NAME] | |
# Stop an app: |
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
rsync -a ~/dir1 username@remote_host:destination_directory | |
rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine | |
scp -r eurocockpit.be:/home/euroco1q/eurocockpit.be/db/eurocockpit.be-master-2019-01-05-0731.sql.gz ~/www |
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 $_POST | |
$name = $_POST['name']; // form param | |
// Drupal 8 $_POST | |
$name = \Drupal::request()->request->get('name'); // form param | |
// Drupal 8 $_GET | |
$query = \Drupal::request()->query->get('name'); | |
// Get HOST |
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
Cache keys | |
Cache keys are unique identifiers for a specific variation of a thing that is being cached. This provides the cache API with the information it needs to be able to retrieve the specific item from whatever storage is being used for cached data. | |
When rendering a node (data being displayed) in the teaser view mode (configuration indicating a specific representation), the cache keys would be e.g. ['node', 5, 'teaser'] | |
Cache tags | |
Cache tags vary the cache based on the data that was used to build the element. For example, entities, users, or configuration. | |
Using cache tags you could associate some cached data with a specific node. When that node is edited, and the content of it changes, the related cached data becomes outdated and no longer valid. |
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
stages: | |
- deploy | |
dev-deployment: | |
stage: deploy | |
script: | |
- ssh HOST 'bash -s' < dev-deployment.sh | |
only: | |
- develop |
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 | |
namespace Drupal\[custom_module]\Plugin\rest\resource; | |
use Drupal\rest\Plugin\ResourceBase; | |
use Drupal\rest\ResourceResponse; | |
use Drupal\user\UserStorageInterface; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |