public static function getInstance() { if (is_null(self::$conn)) { self::$conn = new \PDO('mysql:host=' . Config::getHost() . ';dbname=' . Config::getDatabase(), Config::getUsername(), Config::getPassword(), []); } return self::$conn; }
public function __construct(Config $config) { $paths = [$config->getModelPath()]; $isDevMode = $config->getDevMode(); $dbParams = ['driver' => $config->getDriver(), 'user' => $config->getUser(), 'password' => $config->getPassword(), 'dbname' => $config->getDbname()]; $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode); $this->entityManager = DoctrineEntityManager::create($dbParams, $config); }
/** * @param Hypercharge\IUrl $url * @param Hypercharge\IRequest $request * @return Hypercharge\IResponse * @throws Hypercharge\Error */ public function call(IUrl $url, IRequest $request) { $curl = Config::getFactory()->createHttpsClient(Config::getUser(), Config::getPassword()); $serializer = new XmlSerializer(); $responseStr = $curl->xmlPost($url->get(), $serializer->toXml($request)); $responseDom = new \SimpleXMLElement($responseStr); return $request->createResponse(XmlSerializer::dom2hash($responseDom)); }
/** * @param string $user * @param string $passw * @return Hypercharge\IHttpsClient */ function createHttpsClient($user = null, $passw = null) { if ($user === null) { $user = Config::getUser(); } if ($passw === null) { $passw = Config::getPassword(); } return new Curl($user, $passw); }
public function login() { if (!empty($_POST['username']) and !empty($_POST['password'])) { if ($_POST['username'] === Config::getUser() and sha1('#1_' . $_POST["password"] . '+%6') === Config::getPassword()) { session_start(); (string) ($_SESSION['user'] = $_POST['username']); header("Location: " . Config::getInstallPath()); exit; } } }
public function __construct($userid = null, $pass = null) { if (!isset($userid) && !isset($pass)) { $config = new Config(); $userid = $config->getUsername(); $pass = $config->getPassword(); } $this->baseUrl = 'http://sso.bhmobile.bhtelecom.ba/'; // izmjena nakon što je BH Telecom izmijenio stranicu $this->actionUrl = '/sso/login'; $this->fields = array(new Field('application', ''), new Field('url', 'http://www.bhmobile.bhtelecom.ba/'), new Field('realm', 'sso'), new Field('userid', $userid), new Field('password', $pass)); }
/** * @return \PDO */ private function connect() { $dsn = Config::getDsn(); $username = Config::getUsername(); $password = Config::getPassword(); try { return new \PDO($dsn, $username, $password); } catch (\PDOException $e) { echo $e->getMessage(); die; } }
/** * @covers Pronamic\Twinfield\Secure\Config::getPassword * @todo Implement testGetPassword(). */ public function testGetPassword() { $this->object->setCredentials('testUsername', 'testPassword', 'testOrganisation', 1001); $this->assertSame($this->object->getPassword(), 'testPassword'); }
/** * @param string $text * @return string */ private function getAuthenticationToken($text) { return md5(md5($this->config->getPassword()) . $this->config->getLogin() . 'send' . substr($text, 0, self::AUTH_MSG_LENGTH)); }
/** * @param array $params simply pass $_POST into * @return Hypercharge\TransactionNotification * @throws Hypercharge\Errors\ArgumentError if $params empty or merchant password not set with Config::set() */ static function notification($params) { $tn = new TransactionNotification($params); $passw = Config::getPassword(); if (empty($passw)) { throw new Errors\ArgumentError('password is not configured! See Hypercharge\\Config::set()'); } $tn->verify($passw); return $tn; }
/** * @private * @param string $action * @param string $channelToken * @param string $unique_id * @return Hypercharge\Transaction */ static function request($action, $channelToken, $unique_id) { $url = new TransactionUrl(Config::ENV_SANDBOX, $channelToken, $action); $url = $url->get() . '/' . $unique_id; $curl = new Curl(Config::getUser(), Config::getPassword()); $responseStr = $curl->xmlPost($url, ''); $responseDom = new \SimpleXMLElement($responseStr); // dummy $request = new TransactionRequest(array('transaction_type' => 'sale')); return $request->createResponse(XmlSerializer::dom2hash($responseDom)); }