Skip to content

Instantly share code, notes, and snippets.

@chobie
chobie / Test.cs
Last active December 24, 2015 07:47
// automatically generated, do not modify
namespace Example
{
using System;
using FlatBuffers;
public sealed class Test : Table
{
diff --git a/Zend/zend.h b/Zend/zend.h
index 1377fd5..59d811a 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -588,6 +588,8 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
#define IS_CALLABLE 10
+#define IS_BYTE 11
+#define IS_ORD 12

By cj on Feb 12, 2013

The PHP RFC process has been in place for a while, and users new to core PHP development are starting to use RFCs to propose desirable features.

PHPのRFCの運用が始まり、新参のコア開発もRFCを使って望ましい機能の提案が行えるようになりました。

Here are some personal observations and suggestions that show how I have seen feature acceptance and the RFC process work in practice. These notes augment the steps in How To Create an RFC. I hope they help set expectations about the PHP RFC process and feature acceptance in the PHP language.

この文章では今まで私が見てきた新機能の承認やRFCのプロセスにおいて、RFCをすすめる上でよい方法を示すためのいくつかの個人的な観察と提案を記します。

<?php
/**
* RpbErrorResp
*
* @message RpbErrorResp
*
* -*- magic properties -*-
*
* @property string $errmsg
* @property int $errcode

php-uvで始めるEvent-driven, Nonblocking / IO プログラミング(仮)

対象

  • PHPで開発を行っている中級者向け

概要

普段はApache2等のmodule上で実行されるPHPですが、Node.jsで使われているlibuvをPHPでも使えるようにしたPHP拡張 php-uv を使う事により軽量なイベント駆動やネットワークアプリケーションを簡単に書けるようになります。 本発表ではlibuvの簡単な概要説明からphp-uvを使ったEvent-driven, Nonblocking / IOを使ったプログラミング例の紹介、

var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8888,"::1");
<?php
//https://github.com/chobie/php-uv
$loop = uv_default_loop();
$queue = uv_queue_work($loop, function(){
var_dump("[queue]");
}, function(){
var_dump("[finished]");
});
@chobie
chobie / uv.php
Created May 26, 2012 13:37
php-uv exsample
<?php
$server = uv_tcp_init();
uv_tcp_bind($server, "0.0.0.0",5150);
uv_listen($server,1000,function($server){
$client = uv_tcp_init();
uv_accept($server,$client);
uv_read_start($client, function($buffer, $client){
uv_write($client,"Hello\n",function($status, $client){
<?php
namespace Pinatra;
class Application
{
protected static $instance;
public $routes = array();
public static function getInstnace()
{
@chobie
chobie / php-redis-5.4-patch.diff
Created May 4, 2012 02:21
php-redis-5.4-patch
diff --git a/config.m4 b/config.m4
index 51a1cad..f1af506 100755
--- a/config.m4
+++ b/config.m4
@@ -55,5 +55,5 @@ if test "$PHP_REDIS" != "no"; then
dnl
dnl PHP_SUBST(REDIS_SHARED_LIBADD)
- PHP_NEW_EXTENSION(redis, redis.c library.c redis_session.c redis_array.c redis_array_impl.c igbinary/igbinary.c igbinary/hash_si.c igbinary/hash_function.c, $ext_shared)
+ PHP_NEW_EXTENSION(redis, redis.c g_fmt.c library.c redis_session.c redis_array.c redis_array_impl.c igbinary/igbinary.c igbinary/hash_si.c igbinary/hash_function.c, $ext_shared)