예제 #1
0
 protected function update_configs($command, $new_configs)
 {
     //Note: Impossible to add new configs using this command. Only possible to prune ones.
     $old_configs = $this->configs($command);
     $removed_configs = array_diff($old_configs, $new_configs);
     if (count($removed_configs) == count($old_configs)) {
         return "";
     }
     foreach ($removed_configs as $removed) {
         $command = BashInterpreter::_removeFlagFromCommand($command, "-c " . $removed);
     }
     return $command;
 }
예제 #2
0
 public static function removeFlagFromCommand($text, $full_command, $full_flag)
 {
     $replaced = BashInterpreter::_removeFlagFromCommand($full_command, $full_flag);
     $text = str_replace($full_command, $replaced, $text);
     return $text;
 }