Download the PHP package tatter/patches without Composer

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

Tatter\Patches

Automated project updates for CodeIgniter 4

Quick Start

  1. Install with Composer: > composer require --dev tatter/patches
  2. Use the command to update: > vendor/bin/patch

Description

Patches helps keep your CodeIgniter 4 projects up-to-date when there are framework changes that affect your project source. Use one easy command to patch your development instance and stage any conflicts for easy resolution.

Requirements

Patches is built on top of Git and Composer, so requires both of those be installed and accessible in your $PATH. Additionally, the patch command makes the following assumptions (and will fail if they are not met):

Installation

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

Note: While Patches can be run in a production environment it is strongly recommended that you install it in development (using --dev) and then deploy the repo changes to production.

You may also download the script and add it to your favorite projects.

Usage

Patches comes with a single script, patch, which Composer will treat as a binary and deploy to your vendor/bin/ folder. Simply run the command to kick off the patch process:

./vendor/bin/patch

Arguments

Most of the time the simple script is what you will want, but patch takes a few arguments to alter the behavior of the patch process. Arguments that take a "commit-ish" can use anything Git recognizes (branch, hash, tag, reference, revision, etc).

To ensure patches work correctly in a Docker container, you may need to set the user.email and user.name values manually using the -e and -n flags respectively. This is necessary because Docker containers are often not preconfigured for Git.

Help (-h)

Displays the latest command help:

Version (-v )

Manually sets the version to patch to. This is useful if you need to stop at a specific release, or if your project is pointed at the develop branch and you do not want certain commits. Examples:

Current (-c )

Ignores the current installed version of the framework in favor of the specified one. This is unlikely to be needed in most cases, but can be helpful for example with new installations or if you updated with Composer but forgot to run patches first. Example:

How it Works

Patches is a shell script that calls git and composer. When called it will simulate an upgrade from your current version of the framework to the latest or specified version. The simulation assumes no files were modified in your project, which is very likely not the case, so the staged simulation is then compared as a three-way merge against your current project root. Patches works in a dedicated branch (tatter/scratch) so it will never modify your project directly. Patched files are all staged on tatter/patches so you can review them before merging or pushing to remote. Consider the following examples.

Added Files

CodeIgniter decides it is time for a Widget component, which includes app/Config/Widget.php for the configuration. Your project is running version 4.1.2 but wants to update to 4.2.0 to use this new component. When Patches simulates the update between these versions git will notice the new file:

When the final stage of the patch is run this new file will be merged into your project.

Changed Files

In addition to the config file above, Widget also comes with a great new WidgetFilter. As with all Filters it must be aliased in your app/Config/Filters.php file before it can be used. The framework already took care of this for new projects:

When the final stage of the patch is run git will examine your existing file at app/Config/Filters.php and perform its signature three-way merge (technically, this is done with a cherry-pick). This means if your version is unchanged or if it has been modified in a compatible way then Patches it will apply the edits for you without intervention.

Conflicts

Compatible changes are great, but say you have a weird layout fetish (no judgment) and the app/Config/Filters.php file in your project now looks like this:

You likely moral corruption aside, git will not know how to handle merging the new WidgetFilter and you now have a conflict. Patches will clean up and leave your repo in the conflict state so you can proceed with your favorite conflict resolution. Open app/Config/Filters.php in your favorite text editor to find the conflict:

Once you have resolved all the conflicts you can finish the cherry-pick. For example in this case you would update the file and run the following commands:

Troubleshooting

Compatibility

If you are unsure whether Patches is compatible with your environment, it is recommended that you run the test cases first. Clone or download the repo and launch the tests with their run command:

./tests/run

Clean Up

Recovery

Patches is very conservative and takes many precautions not to touch any of your project files. If you are relatively new to Git and you get into a merge conflict that becomes a mess, the first thing to do: don't panic! Your files are safe and your repo is intact and the only thing that can compromise that is typing in a bunch of commands you do not understand from the internet.

The first thing to know is that Patches works with two dedicated branches: tatter/scratch is where it stages all the files, and tatter/patches is where it attempts the merge. If you are stuck make sure you know which branch you are on using git branch - likely your project uses one of the typical "main" branches: develop, main, or master.

Next thing to be aware of, the final merge stage that could induce conflict is actually handled by a cherry-pick. This is a technical Git process for isolating a single commit and applying it to another branch. if you are mid-cherry-pick then git status should display the current state, as well as any conflicting files and some hints for how to proceed:

As hinted above, you should be able to abort the entire process and get back to your unaltered project state any time you like with the following commands (swap develop for your main branch name):

Support

Still need help?

GitHub Issues are for Bug Reports and Feature Requests only. Issues opened for support will be closed and their authors browbeaten.


All versions of patches with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.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 tatter/patches contains the following files

Loading the files please wait ....