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 | |
// Delete all nodes. | |
entity_delete_multiple('node', \Drupal::entityQuery('node')->execute()); | |
// Delete all files. | |
entity_delete_multiple('file', \Drupal::entityQuery('file')->execute()); | |
// Delete all taxonomy terms. | |
entity_delete_multiple('taxonomy_term', \Drupal::entityQuery('taxonomy_term')->execute()); |
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 | |
$mime = \Drupal::service('file.mime_type.guesser')->guess($uri); |
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
Connect to the Postgres server: | |
psql postgres postgres | |
Create a database: | |
CREATE DATABASE drupal_legacy; | |
Connect to a database: | |
\c drupal_legacy | |
List all tables: |
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
docker events& | |
Then run your failing docker run ... command. Then you should see something like the following on screen: | |
2015-12-22T15:13:05.503402713+02:00 xxxxxxxacd8ca86df9eac5fd5466884c0b42a06293ccff0b5101b5987f5da07d: (from xxx/xxx:latest) die | |
Then you can get the startup hex id from previous message or the output of the run command. Then you can use it with the logs command: | |
docker logs <copy the instance id from docker events messages on screen> |
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
We are going to use composer to create a codebase with the latest version of Drupal 8 or 7: | |
Drupal 8: | |
composer create-project drupal-composer/drupal-project:8.x-dev docker_drupal --stability dev --no-interaction | |
Drupal 7: | |
composer create-project drupal-composer/drupal-project:7.x-dev docker_drupal --no-interaction | |
Then we are going to clone the latest version of docker4drupal and remove the .git folder from it: | |
git clone [email protected]:wodby/docker4drupal.git docker_drupal_server |
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
To install PHP_CodeSniffer and to check drupal code type the following (composer is required system-wide): | |
First make sure you have the composer bin dir in your PATH. The default value is ~/.composer/vendor/bin/, but you can check the value that you need to use by running: | |
composer global config bin-dir --absolute | |
echo $PATH | |
PATH=$PATH:~/.composer/vendor/bin/ | |
echo $PATH | |
Add the following to the /home/<user>/.profile file: |
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
drush fra -y | |
drush fr-all --force -y | |
drush fl | |
drush cc all | |
drush mmmff --all | |
drush rr | |
drush updb -y | |
drush uli |
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
<template> | |
<div class="login"> | |
<div class="container"> | |
<form id="loginForm" v-on:submit.prevent="login"> | |
<div class="col-12 content-block"> | |
<div class="content-block-text"> | |
<h2>Aanmelden</h2> | |
</div> | |
<div class="content-block-text"> | |
<hr> |
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
<html> | |
<header> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
<script src="https://cdn.rawgit.com/oauth-io/oauth-js/c5af4519/dist/oauth.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.12.0/bootstrap-social.min.css"> | |
</header> | |
<body> |
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
#!/bin/bash | |
cd /home/ubuntu/docker | |
sudo rm -rf dhm-it-docker-backup/ | |
cp -r dhm-it-docker dhm-it-docker-backup | |
datetime=$(date +"%Y_%m_%d_%I_%M_%p") | |
docker exec dhmit_mariadb /usr/bin/mysqldump -u dhmit --password=dhmit123 drupal > /home/ubuntu/docker/dhm-it-docker-backup/docker/etc/mysql/$datetime.sql | |
cd dhm-it-docker | |
docker-compose stop | |
docker-compose rm -f | |
docker volume rm $(docker volume ls -q) |