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


PHP Utils::postURL方法代码示例

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


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

示例1: onRun

 public function onRun()
 {
     try {
         Utils::postURL($this->endpoint, $this->data, 5, ["Content-Type: application/json", "Content-Length: " . strlen($this->data)]);
     } catch (\Exception $e) {
     }
 }
开发者ID:NewDelion,项目名称:PocketMine-0.13.x,代码行数:7,代码来源:SendUsageTask.php

示例2: directPush

 public function directPush($token, $title, $message, $reciever)
 {
     /**
      * Directly sends a push to the server using POST.
      * It's seriously recommended to use the sendPush() method,
      * as this is not Async and can cause delays.
      * 
      * Use this method only if nessessary.
      * This method also returns the full Push object.
      * 
      * @param $token User api token
      * @param $title Title
      * @param $message Message
      * @param $reciever String
      * @return Push object
      * */
     return Utils::postURL($this->url, array("type" => "sendPush", "data" => json_encode(array("access_token" => $token, "title" => $title, "message" => $message, "reciever" => $reciever))));
 }
开发者ID:HotFireyDeath,项目名称:PM-Plugins,代码行数:18,代码来源:PushbulletPM.php

示例3: crashDump

 public function crashDump()
 {
     if ($this->isRunning === false) {
         return;
     }
     if ($this->sendUsageTicker > 0) {
         $this->sendUsage(SendUsageTask::TYPE_CLOSE);
     }
     $this->hasStopped = false;
     ini_set("error_reporting", 0);
     ini_set("memory_limit", -1);
     //Fix error dump not dumped on memory problems
     $this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.create"));
     try {
         $dump = new CrashDump($this);
     } catch (\Exception $e) {
         $this->logger->critical($this->getLanguage()->translateString("pocketmine.crash.error", $e->getMessage()));
         return;
     }
     $this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.submit", [$dump->getPath()]));
     if ($this->getProperty("auto-report.enabled", true) !== false) {
         $report = true;
         $plugin = $dump->getData()["plugin"];
         if (is_string($plugin)) {
             $p = $this->pluginManager->getPlugin($plugin);
             if ($p instanceof Plugin and !$p->getPluginLoader() instanceof PharPluginLoader) {
                 $report = false;
             }
         } elseif (\Phar::running(true) == "") {
             $report = false;
         }
         if ($dump->getData()["error"]["type"] === "E_PARSE" or $dump->getData()["error"]["type"] === "E_COMPILE_ERROR") {
             $report = false;
         }
         if ($report) {
             $reply = Utils::postURL("http://" . $this->getProperty("auto-report.host", "crash.pocketmine.net") . "/submit/api", ["report" => "yes", "name" => $this->getName() . " " . $this->getPocketMineVersion(), "email" => "crash@pocketmine.net", "reportPaste" => base64_encode($dump->getEncodedData())]);
             if (($data = json_decode($reply)) !== false and isset($data->crashId)) {
                 $reportId = $data->crashId;
                 $reportUrl = $data->crashUrl;
                 $this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
             }
         }
     }
     //$this->checkMemory();
     //$dump .= "Memory Usage Tracking: \r\n" . chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9))) . "\r\n";
     $this->forceShutdown();
     $this->isRunning = false;
     @kill(getmypid());
     exit(1);
 }
开发者ID:ZenaGamingsky,项目名称:PocketBox,代码行数:50,代码来源:Server.php

示例4: crashDump

 public function crashDump()
 {
     if ($this->isRunning === false) {
         return;
     }
     $this->isRunning = false;
     $this->hasStopped = false;
     ini_set("error_reporting", 0);
     ini_set("memory_limit", -1);
     //Fix error dump not dumped on memory problems
     $this->logger->emergency("An unrecoverable error has occurred and the server has crashed. Creating a crash dump");
     try {
         $dump = new CrashDump($this);
     } catch (\Exception $e) {
         $this->logger->critical("Could not create Crash Dump: " . $e->getMessage());
         return;
     }
     $this->logger->emergency("Please submit the \"" . $dump->getPath() . "\" file to the Bug Reporting page. Give as much info as you can.");
     if ($this->getProperty("auto-report.enabled", true) !== false) {
         $report = true;
         $plugin = $dump->getData()["plugin"];
         if (is_string($plugin)) {
             $p = $this->pluginManager->getPlugin($plugin);
             if ($p instanceof Plugin and !$p->getPluginLoader() instanceof PharPluginLoader) {
                 $report = false;
             }
         } elseif (\Phar::running(true) == "") {
             $report = false;
         }
         if ($dump->getData()["error"]["type"] === "E_PARSE" or $dump->getData()["error"]["type"] === "E_COMPILE_ERROR") {
             $report = false;
         }
         if ($report) {
             $reply = Utils::postURL("http://" . $this->getProperty("auto-report.host", "crash.pocketmine.net") . "/submit/api", ["report" => "yes", "name" => $this->getName() . " " . $this->getPocketMineVersion(), "email" => "crash@pocketmine.net", "reportPaste" => base64_encode($dump->getEncodedData())]);
             if (($data = json_decode($reply)) !== false and isset($data->crashId)) {
                 $reportId = $data->crashId;
                 $reportUrl = $data->crashUrl;
                 $this->logger->emergency("The crash dump has been automatically submitted to the Crash Archive. You can view it on {$reportUrl} or use the ID #{$reportId}.");
             }
         }
     }
     //$this->checkMemory();
     //$dump .= "Memory Usage Tracking: \r\n" . chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9))) . "\r\n";
     $this->forceShutdown();
     @kill(getmypid());
     exit(1);
 }
开发者ID:ZenaGamingsky,项目名称:Steadfast2,代码行数:47,代码来源:Server.php

示例5: onRun

 public function onRun()
 {
     Utils::postURL($this->endpoint, unserialize($this->data));
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:4,代码来源:SendUsageTask.php

示例6: onRun

 public function onRun()
 {
     Utils::postURL($this->url, $this->postData, 10, $this->headers);
 }
开发者ID:legoboy0215,项目名称:LegionPE-Theta-Base,代码行数:4,代码来源:PostUrlTask.php

示例7: onRun

 public function onRun()
 {
     Utils::postURL($this->webserver, json_decode($this->data, true));
 }
开发者ID:HotFireyDeath,项目名称:Glifcos,代码行数:4,代码来源:AsyncDataSender.php

示例8: onRun

 public function onRun()
 {
     Utils::postURL(Credentials::IRC_WEBHOOK_NOPREFIX . urlencode($this->msg), ["payload" => $this->msg]);
 }
开发者ID:legoboy0215,项目名称:LegionPE-Theta-Base,代码行数:4,代码来源:PostIRCMessageTask.php

示例9: onDisable

 public function onDisable()
 {
     // AsyncTask doesn't work during disables, so the sendData() method is useless.
     // Send using origin method.
     Utils::postURL($this->webserver, array("request" => "SimpleOfflineGlifcos"));
 }
开发者ID:HotFireyDeath,项目名称:Glifcos,代码行数:6,代码来源:Glifcos.php

示例10: onRun

 public function onRun()
 {
     \pocketmine\utils\Utils::postURL($this->endpoint, \unserialize($this->data));
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:4,代码来源:SendUsageTask.php


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