 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Lukas Smith's Blog: Query parameter handling in Symfony2
by Chris Cornutt May 14, 2012 @ 11:56:37
Lukas Smith is looking for feedback about a question that's been in his mind a lot lately - can the handling of query parameters be made better for the Symfony2 framework (and even easier to use).
Obviously you can already access query parameters today already but it could be easier. Essentially what I want is a way for developers to easily configure what query parameters they expect and what values they expect. This is useful for several things like easier reading and validating of query parameters, self documenting API both for API docs for humans but also for machines.
He's asking for feedback and ideas from the community on a proposed solution that could make things more flexible. He also briefly mentions the route matching and how qurey parameters could cause them not to match:
For one I don't think that a mismatch on a route requirement of a query parameter cause the route to not match. However then it can quickly become confusing for the end user or it would require adding more and more syntax to handle all the different cases.
voice your opinion now!
symfony2 query parameter handling solution routing match
Anthony Ferrara's Blog: Parameter Type Casting in PHP
by Chris Cornutt March 06, 2012 @ 11:05:32
Anthony Ferrara has a new article posted to his site today about parameter typecasting and the discussions that have been happening about it on the PHP "internals" mailing list.
As any of you who follow the PHP internals list know, scalar type hinting has been a hot topic as of late. You'll also know that I've submitted two new RFC (Request For Comment) proposals for inclusion of two new major features in the PHP language. I figured it was worth going into both RFCs and patches a little deeper, explain my rationale and (hopefully) garner some more visibility of the proposals.
He shares the details of the two main RFCs that are proposed right now - parameter type casting hints and object scalar casting magic methods (both with code examples). Right now, they're only in the patch stage and there's talk of improving the current casting functionality of PHP before something like one of these goes into place.
voice your opinion now!
parameter type casting proposals rfc internals mailing list
Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli
by Chris Cornutt November 04, 2011 @ 11:39:18
Ulf Wendel has a new post today with details on using stored procedures with mysqli - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them.
Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is not stellar, I confess. But still, that's a bit too much... it ain't that difficult. And, it works.
He describes the three parameters (IN, OUT and INOUT) and gives some examples of setting/getting them from your SQL statements. They're all still set up using the query method on your connection as well as handling the result sets that come back and working with prepared statements.
voice your opinion now!
mysql stored procedures mysqli database in out inout parameter
rooJSolutions Blog: Watch-out PHP 5.3.7+ is about.. and the is_a() / __autoload() mess.
by Chris Cornutt September 02, 2011 @ 10:43:24
New from the rooJSolutions blog there's a post pointing out an issue that PHP 5.3.7 has broken the is_a functionality in a lot of cases. The post talks some about what's broken and how you can work around it if you're effected.
The key issue was that 5.3.7 accidentally broke is_a() for a reasonably large number of users. Unfortunately the fixup release 5.3.8 did not address this 'mistake', and after a rather fruitless exchange I gave up trying to persuade the group (most people on mailing list), that reverting the change was rather critical (at least pierre supported reverting it in the 5.3.* series).
This new issue was causing some strange errors to pop up in his code because of a parameter type change in the is_a call, updating the first parameter to be an object instead of a class name. The is_a() call sends its requests to __autoload in some cases and the string->object mismatch of those parameters causes errors to be thrown. His workaround is, in your checking, just be sure to call an is_object first before passing things off to be is_a() checked and autoloaded.
voice your opinion now!
bug isa autoload parameter change string object
Justin Carmony's Blog: PHP Itch to Scratch Object Notation
by Chris Cornutt April 14, 2011 @ 13:42:33
In a new post to his blog Justin Carmony talks about a few "itches" he's wanted to scratched when it comes to features of the PHP language - in this post it's the notation that's used surrounding the use of objects.
At the end [of Marco's post to his blog], he states it ultimately boils down to find a better way to bring features build downstream back upstream. So I thought I would do my part by first my blogging about a few "itches" I'd love to see scratched. My first itch would be some form of Object Notation for PHP.
He talks about the notation method that Javascript has always had and how it can help to make objects more flexible by not forcing their creation through a method/argument interface. He offers one potential solution - using arrays for settings values - but notes that it could be more trouble than it's worth in the implementation. He proposes a new sort of notation instead, one that allows the passing of something similar to the Javascript JSON-ish definition of values and callbacks as anonymous functions.
voice your opinion now!
object notation suggestion array parameter
Brian Swan's Blog: Why Pass Parameters by Reference in the SQLSRV Driver?
by Chris Cornutt November 25, 2010 @ 09:15:22
Brian Swaan has a new post to his blog talking about why you, in your SQL Server-based application, pass the parameters in by reference.
Last week at JumpIn Camp we spent quite a bit of time focusing on the SQL Server Driver for PHP. As developers worked to build SQL Server support into their applications, they had lots of questions about how both the SQLSRV and PDO_SQLSRV drivers work under the hood. One of the questions that came up was "When using the SQLSRV driver to execute parameterized queries, why do I have to pass parameters by reference?"
He includes a simple code example to show this passing by reference - first without it on the call to sqlsrv_prepare (and the warning message it gives) then the more correct version of passing in the past parameter by reference.
The SQL Server Driver for PHP team understands that passing parameters by reference is not ideal. [...] With that said, the team is continuing to investigate solutions that would produce expected behavior without passing parameters by reference.
voice your opinion now!
parameter passbyreference sqlservprepare sqlsrv driver
|
Community Events
Don't see your event here? Let us know!
|