Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8095 invoked by uid 1010); 14 Dec 2006 01:21:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8080 invoked from network); 14 Dec 2006 01:21:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2006 01:21:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=kingwez@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kingwez@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.185 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kingwez@gmail.com X-Host-Fingerprint: 64.233.182.185 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.185] ([64.233.182.185:5350] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/AC-19506-DA5A0854 for ; Wed, 13 Dec 2006 20:16:00 -0500 Received: by nf-out-0910.google.com with SMTP id l35so726180nfa for ; Wed, 13 Dec 2006 17:15:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dyk4MGs8xVtB36pX4KVWhyHNJGFPqzuUw2T6zJ1Gt8YunX5MVTv11tfjynwpUw1SyIDeVB8S8JQ/kJh6oHL9uEPYq3Z012jORZ/QrWCc6liFCt6py06UwyDSMzpFcyZ1/3EOpwHiKB6tq1pPr+lgYVKNpWI2OzUA//5/U4BCKKw= Received: by 10.82.105.13 with SMTP id d13mr153626buc.1166058921789; Wed, 13 Dec 2006 17:15:21 -0800 (PST) Received: by 10.82.167.13 with HTTP; Wed, 13 Dec 2006 17:15:21 -0800 (PST) Message-ID: <4e89b4260612131715s5e8e5e5awcedee94e13867225@mail.gmail.com> Date: Wed, 13 Dec 2006 20:15:21 -0500 To: "Mario Wolff" Cc: internals@lists.php.net In-Reply-To: <9bb5e33f0612110229k680e3dbah1276976a36d963cf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9bb5e33f0611160505u2ac2b1dbt1b04feea4314331c@mail.gmail.com> <4e89b4260611160629o1855ed28pf37139f1576fa99b@mail.gmail.com> <9bb5e33f0611160721l6676cbe5ud0185127fad03402@mail.gmail.com> <9bb5e33f0611160745i4ef015e7i16933d7a4904a6ff@mail.gmail.com> <9bb5e33f0611160752g38cdc4acy92e0f72b9aee9c8b@mail.gmail.com> <4e89b4260611160840p19ad23acg100d9ce44655bd2c@mail.gmail.com> <9bb5e33f0611171402u7ca7523ci382b3c07cf8e8815@mail.gmail.com> <9bb5e33f0611201235m67639d8lcf4e40cf4fa8672b@mail.gmail.com> <9bb5e33f0612110229k680e3dbah1276976a36d963cf@mail.gmail.com> Subject: Re: [PHP-DEV][RFC] Enable authorizer-feature in PDO_SQLITE From: kingwez@gmail.com ("Wez Furlong") Hi Mario, Sorry that I didn't get back to you--I often get too busy to follow up on PHP related mail so you need to poke. I'm currently doing some work on PDO and so I'll look at integrating your patch this week; if I don't spot any problems, I'll commit it, otherwise I'll get back to you to discuss it. Thanks for putting in the effort! --Wez. On 12/11/06, Mario Wolff wrote: > Any suggestions or meanings on it? > > Thanks, > Mario > > Short test script: > $data = array( 'one', 'two', 'three', 'four', 'five', 'six'); > $db = new PDO( 'sqlite::memory:'); > echo "register authorizer\n"; > $db->sqliteSetAuthorizer('auth'); > $db->exec( "CREATE TABLE strings( a)"); > $insert = $db->prepare( 'INSERT INTO strings VALUES ( ?)'); > foreach ( $data as $str) { > $insert->execute( array( $str)); > } > $insert = null; > > if( $delete = $db->prepare( 'DELETE FROM strings where a=?')){ > if( $delete->execute(array( "six" ))){ > echo "delete done!\n"; > } > $delete = null; > }else{ > echo "delete not prepared\n"; > } > > echo "unregister authorizer\n"; > $db->sqliteSetAuthorizer(); > > if( $delete = $db->prepare( 'DELETE FROM strings where a=?')){ > if( $delete->execute(array( "six" ))){ > echo "delete done!\n"; > } > $delete = null; > }else{ > echo "delete not prepared\n"; > } > > function auth($type,$arga,$argb,$argc,$argd ){ > echo "$type\t$arga\t$argb\t$argc\t$argd\n"; > if( $type==SQLITE_DELETE ){ > return SQLITE_DENY; > } > return SQLITE_OK; > } > print_r( $db->query( 'SELECT sqlite_version( *);')->fetchAll( )); > print_r( $db->query( 'SELECT * from strings;')->fetchAll( )); > > ?> > > gives: > register authorizer > 18 sqlite_master main > 2 strings main > 23 sqlite_master type main > 23 sqlite_master name main > 23 sqlite_master tbl_name main > 23 sqlite_master rootpage main > 23 sqlite_master sql main > 20 sqlite_master ROWID main > 20 sqlite_master name main > 20 sqlite_master rootpage main > 20 sqlite_master sql main > 20 sqlite_master tbl_name main > 18 strings main > 9 strings main > delete not prepared > unregister authorizer > delete done! > Array > ( > [0] => Array > ( > [sqlite_version( *)] => 3.3.7 > [0] => 3.3.7 > ) > > ) > Array > ( > [0] => Array > ( > [a] => one > [0] => one > ) > > [1] => Array > ( > [a] => two > [0] => two > ) > > [2] => Array > ( > [a] => three > [0] => three > ) > > [3] => Array > ( > [a] => four > [0] => four > ) > > [4] => Array > ( > [a] => five > [0] => five > ) > > ) > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > >