FVN Tech Blog Coding or Programming in C#/PHP | Linux or Windows Server Backend | New Media | SNS | Misc …

28Mar/072

Effective PHP Develop Environment Part.1

Most PHP newbies will ask such a question: Is there any IDE for PHP like Visual Studio for C++/C# or Eclipse for Java ?

Zend Studio ( Commercial ) is Zend Corp's solution, and someone may like PHPEclipse (Free, based on Eclipse) or PHPed/PHPEdit/Komodo, sth else.

But what's important for productive code is Debug / Profiling / Code Analysis functions. As you know, Zend Studio provides these function all in one as an intergrated environment, while other editors like PHPEclipse need external debugger to provide these important functions. Xdebug is an almost perfect solution.

FUNCTIONALITY

The Xdebug extension helps you debugging your script by providing a lot of valuable debug information. The debug information that Xdebug can provide includes the following:

  • stack and function traces in error messages with:
    • full parameter display for user defined functions
    • function name, file name and line indications
    • support for member functions
  • memory allocation
  • protection for infinite recursions

Xdebug also provides:

Supported:
VIM (Free): plugin of DBGp client.
Komodo (Commercial): intergrated
PHPEdit: intergrated
PHPEclipse:
net.sourceforge.phpeclipse.xdebug.core, net.sourceforge.phpeclipse.xdebug.ui

You can debug local/remote PHP scripts by configure php.ini on the target environment for these parameters :

remote_host, remote_port, you know how to configure

remote_mode  req/jit,

remote_handler  GDB/DBGp, I suggest DBGp.

Click here to read more docu on configuring Xdebug

In Part.2 I'll give out an example of installation and configuration from scratch on a Debian/Linux system, and debug client on Windows.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged as: , 2 Comments
6Nov/060

Zend Framework前瞻(二):0.2.0的新变化

本文内容已经不能适应当前 Zend Framework 版本(0.9+),请参阅更新的文章。20070407

0.2.0增加了以下内容

Zend_Cache
以文件,sqlite数据库或memcache为后端,通过ID和tag来标示数据,可以设定过期期限(以秒为单位),可以自动序列化(因此可以缓存任何数据)。
Zend_Cache类本身是一个工厂类,可以定制cache内容(前端)为Output,File,Function 和 Class。
不过,你可以用Zend_Cache_Core作为统一的访问方式。以下是一个官方手册的例子

require_once 'Zend/Cache.php';
$frontendOptions = array( 'lifeTime' => 7200,
           // cache lifetime of 2 hours
           'automaticSerialization' => true);
$backendOptions = array( 'cacheDir' => './tmp/'
  
 // Directory where to put the cache files);
    // getting a Zend_Cache_Core object
$cache =
Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);

更多说明在此
http://framework.zend.com/manual/en/zend.cache.html
需要注意的是不同缓存的 id 不能重复,否则会有串扰,lol

Zend_Config
专门用于存储在文本中的配置处理
由 Zend_Config_Array,Zend_Config_Ini 和 Zend_Config_Xml 这三个有共同 父类 Zend_Config 的子类组成
ini 和 xml 可能用得会多点
看看官方例子就知道怎么用了
http://framework.zend.com/manual/en/zend.config.html
不过,这些类不是用来保存配置
Zend 官方说保存配置这件事情不归 ZF 管

Zend_Feed
现在用不着什么 lastRSS 之类的 homemade产品了
Zend_Feed_RSS 和 Zend_Feed_Atom ……或者就用 Zend_Feed 就可以帮你解析 feed
从网页中找到rss feed,修改节点内容,还可以输出为xml…… ZF 官方站点的rss feed就是用Zend_Feed 输出的
解析 feed 最简单
$feed = Zend_Feed::import($url);
...Zend_Feed::importFile($filename);
...Zend_Feed::importString($feedstring);
然后就rss内容就在$feed里了

Zend Google Data Client Library
与一系列 Google 服务交互的 APIs
Google Base, Calendar, Blogger, and CodeSearch 等等
这部分需要单独下载
http://framework.zend.com/download/gdata

其他还有 Zend_Acl, Zend_Registry, Zend_Session 等
但还未进入 stable 的状态,暂时不介绍了

Zend_Controller, Zend_View这块的 MVC 架构在 0.2.0 重新实现了
具体细节我还没有看,稍后为您介绍

另外现在 Zend Framework需要 PHP5.1.4 以上版本
建议用最新(20061106)的 PHP 5.2.0 规避一个htmlentity的缓冲区溢出漏洞

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
3Nov/060

PHP 5.2.0

比较重要的改进:

增加 RFC1867 文件上传进度的 hook
JSON 和 ZIP 模块,前者默认启用
Windows版本支持 Apache 2.2 mod
PDO,PCRE,libsqlite,libmysql,openssl等更新与改进

最期待就是文件上传进度的 tracking 了
终于official了……

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged as: No Comments

Pages

Recent Posts

Categories

Tags

apache baidu C# Debian dotNET economy gadget GMA Google hulu IE7 Intel jiwai lighttpd Linux Mobile mod_extforward mojiti nginx oscanner OVAL Parallel PHP phproxy politics proxy Python regsvr32 SNS squid subversion trac TV Vista Visual Studio Windows Live Windows Mobile WLM wordpress wow WTL wzdftpd XDebug XML Zend Framework

Archives

Meta

友情链接与广告

Free web proxy
Old friends:

NSClub: