Archive for category PHP

Using Zimbra LDAP Server Authentication with PHP

I wanted to provide our CRM users an alternate way of logging to the system using their Zimbra email authentication and there is a really easy way of doing it which I have figured out in little while with googling. Definitely PHP online help docs and Zimbra forums both came to help and found a correct options to use from Zimbra Forums which is powered by it's USERS.

Just make sure to enable php_ldap extension before you move further.

// Uncomment following line from php.ini
extension=php_ldap.dll

Following code snippet could be used to authenticate and find out whether provided Username and Password belongs to valid Zimbra User or not by authenticating it with Zimbra's LDAP (Light-weight Directory Access Protocol) server. So this way if you want you can provide your intranet/business application users an ability to use their Zimbra (mail/collaboration system) password to be used as an optional way to authenticate themselves. Read the rest of this entry »

Tags: , ,

When PHP Frameworks are going to stop PHP 4 support?

As of now we have many frameworks which are still supporting PHP 4.x. CakePHP and CodeIgniter are leading that troop. Now we have PHP 6 about to get ready for production and PHP 5.x is in it's mature stage since long while now with PHP 5.3 as the latest release. I am not against for support on 4.x version of PHP; may great developers/teams have developed awasom tools and application and they should be still usable without any modifications in their coding.

PHP 4.x Hosting:

So PHP 4.x support for hosting is fine and it's required to keep those applications running and being hosted without any maintenance saving efforts and time. So applications developed for PHP 4.x can run as long as they wish and till there are no equivalent forks of them available in PHP 5.x or newer version.

PHP 4.x for Development:

PHP 4.4.9 has been released as final release for PHP 4.x now and it has been announced as end of life for PHP 4.x now. So developing any project or framework by keeping PHP 4.x compatibility is not a good idea I believe. All projects or framework has to freeze their PHP 4.x versions and let only bug-fixes be made available for those versions and have new feature-set addition be on the fork which is only PHP 5.x. I think every project will have to come up with a date when they will join GoPHP5 rally. For example Symfony 1.2 and 1.3 (Symfony is a PHP 5 only MVC Framework) are specifically supporting PHP 5.2.4 or newer version only.

Basically for newer development it is better idea to use version which has longer future so that finally they don't need to write a fixes which allow those projects to continue working in both the environment. Which will save time on development, QA and maintanence all phases.

I am not against the PHP 4.x but it is a change which is eneviable and which has to happen in it's completeness sometime and change is for good. I am not sure how many of you agree with my thoughts but please share your thoughts on this subjects as comments for this post.

Tags: ,

PHP Text Encoding – Challenge..!

Before sometime I had a project where I am required to create a message digest to authenticate web-service call. Initially it looked simple but while trying on staging server it never authenticated properly. Basically it was a Surescripts web-service implementation where we have to strictly follow their protocols. Read the rest of this entry »

Tags: , ,

PHP 5.2.7 is released

This is good to hear that PHP 5.2.7 is released last week. PHP 5.3 alpha 3 is released as well at the same time. Actually this release has taken more than 6 months after it's last stable release of 5.2.6 version. But it's better later than never. I have come across some blogs archives indicating dull future of PHP in coming year, but this slow and steady progress confirms that PHP elephant is here to stay, and there are many other blogs out there which indicates that too.

This release is majorly bug-fix release consisting more than 100 fixes; you can see change log here.

Anyway I believe in this world where IT is mandatory to run your business and to hold the backbon; everyone wants it cheap and LAMP does that well..!

BTW Wampserver team is damn fast in building their packages and this time they came out with PHP 5.2.7 + Apache 2.2.10 + MySQL 5.1.30 just next day of PHP 5.2.7's release. So enthusiastic developers can get their hands on with latest of all 3 of them. Download Wampserver 2.0e here.

Tags:

Symfony 1.2 first Beta is out

First beta version of new symfony version 1.2 is out now. There is a long long list of What's New in Symfony 1.2 but some of them are:

  • Doctrine to be bundled with framewok with Propel.
  • Prototype and Scriptaculous as core Javascript plugins.
  • Enhanced Web Debug Toolbar.
  • Propel 1.3 upgrade.
  • Many improvements and new features in Forms.

The list goes long and you can catch up that on Symfony website or just download and install a fresh copy of symfony 1.2 to play with.

Tags: , ,

PHP – Downloading a File from Secure website (https) using CURL

Recently in one of my project I was suppose to download file from a secure website. Actually I have to set the scheduler job for downloading nightly builds/full files from the server and the files are placed on secure website.

Initially I tried that with file_get_contents function but it was just downloading 0KB file. Then it strike me that oh..! I can't use file_get_contents as it can't understand the HTTPS protocol here. So what could help me nothing else then our best friend CURL. file_get_contents and fopen kind of other functions works fine with any http web locations.

Here is the simple CURL file transfer function snippet which will copy file from any secure http location. Read the rest of this entry »

Tags: , , ,

Zend Framework 1.6 RC1 with WSDL AutoDiscovery

Zend Framework's new release 1.6 is in it's RC1 stage now. It has got many exiting features, including one of the much waited WSDL auto-generation using Zend_Soap_AutoDiscover class. It will automatically generate WSDL based on your class definition based on PHP Documentation.

I am not sure why it is taking long with PHP to have WSDL auto-generation feature? May be loose typing..!

Anyway current implementation of Zend's WSDL generation with Zend_Soap_AutoDiscover doesn't seems to be perfect. It is having issues with Complex Type. Although you can manually generate WSDL with the help of Zend_Soap_Wsdl.

When I tried with AutoDiscovery feature results were surprising for Complex Type, behavior of generator was weired. Let's hope that Zend will fix issues with this great feature before their final release. Documentation is also in it's building stage and needs more examples and better compilation. Download Zend Framework from here, and try with tar.gz, it looks like zip is not working for me (more than once) with current compilation due to some reason.

Previously I have used WSDL generator class from jool.nl, it was quite handy and easy to configure and uses Reflections to generate WSDL from PHP Docs just like Zend Framework.

Tags: , ,

Paying the bills.!