Download the PHP package gin0115/vite-manifest-parser without Composer

On this page you can find all versions of the php package gin0115/vite-manifest-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vite-manifest-parser

GitHub_CI GitHub release (latest SemVer including pre-releases) codecov Scrutinizer Code Quality GitHub issues [Open Source Love]()

A basic parser for vite manifest file, which allows for the including of vue3-cli/vite projects in php.

Install

Usage

To accommodate the random hash which is added to assets compiled for vue 3 using vite , this library allows for the easy parsing of the required assets.

Example Vite Manifest

You can then access the assets using the following:

API

ViteManifestParser()

The constructor takes 2 properties:

getAssetsUri

@return string The base url of the assets.

Returns the defined assetUri with any trailing slash removed.

getAssetsForVueFile

@param string $fileName The name of the vue file.
@return array<string, string|string[]> The assets for the vue file.
@throws \Exception - File does not exist in manifest.
@throws \Exception - File assets are empty or invalid.

File Asset properties * **file**: *string* * **src**: *string* * **isEntry**?: *bool* (optional) * **isDynamicEntry**?: *bool* (optional) * **dynamicImports**?: *string[]* (optional) * **css**?: *string[]* (optional) * **assets**?: *string[]* (optional) * **imports**?: *string[]* (optional)

Returns an array of all details defined in the manifest for the given vue file.

This will throw exceptions if there is an issue with the manifest file it self or the required file from manifest doesn't exist.

getEntryScriptUri

@param string $fileName - The filename of the asset
@return string|null - The url of the asset or null if file doesn't exist.

This will return just the main JS file uri, this will be prepended with the assetUri.

Unlike getAssetsForVueFile() , this will not throw exceptions if the file doesn't exist and will just return null.

getEntryCssUris

@param string $fileName - The filename of the asset
@return string[] - The urls of the css assets.

This will return all css files that are defined for the entry file. This will be prepended with the assetUri.

Unlike getAssetsForVueFile() , this will not throw exceptions if the file doesn't exist and will just return an empty array.

Change log

If you would like to contribute to this project, please open an issue or pull request. All pull requests must pass the testing suite of PHPUnit, PHPStan and PHP Code Sniffer. To run these tests please run the following.

All code must pass all of these suites against php versions 7.2 , 7.3 , 7.4 , 8.0 & 8.1 . On both windows and linux operating systems. Please note the Windows version runs less tests.


All versions of vite-manifest-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gin0115/vite-manifest-parser contains the following files

Loading the files please wait ....