Преглед на файлове

Ya funciona con expresion regular

master
Armando Ceballos Vargas преди 1 година
родител
ревизия
0d5da3729c
променени са 1 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. +8
    -5
      app/Commands/Redes_wifi.php

+ 8
- 5
app/Commands/Redes_wifi.php Целия файл

@@ -29,9 +29,10 @@ class Redes_wifi extends Command
*/ */
public function handle() public function handle()
{ {
//$this->getProfilesRegex();
$essid = $this->argument('essid'); $essid = $this->argument('essid');
$profiles = $this->getProfiles();
//$profiles = $this->getProfiles();
$profiles = $this->getProfilesRegex();
if (isset($essid) && (!$this->option('list'))) { if (isset($essid) && (!$this->option('list'))) {
$this->line("[{$essid}] ".$this->getPassword($essid)); $this->line("[{$essid}] ".$this->getPassword($essid));
return 0; return 0;
@@ -46,9 +47,11 @@ class Redes_wifi extends Command


public function getProfilesRegex() public function getProfilesRegex()
{ {
$parse = file_get_contents('profiles.txt');
preg_match("/: \s*(.*)/", $parse, $profiles);
dd($profiles);
$result = Process::run('netsh wlan show profile');
$salidaprofiles = $result->output();
//$salidaprofiles = file_get_contents('profiles.txt');
preg_match_all("/: \s*(.*)/", $salidaprofiles, $profiles);
return $profiles[1];
} }
public function getProfiles() public function getProfiles()
{ {


Зареждане…
Отказ
Запис