2010-09-03(金)

19:31 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
当方にプログラミングの知識がなく、何度もアドバイスいただくことになってしまっています。<br />ただただ感謝です。<br /><br />さて、意味自体がわからず探しましたが、ただ単にサーバにphp infoの呪文を書いた.phpファイルをアップして、それをブラウザで開けばValiablesの情報が勝手に出てくれる、というものなのですね!<br />やっと意味がわかってきました。<br />が、Valiablesっていっぱいあって、お指図のものがいったいどれなのかわからない状態でして、めぼしいものをやってみました。<br /><br />しかし妙なのです。ソフトで更新日時を取得実験しましたところ、<br />試したファイルだけが18:47となっていて、あとのファイルは実験した時間である19:02とかなっています。ただし、試していないさわっていないファイルもちょっとおかしくて、これまでは時間までまるで一緒だったのに、今回の実験ではひにちは今日になっているものの、時間が秒単位で微妙にズレています。<br /><br />今までは、すべてのファイルがどれも、ひにち・時間・秒まで同じだったんですが。。。<br /><br />Valiablesに書いてあったのは以下です。<br />※PHPRCとか、HOMEとか、固有っぽい情報は当然仮の情報に書き換えています。<br /> また、どうみても関係ないのもはぶいています。<br /> PHPRC、HOME、SCRIPT_FILENAMEは試したのですが・・・<br /><br />------------------------------------------------------<br />_SERVER[&quot;REDIRECT_STATUS&quot;] 1<br />_SERVER[&quot;PHPRC&quot;] /www/jp/rentalserver/myid/mysite.com<br />_SERVER[&quot;HOME&quot;] /www/jp/rentalserver/myid/mysite.com<br />_SERVER[&quot;PATH&quot;] /usr/local/bin:/usr/bin:/bin<br />_SERVER[&quot;HTTP_HOST&quot;] <a href="http://www.mysite.com" title="http://www.mysite.com" rel="external">www.mysite.com</a><br />_SERVER[&quot;SERVER_NAME&quot;] <a href="http://www.mysite.com" title="http://www.mysite.com" rel="external">www.mysite.com</a><br />_SERVER[&quot;DOCUMENT_ROOT&quot;] /export/cgi<br />_SERVER[&quot;SCRIPT_FILENAME&quot;] /www/cgi/jp/www.mysite/phpinfo.php<br />_SERVER[&quot;GATEWAY_INTERFACE&quot;] CGI/1.1<br />_SERVER[&quot;SERVER_PROTOCOL&quot;] HTTP/1.1<br />_SERVER[&quot;REQUEST_METHOD&quot;] GET<br />_SERVER[&quot;QUERY_STRING&quot;] no value<br />_SERVER[&quot;REQUEST_URI&quot;] /phpinfo.php<br />_SERVER[&quot;SCRIPT_NAME&quot;] /phpinfo.php<br />_SERVER[&quot;PHP_SELF&quot;] /phpinfo.php<br />_SERVER[&quot;REQUEST_TIME&quot;] 1283507279<br />------------------------------------------------------<br /><br />なんどもすみませんホントに......
19:10 ログイン後のユーザーを識別する方法 »Q&A掲示板
あまり詳しくないもので、勉強不足な質問ですみません。 現在、ポータルサイト構築を行っています。 ログイン画面からログイン後、 それぞれのユーザーの専用ページに移行する仕組みです。 ログイン後、ユーザページまでは間違いなく進み、 ユーザーページにログインせずに直接アクセスしようとすると、ログイン画面に リダイレクトするようにはなっています。 ただ現状、ログインユーザー同士が、お互いの専用ページにアクセスできてしまっています。 ログインユーザーを識別し、他のユーザーの専用ページにはアクセスできないようにする 必要があるのですが、どのように記述を変えれば良いかわからない状況です。 <?php session_start () ; $_SESSION  =  array () ; 以下のように、usernameとPWを書き込んだ別ファイルを指定しています $data_file = "./d_file.dat"; このファイルの中には、以下のように各ユーザーのusernameとPWが記載されています。 member_name1,password1, member_name2,password2, 以下にコード続きます。 $error_message = ""; if(!isset($PHP_SELF)){ $PHP_SELF = $_SERVER["PHP_SELF"]; } if(!isset($action)){ $action = $_POST['action']; } if(!isset($member_name)){ $member_name = $_POST['member_name']; } if(!isset($password)){ $password = $_POST['password']; } if (isset($_POST["login"])) {   $p_data = file($data_file);   $p_flag = 0;   for($i=0; $i<count($p_data); $i++){     list($id,$pass) = split(",", $p_data[$i]);     if($id == $member_name && $pass == $password){       $p_flag++;     }   } if($p_flag > 0){      $_SESSION["login_name"] = $_POST["member_name"]; ユーザ専用画面へブラウザをリダイレクトします header("location: http://〜/$member_name/");     exit; <?php session_start () ; $old_session_id  =  session_id () ; session_regenerate_id () ; unlink ( session_save_path ()  .  ' /sess_ '  .  $old_session_id ) ;   if   ( ! isset ( $_SESSION [ " login_name " ]))   {      header ( " location: http://〜/ " ) ;    exit ; } ?> このようにログイン画面を設置。 ログインすると、URLの末尾にmember_nameのあるページに遷移します。 ログイン後のページには以下のように記述しています。 この記述では、各ユーザーを識別できていないのでしょうか? 試行錯誤しておりますが、うまくいきません。 何卒アドバイスを、よろしくお願いいたします。
16:48 「Dropbox Uploader」で人のDropboxアカウントにファイルがアップロード可能に : ライフハッカー[日本版] »はてなブックマーク - タグ「php」を含む注目エントリー
Webツール , ストレージ , フリーソフト , メンテナンス「Dropbox Uploader」で人のDropboxアカウントにファイルがアップロード可能に掲載日時:2010.09.02 14:00  コメント [0], トラックバック [0]Dropboxフォルダを使って、ファイルを共有するのは本当に簡単ですが、友達が、自分のアカウントにファイルをアップロードするための機能は、備わっていませ...
16:48 自動テストのfixtureを効率的に管理する方法 | Ryuzee.com »はてなブックマーク - タグ「php」を含む注目エントリー
僕がやっている案件(PHP)はもともとテストコードのないレガシーなプロジェクトで、それを改善するためにずっと動作を確認するための結合レベルの自動テストを増やしてきた。 そんな中で僕のところではどうやってテスト用のfixtureを管理しているか事例として紹介したいと思う。最初にコアとなるfixtureを用意するみんなが沢山テストを作る前にコアとなるテスト用のfixtureは用意しておく。 さもないと...
16:45 Coreに手を入れず例外を一カ所で補足する方法(PHP5) - Web、只今勉強中 »はてなブックマーク - タグ「cakephp」を含む注目エントリー
CakePHPで簡単に例外をハンドリングしたいな〜と思って検索したところ、Coreのdispatcher.phpに手を入れる以下の様な方法が数件引っかかった。(※以下2つはどちらも動作未確認)CakePHP 1.2 (line 227辺り)try {$output = $controller->dispatchMethod($params['action'], $params['pass']);}...
16:34 月間57億PV、300台のサーバを運用するミツバチワークスが編み出したインフラ技術 »POOKMARK Airlines - タグ:php
14:49 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
環境に依存するようですね。<br />こちらではうまくいくのですが。<br /><br />$mtime = filemtime($_SERVER[&quot;ORIG_PATH_TRANSLATED&quot;]);<br /><br />おそらく $_SERVER[&quot;ORIG_PATH_TRANSLATED&quot;] の値がうまくとれていないのでしょう。<br />phpinfo()で PHP Variables の表をみてください。<br />その中に元のphpファイルをフルパスで指し示している環境変数があるはずです。<br />ORIG_PATH_TRANSLATED のかわりに使ってみてください。<br /><br />こちらでは _SERVER[&quot;SCRIPT_FILENAME&quot;] も同じ値です。
14:25 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
ありがとうございます。<br /><br />&gt; そのことは考慮済みです<br /><br />なんと! そこまで考えていただいたいたのですか・・・<br />ありがとうございます。<br /><br /><br />&gt; これより上に記述するかinclude_once()してみてください。<br /><br />include_once()のほうは、例えば「last-mod.php」などとして外部ファイル化し、そこにご案内のソースを入れる、<br />ということだと理解しました。そうやってもいいんですね。<br /><br /><br />そういうことだったのか、ということでひとまず「これより上に記述」のほうでやってみました。要は一番最初にもってきたことになりました。<br />index.phpという大元ファイルの。<br /><br />そうしましたところ、ソフトを起動して「Webサイトから取得」をやってみましたところ、確かにこのindex.phpのファイルだけ更新日時が変わりました。<br />しかし、なんででしょうか・・・・<br />1970-01-01<br />09:00:00<br />と出ました。<br />いじっていない他のすべての.phpは、相変わらず「Webサイトから取得」を実行した本日只今の日時が更新日時として出ていました。<br />ウ~ン・・・・なんで40年前の9時丁度に??<br /><br />試しに、sidebar.phpの冒頭にも同じソースをアップした状態でやってもみましたが、<br />やはり結果は同じでした。
12:51 Distributed Hashing Algorithms by Example: Consistent Hashing - www.dotnetconvo.com »del.icio.us/popular/php
12:46 Big Sky :: VimmerなPerl開発環境 »はてなブックマーク - タグ「php」を含む注目エントリー
えーっと、IDE使ってません。ごめんなさい。 PerlをIDEで書いてる人、どれくらいいるんだろう。何使ってるんだろ。 私はLinuxでもWindowsでもVimを使ってます。Perlってサーバで使われる事が多いし、サーバだとsshで入る事が多いだろうし、まぁXの転送やVNCやそれっぽいのでグラフィカルに操作しても良いけど、正直PerlのドキュメントもテキストベースだしPerlで入力補完出来るグラ...
12:46 月間57億PV、300台のサーバを運用するミツバチワークスが編み出したインフラ技術 »はてなブックマーク - タグ「php」を含む注目エントリー
ミツバチワークスのエンジニアは、「月間57億PV」という巨大なトラフィックをさばくため、さまざまな技術を駆使してインフラを構築している。主と副の2本立てでデータベースを運用し、300台のサーバを使いながら「負荷の限界」に挑むエンジニアに、技術ノウハウを聞く。ミツバチワークスが運営するケータイブログサービス「DECOLOG」は、異色のサービスである。10代後半から20代前半の女性に最も人気のあるケー...
11:59 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
&gt; (1)説明が悪かったので補足<br />そのことは考慮済です。<br />include_once()で取り込む時点でindex.php(外部ファイルではない大元のphpファイル)のLast-Modifiedを返します。<br />sidebar.phpでなくとも別のファイルに記述しておけばいいと思います。<br /><br />&gt; (2)<br />&gt; &lt;?php echo &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n&quot;; ?&gt;<br />内容を送出した後なのでヘッダは送れなくなるのですよ。<br />これより上に記述するかinclude_once()してみてください。
11:14 Authコンポーネントでのwebrootアクセス制御 »CakePHP Users in Japan
Authコンポーネントを使ってクローズドな環境を作ってもwebrootがオープンなので、どうにかできますか?
アイディアまたはご教授ください。
10:47 Simple Groupware 0.642 released »SourceForge.net: SF.net Project News: Simple Groupware
The updater was extended to handle update methods from extensions.
Error handling was optimized for initializing IMAP connections.
Fixes were applied to unicode names in the WebDAV server and uninstalling extensions.
10:46 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
nulla様、申し訳ないです、私の無知により説明が悪かった気がしております。それの補足説明と、やってみての結果をお伝えします。<br /><br />(1)説明が悪かったので補足<br />バカでした。サイドバーの外部ファイルでsidebar.phpとすればわかりやすくなると思ったのですが、見当違いでした。<br />あくまでも更新日時を取得したいのは、「公開した新たに製作したページや、すでにあるページを編集・上書きしたページ」ですから、<br />サイドバーではなかったです。サイドバーが実際に更新されるのは「常にではない」のが正しいのに。<br /><br />なので、更新したかどうかを知らせたいファイルというのは、<br />●外部ファイルではない大元の.phpファイル。例:製品Fのページを新たに公開したのなら、/item/item-f/index.php<br />●更新されたことを知らせたい外部ファイル。例:製品Fのページに直接記述せず、使い回しできるように外部ファイル化している、「製品A~製品F」をゆききするサブリンクボタンの部分だけが記述されている外部ファイル。<br /><br />ということだとやっと理解しました。<br /><br /><br /><br /><br />(2) ということで以下のようにやってみましたが、ページを更新するとエラーメッセージのようなものが出ました。<br /><br />●sidebar.phpは関係ないと理解できたので、新たに公開した製品Fの.phpページの以下の場所に教えていただいたソースを入れた<br />------------------------------------------------------<br />&lt;?php echo &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n&quot;; ?&gt;<br />&lt;?php<br /><br />$mtime = filemtime($_SERVER[&quot;ORIG_PATH_TRANSLATED&quot;]);<br />header(&quot;Last-Modified: &quot; . gmdate(&quot;D, d M Y H:i:s&quot;, $mtime) . &quot; GMT&quot;);<br /><br />?&gt;<br />&lt;?php include_once(&quot;../../cmn/inc/doctype.php&quot;); ?&gt;<br />&lt;head&gt;<br />&lt;?php include_once(&quot;../../cmn/inc/head.php&quot;); ?&gt;<br />------------------------------------------------------<br /><br /><br />●そのうえで該当URLを開いたら、ページデザインの一番上に以下のようなメッセージが出た<br />------------------------------------------------------<br />Warning: Cannot modify header information - headers already sent by (output started at /serverpass/www//rentalserver/myid/mysite.com/item/item-f/index.php:1) in /serverpass/www/rentalserver/myid/mysite.com/item/item-f/index.php on line 6<br />------------------------------------------------------<br /><br />「headerはすでに送っているぞ」<br />とは、Last-Modifiedと何の関係があるのかな・・・・<br /><br />ご迷惑おかけしております・・・・・・
08:45 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
おはようございます。<br /><br />sidebar.phpの上部辺りに<br />&lt;?php<br /><br />$mtime = filemtime($_SERVER[&quot;ORIG_PATH_TRANSLATED&quot;]);<br />header(&quot;Last-Modified: &quot; . gmdate(&quot;D, d M Y H:i:s&quot;, $mtime) . &quot; GMT&quot;);<br /><br />?&gt;<br /><br />httpレスポンスヘッダを確認してみてください。<br />Last-Modifiedがあるはずです。
07:26 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
nullaさま、ありがとうございます!<br /><br />済みませんがおっしゃってることが、いったい何をどうすればいいのかプログラミング初心者なので何もわかりませんでした。<br />検索しても出ないのですが、ひとつ見つけたサイトで、<br /><br /><a href="http://dara-j.asablo.jp/blog/cat/php/?offset=10" title="http://dara-j.asablo.jp/blog/cat/php/?offset=10" rel="external">http://dara-j.asablo.jp/blog/cat/php/?offset=10</a><br /><br />以下のような記載がありました。<br /><br />「Last-Modified = &quot;Last-Modified&quot; &quot;:&quot; HTTP-date」<br /><br />すでに記載したとおり、当方の状況の場合、<br />●ソフトを使い続けるようにするのが目的<br />●当然ソフト自体を改造することはできない<br />●PHPファイルや他のファイル等、Webサーバにアップロードするファイルに何か仕込む的な手法を想像している<br /><br />こんな感じなのですが、上述の、<br /><br />「Last-Modified = &quot;Last-Modified&quot; &quot;:&quot; HTTP-date」<br /><br />を、外部化・共通化した.phpファイル(例:sidebar.php。サイドバーの個所だけが記載された外部ファイル。サイドバーのページリンクを増やしたり、変更・削除がここをいじるだけで終了できる)の冒頭に記述するとかでしょうか??<br /><br />初心者なため、記述してサーバが壊れてサイトが表示されなくでもなったら恐ろしいことになるので、わからず試すのも無理がありまして・・・<br /><br />済みません、書いてあることを具体的にどうやればよいのかまるで知らないので、たぶん見当違いとは思いますが自分で調べるとこんな感じくらいしか思いつきませんでした。<br />もしよろしかったら、何のファイルにどうやれば良いか教えていただけましたらとても助かります。
04:10 Gonzalo Ayuso's Blog: Using Monkey Patching to store files in CouchDb using the standard filesystem »PHPDeveloper.org

Gonzalo Ayuso takes his "CouchDb as a filesystem" approach one step further (see the previous post about it here) with this new post talking about monkey patching to store files into the CouchDb server using the normal PHP file handling functions.

Since PHP5.3 a new design pattern is available for us: Monkey Patching. With this pattern we can override PHP's core functions with a home-made functions in a different namespace (another example here). That's means if I have fopen function in the above example, PHP uses the filesystem function "fopen" but if we set a namespace in our example, PHP will search first the function within the current namespace.

By defining the new interface inside of a namespace (with functions to override the default PHP file handlers) you can have the rest of the code call the same functions (fopen, fread, etc) but they'll do different things. In this case it handles them as push and pull to the CouchDb instead of the normal filesystem. You can grab the source for this example here.

03:49 Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 4 »PHPDeveloper.org

Kevin Schroeder has another new post to his blog today with an excerpt from his "You Want to Do WHAT with PHP?" book. This new post is a section from the fourth chapter looking at stream handling.

Communication is key to building applications now and for the future. While it is not something that I think that everyone should do, I have not seem many applications that make good use of streams in PHP. Streams can be immensely useful in the right situations, but a lot of developers are not really aware of how streams can be used. [...] While I don't think you will end up basing your application around streams it is a really good idea to know how streams work.

The sample code (and description) talk about changing the properties of a stream on the fly. He shows how, with a fgets loop checking the input, he can catch a command from the already running script and change the compression setting on the currently open stream. The compression changes the stream's data from plain text to a binary format as handled by the streams functionality.

02:35 TechTatva.com: [How To] Setup Cherokee with PHP5 FPM »PHPDeveloper.org

On the TechTatva.com site today there's a new tutorial posted about getting the Cherokee web server set up and running PHP5 FPM. It's a few simple steps to install and a few clicks around the GUI to get things configured.

In this "how to" we will see how to setup cherokee on Ubuntu with PHP5-FPM (FastCGI Process Manager). Although the cherokee CookBook claims that "If PHP-fpm binaries are found, those will be prioritized over the regular binaries." it turns out that the latest stable version of cherokee in Launchpad gives errors while enabling

A few calls to "apt-get" install some packages (Cherokee and php5-fpm) and changes to the Cherokee configuration - handled through its web-based interface - are all that's needed to add a new behavior rule to the default vServer to link to the PHP5-FPM install (as FastCGI).

01:12 Zend Developer Zone: Zend Framework is a BOSSie Award Winner »PHPDeveloper.org

According to this new post on the Zend Developer Zone, the Zend Framework has won itself a BOSSie award (from InfoWorld) in the "best open source application development software" category. Matthew Weier O'Phinney has this to say about the award:

I am one of the privileged few to have worked with Zend Framework since before the original public pre-alpha release. [...] What [Mike Naberenzy] showed me at the time captured my imagination: the company with the best known name in the PHP industry was building an application framework, and the code I was seeing was simple, straight-forward PHP. It was the first time I'd seen a framework I was actually interested in using -- even if it was in its early, early infancy. I knew at that moment that I wanted to be involved in the project.

He mentions some of the things that "shook up" the development world when those first versions of the Zend Framework came out - like the PHP5 requirement and the CLA you had to sign to contribute.

Other BOSSie award winners include jQuery, Apache Hadoop, Git and Go.

00:50 ThinkPHP Blog: Contributing to Zend Framework »PHPDeveloper.org

On the ThinkPHP blog today there's this new post talking about open source contribution and, more specifically, making contributions to a popular PHP project - the Zend Framework.

Who hasn't ever started writing his own Framework/CMS? It is considered best practice for learning purposes, but going through all the security stuff can be stressful and boring at the same time. That's where most devs start to contribute to big Open Source-projects like Typo3 or the Zend Framework, because they are already experienced working with it and yet evolving another system on the market or even getting people to contribute seems like an unachievable task.

They talk about the evangelizing that all of the Zend Framework tutorial posts do to further the cause of ZF use and how they can help introduce beginners to the framework even easier than them trying to submit bugfixes right from the start. They also talk about the process of contributing back to the Zend Framework - signing a CLA, reading the standards, grabbing the code from the subversion server and checking out the bug tracker for things to get in and fix (and write unit tests for, of course).

2010-09-02(木)

23:40 Developer.com: Getting Started with Memcached Distributed Memory Caching »PHPDeveloper.org

On Developer.com today there's a new article talking about memcache and how you can implement it in your application to provide a performance boost for applications in a distributed environment.

As distributed system is part of the Memcached definition, you can install Memcached on various servers to make a larger caching server. In this way, Memcached helps reduce database loads to a minimum, resulting in faster and more responsive Web applications

They take some time to explain what memcache is - a simple to use caching system that reduces the dependency on other data sources - and how to get it installed (via the package manager of your choice). They suggest times on when and when not to use it as well as some of the security implications you'll need to worry about when implementing it. There's also a bit of sample code to help you get started in your application. You'll need the memcached extension to make it all work, though.

22:57 Re: PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
こんばんは、<br />取り急ぎレスポンスしますが、phpからhttpヘッダーでLast-Modifiedを明示的に返すようにしてみてはどうでしょう?
22:31 My interview at dot KDE - Henri Bergius »Planet PHP

Jos Poortvliet did an interview with me for dot KDE in this summer's aKademy and it has been online for a while now. In it we discuss things like Midgard as a storage engine for desktop applications, and Maemo's open QA process for Downloads applications. Some excepts:

At maemo.org we have an appstore for FOSS applications on the Maemo platform. This appstore is enabled by default on all Nokia N900s so we wanted to have some quality control. We had to create our own appstore approval process, compatible with the FOSS philosophy. Now any developer can submit an app, and anyone can test and vote. The whole process is completely transparent, auditable and visible. And it also provides a feedback channel from testers and users to the developers!

...

Midgard is a data storage service. Whether you write desktop or web applications, instead of coming up with your own file format, you just use Midgard. You can work more easily and object-based. Users have many different devices these days, so Midgard has strong replication features to synchronize between different systems. Midgard is built on top of GObject; we provide bindings to a bunch of different languages so developers can choose the tools they like - PHP, Python, Javascript. Currently (as in now, while we're talking) Qt bindings are being developed here at Akademy.

Read the whole interview.

22:05 AjaxRay.com: Extending Zend Form Element to create customized Phone number field »PHPDeveloper.org

On the AjaxRay.com site today there's a new tutorial for the Zend Framework users out there with a library they can use to extend Zend_Form for custom phone number fields.

When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. [...] Now, if we try provide this feature in Zend Form, that's possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle.

Instead of separate fields, the library they create makes it simple to handle them as a whole field. It works as a helper for Zend_Form and lets you set things like the separator between the text fields, a "format" string and a validator to apply to their fields (in the example code, it's the "digits" validator). Sample code is included to show you how it fits in your form.

20:39 9/4(土) 15:00-18:00 XOOPS九州ユーザー会 9月定例会開催 »XOOPS Cube公式サイト
19:21 Packt launches fifth annual Open Source Awards - Ken Guest »Planet PHP

Packt launches fifth annual Open Source Awards

The 2010 Open Source Awards was launched last month by Packt, inviting people to visit www.PacktPub.com and submit nominations for their favorite Open Source project. Now in its fifth year, the Award has been adapted from the established Open Source CMS Award with the wider aim of encouraging, supporting, recognizing and rewarding all Open Source projects.
WordPress won the 2009 Open Source Content Management System (CMS) Award in what was a very close contest with MODx and SilverStripe. While MODx was the first runner up, SilverStripe, a Most Promising CMS Award winner in 2008, made its way to the second runner up position in its first year in the Open Source CMS Award final.
The 2010 Award will feature a prize fund of $24,000 with several new categories introduced. While the Open Source CMS Award category will continue to recognize the best content management system, Packt is introducing categories for the Most Promising Open Source Project, Open Source E-Commerce Applications, Open Source JavaScript Libraries and Open Source Graphics Software. CMSes that won the Overall CMS Award in previous years will continue to compete against one another in the Hall of Fame CMS category.
These new categories will ensure that the Open Source Awards is the ultimate platform to recognise excellence within the community while supporting projects both new and old. “We believe that the adaption of the Award and the new categories will provide a new level of accessibility, with the Award recognizing a wider range of Open Source projects; both previous winners while at the same time, encouraging new projects” said Julian Copes, organizer of this year’s Awards.
Packt has opened up nominations for people to submit their favorite Open Source projects for each category at http://www.PacktPub.com/open-source-awards-home . The top five in each category will go through to the final, which begins in the last week of September. For more information on the categories, please visit Packt’s website http://www.PacktPub.com/blog/packt’s-2010-open-source-awards-announcement

18:10 PHPがCGIモードのサーバでもLast-Modifiedを取得するには? »日本PHPユーザ会 掲示板
sitemap.xmlやrss.xmlを自動で生成するWindowsにインストールするタイプのソフトを使っており、これを使い続けたい状況です。<br /><br />しかし、問題があって使えない状況になってしまいました。それを再び使える状態にしたいです。<br /><br />●Webサイトを.htmlではなく、.phpで制作<br />●共通部分を外部.phpファイル化しています<br />●上述のソフトで生成されたファイルを開くと、更新した日が一番上にくるはずなのにそうならず、<br /> よく見ると、全てのページの更新日時が同じになっている。<br /> これでは更新順にページが並ばず、まるでウソのRSSファイルになってしまう。<br /><br />●ソフトはWebサーバからでもローカルからでも更新日時を取得できるが、事情あってローカルはダメ。<br /><br />●Webサーバから取得しようとすると取得できない。<br /> Last-Modifiedで更新日時を取得しているソフトだそうだが、製作者いわく、サーバがモジュールモードならば.htaccessに一行追加するだけで再び使えるようになると。<br /> が、利用サーバはCGIモード。<br /><br />PHPがCGIモードのサーバでも、自動生成ソフトが再び使えるようになる方法が何かないでしょうか?<br />「トップページと同じ階層に○○と記述した.phpファイルをアップすればできるよ」<br />など、何か方策あると大変大変助かります。<br />プログラミングは全くの初心者ですが何卒宜しくお願い致します。
16:48 MOONGIFT : CodeIgniterベースのCMS「SiteManagr」 オープンソース・ソフトウェア/フリーウェアを毎日紹介 »はてなブックマーク - タグ「php」を含む注目エントリー
オープンソース・フリーウェアを毎日紹介するブログ。日々の業務の効率化、新しいサービスのネタ探しにどうぞ。SNS、SBS、CMS、オフィス、画像編集、ユーティリティ、Firefoxアドオン、テキストエディタ、ゲーム…ジャンルは様々。SiteManagrはPHP/CodeIgniter製のフリーウェア(ソースコードは公開されている)。最近はブログエンジンがCMSとして利用されることが多くなっている。そ...
16:48 Atkin »PHP Classes: Latest entries
Package:
Summary:
Find prime numbers with Sieve of Atkin algorithm
Groups:
Author:
Description:
This class can be used to find prime numbers with the Sieve of Atkin algorithm.

It can take a limit number and find all prime numbers smaller than the given limit.


16:48 Guitar Chord API class »PHP Classes: Latest entries
Package:
Summary:
Search for guitar chords using Guitar Chord API
Groups:
Author:
Description:
This class can be used to search for guitar chords using Guitar Chord API.

It can send HTTP request to the Guitar chord API Web server to find chord variations based on given data about chord by specifying the chord name, chord modification, or/and string/fret combination.


12:51 10 RSS parsers to create your own feed burner | Web Developer Juice »del.icio.us/popular/php
10:11 PHPプロ!Weekly PEAR リリース @ 10/09/02号 »PHPプロ!ニュース
PHPプロ!Weekly PEARリリースでは、前週からの1週間にリリースされたPEARパッケージを、毎週まとめてご紹介します。 本記事では、08月26日から09月02日までの間にリリースされたパッケージ一覧を掲載しています。
08:50 Extending Zend Form Element to create customized Phone number field - Let’s explore the web technologies together »del.icio.us/popular/php
04:52 Creating a Upload/Download System Using PHP Classes | TutToaster »del.icio.us/popular/php
03:41 Gonzalo Ayuso's Blog: Using CouchDb as filesystem with PHP »PHPDeveloper.org

In a new post to his blog Gonzalo Ayuso shows an interesting use for the CouchDB tool - using it as a filesystem for cross-server handling of things like images or other binary resources.

One of the problems I need to solve in my clustered PHP applications is where to store files. When I say files I'm not speaking about source code. I'm speaking about additional data files, such as download-able pdfs, logs, etc. Those files must be on every node of the cluster. [...] CouchDb has two great features to meet or requirements with this problem. It allows us to store files as attachments and it also allows to perform a great and very easy multi-master replica system.

He shows how use two libraries he's created to connect to the CouchDB instance and, based on this structure, be able to insert the content - a text file in this case - pull it back out, get the meta data about it and even move it to another location in the structure.

02:09 Web Builder Zone: The different kinds of testing »PHPDeveloper.org

On the Web Builder Zone (from DZone) Giorgio Sironi has posted a new article that talks about the different kinds of testing you can do on your application - both on the frontend and backend.

Automated testing supports your constant effort in design and refactoring, and besides that ensures that your application actually works in a reliable and repeatable way. [...] In this article I'll describe the different categories of testing, as applied to a Zend Framework 1 application, but this classification pertains to every web application based on object-oriented programming. Since this kind of applications is obviously PHP-based, PHPUnit will be the tool of choice along with some of its standard extensions.

He looks at five different types of testing you can do on your application:

  • Unit testing
  • Pragmatic unit testing
  • Functional testing
  • Integration testing
  • Acceptance testing

Not all of these can be done with PHPUnit on the backend, but they (mostly) have automated tools of their own like Selenium for frontend interface testing.

01:22 Zend Framework is a BOSSie Award Winner - Zend Developer Zone »Planet PHP
Last week, while I was on vacation, the news broke that IDG's InfoWorld had announced its annual InfoWorld Bossie Award winners ("Bossie" stands for "Best of Open Source Software"), and that Zend Framework had won the " best open source application development software " award.
01:16 Josh Holmes' Blog: Scaling WordPress on Microsoft »PHPDeveloper.org

Josh Holmes, just coming off of presenting at OpenCa.mp in Dallas, has posted his entire presentation to his blog for anyone that missed it and wants to catch up. He spoke about scaling WordPress on the Windows platform. He also includes a lot of content in the post that he wasn't able to get to during the presentation.

Now, on to my session itself. This was a fun session. I only had 30 minutes and I had about 3 hours of material so I've got a ton of stuff in these notes that I didn't cover in the session itself. The session is a take off a session that I did at MODxpo back in the spring. The talk itself is about 3-5 minutes of slides and the rest is all demos.

If you're looking for the actual slides, they're over on slideshare, but the real content - including the demos (and screenshots of them) are included. He talks about the Windows Platform Installer, the WinCache library and Windows Azure Data Storage.

00:50 メールアドレスのドメインのチェックはMXレコードだけじゃなくAレコードも見ないとダメ。 »はてなブックマーク - タグ「php」を含む注目エントリー
Web屋のネタ帳Webビジネスに必要な「戦略」「システム」「デザイン」の3要素とそれらをまとめる「マネジメント」について現場の実感と独自の観点でお送りするコラム・・・のはずなんですが、要するにWebがらみのシステム&デザイン業界に関する小ネタとツッコミの雑記です。ずいぶん前に、聞かれたことがあったので。とあるWebサービスのとある利用希望者が、「俺のメールアドレスは taro@hogehoge.e...
00:39 Tiki Receives Best of Open Source Software Ap »SourceForge.net: SF.net Project News: Tiki CMS/Groupware
Tiki Wiki CMS Groupware has been awarded a 2010 Bossie award (Best of Open Source Software) by InfoWorld, in the Applications category. InfoWorld's Best of Open Source Software Awards (aka the Bossies) is chosen annually by Test Center editors and reviewers, and recognize the best open source software for business users.
00:36 Speaking at PHPNW 2010 - John Mertic »Planet PHP

phpnw10 PHP Conference 09/10/2010I’m excited to announce I’ll be speaking at PHPNW Conference, to be held October 9th, 2010 in Manchester, UK. I’ll be doing my talk, “Developing Easily Deployable PHP Applications“, which I also did in July at OSCON. I’m working on making the talk even better based upon feedback I received, and will talk more about the various tools we use and have developed to make building SugarCRM easier.

This is my first time to this conference, but judging from the lineup of talks it is not one to miss if you are in the area. The lineup has several exciting talks about PHP development from some of the biggest names in PHP. You can register now at the conference website; early bird registration ends on September 4th.


2010-09-01(水)

23:21 PHPBuilder.com: Downloading and Parsing Gmail Messages in PHP »PHPDeveloper.org

New on PHPBuilder.com today there's a tutorial showing you how to download and parse messages from Google Mail. In their case it's grabbing and parsing submissions from a form.

Some friends of mine publish a literary journal that accepts submissions via email. At their request I wrote a script to download messages from the journal's Gmail account and do some simple parsing tasks. Most of the submissions are made using an HTML form and a corresponding mailer script on their website, so I knew the precise format of the incoming messages (see Figure 1). What I didn't know was how to access Gmail in PHP.

He tried out the libgmailer script first, but ran into roadblocks until he realized he could use something PHP already had - the imap functions. With these he shows how to make a connection to the Gmail servers, get the listing of messages and pull out the body for the one you want to parse.

22:49 Zend Developer Zone: Introduction to DataModeler »PHPDeveloper.org

On the Zend Developer Zone today there's the first part of a series from Vic Cherubini about an ORM tool he's created to make pulling data from your database of choice (via PDO objects) simpler - DataModler. This first part looks at creating testable models.

DataModeler allows you to create easily testable Models that are not dependent on any datasource. The majority of your logic should take place in the Model, and not the Controller (making your application even easier to test as data sources can be mocked). I try to keep my code as simple as possible, so DataModeler is fairly small.

He talks about how the DataModler tool uses dependency injection and how one primary namespace (DataModlerModel) contains the bulk of the code. He includes code samples showing how to create a simple mode, give the attributes data types and access them via magic "set" and "get" methods. For more information on this ORM tool, check out the latest source on github.

20:48 ウノウラボ Unoh Labs: アジャイルな開発をチームでやってみた(2010年版) - その2 »はてなブックマーク - タグ「php」を含む注目エントリー
テストコード書いてますか? HIROKIです。murahashiに続いて、テストファーストを導入してみての振り返りをします。まず、どうやってチームにテストファーストのスタイルを持ち込んだのか。1.テストが重要だという共通認識を持つ。前のプロジェクトではテストコードは、ほとんどありませんでした。その中で、開発になれていない人や新たに人が投入され、極少数ですが、デグレーションが起きました。その経験を元...
17:13 Contributing to ZendFramework - ThinkPHP /dev/blog - PHP »Planet PHP

... on contribution

Who hasn't ever started writing his own Framework/CMS? It is considered best practice for learning purposes, but going through all the security stuff can be stressful and boring at the same time. That's where most devs start to contribute to big Open Source-projects like Typo3 or the Zend Framework, because they are already experienced working with it and yet evolving another system on the market or even getting people to contribute seems like an unachievable task. Instead of wasting his time on yet another ACL implementation, the developer is taking part in making a software become even better, no matter if he delivers new features, reports / fixes bugs or works on documentation (another, yet an often underestimated part of contribution). It is also worth noting that every single Blog-entry and every HowTo thats put on the web also is a great deal of contribution that helps the software spreading. Beginners articles are important to put on the web since every one of us had it's beginnings and these are the sort of articles where many people decide to either use the software for a certain project or not.

As you might see, this article is not only a guide on contributing bugfixes, but also I want to motivate you to just give it a try.

... on Zend Framework

Having spent almost a year at the IRC support channel, I can tell they're really fun guys to hang around with. Of course, the Framework itself developed into a great piece of software. I do not want to discuss the up or downsides of a use-at-will framework, neither I want to recommend it over {put your favourite software here}. But what I can talk about is a little summary of the support channel's chatlogs. The widely annouced channel (which is #zftalk on Freenode) includes all kinds of concerns. One kind of people finds bugs, the other do have really clever ideas on improvements, but when you ask them to contribute its all the same: they either think it takes years to get into it, the others think they might be "not good enough for this". We sure won't force or threaten people to contribute, but what I can do is taking the fear out of it and demystify the thing, so later you might see that its actually just a few minutes to spend. Let me just loose a few words to the latter ones before we get into it: You can't destroy anything, and every idea of yours can also lead to a great improvement either realted to your concern or in a completely different area. We're glad that you take your time, even if you are completely new to ZF. Some beginners concerns already caused developers to write guides and articles that are still around and are linked at times in #zftalk...

... on contributing to Zend Framework

Contributing any code to ZF requires signing the CLA, which is an agreement that both you have the right to share any code you supply, and that you will not patent that code. This is to ensure that the frameworks codebase remains business friendly, and free to use for everyone. In fact you have to actually sign a paper, having done this you can just scan and mail or fax it. This is an important step, and none of your code will be used in any official package unless you did this.

The next step will be reading the coding & subversion standards. If you already had a look at actual ZF components code you should be familiar with the standards. Once you took a short insight (you probably wont be able to just remember all of this at once), you can check out the official SVN repository. Notice, that you, even having signed the CLA and being confirmed, do not have commit rights. So you might now ask yourself how to contribute then? All magic is taking place in the bugtracker, ZF's official Jira. All bug tickets, additions and improvements are filed as tickets here. So if you find a bug, report it here, and soon there will be a discussion in the comments section of a ticket.

Mostly all of these people, being listed by their reallife names, are also to be found on different names in the support channel, so feel free to ask them any ticket-related stuff.

The code itself will be submitted as a patch file (svn diff > patchFile), and uploaded in the Jira-Ticket. This might also be done by people who do have commit rights, but one might not be sure how to fix a problem, or any question might be left. This method of code management then leaves it to the original package developer to decide whether a change should be made or it should be thought over again (might have side effects on other packages and so on).

The last yet very important point is unit tests. ZF makes heavy use of th

Truncated by Planet PHP, read more at the original (another 1916 bytes)

16:52 ウノウラボ Unoh Labs: アジャイルな開発をチームでやってみた(2010年版) - その2 »はてなブックマーク - タグ「symfony」を含む注目エントリー
テストコード書いてますか? HIROKIです。murahashiに続いて、テストファーストを導入してみての振り返りをします。まず、どうやってチームにテストファーストのスタイルを持ち込んだのか。1.テストが重要だという共通認識を持つ。前のプロジェクトではテストコードは、ほとんどありませんでした。その中で、開発になれていない人や新たに人が投入され、極少数ですが、デグレーションが起きました。その経験を元...
16:52 symfonyセミナー動画無料公開! : アシアルブログ »はてなブックマーク - タグ「symfony」を含む注目エントリー
こんにちはアシアル・アピール担当の岡本雄樹です 最近、弊社の優秀なアルバイトが 私の席の後ろでsymfonyと格闘しているようです。 クラスの概念から勉強中なので苦労しているようですが、 親切な先輩社員が1から10まで教え込んでいるので、 将来が楽しみです。 symfonyと言えば、 先月開催した弊社テクニカルセミナー 「PHP×symfony」編の動画を、 今回特別に公開する運びとなりました。 ...
16:51 Beware of the default Apache 2 config for PHP - iBlog - Ilia Alshanetsky »del.icio.us/popular/php
16:51 Collecting Garbage: PHP's take on variables — Derick Rethans »del.icio.us/popular/php
16:51 F3: маленький PHP-фреймворк с огромными возможностями / Web-разработка / Хабрахабр »del.icio.us/popular/php
16:51 How to Roll Your Own JavaScript Compressor with PHP and the Closure Compiler »del.icio.us/popular/php
16:51 PHPBuilder.com, the best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more. »del.icio.us/popular/php
16:50 【2ch】コピペ情報局 : PHPが書けるだけで仕事に困ることはなくなるのに何故やらないのか »FC2ブックマーク タグ:PHPでの検索結果
16:50 PHPで実現できる@便利な小技系スニペット集 »FC2ブックマーク タグ:PHPでの検索結果
パスワードの生成や各種の計算などは、PHPプログラムでよく使われるものですが、それらの処理をお手軽に実装できるスニペットをご紹介します。http://www.catswhocode.com/blog/10-life-saving-php-snippetsスニペットとして使えるのは以下のコード。●フレーズ内でワードをハイライトさせる●FeedBurnerの購読者の平均を取る●パスワード生成●複数のCSSファイルを圧縮してひとつにする●TinyURLで、URLを短くする●誕生日か
16:47 PHP Xdebug のProfile の手軽な共有ツールを作ったよ »はてなブックマーク - タグ「php」を含む注目エントリー
お疲れ様です。sasaki-kです。毎日暑いですね。KLabではPHPで作られたフレームワークの高速化が熱いです。 高速化にあたっては、計測が重要です。KLabではphpのxdebug extensionを使用し、プロファイル結果をcachegrindファイル形式で取得しWinCacheGrind で解析しています。また皆でレビューするために Webgrind で解析結果を共有したり、言葉で説明し...
16:47 あなたのドロップボックスにアップロードが可能なPHPスクリプト:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
Allow Anyone To Upload Files To a Folder in Your Dropbox Account あなたのドロップボックスにアップロードが可能なPHPスクリプト。 ソフトをインストールしてフォルダに置いておくと自動で同期される超便利なDropBoxですが、PHPをつかってブラウザ上からアップロードをすることができるPHPスクリプトの紹介。 DropBoxが入っていな...
16:47 まるで何かのOSに搭載されているようなブラウザベースの高機能ファイルマネージャ「elFinder」:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
まるで何かのOSに搭載されているようなブラウザベースの高機能ファイルマネージャ「elFinder」2010年08月31日-elFinder - file manager for web まるで何かのOSに搭載されているようなブラウザベースの高機能ファイルマネージャ「elFinder」。 次のような左側にツリービュー、右側にファイル一覧のインタフェースをもち、ファイルはドラッグ&ドロップも出来たりす...
16:47 クライアントに頼まれやすい機能を補えるWordPressプラグインいろいろ - かちびと.net »はてなブックマーク - タグ「php」を含む注目エントリー
中小企業、店舗系のWeb制作が 個人的に最も多いので、そういった クライアントさんに頼まれやすい機能 を加えるWPプラグインのメモです。 大規模なWebサイトではまた別の需 要が出てくると思います。 羅列した全てのプラグインを入れる訳ではなく、「よく頼まれる機能」を補うプラグインをあげています。順不同。WP-Add-quicktag今更便利さに気がついた、という感じですが、最近よく使っています。基...
16:47 マイリスト 日本Ruby会議2010‐ニコニコ動画(9) »はてなブックマーク - タグ「php」を含む注目エントリー
推奨環境…OS:Windows XP, Vista, 7 & Mac OS X Leopard, Snow Leopard /ブラウザ:Internet Explorer, Firefox, Safari(Mac版のみ), 各最新版 /プラグイン:Adobe Flash Player 10以降 /その他:クッキー( cookie )制限をしている場合は nicovideo.jp を許可
16:47 CakePHPでトランザクション制御 | へびにっき »はてなブックマーク - タグ「php」を含む注目エントリー
環境: CakePHP 1.3CakePHPのModelクラスには直接トランザクションを制御するメソッドがない。そこで例えば次のようにAppModelにメソッドを定義する。class AppModel extends Model {function begin() {return $this->getDataSource()->begin($this);}function commit() {re...
16:47 CakePHPでフィクスチャに惑わされずにテストを書く方法 »はてなブックマーク - タグ「php」を含む注目エントリー
前回挙げたチュートリアルはやってみましたか? 快適なテストライフを送ってますか?テストケースをたくさん書いていると気づくのは、フィクスチャがメンテナンスの邪魔をするということ。 フィクスチャに初期データを定義すると、それを気にしながらテストケースを作ることになります。 これがとても面倒くさいんです。これを解消すべく、今日はモックを使ったテストケースの書き方を紹介します。モックとはSimpleTes...
16:47 ChromePHP »はてなブックマーク - タグ「php」を含む注目エントリー
InstallationDownload and install the extension from the Google Chrome Extension Gallery.Click the extension icon to enable logging for the current tab's domainDownload the ChromePhp class for logging ...
16:47 第11回LOCAL PHP部 勉強会 無事終了しました | ke-tai.org »はてなブックマーク - タグ「php」を含む注目エントリー
第11回LOCAL PHP部 勉強会 無事終了しました2010/8/30 月曜日 matsui Posted in PHP, お知らせ | No Comments » 先週8月28日に行われた第11回のLOCAL PHP部勉強会ですが、おかげさまで盛況のうちに無事終了することができました。なんと24名もの方にご参加いただくことができまして、かつ新規の方も多かったという、勉強会としては最高の形でした...
16:47 DreamweaverからCodaに変えました | Webクリエイターボックス »はてなブックマーク - タグ「php」を含む注目エントリー
Webサイトを制作する時のWebオーサリングツール・HTMLエディタは何を使用していますか?きっと多くの人がDreamweaverを使っていると思います。私もそうでした。が、最近私のまわりのWebデザイナーがみんなCodaというソフトを使っているのに気づき、試したところ、あまりにも使い勝手がいいので紹介します。本当におすすめです!Codaの特徴を簡単に詳しい説明はリンクをクリックでジャンプします。...
16:47 Excelの2007/2010バージョンも読み書きできるPHPエクステンション:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
PHP Excel Extension 0.8.6 - iBlog - Ilia Alshanetsky Excelの2007/2010バージョンも読み書きできるPHPエクステンションが公開されているっぽいです。 Extensionなので高速で動作し、さらに新しいバージョンのExcelも使えるということで試してみるとよいかも。 公開はGitHubにて行われています 関連エントリPHPExcelを使...
16:47 (またしても今更ですが)phpの「-i」オプションが便利だ! - IDEA*IDEA ~ 百式管理人のライフハックブログ »はてなブックマーク - タグ「php」を含む注目エントリー
「そんなの常識!」という人は華麗にスルーでお願いします系のエントリー(これ、なんか短い言い方できんかな・・・)。さて、phpのコマンドラインオプションで「-i」というのがあるのですが、これ、本当に便利ですね。何をしてくれるかというと、phpinfo()を実行したときと同等の結果を出力してくれます。これにgrepとかかければ「あー、あの設定どうなっていたかなー」というのがコマンドラインからさっとわか...
16:47 MySQLベースのデータ管理画面をWEB上で自動生成可能な「CRUD太郎」:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
CRUD太郎 - 管理画面自動生成 MySQLベースのデータ管理画面をWEB上で自動生成可能な「CRUD太郎」 まずWEB上で、Create分を入力してウィザードに従うとCakePHPベースのPHPコードがダウンロード可能です。 生成できる画面デザインもクールで、機能的にはデータの挿入、編集、削除などの機能があります。 実際に利用者に公開する部分に注力したい場合はこうしたツールで管理画面の作成作業...
16:47 pc.casey.jp » 2chのトリップをPHPで計算する »はてなブックマーク - タグ「php」を含む注目エントリー
2chのトリップをPHPで計算する投稿者: admin, カテゴリ: PHP, tags: CakePHP, Crypt, PHP, UTF-8 投稿日: 2010.08.17 - 14:08 更新日: (更新なし) 2chのトリップをPHPで計算する方法です。#に続いて文字列を入れると、暗号化された10桁もしくは12桁の文字列が算出されます。これをトリップといいます。このプログラムはそれを計算し...
16:47 PHPフロントエンドのコンソールロギング用Chrome拡張「ChromePHP」:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
ChromePHP PHPフロントエンドのコンソールロギング用Chrome拡張「ChromePHP」 インストールすると次のようなボタンが表示されます。 ChromePhp.php をダウンロードしてinclude ChromePhp::log('hello world'); のようにPHPコードを記述すればChromeのログ画面に次のように変数等を出力できます。 ツリーのおりたたみ機能なんかもつ...
16:47 Riding Rails: Rails 3.0: It's ready! »はてなブックマーク - タグ「php」を含む注目エントリー
Posted by David August 29, 2010 @ 06:28 PMRails 3.0 has been underway for a good two years, so it’s with immense pleasure that we can declare it’s finally here. We’ve brought the work of more than 1,6...
16:47 RubyKaigi2010スペシャルレポート:Ruby会議2010 1日目レポート[随時更新]|gihyo.jp … 技術評論社 »はてなブックマーク - タグ「php」を含む注目エントリー
RubyKaigi2010スペシャルレポートRuby会議2010 1日目レポート[随時更新]2010年8月27日KaigiFreaks レポート班, 赤松祐希, 大和田純, すがわらまさのり, 白土慧, 三村益隆,with 編集部RubyKaigi, Rubyこの記事を読むのに必要な時間:およそ 0.5 分本日8月27日(金)から29日(日)までの3日間にわたり,茨城県つくば市のつくば国際会議場に...
16:47 WordPressをバグトラッカーとして使うためのWordPressテーマ:phpspot開発日誌 »はてなブックマーク - タグ「php」を含む注目エントリー
Quality Control WordPress Theme ? Spencer Finnell WordPressをバグトラッカーとして使うためのWordPressテーマ. WordPressといえばご存知、ブログ発行プラットフォームなわけですが、その豊富な機能を利用してBugzillaのようなバグトラッカーとして使うためのテーマが公開されています。 オープンソースなソフトや、サイトのバグ報告...
16:47 WP地味ハック・functions.phpに数行加えるだけでプロフィールの項目にTwitterとか増やす方法 - かちびと.net »はてなブックマーク - タグ「php」を含む注目エントリー
需要があるのか分からないシリーズです。 マルチユーザーのブログで、プロフィールを 使ってるサイトなんかに使えるんじゃないか と思ってエントリー。プログインも使わず、 コアファイルも触らずにプロフィール項目を 増やす方法。 なんで書いたかというと、探して出てきた方法がコアファイル触る方法だったからというだけです。ちゃんと探せばちゃんと書いてるエントリーもありそうですがあまり探していないです・・出来れ...
16:47 Calculate age »PHP Classes: Latest entries
calculate age
Package:
Summary:
Calculate the age of a person given the birth date
Groups:
Author:
Description:
This class can be used to calculate the age of a person given the birth date.

It takes the birth date and computes the number of years, weeks and days that the person lived.


16:47 cjEvents »PHP Classes: Latest entries
Package:
Summary:
Handle browser events in PHP
Groups:
Author:
Description:
This package can be used to handle browser events in PHP.

It can register event handler callback functions that should be handled when certain events are triggered.

The main class takes requests to raise events and dispatch them by calling the registered event handler functions.

A specialized sub-class can decode JSON object parameters passed from JavaScript running on the browser to the event handler.


16:47 Haversine »PHP Classes: Latest entries
Package:
Summary:
Calculate the distance between Earth two points
Groups:
Author:
Description:
This class can be used to calculate the distance between Earth two points.

It takes the latitude and longitude coordinates of two points of the Earth and calculates the distance between them using the Haversine formula.

The distances may be returned in Kilometers, meters, miles, yards, feet or inches.


16:47 Image compare »PHP Classes: Latest entries
Package:
Summary:
Compare two images to find the differences
Groups:
Author:
Description:
This class can be used to compare two images to find the differences.

It takes two images and resize them to have 20 by 20 pixels to generate an array with the intensity of the color used in pixels of the resized image.

The class returns a value that evaluates the difference of the intensity of the pixels of the two images.


16:47 Pagination in PHP »PHP Classes: Latest entries
SortImg1
Package:
Summary:
Browse MySQL query results split in pages
Groups:
Author:
Description:
This package can be used to browse MySQL query results split in pages.

It can take a MySQL query and generates navigation links to browse to the different pages among which the listing of the query results will be split.


16:47 PHP Class Generator Bryan Version »PHP Classes: Latest entries
Package:
Summary:
Generate classes to manipulate MySQL table rows
Groups:
Author:
Description:
This package can be used to generate classes to manipulate MySQL table rows.

It is an enhanced version of the original package written by Marco Voegeli.

This version can also generate function for retrieving one row or all rows, serializing the object into a string, retrieve the count of row in the table. The update and delete functions were also updated.


16:47 PHP Vulnerability Scanner »PHP Classes: Latest entries
Package:
Summary:
Scan script files for malicious code
Groups:
Author:
Description:
This class can be used to scan script files to find eventually malicious code.

It can traverse a given directory recursively and checks script files to see if they may contain code that may be eventually malicious.

Currently it finds script files that are using functions often used in infected scripts, such as base64_encode and base64_decode.


16:47 Primage »PHP Classes: Latest entries
Package:
Summary:
Resize and add watermarks to images
Groups:
Author:
Description:
This class can be used to resize and add watermarks to images.

It can handle requests for GIF, JPEG or PNG images that need to be resized to match a certain size and need to have a watermark applied.


16:47 Probability distribution »PHP Classes: Latest entries
screenshot
Package:
Summary:
Create noise with Gaussian or Poisson distribution
Groups:
Author:
Description:
This package can be used to create noise with certain probability distributions.

It can generate sets of values with different with either uniform, Gaussian or Poisson distribution.

It can also apply the generated values at an input signal in input to simulate a noise.

An additional filter class can be used to recover the original by first applying a Fast Fourier Transform, the use high-pass or low-pass before recovering the signal using the reverse Fast Fourier Transform.


16:47 Web Shell Searcher »PHP Classes: Latest entries
Package:
Summary:
Search for words in files
Groups:
Author:
Description:
This class can be used to search for words in files.

It traverse a given directory recursively and search for files that have words from a list which may be read from a given file.

The class can restrict the search to files with a given file name extension and have full read and write permissions.


16:44 TwitterみたいなURL表示にしたい|ASTRODEO »はてなブックマーク - タグ「cakephp」を含む注目エントリー
twitterをやっている方はご存知だと思いますが、twitterでユーザーのプロフィールページに行くと、URLは↓こんな感じになっていますよね。http://twitter.com/ユーザー名(screen_name)CakePHPで開発をしている場合、普通は、ドメイン名の下にはコントローラー名が来ます。で、その下にはアクション名が来ます。だからあるコントローラーのあるアクションを呼び出せば、U...
16:44 CakePHPでトランザクション制御 | へびにっき »はてなブックマーク - タグ「cakephp」を含む注目エントリー
環境: CakePHP 1.3CakePHPのModelクラスには直接トランザクションを制御するメソッドがない。そこで例えば次のようにAppModelにメソッドを定義する。class AppModel extends Model {function begin() {return $this->getDataSource()->begin($this);}function commit() {re...
16:44 CakePHPでフィクスチャに惑わされずにテストを書く方法 »はてなブックマーク - タグ「cakephp」を含む注目エントリー
前回挙げたチュートリアルはやってみましたか? 快適なテストライフを送ってますか?テストケースをたくさん書いていると気づくのは、フィクスチャがメンテナンスの邪魔をするということ。 フィクスチャに初期データを定義すると、それを気にしながらテストケースを作ることになります。 これがとても面倒くさいんです。これを解消すべく、今日はモックを使ったテストケースの書き方を紹介します。モックとはSimpleTes...
16:44 CakePHPプラグインのまとめ – 検索とページネーション/ファイルアップロード編 »はてなブックマーク - タグ「cakephp」を含む注目エントリー
if ( $blog == " Webエンジニアのためのライフハック " ) { print " 1-byte.jp "; } ホーム1-byte.jpとは書いてるヒトは前回の”CakePHPプラグインのまとめ – 認証編“の続きです。 以下のページの”Searching and Pagination”と”File Uploading”の訳とメモを書いていきます。CakePHP Plugins –...
16:44 DEBUG=0でも、DB接続エラーを表示: CakePHP のおいしい食べ方 »はてなブックマーク - タグ「cakephp」を含む注目エントリー
CakePHPは、WEB開発用 PHP4/PHP5のRADフレームワークです。日々、発展を遂げる各種フレームワークの動向を見極めつつ、日本発のCakePHP応援ブログとして、最新情報をお届けします。DEBUG設定を0にしていても、MySQLが動作していなければエラーを表示させるには。 app_controller.php に下記のように書いてみました。 (1)まず、下記を class宣言"clas...
16:44 MySQLベースのデータ管理画面をWEB上で自動生成可能な「CRUD太郎」:phpspot開発日誌 »はてなブックマーク - タグ「cakephp」を含む注目エントリー
CRUD太郎 - 管理画面自動生成 MySQLベースのデータ管理画面をWEB上で自動生成可能な「CRUD太郎」 まずWEB上で、Create分を入力してウィザードに従うとCakePHPベースのPHPコードがダウンロード可能です。 生成できる画面デザインもクールで、機能的にはデータの挿入、編集、削除などの機能があります。 実際に利用者に公開する部分に注力したい場合はこうしたツールで管理画面の作成作業...
16:44 pc.casey.jp » 2chのトリップをPHPで計算する »はてなブックマーク - タグ「cakephp」を含む注目エントリー
2chのトリップをPHPで計算する投稿者: admin, カテゴリ: PHP, tags: CakePHP, Crypt, PHP, UTF-8 投稿日: 2010.08.17 - 14:08 更新日: (更新なし) 2chのトリップをPHPで計算する方法です。#に続いて文字列を入れると、暗号化された10桁もしくは12桁の文字列が算出されます。これをトリップといいます。このプログラムはそれを計算し...
07:00 Big step forward in Modular Database Applications with DataObjects - Alan Knowles »Planet PHP
Article originally from rooJSolutions blog
Being a Software Developer is all about developing applications faster, and delivering quicker. At the same time ensuring that quality is not lost and readibility is kept. DB_DataObjects is one of the key tools in my productivity toolkit. It was originally designed as a way of ensuring that shared database related code ends up in the right place, In the Model layer of the application, rather than the View or Controller (or worse mixed in to some hybrid PHP html garbage..), along with doing cool stuff like Query building etc.

Over the years, of using DataObjects, I've built up quite a library of reusable DataObjects, which to some degree can be plugged in to any project. A Person object that handles login/authentication and authorization (working with the Permissions and Group objects). A Image object that handles storage of Images, and Files that can provide File type conversion for rendering (using things like unoconv, etc.)

More recently, I've been using the Roo Javascript library as the UI component, the Pman Components ontop of the very lightweight html_FlexyFramework. The result is a very modular set of Application development parts. That can quickly be thrown together to build applications. Here's how they all fit together and how it just got a whole lot more modular and flexible...


05:31 Community News: Day Camp 4 Developers »PHPDeveloper.org

If you're a developer are are looking on a way to brush up on some of your "soft skills" in your career of choices, you should check out this day long camp being organized by Cal Evans - Day Camp 4 Developers.

Invest a Saturday in your career. Learn the skills you need from your five camp counselors. We promise no wallets or lanyards. This one-day, technology agnostic, online conference will feature 5 sessions in a single track. You participate in this live conference from the comfort of your own home or office. (or anywhere you have internet connectivity) In addition, you will be able to download all of the sessions after the conference for off-line review.

The event will last all day - seven hours on a Saturday - and can be accessed from anywhere you have a computer to run the GoToWebinar software. There's a cost of $35 USD for each attendee or $30 USD in groups of 10 or more. If you're interested check out the Day Camp 4 Developers site or just go on and register! You can see the schedule here.

04:27 Zend Developer Zone: Creating PDF Documents with Zend Framework »PHPDeveloper.org

On the Zend Developer Zone there's a new post by Vikram Vaswani about a method for creating PDF files directly from a Zend Framework application (hint: it uses Zend_Pdf).

PHP comes with a number of options to help developers dynamically generate PDF files from within their applications. The Haru and PDFlib extensions offer a complete API for dynamic PDF generation, and there also exist a number of open-source PHP components that can be used for the same purpose. This article will introduce you to one such component, the Zend_Pdf component that ships as part of the Zend Framework, and illustrate how it can be used to perform sophisticated PDF operations from within a PHP application.

The tutorial walks you through some of the introductory steps to using the component (outside of the framework) and create a sample PDF with some basic text. It gets more technical by adding in pictures, text wrapping, drawing lines and shapes, styling text and using things like the My_Pdf_Table feature to easily create tables. There's even a bit at the end about using the properties of the file to set things like title, subject and author.

03:44 Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 3 »PHPDeveloper.org

Kevin Schroeder has posted another excerpt from his "You Want to Do WHAT with PHP?" book to his blog today. This time it's from the third chapter that looks at character encodings like UTF-8 or ISO-8859-1.

I realized that while this 3.5-year PHP consultant knew Unicode, UTF-8, character encodings such as ISO-8859-1 or ISO-8859-7, I didn't understand them as well as I thought I had. With that I threw this chapter in the book. Knowing about character encoding is what many developers have. Not as many truly understand it. In this chapter I try to de-mystify character encoding as a whole.

The excerpt introduces character encoding and what it really is - a translation for the computer to be able to handle the human language. The problem comes in when multiple tools try to define the same sort of letters/chatacters in different ways. He gives an example of a "hello world" string in a normal ASCII format versus one from the EBCDIC format and how it would be rendered by an ASCII-understanding browser.

02:51 SitePoint PHP Blog: How to Roll Your Own JavaScript Compressor with PHP and the Closure Compiler »PHPDeveloper.org

On the SitePoint PHP blog today there's a quick new post showing you how to create a Javascript compressor tool with PHP that uses the Closure Compiler from Google.

In my previous post, I discussed the Closure Compiler's REST API. In this article, we'll develop a small PHP program that shows how the API can be used to compress JavaScript code whenever you need it.

He shows how to compress three "script" tags down into one that defines multiple files for the engine to grab and compress. This is passed into a PHP file that grabs the file and passes the data off to the Closure Compiler for handling (via curl). The result is then passed back and served up with a content type of "text/javascript" back to the browser.

02:08 phpMyFAQ 2.6.8 Released! »phpMyFAQ devBlog
The phpMyFAQ Team is pleased to announce phpMyFAQ 2.6.8, the “Laurent Fignon” release. We dropped the Oracle database support and added a new TinyMCE plugin for adding internal links by a suggest search. We also added a basic HTML5 powered administration backend and improved the setup and update functionality. The bundled TCPDF library was updated [...]
01:35 phpMyAdmin 3.3.7-rc1 and 2.11.11-rc1 released »SourceForge.net: SF.net Project News: phpMyAdmin
Welcome to the first release candidate for phpMyAdmin 3.3.7 and 2.11.11 which are bugfix versions.
01:03 Brian Swan's Blog: Managing Multiple PHP Versions with PHP Manager for IIS 7 »PHPDeveloper.org

In this new post to his blog Brian Swan talks about a tool that's been released by the IIS Team at Microsoft to make it even simpler to run multiple versions of PHP under IIS - the PHP Manager.

Not only does the PHP Manager make it a no-brainer to run different PHP versions side-by-side on IIS, it makes it easy to register PHP with IIS, configure various PHP settings, enable/disable PHP extensions, remotely manage PHP configuration via the php.ini file, and check the PHP runtime configuration and environment (i.e. see the output of phpinfo()).

Brian goes through a six step process to use this new tool to set up both PHP 5.2 and PHP 5.3 versions on an IIS server. It's as simple as installing the tool, registering new PHP versions and customizing the configurations. They'd love feedback on the tool so leave them comments here or report bugs here.

00:49 Derick Rethans' Blog: Collecting Garbage: PHP's take on variables »PHPDeveloper.org

Derick Rethans is republishing an article series he wrote (originally for php|architect) about the garbage collection that is included with the PHP 5.3 releases. He kicks off the series with this first post introducing internal variable handling.

Before we start with the intricate details of PHP's new GC engine I will explain why it is actually needed. This, combined with an introduction how PHP deals with variables in general is explained in this first part of the column. The second part will cover the solution and some notes on the GC mechanism itself, and the third part covers some implications of the GC mechanism, as well as some benchmarks. But now first on to the introduction.

He introduces the concept of a "zval" - the container PHP uses internally to handle variables (along with its "is_ref" and "refcount" to tell the interpreter if it's a reference or not). He also shows how these relate to the variables you set in your applications as well as a mention of the xdebug_debug_zval function of XDebug to show how it's handled behind the scenes. He also shows how references are handled with accompanying images to show the flow. If you'd like more information on variable handling, Derick points to this article for more detail.

00:23 The fine art of application virtualization - John Lim (PHP Everywhere - By John Lim) »Planet PHP

The new 8-core Intel Xeon 7550 processors are extremely powerful and a good platform for virtualised applications. My company is setting up PHP application running on a Xen based virtualisation on two HP Proliant DL580 for a total of 64 cores in a high availability environment. .

Why Virtualise?

First let's investigate why virtualisation is attractive. The advantages are:

  • Simplified maintenance, as all software is running on virtual machines (VMs). Easy to stop and start VMs from the VM server console.
  • High availability is easier to achieve, as you can just restart the VM on a secondary server if the primary server fails, assuming that the VM is stored in shared storage accessible by all servers, using shared storage methods such as NFS, iSCSI or a SAN (Storage Area Network).
  • Able to optimize server hardware utilisation globally as CPUs, memory, hard disk, network resources are all shared.

The disadvantages are strangely enough related to the advantages:

  • The maintenance is simplified, but the initial setup is more complex as not merely do you need to setup the hardware and the operating systems, but you have to plan out the virtual environment, such as the virtual network, and make sure that everything is properly sized as you are buying a few big machines, instead of lots of smaller servers.
  • High availability means you need to invest in high quality shared storage to store the shared VMs, typically a SAN, the SAN switches and the Fibre Channel HBA cards to connect to the SAN switches.
  • Need to over-configure the hardware as there is some overhead in virtualisation, particularly in terms of network I/O and storage I/O. CPU overhead for virtualisation is normally not a concern with modern virtualisation technologies such as VMWare, Xen, or Hyper-V.

In this case, our customer was comfortable with virtualisation, as they are big users of IBM AIX Logical Partitions and VMWare. Secondly, they already operate several large Storage Area Networks, and merely had to upgrade the SAN to support us. Lastly they had the budget to pay for all of this :)

VM Technology

We are using Zend Server CE (PHP 5.2), Apache 2.2 and Oracle 11gR2 running on Red Hat Linux 5.5 and Oracle VM 2.2 (which uses the Xen Hypervisor).

In the VM world, there are 4 main technologies that are popular:

  • VMWare - the market leader, this company has been doing virtualisation for over 10 years and they have good products.
  • Xen Based products - Xen is an open source technology that arose from some research on Hypervisors (the bare metal OS that controls all the virtual machines) done in Cambridge University. Today, several companies offer products using Xen, including Red Hat, Citrix, and Oracle. Has good support for Linux and Windows.
  • KVM - many kernel hackers were dissatisfied with Xen (because the Xen Hypervisor is not Linux-based internally), resulting in the development of KVM, which is fully Linux based. KVM is not as mature as Xen, but improving really fast. Support Linux and Windows.
  • Hyper-V - Microsoft's virtualisation technology. Microsoft is committed to supporting Linux also.

We chose Oracle VM (Xen) because it has good performance with Linux and Oracle databases (naturally). Oracle VM is free with optional paid support available. There are also licensing advantages to using Oracle VM with Oracle databases. Oracle database licensing dictates that if you are using virtualisation technologies such as VMWare and are purchasing CPU licenses, you still have to pay database licenses for all the CPU cores of the server, even if the database VM is using only 1 core. However if you are using Oracle VM, then you only have to pay for the CPU cores you use using; this is known as "hard-partition" licensing in Oracle terminology.

I also have experience with VMWare, and can recommend it as an mature alternative. Apparently the Citrix Xen Server is a good product, but I don't have experience with it.

I will cover more technical details in part 2, which i will be writing in September after I complete this installation.

2010-08-31(火)

23:49 PHPプロ!Weekly PECL リリース @ 10/08/31号 »PHPプロ!ニュース
PHPプロ!Weekly PECLリリースでは、前週からの1週間にリリースされたPECLパッケージを、毎週まとめてご紹介します。 本記事では、08月24日から08月31日までの間にリリースされたパッケージ一覧を掲載しています。
23:38 Ilia Alshanetsky's Blog: Beware of the default Apache 2 config for PHP »PHPDeveloper.org

Ilia Alshanetsky has a suggestion for those setting up PHP and Apache2 for the first time - beware of the default configuration!

About a week ago, I was doing some upgrades on my development machine and came across a rather nasty issue when it comes to how .php(s) files are associated with PHP in Apache. It seems that a number of distros including Gentoo (which is what I was using) are using the [same] configuration directive to make the PHP module parse PHP files

The problem comes from their use of "AddHandler" versus "AddType" when telling Apache which files to parse as PHP. The first allows anything with ".php" in its filename to be parsed while the second limits it to just files ending in ".php". Check your configuration to ensure you're not open to this issue, especially if there's scripts/files outside of your control.

22:11 Wouter Lagerweij's Blog: Reading Up: Books Every Programmer Should Read »PHPDeveloper.org

Wouter Lagerweij has posted a list of books he thinks every programmer should read to help them get a better handle on their process overall (they apply to any language out there, really).

When discussing books on software engineering with colleagues, I got the idea of listing the best books I've read in the past 15 years. Because it seems useful, but also because that will allow others to tell me which ones I should have read.

He lists five books that cover some of the "meta" about programming:

21:03 Community News: Latest PECL Releases for 08.31.2010 »PHPDeveloper.org
17:23 Collecting Garbage: PHP's take on variables - Derick Rethans »Planet PHP

Collecting Garbage: PHP's take on variables

This is the first part of three-parts column that was originally published in the April 2009 issues of php|architect.


In this three part column I will explain the merits of the new Garbage Collection (also known as GC) mechanism that is part of PHP 5.3. Before we start with the intricate details of PHP's new GC engine I will explain why it is actually needed. This, combined with an introduction how PHP deals with variables in general is explained in this first part of the column. The second part will cover the solution and some notes on the GC mechanism itself, and the third part covers some implications of the GC mechanism, as well as some benchmarks. But now first on to the introduction.

PHP stores variables in containers called a "zval". A zval container contains besides the variable's type and value, also two additional bits of information. The first one is called "is_ref" and contains a boolean value whether this variable is part of a "reference set". With this bit PHP's engine knows how to differentiate between normal variables, and references. However, PHP has user-land references—as created by the & operator, but also an internal reference counting mechanism to optimize memory usage. The second piece of additional information, called "refcount", contains how many variables names—also called symbols—point to this one zval container. All symbols are stored in a symbol table, of which there is one per scope. There is a scope for the main script (ie, the one requested through the browser), as well as for every function or method.

A zval container is created when a new variable is created with a constant value, such as:

$a = "new string";

In this case the new symbol name "a" is created in the current scope, and a new variable container is created with type "string", value "new string". The "is_ref" bit is by default set to "false" because no user-land reference has been created. The "refcount" is set to "1" as there is only one symbol that makes use if this variable container. Also, if the "refcount" is "1", "is_ref" is always "false". If you have Xdebug installed you can display this information by calling:

xdebug_debug_zval('a');

which displays:

a: (refcount=1, is_ref=0)='new string'

Assigning this variable to another variable name, increases the refcount:

$a = "new string";
$b = $a;
xdebug_debug_zval( 'a' );

which displays:

a: (refcount=2, is_ref=0)='new string'

The refcount is "2" here, because the same variable container is linked with both "a" and "b". PHP is smart enough not to copy the actual variable container when it is not necessary. Variable containers get destroyed when the "refcount" reaches zero. The "refcount" gets decreased by one for each symbol linked to the variable container leaves the scope (f.e. if the function ends) or when unset() is called on a symbol. The following example shows that:

$a = "new string";
$c = $b = $a;
xdebug_debug_zval( 'a' );
unset( $b, $c );
xdebug_debug_zval( 'a' );

which displays:

a: (refcount=3, is_ref=0)='new string'
a: (refcount=1, is_ref=0)='new string'

If we now call "unset( $a );" the variable container, including the type and value will be removed from memory.

Things get a tad more complex with compound types such as arrays and objects. Instead of a scalar value, arrays and objects store their properties in a symbol table of their own. This means that the following example creates three zval containers:

$a = array( 'meaning' => 'life', 'number' => 42 );
xdebug_debug_zval( 'a' );

which displays (after formatting):

a: (refcount=1, is_ref=0)=array (
        'meaning' => (refcount=1, is_ref=0)='life',
        'number' => (refcount=1, is_ref=0)=42
)

Graphically, it looks like:

gc-part1-figure1.png

You can see the three zval containers here: "a", "meaning" and "number". Similar rules apply for increasing and decreasing "refcounts". Below we add another element to the array, and set it's value to the contains of an already existing element:

$a = array( 'meaning' => 'life', 'number' => 4

Truncated by Planet PHP, read more at the original (another 4743 bytes)

16:21 How to Roll Your Own JavaScript Compressor with PHP and the Closure Compiler - SitePoint » PHP »Planet PHP

In my previous post, I discussed the Closure Compiler’s REST API. In this article, we’ll develop a small PHP program that shows how the API can be used to compress JavaScript code whenever you need it.

Why write your own system?

You’ll find that several free tools handle this task; one of the first PHP JavaScript compressors was written by Ed Eliot. Sometimes, however, they require technologies you don’t use — such as Java — or may not cater for internal workflow processes, including:

  • distributing uncompressed JavaScript to developer PCs
  • integration with source control systems
  • automating your build, and so on
Important: This is not production-level code!

The code below implements a rudimentary JavaScript compressor in PHP to illustrate the basics. The code calls the Closure Compiler compression API every time a request is made, so it’s likely to be slower than multiple uncompressed JavaScript files. You should add your own functions to handle caching to a file or database.

The html

Assume you normally include the following script tags at the bottom of your html:

<script src="script/file1.js"></script>
<script src="script/file2.js"></script>
<script src="script/file3.js"></script>

We’ll replace this block with a single script tag that references all three files.
The .js is removed and the file names are separated with an ampersand:

<script src="script/?file1&file2&file3">
</script>

The PHP

We now require an index.php file within our script folder. The first code block transforms the GET parameters into an array (file1, file2, file3) and initializes the variables:

<?php
// fetch JavaScript files to compress
$jsfiles = array_keys($_GET);

$js = '';		// code to compress
$jscomp = '';	        // compressed JS
$err = '';	        // error string

We now loop through the JS files, read the content, and append it to the $js string. If a file is unable to be found or read, its name is appended to the $err string:

// fetch JavaScript files
for ($i = 0, $j = count($jsfiles); $i < $j; $i++) 
{
  $fn = $jsfiles[$i] . '.js';
  $jscode = @file_get_contents($fn);
  if ($jscode !== false) {
    $js .= $jscode . "\n";
  }
  else {
    $err .= $fn . '; ';
  }
}

If any files are missing, we can generate a JavaScript alert to inform the developer:

if ($err != '') {
  // error: missing files
  $jscomp = "alert('The following JavaScript files 
could not be read:\\n$err');";
}

If there are no errors and we have some JavaScript code, we can proceed with the compression. The $apiArgs array contains a list of Closure Compiler API options — you can add, remove, or modify these as necessary. The arguments are encoded and appended to the $args string:

else if ($js != '') {
  // REST API arguments
  $apiArgs = array(
    'compilation_level'=>'ADVANCED_OPTIMIZATIONS',
    'output_format' => 'text',
    'output_info' => 'compiled_code'
   );
   $args = 'js_code=' . urlencode($js);
   foreach ($apiArgs as $key => $value) {
     $args .= '&' . $key .'='. urlencode($value);
   }

We can now call the Closure Compiler API using PHP’s cURL library. The compressed JavaScript is returned to the $jscomp string:

  // API call using cURL
  $call = curl_init();
  curl_setopt_array($call, array(
    CURLOPT_URL => 
'http://closure-compiler.appspot.com/compile',
    CURLOPT_POST => 1,
    CURLOPT_POSTFIELDS => $args,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_HEADER => 0,
    CURLOPT_FOLLOWLOCATION => 0
  ));
  $jscomp = curl_exec($call);
  curl_close($call);

Finally, we return our compressed code to the browser with the appropriate MIME type:

}
// output content 
header('Content-type: text/javascript'); 
echo $jscomp; 
?> 

Download the Code

Save yourself some typing and

Truncated by Planet PHP, read more at the original (another 3132 bytes)

15:52 [PHP]interactive shellでviモードを使う »Do You PHP はてな
そうか。PHPのinteractive shellってreadline使ってるから、 $ echo "set editing-mode vi" >> ~/.inputrc でOKだ。これでカーソル移動も履歴もviっぽくできるし、bashもviモードになりますね。 On-line Manual of ”readline” Readline の起動ファイル ちなみに、PostgreSQLのフロントエンドであるpsqlコマンドでも、同様にviモードが使えます。
12:52 [Firefox][twitter]Twitkit+を諦めてYoonoをインストールした »Do You PHP はてな
ついにTwitterアプリの認証方式がOAuthになりますが、愛用しているTwitkit+のOAuth対応が間に合いそうにない雰囲気(コード中には断片があります)なので、Twitkit+を諦めてYoonoをインストールしてみました。 Yoono - Twitter Facebook MySpace LinkedIn Flickr - Share and Download Youtube videos 全体的な雰囲気は、以下の記事で。目的としては『Twitkit+の代替』ということで、ちょっとオーバ ...
04:46 NerdMom Blog: Kohana 3 & CodeIgniter 2 »PHPDeveloper.org

On the NerdMom blog there's a recent post from Jen about her experiences in developing in both the CodeIgniter 2 framework and Kohana 3 frameworks (upcoming versions of both).

For the last month or so I've been developing an app side-by-side with Kohana 3 and CodeIgniter 2 to see which framework fits my programming style better. Nothing terribly fancy; just a simple CMS. [...] In the end it comes down to framework stability for me. And in this case, CI wins, hands down. Don't get me wrong; Kohana is beautifully written and introduced me to a prime example of clean, well commented code.

She talks about some of what she was needing out of a framework and what ultimately lead her to pick CodeIgniter 2 as the tool for her and her development. She notes that, while Kohana is nicely written, they've had some consistency issues with backwards compatibility that have caused issues. She also mentions some of the unstable code that was added just to micro-optimize things when it wasn't needed.

03:52 Beware of the default Apache 2 config for PHP - Ilia Alshanetsky »Planet PHP
About a week ago, I was doing some upgrades on my development machine and came across a rather nasty issue when it comes to how .php(s) files are associated with PHP in Apache. It seems that a number of distros including Gentoo (which is what I was using) are using the following configuration directive to make the PHP module parse PHP files:

<IfModule mod_mime.c>
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</IfModule>


The non-obvious problem with the above is that it will allow not only "file.php" to be treated as PHP scripts, but also "file.php.txt", which means that any file containing ".php" in its name, no matter where in the filename, would be treated as a PHP script. This of course creates a rather nasty security hole, since many upload file validation tools, only check the final extension. Consequently allowing the user to by-pass the validation, by simply prefixing another "harmless" extension like .txt, .pdf, etc... to the filename, but still get the code to execute.

To mitigate this problem you should instead use the following configuration, that would only pick-up of files ending with a .php extension.


<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>


The difference between the two configurations being that the original uses AddHandler (bad) and the latter uses AddType (good).
01:30 PHP Manager for IIS 7 – beta release - Ruslan Yakushev »Planet PHP

Today I am releasing PHP Manager for IIS 7 – beta, which is an IIS extension for setting up and managing multiple PHP installations on IIS 7 servers. It can be used to:

  • Register PHP with IIS;
  • Run multiple PHP versions side by side;
  • Check PHP runtime configuration and environment (output of phpinfo() function)
  • Configure various PHP settings
  • Enable or disable PHP extensions
  • Remotely manage PHP configuration in php.ini fille

The PHP Manager installation packages can be downloaded from these locations:

The project’s home page and documentation are located at http://phpmanager.codeplex.com/. This blog post describes how the PHP Manager for IIS can be used.

Installation

From the Downloads page select the installation package that is appropriate for your target machine. Download and run the installer, which will install and register PHP Manager’s binaries with IIS. Note that only IIS versions 7.0 and above are supported. After installation is complete, launch the IIS Manager and find the “PHP Manager” feature:

When opened, the “PHP Manager” feature provides a configuration overview for the PHP installation that is registered with IIS and is currently active. If no PHP is registered with IIS, then the only action that can be performed is the registration of a new PHP version.

Registering PHP with IIS

To register a new PHP version with IIS, first you need to download the zip archive with PHP binaries from http://windows.php.net/ and then extract the files from it into a folder of your choice. Note that you can also install PHP by using Web Platform Installer or the Windows installer from http://windows.php.net/ – the PHP Manager can be used to manage those PHP installations as well.

Click on “Register new PHP version” task and then provide the full path to the location of the main php executable file: php-cgi.exe:

After clicking OK the new PHP version will be registered with IIS and will become active. This means that all the sites on this IIS server by default will use this PHP version.

Switching between PHP versions

After multiple PHP versions have been registered with IIS, you can use PHP Manager to easily switch between the versions on a server and site level. This means that you can configure some IIS sites to use one PHP version, while other sites use different version.

Checking phpinfo() output

phpinfo() function in PHP provides very detailed information about all aspects of PHP runtime configuration. To check the phpinfo() output from within PHP Manager use the “Check phpinfo()” task.

Configuring Error Reporting

You can use PHP Manager to configure error reporting level in PHP. If IIS is used on a development machine then you may want to use verbose error reporting in order to see all the errors, warnings and notices from your PHP application right away. If IIS is used as a production server, then error reporting level is less verbose and errors are logged in a log file, but never communicated to HTTP client.

Truncated by Planet PHP, read more at the original (another 2028 bytes)

2010-08-30(月)

23:06 phpAutoindex 1.1.1 released »SourceForge.net: SF.net Project News: phpAutoindex
phpAutoindex 1.1.1 was released today addressing an issue that prevented it from displaying anything useful in PHP 5.3.
22:21 TikiFest New York: Countdown to Tiki 6 »SourceForge.net: SF.net Project News: Tiki CMS/Groupware
Members of the Tiki Community, including developers, end-users, advocates, will be meeting in the Big Apple from October 3-6, 2010. This TikiFest will be the last major gathering before the release of Tiki 6.
22:07 mysqlにて日付を検索する方法として »Q&A掲示板
こんばんわ。ご質問させていただきます。 環境としては、PHP5+MySQLにて稼動しています。 SELECT * FROM テーブル名   WHERE カラムA    BETWEEN DATE_FORMAT( DATE_ADD(カラムA, interval -10 day), '%Y-%m-%d' ) AND '$day'; あるカラムに入力されている日付にて検索をかけているのですが、 どうにかうまくデータを抽出してくれません。 例えば、カラムAに 2010-08-30 2010-08-31 2010-09-01 2010-09-02 とデータが入ってたとすると、 2010-08-31が抽出されないなどなど、、 DATE_FORMATにて日付を整理せずに、 date("Y-m-d", strtotime("+10 day")) にて整理してやるとうまく動くのでデータの値は間違っていないかと思います。 DATE_FORMATにてデータを整理するのはあまりよろしくないのでしょうか? お教えいただければ幸いです。
22:00 Creating PDF Documents with Zend Framework - Zend Developer Zone »Planet PHP
PHP comes with a number of options to help developers dynamically generate PDF files from within their applications. The Haru and PDF lib extensions offer a complete API for dynamic PDF generation, and there also exist a number of open-source PHP components that can be used for the same purpose. This article will introduce you to one such component, the Zend_Pdf component that ships as part of the Zend Framework, and illustrate how it can be used to perform sophisticated PDF operations from within a PHP application.
17:18 JSClasses, JSMag, PHP Alpha 1, PHP strict typing, IndieConf - Lately in PHP podcast episode 4 - PHP Classes »Planet PHP
By Manuel Lemos
On this episode of the Lately in PHP podcast, Manuel Lemos and Ernani Joppert interview Michael Kimsal from the WebDev publishing company.

They talked about JSClasses, the just launched PHPClasses brother site for JavaScript components.

They also commented on the OpenID based single sign-on system that was implemented to reuse PHPClasses accounts on the JSClasses site to avoid making current PHPClasses users to creating new accounts on the JSClasses site.

It was also discussed about the latest developments for the eventual PHP 5.4 Alpha 1 version, such as the support type hinting of scalar arguments versus strict typing.

Also covered are some initiatives of Michael's company, the JSMag JavaScript magazine (promotion coupon included) and IndieConf, a conference for independent Web professionals.
17:04 virtualfields使用時の sort »CakePHP Users in Japan
こんにちわ。
cakephp1.3 の virtualfieldsについて教えて下さい。

■今回の目的
試験を受けたユーザーが多い順にsortしたい

■DB設定
hideblog_users テーブル として id , name (1対)
hideblog_shikens テーブル として id...
06:30 A week of symfony #191 (23->29 August 2010) »symfony project weblog

Symfony2 added this week the new ControllerInterface and BaseController classes. The profiler was refactored and the web development toolbar was temporally removed (it will be included in the upcoming WebProfilerBundle). Lastly, the exception management was refactored once more and the event listeners added a new priority parameter.

Development mailing list

Development highlights

Symfony 1.X branch:

  • r30773: [1.3, 1.4] added missing processing of event

Symfony 2.X branch:

  • 1277568: [HttpFoundation] fixed Session
  • 0319838: [TwigBundle] added a flash tag
  • fe78d5f: added a way to disable the profiler
  • 9c07e46: [FrameworkBundle] added ControllerInterface. A Controller must now implement ControllerInterface. The BaseController can be used as the base class for Controllers. The Controller class adds some proxy methods and an array access to the Container.
  • 789a02d: [FrameworkBundle] and made it call Session::get
  • ec8500b: [FrameworkBundle] added support for previous exceptions in the exception pages
  • 3c42e0b: [FrameworkBundle] changed the default value of ignore_errors according to the current debug value
  • b1e7996: [DependencyInjection] moved extension loading in the freezing process (opens more possibilities in the loading order of configs)
  • a432417: [DependencyInjection] added a way to ignore errors when importing a non-existent file (useful when you want to include an optional service file)
  • bf67562: [Templating] fixed PHP renderer when using a template variable named 'template'
  • 69f9d9c: [DoctrineMongoDBBundle] added logger and data collector for WDT
  • 0867080: [HttpFoundation] added a keys() method to *Bag classes
  • 1d7f43e: [Framework] added logs when some listeners are not called because the event has already been processed
  • 82ff790: added a priority to the event dispatcher listeners
  • 57db35b: made ExceptionManager independent of the Request
  • 92f4b92: [HttpFoundation] fixed Session serialization
  • c78528a: [FrameworkBundle] added abbrClass() and abbrMethod() helpers
  • eeb0742: [Framework] added a way to retrieve called and not-called events for a given dispatcher
  • 83a64df: added ContainerAwareInterface
  • eb66e0d: [FrameworkBundle] made exception controller embeddable
  • 72db4c7: refactored Profiler and DataCollector classes (the WDT has been removed and will be re-added in the upcoming WebProfilerBundle)
  • 0208800: refactored exception management (removed the ExceptionManager)

sfDoctrinePlugin:

  • r30774: [1.3, 1.4] changed lingering Doctrine calls to Doctrine_Core in admin generator

...and many other changes

Development digest: 51 changesets, 11 bugs reported, 28 bugs fixed, 4 enhancements suggested, 12 enhancements closed, 7 documentation defects reported, 2 documentation defects fixed, and 12 documentation edits.

Documentation

New symfony bloggers

Plugins

  • Updated plugins
    • lyMediaManagerPlugin: refactored lyMediaAsset and added some unit tests, refactored lyMediaFolder, fixed wrong rounding to integer of asset file size value
    • csDoctrineActAsSortablePlugin: fixed fetchOne for large Collections
    • csDoctrineActAsGeolocatablePlugin: fixed incorrect error message in geolocatable template
    • sfAssetsLibraryPlugin: fixed some small issues in helper and routing, improved README, fixed some issues with sfWidgetFormAssetInput
    • ddOnlineStorePlugin: the fixtures files now are .sample files, is_featured field added to all products
    • sfFormExtraPlugin: added support for sfWidgetFormDateTime in sfWidgetFormJQueryDate, fixed JS function names when the widget name contains '-', fixed sfWidgetFormJQueryDate doesn't restrict values on page load, fixed sfWidgetFormJQueryDate doesn't refresh disabled after the date was chosen from calendar, updated the autocomplete JavaScript to the latest version, added culture and theme options for sfWidgetFormReCaptcha, fixed widget for sfFormLanguage, allowed unassociated list to be left of the associated one
    • sfDatgridPlugin: clear also hidden in jquery reset search
    • sfTaskLoggerPlugin: fixed bug with logger when the task is launched in a web context: need to disconnect from dispatcher to avoid symfony to try to write in the closed file
    • sfPropel15Plugin: fixed plugin package template (remember to modify the package generated by the plugin:package task to remove the vendor/propel-generator/pear/build-pear-package.xml file, since it makes PEAR go nuts when trying to install the package)
    • ahDoctrineEasyEmbeddedRelationsPlugin: added newFormUnsetPrimaryKeys optional parameter (this allows you to embedded forms to not unset their primary keys, this is useful in composite key situations)
    • sfAdminDashPlugin: updated translations
    • diemProject:
      • fixed permission name in dmWidget/editRecords security
      • swap assets in asynchronous rendering of widget
    • apostrophePlugin:
      • added more a_include_js_calls() invocations to AJAX actions which don't get it automatically
      • fixed aMediaCMSSlotsTools had a redundant and buggy implementation of aMediaTools::userHasUploadPrivilege()
      • the repair-tree task has been overhauled (all variants of the task now use PDO to avoid running out of memory on big page trees)
      • the repair-tree task has been overhauled (all variants of the task now use PDO to avoid running out of memory on big page trees)
      • added javascript to hide the template dropdown if your page type is not template-based
      • navigation component can now accept its active and root parameters as aPage objects
      • removed assumptions about routes
      • removed second instance of history browser from global tools
      • refactored big chunks of inline js to the apostrophe object and a_js_call
      • updated the edit categories funcitonality in the media lib sidebar to use a_js
      • the versions info array is now a flat array for JS compatibility
      • aDoctrineRoute and aRoute can no longer require an additional query to be made when using the engine-slug parameter
    • apostropheBlogPlugin:
      • backed out engineSlug in blog plugin
      • fixed count query used for blog category admin
      • changed link_to to use named route in blogCategoryAdmin
      • fixed a bug that was causing the categories listing in the page settings engine dropddown to not be alaphabetical
      • added first pass at a calendar for events
      • removed obsolete tasks that just lead to confusion
      • fixed i18n: apostropheBlogPlugin should use the apostrophe catalog just like the main plugin does
      • added some more functionality to the calendar so you can click on a day, month or year and begin browsing that way
      • fixed calendar for showSuccess and changed the getDay getMonth getYear for events to use the StartDate instead of the Pub Date
      • removed the addStylesheets and addJavascripts calls from the assets partial
      • moved the app.yml check for whether or not the calendar is enabled up into the action
  • New symfony powered websites

    • Billigt Grin: (Danish) a danish booking agency for upcoming stand-up comedians
    • Kvartirka.bg: (Bulgarian) find appartments for rent in Bulgaria
    • PressBulgaria.com: (Bulgarian) send press release to all medias in Bulgaria

    They talked about us


    style="margin-bottom: 5px">
    Be trained by symfony experts - Sep 07 Online - Sep 22 Paris - Oct 05 Online - Oct 20 Paris - Nov 24 Paris

    2010-08-29(日)

    23:17 UseBB 1.0.10 RSS feeds security issue »SourceForge.net: SF.net Project News: UseBB
    Very recently, a security issue has been discovered in UseBB 1.0.10 with per forum and topic RSS feeds in combination with restricted forum access permissions.