解决方案
把PHP的安装目录加入到系统的环境变量
或者把这libeay32.dll, ssleay32.dll,php5ts.dll拷贝到system32目录下
推荐第一种
前提是php.ini中要把extension=php_curl.dll 前面的注释去掉.
<?php
class A
{
function __construct()
{
echo ‘construct’;
}
function test()
{
echo ‘test’;
}
}
class B extends A
{
function __construct()
{
// 正确的写法
parent::__construct();
self::test();
//错误的写法
//$b = parent::__construct();
//$b->test();
}
}
$b = new B();
?>
今天在这上面花了不少时间,还是对oop的理解不是很深刻才会造成这个错误.
这是我用zendframework写的认证
<?php
/*
* Created on 2008-5-17 01:23:00
*
* Auth.php
*
* @author: sanp
* @blog: http://hi.baidu.com/tecent
*/
class Sanp_Auth extends Zend_Auth_Adapter_DbTable
{
public function __construct($userName, $userPassword)
{
$dbAdapter = Zend_Db_Table::getDefaultAdapter();
parent::__construct($dbAdapter, ‘users’, ‘user_name’, ‘user_password’);
// set credentials value
self::setIdentity($userName);
self::setCredential($userPassword);
// run credential query and save the result
$result = self::authenticate();
}
}
每次login的时候调用下这个就可以了.
$auth = new Sanp_Auth($userName, $userPassword);
Takeaway: This document outlines the more useful functions available in a toolkit of PHP functions designed specifically to test variables and find out if they belong to a particular character class.
Unlike many of its counterparts, PHP is not a strictly typed language. Essentially, this means that a developer doesn’t need to explicitly set the type (number, string, Boolean) of a variable before using it. Instead, the PHP interpreter automatically detects variable type based on the information stored within a variable.
While this makes programming in PHP very easy, it does have an important drawback: when you do actually need to test a variable’s type, a loosely typed language can be somewhat confusing to deal with. Luckily, the developers of PHP knew this and therefore included a toolkit of functions designed specifically to test variables and find out if they belong to a particular character class – that is, whether they contains strings, integers, objects or Booleans.
Table A outlines the more useful functions available in this category and provides explanations and usage examples.
Table A
|
Function
|
Explanation
|
Example
|
| empty($var) |
This function is used to check if a variable is empty (no value or a zero value)
Use this function to check user input — for example, form variables — to ensure that they contain valid data.
|
<?php
// returns false
$var = "hello";
echo empty($var) ? "true" : "false";
// returns true
$var = 0000;
echo empty($var) ? "true" : "false";
?> |
| gettype($var) |
This function returns the type of a variable – for example, "string", "integer", "Boolean", "float" etc.
Use this function to verify that variables are of the type you expect, usually before inserting them into a strictly-typed database field.
|
<?php
// returns string
$var = "hello";
echo gettype($var);
// returns double
$var = 1000.56;
echo gettype($var);
?> |
| is_bool($var) |
This function tests a variable to see if it contains a Boolean (true/false) value
Use this function to check if a variable is a Boolean variable.
|
<?php
// returns true
$var = false;
echo is_bool($var) ? "true" : "false";
?> |
| is_string($var) |
This function tests a variable to see if it is a string.
Use this function to check if a variable holds string data.
|
<?php
// returns true
$var = "exception";
echois_string($var) ? "true" : "false"
// returns true
$var = "88408";
echo is_string($var) ? "true" :"false";
?> |
| is_numeric($var) |
This function tests a variable to see if it contains a number or numeric string (strings containing a sign, numbers and decimal points).
Use this function to verify that a variable contains a number, usually before using it in a calculation.
|
<?php
// returns true
$var = "+99.766";
echois_numeric($var) ? "true" :"false";
// returns false
$var = "b00";
echo is_numeric($var) ?"true":"false";
?> |
| is_array($var) |
This function tests a variable to see if it is a PHP associative or numerically-indexed array.
Use this function to check if a variable is an array, usually prior to processing it in a loop.
|
<?php
// returns true
$var = array("tiger", "lion","zebra");
echois_array($var) ? "true" : "false"; // returns false
$var = "zebra";
echo is_array($var) ? "true" : "false";
?> |
| is_null($var) |
This function tests a variable to see if it is NULL.
Use this function to verify if a variable is NULL or not, usually when evaluating data returned by an SQL query.
|
<?php
// returns false
$var = "aa";
echo is_null($var) ? "true" : "false"; // returns true
$var = null;
echo is_null($var) ? "true" : "false";
?> |
| is_object($var) |
This function tests a variable to see if it is a PHP object.
Use this function to test if a variable is a PHP object, usually before calling a method or accessing a property.
|
<?php
// returns false
$var = "exception";
echo is_object($var) ? "true" : "false";
// returns true
$var = new Exception;
echois_object($var) ? "true" : "false";
?> |
| isset($var) |
This function tests a variable to see if it has already been defined.
Use this function to test if a variable has been defined, usually when evaluating the results of a form submission.
|
<?php
// returns true
$var = "yes";
echoisset($var) ? "true" : "false"; // returns false
echo isset($test) ? "true" : "false";
?> |
| print_r($var) |
This function prints the contents of a variable.
Use this function to "look inside" a variable, typically when debugging a script.
|
<?php
$var = array("one", "two", array("red", "green"), new Exception, 467);
print_r($var);
?> |
安装的时候我数据库前缀留空
啥都没写
会报这样的错误
Table ‘phpcms.table_module’ doesn’t exist
我下载了一个phpcms2007_sp4_gbk版的,可是在安装过程中出现了下面的错误
MySQL Query:SELECT module,name,iscore,iscopy,isshare,moduledir,moduledomain FROM TABLE_MODULE WHERE disabled=0
MySQL Error:Table ‘phpcms.table_module’ doesn’t exist
把数据库前缀加上就不会报错了
如果数据库前缀首字母为大写字母也会导致这种错误.
把大写换成小写就ok了。
spanishpod.com
frenchpod.com
接下来是哪个pod?
Merge很烦.
尤其是在一个稳定版本都没有的时候
来了N个Branches
Bug改不尽,春风吹又生.
秋风扫落叶,红叶都枫了.
空间名称也换成了三平流浪记
总想和三毛这位名人扯上关系
哪一天我赚钱了赚钱了
不再流浪流浪
上海是我的起点
但绝对不是我的终点
这年头出轨并不可怕
可怕的是被撞到
无论遇到什么困难
一定要好好活着
人生无常
一瞬间即可灰灰湮灭
在转角遇见了谁?
也许是一辆集装箱卡车
也许是842
也许是一坨.
总之过马路要小心
红灯行绿灯停
那是不对的.
周末一定要去买个床垫.
每天都睡在木板上
这不是在练功.
家中椅子该换了
桌子太矮
椅子太高
这样腰会很不好
腰不好,肾也会不好
天气热了
会流汗了
要谨记:
每天一斤水
强壮中国人
品冠的新专辑<那些女孩教我的事>
好听
我天天听
你要不要听一下
自从搬了住处
睡眠质量很好
每天6点准时醒
那绝对不是我以前的风格
人生最高境界也许就是:
数钱数到脚抽筋
睡觉睡到自然醒
不过突然发现
走路30分钟是不是太漫长了
难道我又想搬了
这次绝对不了.