pocketmine\Server::getDataPath PHP Method

getDataPath() public method

public getDataPath ( ) : string
return string
    public function getDataPath()
    {
        return $this->dataPath;
    }

Usage Example

Example #1
0
 private function extraData()
 {
     global $arguments;
     if ($this->server->getProperty("auto-report.send-settings", \true) !== \false) {
         $this->data["parameters"] = (array) $arguments;
         $this->data["server.properties"] = @\file_get_contents($this->server->getDataPath() . "server.properties");
         $this->data["server.properties"] = \preg_replace("#^rcon\\.password=(.*)\$#m", "rcon.password=******", $this->data["server.properties"]);
         $this->data["pocketmine.yml"] = @\file_get_contents($this->server->getDataPath() . "pocketmine.yml");
     } else {
         $this->data["pocketmine.yml"] = "";
         $this->data["server.properties"] = "";
         $this->data["parameters"] = [];
     }
     $extensions = [];
     foreach (\get_loaded_extensions() as $ext) {
         $extensions[$ext] = \phpversion($ext);
     }
     $this->data["extensions"] = $extensions;
     if ($this->server->getProperty("auto-report.send-phpinfo", \true) !== \false) {
         \ob_start();
         \phpinfo();
         $this->data["phpinfo"] = \ob_get_contents();
         \ob_end_clean();
     }
 }
All Usage Examples Of pocketmine\Server::getDataPath
Server