Re: [PHP-DEV] A validator module for PHP7

2017-09-12 Thread Yasuo Ohgaki
On Tue, Sep 12, 2017 at 1:04 PM, Stephen Reay wrote: > > On 12 Sep 2017, at 04:07, Yasuo Ohgaki wrote: > > Stephen, > > On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay > wrote: > >> >> On 11 Sep 2017, at 17:41, Yasuo Ohgaki wrote: >> >> Hi Stephen, >> >> On Mon, Sep 11, 2017 at 6:37 PM, Stephen

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Stephen Reay
> On 12 Sep 2017, at 04:07, Yasuo Ohgaki wrote: > > Stephen, > > On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay > wrote: > >> On 11 Sep 2017, at 17:41, Yasuo Ohgaki > > wrote: >> >> Hi Stephen, >> >> On Mon, Sep 11, 2017 at 6:37 PM

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi, On Tue, Sep 12, 2017 at 6:54 AM, li...@rhsoft.net wrote: > > > Am 11.09.2017 um 23:39 schrieb Yasuo Ohgaki: > >> On Tue, Sep 12, 2017 at 6:35 AM, li...@rhsoft.net but you still fail >> to explain why in the world you don#t try to >> enhance the existing filter functions instead inven

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread li...@rhsoft.net
Am 11.09.2017 um 23:49 schrieb Yasuo Ohgaki: but you still fail to explain why in the world you don#t try to enhance the existing filter functions instead invent a new beast leading finally to have the existin filter functions and your new stuff which share the sa

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread li...@rhsoft.net
Am 11.09.2017 um 23:39 schrieb Yasuo Ohgaki: On Tue, Sep 12, 2017 at 6:35 AM, li...@rhsoft.net but you still fail to explain why in the world you don#t try to enhance the existing filter functions instead invent a new beast leading finally to have the existin filter functions and y

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi, On Tue, Sep 12, 2017 at 6:39 AM, Yasuo Ohgaki wrote: > Hi, > > On Tue, Sep 12, 2017 at 6:35 AM, li...@rhsoft.net > wrote: > >> >> Am 11.09.2017 um 23:07 schrieb Yasuo Ohgaki >> >>> On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay >> > >>> So, you still didn’t actually provide an example.

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi, On Tue, Sep 12, 2017 at 6:35 AM, li...@rhsoft.net wrote: > > Am 11.09.2017 um 23:07 schrieb Yasuo Ohgaki > >> On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay >> >>> So, you still didn’t actually provide an example. I *guess* you’re >>> talking >>> about character class validation or somethin

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi Stephen, On Tue, Sep 12, 2017 at 6:07 AM, Yasuo Ohgaki wrote: > Would you like me to propose previous RFC again? > and implement "ture validation" with filter? > I don't mind implementing it if you would like to update the RFC and it > passes. > It must use "white list" as much as possible. >

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread li...@rhsoft.net
Am 11.09.2017 um 23:07 schrieb Yasuo Ohgaki On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay So, you still didn’t actually provide an example. I *guess* you’re talking about character class validation or something else equally “simple”, because I can’t imagine what else would be a common enough

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Stephen, On Tue, Sep 12, 2017 at 12:22 AM, Stephen Reay wrote: > > On 11 Sep 2017, at 17:41, Yasuo Ohgaki wrote: > > Hi Stephen, > > On Mon, Sep 11, 2017 at 6:37 PM, Stephen Reay > wrote: > > On 11 Sep 2017, at 15:42, Yasuo Ohgaki wrote: > > It seems you haven't try to use filter module serio

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Stephen Reay
> On 11 Sep 2017, at 17:41, Yasuo Ohgaki wrote: > > Hi Stephen, > > On Mon, Sep 11, 2017 at 6:37 PM, Stephen Reay > > wrote: > >> On 11 Sep 2017, at 15:42, Yasuo Ohgaki wrote: >> >> It seems you haven't try to use filter module seriously. >> It simply does n

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi Stephen, On Mon, Sep 11, 2017 at 6:37 PM, Stephen Reay wrote: > On 11 Sep 2017, at 15:42, Yasuo Ohgaki wrote: > > It seems you haven't try to use filter module seriously. > It simply does not have enough feature for input validations. > e.g. You cannot validate "strings". > > > Yasuo, > > I’

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Stephen Reay
> On 11 Sep 2017, at 15:42, Yasuo Ohgaki wrote: > > It seems you haven't try to use filter module seriously. > It simply does not have enough feature for input validations. > e.g. You cannot validate "strings". > Yasuo, I’ve asked previously what your proposal actually offers over the filter

