Connect PHP5 to SQL AzureWednesday, October 14. 2009
With SQL Azure right around the corner (expected to go live in November 2009), I had to evaluate if we could migrate some databases 'into the microsoft cloud'.
The pitch from Microsoft senior program manager David Robinson is "With SQL Azure, developers building Web 2.0, ASP.Net and PHP applications can use familiar tools and data models to develop on a pay-as-you-grow, secure, scalable and highly available database service at minimal infrastructure cost,". First, there are limitations, but essentially microsoft is offering a subset of SQL server 2008 running on their infrastructure. SQL Azure is the first hosted database product with good support for Transact-SQL. This means that any application using nearly standards compliant SQL queries could easily be migrated to use SQL Azure. For example, using the MV framework, it could be as simple as changing your connection PostgreSQL: SQL Azure: Since Microsoft has made it relatively easy to connect to SQL Azure from Windows (SQL Server Native Client), this post looks at connecting php5 on unix to SQL Azure. There are two methods to connect to SQL Azure from UNIX. a) Using mssql_connect() b) Using odbc_connect() Once your unix server is properly configured, you can go ahead and test php connections. If all went well, you should see 'Success' everywhere. Be sure to check the version of FreeTDS and unixODBC you are using! If you run into bugs with these tools, well report them or write a patch! My conclusion, although FreeTDS works, it is not enterprise ready and needs some corporate backing. Naturally, this brings the question, what Microsoft is up to? GAE & PHPThursday, April 16. 2009
There's a really easy way to get PHP running on Google's app engine, see this great link:
http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/ In short, it works by using 'Quercus' which likely takes the php scripts, transforms and compiles into java bytecode that gets run in the JVM. Don't understand all that? No problem, the important note it is seems to work well. So far I've tested two pieces of code: Memcache Works great. Now, probably the most important reason to use App Engine? Access to your very own google database! Running scalable web services just got a whole lot easier. The bad news is there's no good interface or classes yet with php, so you have to go through using google's 'raw' datastore API. Datastore Unfortunately, it throws a NULL exception. So aside from the quirks, it looks promising. The Datastore API is documented here. PHP LINQ?Thursday, July 24. 2008
When it comes to writing Web applications, a developer often needs to access data from a multitude of data sources. The result is often a lot of spaghetti code that iterates and filters the results (XML, csv, soap, REST services, and so on).
But the most common data that's accessed is in a relational database. Luckily, at some point database vendors agreed on SQL (standard query language) which is a common way to access /query data from a database. With the reality of the Web, wouldn't it be nice to have some form of standard query language to access many forms of data?? That's what Microsoft's LINQ attempts to offer. It's a great innovation and I was curious about what a PHP API could look like and it turns out there's a good discussion here: http://www.mikeborozdin.com/post/Is-PHPLinq-As-Cool-As-Real-LINQ.aspx The advantage of LINQ in .NET is how the LINQ expressions can be evaluated and compiled. In short, it takes the expressions ("pretty" code) and builds the "spaghetti code that iterates and filters the results" automatically. If the compiler is smart and can make proper machine level optimizations, I would guess it means very fast execution and a standard way of accessing data. Amazing! As for PHP, Maarten Balliauw still went ahead and created a PHP implementation of LINQ: http://www.codeplex.com/PHPLinq/Release/ProjectReleases.aspx?ReleaseId=10084 It's definetly "interesting" at this point and if PHP could support natively some form of LINQ, it would be a major achievement and very cool stuff. There's also a java version of "LINQ" (Quaere): http://www.theserverside.com/news/thread.tss?thread_id=46887 Short PHP array synthaxFriday, May 30. 2008
There's an RFC that has been recently declined through the PHP internals list. It is a minor change/patch to introduces a short synthax to declare arrays in PHP.
To declare an array in PHP, you currently use the following synthax: The proposed patch (a few lines) would allow to declare arrays in a shorter form: This notation is used by many programming languages, most notably javascript. Since PHP is essentially a programming language used for the Web, my opinion is it makes perfect sense to support a javascript-like notation for arrays. There's some resistance from the core developers and overall there were too many veto (negative) votes. I definitely understand their concern but feel it's a natural evolution of the language, this to me seems like something most users would want to see in PHP. Hopefully, the PHP community can speak out enough to get better idea of what the users / php community wants. The actual proposal and more info at: http://wiki.php.net/rfc/shortsyntaxforarrays.
(Page 1 of 1, totaling 4 entries)
|
Calendar
QuicksearchArchivesCategoriesSyndicate This Blog |
|||||||||||||||||||||||||||||||||||||||||||||||||