WordPress the_excerpt Plugin

Posted on October 21, 2008

Recently, I was looking for a solution for extracting post text by defining the length of the string. WordPress offers two useful functions: the_content(): returns the full content of a post the_excerpt(): returns a fixed extracted text from a post, but no parameter option is provided. The idea is to write a better function that [...]

Posted in PHP Leave a comment

mySQL: Error 1045

Posted on August 16, 2008

If you get this error (in phpMyAdmin or other operation) after setting up a MySQL password: ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: NO) This might caused by phpMyAdmin’s configuration doesn’t have the new password. If using XAMPP, you need to update the /Applications/xampp/xamppfiles/phpmyadmin/config.inc.php for the phpMyAdmin: $cfg['Servers'][$i]['password'] = ‘YOURPASSWORD’; Change the YOURPASSWORD [...]

Type-Safe Objects in PHP

Posted on May 23, 2008

Symfony and Ruby on Rail

Posted on April 15, 2008

研究过PHP下的Symfony, 再看Ruby on Rail的时候, 发现两者都有不少的相似性. 首先他们都用到MVC的架构设计整个项目, 作为Web Application来说, 这样可以将class library, layout view, handler清清楚楚的分开,有助于多人开发,和日常维护。 如果比较过两者library的结构,他们也有相近之处。 从创建项目到编辑项目设置等等。 比如, 创建项目时, 他们都会创建一系列的文件夹和默认文件, 然后可以自己创建module, 都有位置防止plugins。做数据库的时候,也可以用.xml 或者.yml导出 Sql store procedures. 那到底哪个比较好一些。 这里有一边文章对比一些MVC frameworks的性能, 不足的是, Bench mark只不过是一个参照, 完全不能说明其他的情况, 比如error handling的性能, 每个framework都有各自的优化设置, symfony deployment的时候就有优化的设置. 在Google doc上到有一片比较全面的文章比较Rail和Django, 对与一个新的项目选择framework有一定的帮助.