Exemplo n.º 1
0
 /**
  * Initialize the required builder, based on the use's
  * preference (set inside the configuration ini file)
  *
  * @param string $interface
  */
 public function __construct($interface = null)
 {
     $interface = $interface ?: \Genesis\Config::getInterface('parser');
     switch ($interface) {
         default:
         case 'xml':
             $this->context = new Parsers\XML();
             break;
         case 'json':
             break;
     }
 }
 /**
  * Initialize the Network instance with API Request instance
  *
  * @param string $interface
  */
 public function __construct($interface = null)
 {
     $interface = $interface ?: \Genesis\Config::getInterface('network');
     switch ($interface) {
         default:
         case 'curl':
             $this->context = new Network\cURL();
             break;
         case 'stream':
             $this->context = new Network\Stream();
             break;
     }
 }
Exemplo n.º 3
0
 /**
  * Check if the current system fulfils the project's dependencies
  *
  * @throws \Exception
  */
 public static function verify()
 {
     // PHP interpreter version
     self::checkSystemVersion();
     // BCMath
     self::isFunctionExists('bcmul', self::getErrorMessage('bcmath'));
     self::isFunctionExists('bcdiv', self::getErrorMessage('bcmath'));
     // Filter
     self::isFunctionExists('filter_var', self::getErrorMessage('filter'));
     // Hash
     self::isFunctionExists('hash', self::getErrorMessage('hash'));
     // XMLReader
     self::isClassExists('XMLReader', self::getErrorMessage('xmlreader'));
     // XMLWriter
     if (\Genesis\Config::getInterface('builder') == 'xml') {
         self::isClassExists('XMLWriter', self::getErrorMessage('xmlwriter'));
     }
     // cURL
     if (\Genesis\Config::getInterface('network') == 'curl') {
         self::isFunctionExists('curl_init', self::getErrorMessage('curl'));
     }
 }