88 if (isset($this->licenseText) && (!empty($this->licenseText)))
116 if (!file_put_contents($this->target.$this->licenseFilename, $this->licenseText))
135 if (!isset($this->license) || (!isset($this->holder) || (!isset($this->year) ||(!isset($this->
description)))
136 || (empty($this->license) || (empty($this->holder) || (empty($this->year) || (empty($this->
description)))))))
142 switch ($this->license)
147 $this->licenseText =
"
148 ".$this->description.
"
149 Copyright (C) ".$this->year.
" copyright ".$this->holder.
"
150 Permission is hereby granted, free of charge, to any person
151 obtaining a copy of this software and associated documentation
152 files (the \"Software\"), to deal in the Software without
153 restriction, including without limitation the rights to use,
154 copy, modify, merge, publish, distribute, sublicense, and/or
155 sell copies of the software, and to permit persons to whom
156 the software is furnished to do so, subject to the following
159 The above copyright notice and this permission notice shall
160 be included in all copies or substantial portions of the software.
162 THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,
163 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
164 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
165 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
166 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
167 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
168 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
169 OR OTHER DEALINGS IN THE SOFTWARE.";
177 $this->licenseText =
"
178 ".$this->description.
"
179 Copyright ".$this->year.
" ".$this->holder.
"
181 Licensed under the Apache License, Version 2.0 (the \"License\");
182 you may not use this file except in compliance with the License.
183 You may obtain a copy of the License at
185 http://www.apache.org/licenses/LICENSE-2.0
187 Unless required by applicable law or agreed to in writing, software
188 distributed under the License is distributed on an \"AS IS\" BASIS,
189 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190 See the License for the specific language governing permissions and
191 limitations under the License.";
199 $this->licenseText =
"
200 ".$this->description.
"
201 Copyright (C) ".$this->year.
" ".$this->holder.
"
203 This program is free software; you can redistribute it and/or
204 modify it under the terms of the GNU General Public License
205 as published by the Free Software Foundation; either version 2
206 of the License, or (at your option) any later version.
208 This program is distributed in the hope that it will be useful,
209 but WITHOUT ANY WARRANTY; without even the implied warranty of
210 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211 GNU General Public License for more details.
213 You should have received a copy of the GNU General Public License
214 along with this program; if not, write to the Free Software
215 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.";
223 $this->licenseText =
"
224 ".$this->description.
"
225 Copyright (C) ".$this->year.
" ".$this->holder.
"
226 This program is free software: you can redistribute it and/or modify
227 it under the terms of the GNU General Public License as published by
228 the Free Software Foundation, either version 3 of the License, or
229 (at your option) any later version.
231 This program is distributed in the hope that it will be useful,
232 but WITHOUT ANY WARRANTY; without even the implied warranty of
233 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
234 GNU General Public License for more details.
236 You should have received a copy of the GNU General Public License
237 along with this program. If not, see <https://www.gnu.org/licenses/>.
244 case "Lesser GPL 2.0":
246 $this->licenseText =
"
247 ".$this->description.
"
248 Copyright (C) ".$this->year.
" ".$this->holder.
"
250 This library is free software; you can redistribute it and/or
251 modify it under the terms of the GNU Library General Public
252 License as published by the Free Software Foundation; either
253 version 2 of the License, or (at your option) any later version.
255 This library is distributed in the hope that it will be useful,
256 but WITHOUT ANY WARRANTY; without even the implied warranty of
257 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
258 Library General Public License for more details.
260 You should have received a copy of the GNU Library General Public
261 License along with this library; if not, write to the
262 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
263 Boston, MA 02110-1301, USA.";
269 case "Lesser GPL 2.1":
271 $this->licenseText =
"
272 ".$this->description.
"
273 Copyright (C) ".$this->year.
" ".$this->holder.
"
275 This library is free software; you can redistribute it and/or
276 modify it under the terms of the GNU Lesser General Public
277 License as published by the Free Software Foundation; either
278 version 2.1 of the License, or (at your option) any later version.
280 This library is distributed in the hope that it will be useful,
281 but WITHOUT ANY WARRANTY; without even the implied warranty of
282 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
283 Lesser General Public License for more details.
285 You should have received a copy of the GNU Lesser General Public
286 License along with this library; if not, write to the Free Software
287 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA";
295 $this->licenseText =
"
296 ".$this->description.
"
297 Copyright (C) ".$this->year.
" copyright ".$this->holder.
"
298 Permission is hereby granted, free of charge, to any person
299 obtaining a copy of this software and associated documentation
300 files (the \"Software\"), to deal in the Software without
301 restriction, including without limitation the rights to use,
302 copy, modify, merge, publish, distribute, sublicense, and/or
303 sell copies of the software, and to permit persons to whom
304 the software is furnished to do so, subject to the following
307 The above copyright notice and this permission notice shall
308 be included in all copies or substantial portions of the software.
310 THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,
311 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
312 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
313 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
314 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
315 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
316 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
317 OR OTHER DEALINGS IN THE SOFTWARE.";
331 if (is_dir(dirname($this->target)))
333 if (is_writeable(dirname($this->target)))
344 if (!mkdir(dirname($this->target)))
__construct($license, $description, $year, $holder, $target)
Licenses constructor create requested license for holder.
createLicenseText()
Create license text and save string as obj property.
writeLicenseFile()
Create license text and write it as LICENSE file to $this->target folder.
checkFolder()
Check if target folder exists and is writeable.
getLicenseText()
Create license text and return it as string (or false)
This class serves methods to create backup from files.