-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validation improvements, adding support for complex expressions in PH…
…QL ORDER BY/GROUP BY, fixing wrong method name in Phalcon\Mvc\Criteria
- v5.9.0
- v5.8.0
- v5.7.0
- v5.6.2
- v5.6.1
- v5.6.0
- v5.5.0
- v5.4.0
- v5.3.1
- v5.3.0
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.4
- v5.1.3
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0beta3
- v5.0.0beta2
- v5.0.0beta1
- v5.0.0alpha7
- v5.0.0alpha6
- v5.0.0alpha5
- v5.0.0alpha4
- v5.0.0alpha3
- v5.0.0RC4
- v5.0.0RC3
- v5.0.0RC2
- v5.0.0RC1
- v5.0.0-alpha.2
- v5.0.0-alpha.1
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0-rc.3
- v4.0.0-rc.2
- v4.0.0-rc.1
- v4.0.0-beta.2
- v4.0.0-beta.1
- v4.0.0-alpha.5
- v4.0.0-alpha.4
- v4.0.0-alpha.3
- v4.0.0-alpha.2
- v4.0.0-alpha1
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.1.0-alpha2
- v3.1.0-alpha1
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- phalcon-v2.0.13
- phalcon-v2.0.12
- phalcon-v2.0.11
- phalcon-v2.0.10
- phalcon-v2.0.9
- phalcon-v2.0.8
- phalcon-v2.0.7
- phalcon-v2.0.6
- phalcon-v2.0.5
- phalcon-v2.0.4
- phalcon-v2.0.3
- phalcon-v2.0.2
- phalcon-v2.0.1
- phalcon-v2.0.0
- phalcon-v1.3.4
- phalcon-v1.3.3
- phalcon-v1.3.2
- phalcon-v1.3.1
- phalcon-v1.3.0
- phalcon-v1.2.6
- phalcon-v1.2.5
- phalcon-v1.2.4
- phalcon-v1.2.3
- phalcon-v1.2.2
- phalcon-v1.2.1
- phalcon-v1.2.0
- phalcon-v1.1.0
- phalcon-v1.0.1
- phalcon-v1.0.0
- Dao-v1.3.7
- Dao-v1.3.6.3
- Dao-v1.3.6.2
- Dao-v1.3.6.1
- Dao-v1.3.6
- Dao-v1.3.6-RC
- Dao-v1.3.6-Final
- Dao-v1.3.5
- Dao-v1.3.5-RC
- Dao-v1.3.4.2
- Dao-v1.3.4.1
- Dao-v1.3.4
- Dao-v1.3.4-RC
- Dao-v1.3.3.3
- Dao-v1.3.3.2
- Dao-v1.3.3-beta
- Dao-v1.3.3-RC
- Dao-v1.3.3-Final
- Dao-v1.3.2-Release
- Dao-v1.3.0
- 5.0.0alpha3
phalcon
committed
Feb 25, 2013
1 parent
6a8ad8c
commit d3c1f21
Showing
20 changed files
with
1,034 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
|
||
/* | ||
+------------------------------------------------------------------------+ | ||
| Phalcon Framework | | ||
+------------------------------------------------------------------------+ | ||
| Copyright (c) 2011-2013 Phalcon Team (http://www.phalconphp.com) | | ||
+------------------------------------------------------------------------+ | ||
| This source file is subject to the New BSD License that is bundled | | ||
| with this package in the file docs/LICENSE.txt. | | ||
| | | ||
| If you did not receive a copy of the license and are unable to | | ||
| obtain it through the world-wide-web, please send an email | | ||
| to license@phalconphp.com so we can send you a copy immediately. | | ||
+------------------------------------------------------------------------+ | ||
| Authors: Andres Gutierrez <andres@phalconphp.com> | | ||
| Eduar Carvajal <eduar@phalconphp.com> | | ||
+------------------------------------------------------------------------+ | ||
*/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include "php.h" | ||
#include "php_phalcon.h" | ||
#include "phalcon.h" | ||
|
||
#include "Zend/zend_operators.h" | ||
#include "Zend/zend_exceptions.h" | ||
#include "Zend/zend_interfaces.h" | ||
|
||
#include "kernel/main.h" | ||
#include "kernel/memory.h" | ||
|
||
#include "kernel/fcall.h" | ||
#include "kernel/operators.h" | ||
#include "kernel/concat.h" | ||
|
||
/** | ||
* Phalcon\Validation\Validator\StringLength | ||
* | ||
* Validates that a value is not null or empty string | ||
*/ | ||
|
||
|
||
/** | ||
* Phalcon\Validation\Validator\StringLength initializer | ||
*/ | ||
PHALCON_INIT_CLASS(Phalcon_Validation_Validator_StringLength){ | ||
|
||
PHALCON_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, StringLength, validation_validator_stringlength, "phalcon\\validation\\validator", phalcon_validation_validator_stringlength_method_entry, 0); | ||
|
||
return SUCCESS; | ||
} | ||
|
||
/** | ||
* Executes the validation | ||
* | ||
* @param Phalcon\Validator $validator | ||
* @param string $attribute | ||
* @return boolean | ||
*/ | ||
PHP_METHOD(Phalcon_Validation_Validator_StringLength, validate){ | ||
|
||
zval *validator, *attribute, *value, *option = NULL, *identical_value; | ||
zval *message_str = NULL, *type, *message; | ||
|
||
PHALCON_MM_GROW(); | ||
|
||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &validator, &attribute) == FAILURE) { | ||
RETURN_MM_NULL(); | ||
} | ||
|
||
PHALCON_INIT_VAR(value); | ||
PHALCON_CALL_METHOD_PARAMS_1(value, validator, "getvalue", attribute); | ||
|
||
PHALCON_INIT_VAR(option); | ||
ZVAL_STRING(option, "value", 1); | ||
|
||
PHALCON_INIT_VAR(identical_value); | ||
PHALCON_CALL_METHOD_PARAMS_1(identical_value, this_ptr, "getoption", option); | ||
if (!PHALCON_IS_EQUAL(value, identical_value)) { | ||
|
||
PHALCON_INIT_NVAR(option); | ||
ZVAL_STRING(option, "message", 1); | ||
|
||
PHALCON_INIT_VAR(message_str); | ||
PHALCON_CALL_METHOD_PARAMS_1(message_str, this_ptr, "getoption", option); | ||
if (!zend_is_true(message_str)) { | ||
PHALCON_INIT_NVAR(message_str); | ||
PHALCON_CONCAT_VS(message_str, attribute, " does not have the expected value"); | ||
} | ||
|
||
PHALCON_INIT_VAR(type); | ||
ZVAL_STRING(type, "Identical", 1); | ||
|
||
PHALCON_INIT_VAR(message); | ||
object_init_ex(message, phalcon_validation_message_ce); | ||
PHALCON_CALL_METHOD_PARAMS_3_NORETURN(message, "__construct", message_str, attribute, type); | ||
|
||
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(validator, "appendmessage", message); | ||
} | ||
|
||
PHALCON_MM_RESTORE(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
/* | ||
+------------------------------------------------------------------------+ | ||
| Phalcon Framework | | ||
+------------------------------------------------------------------------+ | ||
| Copyright (c) 2011-2013 Phalcon Team (http://www.phalconphp.com) | | ||
+------------------------------------------------------------------------+ | ||
| This source file is subject to the New BSD License that is bundled | | ||
| with this package in the file docs/LICENSE.txt. | | ||
| | | ||
| If you did not receive a copy of the license and are unable to | | ||
| obtain it through the world-wide-web, please send an email | | ||
| to license@phalconphp.com so we can send you a copy immediately. | | ||
+------------------------------------------------------------------------+ | ||
| Authors: Andres Gutierrez <andres@phalconphp.com> | | ||
| Eduar Carvajal <eduar@phalconphp.com> | | ||
+------------------------------------------------------------------------+ | ||
*/ | ||
|
||
extern zend_class_entry *phalcon_validation_validator_stringlength_ce; | ||
|
||
PHALCON_INIT_CLASS(Phalcon_Validation_Validator_StringLength); | ||
|
||
PHP_METHOD(Phalcon_Validation_Validator_StringLength, validate); | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_validation_validator_stringlength_validate, 0, 0, 2) | ||
ZEND_ARG_INFO(0, validator) | ||
ZEND_ARG_INFO(0, attribute) | ||
ZEND_END_ARG_INFO() | ||
|
||
PHALCON_INIT_FUNCS(phalcon_validation_validator_stringlength_method_entry){ | ||
PHP_ME(Phalcon_Validation_Validator_StringLength, validate, arginfo_phalcon_validation_validator_stringlength_validate, ZEND_ACC_PUBLIC) | ||
PHP_FE_END | ||
}; | ||
|