Esempio n. 1
0
 /**
  *  Generates the CLUE, this method should be called once every inclusions are
  *  done (EOF most of time)
  * 
  *  @since 1.00
  *  @version 1.00
  *  @access public
  * 
  *  @param [bool $self_exclude = false] Removes self file inclued data if true
  *  @return $this Inclued instance
  */
 public function genClue($self_exclude = false)
 {
     $this->_clue = inclued_get_data();
     if ($self_exclude) {
         foreach ($this->_clue as $inc_tk => $inc_tv) {
             foreach ($inc_tv as $inc_vk => $inc_vv) {
                 if (strstr($inc_vv['name'], __NAMESPACE__) || $inc_vv['filename'] == basename(__FILE__)) {
                     unset($this->_clue[$inc_tk][$inc_vk]);
                 }
             }
         }
     }
     return $this;
 }
Esempio n. 2
0
}
$serialized = 'foo';
set_error_handler('unserialize_handler');
//如果是 unserialize() 导致了一个错误,接下来 会恢复原来的错误处理函数。
$original = unserialize($serialized);
restore_error_handler();
//恢复,设置,异常处理函数
function exception_handler_1(Exception $e)
{
    echo "<br/>";
    echo '[' . __FUNCTION__ . '] ' . $e->getMessage();
}
function exception_handler_2(Exception $e)
{
    echo "<br/>";
    echo '[' . __FUNCTION__ . '] ' . $e->getMessage();
}
set_exception_handler('exception_handler_1');
set_exception_handler('exception_handler_2');
restore_exception_handler();
throw new Exception('This triggers the first exception handler...');
echo "<br/>";
if ($divisor == 0) {
    //产生一个用户级别的 error/warning/notice 信息
    trigger_error("Cannot divide by zero", E_USER_ERROR);
}
include '1.php';
//获取包含的数据
$clue = inclued_get_data();
echo "<pre>";
print_r($clue);