This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via 544d5db1fa7a0a5f7fddfc263748667985345b65 (commit)
from 279ece5220bf321c2ce9cd9ef59972fea183ef06 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 544d5db1fa7a0a5f7fddfc263748667985345b65
Author: Ivan1986 <iva...@li...>
Date: Fri Jun 25 10:24:33 2010 +0400
Удалена нафиг не нужная TrueValidation
diff --git a/lib/Language.php b/lib/Language.php
deleted file mode 100755
index e2aaf43..0000000
--- a/lib/Language.php
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/**
- * CodeIgniter
- *
- * An open source application development framework for PHP 4.3.2 or newer
- *
- * @package CodeIgniter
- * @author Rick Ellis
- * @copyright Copyright (c) 2006, EllisLab, Inc.
- * @license http://www.codeignitor.com/user_guide/license.html
- * @link http://www.codeigniter.com
- * @since Version 1.0
- * @filesource
- */
-
-// ------------------------------------------------------------------------
-
-/**
- * Language Class
- *
- * @package CodeIgniter
- * @subpackage Libraries
- * @category Language
- * @author Rick Ellis
- * @link http://www.codeigniter.com/user_guide/libraries/language.html
- */
-class Language {
-
- var $language = array();
- var $is_loaded = array();
-
- /**
- * Constructor
- *
- * @access public
- */
- function __construct()
- {
-
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Load a language file
- *
- * @access public
- * @param mixed the name of the language file to be loaded. Can be an array
- * @param string the language (english, etc.)
- * @return void
- */
- function load($langfile = '', $idiom = '', $return = FALSE)
- {
- global $config;
- $langfile = $langfile.'_lang.php';
-
- if (in_array($langfile, $this->is_loaded, TRUE))
- {
- return;
- }
-
- if ($idiom == '')
- {
- $deft_lang = $config['host']['lang'];
- $idiom = is_null($deft_lang) ? 'en_EN' : $deft_lang;
- }
-
- // Determine where the language file is and load it
- if (file_exists(APPPATH.'/language/'.$idiom.'/'.$langfile))
- {
- include(APPPATH.'/language/'.$idiom.'/'.$langfile);
- }
- else
- {
- if (file_exists(LIBPATH.'/language/'.$idiom.'/'.$langfile))
- {
- include(LIBPATH.'/language/'.$idiom.'/'.$langfile);
- }
- else
- {
-//!!! show_error('Unable to load the requested language file: language/'.$langfile);
- }
- }
-
-
- if ( ! isset($lang))
- {
-//!!! log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
- return;
- }
-
- if ($return == TRUE)
- {
- return $lang;
- }
-
- $this->is_loaded[] = $langfile;
- $this->language = array_merge($this->language, $lang);
- unset($lang);
-
-//!!! log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile);
- return TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Fetch a single line of text from the language array
- *
- * @access public
- * @param string the language line
- * @return string
- */
- function line($line = '')
- {
- return ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
- }
-
-}
-// END Language Class
-QFW::$libs['lang'] = new Language();
-?>
\ No newline at end of file
diff --git a/lib/True_validation.php b/lib/True_validation.php
deleted file mode 100755
index 4989b5d..0000000
--- a/lib/True_validation.php
+++ /dev/null
@@ -1,471 +0,0 @@
-<?php
-
-class True_Validation {
-
- var $_rules = array(); //Правила для проверки
- var $_data = array(); //Данные для проверки.
- var $_fields = array(); //Заголовки полей
- var $_errors = array(); //Массив ошибок
- var $_error_messages = array();//Собственные сообщения об ошибках
-
- function True_Validation() {
- $this->init();
- require_once(LIBPATH.'/Language.php');
- }
-
- function init() {
- $this->_rules = array();
- $this->_data = array();
- $this->_fields = array();
- }
-
- function set_data($data = '') {
- if ($data == '') {
- return FALSE;
- } else {
- $this->_data = $data;
- }
- }
-
- function set_rules($rules = '') {
- if ($rules == '') {
- return;
- }
-
- foreach ($rules as $key => $val) {
- $this->_rules[$key] = $val;
- }
- }
-
- function set_fields($data = '', $field = '') {
- if ($data == '') {
- if (count($this->_fields) == 0) {
- return FALSE;
- }
- } else {
- if ( ! is_array($data)) {
- $data = array($data => $field);
- }
-
- if (count($data) > 0) {
- $this->_fields = $data;
- }
- }
- }
-
- function set_message($lang, $val = '') {
- if ( ! is_array($lang))
- {
- $lang = array($lang => $val);
- }
-
- $this->_error_messages = array_merge($this->_error_messages, $lang);
- }
-
- function add_error($field, $error) {
- $this->_errors[$field][] = $error;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Run the Validator
- *
- * This function does all the work.
- *
- * @access public
- * @return bool
- */
- function run($clean_errors = TRUE) {
- if ($clean_errors) {
- $this->_errors = array();
- }
-
- // Do we even have any data to process? Mm?
- if (count($this->_data) == 0 OR count($this->_rules) == 0) {
- return FALSE;
- }
-
- // Load the language file containing error messages
- QFW::$libs['lang']->load('true_validation');
-
- // Cycle through the rules and test for errors
- foreach ($this->_rules as $field => $rules) {
- //Explode out the rules!
- $ex = explode('|', $rules);
-
- /*
- * Are we dealing with an "isset" rule?
- *
- * Before going further, we'll see if one of the rules
- * is to check whether the item is set (typically this
- * applies only to checkboxes). If so, we'll
- * test for it here since there's not reason to go
- * further
- */
- if ( ! isset($this->_data[$field])) {
- if (in_array('isset', $ex, TRUE) OR in_array('required', $ex)) {
- if ( ! isset($this->_error_messages['isset'])) {
- if (FALSE === ($line = QFW::$libs['lang']->line('isset'))) {
- $line = 'The field was not set';
- }
- } else {
- $line = $this->_error_messages['isset'];
- }
-
- $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
- $this->add_error($field, sprintf($line, $mfield));
- }
-
- continue;
- }
-
- /*
- * Set the current field
- *
- * The various prepping functions need to know the
- * current field name so they can do this:
- *
- * $this->data[$this->_current_field] == 'bla bla';
- *
- $this->_current_field = $field;*/
-
- // Cycle through the rules!
- foreach ($ex As $rule) {
- // Strip the parameter (if exists) from the rule
- // Rules can contain a parameter: max_length[5]
- $param = FALSE;
- if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) {
- $rule = $match[1];
- $param = $match[2];
- }
-
- // Call the function that corresponds to the rule
- if ( ! method_exists($this, $rule)) {
- /*
- * Run the native PHP function if called for
- *
- * If our own wrapper function doesn't exist we see
- * if a native PHP function does. Users can use
- * any native PHP function call that has one param.
- */
- if (function_exists($rule)) {
- $this->_data[$field] = $rule($this->_data[$field]);
-// $this->$field = $this->data[$field];
- }
-
- continue;
- }
-
- $result = $this->$rule($this->_data[$field], $param);
-
- // Did the rule test negatively? If so, grab the error.
- if ($result === FALSE) {
- if ( ! isset($this->_error_messages[$rule])) {
- if (FALSE === ($line = QFW::$libs['lang']->line($rule))) {
- $line = 'Unable to access an error message corresponding to your field name.';
- }
- } else {
- $line = $this->_error_messages[$rule];
- }
-
- // Build the error message
- $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
- $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param];
- // Add the error to the error array
- $this->add_error($field, sprintf($line, $mfield, $mparam));
-
- continue 2;
- }
- }
-
- }
-
- $total_errors = count($this->_errors);
-
- /*
- * Recompile the class variables
- *
- * If any prepping functions were called the $this->data data
- * might now be different then the corresponding class
- * variables so we'll set them anew.
- */
- if ($total_errors > 0) {
- $this->_safe_form_data = TRUE;
- }
-
-//!!! $this->set_fields();
-
- // Did we end up with any errors?
- if ($total_errors == 0) {
- return TRUE;
- }
- return FALSE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Required
- *
- * @access public
- * @param string
- * @return bool
- */
- function required($str)
- {
- if ( ! is_array($str))
- {
- return (trim($str) == '') ? FALSE : TRUE;
- }
- else
- {
- return ( ! empty($str));
- }
- }
-
- function reqpwd($str, $val)
- {
- if ( ! is_array($str))
- {
- return ($str == '') ? FALSE : TRUE;
- }
- else
- {
- return ( ! empty($str));
- }
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Match one field to another
- *
- * @access public
- * @param string
- * @return bool
- */
- function matches($str, $field)
- {
- if ( ! isset($this->_data[$field]))
- {
- return FALSE;
- }
-
- return ($str !== $this->_data[$field]) ? FALSE : TRUE;
- }
-
- function noeq($str, $val)
- {
- return ($str=== $val) ? FALSE : TRUE;
- }
-
- function pwd($str, $val)
- {
- return ($str!== $val) ? FALSE : TRUE;
- }
- // --------------------------------------------------------------------
-
- /**
- * Minimum Length
- *
- * @access public
- * @param string
- * @return bool
- */
- function min_length($str, $val)
- {
- if (preg_match("/[^0-9]/", $val))
- {
- return FALSE;
- }
-
- return (mb_strlen($str,QFW::$config['host']['encoding']) < $val) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Max Length
- *
- * @access public
- * @param string
- * @return bool
- */
- function max_length($str, $val)
- {
- if (preg_match("/[^0-9]/", $val))
- {
- return FALSE;
- }
-
- return (mb_strlen($str,QFW::$config['host']['encoding']) > $val) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Exact Length
- *
- * @access public
- * @param string
- * @return bool
- */
- function exact_length($str, $val)
- {
- if (preg_match("/[^0-9]/", $val))
- {
- return FALSE;
- }
-
- return (mb_strlen($str,QFW::$config['host']['encoding']) != $val) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Valid Email
- *
- * @access public
- * @param string
- * @return bool
- */
- function valid_email($str)
- {
- if (strlen($str)>255)
- return FALSE;
- if (strpos($str,'@')>64)
- return FALSE;
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Validate IP Address
- *
- * @access public
- * @param string
- * @return string
- */
- function valid_ip($ip)
- {
- return true;//!!!!!$this->CI->valid_ip($ip);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Alpha
- *
- * @access public
- * @param string
- * @return bool
- */
- function alpha($str)
- {
- return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Alpha-numeric
- *
- * @access public
- * @param string
- * @return bool
- */
- function alpha_numeric($str)
- {
- return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Alpha-numeric with underscores and dashes
- *
- * @access public
- * @param string
- * @return bool
- */
- function alpha_dash($str)
- {
- return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Numeric
- *
- * @access public
- * @param int
- * @return bool
- */
- function numeric($str)
- {
- //return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE;
- return ( ! preg_match("/^[0-9\.]+$/", $str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Is Numeric
- *
- * @access public
- * @param string
- * @return bool
- */
- function is_numeric($str)
- {
- return ( ! is_numeric($str)) ? FALSE : TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Login
- *
- * @access public
- * @param string
- * @return bool
- */
- function login($str)
- {
- return ( ! preg_match("/^[a-z][0-9a-z_]*$/", $str)) ? FALSE : TRUE;
- }
-
-
- // --------------------------------------------------------------------
-
- /**
- * Passport login (can include @ and domain after it)
- *
- * @access public
- * @param string
- * @return bool
- */
- function passport_login($str)
- {
- return ( ! preg_match("/^[0-9a-z_\-][0-9a-z_\-\.]+(@([0-9a-z][0-9a-z\-]*[0-9a-z]\.)+[0-9a-z]{2,6})?$/i", $str)) ? FALSE : TRUE;
- }
-
- function valid_url($str) {
- return ( !preg_match('/\b((ht|f)tp):(\/\/)([a-z0-9.:@*()~#\]\[_?=&\/\\-])+/', $str)) ? FALSE : TRUE;
- }
-
- function range($str, $val) {
- $val = explode('-', $val);
- if ((count($val)!==2) || preg_match("/[^0-9]/", $val[0]) || preg_match("/[^0-9]/", $val[1])) {
- return FALSE;
- }
- return (($tmp = intval($str) < $val[0]) || ($tmp > $val[1])) ? FALSE : TRUE;
- }
-
-}
-// END Validation Class
-QFW::$libs['true_validation'] = new True_Validation();
-?>
\ No newline at end of file
diff --git a/lib/language/ru_RU/true_validation_lang.php b/lib/language/ru_RU/true_validation_lang.php
deleted file mode 100644
index 1cf8c86..0000000
--- a/lib/language/ru_RU/true_validation_lang.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-$lang['required'] = "Поле %s необходимо заполнить.";
-$lang['isset'] = "Поле %s должно иметь значение.";
-$lang['valid_email'] = "Поле %s должно содержать правильный e-mail.";
-$lang['valid_url'] = "Поле %s должно содержать правильный URL.";
-$lang['min_length'] = "Поле %s должно содержать не менее %s знаков.";
-$lang['max_length'] = "Поле %s должно содержать не более %s знаков.";
-$lang['exact_length'] = "Поле %s должно содержать ровно %s знаков.";
-$lang['alpha'] = "Поле %s может содержать только буквы.";
-$lang['alpha_numeric'] = "Поле %s может содержать только буквы и цифры.";
-$lang['alpha_dash'] = "Поле %s может содержать только буквы, цифры, заки подчеркивания и тире.";
-$lang['numeric'] = "Поле %s должно содержать число.";
-$lang['matches'] = "Поле %s должно совпадать с полем %s.";
-$lang['login'] = "Поле %s должно начинаться обязательно с буквы (a-z). Разрешено использовать только символы английского алфавита (a-z), цифры (0-9) и символы подчеркивания '_'.";
-$lang['passport_login'] = "Поле %s должно начинаться обязательно с буквы (a-z). Разрешено использовать только символы английского алфавита (a-z), цифры (0-9) и символы подчеркивания '_'. При использовании системы \"Паспорт\" после логина должен идти символ '@' и домен проекта на котором вы уже зарегистрированы";
-$lang['range'] = "Поле %s должно находиться в диапазоне %s.";
-$lang['pwd'] = "Неверно введено значение поля %s.";
-$lang['noeq'] = "Значение поля %s совпадает со старым.";
-$lang['reqpwd'] = "Поле %s необходимо заполнить.";
-
-?>
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
lib/Language.php | 122 -------
lib/True_validation.php | 471 ---------------------------
lib/language/ru_RU/true_validation_lang.php | 22 --
3 files changed, 0 insertions(+), 615 deletions(-)
delete mode 100755 lib/Language.php
delete mode 100755 lib/True_validation.php
delete mode 100644 lib/language/ru_RU/true_validation_lang.php
hooks/post-receive
--
quickfw
|