News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Turland's Blog:
Splitting PHP Class Files
January 25, 2010 @ 13:23:56

Matthew Turland, in trying to solve a problem from work, needed a way to split out some code into two files to simplify and make it easier to use them individually.

The issue I ran into was due to all the generated PHP classes being housed in a single file. I had to process two WSDL files that had several identical user-defined types in common. As a result, I couldn't simply include the two PHP files generated from them because PHP doesn't allow you to define two classes with the same name.

He used the tokenizer extension to create a simple command-line script that did the splitting for him. This script could potentially be used for splitting out other kinds of files too - "unpacking" them from their combined state. You can download the latest version from Matthew's github account.

0 comments voice your opinion now!
tutorial split class file wsdl


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: How to Upload Images Using PHP

Gary Hockin's Blog: Zend Framework 2 and a Restful Application

PHPBuilder.com: Creating an Online Survey - Part 1

PHPMaster.com: Debugging and Profiling PHP with Xdebug

Matthew Weir O'Phinney's Blog: Cgiapp2 Tutorial 1 - Switch Template Plugins at Will


Community Events





Don't see your event here?
Let us know!


zendserver series framework threedevsandamaybe voicesoftheelephpant laravel language interview symfony conference deployment release podcast introduction code tips api community bugfix list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework