add setting of values to anonymouse member function

This commit is contained in:
Isaac Connor
2017-10-17 10:09:14 -07:00
parent 92ff3d9606
commit ba4e5572d6
4 changed files with 30 additions and 12 deletions

View File

@@ -48,10 +48,16 @@ class Event {
}
public function __call( $fn, array $args){
if ( count( $args ) ) {
$this->{$fn} = $args[0];
}
if ( array_key_exists( $fn, $this ) ) {
return $this->{$fn};
#array_unshift($args, $this);
#call_user_func_array( $this->{$fn}, $args);
$backTrace = debug_backtrace();
$file = $backTrace[1]['file'];
$line = $backTrace[1]['line'];
Warning( "Unknown function call Event->$fn from $file:$line" );
}
}

View File

@@ -36,10 +36,16 @@ class Frame {
return new Event( $this->{'EventId'} );
}
public function __call( $fn, array $args){
if( array_key_exists( $fn, $this ) ) {
if ( count( $args ) ) {
$this->{$fn} = $args[0];
}
if ( array_key_exists( $fn, $this ) ) {
return $this->{$fn};
#array_unshift($args, $this);
#call_user_func_array( $this->{$fn}, $args);
$backTrace = debug_backtrace();
$file = $backTrace[1]['file'];
$line = $backTrace[1]['line'];
Warning( "Unknown function call Frame->$fn from $file:$line" );
}
}

View File

@@ -58,10 +58,16 @@ class Storage {
}
public function __call( $fn, array $args= NULL){
if(isset($this->{$fn})){
if ( count( $args ) ) {
$this->{$fn} = $args[0];
}
if ( array_key_exists( $fn, $this ) ) {
return $this->{$fn};
#array_unshift($args, $this);
#call_user_func_array( $this->{$fn}, $args);
$backTrace = debug_backtrace();
$file = $backTrace[1]['file'];
$line = $backTrace[1]['line'];
Warning( "Unknown function call Storage->$fn from $file:$line" );
}
}
public static function find_all() {

View File

@@ -127,10 +127,10 @@ function dbQuery( $sql, $params=NULL ) {
} else {
$result = $dbConn->query( $sql );
}
//if ( $params )
//Warning("SQL: $sql" . implode(',',$params));
//else
//Warning("SQL: $sql" );
if ( $params )
Warning("SQL: $sql" . implode(',',$params));
else
Warning("SQL: $sql" );
} catch(PDOException $e) {
Error( "SQL-ERR '".$e->getMessage()."', statement was '".$sql."' params:" . implode(',',$params) );
}