Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-17 Thread Mario Wolff
2006/11/16, Wez Furlong <[EMAIL PROTECTED]>: I think it would be better to pass in the pdo_dbh_t as the autharg to the C level callback and then use that to determine if any of the expensive work needs to be done in the callback. Saves the sqlite_set_authorizer recall in SetAuthorizer, Looks si

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Wez Furlong
I think it would be better to pass in the pdo_dbh_t as the autharg to the C level callback and then use that to determine if any of the expensive work needs to be done in the callback. static int authorizer() { pdo_dbh_t *db; /* keep the current safemode / basedir checks "cheap" and fast *

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Mario Wolff
Short test script: 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; echo "unregister authorizer\n"; $db->sqliteSetAuthorizer(); fun

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Mario Wolff
2006/11/16, Mario Wolff <[EMAIL PROTECTED]>: 2006/11/16, Wez Furlong <[EMAIL PROTECTED]>: > I suggest that you adjust your patch to cache the function callback > information in the pdo_dbh_t to reduce some of that overhead, and run > some benchmarks for a simple authorizer function in PHP that al

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Mario Wolff
2006/11/16, Wez Furlong <[EMAIL PROTECTED]>: I suggest that you adjust your patch to cache the function callback information in the pdo_dbh_t to reduce some of that overhead, and run some benchmarks for a simple authorizer function in PHP that always returns true vs the same script with no author

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Mario Wolff
@Wez: Whoop, just found you as maintainer in Pecl and send the same request direct to you, sorry! 2006/11/16, Wez Furlong <[EMAIL PROTECTED]>: Two comments about the patch: - could you create a unified diff and post that instead? Here it is! - static local variable usage is not thread safe;

Re: [PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Wez Furlong
Two comments about the patch: - could you create a unified diff and post that instead? - static local variable usage is not thread safe; state should be stored in the pdo_dbh_t structure. And one concern: I deliberately left this feature unimplemented so far because the authorization callback w

[PHP-DEV] Enable authorizer-feature in PDO_SQLITE

2006-11-16 Thread Mario Wolff
Hello list, i've extended sqlite_driver to get access to the authorizer-feature of sqlite. This is my first contact with the Zend-API and my last c skill is more than a bit outdated. Could someone review/cleanup my code to get it merged to the distribution? Hint and comment welcome! Thanks, Mario