Re: [PHP-DEV] A validator module for PHP7

2017-09-11 Thread Yasuo Ohgaki
Hi Tony, On Sat, Sep 9, 2017 at 6:26 PM, Tony Marston wrote: > "Yasuo Ohgaki" wrote in message news:CAGa2bXa4UvkL-ZsLAB2bF05L > 4q_oduixszvvyzu9nddksvt...@mail.gmail.com... > >> >> Hi Tony, >> >> > >> >>> As a person who has been developing database applications for several >>> decades and wit

Re: [PHP-DEV] A validator module for PHP7

2017-09-09 Thread Tony Marston
"Yasuo Ohgaki" wrote in message news:caga2bxa4uvkl-zslab2bf05l4q_oduixszvvyzu9nddksvt...@mail.gmail.com... Hi Tony, As a person who has been developing database applications for several decades and with PHP since 2003 I'd like to chip in with my 2 cent's worth. Firstly I agree with Dan's

Re: [PHP-DEV] A validator module for PHP7

2017-09-07 Thread Yasuo Ohgaki
Hi Tony, On Thu, Sep 7, 2017 at 5:40 PM, Tony Marston wrote: > "Dan Ackroyd" wrote in message news:CA+kxMuSL1kEW60S7DFJb06+r > 2q3rc1ueewu1jap78fy65aj...@mail.gmail.com... > >> >> On 6 September 2017 at 13:31, Rowan Collins >> wrote: >> >>> I'm going to assume that the code you posted was some

Re: [PHP-DEV] A validator module for PHP7

2017-09-07 Thread Tony Marston
"Dan Ackroyd" wrote in message news:ca+kxmusl1kew60s7dfjb06+r2q3rc1ueewu1jap78fy65aj...@mail.gmail.com... On 6 September 2017 at 13:31, Rowan Collins wrote: I'm going to assume that the code you posted was something of a straw man, and you're not actually advocating people copy 20 lines of c

Re: [PHP-DEV] A validator module for PHP7

2017-09-07 Thread Lester Caine
On 07/09/17 05:26, Yasuo Ohgaki wrote: > As I wrote in README.md, there are only 3 types of inputs. > > 1. Valid data should accepted. > 2. Valid data should accepted, but user's mistake. e.g. Logical error like > your example above. > 3. Invalid. Anything other than 1 and 2 (i.e. Client cannot

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Yasuo Ohgaki
Hi Dan On Wed, Sep 6, 2017 at 8:38 PM, Dan Ackroyd wrote: > On 6 September 2017 at 12:15, Rowan Collins > wrote: > > > If you have suggestions for how the format should look > > Don't use a format. Just write code - see below. > > > Which is why Yasuo and I have both suggested we work together

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Rowan Collins
On 6 September 2017 21:33:53 BST, Dan Ackroyd wrote: >On 6 September 2017 at 13:31, Rowan Collins >wrote: >> I'm going to assume that the code you posted was something of a straw >> man, and you're not actually advocating people copy 20 lines of code >for >> every variable they want to validate.

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Dan Ackroyd
On 6 September 2017 at 13:31, Rowan Collins wrote: > I'm going to assume that the code you posted was something of a straw > man, and you're not actually advocating people copy 20 lines of code for > every variable they want to validate. You assume wrong. No it's not, and yes I am. I can point a

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Rowan Collins
On 6 September 2017 12:52:24 BST, Lester Caine wrote: >On 06/09/17 12:15, Rowan Collins wrote: >> On 6 September 2017 09:29:37 BST, Lester Caine >wrote: >> Which is why Yasuo and I have both suggested we work together to come >up with such a standard format that can be used or adapted for these >

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Rowan Collins
On 6 September 2017 12:38:03 BST, Dan Ackroyd wrote: >On 6 September 2017 at 12:15, Rowan Collins >wrote: > >> If you have suggestions for how the format should look > >Don't use a format. Just write code - see below. I'm going to assume that the code you posted was something of a straw man, and

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Lester Caine
On 06/09/17 13:00, li...@rhsoft.net wrote: > Am 06.09.2017 um 13:52 schrieb Lester Caine: >> The likes of ADOdb datadict are still used as a base for metadata in >> projects, but PDO destroyed the standardisation that used to exist by >> spawning a number of competing wrappers. https://github.com/A

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Stephen Reay
> On 6 Sep 2017, at 18:15, Rowan Collins wrote: > >> On 6 September 2017 09:29:37 BST, Lester Caine wrote: >> My only problem with Yasuo's latest offering is once again it adds a >> whole new set of defines that have to be mapped to existing metadata >> definitions ... That and it is a lot of l

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread li...@rhsoft.net
Am 06.09.2017 um 13:52 schrieb Lester Caine: The likes of ADOdb datadict are still used as a base for metadata in projects, but PDO destroyed the standardisation that used to exist by spawning a number of competing wrappers. https://github.com/ADOdb/ADOdb has evolved from a private project to b

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Lester Caine
On 06/09/17 12:15, Rowan Collins wrote: > On 6 September 2017 09:29:37 BST, Lester Caine wrote: >> My only problem with Yasuo's latest offering is once again it adds a >> whole new set of defines that have to be mapped to existing metadata >> definitions ... That and it is a lot of longhand code u

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Dan Ackroyd
On 6 September 2017 at 12:15, Rowan Collins wrote: > If you have suggestions for how the format should look Don't use a format. Just write code - see below. > Which is why Yasuo and I have both suggested we work together If you're going to work together and continue the conversation, please ca

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Rowan Collins
On 6 September 2017 09:29:37 BST, Lester Caine wrote: >My only problem with Yasuo's latest offering is once again it adds a >whole new set of defines that have to be mapped to existing metadata >definitions ... That and it is a lot of longhand code using a different >style to existing arrays. We n

Re: [PHP-DEV] A validator module for PHP7

2017-09-06 Thread Lester Caine
On 05/09/17 21:45, Rowan Collins wrote: >> I've been pushing the idea of a single method of managing metadata for >> a long time. >> A single standard set of rules >> that can be used across the board from variable creation to checking >> data going out to forms and returns coming back and data be

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Yasuo Ohgaki
Hi Rowan, Crocodile and Lester, Rowan, Thank you for helpful suggestions. I think it may better be named 'validate()'/etc. Sole reason I named functions as 'valid*()' is name collision. 'validate*()' seems too common, but users should use namespace to avoid collisions. I'll take your suggestions i

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Rowan Collins
On 5 September 2017 20:39:36 BST, Lester Caine wrote: >I've been pushing the idea of a single method of managing metadata for >a long time. > A single standard set of rules >that can be used across the board from variable creation to checking >data going out to forms and returns coming back and d

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Lester Caine
On 05/09/17 20:05, Yasuo Ohgaki wrote: > There is one principle that developers is better to follow. > https://en.wikipedia.org/wiki/Fail-fast > If we follow this principle, validation at controller makes sense. Since a large proportion of the data coming in is a result of input into a previously g

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Yasuo Ohgaki
Hi Lester, I always make some mistakes. s/are/is There is one principle that developers is better to follow. https://en.wikipedia.org/wiki/Fail-fast If we follow this principle, validation at controller makes sense. Anyway, thank you for pointer for PDO validation. I didn't notice the project. W

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Yasuo Ohgaki
Hi Lester, On Tue, Sep 5, 2017 at 8:36 PM, Lester Caine wrote: > On 05/09/17 12:18, Yasuo Ohgaki wrote: > > I cannot guess people's thought. I appreciated feedback! > > With a decent database layer a lot of the validation you are proposing > is already covered but PDO does not help in this area.

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread li...@rhsoft.net
Am 05.09.2017 um 18:57 schrieb Lester Caine: But not at the cost of writing different sets of code to play to each area where checking SHOULD be done. Stick to a single standard method of defining the metadata and that already exists in the database layer ok, to make that point clear: not eve

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Lester Caine
On 05/09/17 15:13, li...@rhsoft.net wrote: > your first error is thinking every input is related to databases at all So we end up with different code for different types of input? An array that will work directly into a database save or some other follow on process without having to think about whe

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread li...@rhsoft.net
Am 05.09.2017 um 15:44 schrieb Lester Caine: On 05/09/17 14:08, li...@rhsoft.net wrote: the only question as applicaton developer is how you proceed in which cases * reject the whole request with a error-message * reset form-fields where you don't expect an array as input * reset from-fields

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Lester Caine
On 05/09/17 14:08, li...@rhsoft.net wrote: > > > Am 05.09.2017 um 13:36 schrieb Lester Caine: >> On 05/09/17 12:18, Yasuo Ohgaki wrote: >>> I cannot guess people's thought. I appreciated feedback! >> >> With a decent database layer a lot of the validation you are proposing >> is already covered b

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread li...@rhsoft.net
Am 05.09.2017 um 13:36 schrieb Lester Caine: On 05/09/17 12:18, Yasuo Ohgaki wrote: I cannot guess people's thought. I appreciated feedback! With a decent database layer a lot of the validation you are proposing is already covered but PDO does not help in this area. Adding another layer that

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Rowan Collins
On 5 September 2017 12:36:42 BST, Lester Caine wrote: >On 05/09/17 12:18, Yasuo Ohgaki wrote: >> I cannot guess people's thought. I appreciated feedback! > >With a decent database layer a lot of the validation you are proposing >is already covered but PDO does not help in this area. Adding another

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Lester Caine
On 05/09/17 12:18, Yasuo Ohgaki wrote: > I cannot guess people's thought. I appreciated feedback! With a decent database layer a lot of the validation you are proposing is already covered but PDO does not help in this area. Adding another layer that does not integrate with a storage layer is just

