News

Zend Framework 2 Beta 2 released

Zend Framework 2, Beta 2 has been released!

The key new features are:

  • Refactored Mail component
  • Refactored Cache component
  • MVC updates

Check out Matthew’s blog post for the full details.

I’ve also updated my tutorial. This is a good time to get involved, try it out and let us know what you like/dislike.

flattr this!

Author: Rob…

by News Robot on December 21, 2011 in News, No Comments »
tags: , , ,

Zend Reveals What Music Will Keep Developers Productive (and Happy) This Holiday

Zend Developer Pulse Survey Shows Which Artists are Hot or Not  

 

We are living in an app economy, where even the newest software applications are downloaded by the billions in the blink of an eye. Software industry growth is outpacing some other industries, employing millions of people, and often paying higher salaries than other jobs. With software doing so much to fuel the global economy, it makes sense to keep the people who are writing the code productive and happy, right?

It’s well-known that music can inspire minds for brilliance and productivity. By their own admission, developers claim that music helps them ‘become one with the machine’ and get into the zone, working intensely at all hours of the day or night.

Zend Technologies, a developer-centric software company and leading provider of solutions to build and deploy web apps, recently asked developers about their musical preferences, among other things, in a new survey series called the Zend Developer Pulse. In less than 48 hours, some 3,335 developers responded, with some interesting results:

Zend Developer Pulse Survey – Findings on musical preferences among software developers

The survey showed that as much as 86% of developers listen to music while coding. Of the major music genres, 42% of developers said they prefer coding to music of the rock/pop variety.

#1 most popular artist to code to: Metallica.  Runners-up: Pink Floyd and Linkin Park

#1 biggest ‘guilty pleasure’ artist: Lady Gaga (artists that coders only listen to with their headphones on).  Runners-up: Britney Spears and ABBA

#1 least popular artist: Justin Bieber.  Runners-up: Lady Gaga and Britney Spears (ironically, these least popular artists also topped the ‘guilty pleasure’ category).

Those with a favorite coder in the family or at the office can give the gift of music this season, and check off one more name on their holiday shopping list.

In January 2012, Zend will announce the full results of its first Zend Developer Pulse Survey. The new survey series will provide the developer perspective on industry, technology and career, revealing insights into technology trends for 2012 — from mobile to cloud computing and beyond.

Learn more at www.zend.com.

Media contacts:
Sammy Totah
BOCA Communications
z...@bocacommunications.com
415.738.7718

Author:

Zend Announces GA Release of Zend Server for IBM i 5.6

New Features Make it Faster, Easier for Customers to Deliver Modern Web Applications and Web Services Using PHP on IBM i

Zend Server for IBM i makes it possible to quickly modernize business-critical applications and leverage business logic stored in databases, or to create brand new web-based applications using PHP on the IBM i platform. Zend Server for IBM i 5.6 adds the ability to streamline and automate deployment for speed, efficiency and consistency to help ensure business-critical web applications meet SLAs and deliver the best possible end-user experience.

Rapid and Reliable Web Application Deployment

  • Development teams can now deliver fully packaged, ready-to-run applications to operations teams, with predefined settings and parameters. This saves time and helps eliminate guesswork and unnecessary errors commonly associated with conventional deployment processes.
  • Proactive monitoring provides development and operations teams with real-time visibility into bottlenecks or errors in development and production environments. Alert notifications deliver timely information on application status and deployment issues so teams can resolve issues quickly and definitively.
  • The new ability to rapidly roll back and recover from code or deployment errors or outages ensures that servers and applications can be restored to their last-known working state. Successful launches that eliminate downtime delays and SLA non-compliance problems can help a company save thousands or even millions of dollars and retain brand loyal customers.
  • Web APIs automate the provisioning, configuring and deployment of applications.
  • Enablement of Continuous Integration processes provides support for agile deployment.

Integration with XML Toolkit

  • IBM and Zend have developed a fully open-source toolkit based in XML, which provides an integration layer for access to IBM i data, programs and operating system functions.
  • The new XML Toolkit is based on standard technologies such as DB2, RPG, XML and PHP, and takes advantage of IBM i mechanisms such as standard DB2 connections, stored procedures, and RPG ILE. Fully PHP-based client-side code provides compatibility with any platform that can connect to DB2 on IBM i.
  • The new XML Toolkit is available as part of Zend Server for IBM i 5.6.
  • After December 31, 2011, the Easycom Toolkit will no longer be included with Zend Server for IBM i.  A built-in ‘compatibility wrapper’ makes it easy to migrate to the new XML Toolkit. The compatibility wrapper, now in beta, provides PHP implementations of most Easycom toolkit functions.

Zend Server for IBM i 5.6 Availability

