Re: [PHP-DEV] Patch: Use notices in PDO
Samuel ROZE wrote: > It's a good idea. > > - PDO::NOTICES_FETCH -> PDO::NOTICES_ENABLED > - PDO::NOTICES_NONE -> PDO::NOTICES_DISABLED > > That's better ? That works. > I see that you are from the Oracle team. Can you explain me how oracle > works to raise notices like PostgreSQL ? Or can you build a proof of > concept to get notices from Oracle ? I'm equating your NOTICES to Oracle's DBMS_OUTPUT. See "Getting Output with DBMS_OUTPUT" on p 181 of: http://www.oracle.com/technology/tech/php/underground-php-oracle-manual.html Something similar could be coded in the PDO driver. The amount of text output could be quite large, depending on the user's coding style. Is your design extensible enough to allow for streaming/chunking if the interface needs to be enhanced? PL/SQL also has compile time warnings and errors that are handled differently, see "PL/SQL Success With Information Warnings" on p167. Chris > > Thanks. > Samuel. > > Le jeudi 08 octobre 2009 à 15:22 -0700, Christopher Jones a écrit : >> Samuel ROZE wrote: >>> Hi, >>> >>> I've make a patch which insert notices concepts to PDO. It create: >>> - PDO::noticeInfo() - to be like errorInfo >>> - PDO::ATTR_LOG_NOTICES, the name of the PDO parameter >>>- PDO::NOTICES_FETCH - fetch notices >> I initially took "FETCH" to mean it was related to a query; this >> wouldn't always be the case. What about calling it NOTICES_ENABLE? >> >> Chris >> > > -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Patch: Use notices in PDO
It's a good idea. - PDO::NOTICES_FETCH -> PDO::NOTICES_ENABLED - PDO::NOTICES_NONE -> PDO::NOTICES_DISABLED That's better ? I see that you are from the Oracle team. Can you explain me how oracle works to raise notices like PostgreSQL ? Or can you build a proof of concept to get notices from Oracle ? Thanks. Samuel. Le jeudi 08 octobre 2009 à 15:22 -0700, Christopher Jones a écrit : > > Samuel ROZE wrote: > > Hi, > > > > I've make a patch which insert notices concepts to PDO. It create: > > - PDO::noticeInfo() - to be like errorInfo > > - PDO::ATTR_LOG_NOTICES, the name of the PDO parameter > > - PDO::NOTICES_FETCH - fetch notices > > I initially took "FETCH" to mean it was related to a query; this > wouldn't always be the case. What about calling it NOTICES_ENABLE? > > Chris > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Patch: Use notices in PDO
Samuel ROZE wrote: Hi, I've make a patch which insert notices concepts to PDO. It create: - PDO::noticeInfo() - to be like errorInfo - PDO::ATTR_LOG_NOTICES, the name of the PDO parameter - PDO::NOTICES_FETCH - fetch notices I initially took "FETCH" to mean it was related to a query; this wouldn't always be the case. What about calling it NOTICES_ENABLE? Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Patch: Use notices in PDO
There's an example, using PostgreSQL driver: PDO::NOTICES_FETCH )); var_dump($sql); echo "getAttribute: "; var_dump($sql->getAttribute(PDO::ATTR_LOG_NOTICES)); echo 'Notices: '; var_dump($sql->noticeInfo()); $q1 = $sql->query('CREATE OR REPLACE FUNCTION test_notice (v_int integer) RETURNS integer AS $$ BEGIN RAISE NOTICE \'Sympatique % !\', v_int; RAISE NOTICE \'Sympatique un nouvelle fois % !\', v_int; RAISE NOTICE \'Génial maintenant... % \', v_int; RETURN 12; END; $$ LANGUAGE plpgsql;'); $q2 = $sql->query('SELECT * FROM test_notice(1)'); echo 'Query: '; var_dump($q2); echo 'Notices: '; var_dump($sql->noticeInfo()); ?> That will return: object(PDO)#1 (0) { } getAttribute: bool(true) Notices: bool(false) Query: object(PDOStatement)#3 (1) { ["queryString"]=> string(28) "SELECT * FROM test_notice(1)" } Notices: array(3) { [0]=> string(23) "NOTICE: Sympatique 1 !" [1]=> string(40) "NOTICE: Sympatique un nouvelle fois 1 !" [2]=> string(33) "NOTICE: Génial maintenant... 1 " } Query: object(PDOStatement)#4 (1) { ["queryString"]=> string(10) "SELECT 1,2" } Notices: bool(false) Samuel. Le jeudi 08 octobre 2009 à 23:51 +0200, Samuel ROZE a écrit : > Hi, > > I've make a patch which insert notices concepts to PDO. It create: > - PDO::noticeInfo() - to be like errorInfo > - PDO::ATTR_LOG_NOTICES, the name of the PDO parameter > - PDO::NOTICES_FETCH - fetch notices > - PDO::NOTICES_NONE - don't fetch notices > > The notices HashTable is emptied at each queries. > > There is a patch to implements this function into PDO: > http://www.d-sites.com/wp-content/uploads/2009/10/php-5_3-pdo-notices-managment.patch > > And one other to implements notices recuperation for PostgreSQL: > http://www.d-sites.com/wp-content/uploads/2009/10/php-5_3-pdo-pgsql-notices-managment.patch > > It can be done for Oracle, i'm sure. > > Thanks for feedbacks. > Samuel. > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Patch: Use notices in PDO
Hi, I've make a patch which insert notices concepts to PDO. It create: - PDO::noticeInfo() - to be like errorInfo - PDO::ATTR_LOG_NOTICES, the name of the PDO parameter - PDO::NOTICES_FETCH - fetch notices - PDO::NOTICES_NONE - don't fetch notices The notices HashTable is emptied at each queries. There is a patch to implements this function into PDO: http://www.d-sites.com/wp-content/uploads/2009/10/php-5_3-pdo-notices-managment.patch And one other to implements notices recuperation for PostgreSQL: http://www.d-sites.com/wp-content/uploads/2009/10/php-5_3-pdo-pgsql-notices-managment.patch It can be done for Oracle, i'm sure. Thanks for feedbacks. Samuel. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] #49785 htmlspecialchars() should check byte sequence more strictly
Hi, Jani closed the following bug report: #49785 htmlspecialchars() should check byte sequence more strictly http://bugs.php.net/bug.php?id=49785 But I think that his reaction isn't good. Does he understand this problem truly? This is a SECURITY PROBLEM. Some Japanese experts in security discussed about this problem. This report is the result of those discussions. I explain about this problem in English: http://co3k.org/sample/php_bugs_49785.html Do you still want to reject this problem? We want to talk about this problem with another one who is well informed about encoding. Would you bring such one? Thanks, -- Kousuke Ebihara ebih...@tejimaya.com http://sns.openpne.jp/?a=page_f_home&target_c_member_id=807 OpenPNE Project http://www.openpne.jp Tejimaya.inc http://tejimaya.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php