Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52447 invoked from network); 5 Sep 2017 19:39:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2017 19:39:42 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lsces.co.uk designates 185.153.204.204 as permitted sender) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 185.153.204.204 mail4.serversure.net Linux 2.6 Received: from [185.153.204.204] ([185.153.204.204:53204] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/9C-04538-B7DFEA95 for ; Tue, 05 Sep 2017 15:39:41 -0400 Received: (qmail 27366 invoked by uid 89); 5 Sep 2017 19:39:36 -0000 Received: by simscan 1.3.1 ppid: 27358, pid: 27362, t: 0.0527s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 5 Sep 2017 19:39:36 -0000 To: internals@lists.php.net References: <0C7F986C-B0BC-4315-98ED-B4FD003B9399@gmail.com> <2a4491b4-e6f5-4297-beec-363f373a93e6@lsces.co.uk> <3f8be7b1-0e59-21c6-4fe8-8299b2c05645@rhsoft.net> <6ba62d62-f1ab-9e7b-93f0-a1a9238c47a6@lsces.co.uk> Message-ID: Date: Tue, 5 Sep 2017 20:39:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] A validator module for PHP7 From: lester@lsces.co.uk (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 generated form, the data can often be validated in terms of basic structure before even needing to decide if the data set needs to be iterated? If things like 'maximum data size' can be established when the form is created, any data set larger than that can simply be killed off. > Anyway, thank you for pointer for PDO validation. I didn't notice the > project. We may cooperate so that there aren't unnecessary validaiton > rule incompatibilities I've been pushing the idea of a single method of managing metadata for a long time. Most of the 'checking' loading down PHP now still misses the point and the database style of rules has been around since long before PDO and other abstractions messed it up. 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 between operations such as database activity. This is NOT 'typing' since that lacks the vast majority of checks that a decent validation will handle, but the much finer details such as limits and value sets. There is a vast discrepancy in how this is handled across databases, but the SQL standard does provide a base which databases are slowly evolving towards. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk