Skip to content
Browse files

MIT license switch

  • Loading branch information...
1 parent 751025d commit ca4b1fba3da635993c6029ba7e3899a994d5ec4e @jlogsdon committed Apr 21, 2010
Showing with 43 additions and 59 deletions.
  1. +16 −24 LICENSE
  2. +6 −4 lib/cli/Notify.php
  3. +8 −6 lib/cli/Progress.php
  4. +2 −4 lib/cli/Shell.php
  5. +2 −4 lib/cli/Table.php
  6. +3 −5 lib/cli/cli.php
  7. +2 −4 lib/cli/notify/Dots.php
  8. +2 −4 lib/cli/notify/Spinner.php
  9. +2 −4 lib/cli/progress/Bar.php
View
40 LICENSE
@@ -1,27 +1,19 @@
-Copyright (c) 2010, Phergie Development Team
-All rights reserved.
+Copyright (c) 2010 James Logsdon
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
-Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
-Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-
-Neither the name of the Phergie Development Team nor the names of its
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
10 lib/cli/Notify.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli;
@@ -67,6 +65,10 @@ public function current() {
* @return int The elapsed time in seconds.
*/
public function elapsed() {
+ if (!$this->_start) {
+ return 0;
+ }
+
$elapsed = time() - $this->_start;
return $elapsed;
}
View
14 lib/cli/Progress.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli;
@@ -36,7 +34,7 @@ public function __construct($msg, $total, $interval = 100) {
parent::__construct($msg, $interval);
$this->_total = (int)$total;
- if ($this->_total <= 0) {
+ if ($this->_total < 0) {
throw new \InvalidArgumentException('Maximum value out of range, must be positive.');
}
}
@@ -73,7 +71,7 @@ public function total() {
*/
public function estimated() {
$speed = $this->speed();
- if (!$this->elapsed()) {
+ if (!$speed || !$this->elapsed()) {
return 0;
}
@@ -106,6 +104,10 @@ public function increment($increment = 1) {
* @return float The percent completed.
*/
public function percent() {
+ if ($this->_total == 0) {
+ return 1;
+ }
+
return ($this->_current / $this->_total);
}
}
View
6 lib/cli/Shell.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli;
View
6 lib/cli/Table.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli;
View
8 lib/cli/cli.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli;
@@ -146,7 +144,7 @@ function prompt($question, $default = false, $marker = ':') {
* @return string The users choice.
* @see cli\prompt()
*/
-function choose($question, $choices= 'yn', $default = 'n') {
+function choose($question, $choice = 'yn', $default = 'n') {
if (!is_string($choice)) {
$choice = join('', $choice);
}
View
6 lib/cli/notify/Dots.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli\notify;
View
6 lib/cli/notify/Spinner.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli\notify;
View
6 lib/cli/progress/Bar.php
@@ -2,14 +2,12 @@
/**
* PHP Command Line Tools
*
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
+ * This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @author James Logsdon <dwarf@girsbrain.org>
* @copyright 2010 James Logsdom (http://girsbrain.org)
- * @license New BSD License
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace cli\progress;

0 comments on commit ca4b1fb

Please sign in to comment.
Something went wrong with that request. Please try again.