manifest = json_decode( wpcom_vip_file_get_contents( $manifest_path ), true ); } else { $this->manifest = []; } } /** * Get the manifest location. * * @return array manifest file array. */ public function get() { return $this->manifest; } /** * [getPath description] * * @param string $key [description]. * @param [type] $default [description]. * @return [type] [description]. */ public function get_path( $key = '', $default = null ) { $collection = $this->manifest; if ( is_null( $key ) ) { return $collection; } if ( isset( $collection[ $key ] ) ) { return $collection[ $key ]; } foreach ( explode( '.', $key ) as $segment ) { if ( ! isset( $collection[ $segment ] ) ) { return $default; } else { $collection = $collection[ $segment ]; } } return $collection; } }