Beispiel #1
0
 public function testIteratorAggregate()
 {
     $this->assertInstanceOf('IteratorAggregate', $this->report);
     $this->assertInstanceOf('Iterator', $this->report->getIterator());
 }
Beispiel #2
0
 /**
  * dispose affected Variables
  * 
  * @param \IDS\Report $oIdsReport
  * @access public
  * @static
  */
 public static function dispose(\IDS\Report $oIdsReport)
 {
     $aName = array();
     $aDisposed = array();
     // get Name of Variables
     foreach ($oIdsReport->getIterator() as $oEvent) {
         $aName[] = $oEvent->getName();
     }
     // iterate infected and dispose those
     foreach ($aName as $sName) {
         // get Type and Key
         $aType = explode('.', $sName);
         $sType = isset($aType[0]) ? $aType[0] : '';
         $sKey = isset($aType[1]) ? $aType[1] : '';
         $aAffected = isset($GLOBALS['_' . $sType][$sKey]) ? $GLOBALS['_' . $sType][$sKey] : array();
         if (!empty($aAffected)) {
             if ('GET' == $sType) {
                 if (isset($_GET[$sKey])) {
                     $_GET[$sKey] = null;
                     unset($_GET[$sKey]);
                 }
             }
             if ('POST' == $sType) {
                 if (isset($_POST[$sKey])) {
                     $_POST[$sKey] = null;
                     unset($_POST[$sKey]);
                 }
             }
             if ('COOKIE' == $sType) {
                 if (isset($_COOKIE[$sKey])) {
                     $_COOKIE[$sKey] = null;
                     unset($_COOKIE[$sKey]);
                 }
             }
             $aDisposed[] = $sType . '[' . $sKey . ']';
             \MVC\Log::WRITE("INFO\tdisposed: " . $sType . '[' . $sKey . ']', 'ids.log');
             // overwrite
             $oRequest = Request::getInstance();
             $oRequest->saveRequest();
         }
     }
     \MVC\Registry::set('MVC_IDS_DISPOSED', $aDisposed);
 }