示例#1
0
 /**
  * @author Manuel Will <*****@*****.**>
  * @since  2015-08
  *
  * @param array $credentials
  *
  * @throws SAP_Exception
  */
 public static function init(array $credentials, $compileDirectory)
 {
     if (null !== self::$singleton) {
         throw new SAP_Exception('SapRfcDal is already initialized.');
     }
     self::$singleton = new self($credentials, $compileDirectory);
 }
示例#2
0
 /**
  * @return null|SAP_Connection
  * @author Manuel Will
  * @since 2013
  */
 private function getConnection()
 {
     if (null === $this->connection) {
         $credentials = SAP_Factory::get()->getCredentials();
         $this->connection = new SAP_Connection($credentials);
     }
     return $this->connection;
 }
示例#3
0
<?php

use Symfony\Component\Yaml\Yaml;
include_once implode(DIRECTORY_SEPARATOR, [dirname(__DIR__), 'vendor', 'autoload.php']);
$config = Yaml::parse(file_get_contents('config.yml'));
SAP_Factory::init($config['credentials'], $config['compile-dir']);