Пример #1
0
 /**
  * This method assists with freeing, releasing, and resetting un-managed resources.
  *
  * @access public
  * @param boolean $disposing                                whether managed resources can be disposed
  *                                                          in addition to un-managed resources
  *
  * @see http://paul-m-jones.com/archives/262
  * @see http://www.alexatnet.com/articles/optimize-php-memory-usage-eliminate-circular-references
  */
 public function dispose($disposing = true)
 {
     $this->current = null;
     $this->rules->clear();
     if ($disposing) {
         $this->reader = null;
         $this->rules = null;
     }
     if ($this->reader !== null) {
         $this->reader->seek(0);
     }
 }
Пример #2
0
 /**
  * This method returns the collection as a map.
  *
  * @access public
  * @return \Unicity\Common\IMap                             a map of the elements
  */
 public function toMap()
 {
     return $this->list->toMap();
 }
Пример #3
0
 /**
  * This method logs any changes between the source and target values.
  *
  * @access protected
  * @param mixed $source                                     the source value to be evaluated
  * @param mixed $target                                     the target value to be evaluated
  * @param string $path                                      the current path
  * @param Common\Mutable\IList $log                         a reference to the log
  */
 protected function compareValues($source, $target, $path, Common\Mutable\IList $log)
 {
     $source_info = Core\DataType::info($source);
     $target_info = Core\DataType::info($target);
     if ($source_info->hash != $target_info->hash) {
         if ($source_info->type != $target_info->type) {
             $log->addValue(array('body' => strtr('Target value is of ":target" type, but source value is of ":source" type.', array(':source' => $source_info->type, ':target' => $target_info->type)), 'level' => Log\Level::warning()->__name(), 'path' => $path, 'time' => date('c')));
         } else {
             $log->addValue(array('body' => strtr('Target value ":target" is different from source value ":source".', array(':source' => Core\Convert::toString($source), ':target' => Core\Convert::toString($target))), 'level' => Log\Level::warning()->__name(), 'path' => $path, 'time' => date('c')));
         }
     }
 }
Пример #4
0
 /**
  * This method adds a resource to this context.
  *
  * @access public
  * @param \SimpleXMLElement $resource                       the resource to be added
  */
 public function addResource(\SimpleXMLElement $resource)
 {
     $this->resources->addValue($resource);
 }
Пример #5
0
 /**
  * This method removes all tasks in this task composite.
  *
  * @access public
  */
 public function removeTasks()
 {
     $this->tasks->clear();
 }