Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14912 invoked from network); 5 Sep 2017 12:25:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2017 12:25:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wm0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:32937] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/D6-04538-5D79EA95 for ; Tue, 05 Sep 2017 08:25:58 -0400 Received: by mail-wm0-f44.google.com with SMTP id f145so10860280wme.0 for ; Tue, 05 Sep 2017 05:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=7MOdZGf2A7INcOM9sA4kzrcb4YusBW1i1wAFtsAL320=; b=XxBw2X9jZ4elnAEk/qR0FqRGW4z/i+l0Si4zOLUaCzJOcoOAvp06L754U298pn+HUB LLBnnV6mDcNVSbI5Txr2EhsFbk4qJ6a+J5xNQs0UCY66WPF1ZdD+Objs43YFV4jy0Lio lSR2K1O1tel+cgsqR95o0woSvnavPbM9DmUF9FHdQ+MyaER2YJeH+Km3+0AtxTTkdEYN daNn8XxbdCcpVKHGfRSIgXg0E++AyxuAmXCGRRjThD2VLTwauVPVkwMDoeBYR+XkNbah tyVmBxjNasb8AZbpLRskIMqwvKrQL2GQ+pHSd1nHsbRnntQBySXu1QYDM8Wvi9JheMX5 kmug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=7MOdZGf2A7INcOM9sA4kzrcb4YusBW1i1wAFtsAL320=; b=Lz/20GSCP6OST0NZQMElSJ/WvTy2naWbi5cE61XyGDcvD+XeEt44TaztR4HFJWKdEf xdlwGMW6Ql/i/AwOccdsM4n6eyIAj2G4zYm/o5qzjWu080iUnTd0JXqSHr3NLsZoW3us ohCYXRQDhFjFX13lTl7dpOwYbl2YZQ+fajUGdC57v7aeAcQptsJiZ8kcnX0RZJnhHPS3 +f6pdCQvaW+w9BzP7ZSSFrZgREwwktjv0Jogm8pufaN9epfRq68evg2TWY7nbKsfvCHI jyBIDUEdVJSNnM3MJoTn8vYudn3pPEk/7Zpeduzv4RpD5fpzZL/DbuczS2v75ZuugfPP arew== X-Gm-Message-State: AHPjjUivppfGYkkU84I73d0f/aNX0T7uG5/EZDfBCH4Jx+BpgvKCbV7m QDElBdVCuTMhfL0DbO0= X-Google-Smtp-Source: ADKCNb4JbmGsJH7L6U/GUs95kRp8z6LHC+Sf3c9NfoBE2tBh410ml5lQvMZqnv1nY/Hs/BxmrvcKBA== X-Received: by 10.28.104.7 with SMTP id d7mr1565697wmc.6.1504614354665; Tue, 05 Sep 2017 05:25:54 -0700 (PDT) Received: from [10.61.147.69] (188.29.165.122.threembb.co.uk. [188.29.165.122]) by smtp.gmail.com with ESMTPSA id x5sm580319wre.18.2017.09.05.05.25.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 05:25:53 -0700 (PDT) Date: Tue, 05 Sep 2017 13:25:51 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: <0C7F986C-B0BC-4315-98ED-B4FD003B9399@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net,Lester Caine Message-ID: <3859B28E-D1E7-4903-8C8A-0BEA4D748A22@gmail.com> Subject: Re: [PHP-DEV] A validator module for PHP7 From: rowan.collins@gmail.com (Rowan Collins) On 5 September 2017 12:36:42 BST, Lester Caine wro= te: >On 05/09/17 12:18, Yasuo Ohgaki wrote: >> I cannot guess people's thought=2E 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=2E Adding another >layer that does not integrate with a storage layer is just adding to >the >current mess =2E=2E=2E Validation should have nothing to do with the storage layer=2E Or at least= , there should be a level of validation separate from the storage layer=2E Inputs may come from all sorts of sources: the HTTP request, an API, an im= port file, etc; and they may be going to all sorts of destinations: the HTT= P response, a database, an API, an export file, an e-mail, etc=2E=20 Regardless of where it came from, and where it's going to end up, the appl= ication knows what format that input data should be in to use as or populat= e appropriate domain models=2E For instance, "age_in_years is a non-negativ= e integer" is an invariant fact about the domain being modelled, even if it= 's a value that goes nowhere near any form of database=2E I actually agree that this module doesn't need to replace the existing use= rland libraries, only to act as a useful base for them, as well as a useful= fallback when writing "raw PHP"=2E The key problem is balancing flexibilit= y and usability such that people will reach for this tool rather than brewi= ng their own=2E Regards, --=20 Rowan Collins [IMSoP]