Confirm the current kernel version:
$ uname -snr
Linux 3.10.0-1062.18.1.el7.x86_64 x86_64
Add the ELRepo repository:
yum update -y
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
<?php | |
/** | |
* Recursively replace array elements in associative arrays. | |
* | |
* The key difference between this function and array_replace_recursive() is that in this function | |
* only associative arrays are merged recursively and list arrays are replaced entirely (not merged). | |
* This approach ensures that list arrays are entirely refreshed with new values, while associative | |
* arrays have their contents intelligently combined, preserving structural integrity and updating | |
* where necessary. |
<?php | |
namespace App\Jobs; | |
use Exception; | |
use Throwable; | |
class ExampleJob extends BaseJob | |
{ | |
public int $number; |
<?php | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Support\Str; | |
if (! function_exists('add_query_arg')) { | |
/** | |
* Add query arg(s) to a URL. | |
* |
<?php | |
use Illuminate\Support\Collection; | |
use Illuminate\Support\Str; | |
/** | |
* ``` | |
* collect(['foo' => ['bar' => 'baz']])->recursive(); | |
* collect(['foo' => ['bar', 'baz', 'qux']])->recursive(true); | |
* ``` |
# force `wp` commands to run as the `www-data` user | |
wp() { | |
if [ $1 == "cli" ]; then | |
command wp $* --allow-root | |
elif [ $(whoami) != "www-data" ]; then | |
su www-data -c "wp $*" | |
else | |
command wp $* | |
fi | |
} |
{ | |
{ | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "git@github.com:bar/project.git" | |
} | |
], | |
"require": { | |
"foo/project": "dev-main" |
<?php | |
/** | |
* Apply a user supplied function to every member of an array, in parallel. | |
* | |
* @param array $array | |
* @param callable $callback First arg is the value, second arg is the key. | |
* @param mixed $arg Will be passed as the third parameter to the callback. | |
* @param int $maxProcesses | |
* @return bool |
<?php | |
/** | |
* Run a WP-CLI command via an authorized HTTP POST webhook. | |
* | |
* curl -X POST https://mysite.com/webhook-wp-cli.php \ | |
* -H 'Content-Type: application/json' \ | |
* -H 'X-Authorization: Bearer MY_SUPER_SECRET_KEY_HERE' \ | |
* -d '[ ["theme", "install"], ["https://downloads.wordpress.org/theme/go.zip"], ["force"], {"user": 1} ]' | |
* |
<?php | |
/** | |
* Replaces paragraph elements with double line-breaks. | |
* | |
* This is the inverse behavior of the wpautop() function | |
* found in WordPress which converts double line-breaks to | |
* paragraphs. Handy when you want to undo whatever it did. | |
* | |
* @see wpautop() |
Confirm the current kernel version:
$ uname -snr
Linux 3.10.0-1062.18.1.el7.x86_64 x86_64
Add the ELRepo repository:
yum update -y
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org