Is a good practice to inject a service whenever is possible.
Reading the code on the Drupal Class you can find the httpClient method:
/**
| <?php | |
| /** | |
| * The only reliable way of determining if a child exists | |
| * in SimpleXMLElement is to use count(). All other methods | |
| * do not work reliably in global or local NS. | |
| * | |
| * NOTE: Error suppresion on @count() is used to suppress | |
| * "PHP Warning: count(): Node no longer exists" | |
| */ | |
| if(!class_exists('SimpleXMLElement')) die("Bonkers"); |
| Rebase the old branch against the master branch. | |
| Solve the merge conflicts during rebase, and the result will be an up-to-date branch that merges cleanly against master. | |
| git checkout <branch> && git rebase <target> | |
| In our case it is | |
| git checkout <branch> && git rebase master | |
| _------------------------------------ | |
| Frequently used commands | |
| -------------- | |
| git stash save --keep-index --include-untracked | |
| git stash drop |
| <html> | |
| <head> | |
| <title> csv2 sql</title> | |
| <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
| </head> | |
| <body> | |
| <br> | |
| <h1> CSV to Mysql </h1> | |
| <p> This Php Script Will Import very large CSV files to MYSQL database in a minute</p> |
| function arrayToCSV (twoDiArray) { | |
| // Modified from: http://stackoverflow.com/questions/17836273/ | |
| // export-javascript-data-to-csv-file-without-server-interaction | |
| var csvRows = []; | |
| for (var i = 0; i < twoDiArray.length; ++i) { | |
| for (var j = 0; j < twoDiArray[i].length; ++j) { | |
| twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas | |
| } | |
| csvRows.push(twoDiArray[i].join(',')); | |
| } |
| var redirectToUrl = function (url,data) { | |
| // optional parameter | |
| data = data ||0; | |
| var form = document.createElement('form'); | |
| form.method = 'post'; | |
| form.action = url; | |
| for (var name in data) { | |
| var input = document.createElement('input'); | |
| input.type = 'hidden'; | |
| input.name = name; |
| #!/usr/bin/env bash | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| # https://docs.docker.com/compose/install/ |
| git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt |
| git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt |
| git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" -i -E | grep -v -e "Merge branch" > release_notes.txt |