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
foreach ($listOfSites as $site) { | |
file_put_contents('/tmp/lockprocess.lock','locked'); | |
$url = $site[0]; | |
// Add loop here to iterate if concurrency is bigger than a threshold. | |
echo "starting ASYNC request for $url" . PHP_EOL; | |
$promises[] = $client->requestAsync('GET', $url, [ | |
'headers' => [ | |
'User-Agent' => 'AcquiaScrapperBot/0.1', |
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 | |
// clearcacheall.php alias/druh >> cacheclear.log | |
$list_sites = []; | |
$drush_alias = $argv[1]; | |
// Iterate on them to execute the drush command. | |
foreach ($list_sites as $site) { | |
execDrushCommand($site['alias'], $drush_alias); |
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 drush to fetch users and roles in a given site. | |
* | |
* @param [type] $site_alias | |
* @param [type] $drush_alias | |
* @return void | |
*/ | |
function execDrushUserInfo($site_alias, $drush_alias) | |
{ | |
$php = "/usr/local/bin/php"; |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: ddev-load-balancer | |
spec: | |
type: LoadBalancer | |
selector: | |
# Will deliver external traffic to the pod holding each of our containers | |
app: ddev | |
ports: |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mysqlservice | |
spec: | |
ports: | |
- port: 3306 | |
selector: | |
app: ddevdb | |
clusterIP: None |
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
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: webserver-storage | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 5Gi |
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
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: ddev-wb | |
spec: | |
selector: | |
matchLabels: | |
app: ddev | |
replicas: 1 # tells deployment to run 1 pods matching the template | |
template: |
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
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: webserver-storage | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 5Gi |
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
<pre><code class="language-php"> | |
<?php | |
class FileBlobMigration extends Migration { | |
public function __construct() { | |
$query = db_select('legacy_file_data', 'f') | |
->fields('f', array('attachmentid', 'attachmentblob', 'filename', 'file_ownerid')); | |
$this->source = new MigrateSourceSQL($query); | |
$this->destination = new MigrateDestinationFile('file', 'MigrateFileBlob'); | |
$this->addFieldMapping('value', 'attachmentblob'); |
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
curl --include --request POST --user user:pass --header 'Content-type: application/hal+json' --header 'X-CSRF-Token: <obtained from http://example.com/rest/session/token>' http://local.drupal8.com/entity/node?_format=hal_json --data-binary '{"_links":{"type":{"href":"http://local.drupal8.com/rest/type/node/cruise"}},"title":[{"value":"Example node title"}],"type":[{"target_id":"article"}]}' |
NewerOlder