CakeAMFPhp installation steps

Tháng Mười 30, 2008

1. Download cakeamfphp at cakefore project website, I use CakeAMFPHP.0.6.0.

2. Download Cakephp1.2.x at CakePHP website

3. Extract cakeamfphp and cakephp 

4. Copy

                      /cakeamfphp/webroot/* => ../app/webroot/

                      /cakeamfphp/venders/* => ../app/venders/

                      /cakeamfphp/views/* => ../app/views/

5. Edit app/webroot/amfbrowser/config.inc.php, at line 75

Replace:

loadController (null);

By

App::import(‘Controller’, null);

App::import(‘Controller’, ‘App’);

6. Edit app/webroot/cake_gateway.php, at line 75

Replace

require CORE_PATH.’cake’.DS.’bootstrap.php’; 
loadController (null);   
vendor(‘cakeamfphp’.DS.’amf-core’.DS.’app’.DS.”CakeGateway”);  

to 

require CORE_PATH.’cake’.DS.’bootstrap.php’; 
App::import(‘Controller’, null); 
App::import(‘Controller’, ‘App’); 
require_once( CORE_PATH . ‘vendors’ . DS . ‘cakeamfphp’.DS.’amf-core’.DS.’app’.DS. ‘CakeGateway.php’); 

7. Edit app/vendors/cakeamfphp/amf-core/app/CakeActions.php, at line 195

Replace 

$controller->_initComponents(); 

By 

$controller->Component->init($controller); 

8. Edit app/vendors/cakeamfphp/amf-core/app/CakeGateway, at line 25

Replace:

vendor(‘cakeamfphp’.DS.’amf-core’.DS.’app’.DS.’Gateway’); 
vendor(‘cakeamfphp’.DS.’amf-core’.DS.’app’.DS.’CakeActions’);

by

require_once(APP.’vendors’.DS.’cakeamfphp’.DS.’amf-core’.DS.’app’.DS.’Gateway.php’); 
require_once(APP.’vendors’.DS.’cakeamfphp’.DS.’amf-core’.DS.’app’.DS.’CakeActions.php’); 

Let’s join in CakePHP with AMF

 

 

 




CakePHP, Prototype & Json

Tháng Mười 7, 2008

In my recent blog, I’ve presented a development model, frameworks and tools for scalable, high performance systems as social networks. CakePhp, Prototype & Json are three tools that we must learn fisrt. In this blog, I would note some steps to use CakePHP, Prototype and Json together.

1. Download and install CakePHP 1.2x (I installed and run well in Slackware 12.0)

1.1 Download CakePHP 1.2x (Example: cake_1.2.0.7692-rc3.tar.gz

# wget http://cakeforge.org/frs/download.php/671/cake_1.2.0.7692-rc3.tar.gz

1.2 Extract and move to /www/ folder

# tar -zxf cake_1.2.0.7692-rc3.tar.gz

# mv cake_1.2.0.7692-rc3 /www/cake_1.2.0.7692-rc3

1.3 Modify /etc/httpd/httpd.conf

1.3.1. Enable mod_rewrite (just remove comment – uncomment)

LoadModule rewrite_module /lib/httpd/modules/mod_rewrite.so

1.3.2. Re-configure DirectoryRoot 

DocumentRoot “/www/cake_1.2.0.7692-rc3/”

1.3.3.  Add DirectoryIndex (index.php index.htm index.html) and modify AllowOverride ( All ) params to tag <Directoy> of “/www/cake_1.2.0.7692-rc3/”

<Directory “/www/cake_1.2.0.7692-rc3/”>

    DirectoryIndex index.php index.htm index.html

    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

1.3.4 Restart your apache

# cd /etc/rc.d/

# rc.httpd restart

1.4 Configure cakephp database, modify …/app/config/database.php

var $default = array(

‘driver’ => ‘mysql’,

‘persistent’ => false,

‘host’ => ‘yourservername_or_ip’,

‘login’ => ‘db_username’,

‘password’ => ‘db_password,

‘database’ => ‘db_name’,

‘prefix’ => ”);

You also can define more than one database, but you should define those with names are not ‘default’. 

1.5. chmod and chown cakephp ../app/tmp folder

chmod 775 -R /www/cake_1.2.0.7692-rc3/app/tmp

chown -R your_apache_account /www/cake_1.2.0.7692-rc3/app/tmp

Now, http://localhost/ is showing your cakePHP page (You should have break then go to the 2nd step)

2. Intergrate Json to CakePHP

3. Download Prototype and use with CakePHP

4. Sample

To be continous …


Mô hình hệ thống và công cụ !

Tháng Mười 6, 2008

Từ khi dùng CakePHP, tôi gần như sang một trang mới về hướng phát triển sản phẩm. Khác xưa khá nhiều, tạm bỏ .NET, C# và các công nghệ của Microsoft, tôi chuyển hướng sang phát triển những sản phẩm hệ thống mạng cộng đồng có thể cung cấp dịch vụ cho cả hàng triệu người dùng, hàng tỷ lượt truy cập và visit mỗi ngày. Đó không phải là ước mơ, đó là kế hoạch và tôi đã có những giải pháp và đường hướng đi cho chính tôi, cho những sản phẩm mà tôi sẽ phát triển. Bước đầu chuyển hướng gặp nhất nhiều bỡ ngỡ. CakePHP giúp tôi những bước làm quen đơn giản, cho tôi một nền tảng để xây dựng những kế hoạch tương lai gần.

Một hướng phát triển trong thời gian đây mà tôi quan tâm đến, khá theo định hướng của ông lớn Google, mô hình hệ thống phân tán dịch vụ đa thành phần. Tôi tạm đặt tên là như vậy. Ajax là một công nghệ, kết hợp với mô hình trên quả thực là thành bộ đôi không gì tốt hơn. Trước đây, khi định dạng dữ liệu XML giữa client-server và ngược lại được những người phát triển Ajax sử dụng rất phổ biến, nhưng từ khi xuất hiện Json, XML dần trở thành dĩ vãng bới thua kém về sự nhanh-gọn-rẻ trong sử dụng. Và từ khi Prototype hỗ trợ Json, tôi thậm chí còn không còn nghĩ đến XML nữa. Công nghệ thật thay đổi nhanh chóng.

Thật là may mắn, qua mấy buổi cafe với bạn, google tài liệu và cả đống sách tính bằng GB trong máy, mô hình phân tán dịch vụ đa thành phần là cốt lõi, là định hướng; CakePHP, Json và Prototype là những công cụ để tôi xây dựng hệ thống cho các sản phẩm sắp tới của mình. Tôi sẽ có những bài báo chi tiết hơn cách xây dựng, cấu hình hệ thống để những công cụ này làm việc với nhau thật hiệu quả và áp dụng mô hình hệ thống phân tán dịch vụ đa thành phần vào xây dựng hệ thống của riêng bạn như thế nào !!! Hãy đón đọc trong các kì sau

 

To be continuous …