John Wells said:
> Peter Hutnick said:
>>> Yeah...that's really what I'm wondering.  If I have my own code, but
>>> make function calls and the like to script libraries licensed under
>>> the GPL, does it mean my code will have to be GPL'd as well?
>>
>> In a word, yes.
>
> Even if the script libraries are themselves just PHP scripts...not any
> binary code being linked into the interpreter?  I'm still unclear here.

Makes no difference.  If you think about it, the GPL applies equally to
binary programs and the source code that produces them . . . so an
interpreted language is like the first part without the second.

>>> Say, for instance, that I use a GPL'd library that provides a class
>>> called myGPLClass.  If I create instances of myGPLClass in my own
>>> scripts, does that make my code in violation of the GPL?
>>
>> No.  Use is not restricted in any way by the GPL.  In fact, you
>> needn't even /agree/ to the GPL in order to use GPLed software in any
>> way you'd like, only to (re)distribute it.
>
> Hmmm....now I think I understand what you mean, but if I consider it in
> the context of my question and with your above statement, it seems
> contradictory.  I don't think it's that you're misunderstanding me...I
> think it's me misunderstanding you ;-).

Perhaps I read "use" more literally than you meant it.  You can USE a
GPLed lib any way you want.  If you want to DISTRIBUTE a program (to
include a script) that uses a GPLed library you must do so under the terms
of the GPL.

If that isn't completely clear, read on.

> Let me lay it out:
>
> Say you create a set of class libraries, called PeterLib, and release it
> under the GPL.  I download these libraries...like what you've done...and
> decide to use them in my development.  Your library makes available a
> class called FooBar that I really like, and I decide to make use of it
> in a number of my own files.
>
> So, one of the core files in my application contains:
>
> <?
>     require_once("/PeterLib/FooBar.inc");
>
>     $myObj = new FooBar();
>
>     $myObj->getFoo();
>
>     $myObj->printBar();
>
> ?>

You may do that.

> Now, futher assume that I want to sell my application under my own
> company's license and I label all my files as such, but still retain
> your GPL license it the PeterLib files.  I rush to market and have an
> overwhelming amount of customers in the first month.
>
> Four issues:
> 1. Have I violated the GPL by distributing your code with my
> "propietary", non-open source app?  I'm still distributing source, but
> my specific files (including a few that call PeterLib classes) are not
> GPL'd.

Maybe.  It depends on what "my own company's" license says.  Specifically,
if it is a "GPL compatible" license, then no.  For a list of
known-compatible licenses see
http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses.

In practice when you say "my own company's license" you probably mean a
proprietary license.  That would be a violation.

> 2. If I decided to only distribute my own source for money under my own
> propietary license, but told my customers that in order for my
> application to function correctly, they'd need to download PeterLib.  Is
> this a violation?

I don't think that there is any way to be absolutely sure about that
without being sued.  If you win, no.  If you lose, yes ;-)

It /sounds/ like a loophole, since 1. you don't agree to the GPL to write
your program and 2. you don't distribute the GPLed code.

I think in all likelihood you would lose.  Your program would be seen as a
derivative work.

> 3.  If the above are considered violations, I assume only using
> libraries licensed under licenses like the LGPL or PHP would make it
> safe for me to redistribute with my proprietary app?

Right.  This (should be)/is a conscious decision that is made by the
library's developer.  If they want to let you link at will they use the
LGPL, if they want to extend the copyleft to linking programs they use the
GPL.

> 4.  How do the above change if/when I decide to encode my self-written
> files with Zend Encoder?

This is an obfuscation utility?  If so, the GPL excludes obfuscated source
code as "qualifying" as source code for the purpose of license compliance.

"Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above
on a medium customarily used for software interchange"

I.e. you can't give someone a printout of source code or an image of the
source code, you can't provide it on 1/4 inch tape or a stack of punch
cards, and you can't run the code through an "optimizer" or obfuscater
first.

> Thanks very much for all your input.  Very helpful.  I really appreciate
> it.

Glad to help.

-Peter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to