public function loadFile($file = null)
    {
        if (null === $file) {
            $file = $this->getDefaultPath();
        }

        $json = $this->json->decodeFile($file);

        if (isset($json->import)) {
            if (!Path::isAbsolute($json->import)) {
                $json->import = Path::join(
                    array(
                        dirname($file),
                        $json->import
                    )
                );
            }

            $json = (object) array_merge(
                (array) $this->json->decodeFile($json->import),
                (array) $json
            );
        }

        $this->json->validate(
            $this->json->decodeFile(BOX_SCHEMA_FILE),
            $json
        );

        return new Configuration($file, $json);
    }
public function loadFile($file = null)
    {
        if (null === $file) {
            $file = $this->getDefaultPath();
        }

        $json = $this->json->decodeFile($file);

        if (isset($json->import)) {
            if (!Path::isAbsolute($json->import)) {
                $json->import = Path::join(
                    array(
                        dirname($file),
                        $json->import
                    )
                );
            }

            $json = (object) array_merge(
                (array) $this->json->decodeFile($json->import),
                (array) $json
            );
        }

        $this->json->validate(
            $this->json->decodeFile(BOX_SCHEMA_FILE),
            $json
        );

        return new Configuration($file, $json);
    }
public function loadFile ( $ file = null ) { if ( null === $ file ) { $ file = $ this -> getDefaultPath ( ) ; } $ json = $ this -> json -> decodeFile ( $ file ) ; if ( isset ( $ json -> import ) ) { if ( ! Path :: isAbsolute ( $ json -> import ) ) { $ json -> import = Path :: join ( array ( dirname ( $ file ) , $ json -> import ) ) ; } $ json = ( object ) array_merge ( ( array ) $ this -> json -> decodeFile ( $ json -> import ) , ( array ) $ json ) ; } $ this -> json -> validate ( $ this -> json -> decodeFile ( BOX_SCHEMA_FILE ) , $ json ) ; return new Configuration ( $ file , $ json ) ; }
Loads the configuration file and returns it.

@param string $file The configuration file path.

@return Configuration The configuration settings.
Loads the configuration file and returns it .