Download the PHP package 3bg-supply-co/php-functions without Composer
On this page you can find all versions of the php package 3bg-supply-co/php-functions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3bg-supply-co/php-functions
More information about 3bg-supply-co/php-functions
Files in 3bg-supply-co/php-functions
Package php-functions
Short Description This package contains random functions and classes that can be reused in any PHP project.
License MIT
Informations about the package php-functions
PHP Functions
This package is a collection of reusable classes and functions that are currently being used in many of our projects.
Table of Contents
- Requirements
- Installation
- Usage
- ApiResponse Class
- HttpPost Class
- GenericFunctions
Requirements
In order to use this package, the following requirements must be met:
- credentials.ini file must exist 2 levels above the root directory
- For example: if the code is deployed to the following directory: , then the file would have to be located in the following directory: .
- Composer
- PHP version 7.0+
- SSH Access
- Follow this tutorial to set up the SSH Key
- You can test it by running the following command on the machine with the SSH Key:
Installation
To install this package, the following steps must be followed (in order):
- Create a composer.json file in your project by running the following command:
-
After going through the options, add the following code to the composer.json file:
- Run
Usage
To use this collection of code, determine what your need is. All classes found in this package will use the base namespace Common3BG.
To use the logging function writeLog(), the /tmp/ directory must have write permissions by the user executing the script.
For example, if all you need is access to the functions found in the file, then just call said function in your script.
If you need to use one of the classes (such as ApiResponse), then you must include the proper namespace. For example, the following line of code is needed to use the ApiResponse class:
ApiResponse Class
This class takes no parameters.
The following method
Sample PHP Code
Sample Success Response
Sample Failure Response
HttpPost Class
Documentation Coming Soon!
GenericFunctions
Documentation Coming Soon!