fromString() public static method

public static fromString ( string $str ) : BanEntry
$str string
return BanEntry
Ejemplo n.º 1
0
 public function load()
 {
     $this->list = [];
     $fp = @\fopen($this->file, "r");
     if (\is_resource($fp)) {
         while (($line = \fgets($fp)) !== \false) {
             if ($line[0] !== "#") {
                 $entry = BanEntry::fromString($line);
                 if ($entry instanceof BanEntry) {
                     $this->list[$entry->getName()] = $entry;
                 }
             }
         }
         \fclose($fp);
     } else {
         MainLogger::getLogger()->error("Could not load ban list");
     }
 }