本文整理汇总了PHP中validator::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP validator::getErrors方法的具体用法?PHP validator::getErrors怎么用?PHP validator::getErrors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator
的用法示例。
在下文中一共展示了validator::getErrors方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}
示例3: csvparser
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;
示例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);
}
}
示例5: array
<?php
// Require app files
require 'app/User.php';
require 'app/Validator.php';
require 'app/Helper.php';
//Set data and validation rules
$rules = array('email' => 'required|email', 'password' => 'required|min:8');
$data = array('email' => 'joost@tutsplus.com', 'password' => '12346789', 'foo' => 'bar');
// Run validation
$validator = new validator();
if ($validator->validate($data, $rules) == true) {
//Validation passed. Set user values.
$joost = new User($data);
$joost->email = 'sometheremail@tutsplus.com';
$joost->password = 'sadfsadfsad';
//var_dump($joost->email);
//var_dump($joost->password);
//Dump user
// var_dump($joost);
echo $joost;
} else {
// Validation failed. Dump validation errors.
var_dump($validator->getErrors());
}
示例6: array
<link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>
<body>
<h1 align="center">Gmail</h1>
<h2 align="center">signup</h2>
<?php
if (!empty($_POST)) {
require_once 'function.php';
$errors = array();
$validatorObj = new validator($_POST);
$validatorObj->validate();
if ($validatorObj->getIsValid()) {
// create user object for OOP manipulation
$userObj = new User($_POST);
} else {
$errors = $validatorObj->getErrors();
}
}
if (!empty($errors)) {
?>
<p> errors occured:please check</p>
<p class="error">
<?php
if (is_array($errors)) {
foreach ($errors as $val) {
echo $val . '<br />';
}
}
?>
</p>
<?php