Download the PHP package amsify42/php-command-line without Composer

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

PHP Command Line

This is a php package for dealing with command line parameters.

Installation

Table of Contents

  1. Introduction
  2. Getting Parameters
  3. Double Hyphen Param
  4. To String
  5. CLI Task

1. Introduction

The class Amsify42\CommandLine\CommandLine class helps get the cli parameter passed in any of the format.

or

or

2. Getting Parameters

To get all the parameters passed you can call this method

or with helper method

To get the specific key param

or

To check the whether the cli param exist

or

It will return true if exist else false

3. Double Hyphen Param

The helper class can also detect the param name passed with double hyphen

We can use the same isParam method to check whether global param passed or not.

4. To String

We can also convert all the cli params passed back to the string with this method.

or

5. CLI Task

Create a class under any directory, Example: /app/Task/

You can run this script from console from other file like test.php

and run this file

If script file name is passed directly from command line

and run the file with task file name

For programmatically running the script, you can use this method

For running script in background asynchronously, you need to pass 3th param as true

Params/Validations

You can also pass cli params along with script like this

Through method

and can collect these params in the script

To validate and check whether the params exist, you can do this

Further script will not be executed if validation fails.


All versions of php-command-line with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
amsify42/php-vars-data Version dev-master
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 amsify42/php-command-line contains the following files

Loading the files please wait ....