Download the PHP package jakesutherland/nomad-helpers without Composer
On this page you can find all versions of the php package jakesutherland/nomad-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jakesutherland/nomad-helpers
More information about jakesutherland/nomad-helpers
Files in jakesutherland/nomad-helpers
Package nomad-helpers
Short Description A WordPress PHP Composer package that provides helper functions and utilities that are used in other Nomad Composer Packages.
License MIT
Homepage https://jakesutherland.com
Informations about the package nomad-helpers
Nomad Helpers
A WordPress PHP Composer package that provides helper functions and utilities that are used in other Nomad Composer Packages.
Installation
You can install Nomad Helpers in your project by using composer.
Documentation
Majority of the Nomad Helpers functions and utilities provided are fairly self explanatory and already well documented within the code-base.
Only the important stuff that you need to worry about is below.
Nomad Environment
The NOMAD_ENV
constant is used to determine the type of environment that your WordPress installation is running on. This should be defined in your wp-config.php
file.
Possible values: development
staging
production
Default value: production
If you are building out your project locally on your computer, you'll want to configure your environment for development:
If you are testing your website in a staging environment:
If your website is live, configure your environment for production:
It is highly recommended that you never have a live production website set to development
.
Nomad Debugging
The NOMAD_DEBUG
constant is used to show additional debugging information when in a development
environment. This should also be defined in your wp-config.php
file.
Nomad Errors
While working on your project in a development environment, you may come across a Nomad Error. The purpose for Nomad Errors is to help steer you in the right direction when developing with Nomad features and utilities.
Nomad Errors will stop all processing and display error messages when NOMAD_ENV
is set to development
.
If NOMAD_ENV
is set to staging
or production
then Nomad Errors will not be displayed.
IMPORTANT: If NOMAD_ENV
is NOT defined and is NOT set to development
you will not see any Nomad Error messages! The assumption is that, by default, you're on a production environment.
Nomad Exceptions
Much different than Nomad Errors, Nomad Exceptions happen when the code cannot recover from itself and the application needs to stop processing. Something is broken.
Nomad Exceptions will be displayed regardless of your NOMAD_ENV
setting.
Register Nomad Package & Plugin
The register_nomad_package()
and register_nomad_plugin()
functions register a Nomad Package or Plugin in the global scope. This way the system knows which Nomad Packages or Plugins are available and being used. It passes in the path that its installed to help determine where the specific package is being loaded. This is important because every Nomad Plugin likely utilizes multiple Nomad Packages as dependencies, and each Nomad Package may also have its own dependencies.
Every Nomad Package is developed in such a way that it will only load once, no matter how many instances may be installed across other various Nomad Plugins or Packages.
Changelog
1.2.0
- Added
register_nomad_package()
andregister_nomad_plugin()
functions. - Added
Nomad_Constants
class that contains various constants. - Updated
Nomad_Exception
class filename to be prefixed withclass-
. - Updated changelog version number formatting.
- Fixed
nomad_format_attributes()
when an attribute is a boolean and its value is false, the key should not be added to the list of attributes. - Removed
type
property fromcomposer.json
file.
1.1.0
- Updated constants (package is called Nomad Helpers, not Nomad Helper).
- Updated constants commenting to include context and version number it was added.
- Updated
nomad_error()
function comments to provide more context of expectations. - Added
NOMAD_ENV
documentation toREADME.md
. - Added
NOMAD_HELPERS_SRC_PATH
constant. - Added
NOMAD_DEBUG
constant (defaultfalse
). - Added
NOMAD_DEBUG
documentation toREADME.md
. - Added
Nomad_Exception
class. - Added
Nomad_Exception
documentation toREADME.md
. - Added
nomad_error()
documentation toREADME.md
. - Added
nomad_array_keys_exist()
function. - Added
nomad_array_keys_missing()
function. - Added Changelog to
README.md
.
1.0.0
- Initial Release
License
The MIT License (MIT). Please see License File for more information.
Copyright
Copyright (c) 2021 Jake Sutherland