Investigate a possible switch to the Apache 2.0 License as the rest of Jasig has done #5

Merged
merged 2 commits into from Nov 12, 2011

Conversation

Projects
None yet
2 participants
Member

adamfranco commented Nov 4, 2011

Migrated from PHPCAS-131

Description

I guess we should look into making the switch with the 1.3.0 version. Since all of the code is BSD it should not be a big issue. We just have to be carefull with all the different headers and files.

https://wiki.jasig.org/display/LIC/Home

I however don't like adding a full text to all source files. I would really like to place doxygen comments like @license in all code files referring to the external license file. Adding the full text to compiled language makes sense but in an interpreted language it's just a lot of overhead during runtime if you bloat all the source files.

Adam Franco added a comment - 26/Sep/11 10:54 PM

When using APC or another opcode cache, parsing time becomes basically irrelevant since files are only even opened and read when changed. As well, according to this post and a few others like it indicate that comment parsing shouldn't be an issue.

That said, I didn't want to go on just hearsay, so I decided to run a few tests to find out how stripping out comments and white-space affected execution time:

[afranco@maple phpcas]$ # A command to time execution
[afranco@maple phpcas]$ cat run_1000 
#!/bin/bash
i=0; 
while [ $i -lt 1000 ]; do 
    php $1; 
    let i=$i+1; 
done;
[afranco@maple phpcas]$ 
[afranco@maple phpcas]$ # First a test with an empty script.
[afranco@maple phpcas]$ echo '<?php ' > empty.php
[afranco@maple phpcas]$ time ./run_1000 empty.php 

real    0m9.404s
user    0m5.671s
sys 0m2.700s
[afranco@maple phpcas]$ 
[afranco@maple phpcas]$ git reset --hard
HEAD is now at 0926ab8 NOJIRA fix errors in examples
[afranco@maple phpcas]$ # Characters in phpCAS
[afranco@maple phpcas]$ find source -name "*.php" -exec cat {} \; | wc -c
  305774
[afranco@maple phpcas]$ time ./run_1000 source/CAS.php 

real    0m18.341s
user    0m13.387s
sys 0m3.764s
[afranco@maple phpcas]$ 
[afranco@maple phpcas]$ # Strip comments and whitespace
[afranco@maple phpcas]$ find source -name "*.php" -exec sh -c 'php -w {} > {}.tmp; mv {}.tmp {}' \;
[afranco@maple phpcas]$ # Characters in phpCAS after stripping whitespace and comments
[afranco@maple phpcas]$ find source -name "*.php" -exec cat {} \; | wc -c
  123311
[afranco@maple phpcas]$ time ./run_1000 source/CAS.php 

real    0m17.358s
user    0m12.474s
sys 0m3.709s
[afranco@maple phpcas]$ 
[afranco@maple phpcas]$ git reset --hard
HEAD is now at 0926ab8 NOJIRA fix errors in examples
[afranco@maple phpcas]$

So, shrinking the file-size by 60% resulted in a 7% change in execution time. I don't think this is significant enough to change our general commenting practices (the readability cost wouldn't be worth it), but it probably doesn't make sense to put a full 135-line license in each file. The short version below would probably be sufficient in the header and shouldn't change the execution time much on systems without an opcode cache.

Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
@adamfranco adamfranco Issue #5: Added Apache 2.0 LICENSE, NOTICE, and file-headers.
Followed the License implementation wiki page at:
  https://wiki.jasig.org/display/LIC/Implementing+the+Licensing+Policy

I investigated the source code to get the years for the copyright NOTICE
differentiated between ESUP-Portail (2003-2006) and Jasig (2007-2011), but
this might not be correct.

Still to do:
 - Fix any dates
 - Add license notice for the ant_doxygen.jar or remove it if no longer in use.
7864c40
Member

adamfranco commented Oct 27, 2011

I followed the License implementation wiki page at:
https://wiki.jasig.org/display/LIC/Implementing+the+Licensing+Policy
and added Apache 2.0 LICENSE, NOTICE, and file-headers.

I looked through the source code repositories to try get the years for the copyright NOTICE differentiated between ESUP-Portail (2003-2006?) and Jasig (2007?-2011), but this might not be correct.

Still to do:

  • Fix any dates
  • Add license notice for the ant_doxygen.jar or remove it if no longer in use.
Owner

jfritschi commented Oct 30, 2011

The move from sourceforge to jasig was on 3 July 07.

Maybe we should talk to licensing@jasig.org listed on the https://wiki.jasig.org/display/LIC/Jasig+Licensing+Policy site and discuss any open points with them. Just to be safe side around these legal topics.

adamfranco referenced this pull request Nov 4, 2011

Merged

Move phpCAS to github #12

Member

adamfranco commented Nov 4, 2011

Here are the questions I have:

  • How do we properly include notice for utils/ant_doxygen.jar? My guess is that the file comes from this project that specifies an Apache 1.1 license.
  • Is the NOTICE file's handling of the ESUP-Portail copyright handled correctly?

Do you have any others or shall I send an email to licensing@jasig.org?

Owner

jfritschi commented Nov 4, 2011

I guess we have to include some notice around the old BSD license in the NOTICE file. https://wiki.jasig.org/display/LIC/Transition+Process+for+Existing+Projects

The autoloader is also some BSD licensed code from saltybeagle that has to be referenced in the NOTICE file again unless we get permission to release it under Apache 2.0.

Owner

jfritschi commented Nov 4, 2011

Another important questions is how to work with pull requests from people that have not signed an ICLA. With SVN this was easy since commit access was pretty strict. Now it's kind of a gray area and the commit is actuall assigned to the authors.

jfritschi merged commit 5d6f227 into master Nov 12, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment