Monday, June 30, 2008

IDE for CakePHP (OS X)

Hi to all!

Can you help me to make choice between: TextMate & NetBeans?

As I saw, it's tow nice IDE for developing in PHP (for Mac). But TextMate cost some money, and NB - weight like 91 Mb...

What better? Help me to select ;-)

How about autocomplite? Help (for class-function, and browsing through lib?)

Labels: ,

Sunday, June 29, 2008

jQuery ft Prototype

It's really hard to choice. Easy (to me ;) in developing and understanding jQuery as AJAX/javascript framework. Or hard (as for me) but native Prototype.

When I wrote my own function in AJAX/JS I use jQuery (of course). But when you'll start using AJAX with standart pagination (for example) - easy to use - prototype with ajax.helper....

Now I seat and thinking about: may be start to study Prototype? Or start to write jquery.helper?  ;-)

Labels: , , ,

Saturday, June 28, 2008

Cake 1.2 RC2

My congratulations to all community! ;-)

I very glad to use CakePHP ;) And I hope, that RC2 haven't bugs, and work faster than RC1 ;-)

Labels:

Wednesday, June 25, 2008

Empty & old Cake

Hi, pals!

I have one old project with cake 1.1. And, suddenly, I start to get a lot of "empty" message.

So, it's look like this:

site.com/ads/add

Model have (all field) -> VALID_NOT_EMPTY

In controller, before $this->Ad->save() I made this:

trim(...)
strip_tags(...)
And, even, I wrote:

if ($this->data['Field'] == '') die;

But... But after one-two day I can found in DB records with empty fields. ;(

Of couse, I trying to add record with empty fields an cann't do it. Cake work fine, and return me to /ads/add with error "Field cannot be empty"

But fields empty. I don't know, how spammers do it, but he do it fine ;-(

After week of a lot attempts to fight with this I start use function afterSave ;-)

So

afterSave

$id = $this->Model->GetId();
$data = $this->Model->read(null,$id);
if ($data['Field'] == '') -> $this->Model->del($id)

After this I got only useful record in database.

But, of couse, this decision is not so beauty ;-(

If you know HOW this spammers do it - I'll be very happy if you tell me

(Yes, I look apache logs and don't found anything strange)

Labels: , ,

Thursday, June 05, 2008

Bug in posts_tags table

If you read my previous article about strange bugs in posts_tag table, you must to know, I found "error", and now all work stable.

In Mysql table posts_tag, you must add column id (BIGINT, unique, autoincrease)
So, at least you had:

id BIGINT +
post_id
tag_id

And, if you editing any posts (clearing tag, for example) - other posts don't clear in this table.

Alliluja! ;-)

Labels: ,