我自己发现的php毛病是函数命名不规范,有的用下划线,有的又不用,有点乱,就不到规范正规一点儿吗?
如 file_put_contents()和fileattime()这两个,其中后面一个完全可以写成file_at_time()的嘛,看着也直观不知phper怎么看这事儿?
如 file_put_contents()和fileattime()这两个,其中后面一个完全可以写成file_at_time()的嘛,看着也直观不知phper怎么看这事儿?
不过就不能写成file_access_time()或file_a_time()吗?
而fileattime从PHP3就有了。
历史遗留的问题
stat?鬼知道什么意思,不是吗?
function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false)
{
if ($argHostname != "") $this->host = $argHostname;
if ($argUsername != "") $this->user = $argUsername;
if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons
if ($argDatabaseName != "") $this->database = $argDatabaseName;
$this->_isPersistentConnection = false;
if ($forceNew) {
if ($rez=$this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true;
} else {
if ($rez=$this->_connect($this->host, $this->user, $this->password, $this->database)) return true;
}
if (isset($rez)) {
$err = $this->ErrorMsg();
if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'";
$ret = false;
} else {
$err = "Missing extension for ".$this->dataProvider;
$ret = 0;
}
if ($fn = $this->raiseErrorFn)
$fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
$this->_connectionID = false;
if ($this->debug) ADOConnection::outp( $this->host.': '.$err);
return $ret;
}
一般情况下move都省作mov,偏偏linux省作mv。
不过这样很有意思。