1. Go to this page and download the library: Download drewm/morse library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
drewm / morse example snippets
use \DrewM\Morse\Morse;
if (Morse::featureExists('http/curl')) {
// use curl
}else{
// use sockets
}
Morse::featureExists('group/feature');
if (Morse::featureExists('file/finfo')) {
...
}
switch(Morse::featureExists('file/finfo')) {
case Morse::CLASS_SUPPORT:
$finfo = new finfo(...);
break;
case Morse::FUNCTION_SUPPORT:
$finfo = finfo_open(...);
break;
default:
die('No finfo support!');
break;
}
namespace DrewM\Morse\Feature;
class Db extends \DrewM\Morse\Feature
{
public function testPongo_Panda()
{
// do whatever needs to be done to determine support
// return true for support, false for no support;
return true;
}
}
namespace DrewM\Morse\Feature;
class Db extends \DrewM\Morse\Feature
{
public function testPongo_Panda()
{
if (class_exists('PongoPanda')) {
return \DrewM\Morse\Morse::CLASS_SUPPORT;
}
if (self::functionAvailable('pongo_panda')) {
return \DrewM\Morse\Morse::FUNCTION_SUPPORT;
}
return false;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.