Distributing your code

Once you have your ideal scripts written, very often you will want to give them to other people. Perhaps you have written code to generate graphs, predict the weather, or perhaps you have just written Yet Another Forum (YAF) - it does not matter what you write, because there are few feelings quite as nice as watching people take your code and use it.

In this situation it is wise to keep in mind Finster's law: "A closed mouth gathers no feet". That is, if you do not tell anyone about your script, you are never going to get any users!

There are several things you need to keep in mind when writing code for distribution, like "do you want people to see the source code?", or "Will it work on all PHP platforms?", and that is what this section covers.

Author's Note: Please be careful when distributing your code - if any part of it was not wholly created by you, you may need the original author's permission before you can redistribute. This is important not only for PHP code, but for attached resources such as pictures, fonts, etc - always err on the side of caution and ask before distributing.


Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Charging for your work >>

Previous chapter: Testing

Jump to:


Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.