Skip to content

Instantly share code, notes, and snippets.

View suryanto's full-sized avatar

Suryanto Rachmat suryanto

View GitHub Profile
#!/bin/bash
TMP="."
DB_USER="root"
DB_PASSWD="root"
DB="permata"
VERSION=`date +%F`
#First dump the structures
TABLES=`mysql --skip-column-names -e 'show tables' --user=${DB_USER} --password=${DB_PASSWD} ${DB}`
mysqldump --complete-insert --disable-keys --single-transaction --no-data --user=$DB_USER --password=$DB_PASSWD --opt $DB $TABLES > $TMP/$DB-$VERSION.sql
<?php
use Drupal\Component\Serialization\Json;
/** @var \GuzzleHttp\Client $client */
$client = \Drupal::service('http_client_factory')->fromOptions([
'base_uri' => 'https://pweb.permata.xituz.com/',
]);
$response = $client->get('sites/default/files/feeds/dummy_mf.json');
$json_data = Json::decode($response->getBody());