IBM delivers Zend Server for IBM i with every IBM i shipment. IBM and Zend make it easy for customers to explore and use Zend Server based on their needs. 

  • Existing customers with an active subscription to Zend Server for IBM i are automatically entitled to a free upgrade to the latest release. 
  • New customers may subscribe to Zend Server for IBM i 5.6, with up to 24x7x365 support, available for purchase directly through Zend. Pricing starts at 50 per server depending on server model and subscription level.
  • New customers may also subscribe to Zend Server Community Edition for IBM i 5.6, with the first year of basic support provided by Zend at no charge.  Users who receive the software from IBM simply register via the Zend website to access this support offering.


Zend Solutions for IBM i
Since 2006, Zend and IBM have partnered to deliver Zend solutions for IBM i, delivering a complete PHP development and production environment solution for the IBM i platform. With Zend Server for IBM i, customers can develop, deploy and manage modern Web apps and Web services, maximizing their investment in the IBM i platform while minimizing the risk and cost sometimes associated with modernization and web-enablement. Zend Server for IBM i offers the only complete, enterprise-ready PHP stack that combines application deployment, proactive monitoring, Code Tracing with root-cause analysis for quick problem resolution, powerful caching and other performance optimizations, job queuing, and a tested and certified PHP runtime supported by Zend, the PHP Company. An integral part of the Zend family of solutions, Zend Server for IBM i also includes Zend Framework, the leading PHP application framework, and is fully integrated with Zend Studio, the leading PHP IDE.

Consulting and Training

  • Smart Start for IBM i – to accelerate development and deployment of PHP apps.  Includes on-site training for RPG programmers, and set up of Zend solutions on IBM i plus assistance with start up of a fully operational, PHP-based pilot project.
  • Training for RPG developers – curriculum focused on building proficiency with PHP and Zend Server, and accelerating time to market with web applications.

