Added proc_open for execute commands in php
This commit is contained in:
parent
72d741eb7d
commit
2efc7b72f3
1 changed files with 12 additions and 4 deletions
16
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
16
vendor/phangoapp/leviathanutils/src/Linux.php
vendored
|
|
@ -228,7 +228,7 @@ class Linux {
|
|||
|
||||
if(!isset($original_file[$distro])) {
|
||||
|
||||
echo "Sorry, you don't have a patch for this distro\n";
|
||||
echo "Sorry, you don't have a patch for this distro\n\n";
|
||||
|
||||
exit(1);
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ class Linux {
|
|||
|
||||
if(!isset($service[$distro])) {
|
||||
|
||||
echo "Sorry, you don't have a service reload for this distro\n";
|
||||
echo "Sorry, you don't have a service reload for this distro\n\n";
|
||||
|
||||
exit(1);
|
||||
|
||||
|
|
@ -270,9 +270,17 @@ class Linux {
|
|||
|
||||
}
|
||||
|
||||
static public function sed($str_search, $str_replace, $file_to_replace) {
|
||||
static public function sed($arr_sed) {
|
||||
|
||||
Linux::exec("sudo sed -i 's/${str_search}/${str_replace}/g' ${file_to_replace}");
|
||||
if(!isset($arr_sed[$distro])) {
|
||||
|
||||
echo "Sorry, you don't have a sed str for this distro\n\n";
|
||||
|
||||
exit(1);
|
||||
|
||||
}
|
||||
|
||||
Linux::exec("sudo sed -i 's/${arr_sed[$distro][0]}/${arr_sed[$distro][1]}/g' ${arr_sed[$distro][2]}");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue