reads in our configuration file. Makes a new $event variable
available in our classes when loading the file.
540428
protected function readConfigFile()
    {
        if (! is_file($this->config_path))
        {
            throw new \RuntimeException('Invalid Events configuration path: '. $this->config_path);
        }

        extract(['events' => $this]);

        include $this->config_path;

        $this->have_read_from_file = true;
    }
1317272
function readFile() {
                    return new Promise(function (resolve, reject) {
                        /** @type {?} */
                        var reader = new FileReader();
                        reader.onload = function (event) {
                            resolve(reader.result);
                        };
                        reader.onerror = function (err) {
                            reject(err);
                        };
                        reader.readAsDataURL(file);
                    });
                }
166869
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        // Get the reader from the parent and add the attribute incorporating wrapper
        final PipelineEventReader<XMLEventReader, XMLEvent> cachingEventReader =
                this.wrappedComponent.getEventReader(request, response);
        final XMLEventReader eventReader =
                new AttributeIncorporatingXMLEventReader(
                        request, response, cachingEventReader.getEventReader());

        final Map<String, String> outputProperties = cachingEventReader.getOutputProperties();
        return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(eventReader, outputProperties);
    }
364592
function (event) {
            this.data.showSource = !this.data.showSource;
            if (this.data.showSource) {
                this.data.initialSource = true;
                var filePath = this.data.templateCtxt.tplClasspath.replace(/\./g, "/") + ".tpl";
                this.data.source = this.moduleCtrl.getSource(filePath).value;
            }
            this.$refresh();
        }
