Added files
This commit is contained in:
commit
25aaa0a4bf
31 changed files with 4035 additions and 0 deletions
34
scripts/webapps/wordpress/install_wp.php
Normal file
34
scripts/webapps/wordpress/install_wp.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use PhangoApp\LeviathanUtils\Linux;
|
||||
|
||||
include('leviathanutils/vendor/autoload.php');
|
||||
|
||||
$user=get_current_user();
|
||||
|
||||
$file_wp='./bin/wp';
|
||||
|
||||
Linux::json_log('Installing WP Wordpress utility...', $error=0, $status=0, $progress=0, $no_progress=1);
|
||||
|
||||
if(is_file($file_wp)) {
|
||||
|
||||
Linux::json_log('Installed, updating wp...', $error=0, $status=0, $progress=0, $no_progress=1);
|
||||
|
||||
Linux::shell_command(['./bin/wp cli update --yes']);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(!is_dir('./bin')) {
|
||||
|
||||
mkdir('./bin');
|
||||
|
||||
}
|
||||
|
||||
Linux::shell_command(['curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar']);
|
||||
Linux::shell_command(['chmod +x wp-cli.phar']);
|
||||
Linux::shell_command(["mv wp-cli.phar ./bin/wp && sudo ln -s /home/${user}/bin/wp /usr/local/bin/wp"]);
|
||||
|
||||
}
|
||||
|
||||
Linux::json_log('WP utility installed successfully', $error=0, $status=0, $progress=100, $no_progress=0);
|
||||
Loading…
Add table
Add a link
Reference in a new issue