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 | |
foreach (glob("./data/*.html") as $filename) { | |
echo "<a href='$filename'>$filename</a><br/>"; | |
} | |
?> |
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 | |
/* | |
* Hello World client | |
* Connects REQ socket to tcp://localhost:5555 | |
* Sends "Hello" to server, expects "World" back | |
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 | |
namespace raklib\server; | |
use raklib\protocol\CLIENT_CONNECT_DataPacket; //0x09 | |
use raklib\protocol\CLIENT_DISCONNECT_DataPacket; //0x15 | |
use raklib\protocol\CLIENT_HANDSHAKE_DataPacket; //0x13 | |
use raklib\protocol\PING_DataPacket; //0x00 | |
use raklib\protocol\PONG_DataPacket; //0x03 | |
use raklib\protocol\SERVER_HANDSHAKE_DataPacket; //0x10 |
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 | |
//error_reporting(0); | |
header("Content-type:text/html;charset=utf-8"); | |
function __autoload($class_name) { | |
require_once ('/workspace/minecraft/pocket/src/'.str_replace('\\','/',$class_name) . '.php'); | |
} | |
function test($f=array()){ | |
$magic = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78"; | |
$re = 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 | |
//example 使用多线程处理任务 | |
// http://netkiller.github.io/journal/thread.php.html 比较全部的php多线程学习 | |
class vote extends Thread { | |
public $res = ''; | |
public $url = array(); | |
public $name = ''; | |
public $runing = false; |
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
#!/bin/sh | |
# | |
# git autodeploy script when it matches the string "[deploy]" | |
# | |
# @author icyleaf <[email protected]> | |
# @link http://icyleaf.com | |
# @version 0.1 | |
# | |
# Usage: | |
# 1. put this into the post-receive hook file itself below |
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 | |
// http://hostname:82/gitbranch.php | |
$root_path = '/workspace/www/'; | |
?> | |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="keywords" content=""> | |
<meta name="description" content=""> |
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 | |
// nohup /usr/local/php55/bin/php -S 0.0.0.0:82 -t /www/sync/ >> /www/sync/githook.log 2>&1 & | |
// http://hostname:82/githook.php?token=xfs | |
$valid_token = 'xfs'; | |
$valid_ip = array('127.0.0.1'); | |
$client_token = $_GET['token']; | |
$client_ip = $_SERVER['REMOTE_ADDR']; | |
$fs = fopen('./githook.log', 'a'); | |
fwrite($fs, "\n".'Request on ['.date("Y-m-d H:i:s").'] from ['.$client_ip.']'.PHP_EOL); | |
if ($client_token !== $valid_token) |
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
function is_idcard( $id ) | |
{ | |
$id = strtoupper($id); | |
$regx = "/(^\d{15}$)|(^\d{17}([0-9]|X)$)/"; | |
$arr_split = array(); | |
if(!preg_match($regx, $id)) | |
{ | |
return FALSE; | |
} | |
if(15==strlen($id)) //检查15位 |
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 | |
//src https://github.com/Gsinhi/swoole-ide | |
/** | |
* 当前Swoole的版本号 | |
*/ | |
define('SWOOLE_VERSION', SWOOLE_VERSION); | |
/** | |
* 使用Base模式,业务代码在Reactor中直接执行 | |
*/ |