Problem found
While tracking the Yratings_get_targets,
Error_log (Var_export (Yblog_mspconfiginit ("ratings"), true); always print out yblog_mspconfiginit ("ratings") return is null
Cause I thought it was impossible to build a connection with DB and took the wrong way for the day.
Finally found that this is one of the differences between Var_export and Var_dump.
This is:
Problem reason
Var_export must return valid PHP code, that is to say, the code returned by Var_export can be assigned a variable directly as a PHP code. And this variable will get the same type of value as being var_export.
However, when the variable type is resource, it cannot be copied by simple copy, so when the Var_export variable is a resource type, VAR_EXPORT returns null
Instance
$res = Yblog_mspconfiginit ("ratings");
Var_dump ($res);
Var_export ($res); Results:
Resource (1) of type (Yahoo_yblog)
Null again for example:
$res = fopen (' status.html ', ' R ');
Var_dump ($res);
Var_export ($res); Results:
Resource (2) of type (stream)
Null