application/Espo/Core/Utils/File/Unifier.php
protected function unifyGetContents($paths, $defaults)
    {
        $fileContent = $this->getFileManager()->getContents($paths);

        if ($this->useObjects) {
            $decoded = Utils\Json::decode($fileContent);
        } else {
            $decoded = Utils\Json::getArrayData($fileContent, null);
        }

        if (!isset($decoded)) {
            $GLOBALS['log']->emergency('Syntax error in '.Utils\Util::concatPath($paths));
            if ($this->useObjects) {
                return (object) [];
            } else {
                return array();
            }
        }

        return $decoded;
    }
protected function unifyGetContents($paths, $defaults)
    {
        $fileContent = $this->getFileManager()->getContents($paths);

        if ($this->useObjects) {
            $decoded = Utils\Json::decode($fileContent);
        } else {
            $decoded = Utils\Json::getArrayData($fileContent, null);
        }

        if (!isset($decoded)) {
            $GLOBALS['log']->emergency('Syntax error in '.Utils\Util::concatPath($paths));
            if ($this->useObjects) {
                return (object) [];
            } else {
                return array();
            }
        }

        return $decoded;
    }
protected function unifyGetContents ( $ paths , $ defaults ) { $ fileContent = $ this -> getFileManager ( ) -> getContents ( $ paths ) ; if ( $ this -> useObjects ) { $ decoded = Utils \ Json :: decode ( $ fileContent ) ; } else { $ decoded = Utils \ Json :: getArrayData ( $ fileContent , null ) ; } if ( ! isset ( $ decoded ) ) { $ GLOBALS [ 'log' ] -> emergency ( 'Syntax error in ' . Utils \ Util :: concatPath ( $ paths ) ) ; if ( $ this -> useObjects ) { return ( object ) [ ] ; } else { return array ( ) ; } } return $ decoded ; }
Helpful method for get content from files for unite Files

@param string | array $paths
@param string | array() $defaults - It can be a string like ["metadata","layouts"] OR an array with default values

@return array
Helpful method for get content from files for unite Files