Loads in the ini file specified in filename, and returns the settings in
it as an associative multi-dimensional array
@param string $data
@throws ProcessorException
557802
public function load(string $data)
    {
        // we silence error(s) so we can catch them and throw a proper exception after
        $data = @parse_ini_string($data, true);

        // fail if there was an error while processing the specified ini file
        if ($data === false) {
            $error = error_get_last();
            throw new ProcessorException(__CLASS__.' fail to parse data: '.$error['message']);
        }

        // reset the result array
        $this->content = [];

        // loop through each section
        foreach ($data as $section => $contents) {
            $this->processSection($section, $contents);
        }
    }
1131305
public function load($data)
    {
        if (is_object($data)) {
            $data = get_object_vars($data);
        }
        foreach ($data as $index => $value) {
            if ($index == 'tags' && !is_array($value)) {
                if (isset($value->tag)) {
                    $value = (!is_array($value->tag)) ? array($value->tag) : $value->tag;
                }
            }
            $this->$index = $value;
        }
    }
895807
public final function load(array $data): self
    {
        foreach ($data as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
969635
public static function loadSettings($iniFile)
    {
        if (!file_exists($iniFile)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'The provided configuration file is invalid or inaccessible!'
            );
        }

        $settings = parse_ini_file($iniFile, true);

        foreach ($settings['Genesis'] as $option => $value) {
            if (array_key_exists($option, self::$vault)) {
                self::$vault[$option] = $value;
            }
        }

        foreach ($settings['Interfaces'] as $option => $value) {
            if (array_key_exists($option, self::$interfaces)) {
                self::$interfaces[$option] = $value;
            }
        }
    }
792581
public function initByData($data)
    {
        foreach ($data as $name => $value) {
            $this->set($name, $value);
        }
        $this->initialize();
        return $this;
    }
178197
public function loadConfiguration($data)
	{
		/*
		 * Setup some application metadata options.  This is useful if we ever want to write out startup scripts
		 * or just have some sort of information available to share about things.
		 */

		// The application author name.  This string is used in generating startup scripts and has
		// a maximum of 50 characters.
		$tmp = (string) $this->get('author_name', 'Joomla Framework');
		$this->set('author_name', (strlen($tmp) > 50) ? substr($tmp, 0, 50) : $tmp);

		// The application author email.  This string is used in generating startup scripts.
		$tmp = (string) $this->get('author_email', 'admin@joomla.org');
		$this->set('author_email', filter_var($tmp, FILTER_VALIDATE_EMAIL));

		// The application name.  This string is used in generating startup scripts.
		$tmp = (string) $this->get('application_name', 'JApplicationDaemon');
		$this->set('application_name', (string) preg_replace('/[^A-Z0-9_-]/i', '', $tmp));

		// The application description.  This string is used in generating startup scripts.
		$tmp = (string) $this->get('application_description', 'A generic Joomla Framework application.');
		$this->set('application_description', filter_var($tmp, FILTER_SANITIZE_STRING));

		/*
		 * Setup the application path options.  This defines the default executable name, executable directory,
		 * and also the path to the daemon process id file.
		 */

		// The application executable daemon.  This string is used in generating startup scripts.
		$tmp = (string) $this->get('application_executable', basename($this->input->executable));
		$this->set('application_executable', $tmp);

		// The home directory of the daemon.
		$tmp = (string) $this->get('application_directory', dirname($this->input->executable));
		$this->set('application_directory', $tmp);

		// The pid file location.  This defaults to a path inside the /tmp directory.
		$name = $this->get('application_name');
		$tmp  = (string) $this->get('application_pid_file', strtolower('/tmp/' . $name . '/' . $name . '.pid'));
		$this->set('application_pid_file', $tmp);

		/*
		 * Setup the application identity options.  It is important to remember if the default of 0 is set for
		 * either UID or GID then changing that setting will not be attempted as there is no real way to "change"
		 * the identity of a process from some user to root.
		 */

		// The user id under which to run the daemon.
		$tmp     = (int) $this->get('application_uid', 0);
		$options = ['options' => ['min_range' => 0, 'max_range' => 65000]];
		$this->set('application_uid', filter_var($tmp, FILTER_VALIDATE_INT, $options));

		// The group id under which to run the daemon.
		$tmp     = (int) $this->get('application_gid', 0);
		$options = ['options' => ['min_range' => 0, 'max_range' => 65000]];
		$this->set('application_gid', filter_var($tmp, FILTER_VALIDATE_INT, $options));

		// Option to kill the daemon if it cannot switch to the chosen identity.
		$tmp = (bool) $this->get('application_require_identity', 1);
		$this->set('application_require_identity', $tmp);

		/*
		 * Setup the application runtime options.  By default our execution time limit is infinite obviously
		 * because a daemon should be constantly running unless told otherwise.  The default limit for memory
		 * usage is 128M, which admittedly is a little high, but remember it is a "limit" and PHP's memory
		 * management leaves a bit to be desired :-)
		 */

		// The maximum execution time of the application in seconds.  Zero is infinite.
		$tmp = $this->get('max_execution_time');

		if ($tmp !== null)
		{
			$this->set('max_execution_time', (int) $tmp);
		}

		// The maximum amount of memory the application can use.
		$tmp = $this->get('max_memory_limit', '256M');

		if ($tmp !== null)
		{
			$this->set('max_memory_limit', (string) $tmp);
		}

		return $this;
	}
850989
public function load(array $data)
    {
        switch($data['Event']) {
            case WxReceiveEvent::EVENT_TYPE_LOCATION:
                return $this->createLocationEvent($data);
                break;
            case WxReceiveEvent::EVENT_TYPE_VIEW:
                return $this->createViewEvent($data);
                break;
            case WxReceiveEvent::EVENT_TYPE_CLICK:
                return $this->createClickEvent($data);
                break;
            case WxReceiveEvent::EVENT_TYPE_SCAN:
                return $this->createScanEvent($data);
                break;
            case WxReceiveEvent::EVENT_TYPE_SUBSCRIBE:
            case WxReceiveEvent::EVENT_TYPE_UN_SUBSCRIBE:
                return $this->createSubscribeEvent($data);
                break;
            default:
                break;
        }

        throw new RuntimeException("unknown Event({$data['Event']})");
    }
1161502
protected function loadProcessor($class, $name)
    {
        if (!class_exists($class) && !function_exists($class)) {
            try {
                $this->getCore()->getLoader()->loadPlugin($name);
            }
            catch (Exception $e) {
                throw new Exception('Processor ' . $name . ' could not be found in your plugin directories, please ensure it is in a file named ' . $name . '.php in the plugin directory');
            }
        }

        if (class_exists($class)) {
            return array(new $class($this), 'process');
        }

        if (function_exists($class)) {
            return $class;
        }

        throw new Exception('Wrong processor name, when using autoload the processor must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Processor_name"');
    }
763192
public static function createFromArray(array $data, SecuritySettingsInterface $sourceSettings = null)
    {
        if ($sourceSettings && !$sourceSettings instanceof self) {
            throw new \InvalidArgumentException('Provide an instance of DefaultSecuritySettings for $sourceSettings');
        }

        $settings = $sourceSettings ? clone $sourceSettings : new static();
        \assert($settings instanceof self);
        $settings->mergeSettings($data);

        return $settings;
    }
871344
public static function loadConfig($filename)
    {
        self::fireEvent('Atomik::Loadconfig::Before', array(&$filename));
        
        // config file format
        if (!preg_match('/.+\.(php|ini|json)$/', $filename)) {
            $found = false;
            foreach (array('php', 'ini', 'json') as $format) {
                if (file_exists("$filename.$format")) {
                    $found = true;
                    break;
                }
            }
            if (!$found) {
                throw new AtomikException("Configuration file '$filename' not found");
            }
            $filename .= ".$format";
        } else {
            $format = substr($filename, strrpos($filename, '.') + 1);
        }
        
        $config = array();
        if ($format === 'ini') {
            if (($data = parse_ini_file($filename, true)) === false) {
                throw new AtomikException('INI configuration malformed');
            }
            $config = self::dimensionizeArray($data, '.');
        } else if ($format === 'json') {
            if (($config = json_decode(file_get_contents($filename), true)) === null) {
                throw new AtomikException('JSON configuration malformed');
            }
        } else {
            if (is_array($return = include($filename))) {
                $config = $return;
            }
        }
        
        self::fireEvent('Atomik::Loadconfig::After', array($filename, &$config));
        return $config;
    }
1029621
public function validate(array $data)
    {
        $processor = new Processor();
        self::setData($data);
        $configuration = $processor->processConfiguration($this, $data);
    }
232880
public static function dataPreProcessor(DataPreProcessor $processor)
    {
        $finalData = [];
        $data = $processor->getData();

        foreach ($data as $key => $value) {
            $finalData[$key] = (string)$value;
        }

        $processor->setData(['items' => $finalData]);
    }
394138
public function validate(array $data)
    {
        $processor = new Processor();
        $processor->processConfiguration($this, $data);

        foreach ($data['tools'] as $tool) {
            $importer = $this->getImporterByName($tool['tool']['type']);

            if (!$importer && isset($tool['tool']['data'])) {
                throw new InvalidConfigurationException('The importer ' . $tool['tool']['type'] . ' does not exist');
            }

            if (isset($tool['tool']['data'])) {
                $array['data'] = $tool['tool']['data'];
                $importer->validate($array);
            }
        }
    }
1124053
public function setCache(array $data)
    {
        if (!is_writable(preg_replace('/[\/][^\/]+\.[^\/]++$/', null, $this->path))) {
            throw new \Exception(
                'Temp directory ' .
                htmlspecialchars($this->path, ENT_QUOTES, 'UTF-8') .
                ' seems not writable'
            );
        }

        if (!$this->isValidFile($this->path)) {
            $handle = @fopen($this->path, 'w+');

            if (!$handle) {
                throw new \Exception("Cache file couldn't be created");
            }

            $serialized = @serialize($data);
            if (!$serialized) {
                throw new \Exception("Cache data couldn't be serialized");
            }

            fwrite($handle, $serialized);
            fclose($handle);
        }

        return $this;
    }
855962
private function loadFile($file)
    {

        $f = array();
        if (file_exists($file))
            try {
                $f = parse_ini_file($file, true);
            } catch (\Exception $ex) {
                throw new \OWeb\manage\exceptions\Settings("Failed to load Settings file : '$file'", 0, $ex);
            }

        return $f;

    }
993329
public function init(array $data = [])
    {
        foreach ($data as $key => $value) {
            $this->set($key, $value);
        }
    }
478666
public function load($data)
	{
		$this->_data = $data;

		// total byte size of Excel data (workbook global substream + sheet substreams)
		$this->_dataSize = strlen($this->_data);

		$this->_pos = 0;

		// Parse Escher stream
		while ($this->_pos < $this->_dataSize) {

			// offset: 2; size: 2: Record Type
			$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2);

			switch ($fbt) {
				case self::DGGCONTAINER:	$this->_readDggContainer();		break;
				case self::DGG:				$this->_readDgg();				break;
				case self::BSTORECONTAINER:	$this->_readBstoreContainer();	break;
				case self::BSE:				$this->_readBSE();				break;
				case self::BLIPJPEG:		$this->_readBlipJPEG();			break;
				case self::BLIPPNG:			$this->_readBlipPNG();			break;
				case self::OPT:				$this->_readOPT();				break;
				case self::TERTIARYOPT:		$this->_readTertiaryOPT();		break;
				case self::SPLITMENUCOLORS:	$this->_readSplitMenuColors();	break;
				case self::DGCONTAINER:		$this->_readDgContainer();		break;
				case self::DG:				$this->_readDg();				break;
				case self::SPGRCONTAINER:	$this->_readSpgrContainer();	break;
				case self::SPCONTAINER:		$this->_readSpContainer();		break;
				case self::SPGR:			$this->_readSpgr();				break;
				case self::SP:				$this->_readSp();				break;
				case self::CLIENTTEXTBOX:	$this->_readClientTextbox();	break;
				case self::CLIENTANCHOR:	$this->_readClientAnchor();		break;
				case self::CLIENTDATA:		$this->_readClientData();		break;
				default:					$this->_readDefault();			break;
			}
		}

		return $this->_object;
	}