Download the PHP package codewithkyrian/platform-package-installer without Composer

On this page you can find all versions of the php package codewithkyrian/platform-package-installer. 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 platform-package-installer

Composer Platform Package Installer

The Composer Platform Package Installer is a powerful Composer plugin that provides fine-grained control over package distribution across different platforms and architectures. Unlike traditional Composer package management, this plugin allows you to:

Requirements

Installation

Install the plugin using Composer:

Usage Guide

Step 1: Package Configuration

Change your package type to platform-package in composer.json:

Step 2: Create Platforms Configuration

Create a platforms.yml file in the root of your project and list the platforms you want to support:

You can also specify exclusion rules for each platform (this will come in handy later when generating distribution archives).

Exclusion Rule Patterns:

Step 3: Generate Distribution URLs

Use the platform:generate-urls command to create platform-specific download URLs and add them to composer.json. This is very important because Composer will use these URLs to download the appropriate platform-specific package.

Command Options

For the example above, the generated config added to composer.json would look like:

Now the next time someone installs your package, Composer will use the generated URLs to download the appropriate platform-specific package. The good thing is that if for any reason the URLs are wrong or not working, Composer falls back to downloading the original source (which means more things to download and slower installation but hey, it's better than nothing).

Platform Identifiers

Platform Identifiers are used to specify the platform-specific package URL. Platform identifiers can be:

Distribution Archives

For regular packages, GitHub and GitLab provide an automatic distribution archive (tarball or zip) for each release. Using this package however, means you can no longer rely on those automatic distribution archives.

The composer platform:generate-urls only generates urls for the platforms specified in the platforms.yml file using a template, but you still need to manually generate the archive for each platform and make them available at those locations.

GitHub

The generated GitHub distribution archive is available at the following URL:

{platform} and {ext} will be replaced with the platform identifier and the file extension when generating the URL while {version} will be replaced with the package version at installation time.

The package provides a convenient example GitHub Actions workflow that uses the platforms.yml file to generate the distribution archives every release and upload them as release assets. Feel free to modify the workflow to suit your needs.

GitLab

The GitLab distribution archive is available at the following URL:

At the moment, there's no example workflow for GitLab. Contributions are welcome for a similar workflow.

Always test the workflow thoroughly to ensure it generates the correct distribution archives for each platform.

Runtime Utility

The package provides a powerful utility method findBestMatch() to easily handle platform-specific resources at runtime. It finds the most appropriate match for the current platform from a given set of platform-specific entries.

Tests

The tests folder contains a suite of tests that verify the behavior of the plugin. To run the tests, you need to install the development dependencies using the composer install --dev command. Then, run the tests using either the composer test command or the ./vendor/bin/pest command.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


All versions of platform-package-installer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
composer-plugin-api Version ^1.1 || ^2.0
composer-runtime-api Version *
symfony/yaml Version ^6.4 || ^7.2
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 codewithkyrian/platform-package-installer contains the following files

Loading the files please wait ....