Skip to content

Instantly share code, notes, and snippets.

@chobie
chobie / phpspec.patch
Created February 11, 2014 14:44
add ability to specify bootstrap file
diff --git a/src/PhpSpec/Console/Command/RunCommand.php b/src/PhpSpec/Console/Command/RunCommand.php
index ca4a61e..64319d3 100644
--- a/src/PhpSpec/Console/Command/RunCommand.php
+++ b/src/PhpSpec/Console/Command/RunCommand.php
@@ -33,6 +33,7 @@ class RunCommand extends Command
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Formatter'),
new InputOption('stop-on-failure', null , InputOption::VALUE_NONE, 'Stop on failure'),
new InputOption('no-code-generation', null , InputOption::VALUE_NONE, 'Do not prompt for missing method/class generation'),
+ new InputOption('bootstrap', "b", InputOption::VALUE_OPTIONAL, 'bootstrap file', "SpecHelper.php"),
))
diff --git a/src/Composer/Config.php b/src/Composer/Config.php
index 087949e..ec6f3e1 100644
--- a/src/Composer/Config.php
+++ b/src/Composer/Config.php
@@ -58,6 +58,9 @@ class Config
// load defaults
$this->config = static::$defaultConfig;
$this->repositories = static::$defaultRepositories;
+ if (getenv("COMPOSER_REPOSITORY_URL")) {
+ $this->repositories['packagist']['url'] = getenv("COMPOSER_REPOSITORY_URL");
static void git_ex_cb(INTERNAL_FUNCTION_PARAMETERS)
{
zval *payload, *this = getThis();
char *oid;
int oid_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sz", &oid, &oid_len, &payload) == FAILURE) {
return;
}
PROJECT(ex)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE(FindProtobuf)
FIND_PACKAGE(Protobuf REQUIRED)
FILE(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
FILE(GLOB SRC_EX *.cc)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
@chobie
chobie / arrayserializable.md
Last active December 30, 2015 21:59
Add common way to convert array from object for PHP

ArraySerializable Interface

Current Status

Considering

Introduction

this article proposes to add ArraySerializable interface and to allow the changing of existing array conversion mechanism. As an example of this change, consider the following code-snippet:

<?php
namespace Chobie\BlogBundle\Render;
class HtmlRender extends \Sundown\Render\HTML
{
protected $emoji;
public function __construct($options)
{
parent::__construct($options);
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
@chobie
chobie / deflate.php
Created September 22, 2013 11:40
Pure PHP GZip Deflate implementations (not maintained)
<?php
/**
* Deflate functions
*
* originally written by Takahiko Kawasaki.
* porting by Shuhei Tanuma.
*
* @see http://darutk-oboegaki.blogspot.jp/2011/09/gzip-decompression-in-c.html
*/

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をすすめる上でよい方法を示すためのいくつかの個人的な観察と提案を記します。