Download the PHP package drewm/morse without Composer

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

Morse: the PHP detective-inspector

Morse is a feature detection library for PHP code that needs to run in multiple different environments.

Build Status Scrutinizer Code Quality

Supports PHP 5.3 and up.

Why?

Writing PHP that works in unknown (some sometimes hostile) environments is hard. You don't always know what functionality is available to you, so you have to test for it. Morse is a library to encapsulate those tests.

Most tests are really simple - just a function_exists() or similar - but you can often end up needing to repeat that test over and over across your codebase. Morse centralises those tests, providing reusability and consistancy.

Some tests aren't so simple, perhaps due to that one weird PHP bug or unusual hosting configurations or whatever. You have to do a weird dance to check if something is really going to work. Morse takes care of that, and keeps the weird dancing out of your application code, safe from the next developer who thinks it's dumb and rips it out.

Install

Either download and include, or install via Composer:

How to

Testing if a feature exists

Features that may be available in either newer class support or older function support can return a value of Morse::CLASS_SUPPORT or Morse::FUNCTION_SUPPORT, both of which are truthy.

So this works:

but equally:

If class support is found, this returns regardless of function support.

Finding the first match in a list

or

Features

Feature detection tests currently exist for the following:

Contributing feature tests

Feature tests are functions in the appropriate class that return true or false to indicate support for a feature.

Let's say you wanted to add a feature detection test for a database called Pongo. You would test for it with the feature identifier db/pongo, which would map to a function called testPongo in the Feature/Db.php class file.

Both half of the feature identifier are run through ucwords() to correct case. Dashes are changed to underscores. So db/pongo-panda would map to Feature\Db::testPongo_Panda.

If a feature can exist in both OO-style classes and procedural-style function form, return \DrewM\Morse\Morse::CLASS_SUPPORT or \DrewM\Morse\Morse::FUNCTION_SUPPORT as your truthy value. Check for classes first.

Feature classes should be big concepts (image, text, database) and the tests themselves should be specific features.

Please write a corresponding PHPUnit test for the feature you're adding. Note that you can't rely on the environment, so just test that the detection works and returns a sane value.

Testing for function availability

PHP gives us function_exists() for testing if a function has been declared. In some circumstances (e.g. when suhosin blacklisting is invoked), this can return true even if the function has been disabled and isn't available for use. Therefore, do the following within a feature class to detect whether a function is both declared and not disabled:

self::functionAvailable('pongo_panda')

All versions of morse with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 drewm/morse contains the following files

Loading the files please wait ....