当前位置: 首页>>代码示例>>PHP>>正文


PHP validator::validateInput方法代码示例

本文整理汇总了PHP中validator::validateInput方法的典型用法代码示例。如果您正苦于以下问题:PHP validator::validateInput方法的具体用法?PHP validator::validateInput怎么用?PHP validator::validateInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在validator的用法示例。


在下文中一共展示了validator::validateInput方法的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;
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:11,代码来源:sendSMS.class.php

示例2: csvparser

include_once 'init.inc.php';
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'){
开发者ID:Git-Host,项目名称:sms,代码行数:31,代码来源:process_airdb.php

示例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);
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:44,代码来源:textAnywhere.class.php

示例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);
     }
 }
开发者ID:Git-Host,项目名称:sms,代码行数:32,代码来源:getSMSStatus.class.php


注:本文中的validator::validateInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。