DooPHP - fastest MVC based PHP framework

Learn More

The Official Blog of DooPHP

News, Updates, Tips & Tricks for DooPHP

Subscribe to Blog

Subscribe to the official blog of DooPHP framework.

DooPHP version 1.2 is released!2009-09-01 16:21:20

DooPHP version 1.2 is released!

DooPHP version 1.2 is released! It now comes with better ORM tools and data validation along with code generation to make things easier!

The benchmark comparison of using the original Doo::db() and the new DooModel.

Doophp v1.1 benchmark

Doophp v1.1 benchmark

Noticeable New Features in v1.2:

  • Enhanced Database ORM for shorter and more elegant code. Your current model classes can extend DooModel for addon ORM functionailities.
  • Smart Model Cache (DooSmartModel) for automated data model cache management. It is a smarter version of DooModel. Cache can be stored as file based, php vars, APC, XCache, Memcache, EAccelerator.
  • Form/Model Validation for data validation before saving/creating/deleting DB records. Validation rules can be generated with the Model generator.
  • Better Native PHP template support for those who do not use the template engine. Read the API doc for DooView.
  • And several bug fixes plus enhancements.

View the complete features and changes in the CHANGELOG file in the latest source.

Go ahead and download the new framework source.

See DooPHP database demo's MainController::test() and the API doc for DooModel for example usage of the enhanced ORM tools.


Published under: News & Updates Share/Save/Bookmark

DooPHP Version 1.1 Released!2009-08-24 14:08:58

DooPHP Version 1.1 Released!

DooPHP version 1.1 is released! It now comes with a more complete list of features. Another great thing to be mentioned is that the performance in this version has improved too!

The benchmark comparison of v1.0 and v1.1

Doophp v1.1 benchmark

The benchmarked source code and environment is the same as the previous benchmark tested with Kohana framework.

Noticeable New Features in v1.1:

  • Access Control List(ACL) as built-in authentication support.
  • Data caching which supports APC, Memcache, XCache, EAccelerator & file based cache.
  • Sophisticated Frontend cache mechanism where both full page(single/recurvise) & partial page cache are supported.
  • Database replication (master-slave) support in the ORM tools
  • Better conventional modular directory structure support.
  • Auto loading of the framework classes.
  • IF statement and Cache tag support for template engine.
  • Enhanced model class generator. PostgreSQL supported.
  • Image manipulation helper for resize, crop, watermark, upload, etc.
  • Pager component for item list pagination.
  • Text helper class for string manipulation.
  • Url builder class to generates URLs based on route ID or controller & method names
  • Log/Profile viewer tool.
  • Sitemap Generator tool to generate routes and controller files.

View the complete features and changes in the CHANGELOG file in the latest source.

Go ahead and download the new framework source. New demos and tools are added in to help you get started even easier now.


Published under: News & Updates Share/Save/Bookmark

Database Replication (Master-slave) Support in DooPHP2009-08-21 03:41:25

Database Replication (Master-slave) Support in DooPHP

Database replication support is added in DooPHP.

Most simple frameworks/application have no separation of Reads and Writes of the DB. Once the projects outgrow a single server RDBMS the next step is often to do a Master/Slave setup in MySQL.

In a Master/Slave setup expensive and less frequent writes are channeled to the Master server while reads are channelled to the Slave server.

In DooPHP, we simplifies thing to merely just define the Slave server configurations in db.conf.php

You need to call Doo::useDbReplicate() in the bootstrap index.php, and that's all!

The query stuffs remain the same.

To setup:

//This will serve as the Master
$dbconfig['dev'] = array('localhost', 'db', 'root', '1234', 'mysql',true);

//slave with the same info as master
$dbconfig['slave'] = array('192.168.1.1', '192.168.1.2', '192.168.1.3');

//OR ...
//slave with different info, use a string if it's same as the master info.
$dbconfig['slave'] = 
	array(
	   array('192.168.1.1', 'db', 'dairy', '668dj0', 'mysql',true),
	   array('192.168.1.2', 'db', 'yuhus', 'gu34k2', 'mysql',true),
	   array('192.168.1.3', 'db', 'lily', '84ju2a', 'mysql',true),
	   '192.168.1.4'
    );

In index.php just add a line Doo::useDbReplicate() before setting up the DB.

Doo::useDbReplicate();
Doo::db()->setMap($dbmap);
Doo::db()->setDb($dbconfig, $config['APP_MODE']);

Published under: Tips & Tricks Share/Save/Bookmark

Using DooPHP on Nginx Rewrite Rule2009-08-12 03:10:36

Using DooPHP on Nginx Rewrite Rule

For those who are using DooPHP with Nginx and wanted to have clean URLs without the index.php, here's my settings for the rewrite rules. I hope it works for you.

      location ~ \.php {     
         fastcgi_pass  127.0.0.1:9000;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;
         fastcgi_param PATH_INFO $fastcgi_script_name;
         access_log off;
      }
      
      location /doophp_svn/app/ {
         index  index.php;
         if (!-e $request_filename){
            rewrite (.*) /doophp_svn/app/index.php/$1;
         }
      }

It can be access via:

http://localhost/doophp_svn/app/
http://localhost/doophp_svn/app/index.php
http://localhost/doophp_svn/app/allurl
http://localhost/doophp_svn/app/index.php/allurl

Also, remember to change the configs in the demos for them to work properly. Do change the SITE_PATH, BASE_PATH, SUBFOLDER and APP_URL.

If you have a better solution, do post it in the Tips & Tricks forum


Published under: Tips & Tricks Share/Save/Bookmark

Guide on Controller Added2009-08-08 03:43:22

Guide on Controller Added

A new page is added to the guide section. It explains the basics of using Controller class in DooPHP.

Read more at http://doophp.com/doc/guide/basic/controller

At the same time, translation of the guide documentation in Chinese is available thanks to kntism in the forum. You can read the translated documentation at PeeHP

DooPHP is now 3 weeks old! Good news is the official website has an Alexa traffic ranking at 324,673!

Stay tuned for the next release (coming soon!).


Published under: News & Updates Share/Save/Bookmark

About

Categories

Archives


Syndication