Category Archives: PHP

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.

Becareful the heredoc!

today , i was spent half hour to find a bug, it said , Parse error: syntax error, unexpected ‘]’, expecting T_STRING or T_VARIABLE or T_NUM_STRING in xx line, i check that lline all words , on by … Continue reading

Posted in PHP | Tagged | Leave a comment

Simple is hard

这两天看了看Rasmus(PHP作者)的一个讲座,关于Scalability、Performance 、 Security ,比较了一些PHP Framework的性能,对于Python, RoR 等语言也有一些评论,还有一些Profiling 和 Benchmarking 工具,自己需要在这一方面加强了,以前都根本没有概念,简单的一个时区的设置在php.ini里都会有影响,include_path的设置等。 Tools for PHP debug and profiling 1. apd ( Zend extension) sudo pear install pear/apd 2. xdebug 3. apc sudo pear install apc extension=apc.so (added it to php.ini) 4. xdebugtoolkit A toolkit for analyzing and visualizing xdebug cachegrind files

http://code.google.com/p/xdebugtoolkit/

5.cg2dot … Continue reading

Posted in PHP | Leave a comment

Back on the joomlaconsole development

After a short kind of vacation, i back and working on the Joomla console development, hope I can release it before the new year (2010.1.1) .hurry up !!!

Posted in Joomla | Tagged | Leave a comment

Fixed the Joomla Plugin Error

I have created a Joomla website with Joomfish & Nook-framwork extensions, then I got a error on frontent :

Fatal error: Class ‘interceptDB’ not found in **/plugins/system/jfdatabase/jfdatabase_inherit.php on line 58

why ?? because the nooku change the the getDBO of JFactory, … Continue reading

Posted in Joomla | Tagged , | Leave a comment

How to override a core controller in the magento

How to Override a core controoler in magento ?? Magento controller class override is something different then others classes. Controller override is not same as model, helper, block override. I found lot of thread on magento forum , but not … Continue reading

Posted in Magento | Tagged , , | 7 Comments

在NetBeans给magento添加提示方法功能

在 magento中,如果你用getModel得到一个对象时,默认没有方法提示的,可以通过添加一个注释来实现

$quote = Mage::getModel(‘sales/quote’) ->setStoreId(Mage::app()->getStore()->getId()); /* @var $quote Mage_Sales_Model_Quote */

通过var的定义,就可以有自动的方法提示了。

Posted in Magento | Tagged | Leave a comment

How to call your hlper class in magento

在magento中,如果你在local下面有自己的模块,并且有自己的空间(象是公司名等),如果你想引用一个 helper的时候,默认magento不能找到你的类,需要在config.xml里定义你的helper类

Posted in Magento | Tagged , | 1 Comment

set cakephp to use utf8

for the app ,need set the $html->charset(‘utf-8′) in your layouts file

for database, set the encoding in the database.php in the configure folder

Posted in CakePHP | Tagged | Leave a comment

Class ‘Spyc’ not found when use the Migrations in cakephp

下载 了这个migrations,执行时候的时候发现提示没有找到Spyc,这里是大写的S,修改migrate.php里的vendor(‘Spyc’) 改成小写的s,修复!

Posted in CakePHP | Tagged | Leave a comment

Undefined class ‘String’ when use the console of cakephp

today ,I try to learn the console of cakephp , when i ran ‘cake schema generate ‘command, i got a undefined the String class ,and i try to get answer to #cakephp on IRC.solution: adding this line :

uses(‘String’);

at the top … Continue reading

Posted in CakePHP | Tagged | Leave a comment