-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrush.php
executable file
·60 lines (49 loc) · 1.31 KB
/
wrush.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
ini_set('date.timezone', 'GMT');
ini_set('display_errors', 'On');
error_reporting(E_ALL);
require($argv[2]."/classes/class.curl.php");
require($argv[2]."/functions.php");
$vars = init_wp_variables($argv[3]);
if($vars['state'])
{
try
{
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host='.$vars['bdd_host'].';dbname='.$vars['bdd_name'], $vars['bdd_user'], $vars['bdd_pass']);
}
catch (Exception $e)
{
die('Error : ' . $e->getMessage());
}
switch($argv[1])
{
case "infos":
wrush_infos($bdd, $vars['bdd_prefix']);
break;
case "blogs":
wrush_blogs($bdd, $vars['bdd_prefix'], $vars['wp_multisite']);
break;
case "plugins":
wrush_plugins($bdd, $vars['bdd_prefix'], $vars['wp_multisite']);
break;
case "crons":
if(isset($argv[5])) {
if(isset($argv[6])) {
// Include Auth informations
wrush_crons($bdd, $vars['bdd_prefix'], $vars['wp_multisite'], $argv[5], $argv[6]);
} else {
wrush_crons($bdd, $vars['bdd_prefix'], $vars['wp_multisite'], $argv[5]);
}
} else {
wrush_crons($bdd, $vars['bdd_prefix'], $vars['wp_multisite']);
}
break;
case "cron-posts":
wrush_cron_posts($bdd, $vars['bdd_prefix'], $vars['wp_multisite']);
break;
}
} else {
echo "Wrush : An error occured with your wp-config.php file";
}
?>