Save loaded informations from json file into the loadInfos property

@return void
559749
protected function obtainLoadInfos()
    {
        $currentClass = get_called_class(); //Allow extends
        
        $this->loadInfos = $currentClass::readJsonFile(
            MODULES_DIR.$this->name
            .'/module.json'
        );
    }
1044073
public function loadInfos()
    {
        $this->findModuleName();
        
        $infos = $this->obtainInfosFromModule();
        $this->checkPropertySrcPath($infos);
        
        //Defines default paths
        $this->sourceSrcPath    = $infos->srcPath;
        $this->sourceConfigPath = $infos->srcPath;

        //Defines properties
        
        if (property_exists($infos, 'configFiles')) {
            $this->configFilesList = (array) $infos->configFiles;
        }

        if (property_exists($infos, 'configPath')) {
            $this->sourceConfigPath = $infos->configPath;
        }

        if (property_exists($infos, 'installScript')) {
            $this->sourceInstallScript = $infos->installScript;
        }

        $this->sourceSrcPath = realpath(
            $this->sourcePath.'/'.$this->sourceSrcPath
        );
        
        $this->sourceConfigPath = realpath(
            $this->sourcePath.'/'.$this->sourceConfigPath
        );
        
        if (is_bool($this->sourceSrcPath) || is_bool($this->sourceConfigPath)) {
            throw new Exception(
                'The srcPath or the configPath (if define) properties not exist'
                .' for the module '.$this->name,
                $this::ERR_LOAD_PATH_NOT_EXIST
            );
        }
    }
208620
public function load()
    {
        if (self::$json === null) {
            self::$json = array();
            if (!empty($this->extSettings['json'])) {
                $file = MaskUtility::getFileAbsFileName($this->extSettings['json']);
                if (file_exists($file)) {
                    self::$json = json_decode(file_get_contents($file), true);
                }
            }
        }
        return self::$json;
    }
1208446
public function save()
    {
        $json = [];
        foreach ($this as $cookie) {
            if ($cookie->getExpires() && !$cookie->getDiscard()) {
                $json[] = $cookie->toArray();
            }
        }

        $_SESSION[$this->sessionKey] = json_encode($json);
    }
1261922
protected function saveInternal()
    {
        $modified_properties = $this->getModifiedProperties();

        if (count($modified_properties) === 0) {
            return;
        }

        if ($this->table === null) {
            trigger_error(
                sprintf('No table defined for %s', get_class($this)),
                E_USER_NOTICE
            );

            return;
        }

        if ($this->id_field === null) {
            if (!$this->loaded_from_database) {
                $this->saveNewBinding();
                return;
            }

            trigger_error(
                sprintf('No id_field defined for %s', get_class($this)),
                E_USER_NOTICE
            );

            return;
        }

        $id_field = new SwatDBField($this->id_field, 'integer');

        if (!property_exists($this, $id_field->name)) {
            trigger_error(
                sprintf(
                    "The id_field '%s' is not defined for %s",
                    $id_field->name,
                    get_class($this)
                ),
                E_USER_NOTICE
            );

            return;
        }

        $id_ref = $id_field->name;
        $id = $this->$id_ref;

        $fields = array();
        $values = array();

        foreach ($modified_properties as $name => $value) {
            if ($name === $id_field->name) {
                continue;
            }

            $type = $this->guessType($name, $value);

            if ($type == 'date') {
                $value = $value->getDate();
            }

            $fields[] = sprintf('%s:%s', $type, $name);
            $values[$name] = $value;
        }

        if ($id === null) {
            $this->$id_ref = SwatDB::insertRow(
                $this->db,
                $this->table,
                $fields,
                $values,
                $id_field->__toString()
            );
        } else {
            SwatDB::updateRow(
                $this->db,
                $this->table,
                $fields,
                $values,
                $id_field->__toString(),
                $id
            );
        }

        // Note: This flushes any name-spaces with the newly saved
        // data-object data. In theory you may need to flush name-spaces
        // that rely on the pre-changed values. You must handle this case
        // manually in your application's code by cloning the object
        // before setting the values.
        $this->flushCacheNamespaces();
    }
728734
public function jsonCommand(): void
    {
        $data = [
            [
                'id'     => 1,
                'name'   => 'john',
                'status' => 2,
                'email'  => 'john@email.com',
            ],
            [
                'id'     => 2,
                'name'   => 'tom',
                'status' => 0,
                'email'  => 'tom@email.com',
            ],
            [
                'id'     => 3,
                'name'   => 'jack',
                'status' => 1,
                'email'  => 'jack-test@email.com',
            ],
        ];

        $this->output->write('use dump:');
        $this->output->dump($data);

        $this->output->write('use print:');
        $this->output->prints($data);

        $this->output->write('use json:');
        $this->output->json($data);
    }
