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
set -B # enable brace expansion | |
for i in {1..200}; do | |
echo "Hello Hey $i" | |
curl --location --request POST 'http://dev.passwordlocker.loc/api/json/password' \ | |
--header 'Accept: application/vnd.api+json' \ | |
--header 'Content-type: application/vnd.api+json' \ | |
--header 'X-CSRF-Token: Kbl6ZFLWvrPOtyD6EmULWcRsOMk3CH4WmSrLgPGExzU' \ | |
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImMzNzhlYmEyNmU1NjcwYjYzMjM2YmE5NjljN2E5NzEyZTBmMGVlMzRlOGYwNzI0MmI5YzkzNGFiNmU1NjNhNWUyYzQ4ODYwNjkzNmUwNzg5In0.eyJhdWQiOiIwNzgwYWVkYy1jZWZhLTQ2MDMtODFiZi1hOWZkMzVjZDcwMmQiLCJqdGkiOiJjMzc4ZWJhMjZlNTY3MGI2MzIzNmJhOTY5YzdhOTcxMmUwZjBlZTM0ZThmMDcyNDJiOWM5MzRhYjZlNTYzYTVlMmM0ODg2MDY5MzZlMDc4OSIsImlhdCI6MTY0MjU1MDIwOSwibmJmIjoxNjQyNTUwMjA5LCJleHAiOjE2NDU1NTAyMDguOTU2ODI1LCJzdWIiOiIyIiwic2NvcGUiOlsiY3VzdG9tZXIiLCJhdXRoZW50aWNhdGVkIl19.qWaPozwNbJZyYHjVMbnrN7vB6PDgij5oLe6NmjYOpeZz6a1TwzMYXqtSbbDQuhBuNaihEaF4Xn4fJLzGgnhVled8ZgQrDBL72DknIuVkPMjaBkoMn5A05RaSmY-DreYVDUeKN_JOveQxDWHbBj98uY7pj0mmvm2T |
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
get current user in drupal 8 | |
Description: In drupal 7 we get the current user object by defining global $user but in drupal 8 this quite different. If you want to get current user object then follow below code. | |
$current_user = \Drupal::currentUser(); | |
$uid = $current_user->id(); | |
It returns user id of current user. | |
$user_mail = $current_user->getEmail(); | |
It returns user email id. |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name dev.passwordlocker.loc; | |
index index.php index.html index.htm; | |
root /var/www/html/web; |
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
10225 gco develop | |
10226 git fetch --all | |
10227 git pull | |
10228 git branch -D feature/DevOps-Refonte-du-docker | |
10229 git fetch --all | |
10230 gco feature/DevOps-Refonte-du-docker | |
10232 git branch | |
10234 git rebase origin/develop | |
10236 git add composer.lock | |
10238 git rebase --continue |
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
use Drupal\migrate\MigrateExecutable; | |
use Drupal\migrate\MigrateMessage; | |
/** | |
* Implements hook_cron(). | |
*/ | |
function migrate_tools_cron() { | |
$manager = Drupal::service('plugin.manager.migration'); | |
$migration_ids = ['drupal_planet_rss_importer']; | |
foreach ($migration_ids as $migration_id) { |
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
id: drupal_planet_rss_importer | |
label: 'Import Drupal planet RSS feed' | |
status: true | |
source: | |
plugin: url | |
data_fetcher_plugin: http | |
urls: 'https://www.drupal.org/planet/rss.xml' | |
data_parser_plugin: simple_xml |
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
drush locale-import file modules/custom/custom_opm/translations/custom_opm.fr.po |
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
# Execute PHPUnit tests in Symfony: | |
vendor/bin/phpunit -d memory_limit=-1 --group active | |
# Execute php code sniffer for Symfony: | |
phpcs --standard=Symfony --extensions=php --ignore=node_modules,bower_components,vendor DemandeController.php | |
phpcbf --standard=Symfony --extensions=php --ignore=node_modules,bower_components,vendor DemandeController.php | |
# Execute console commands from the host with docker-compose: | |
docker-compose exec php php bin/console doctrine:schema:update --force |
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\migrate_opm\Commands; | |
use Drush\Commands\DrushCommands; | |
use Symfony\Component\Console\Helper\ProgressBar; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
/** | |
* A Drush commandfile. |
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 | |
$header = array('uid','name','pass','mail','status','created','access','login','timezone','language','init','users_roles','prenom','patronyme','autre_prenoms','civilite','date_naissance','lieu_naissance','nouveau_email','nom_usage'); | |
$line = array('4509','[email protected]','$S$DUOohSWRaHv5IZOpqAQHfFiKFOVBbyo9yogtOIMicsI0jVv8TMR3','[email protected]','1','1479377985','1532625913','1532625913','Europe/Paris','fr','[email protected]','3','jérémy','lacroze','','mr','1991-03-01 00:00:00','enghien-les-bains','',''); | |
$file = fopen("modules/custom/migrate_opm/data/user/usrs.csv","w"); | |
fputcsv($file, $header); | |
for ($i = 2; $i <= 1500001; $i++) { | |
$line[0] = $i; |
NewerOlder