Download the PHP package workofstan/backyard without Composer
On this page you can find all versions of the php package workofstan/backyard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download workofstan/backyard
More information about workofstan/backyard
Files in workofstan/backyard
Package backyard
Short Description Library of useful functions and classes
License MIT
Homepage https://github.com/WorkOfStan/backyard
Informations about the package backyard
Library In Backyard
Collection of useful functions
Requirements
- PHP 5.3.0 or higher (i.e. not used [] instead of array() as this short syntax can be used only since PHP 5.4)
Installation
You can use Composer or simply Download the Release
Composer
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
Finally, be sure to include the autoloader:
Download the Release
If you abhor using composer, you can download the package in its entirety. The Releases page lists all stable versions.
Download any file with the name backyard/archive/[TAG].zip
for a package including this library and its dependencies.
Uncompress the ZIP file you download, and include the autoloader in your project:
Deployment
After the autoloader is included you may create the backyard
object with default configuration:
Or you may configure it with following options:
Notes
NB: BackyardMysqli creates no Backyard->Mysqli object (as e.g. Backyard->Json does) because it is not used by LIB itself and more importantly user of LIB may create any number of those. Example of usage:
class BackyardBriefApiClient
Very simple JSON RESTful API client. It just sends JSON and returns what is to be returned with few optional decorators and error logging.
sendJsonLoad
- sends JSON and returns whatever is returned with second OPTIONAL parameter with HTTP verbGET
,PUT
,DELETE
getJsonArray
- sends JSON and returns array decoded from response JSONgetArrayArray
- encode array to a JSON and returns array decoded from response JSON
About previous versions
Their code is disabled and therefore secured.
backyard 1 usage
This array MUST be created by the application before invoking backyard 1
Invoking backyard 1
backyard 2 usage
The array $backyardDatabase (see above) SHOULD be created ONLY IF there is a table `system` (or different name stated in $backyardDatabase['system_table_name']) with fields containing backyard system info.
Usage:
Requires the basic LIB library. All other LIB components to be included by
Recommendation
To be in control of the logging, set following before requiring LIB
Once your application is production ready, set following before requiring LIB
src/emulator.php get_data in a defined manner (@todo - better describe)
src/emulate.php is an envelope for emulator.php
Geolocation functions described in src/backyard_geo.php . Expected structure of geo related tables is in sql/poi.sql .
Naming conventions (2013-05-04)
- Naming conventions
- I try to produce long, self-explaining method names.
- Comments formatted as Phpdoc, JSDoc
- I prefer to tag the variable type. I write rather entityA (array of entities) than simple entities. For an instance of song object, rather than song I name the variable songO.
- Some examples:
- variable, method, function, elementId – camelCase
- class name – UpperCamelCase
- URL – hyphened-text
- file, database_column, database_table – underscored_text
- constant – BIG_LETTERS
- Comments
- Primary language of comments is English.
- Deprecated or obsolete code blocks are commented with prefix of the letter “x”. I may add reason for making the code obsolete as in the following:
- //Xhe’s got ID from the beginning: $_SESSION["id"] = User::$himself->getId();