you know mruby is the lightweight implementation of the Ruby language. it also works with php. I made this extension in my lunch time :)
git clone https://github.com/chobie/php-mruby.git --recursive
cd php-mruby
cd mruby
make
/*! | |
* jQuery JavaScript Library v1.5.1 | |
* http://jquery.com/ | |
* | |
* Copyright 2011, John Resig | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ |
#!/usr/local/Cellar/php/5.3.6/bin/php | |
<?php | |
/* | |
git svn externals | |
git svn checkout-externals | |
git svn update-externals | |
git svn remove-externals | |
.externalsにデータはいれておく。 | |
*/ |
<?php | |
header("Content-type: text/plain"); | |
$data = file_get_contents("http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"); | |
header("Content-length: ". strlen($data)); | |
echo $data; |
// from php 5.3.6 | |
PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC); | |
#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC) | |
#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC) | |
PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) | |
{ | |
if (buf == NULL || count == 0 || stream->ops->write == NULL) { |
module Fluent | |
require 'pp' | |
# help me! i'm really ruby newbiee | |
require '/usr/local/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-0.9.20/lib/fluent/plugin/memcache_parser' | |
class MemcachedInput < Input | |
Plugin.register_input('memcached', self) | |
def initialize |
diff --git a/repository.c b/repository.c | |
index 88cc2bf..411f15d 100644 | |
--- a/repository.c | |
+++ b/repository.c | |
@@ -28,6 +28,30 @@ PHPAPI zend_class_entry *git2_repository_class_entry; | |
void php_git2_repository_init(TSRMLS_D); | |
static zend_object_handlers git2_repository_object_handlers; | |
+ | |
+static zval *php_git2_repository_read_property(zval *object, zval *member, int type TSRMLS_DC) |
sudo aptitude install build-essential automake cmake patch git-core php5-cli php5-dev libpcre3-dev -y | |
git clone https://github.com/libgit2/libgit2.git | |
cd libgit2 | |
mkdir build | |
cd build | |
cmake .. | |
cmake --build . | |
sudo cmake --build . --target install | |
cd ../../ |
diff --git a/Tests/Markdown/KwattroMarkdownTest.php b/Tests/Markdown/KwattroMarkdownTest.php | |
index e21b152..0162ec2 100644 | |
--- a/Tests/Markdown/KwattroMarkdownTest.php | |
+++ b/Tests/Markdown/KwattroMarkdownTest.php | |
@@ -64,12 +64,12 @@ class KwattroMarkdownTest extends \PHPUnit_Framework_TestCase | |
$md = new Markdown(array(), array(), 'html'); | |
$link = "hello_world_man"; | |
$expected = '<p>'.$link.'</p>'."\n"; | |
- //$this->assertEquals($expected, $md->render($link, array('no_intraemphasis' => true))); | |
+ //$this->assertEquals($expected, $md->render($link, array('no_intra_emphasis' => true))); |
<?php | |
class CustomRender extends Sundown\Render\HTML | |
{ | |
public function normaltext($paragraph) | |
{ | |
return nl2br($paragraph); | |
} | |
} | |
$render = new CustomRender(); |