Re: [PHP-DEV] A validator module for PHP7

2017-09-05 Thread Yasuo Ohgaki
Hi all, On Tue, Sep 5, 2017 at 12:19 PM, Paul Jones wrote: > > > On Sep 4, 2017, at 18:06, Marco Pivetta wrote: > > > > On Mon, Sep 4, 2017 at 8:56 PM, Crocodile wrote: > > > >> In most cases users would like more than just valid/invalid, i. e. which > >> particular rule(s) failed and also hum

Re: [PHP-DEV] A validator module for PHP7

2017-09-04 Thread Paul Jones
> On Sep 4, 2017, at 18:06, Marco Pivetta wrote: > > On Mon, Sep 4, 2017 at 8:56 PM, Crocodile wrote: > >> In most cases users would like more than just valid/invalid, i. e. which >> particular rule(s) failed and also human-readable error messages. As of >> simple validation that is almost alw

Re: [PHP-DEV] A validator module for PHP7

2017-09-04 Thread Marco Pivetta
On Mon, Sep 4, 2017 at 8:56 PM, Crocodile wrote: > In most cases users would like more than just valid/invalid, i. e. which > particular rule(s) failed and also human-readable error messages. As of > simple validation that is almost always at hand, filter_* functions do a > good job, although I a

Re: [PHP-DEV] A validator module for PHP7

2017-09-04 Thread Crocodile
In most cases users would like more than just valid/invalid, i. e. which particular rule(s) failed and also human-readable error messages. As of simple validation that is almost always at hand, filter_* functions do a good job, although I agree that they could be better. I, for one, would like to s

Re: [PHP-DEV] A validator module for PHP7

2017-09-04 Thread Rowan Collins
On 4 September 2017 07:33:41 BST, Yasuo Ohgaki wrote: >Hi all, > >I spent a little time for a new input validation module. It's not >totally >new module, but is based on Filter module's validation filter >improvement >RFC in many ways. [1] Hi Yasuo, Thanks for tackling this. I do think the curre

[PHP-DEV] A validator module for PHP7

2017-09-03 Thread Yasuo Ohgaki
Hi all, I spent a little time for a new input validation module. It's not totally new module, but is based on Filter module's validation filter improvement RFC in many ways. [1] As all of us knew already, input validation is the most important practice in secure coding. [2][3] Yet, we don't provi