Download the PHP package forrest79/deploy-php without Composer

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

Forrest79/DeployPhp

Build

Simple assets builder and application deploy helper for PHP projects.

Requirements

Forrest79/DeployPhp requires PHP 8.0 or higher.

Installation

The recommended way to install Forrest79/DeployPhp is through Composer:

Documentation

Assets

This is a simple assets builder. Currently, it supports copying files, compiling and minifying less files, sass files and JavaScript (simple minifier UglifyJS or complex rollup.js + recommended Babel) files and in debug environment also generating map files.

For compiling and minifying is required node.js with installed npm packages less, node-sass, uglify-js or rollup (babel) environment. In Debian or Ubuntu, you can do it like this (-g option install package globally in the system, not in your repository):

Using is straightforward. Examples show how this works with Nette Framework. Just create new instance Forrest79\DeployPhp\Assets class and pass temp directory, assets source directory and configuration array to constructor. key is a directory to process (for ) or target file (for DeployPhp\Assets::UGLIFYJS, DeployPhp\Assets::ROLLUP or DeployPhp\Assets::LESS) or directory (for DeployPhp\Assets::SASS) for source data and value can be simple DeployPhp\Assets::COPY which tells to copy this file/directory from source to destination or another array with items:

The next two parameters are callable function, the first is for reading hash from file, and the second is to write hash to file. In example is shown, how you can write it to neon and use it with Nette DI.

Last (fourth) parameter is optional and define an array with optional settings. More about this is under the example.

To build assets you need first call buildDebug($configNeon, $destinationDirectory) or buildProduction($configNeon, $destinationDirectory) method.

First builds assets only if there was some changed file and creates new hash from all files timestamps (and also create map files), the second builds assets every time and creates hash from every file content.

rollup.js environment with Babel

This is modern JavaScript building configuration. You must prepare rollup configuration file in your assets directory:

Create files assets\rollup.config.js:

In your HTML, you can use both files like this:

Example

In deploy/assets.php:

Neon file with hash has this structure:

In deploy/assets.local.php you can define local source assets directory, if you're using some virtual server, where the paths are different from your host paths. This directory will be used for JS and CSS map files to property open source files in the browser console:

Or you need to specify here your local server bin directory, if differ from /usr/bin:/bin (directory, where is node binary):

In app/bootstrap.php:

In debug mode, hash is calculated from every assets file timestamp - creating hash is fast (if you change file or add/remove some file, hash is changed and assets are automatically rebuilt before the request is performed).

In Nette, you need to define you own Assets extension, that will read hash from and with some sort of service, you can use it in your application. For example, like this:

In your application, you can use hash as query parameter or as virtual path in web server, example for nginx, load assets at path :

When building application:

Hash is computed from all file content, so hash is changed only when some file content is changed or the same file is added/remove (creating hash is slow).

Build and deploy

Contains just some helper methods to checkout from GIT, copy files via SFTP, and run commands via SSH. For documentation look at example.

Example

Composer monorepo

IF you're using monorepo for you applications, you need simple tool to prepare correct composer.lock. This is the simple one for a repository that meets these requirements:

Be careful, using this tool is always performed update on the global composer! The next step is copy global composer to the local one and update is also performed here. After this is local vendor cleaned.

Just for hint, differences between global and locals composer.json are shown. This may not be a mistake.

Example:

Second parameter to ComposeMonorepo constructor is optional parameters to composer update command.


All versions of deploy-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
nette/utils Version ^3.0 | ^4.0
phpseclib/phpseclib Version ^3.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 forrest79/deploy-php contains the following files

Loading the files please wait ....