Added is_object()

This commit is contained in:
abraar
2010-12-08 10:14:41 +00:00
parent d380899945
commit 3dd41e58ad
14 changed files with 23 additions and 23 deletions

View File

@@ -318,7 +318,7 @@ class pagedTable
else
trigger_Error('Warning: sql query is empty',E_USER_WARNING);
// Config attributes from XMLFORM file
$myAttributes=get_class_vars(is_object($this) && get_class($this));
$myAttributes=get_class_vars(get_class($this));
foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value)
if (array_key_exists( $atrib, $myAttributes)){
eval('settype($value,gettype($this->'.$atrib.'));');
@@ -637,8 +637,8 @@ class pagedTable
$this->xmlForm->setDefaultValues();
$this->xmlForm->setValues( $result );
$this->xmlForm->fields[ $this->fields[$r]['Name'] ]->mode = 'view';
if ((array_search( 'rendergrid', get_class_methods(is_object($this) && get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)
||(array_search( 'renderGrid', get_class_methods(is_object($this) && get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)) {
if ((array_search( 'rendergrid', get_class_methods( get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)
||(array_search( 'renderGrid', get_class_methods( get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)) {
$htmlField = $this->xmlForm->fields[ $this->fields[$r]['Name'] ]->renderGrid( array($value) , $this->xmlForm );
$this->tpl->assign( "value" , $htmlField[0] );
} else {

View File

@@ -111,7 +111,7 @@ class WebResource
if (!function_exists('json_encode')) {
G::LoadThirdParty('pear/json','class.json');
function json_encode(&$value) {
$json=& new Services_JSON;
$json= new Services_JSON;
return $json->encode($value);
}
}
@@ -119,7 +119,7 @@ if (!function_exists('json_encode')) {
if (!function_exists('json_decode')) {
G::LoadThirdParty('pear/json','class.json');
function json_decode(&$value) {
$json=& new Services_JSON;
$json= new Services_JSON;
return $json->decode($value);
}
}

View File

@@ -194,7 +194,7 @@ class ymlTestCases
{
$results=array();
//$this->addToPlan( $count, $start );
$functions=get_class_methods(is_object($testerObject) && get_class($testerObject) );
$functions=get_class_methods( get_class($testerObject) );
foreach($functions as $id=>$fn)
$functions[$id]=strtolower($fn);
foreach($this->testCases as $index => $testCase){

View File

@@ -38,7 +38,7 @@ require_once "PEAR.php";
* methods, an instance of each class providing separated methods is
* stored and called every time the aggregated method is called.
*
* @author Stig S<>ther Bakken <ssb@php.net>
* @author Stig S<>ther Bakken <ssb@php.net>
*/
class PEAR_Autoloader extends PEAR
{
@@ -146,7 +146,7 @@ class PEAR_Autoloader extends PEAR
$classname = strtolower($classname);
reset($this->_method_map);
while (list($method, $obj) = each($this->_method_map)) {
if (get_class($obj) == $classname) {
if (is_object($obj) && get_class($obj) == $classname) {
unset($this->_method_map[$method]);
$ok = true;
}