Product Information
Zend Server for IBM i (http://www.zend.com/en/products/server/zend-server-ibm-i)
Zend Solutions for IBM i (http://www.zend.com/en/solutions/modernize-ibm-i/)

Webinar
Zend Server for IBM i Update, January 11, 2012: 9am PST, 12pm EST, 5pm GMT, 6pm CET
http://www.zend.com/en/company/news/event/929_webinar-zend-server-5-5-update

Author:

by News Robot on December 20, 2011 in News, No Comments »
tags: , , ,

Configuring Zend Framework apps for Windows Azure

Building web applications is nothing new anymore, as we’ve beendoing it since the early days of the internet, but we’ve alwaysdone this on a single system. Even when Zend Framework came round,we kept doing the same thing and build apps for a singleenvironment.
But as I’ve discussed already in my previous article, developing for the cloud requires anotherapproach.

As you can see, your system now falls appart into all differentcomponents that are systems by themselves. And each system has itsown purpose, completely independent from each other.

With Zend Frameworkdeveloping applications running on these separate compontentsbecomes really easy. It’s like having your cloud toolbox right inyour pocket.

Databases

With Zend Framework,connecting to databases is really easy and swapping out a databasebrand is just a matter of modifying your configurationapplication/configs/application.ini.

resources.db.adapter = "pdo_mysql"resources.db.params.host = "10.20.30.40"resources.db.params.username = "user1"resources.db.params.password = "secret"resources.db.params.dbname = "db1"resources.db.isDefaultTableAdapter = true

Even if you need to connect to multiple databases, you can justpile them up as configuration setting and be done with it.

resources.multidb.server1.adapter = "pdo_mysql"resources.multidb.server1.host = "10.20.30.40"resources.multidb.server1.username = "user1"resources.multidb.server1.password = "secret1"resources.multidb.server1.dbname = "db1"resources.multidb.server1.default = true

resources.multidb.server2.adapter = "pdo_pgsql"resources.multidb.server2.host = "10.20.30.41"resources.multidb.server2.username = "user2"resources.multidb.server2.password = "secret2"resources.multidb.server2.dbname = "db2"

resources.multidb.server3.adapter = "pdo_sqlite"resources.multidb.server3.dbname = APPLICATION_PATH "/files/db/project.db"

But this is just the basics. When dealing with the cloud youoften get a connection string for the host, so it’s real easy tohook up to an relational database in the cloud. Here’s an exampleto connecting to SQL Azure.

resources.db.adapter = "SQLSRV"resources.db.params.host = "abcdefghijk.database.windows.net"resources.db.params.port = 1234resources.db.params.username = "user1"resources.db.params.password = "secret"resources.db.params.dbname = "db1"resources.db.isDefaultTableAdapter = true

Bottom line, no worries connecting to a cloud database. Zend Framework has yourback!

Sessions

As you want to assist your visitors as much as possible, youprobably want to use sessions in your application. If you don’tconfigure anything, PHP stores session on your filesystem bydefault and so does ZendFramework.

For the cloud, you don’t want to write to your local filesystem,so you set up session storage. I chose to use the SQL Azure serverI already had setup using the following settings.

resources.session.use_only_cookies = trueresources.session.gc_maxlifetime = 864000resources.session.remember_me_seconds = 864000resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable"resources.session.saveHandler.options.name = "session"resources.session.saveHandler.options.primary = "id"resources.session.saveHandler.options.modifiedColumn = "modified"resources.session.saveHandler.options.dataColumn = "data"resources.session.saveHandler.options.lifetimeColumn = "lifetime"

No further changes need to be done as all fields are defined andthis Zend_Session_SaveHandler_DbTable takes care of all the rest.

Caching

Just like databases, providing caching for your applicationrequires just a few simple configuration settings, this examplesets up a memcache service.

resources.cachemanager.memcached.frontend.name = Coreresources.cachemanager.memcached.frontend.options.automatic_serialization = Onresources.cachemanager.memcached.backend.name = Libmemcachedresources.cachemanager.memcached.backend.options.servers.one.host = localhostresources.cachemanager.memcached.backend.options.servers.one.port = 11211resources.cachemanager.memcached.backend.options.servers.one.persistent = On

Caching on the cloud requires a little different approach as mostcloud services offer their own flavor of caching, making itdifficult to find a PHP driver that is capable to access thiscloud caching layer. But don’t let this stop you in moving to thecloud. Windows Azure provides a superb caching platform, and I’llshow you later in these series how to modify your application asit requires a little tweek on the configuration of your WindowsAzure installation.

Storage

Uploading and distributing files can be considered as an importanpart of any application, and with Zend Framework you canmanage file uploads relatively simple using Zend_Form andZend_File.

An example would be to upload a small image.

public function uploadAction(){ $adapter = new Zend_File_Transfer_Adapter_Http();

 $adapter->setDestination(APPLICATION_PATH '/files/upload');

 if (!$adapter->receive()) { $messages = $adapter->getMessages(); echo implode("\n", $messages); } $this->view->filename = $adapter->getFileName('avatar', false);}

Saving into a specific location is done with$adapter->setDestination(), but this still requires the usageof a local location! And we know that in the cloud saving locallyhas no use! Luckily for you, ZendFramework has a bunch of components that will allow you tostore files onto a Windows Azure Storage instance.

 public function uploadAction() { $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/api.ini', APPLICATION_ENV);

 $azure = new My_Cloud_WindowsAzure_AzureStorage( $config->azure->storage->account,  $config->azure->storage->primkey);

 $container = $config->azure->storage->container;

 $adapter = new Zend_File_Transfer_Adapter_Http(); $adapter->setDestination(APPLICATION_PATH '/files/upload');

 if (!$adapter->receive()) { $messages = $adapter->getMessages(); echo implode("\n", $messages); }

 $storageClient = new Zend_Service_WindowsAzure_Storage_Blob( My_Cloud_WindowsAzure_AzureStorage::AZURE_STORAGE_HOST,  $azure->getAccountName(), $azure->getPrimaryKey());

 $result = null;

 if (!$storageClient->containerExists($container)) { $result = $storageClient->createContainer($container); $storageClient->setContainerAcl($container,  Zend_Service_WindowsAzure_Storage_Blob::ACL_PUBLIC_CONTAINER); }

 $fileName = $adapter->getFileName('resume', true); $result = $storageClient->putBlob( $container, basename($fileName), $fileName );

 $this->view->filename = basename($fileName); $this->view->location = sprintf('http://%s.%s/%s/%s', $azure->getAccountName(), My_Cloud_WindowsAzure_AzureStorage::AZURE_STORAGE_HOST, $config->azure->storage->container, $result->Name); }

As you can see, you only need to add a little more functionalityto the first example. But once you have everything in place,nothing can stop you achieving your goals.

; These are local configuration settings; Primarily used to access API's using credential tokens[production]...azure.storage.account = "myblobstorageaccount1"azure.storage.primkey = "fjldjljdlfjadladjsljdfljfdljd/akjddfjldfjjd22kajdajfei3234ajldjfjklajlajd=="azure.storage.container = "myblobstoragecontainer"...

[staging: production][testing: production][development: production]

In this example I used an api.ini which is very convenient tostore your most import settings like account names, api keys andpasswords to various api services. It’s just a file containingkey-value pairs for easy configuration. In this case my INIsettings look like the following listing.

Next

Now that we’ve talked about the specific settings in your Zend Framework applicationit’s about time we set up our environment, download all the tools,register for a Windows Azure account and get started with runningour Zend Framework appin the cloud. So stay tuned for more.



Author:

by News Robot on December 19, 2011 in News, No Comments »
tags: , , , , ,

On Error Handling and Closures

The error suppression operator in PHP (“@”) is often seen as a necessary
evil. Many, many low-level function will return a value indicating an error,
but also raise an E_NOTICE or E_WARNING — things
you might be able to recover from, or conditions where you may want to raise
an exception.

So, at times, you find yourself writing code like this:


if (false === ($fh = @fopen($filename, 'r'))) {
    throw new RuntimeException(sprintf(
        'Could not open file "%s" to read', $filename
    ));
}

Seems straight-forward enough, right? But it’s wrong on so many levels.

Author: Matthew Weier O’Phinney

by News Robot on December 17, 2011 in News, No Comments »
tags: , ,