本文整理匯總了PHP中Configuration::getConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::getConfig方法的具體用法?PHP Configuration::getConfig怎麽用?PHP Configuration::getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Configuration
的用法示例。
在下文中一共展示了Configuration::getConfig方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionIpn
public function actionIpn()
{
require_once 'paypal/PPBootStrap.php';
$log = new Log();
$log->description = "";
$ipnMessage = new PPIPNMessage(null, Configuration::getConfig());
foreach ($ipnMessage->getRawData() as $key => $value) {
$log->description .= "IPN: {$key} => {$value}\n";
}
if ($ipnMessage->validate()) {
$log->description .= "Success: Got valid IPN data\n";
//if($ipnMessage->getRawData()['business']=='marisaloorv-facilitator@yahoo.com') {
if ($ipnMessage->getRawData()['business'] == 'marisaloorv@yahoo.com') {
$reservation = Reservation::model()->findByPk(substr($ipnMessage->getRawData()['item_number'], 3, -1));
if (isset($reservation)) {
if ($ipnMessage->getRawData()['mc_gross'] == $reservation->total) {
if ($ipnMessage->getRawData()['payment_status'] == 'Completed') {
$reservation->status = 'PAID';
$reservation->payment_date = date('Y-m-d H:i:s', strtotime($ipnMessage->getRawData()['payment_date']));
$reservation->note = $ipnMessage->getRawData()['memo'];
} else {
$reservation->status = 'ERROR';
}
if ($reservation->save()) {
$log->description .= "reservation saved\n";
$subject = 'Reservación';
$name = $reservation->user->name . " " . $reservation->user->lastname;
$body = "{$name} ha hecho una reservación y ha pagado exitosamente.\n" . "Fecha llegada: " . $reservation->arrival_date . "\n" . "Fecha salida: " . $reservation->departure_date . "\n" . "Max # personas: " . $reservation->number_people . "\n" . "Nota: " . $reservation->note . "\n" . "Total: \$" . $reservation->total;
$headers = "From: {$name} <no-reply@eden-blue.com>\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=UTF-8";
mail(Yii::app()->params['adminEmail'], $subject, $body, $headers);
$log->description .= "email sent\n";
$subject = 'Reservación EdenBlue';
$name = $reservation->user->name . " " . $reservation->user->lastname;
$body = "Has hecho una reservación y ha pagado exitosamente. Ahora puedes dirigirte a nuestras instalaciones.\n" . "Fecha llegada: " . $reservation->arrival_date . "\n" . "Fecha salida: " . $reservation->departure_date . "\n" . "Max # personas: " . $reservation->number_people . "\n" . "Total: \$" . $reservation->total;
$headers = "From: EdenBlue <no-reply@eden-blue.com>\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=UTF-8";
mail($ipnMessage->getRawData()['payer_email'], $subject, $body, $headers);
$log->description .= "email sent to payer\n";
} else {
$log->description .= "reservation no saved\n";
}
} else {
$log->description .= "bad total amount\n";
}
} else {
$log->description .= "reservation not found\n";
}
} else {
$log->description .= "bad receiver_id\n";
}
} else {
$log->description .= "Error: Got invalid IPN data";
}
$log->creation_date = date('Y-m-d H:i:s');
if ($log->save()) {
echo "saved";
} else {
echo "no saved";
}
}
示例2: PPIPNMessage
<?php
/**
* This is a sample implementation of an IPN listener
* that uses the SDK's PPIPNMessage class to process IPNs
*
* This sample simply validates the incoming IPN message
* and logs IPN variables. In a real application, you will
* validate the IPN and initiate some action based on the
* incoming IPN variables.
*/
require_once '../PPBootStrap.php';
// first param takes ipn data to be validated. if null, raw POST data is read from input stream
$ipnMessage = new PPIPNMessage(null, Configuration::getConfig());
foreach ($ipnMessage->getRawData() as $key => $value) {
error_log("IPN: {$key} => {$value}");
}
if ($ipnMessage->validate()) {
error_log("Success: Got valid IPN data");
} else {
error_log("Error: Got invalid IPN data");
}
示例3: Configuration
<?php
$managerConfig = new Configuration();
if (isset($_POST['validate'])) {
$newConfig = array();
$newConfig['version'] = "1.1";
$newConfig['showRate'] = isset($_POST['showRate']) ? "true" : "false";
$newConfig['responsive'] = isset($_POST['responsive']) ? "true" : "false";
$newConfig['bp_shareActivity'] = isset($_POST['bp_shareActivity']) ? "true" : "false";
$newConfig['bp_shareResult'] = isset($_POST['bp_shareResult']) ? "true" : "false";
$newConfig['share_socialNetwork'] = isset($_POST['share_socialNetwork']) ? "true" : "false";
$newConfig['showTag'] = isset($_POST['showTag']) ? "true" : "false";
$newConfig['showGlossary'] = isset($_POST['showGlossary']) ? "true" : "false";
$sizes = array("small", "medium", "large");
$newConfig['sizePlayer'] = isset($_POST['sizePlayer']) && in_array($_POST['sizePlayer'], $sizes) ? $_POST['sizePlayer'] : $sizes[1];
$managerConfig->InsertConfig($newConfig);
}
$configuration = $managerConfig->getConfig();
require_once __ROOT_PLUGIN__ . 'Views/admin/configuration.view.php';