Function to fetch data from Google API and populate local files.

@access public
@return void
18265
public function fetchData()
    {
        $locales = json_decode(file_get_contents($this->locale_data_url));

        if (isset($locales->countries)) {
            //For some reason the countries are seperated by a tilde
            $countries = explode('~', $locales->countries);

            $data_dir = __DIR__ . '/i18n';

            //Loop countries and grab the corrosponding json data
            foreach ($countries as $country) {
                $file = $data_dir . '/' . $country . '.json';

                file_put_contents($file, file_get_contents($this->locale_data_url . '/' . $country));
            }
        }
    }
1223542
public function load()
    {
        // Make the $menu variable available to all files
        $menu = app('menu');

        // Include menu files
        $files = $this->getFiles();

        /** @var \SplFileInfo $file */
        foreach ($files as $file) {
            require_once $file->getPath() . '/' . $file->getFilename();
        }
    }
441797
protected function loadData()
    {
        if (null === $this->data) {
            $this->statement->execute();
            $this->data = $this->statement->fetchAll(\PDO::FETCH_ASSOC);
        }
    }
651815
protected static function prefetchFiles()
	{
		self::$_files = array();
		if(!isset($_FILES) || !is_array($_FILES))
			return;

		foreach($_FILES as $class=>$info)
			self::collectFilesRecursive($class, $info['name'], $info['tmp_name'], $info['type'], $info['size'], $info['error']);
	}
567665
public function load_data() {
        global $DB;

        // Load the field object.
        if (($this->fieldid == 0) or (!($field = $DB->get_record('user_info_field', array('id' => $this->fieldid))))) {
            $this->field = null;
            $this->inputname = '';
        } else {
            $this->set_field($field);
        }

        if (!empty($this->field) && $this->userid > 0) {
            $params = array('userid' => $this->userid, 'fieldid' => $this->fieldid);
            if ($data = $DB->get_record('user_info_data', $params, 'data, dataformat')) {
                $this->set_user_data($data->data, $data->dataformat);
            }
        } else {
            $this->data = null;
        }
    }
646863
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] != null) {
            $this->name = $data['name'];
        }

        if (isset($data['active']) && $data['active'] != null) {
            $this->active = $data['active'];
        }

        if (isset($data['bouncePage']) && $data['bouncePage'] != null) {
            $this->bouncePage = $data['bouncePage'];
        }

        if (isset($data['logo']) && $data['logo'] != null) {
            $this->logo = $data['logo'];
        }

        if (isset($data['smallLogo']) && $data['smallLogo'] != null) {
            $this->smallLogo = $data['smallLogo'];
        }

        if (isset($data['website']) && $data['website'] != null) {
            $this->website = $data['website'];
        }

        if (isset($data['facebook']) && $data['facebook'] != null) {
            $this->facebook = $data['facebook'];
        }

        if (isset($data['newsletter']) && $data['newsletter'] != null) {
            $this->newsletter = $data['newsletter'];
        }
    }
185955
public function load()
    {
        // We only care about GET requests at the moment
        if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
            return;
        }

        $file = $_SERVER['REQUEST_URI'] . 'index.html';
        if (is_file($this->destination . $file)) {
            $contents = file_get_contents($this->destination . $file);
            do_action('staticwp_pre_cache_hit', $_SERVER['REQUEST_URI']);
            echo apply_filters('staticwp_cache_hit_contents', $contents);
            do_action('staticwp_post_cache_hit', $_SERVER['REQUEST_URI']);
            exit();
        } else {
            do_action('staticwp_cache_miss', $_SERVER['REQUEST_URI']);
        }
    }
