Wednesday, July 30, 2008

CakePHP 1.1 is dead now

If you are new user of CakePHP, forget about CakePHP 1.1 (stable). Learn CakePHP 1.2. 

Yes, it's just RC2, but very useful, nice working and stable ;-)

CakePHP going to past... So long, pal...

Labels: , ,

Thursday, July 17, 2008

Zyxel, MacBook & WiFi troubles

As you know, I'm a happy owner a Apple Macbook. Also, for home mobile development ;-) I get Zyxel 660HTW2EE (ADSL modem + router + WiFi).

But my happy wasn't long ;-(

MacBook drop WiFi connection every 30-60 minutes (when WPA2-PSK). Or drop connect and Zyxel make could restart (!). And I have 3-5 minutes without Internet, without network (terrible! ;-)

When I'm switching into WPA-PSK mode, I get stable connection, Zyxel hasn't restarting. But speed is so slow ;-( max - 110KB/sec (It's 802.11g mode!) Terrible..

After reading a lot of forum/blog and manuals I switch off any WPA, and setup MAC-Filter for my MacBook. Now I have stable connect. STable working of Zyxel, stable Wifi in MacBook.

You may ask me - why you don't by AirPort from Apple? 

I have answer ;-) 
Because AirPort doesn't have ADSL modem ;-( Yep. In my region we using ADSL internet. still... 

So, If you happy from your Zyxel & MacBook - switch off any WPA/WPA2 coding, setup Mac Filter and have fun with WiFi Internet on  your notebook...

Labels: , , , , , ,

Monday, July 14, 2008

Great thing : bindModel

At present moment a have a lot of free time for self improvement and I can learn CakePHP deeper and deeper, as it possible ;-)

In one of my project I have two table with simple relation

Division (id, title) - hasMany Staff
Staff (id, division_id, name, jobtitle..)

So. Now I need to get some info like: I need to get all Staff where birthday today, and get result like:
Array (
   [0] => ["Division"] = Array ...
         => ["Staff"] = [0]
  [1] ...

But I don't want (or cann't) rewrite model fore staff/division. So, What I must doing?

Of cause I must to use this wonderful thing - bindModel ;-)


$this->Division->bindModel(array("hasMany" => array ("Staff" => array (
"conditions" => array ("MONTH (birthday) = " . $month, "DAY (birthday) = " . $day),
"fields" => array (","),
"order" => array("" => "ASC")))));
$staff = $this->Division->find("all");

Also, we can put in field "fields" something like this
"fields" => array ("COUNT ( as count")

And we have array with Division and numbers (count of staff with correct birthday)

Simple? yep. And in good cakephp tradition ;-)

Labels: , , ,

Thursday, July 10, 2008

MAMP & cake (terminal)

YESS! I did it! ;-)

1. sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
2. And 1 hour looking for bug, and found mistake in database.php

After some experiments I put host =>
And forget about it ;-)
Now all cool -> host -> localhost
And my cake bash baker work fine

I am happy! I am like unixman ;-))))

Labels: , , ,

Hm. Cake 1.2RC2 & baker

It's very strange, but I cann't use this cake baker under MacOS ;-(

If I starting terminal cake (from pack dmg) I can read only help and resume: Process completed. And could not put any symbol

If I starting terminal, and go to my site directory and run:

bash cake bake

I can create "skeleton" of my web application in directory myapp. Now cake not want to use this subdir and I'm moving files into /cake/console/..

After this I type: bash cake bake
& setup database.php setup. Of couse, I know - this file has not mistakes (Yep, I'm copy database.php into site/app/config/ and read this "Cake is able to connect to database". So - My database setup is nice, and MySQL server work properly.

So. I returning into cake/console, and run bash cake bake - for creating model. But, after I choose database config "default" (yep My database config is really calling default) I get 3 warning about impossible to connect to database throw sockets and get finally message about "database haven't any tables" but this is wrong! I have tables.

And of cause, I'm using MAMP

Where is mistake? I don't know ;-(

Labels: , , , ,

Tuesday, July 08, 2008

Cake...dmg & .htaccess

After my switching into MacOS I'm start to use cakephp.dmg with latest version of this wonderful framework. But I found some troubles with use this image (dmg).

When MacOS mount cake.dmg you can drag & copy content of framework into your project. Easy? Of cause! But you cann't drag .htaccess from the root of the cakephp. 

May be it's a stupid problem, and after setup finder folder view you can move even invisible files, but I don't know how to made this. After all I'm install muCommander and copying this .htaccess file from mu. How to make this copy more easy?

Yes, .htaccess from /app/ & /app/webroot - copying to project without any problem.

Labels: , , ,

Unix hosting

My pal (pal by ICQ ;-) broken mind about simple problem...


On localhost all work nice. Stable and fine. (Windows)

After uploading to unix hosting my pal get some troubles with error "Model not found", "Controller not found" etc...

But, of couse, file posts_controller.php, post.php are present in bot copies of site.

Decision: unix-style hosting known file Post.php and file post.php - it's really different file. Not same. 

So, if both copies of your site identical - don't forget to check filename uppercase & lowcase ;-)

Labels: , , ,

Thursday, July 03, 2008

4 July

Independence Day! My congratulations to all citizens of USA ;-)

In this day, please, be careful with UFO! As I know, only 4 july a lot of dangerous aliens attack USA and Earth!

Don't look at sky! Don't speak with unknown aliens! Don't enter in UFO!


Labels: , ,

Wednesday, July 02, 2008

Textmate vs CakePHP

Yes, I'm really happy with Textmate ;-)

After reading article "CakePHP for TextMate" I get SVN (universal pack), install SVN, then going and get CakePHP Bundle. And now, I can comfortable use tab triggers with CakePHP ;-)

I don't use TextMate before, and et current time I don't understand, how to made autocomplited with function? I read manual, look at video-tutorial and don't know how ;-)

May be after 1-2 days I found easiest way to use this useful function, and write here.

Netbeans - go to trash, you really monster for me (but good soft, of cause ;-)

Labels: , ,


I don't know it is my last word about IDE for CakePHP. But at present time I think - TextMate is best choice ;-)

Labels: ,

Tuesday, July 01, 2008

To be continue...

I had 4 comments at my last post about selecting IDE for CakePHP ;-)

So. I trying:


I not unix-man, and I have really problem with installing CakePHP Bundles for TextMate (strange SVN etc... ;)) I think I must start to learn this aspect of IT, for better productivity ;-)

Really, I buy MacBook after 4 month of thinking about ;-) And my choice mac, because it's natural Drag-n-Drop & natural unix shell.... I have no problem with drag-drop, but have really problem with unix part of this beautiful OS.

Thanks a lot, pal! And, I hope, I made right choice ;-)

Labels: , ,