On 15/08/16 11:25, Tony Marston wrote:
> The Data Dictionary is one that I wrote, and is available in my open
> source Radicore framework.
>
> I don't use PDO as it was not created until years AFTER I had built my
> own solution. Besides, PDO does not do data validation.
>
> I have no intention
"Marco Pivetta" wrote in message
news:CADyq6s+LjfL5g2mLNz=XSk7BWT=p3vftgsicgjgck-tz0ce...@mail.gmail.com...
Hey Tony,
On Sun, Aug 14, 2016 at 10:50 AM, Tony Marston
wrote:
"Marco Pivetta" wrote in message news:CADyq6sKZRBvYFtqyKYVYM4iU
"Lester Caine" wrote in message
news:4b381281-204d-5e57-0bba-127ab8d2e...@lsces.co.uk...
On 15/08/16 10:11, Tony Marston wrote:
The origins of $fieldarray should be obvious. The $fieldspecs array is
constructed from data which is originally extracted from the database
schema, imported into my
On 15/08/16 10:11, Tony Marston wrote:
> The origins of $fieldarray should be obvious. The $fieldspecs array is
> constructed from data which is originally extracted from the database
> schema, imported into my Data Dictionary, then exported into a PHP
> script which is then included when the
"Lester Caine" wrote in message
news:fe222876-6875-3f07-e25b-aea2cbbed...@lsces.co.uk...
On 14/08/16 09:50, Tony Marston wrote:
If you are still writing code to perform primary validation on each
field then your coding style is way behind the times.
At some point you need to know the rules
Hey Tony,
On Sun, Aug 14, 2016 at 10:50 AM, Tony Marston
wrote:
> "Marco Pivetta" wrote in message news:CADyq6sKZRBvYFtqyKYVYM4iU
> ex+2ouujvhep1jznm56k3+h...@mail.gmail.com...
>
>>
>> So much confusion...
>>
>> There are 3 (or more) types of validation in pretty much
On 14/08/16 09:50, Tony Marston wrote:
> If you are still writing code to perform primary validation on each
> field then your coding style is way behind the times.
At some point you need to know the rules that wrap each field you are
working with. The sort of forms I work with have individual
"Marco Pivetta" wrote in message
news:cadyq6skzrbvyftqykyvym4iuex+2ouujvhep1jznm56k3+h...@mail.gmail.com...
So much confusion...
There are 3 (or more) types of validation in pretty much every web-app, so
let's please stop calling it simply "validation".
1. frontend validation
On 13/08/16 18:28, Marco Pivetta wrote:
> A "NI" or "Email address" concept is only a string at low level.
Yes ... but where do you store the flag such as "NI" ...
> It is well known/accepted that such concepts should be turned into
> simple objects instead, so that you can actually use
A "NI" or "Email address" concept is only a string at low level.
It is well known/accepted that such concepts should be turned into simple
objects instead, so that you can actually use type-signatures to type-hint
against NI/Email.
This avoids having to re-validat e for data-integrity and
On 13/08/16 14:43, Marco Pivetta wrote:
> It receives a value (nested, if necessary) and tells us if it is valid or
> not, plus why (as a set of strings, usually).
>
> This is validation. Please do use separate terminology if you mean:
> * "frontend (client-side) validation"
> * "frontend
So much confusion...
There are 3 (or more) types of validation in pretty much every web-app, so
let's please stop calling it simply "validation".
1. frontend validation (unsafe/unreliable), prevents invalid data
submission, makes things friendlier for the user
2. form validation, in the
On 13/08/16 10:14, Tony Marston wrote:
> I do not see that complicating the language by making it do what SHOULD
> be done in userland code is a good idea. Helping 1% of users while
> hindering the remaining 99% is not an idea which should EVER be
> contemplated.
I'm currently looking to
"Peter Lind" wrote in message
news:caeu6nadvbkmqhju0assr5f+ubo9vvryjyvjmr0ihxb8bdmg...@mail.gmail.com...
On 12 August 2016 at 12:13, Lester Caine wrote:
On 12/08/16 10:42, Peter Lind wrote:
> On 12 August 2016 at 11:25, Lester Caine wrote:
>
> Thanks
"Niklas Keller" wrote in message
news:canuqdcjaxejscajye+q-uhxcfjexwrywlkzmfwrqvdaewvb...@mail.gmail.com...
2016-08-11 14:42 GMT+02:00 Lester Caine :
On 11/08/16 04:56, Michal Brzuchalski wrote:
> You want to stick such validation at runtime at any time with variable
and
On 12/08/16 12:13, Yasuo Ohgaki wrote:
>> I may be missing something, but I thought the original code had rules
>> > for each element of the array? I would certainly expect to see the
>> > capability of setting different validating rules for each element, and
>> > the rules you are defining are
On 12/08/16 12:18, Peter Lind wrote:
> On 12 August 2016 at 13:15, Lester Caine wrote:
>
>> On 12/08/16 12:09, Peter Lind wrote:
>>> And if all typos were switching 'e' and 'n', what a wonderful world it
>>> would be. That is not the case though - it's possible to
On 12 August 2016 at 13:15, Lester Caine wrote:
> On 12/08/16 12:09, Peter Lind wrote:
> > And if all typos were switching 'e' and 'n', what a wonderful world it
> > would be. That is not the case though - it's possible to accidentally
> enter
> > " and > too.
> And the
Hi Lester,
On Fri, Aug 12, 2016 at 8:13 PM, Yasuo Ohgaki wrote:
> On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine wrote:
>> On 12/08/16 11:51, Yasuo Ohgaki wrote:
>>> What makes you feel missing some or designed badly?
>>
>> I may be missing something, but
On 12/08/16 12:09, Peter Lind wrote:
> And if all typos were switching 'e' and 'n', what a wonderful world it
> would be. That is not the case though - it's possible to accidentally enter
> " and > too.
And the browser validation strips them and handles the ' when used in
text fields.
--
Lester
Hi Lester,
On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine wrote:
> On 12/08/16 11:51, Yasuo Ohgaki wrote:
>> What makes you feel missing some or designed badly?
>
> I may be missing something, but I thought the original code had rules
> for each element of the array? I would
On 12 August 2016 at 13:01, Lester Caine wrote:
> On 12/08/16 11:01, Peter Lind wrote:
> > On 12 August 2016 at 11:54, Rowan Collins
> wrote:
> >
> >> On 12/08/2016 10:21, Lester Caine wrote:
> >>
> >>> Many of my systems run on secure intra-nets and
On 12 August 2016 at 12:52, Lester Caine wrote:
> On 12/08/16 11:23, Peter Lind wrote:
> > On 12 August 2016 at 12:13, Lester Caine wrote:
> >
> >> On 12/08/16 10:42, Peter Lind wrote:
> >>> On 12 August 2016 at 11:25, Lester Caine
On 12/08/16 11:51, Yasuo Ohgaki wrote:
> What makes you feel missing some or designed badly?
I may be missing something, but I thought the original code had rules
for each element of the array? I would certainly expect to see the
capability of setting different validating rules for each element,
On 12/08/16 11:01, Peter Lind wrote:
> On 12 August 2016 at 11:54, Rowan Collins wrote:
>
>> On 12/08/2016 10:21, Lester Caine wrote:
>>
>>> Many of my systems run on secure intra-nets and much of the 'safety
>>> concerns' that have been brought up recently as
On 12/08/16 11:23, Peter Lind wrote:
> On 12 August 2016 at 12:13, Lester Caine wrote:
>
>> On 12/08/16 10:42, Peter Lind wrote:
>>> On 12 August 2016 at 11:25, Lester Caine wrote:
>>>
>>> Thanks for the ideas on this feature.
>>>
>>> A few thoughts.
>>>
Hi Lester,
On Fri, Aug 12, 2016 at 7:13 PM, Lester Caine wrote:
>> That said, I generally think that built-in methods that accept Callables
>> are a great way to go. It encourages reuse through modular composition -
>> and could likely be a neater way around the throw
On 12/08/16 11:11, Yasuo Ohgaki wrote:
> Hi Lester,
>
> On Fri, Aug 12, 2016 at 5:19 PM, Lester Caine wrote:
>> > I'm thinking
>> > $var->setConstraint()
>> > $var->setEscape()
>> > $var->setReadOnly()
> DbC cannot cover all, but some of them can be covered during
On 12 August 2016 at 12:13, Lester Caine wrote:
> On 12/08/16 10:42, Peter Lind wrote:
> > On 12 August 2016 at 11:25, Lester Caine wrote:
> >
> > Thanks for the ideas on this feature.
> >
> > A few thoughts.
> > 1. The RFC for this isn't a change - it's
On 12/08/2016 10:52, Lester Caine wrote:
I think the idea *I* am throwing out for discussion is a switch from
global_library($var, ... ) to $var->global_library( ... ) where $var is
now always an object without having every framework creating it's own
version of the wrapper?
So kind of an
On 12/08/16 10:42, Peter Lind wrote:
> On 12 August 2016 at 11:25, Lester Caine wrote:
>
>> On 12/08/16 10:07, Christoph M. Becker wrote:
> I'm thinking
> $var->setConstraint()
> $var->setEscape()
> $var->setReadOnly()
>
> Rather than having to build
Hi Lester,
On Fri, Aug 12, 2016 at 5:19 PM, Lester Caine wrote:
> I'm thinking
> $var->setConstraint()
> $var->setEscape()
> $var->setReadOnly()
DbC cannot cover all, but some of them can be covered during development.
https://wiki.php.net/rfc/introduce_design_by_contract
On 12 August 2016 at 11:54, Rowan Collins wrote:
> On 12/08/2016 10:21, Lester Caine wrote:
>
>> Many of my systems run on secure intra-nets and much of the 'safety
>> concerns' that have been brought up recently as 'essential' simply don't
>> apply.
>>
>
> There's
On 12/08/2016 10:21, Lester Caine wrote:
Many of my systems run on secure intra-nets and much of the 'safety
concerns' that have been brought up recently as 'essential' simply don't
apply.
There's always rogue employees / students / visitors with temporary
access... But yes, IF you trust your
On 12/08/16 09:54, Rowan Collins wrote:
> On 12/08/2016 09:19, Lester Caine wrote:
>> I'm thinking
>> $var->setConstraint()
>> $var->setEscape()
>> $var->setReadOnly()
>>
>> Rather than having to build 'reflections' classes to pull out data that
>> a simple $var->is_valid or echo $var will output
On 12 August 2016 at 11:25, Lester Caine wrote:
> On 12/08/16 10:07, Christoph M. Becker wrote:
> >> > I'm thinking
> >> > $var->setConstraint()
> >> > $var->setEscape()
> >> > $var->setReadOnly()
> >> >
> >> > Rather than having to build 'reflections' classes to pull out
On 12/08/16 09:43, Michał Brzuchalski wrote:
> About ReadOnly I'm currently working on `immutable` feature proposal where
> could be
> possible to mark class and properties as immutable (ReadOnly after
> initialisation)
> so it could solve problem with ReadOnly ValueObjects and immutable
>
On 12/08/16 10:07, Christoph M. Becker wrote:
>> > I'm thinking
>> > $var->setConstraint()
>> > $var->setEscape()
>> > $var->setReadOnly()
>> >
>> > Rather than having to build 'reflections' classes to pull out data that
>> > a simple $var->is_valid or echo $var will output a correctly escaped
>>
On 12/08/16 09:58, Rowan Collins wrote:
>> From a practical point of view of cause, the validation of inputs may
>> well be done in the browser so that the constraints get passed TO some
>> html5 check, or javascript function. So having uploaded the form one
>> COULD simply tag a variable as
On 12.08.2016 at 10:19, Lester Caine wrote:
> On 11/08/16 23:17, Rowan Collins wrote:
>
>> You've mentioned a lot about flexibility, and that the feature could be
>> used in multiple styles, but some concrete examples of how *you* would
>> use it might help define what the feature needs to do
On 12/08/2016 08:51, Lester Caine wrote:
From a practical point of view of cause, the validation of inputs may
well be done in the browser so that the constraints get passed TO some
html5 check, or javascript function. So having uploaded the form one
COULD simply tag a variable as valid?
Just
On 12/08/2016 09:19, Lester Caine wrote:
I'm thinking
$var->setConstraint()
$var->setEscape()
$var->setReadOnly()
Rather than having to build 'reflections' classes to pull out data that
a simple $var->is_valid or echo $var will output a correctly escaped
piece of text.
Note that as discussed
2016-08-12 10:19 GMT+02:00 Lester Caine :
> On 11/08/16 23:17, Rowan Collins wrote:
> > You've mentioned a lot about flexibility, and that the feature could be
> > used in multiple styles, but some concrete examples of how *you* would
> > use it might help define what the
2016-08-12 9:51 GMT+02:00 Lester Caine :
> On 12/08/16 03:27, Yasuo Ohgaki wrote:
> > It sounds you are looking for autoboxing (or at least something similar)
> >
> > https://wiki.php.net/rfc/autoboxing
>
> That is interesting, and is probably something I would expect to come
On 11/08/16 23:17, Rowan Collins wrote:
> You've mentioned a lot about flexibility, and that the feature could be
> used in multiple styles, but some concrete examples of how *you* would
> use it might help define what the feature needs to do (and not do).
Currently my code has lots of checks for
On 12/08/16 03:27, Yasuo Ohgaki wrote:
> It sounds you are looking for autoboxing (or at least something similar)
>
> https://wiki.php.net/rfc/autoboxing
That is interesting, and is probably something I would expect to come
out in the wash with making a more intelligent variable. Except with
Hi Lester,
On Thu, Aug 11, 2016 at 5:07 AM, Lester Caine wrote:
> People keep complaining that I do not contribute any proposals to
> improve PHP, which to some extent s correct. Except the one thing that I
> keep trying to get a handle on is tidying validating of the basic
>
On 11/08/2016 21:19, Lester Caine wrote:
No ... add more than just validation rules. Include facilities such as
escape rules, display rules and variable specific material such as error
messages.
Just how the rules are enforced needs to be flexible and such things as
'required' will vary how the
On 11/08/16 21:22, Fleshgrinder wrote:
> What you are describing are classes. You can achieve all of that with them.
>
> You are completely right btw. that exceptions should not be used during
> validation and for flow control.
We have said all along that all of this can be done in classes, and
On 8/11/2016 10:19 PM, Lester Caine wrote:
> No ... add more than just validation rules. Include facilities such as
> escape rules, display rules and variable specific material such as error
> messages.
>
> Just how the rules are enforced needs to be flexible and such things as
> 'required' will
On 11/08/16 16:14, Rowan Collins wrote:
> On 11/08/2016 15:49, Lester Caine wrote:
>> The question is not how
>> you flag an error, but rather when do you check for one. If the 'load'
>> function from a database record or the populate from a web form results
>> in $age not being valid one handles
On 11/08/2016 16:22, Michał Brzuchalski wrote:
Wgat about static analysis and IDE support? They probably can handle all
those sugarcandies because tgey are sticjed to variable but not with any
dynamic rules procedural style. Am I right?
Yep, that's a good point, add "machine-friendly"
Wgat about static analysis and IDE support? They probably can handle all
those sugarcandies because tgey are sticjed to variable but not with any
dynamic rules procedural style. Am I right?
11.08.2016 17:17 "Rowan Collins" napisał(a):
> On 11/08/2016 15:49, Lester Caine
On 11/08/2016 15:49, Lester Caine wrote:
The question is not how
you flag an error, but rather when do you check for one. If the 'load'
function from a database record or the populate from a web form results
in $age not being valid one handles that situation based on the data
model. If you are
On 11/08/16 14:51, Rowan Collins wrote:
> On 11/08/16 13:50, Niklas Keller wrote:
>>> > If not by using exceptions, how would you handle them if you assign
>>> such
>>> > checks to variables and assign a wrong value?
>
> On 11/08/2016 14:29, Lester Caine wrote:
>> if ( !$age->set(
On 11/08/16 13:50, Niklas Keller wrote:
> If not by using exceptions, how would you handle them if you assign such
> checks to variables and assign a wrong value?
On 11/08/2016 14:29, Lester Caine wrote:
if ( !$age->set( $result_set['age'] ) ) { // handle error }
else { // next step }
So,
On 11/08/16 13:50, Niklas Keller wrote:
>> Now this is where the fundamental difference in styles comes in.
>> > PERSONALLY I would not be looking to throw exceptions at all. The whole
>> > point of validation is to handle any validation error ... and it is an
>> > error not an exception.
>> >
>
2016-08-11 14:42 GMT+02:00 Lester Caine :
> On 11/08/16 04:56, Michał Brzuchalski wrote:
> > You want to stick such validation at runtime at any time with variable
> and
> > throwing \TypeError at any time constraint is broken - wouldn't it cause
> of
> > throwing much more
On 11/08/16 04:56, Michał Brzuchalski wrote:
> You want to stick such validation at runtime at any time with variable and
> throwing \TypeError at any time constraint is broken - wouldn't it cause of
> throwing much more unexpected exceptions during runtime?
> Imagine you'll be passing such
You want to stick such validation at runtime at any time with variable and
throwing \TypeError at any time constraint is broken - wouldn't it cause of
throwing much more unexpected exceptions during runtime?
Imagine you'll be passing such variable with constraint into some object
who operates on
On Wed, Aug 10, 2016 at 4:07 PM, Lester Caine wrote:
> People keep complaining that I do not contribute any proposals to
> improve PHP, which to some extent s correct. Except the one thing that I
> keep trying to get a handle on is tidying validating of the basic
> variables
People keep complaining that I do not contribute any proposals to
improve PHP, which to some extent s correct. Except the one thing that I
keep trying to get a handle on is tidying validating of the basic
variables that are the heart of PHP.
validate_var_array() is a case in point, since ALL it
62 matches
Mail list logo