Download the PHP package maestroerror/html-strings-affixer without Composer

On this page you can find all versions of the php package maestroerror/html-strings-affixer. 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 html-strings-affixer

html-strings-affixer

CLI tool that finds texts in HTML and replaces it with suffixed and prefixed string. Originally developed to replace strings with localization function in blade file:
<p>Some nice string</p> -> <p>{{ __('Some nice string') }}</p>
But can be used in any file which contains html (".jsx", ".vue", ".twig") with same purpose. Of course, prefix and suffix are customizable

JavaScript version is already available here (hsa-js)

Quick start

Check out a little article on Medium about the tool.

Navigation

Installation

Composer

It is already available in composer now, you can require it:
composer require maestroerror/html-strings-affixer --dev.
After installation it is accessible by:

Linux/Unix

Step 1: Download
Download binary file with wget https://github.com/MaestroError/html-strings-affixer/releases/latest/download/hsa

Step 2: Make it executable
Run in directory with downloaded file chmod a+x ./hsa (Use sudo if permission is required)

Step 3: Execution
You can move it in directory where you need to use and just execute with ./hsa [command] [-args] or Make it available viw command line.

Step 4: Command line (optional)
Find your bin folder (/usr/bin, /usr/sbin or ~/bin), or make it with cd ~/ && mkdir bin and Symlink (ln -s $~/path/to/directory/hsa ~/bin/hsa) or move/copy binary file in bin directory. After it you can use app in cli with "hsa" command. Try: hsa check

Windows

Download binary file or Zip. Get "hsa.exe" file in needed directory and run with ".\hsa.exe"

MacOS

Download an archive, Unzip it, get "hsamac" or "hsamacm1" file in needed directory, give to it executable permissions and run with ./hsamac or ./hsamacm1

From source

If you have golang installed, you can clone this repo and run go install or go build for binary file

Features

Config file

You need to create "affixer.json" file in directory, from where you will run html-strings-affixer. You can find an example in bin folder of this repository (bin/affixer-example.json).
Alternativly you can run app without config file in your working directory and it will offer you to create one from example

JSON object and descriptions

Commands

Available commands:

Some configs you can pass as arguments, use hsa [command] --help to read more about command.

Replace command options

Check command options

Usage

It is recommended to use tool with config file, where you can specify all needed info and use all features, that tool is providing. If you already have configured file you can easily run:

In this usage guide, we will cover some CLI use cases, but you can use them alongside with config file, because options provided from command line has higher priority. They re-write all passed options while specific run, but all other configs provided by JSON file stays same.

Just Affix it!

For example, you can: Easily affix all html strings with @lang directive in templates folder. To do so, run:

in another words:

Note: Keep in mind that "@" character is not a part of default ignore or warning chars, you need to specify it via config file

Force replace

If you use git and have uncommitted changes, it is recommended to first commit or stash them and after run replace command, so hsa will ask you about it on every run. If you already tested the tool and you know what are you doing, you can use -force parameter to skip that prompt.

Note: For now, HSA has not UNDO command, so be careful while running replace

Work with one file

Sometimes you will need to perform some commands only on single file, to reduce memory usage, get smaller printed information and/or avoid unwanted changes. For that purpose you can use option -file:

Too many warning

Sometimes with large project there are too many warning to check them via terminal. For such cases -report option could be helpful, it will generate JSON file with all warnings in it:

Note that -report option is availabe for both, replace and check commands. Also, it can be set via JSON file as report: true.

Executables

There are several executables for different platforms, choose your one and use it. They are working the exactly same way, you are changing just the executable file name in command.

Note: I am planning to create single command, which will work for any platform, but for now, it is as it is :smile:

Support

Support Our Work? 🌟 You can help us keep the code flowing by making a small donation. Every bit of support goes a long way in maintaining and improving our open-source contributions. Click the button below to contribute. Thank you for your generosity!

Or use QR code:



To Do




Updated 21/09/2023:


Upcoming

Resources


All versions of html-strings-affixer with dependencies

PHP Build Version
Package Version
No informations.
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 maestroerror/html-strings-affixer contains the following files

Loading the files please wait ....