1334574
public function save()
    {
        switch ($this->fileType) {
            case self::TYPE_JSON :
                $content = json_encode($this->data);
                break;
            default :  $content = '<?php return '. var_export($this->data, true) . ';';
        }
        if (function_exists('apc_clear_cache')) {
            apc_clear_cache();
        }
        if (function_exists('opcache_reset')) {
            opcache_reset();
        }
        return file_put_contents($this->writePath, $content);
    }
104637
private function init()
    {
        // Define Default Config:
        
        $this->setConfig(self::$default_config);
        
        // Load JSON Config File:
        
        $file = new JsonFile(self::CONFIG_FILE);
        
        // Merge JSON Config (if file exists):
        
        if ($file->exists()) {
            $this->mergeConfig($file->read());
        }
    }
976680
public static void saveJson(File json, Object object) throws IOException {
        objectMapper.writer().writeValue(json, object);
    }
98338
protected function load()
    {
        if (!isset($_SESSION[$this->sessionKey])) {
            return;
        }
        $data = json_decode($_SESSION[$this->sessionKey], true);
        if (is_array($data)) {
            foreach ($data as $cookie) {
                $this->setCookie(new SetCookie($cookie));
            }
        } elseif (strlen($data)) {
            throw new \RuntimeException("Invalid cookie data");
        }
    }
98156
public function load()
    {
        $file = BASE_PATH . '/rev-manifest.json';

        if (file_exists($file)) {
            $this->manifest = json_decode(file_get_contents($file), true);
        }
    }
600608
def save_settings(self, settings_file):
        """"""
        settings = {}
        for parameter in self.parameter_maxima:
            settings[parameter] = self.__getattribute__(parameter)
        with open(settings_file, "w") as settings_file:
            simplejson.dump(settings, settings_file)
1043267
private function writeStoredRoutineMetadata(): void
  {
    $json_data = json_encode($this->phpStratumMetadata, JSON_PRETTY_PRINT);
    if (json_last_error()!=JSON_ERROR_NONE)
    {
      throw new RuntimeException("Error of encoding to JSON: '%s'.", json_last_error_msg());
    }

    // Save the metadata.
    $this->writeTwoPhases($this->phpStratumMetadataFilename, $json_data);
  }
1342450
function(data) {
      var segment;
      log('json loaded');

      if (!data.files[0].length) {
        data.files = [data.files];
      }

      for (var i = 0, l = data.files.length; i < l; i++) {
        _files.push([]);
        segment = data.files[i];

        for (var m = 0, n = segment.length; m < n; m++) {
          arrangeData(i, m, segment[m]);
        }
      }
    }
1289260
def _load( self, fn ):
        """"""

        # if file is empty, create an empty notebook
        if os.path.getsize(fn) == 0:
            self._description = None
            self._results = dict()
            self._pending = dict()
        else:
            # load the JSON object
            with open(fn, "r") as f:
                s = f.read()

                # parse back into appropriate variables
                j = json.loads(s)
                self._description = j['description']
                self._pending = dict(j['pending'])
                self._results = j['results']

                # perform any post-load patching
                self.patch()
305776
protected function loadPluginInfo()
    {
        $this->pluginInfo = array();
        foreach ($this->files as $fileInfo) {
            if ($fileInfo instanceof \SplFileInfo) {
                if ($fileInfo->isFile() && $fileInfo->getExtension() == 'php') {
                    $this->addPluginFromFile($fileInfo);
                }
            }
        }
    }
1103179
private function LoadTypeDefFromJson()
    {
        $typedef_def = Json::Decode(file_get_contents(
            $this->definitions_path . "type_definitions.json")
        );

        foreach($typedef_def as $header => $namespaces)
        {
            $this->symbols->AddHeader($header);
            
            foreach($namespaces as $namespace => $typedefs)
            {
                foreach($typedefs as $typedef_name => $typedef_data)
                {
                    if(!isset($typedef_data["description"]))
                        $typedef_data["description"] = "";
                    
                    $typedef = new Element\TypeDef(
                        $typedef_name,
                        $typedef_data["type"],
                        $typedef_data["description"]
                    );

                    $this->symbols->headers[$header]->AddTypeDef(
                        $typedef,
                        $namespace
                    );
                }
            }
        }

        unset($typedef_def);
    }