memcache.php is now part of pecl/memcache

June 3rd, 2008 by Harun Yayli | 2 Comments »

I’m very happy to announce that memcache.php is commited to the CVS of pecl/memcache. Woot woot!

I’ll be maintaining the code through the time as well. Hope you guys/gals find it useful.

PS: I’m planning to add more functionality to the memcache.php in the coming days. Candidates:

  • Delete/Expire a cached value
  • Move stuff from server to server

Let me know if you have any other ideas.

memcache.php goes PECL

June 2nd, 2008 by Harun Yayli | 2 Comments »

After the suggestion by Lukas, I’ve contacted PECL/memcache authors Antony Dovgal and Mikael Johansson. Mikael sent me a reply accepting my submission.
I’m looking forward to the day that memcache.php will appear in the pecl/memcache distribution.
I’ll keep you posted.

Update on memcache.php:

  • Small bug fixed on parsing the bucket Ids.
  • Distribution license is now PHP license.

memcache.php stats like apc.php

May 21st, 2008 by Harun Yayli | 13 Comments »

For a long time I was looking for a nice web interface like the apc.php (comes with the apc’s source) that displays whole nine yards of stats. The only good tool is memcache-tool from the danga guys. It’s quite complete but I guess I’m too lazy to go on the command line.

Anyways, I decided to rip write my own. Totally based on the original apc.php (I even recycled some functions) and apart from completeness, here is a memcache.php that you can get stats and dump from multiple memcache servers.
Here is a screenshot:
Read more…

oci_bind_by_name maxlength is not so optional

May 6th, 2008 by Harun Yayli | 2 Comments »

If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.
Lets say you have your column names in an array already and you want to bind them in a loop smartly.
Read more…

Is Sun going to buy PHP too?(PHP Quebec 2008)

March 14th, 2008 by Harun Yayli | 5 Comments »

It was good 2 days at PHP Quebec Conf here in Montreal.

A lot of great sessions!!!!
My highlights:
- Great session by Eli White - High Performance PHP & MySQL.
- Really nice 2 sessions by Marc Wandschneider (The I18N and memcached sessions)
Some sessions I’ve attended were really really bad. I’m not going to name names :P
But overall, I guess it was worth taking 2 days from work and going to the php conf.

Here is the part about Sun and PHP:
Read more…

PHP APC apc_shm_create error on CLI

March 11th, 2008 by Harun Yayli | 1 Comment »

If you’re getting an error like this one below on Windows PHP commandline make sure that you are not running an apache server that uses apc on the same machine!

[apc-error] apc_shm_create: shmget(0, 8388608, 658) failed: No error. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment.

This was hard to figure! Tested with PHP 5.2.5, APC 3.1.0-dev.

Facebook’s Buggy Spam Detection

February 29th, 2008 by Harun Yayli | No Comments »

Oh my! I’ve heard people getting kicked out of Facebook because they were sending too much messages and facebook considered them as spamming.
One last thing is added to the pile. Now they are claiming the reader of a message is spamming people.
Oh boy, it is funny.
I’ve logged into Facebook and saw I’ve received a message. I clicked the message and boom! There is a red box saying I’m spamming people with messages and I’ll be blocked soon if I continue this.
Wait a minute! I’m not the one writing the message I’m reading it.
So as a responsible geek, I’ve send a message to Facebook and here is the result:

From: Facebook ([edited])
To: [edited]
Subject: Messages Help: bug in spam detection

Hello,
I clicked on the inbox to see a message that is coming to me. I clicked the message to read it (t=[edited])
I’ve received a box saying, I’m spamming.
You’re algo is buggy. I’m not sending messages, I’m reading a spam.
FYI

Answer:

Facebook Support [edited] wrote:
Hi Harun,

We are aware of the problem that you described and hope to resolve it as soon as possible. Sorry for any inconvenience. Let me know if you have any further questions.

Thanks for contacting Facebook,
James
User Operations
Facebook

Well at least they know that somebody made a booboo. Or not?

Test your PHP Facebook. I’m sure you have bugs in detecting the spam as well.

Is it Firefox or Zend Debugger? Cookie Standards

February 20th, 2008 by Harun Yayli | No Comments »

I’m frequently using Zend Debugger and recenlty it started not working with firefox so I decided to investigate. It still works with IE7 and Opera so it was weird to see Firefox being broken with the recent update (2.0.0.12).

When Zend Debugger starts, it sets a cookie on the browser, so when the request passes through the Debugger, it’s caught. Simple enough.

See the cookie that is set by Zend Debugger:
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/ ZendDebuggerCookie=192.168.33.87%2C127.0.0.1%3A10000%3A0||084|77742D65|0; path=/ SESSdd12cedd715988d11c29f14605e8aa57=rfem27em2jsn3l9ipusujaava2; path=/; domain=.127.0.0.1
Nothing looks weird to me…
But when firefox does a second request it returns only the cookies below:

Cookie: ZDEDebuggerPresent=php,phtml,php3; SESSdd12cedd715988d11c29f14605e8aa57=rfem27em2jsn3l9ipusujaava2

What happened to ZendDebuggerCookie? The little firefox ate it?
Plain weird.

ezComponents ready for prod?

February 11th, 2008 by Harun Yayli | 2 Comments »

I’m following what ezComponents doing for sometime now.
Quite nice framework for whatever you need.
I gave a try to write a mysql schema sync.
Real easy to write. only 4-5 lines of code to sync schemas.
It would have been great if it was actually working. The outout sql ddl is not runnable in some cases (syntax errors). Or the order of the columns are different.
I’m sure they’ll fix it soon but this tells me they are not yet ready for production quality.

See the code below, maybe I’m doing something wrong.
Read more…

You Used PHP to Write WHAT?!

February 1st, 2008 by Harun Yayli | 5 Comments »

There is an article on PHP on CIO, bashing it a bit.

PHP may be the most popular Web scripting language in the world. But despite a large collection of nails, not every tool is a hammer. So when should it be used, and when would another dynamic programming language be a better choice? We identify its strengths and weaknesses.

For the ones, who doesn’t know about CIO, their target audience is managerial. not developers.
So potentially reader will be your manager and they’ll get this info as a reference.
I’m copy/pasting some parts of it for your convenience. Let’s assume your manager does not know about PHP (I hope not) and you’re about to convince him/her to use PHP on a project. What whould he/she think after reading this?

When should you use PHP?

  • Creating an intranet site.
  • Prototyping an application that will be converted to Java or some other language.
  • Creating a Web database application.
  • Deploying an inexpensive or quick solution.
  • Using ready-made apps from Sourceforge.net or other sites.

In general you should not use PHP:

  • Where data security is of high importance.
  • In Shell or automated scripted applications.
  • In enterprise applications where scalability takes higher precedence than economy.

What a short sight!?!? Kenneth Hess the author of the article, is also the new “On The Desktop” columnist for Linux Magazine. Honestly, I would not really expect these claims from Ken Hess.

Please share your comment.

Link: You Used PHP to Write WHAT?!