file.custom-handler:
extension: .php
fastcgi.spawn: "PHP_FCGI_CHILDREN=10 exec /root/.phpenv/versions/7.0.0beta3/bin/php-cgi"
This file contains 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 | |
# uploadしてあるzipをサーバーで解凍 | |
# FTPが重いレンサバなどで、`unzip source.zip`が使えない場合などに使う | |
# ext-zipが必要 | |
ini_set("max_execution_time", 300); | |
$zip = new \ZipArchive; | |
if ($zip->open('source.zip') === true){ | |
$zip->extractTo(__DIR__.'/'); | |
$zip->close(); | |
echo 'success'; |
This file contains 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
<html> | |
<body> | |
FacebookのOGPキャッシュがDebuggerでも消えない時に使う。 | |
<form action="https://graph.facebook.com/" method="post"> | |
url: <input name="id" ><br> | |
scrape: <input type="text" name="scrape" value="true"><br> | |
<input type="submit"> | |
</form> | |
</body> | |
</html> |
This file contains 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 | |
class MiddlewareResolver | |
{ | |
public $queue = []; | |
public function __construct(array $list) | |
{ | |
$this->queue = $list; | |
} |
This file contains 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
<form method="post"> | |
<input name="text"> | |
<input type="submit"> | |
</form> | |
<?php | |
!empty($_POST["text"]) && file_put_contents("log.php", date("c>").htmlspecialchars($_POST["text"], ENT_QUOTES, "UTF-8")."\n", FILE_APPEND) && header("location: {$_SERVER['REQUEST_URI']}"); | |
echo @implode('<br>',array_reverse(file("log.php"))); |
This file contains 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
find /path/to -atime +30 |grep .tmp|xargs rm |
This file contains 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 | |
namespace ¥\¥{ | |
class ¥{ | |
static public function ¥(){ | |
echo "\\ is not ¥".PHP_EOL; | |
} | |
} | |
} | |
namespace { |
This file contains 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 | |
// wp-config.phpの先頭あたりに適当につっこむ | |
// YOURNAMEとPASSWORDは適当に書き換える | |
if(preg_match('/wp-login\.php$/', $_SERVER['PHP_SELF'])){ | |
if( !($_SERVER["PHP_AUTH_USER"]=='YOURNAME') || !($_SERVER["PHP_AUTH_PW"]=='PASSWORD') ) { | |
header('WWW-Authenticate: Basic realm="Please Enter Your Password"'); | |
header("HTTP/1.0 401 Unauthorized"); | |
echo "Authorization Required"; | |
die; |
This file contains 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 | |
$♨ = "温泉"; | |
function 🍣(){ | |
return "おすし"; | |
} | |
echo "{$♨}いきたいな〜、".🍣()."たべたいなー。".PHP_EOL; | |
This file contains 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
{ | |
"require": { | |
"donatj/cli-toolkit": "dev-master" | |
} | |
} |