This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi, | |
I've tried to write Doctrine_Query_Tokenizer as PHP extension (This is my first PHP extension): | |
http://github.com/ebihara/php-dql-tokenizer | |
My product executes many DQLs (e.g. about 200 queries) in per request. In this case, DB server is not heavy, but I noticed CPU usage of Web server is high. I checked result of XHProf, and this result showed that executing some methods of Doctrine_Query_Tokenizer uses a lot of CPU resources. | |
So I tried to write this extension for resolving my problem. | |
Of course my case is a little special. I think that many products don't execute too many DQLs. But I want you to try to use this extension if you are interested. (I have a plan to write many Doctrine features in C, not only tokenizer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'SymfonyComponents/YAML/sfYaml.php'; | |
function output_ticket_title($title) | |
{ | |
preg_match('/^.+?#(?P<ticket_id>[0-9]+):(?P<ticket_subject>.*)$/', $title, $matches); | |
$author = ''; | |
$authors = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pathToNewZend = '/usr/local/lib/php/Zend'; | |
$pathToOldZend = '/home/co3k/www/sf/op3-ebihara/lib/vendor/Zend'; | |
//--- | |
require_once $pathToNewZend.'/Version.php'; | |
$pathToHostNameValidator = '/Validate/Hostname'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
INSTALL:: | |
$ apxs2 -c mod_doyagawa.c -ltokyocabinet -ljansson | |
$ libtool --mode=install cp mod_doyagawa.la $PWD | |
Restful API Interface:: | |
Get Feed: GET http://example.com/doya | |
Get Entry: GET http://example.com/doya/{id} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = posix_getpwuid(posix_getuid()); | |
$current_umask = umask(0000); | |
$dir = '/tmp/'.$user['name'].'-'.date('YmdHis'); | |
@mkdir($dir, 0777, true); | |
var_dump(substr(sprintf('%o', fileperms($dir)), -4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Zend/Loader.php'; | |
Zend_Loader::loadClass('Zend_Gdata'); | |
Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); | |
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets'); | |
require_once 'config.php'; | |
define('SPREADSHEET_ID', 'tPPseSNcB7ho4tho-2aB4vg'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file is part of the OpenPNE package. | |
* (c) OpenPNE Project (http://www.openpne.jp/) | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file and the NOTICE file that were distributed with this source code. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "ハッシュアルゴリズムと使用する文字のパターンを変えたときに PHP のセッション ID がどれくらいの長さになるかを検証するマシーン".PHP_EOL; | |
$list = hash_algos(); | |
$example = (string)time(); | |
$bits = array(4, 5, 6); | |
echo "アルゴリズム"; | |
foreach ($bits as $bit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "ハッシュアルゴリズムと使用する文字のパターンを変えたときに PHP のセッション ID がどれくらいの長さになるかを検証するマシーン".PHP_EOL; | |
$list = hash_algos(); | |
$example = (string)time(); | |
$bits = array(4, 5, 6); | |
echo "アルゴリズム"; | |
foreach ($bits as $bit) |