public function parse($parseTo = '')
    {
        $parseTo = str_replace('.', '', $parseTo); // allow to use '6.86' and '686'
        $p = __DIR__ . '/../../' . self::PATH . '/';
        $fullpath = $p . $this->_filename;
        $initData = $this->_parseJsonFile($fullpath);
        if ($parseTo) {
            $subdirs = scandir($p);
            sort($subdirs);
            foreach ($subdirs as $sdir) {
                $subdir = $p . $sdir;
                if (!is_dir($subdir) || $sdir === '.' || $sdir === '..') {
                    continue;
                }
                if ($sdir > $parseTo) {
                    break;
                }
                $path = $subdir . '/' . $this->_filename;
                if (file_exists($path)) {
                    $patchData = $this->_parseJsonFile($path);
                    $initData = $this->_mergeById($initData, $patchData);
                }
            }
        }
        $this->_data = $initData;
    }
public function parse($parseTo = '')
    {
        $parseTo = str_replace('.', '', $parseTo); // allow to use '6.86' and '686'
        $p = __DIR__ . '/../../' . self::PATH . '/';
        $fullpath = $p . $this->_filename;
        $initData = $this->_parseJsonFile($fullpath);
        if ($parseTo) {
            $subdirs = scandir($p);
            sort($subdirs);
            foreach ($subdirs as $sdir) {
                $subdir = $p . $sdir;
                if (!is_dir($subdir) || $sdir === '.' || $sdir === '..') {
                    continue;
                }
                if ($sdir > $parseTo) {
                    break;
                }
                $path = $subdir . '/' . $this->_filename;
                if (file_exists($path)) {
                    $patchData = $this->_parseJsonFile($path);
                    $initData = $this->_mergeById($initData, $patchData);
                }
            }
        }
        $this->_data = $initData;
    }
public function parse ( $ parseTo = '' ) { $ parseTo = str_replace ( '.' , '' , $ parseTo ) ; // allow to use '6.86' and '686' $ p = __DIR__ . '/../../' . self :: PATH . '/' ; $ fullpath = $ p . $ this -> _filename ; $ initData = $ this -> _parseJsonFile ( $ fullpath ) ; if ( $ parseTo ) { $ subdirs = scandir ( $ p ) ; sort ( $ subdirs ) ; foreach ( $ subdirs as $ sdir ) { $ subdir = $ p . $ sdir ; if ( ! is_dir ( $ subdir ) || $ sdir === '.' || $ sdir === '..' ) { continue ; } if ( $ sdir > $ parseTo ) { break ; } $ path = $ subdir . '/' . $ this -> _filename ; if ( file_exists ( $ path ) ) { $ patchData = $ this -> _parseJsonFile ( $ path ) ; $ initData = $ this -> _mergeById ( $ initData , $ patchData ) ; } } } $ this -> _data = $ initData ; }
Parse JSON file
@param string $parseTo
Parse JSON file