799455
protected function read()
	{
		if( !file_exists( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not existing.' );
		$this->data		= parse_ini_file( $this->fileName, true );
	}
571183
def read(file)

      Pathname.new(file).read.each_line do |line|
          # skip blank lines and those starting with #
          next if line =~ /^\s*(#|$)/

          line.strip =~ /^(\w+?):\s*(\S.*)$/
          next unless $1
          attr = $1.to_sym
          setter = "#{attr}=".to_sym
          value = $2.strip

          if CONF_KEYS.keys.include? attr
            if value
              # convert the value to the correct class
              value = value.send(CONF_KEYS[attr])
            end
            self.send(setter, value)
          end  # if
        end # do line

    end
1170759
private function read()
    {
        $filePath = $this->getFilePath();
        $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : [];

        $this->loadSession();
    }
348992
def read(config_file, configspec, server_mode=False, default_section='default_settings', list_values=True):
    '''
    
    '''
#    configspec = ConfigObj(path.join(path.abspath(path.dirname(__file__)), configspec),
#                           encoding='UTF8',
#                           interpolation='Template',
#                           list_values=False,
#                           _inspec=True)
    config = ConfigObj(config_file,
                       configspec=path.join(path.abspath(path.dirname(__file__)),
                                            configspec),
                                            list_values=list_values)
    validation = config.validate(validate.Validator(), preserve_errors=True)

    if validation == True:
        config = dict(config)
        for section in config:
            if section != default_section:
                if server_mode: # When it's a servers config file, retrieve the correct fqdn
                    config[section]['availability'] = True
                    if config[section]['custom_fqdn'] == None:
                        config[section]['custom_fqdn'] = socket.getfqdn()
                for option in config[section]:  # retrieve default configuration for missing values
                    if config[section][option] == None:
                        config[section][option] = config[default_section][option]

        del(config[default_section])

        return config
    else:
        raise ConfiguratorException(config_file, validation)
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;
    }
735624
def on_created(self, event):
        
        if os.path.isdir(event.src_path):
            return

        logger.debug("File created: %s", event.src_path)

        name = self.file_name(event)

        try:
            result = self.target_class.from_config(
                name, yaml.load(open(event.src_path))
            )
        except Exception as e:
            logger.exception(
                "Error when loading new config file %s: %s",
                event.src_path, str(e)
            )
            return

        if not result:
            return

        self.on_add(self.target_class, name, result)
827859
function obtainConfig(file) {
  let json;
  try {
    const jsonFile = fs.readFileSync(file);
    json = JSON.parse(jsonFile);
  } catch (err) {
    throw Error(`fail to load/parse your '${file}': ${err.message}`);
  }
  return json;
}
794754
private function _getEventsConfig()
    {
        $content = array(self:: MAIN_EVENTS_FILE => array());

        $configPath = $this->_configPath;
        if (! is_dir($configPath)) {
            return $content;
        }

        $files = DirData::listFilesRecursive($configPath, self:: MAIN_EVENTS_FILE . self::EXT);
        foreach ($files as $file) {
            $content[self:: MAIN_EVENTS_FILE] = array_merge_recursive(require($file), $content[self:: MAIN_EVENTS_FILE]);
        }

        return $content;
    }
670459
function config_load($file, $section = null, $scope = 'global')
	{
		require_once($this->_get_plugin_filepath('function', 'config_load'));
		smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this);
	}
896270
@Override
    public void configurationEvent(ConfigurationEvent event) {
        LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
        try {
            lock.lock();
            final List<InstanceDeclaration> impacted
                    = getDeclarationsByConfiguration(event.getPid(), event.getFactoryPid());

            if (impacted.isEmpty()) {
                return;
            }

            switch (event.getType()) {
                case ConfigurationEvent.CM_DELETED:
                    for (InstanceDeclaration declaration : impacted) {
                        LOGGER.info("Configuration " + event.getPid() + " deleted");
                        declaration.dispose(event.getPid());
                    }
                    break;
                case ConfigurationEvent.CM_UPDATED:
                    for (InstanceDeclaration declaration : impacted) {
                        final Configuration configuration = find(event.getPid());
                        if (configuration == null) {
                            LOGGER.error("Weird case, a matching declaration was found, but cannot be found a second " +
                                    "times, may be because of rapid changes in the config admin");
                        } else {
                            declaration.attachOrUpdate(configuration);
                        }
                    }

                    break;
            }
        } finally {
            lock.unlock();
        }

    }
958917
def read_events(self):
        
        buf_ = array.array('i', [0])
        # get event queue size
        if fcntl.ioctl(self._fd, termios.FIONREAD, buf_, 1) == -1:
            return
        queue_size = buf_[0]
        if queue_size < self._threshold:
            log.debug('(fd: %d) %d bytes available to read but threshold is '
                      'fixed to %d bytes', self._fd, queue_size,
                      self._threshold)
            return

        try:
            # Read content from file
            r = os.read(self._fd, queue_size)
        except Exception, msg:
            raise NotifierError(msg)
        log.debug('Event queue size: %d', queue_size)
        rsum = 0  # counter
        while rsum < queue_size:
            s_size = 16
            # Retrieve wd, mask, cookie and fname_len
            wd, mask, cookie, fname_len = struct.unpack('iIII',
                                                        r[rsum:rsum+s_size])
            # Retrieve name
            fname, = struct.unpack('%ds' % fname_len,
                                   r[rsum + s_size:rsum + s_size + fname_len])
            rawevent = _RawEvent(wd, mask, cookie, fname)
            if self._coalesce:
                # Only enqueue new (unique) events.
                raweventstr = str(rawevent)
                if raweventstr not in self._eventset:
                    self._eventset.add(raweventstr)
                    self._eventq.append(rawevent)
            else:
                self._eventq.append(rawevent)
            rsum += s_size + fname_len
971274
function readFile(e) {
  const file = e.currentTarget.files && e.currentTarget.files[0];
  const reader = new FileReader();

  reader.onload = event => ArtBoard.loadANSI(event.target.result);
  if (file) reader.readAsText(file);
}
399485
public function getEvents()
    {
        $events = [];

        try {
            $files = $this->reader->readDir($this->directory);

            foreach ($files as $file) {
                $filePath = $this->directory . '/' . $file;

                $contents = $this->reader->read($filePath);

                $parts = explode(PHP_EOL, $contents);
                $line1 = explode(' ', $parts[0]);

                $method = $line1[0];
                $endpoint = $line1[1];
                $reference = $parts[1];
                $request = $parts[2];

                $event = $this->eventFactory->create($request, $endpoint, $method, $reference);

                if (5 === count($parts)) {
                    $event->setLatency((float)$parts[3]);
                    $event->setResponse($parts[4]);
                }

                $events[] = $event;
            }
        } catch (Exception $e) {
            if (null !== $this->logger) {
                $this->logger->error($e);
            }
        }

        return $events;
    }