10 2011 档案

摘要:<?php 002Class DB { 003004private $link_id; 005private $handle; 006private $is_log; 007private $time; 008009//构造函数 010public function __construct() { 011$this->time = $this->microtime_float(); 012require_once("config.db.php"); 013$this->connect($db_config["hostname"], 阅读全文
posted @ 2011-10-17 17:23 Falling Leaves 阅读(4512) 评论(2) 推荐(0) 编辑
摘要:PHP中的命名规则 类的命名 在为类(class )命名前首先要知道它是什么。如果通过类名的提供的线索,还是想不起这个类是什么的话,那么就说明设计存在问题。 超过三个词组成的混合名是容易造成系统各个实体间的混淆,尝试使用(CRC Se- ssion card)看看该命名所对应的实体是否有着那么多的功用。 对于派生类的命名应该避免带其父类名的诱惑,一个类的名字只与它自身有关,和它的父类叫什么无关。 使用大写字母作为词的分隔,其他的字母均使用小写,名字的首字母使用大写 。不要使用下划线('_') 。 例如: class NameOneTwo class Name类库的命名 ... 阅读全文
posted @ 2011-10-12 00:05 Falling Leaves 阅读(300) 评论(0) 推荐(0) 编辑