This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//phar://path/to/resources/test.zip | |
$path = $this->getFile() . "resources/test.zip"; | |
echo "path: "; | |
var_dump($path); | |
//本当にファイルが存在するのかの確認 | |
echo "content-length10(base64): "; | |
var_dump(base64_encode(substr(file_get_contents($path), 0, 10))); | |
//zip | |
$zip = new \ZipArchive(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright (c) 2020 PJZ9n. | |
* | |
* This file is part of NewChestShop. | |
* | |
* NewChestShop is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use pocketmine\utils\Config; | |
class aClass | |
{ | |
private static $config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
class aClass | |
{ | |
private $hoge = "fuga"; | |
} | |
class bClass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name AntiSpamBug | |
* @version 1.0.0 | |
* @main pjz9n\antispambug\AntiSpamBug | |
* @api 3.11.0 | |
*/ | |
declare(strict_types=1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function on(InventoryTransactionEvent $event): void | |
{ | |
$tra = $event->getTransaction(); | |
if (count($tra->getActions()) !== 2) { | |
//TODO | |
return; | |
} | |
//プレイヤーの取得 | |
$player = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use pocketmine\form\Form; | |
use pocketmine\Player; | |
use pocketmine\plugin\PluginBase; | |
use pocketmine\utils\Config; | |
class Main extends PluginBase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onEnable(): void | |
{ | |
$name = "world-" . uniqid(); | |
$this->copyWorld("world", $name); | |
$this->getServer()->loadLevel($name); | |
var_dump($this->getServer()->getLevelByName($name)->getId()); | |
$this->func("test", function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ワールドをコピーする | |
* | |
* @param string $from コピー元ワールド名(ディレクトリ名) | |
* @param string $to コピー先ワールド名(ディレクトリ名) | |
*/ | |
public function copyWorld(string $from, string $to): void | |
{ | |
/** @var Plugin $this */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//パスワードの登録例 | |
$password = "Password";//登録するパスワード | |
var_dump($password); | |
$hash = password_hash($password, PASSWORD_DEFAULT);//ハッシュ化する | |
var_dump($hash); | |
//$hashの内容を保存しておく | |
//パスワードの検証例 |