1155204
private function populate() {
	
		$res = Database::load('SELECT * FROM `options` ORDER BY `group`');
			
		$this->list = array();
			
		foreach ($res as $o) {
			
			// esplode le options
			if ('list'==$o->type) {
				
				$listItems = explode('|', $o->list_options);
				
				foreach ($listItems as $listEntry) {
					
					list ($val,$text)	= explode(',', $listEntry);
					
					$listItem = new \stdClass();
					
					$listItem->value = $val;
					$listItem->text  = $text;
					
					$o->listItems[] = $listItem;
					
				}
				
			}

			// casting
			$o->value = $this->castTo($o->value, $o->type);
			
			$this->list[$o->name] = $o;
			
		}
	
	}
682474
public function __load()
    {
        if (! file_exists($file = $this->getDatabaseFileName())) {
            return collect();
        }

        return collect(json_decode(file_get_contents($file), true));
    }
157999
protected function load()
    {
        if ($this->cache->contains($this->getCacheKey())) {
            $this->map = $this->cache->fetch($this->getCacheKey());
        } else {
            $this->generateMap();
        }
    }
866955
function load()
    {
        $content = trim(file_get_contents($this->file));
        $this->data = explode("\n",$content);
    }
560239
public function populate(\stdClass $data)
    {
        $this->CodEmpresa = $data->codEmpresa;
        $this->CodIntegracaoFilial = $data->codIntegracaoFilial;
        $this->CodTipoMovto = $data->codTipoMovto;
        $this->DatMovimento = $data->datMovimento;
        $this->VlrMovimento = $data->vlrMovimento;
        $this->DscComplemento = $data->dscComplemento;
        $this->CodIntegracaoTipoMovtoCx = $data->codIntegracaoTipoMovtoCx;
        $this->CodIntegracaoMovtoCx = $data->codIntegracaoMovtoCx;
    }
464437
public function populate($data = array())
    {
        foreach (array('title', 'meta_keywords', 'meta_description', 'content', 'heading', 'category') as $attr) {
            if (isset($data[$attr]) && $data[$attr]!= null) {
                $this->$attr = $data[$attr];
            }
        }
        foreach (array('active', 'sort_order', 'pushHome', 'displayHome') as $attr) {
            if (isset($data[$attr])) {
                $this->$attr = (bool) $data[$attr];
            }
        }
        if (isset($data['category']) && $data['category']!= null) {
            $this->category = (int) $data['category'];
        }
    }
397875
public function populate($data = array())
    {
        $this->pageId = (isset($data['pageId'])) ? $data['pageId'] : null;
        $this->pageName = (isset($data['pageName'])) ? $data['pageName'] : null;
        $this->pageLink = (isset($data['pageLink'])) ? $data['pageLink'] : null;

    }
571513
protected function fetchData()
    {
        $uri = $this->getUri();
        if (!$uri) {
            return;
        }

        $client = new \Zend\Http\Client($this->getUri());
        $client->setMethod('GET');

        try {
            $response = $client->send();
        } catch (\Exception $e) {
            return;
        }

        $status = $response->getStatusCode();
        if ($status == 200) {
            $result = $response->getBody();
            $result = (array) json_decode($result);
            if (0 < count($result)) {
                $name = array_pop($result);
                $this->setName($name);
            }
        }
    }
306221
public function upload_files()
    {
        $adapter    = new GoogleDriveAdapter($this->service, Cache::get('folder_id'));
        $filesystem = new Filesystem($adapter);

        // here we are uploading files from local storage
        // we first get all the files
        $files = Storage::files();

        // loop over the found files
        foreach ($files as $file) {
            // remove file from google drive in case we have something under the same name
            // comment out if its okay to have files under the same name
            $this->remove_duplicated($file);

            // read the file content
            $read = Storage::get($file);
            // save to google drive
            $filesystem->write($file, $read);
            // remove the local file
            Storage::delete($file);
        }
    }
976481
public function populate($data = array())
    {
        if (isset($data['title']) && $data['title'] != null) {
            $this->title = $data['title'];
        }

        if (isset($data['subtitle']) && $data['subtitle'] != null) {
            $this->subtitle = $data['subtitle'];
        }

        if (isset($data['active']) && $data['active'] != null) {
            $this->active = $data['active'];
        }
    }