Skip to content

Instantly share code, notes, and snippets.

View co3k's full-sized avatar
🔞
"><s>'\

Kousuke Ebihara co3k

🔞
"><s>'\
View GitHub Profile
@co3k
co3k / config.php
Created November 25, 2009 14:40
Doctrine にバグ報告をする途中
<?php
/*
* $Id: config.php 2753 2007-10-07 20:58:08Z Jonathan.Wage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@co3k
co3k / notifier.php
Created December 13, 2009 04:18
growl に通知するやつ(暫定)
#!/usr/bin/php
<?php
/**
* Copyright 2009 Kousuke Ebihara
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@co3k
co3k / patch_for_pecl_runkit.diff
Created December 30, 2009 05:02
PHP 5.3 で runkit をコンパイルするための自分用パッチ(サンドボックスのあたりはたぶんまだ動かないと思う)
Index: runkit_methods.c
===================================================================
--- runkit_methods.c (revision 292782)
+++ runkit_methods.c (working copy)
@@ -181,7 +181,7 @@
/* {{{ php_runkit_update_children_methods
Scan the class_table for children of the class just updated */
-int php_runkit_update_children_methods(zend_class_entry *ce, int num_args, va_list args, zend_hash_key *hash_key)
+int php_runkit_update_children_methods(zend_class_entry *ce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
diff --git a/lib/vendor/php-openid/Auth/OpenID.php b/lib/vendor/php-openid/Auth/OpenID.php
index 6556b5b..f0657af 100644
--- a/lib/vendor/php-openid/Auth/OpenID.php
+++ b/lib/vendor/php-openid/Auth/OpenID.php
@@ -120,7 +120,7 @@ class Auth_OpenID {
*
* @access private
*/
- function isFailure($thing)
+ static function isFailure($thing)
<?php
$modules = array(
'pc' => 'pc_frontend',
'ktai' => 'mobile_frontend',
);
$ds = DIRECTORY_SEPARATOR;
if (!isset($argv[1]) || !realpath($argv[1]))
<?php
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$test = $browser->test();
$conn = Doctrine::getConnectionByTableName('your_model');
$conn->beginTransaction();
$browser
PHP_AUTOCONF=autoconf2.13 PHP_AUTOHEADER=autoheader2.13 ./buildconf # ./configure とかを生成する必要がある場合(at Debian sid)
./configure --enable-mbstring --with-apxs2=/usr/bin/apxs2 --with-gd --with-mysql --with-pgsql --with-pdo-mysql=/usr --with-pdo-pgsql --with-pdo-sqlite --with-pear --with-jpeg-dir=/usr/lib --with-curl --with-zlib
@co3k
co3k / dashboard.php
Created January 15, 2010 07:07
This script creates JSON contents for OpenPNE 3 dashboard
<?php
function h($str)
{
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}
$callback = $_GET['callback'];
$ch = curl_init();
#!/usr/bin/env php
<?php
print apc_clear_cache('user') ? 'Remove user cache successfully.' : 'Failed to remove user cache.';
echo PHP_EOL;
print apc_clear_cache() ? 'Remove system cache successfully.' : 'Failed to remove system cache.';
echo PHP_EOL;
<?php
/**
* Copyright 2010 Kousuke Ebihara
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0