Skip to content

Commit c3237dd

Browse files
kvzclaude
andcommitted
Document LGPL licensing for BC Math functions
- Add LGPL-2.1 exception section to LICENSE file - Add License section to README with BC Math note - Add SPDX identifier and clearer notice to _bc.js - Remove scripts/verify-php.js (duplicate of src/_util infrastructure) - Remove scripts/ from biome excludes Addresses #473 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1fa5ae0 commit c3237dd

5 files changed

Lines changed: 25 additions & 260 deletions

File tree

LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
MIT License
2+
13
Copyright (c) 2007-2024 Kevin van Zonneveld (https://kvz.io) and Contributors (https://locutus.io/authors)
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -12,3 +14,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1214
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1315
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1416
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
18+
---
19+
20+
LGPL-2.1 Exception
21+
22+
The BC Math functions (src/php/_helpers/_bc.js, src/php/bc/*) are derived from PHP's bcmath extension and Libbcmath,
23+
which are licensed under LGPL-2.1. These files retain their original LGPL-2.1 license. If you use these functions,
24+
LGPL-2.1 terms apply to that portion of your project.
25+
26+
If LGPL is a concern, simply avoid importing from `locutus/php/bc/`.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Use our creations at your own risk, and may they inspire you to push the boundar
2222
- [Install](#install)
2323
- [Use](#use)
2424
- [Development](#development)
25+
- [License](#license)
2526

2627
## Install
2728

@@ -64,3 +65,7 @@ true
6465
## Development
6566

6667
Some guidelines and instructions can be found in [CONTRIBUTING.md](CONTRIBUTING.md)
68+
69+
## License
70+
71+
MIT, except for `src/php/bc/` and `src/php/_helpers/_bc.js` which are LGPL-2.1 (derived from PHP's bcmath/Libbcmath). See [LICENSE](LICENSE) for details.

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"!website",
1313
"!dist",
1414
"!node_modules",
15-
"!.yarn",
16-
"!scripts"
15+
"!.yarn"
1716
]
1817
},
1918
"formatter": {

scripts/verify-php.js

Lines changed: 0 additions & 254 deletions
This file was deleted.

src/php/_helpers/_bc.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-License-Identifier: LGPL-2.1-or-later
2+
// NOTE: This file is LGPL licensed, not MIT like the rest of locutus.
3+
// See LICENSE file for details.
4+
15
module.exports = function _bc() {
26
// discuss at: https://locutus.io/php/_helpers/_bc
37
// original by: lmeyrick (https://sourceforge.net/projects/bcmath-js/)
@@ -7,7 +11,7 @@ module.exports = function _bc() {
711
// returns 1: '+'
812

913
/**
10-
* BC Math Library for Javascript
14+
* BC Math Library for Javascript (LGPL-2.1)
1115
* Ported from the PHP5 bcmath extension source code,
1216
* which uses the Libbcmath package...
1317
* Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
@@ -21,10 +25,9 @@ module.exports = function _bc() {
2125
* Western Washington University
2226
* Bellingham, WA 98226-9062
2327
*
24-
* bcmath-js homepage:
28+
* bcmath-js homepage: https://sourceforge.net/projects/bcmath-js/
2529
*
26-
* This code is covered under the LGPL licence, and can be used however you want :)
27-
* Be kind and share any decent code changes.
30+
* This code is covered under the LGPL-2.1 license.
2831
*/
2932

3033
/**

0 commit comments

Comments
 (0)