本文整理汇总了PHP中validator::getCleanData方法的典型用法代码示例。如果您正苦于以下问题:PHP validator::getCleanData方法的具体用法?PHP validator::getCleanData怎么用?PHP validator::getCleanData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator
的用法示例。
在下文中一共展示了validator::getCleanData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateResponse
private function validateResponse()
{
validator::loadDictionaries(array('TextAnywhereAPIResponse'));
validator::validateInput($this->result);
$this->cleanData = validator::getCleanData();
$errors = validator::getErrors();
if (!empty($errors)) {
$this->logdb->logValidationErrors($this->result, $errors);
exit;
}
}
示例2: csvparser
config::set('process_name', "AirDB - Process CSV");
include_once 'start.inc.php';
try {
$file_location = '/airdb.csv';
debug::output("Processing file: {$file_location}");
$csv = new csvparser($file_location);
mysql::i()->query("truncate airports_backup");
mysql::i()->query("insert into airports_backup select * from airports");
mysql::i()->query("truncate airports");
validator::loadDictionaries(array('AirDB'));
$iata = array('BKN', 'AAS', 'BOO');
$air = array();
foreach ($csv as $row) {
//print_r($row);
validator::validateInput($row);
$cleanData = validator::getCleanData();
$errors = validator::getErrors();
if (!empty($errors)) {
print_r($errors);
exit;
}
$cleanData['Airport'] = str_replace(']', '', str_replace('[', '', $cleanData['Airport']));
$sql = "INSERT INTO airports (ICAO,IATA,place,state,airport,country) VALUES ('{$cleanData['ICAO']}','{$cleanData['IATA']}','{$cleanData['Place']}','{$cleanData['State']}','{$cleanData['Airport']}','{$cleanData['Country']}') ";
mysql::i()->query($sql);
//if(in_array($cleanData['IATA'], $iata))continue;
//print_r($cleanData);
//print_r($cleanData);
/*
if(in_array($cleanData['IATA'], $air)){
if($air[$cleanData['IATA']]['Country'] == 'USA'){
$air[$cleanData['IATA']] = $cleanData;
示例3: send
protected function send()
{
$sc = $this->soap->open($this->soapPath);
$this->vars['method'] = $this->method;
$method = ucfirst($this->method);
validator::loadDictionaries(array(ucfirst($this->method)));
validator::validateInput($this->vars);
$cleanData = validator::getCleanData();
$errors = validator::getErrors();
if (empty($errors)) {
if ($this->live == true) {
$result = $sc->__call($method, array($this->params));
if (!empty($this->vars['body'])) {
debug::output('***************LIVE SENDING START***************');
debug::output($this->vars['body']);
debug::output('***************LIVE SENDING END***************');
}
$resultMethod = $method . 'Result';
//Dynamic method name dependent on the class name
$this->response = $result->{$resultMethod};
sleep(10);
//give the api time to report the message status
debug::output("\n");
debug::output('***************LIVE CHECK DELIVERY START***************');
$smsstatus = new smsstatus($this->vars);
$this->fault = $smsstatus->database();
debug::output('***************LIVE CHECK DELIVERY END***************');
} else {
//else dev
//log for DEV
//print_r($this->params);
//$this->logdb->updateLogOutboundSMS($this->params);
if (!empty($this->vars['body'])) {
debug::output('***************LIVE SENDING START***************');
debug::output($this->vars['body']);
debug::output('***************LIVE SENDING END***************');
}
}
//else dev
} else {
debug::output("There were errors in the data to be sent");
$logdb->logValidationErrors($this->vars, $errors);
}
}
示例4: sendold
private function sendold()
{
$sc = $this->soap->open($this->soapPath);
$this->vars['method'] = $this->method;
$method = ucfirst($this->method);
/*echo "VARS: ";
print_r($this->vars);
echo "END VARS";*/
validator::loadDictionaries(array(ucfirst($this->method)));
validator::validateInput($this->vars);
$cleanData = validator::getCleanData();
$errors = validator::getErrors();
/* echo "clean:";
print_r($cleanData);
print_r($errors);
echo "END clean";*/
if (empty($errors)) {
if ($this->live == true) {
$result = $sc->__call($method, array($this->params));
$resultMethod = $method . 'Result';
//Dynamic method name dependent on the class name
$this->response = $result->{$resultMethod};
$logf = new log_file('/api/textanywhere/');
$logf->request($this->method, $this->vars, $this->count);
$logf->response($this->method, $this->response, $this->count);
}
//if live
} else {
debug::output("There were errors in the data to be sent");
$logdb->logValidationErrors($this->vars, $errors);
}
}