Skip to content

Instantly share code, notes, and snippets.

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

Kousuke Ebihara co3k

🔞
"><s>'\
View GitHub Profile
$ say -v Cellos -f /tmp/oohira
* JavaはSun Microsystemsの登録商標です
* Perl(R)は株式会社テラ・インターナショナルの登録商標です
* 本 Gist は http://tetsuya99.wordpress.com/2010/06/23/perl%E3%81%AE%E3%81%AF%E3%81%AA%E3%81%97-by-%E5%8C%97%E7%95%A0%E5%BE%B9%E4%B9%9F/ および http://webcache.googleusercontent.com/search?q=cache:0pZ7OfEVoHAJ:tetsuya99.wordpress.com/+Perl%E3%81%AE%E3%81%AF%E3%81%AA%E3%81%97+%E2%80%94+by+%E5%8C%97%E7%95%A0%E5%BE%B9%E4%B9%9F&cd=2&hl=ja&ct=clnk&gl=jp&client=firefox-a から転載したものです。申し立てがあれば削除いたします (連絡先: [email protected] )
Index: lib/util/opDoctrineQuery.class.php
===================================================================
--- lib/util/opDoctrineQuery.class.php
+++ lib/util/opDoctrineQuery.class.php
@@ -18,13 +18,15 @@
class opDoctrineQuery extends Doctrine_Query
{
protected static
- $detectedSlave = null;
+ $detectedSlave = null,

XHProf 導入

はじめに

PHP アプリのボトルネックの分析に XHProf を使う。

XHProf は PECL 拡張として提供されている。

<?php
/*
usage:
/usr/bin/php /path/to/this/script.php >> /tmp/junkai-log
*/
diff --git a/data/upgrade/2/sql/message.sql b/data/upgrade/2/sql/message.sql
index 3c38919..3328aa3 100644
--- a/data/upgrade/2/sql/message.sql
+++ b/data/upgrade/2/sql/message.sql
@@ -1,8 +1,11 @@
-INSERT INTO message (id, member_id, subject, body, is_deleted, is_send, thread_message_id, return_message_id, message_type_id, foreign_id, created_at, updated_at) (SELECT c_message_id, c_member_id_from, subject, body, is_kanzen_sakujo_from, is_send, NULL, hensinmoto_c_message_id, 1, NULL, r_datetime, r_datetime FROM c_message);
-INSERT INTO message_send_list (id, member_id, message_id, is_read, is_deleted, created_at, updated_at) (SELECT c_message_id, c_member_id_to, c_message_id, is_read, is_kanzen_sakujo_to, r_datetime, r_datetime FROM c_message);
+INSERT INTO message (id, member_id, subject, body, is_deleted, is_send, thread_message_id, return_message_id, message_type_id, foreign_id, created_at, updated_at) (SELECT c_message_id, c_member_id_from, subject, body, is_deleted_from, is_send, NULL, hensinmoto_c_messa
<?php
require_once 'VersionControl/Git.php';
$git = new VersionControl_Git('/home/ebihara/OpenPNE2-git-mirror');
$git->setGitCommandPath('/usr/local/bin/git');
$branches = $git->getBranches();
foreach ($branches as $branch)
{
<?php
function h($str)
{
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}
$cookie_params = session_get_cookie_params();
if (isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'])
<?php
require_once '/home/co3k/www/sf/b-tuning3/lib/vendor/symfony/lib/util/sfInflector.class.php';
require_once '/home/co3k/www/sf/b-tuning3/lib/vendor/symfony/lib/util/sfToolkit.class.php';
$classStr = file_get_contents('/home/co3k/www/sf/b-tuning3/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Tokenizer.php');
$classStr = preg_replace('/(protected|private)/', 'public', $classStr);
$classStr = str_replace(array('<?php', '?>'), '', $classStr);
eval($classStr);
diff --git a/apps/mobile_frontend/modules/community/templates/_cautionAboutCommunityMemberPre.php b/apps/mobile_frontend/modules/community/templates/_cautionAboutCommunityMemberPre.php
index 8cd9c40..dc9d5e1 100644
--- a/apps/mobile_frontend/modules/community/templates/_cautionAboutCommunityMemberPre.php
+++ b/apps/mobile_frontend/modules/community/templates/_cautionAboutCommunityMemberPre.php
@@ -1,3 +1,4 @@
+<?php $form = new sfForm() ?>
<?php foreach ($communityMembers as $communityMember) : ?>
<font color="red">
<?php echo __('%1% send request for participation to %2%.', array(
@@ -6,6 +7,7 @@