/** * This function evaluates a datapath relativ to the given dataset. * * @param string $strDataPath The XML data path * @param Xml $mxtDataset The dataset on which the datapath should be applied * @param bool $bolStringOnly If true, the function will only return results of type string * @param bool $bolStrict If strict mode is of, the function will try to convert unfitting object to strings (e.g. XML files) * @return string|array|Xml|mixed */ private function xdrRetriveData($strDataPath, $mxtDataset, $bolStringOnly = true, $bolStrict = false) { // TESTING: $this->probe('xdrRetriveData', "STEP3: Evaluating datapath", 7); // TESTING: $this->probe('xdrRetriveData', "Only Strings: ".($bolStringOnly?'on':'off'), 7); // TESTING: $this->probe('xdrRetriveData', "Path: ".$strDataPath, 7); if (is_array($mxtDataset)) { // TESTING: $this->probe('xdrRetriveData', "Dataset is an array", 8); $xlyArray = new Dict($mxtDataset); return $xlyArray->get($strDataPath, false); } elseif ($mxtDataset instanceof Xml || $mxtDataset instanceof Bean) { // TESTING: $this->probe('xdrRetriveData', "Dataset is an XML/Bean document", 8); if ($bolStringOnly) { // TESTING: $this->probe('xdrRetriveData', "Tracing the datapath now: ".$strDataPath, 9); return $mxtDataset->trace($strDataPath); } else { // TESTING: $this->probe('xdrRetriveData', "Retrieving the object now: ".$strDataPath, 9); $mxtData = $mxtDataset->getNodesByPath($strDataPath); if (isset($mxtData[1])) { return $mxtData; } elseif (isset($mxtData[0])) { return $mxtData[0]; } else { return false; } } } else { // TESTING: $this->probe('xdrRetriveData', "Invalid dataset: Dataset must be an array or XML/Bean object.", 8); return false; } }
<?php return array('driver' => 'mailgun', 'host' => 'smtp.mailgun.org', 'port' => 587, 'from' => array('address' => \Dict::get('email_from_email'), 'name' => \Dict::get('email_from_name', 'CMS')), 'encryption' => 'tls', 'username' => null, 'password' => null, 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false);
private function getOneDict($identifier, $default) { return \Dict::get($identifier, $default); }
<?php return array('mailgun' => array('domain' => \Dict::get('mailgun_domain'), 'secret' => \Dict::get('mailgun_secret')), 'mandrill' => array('secret' => ''), 'stripe' => array('model' => 'User', 'secret' => ''));