We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32699 ☆ A M B ☆
    • 427 Posts
    I just noticed I have a 14 copies of the GPL in the revolution database (`modx_transport_packages`.`attributes`), as so many snippets are including the text to it and storing it in the database as part of their snippets.

    Is there anyway we could expect this text to be placed in the snippet folder on the server and NOT in the database. Or could we simply link to a centralized single couple of it?

    I know how the license is supposed to be attached, but I think we could make a reference in the actual snippet "GPL location in docs folder"

    Personally, I place this in the head of my snippets (I plan on releasing)

    /**
     *  File		randomImages.php (MODx snippet)
     * Created on	Nov 12, 2009
     * Project		shawn_wilkerson
     * @package		MODx Revolution Scripts
     * @version		1.3
     * @category	randomization
     * @author		W. Shawn Wilkerson
     * @link		http://www.shawnwilkerson.com
     * @copyright  Copyright (c) 2009, W. Shawn Wilkerson.  All rights reserved.
     * @license  
     * 
     * This program is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License as published by the Free Software
     * Foundation; either version 2 of the License, or (at your option) any later
     * version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
     * Place, Suite 330, Boston, MA 02111-1307 USA
     *
     ************************************************
     * Purpose: to access a user declared folder, select an image and display it
    


    With examples following and the full GPL included in a text file with the docs.

    Having 14 copies of the GPL is certainly worthy of a "bloat" designation.

      Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

      Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
      • 22303 MODX Staff
      • 10,725 Posts
      It’s arguable whether the package attributes should be stored in the database for sure, but how you build a package with the license is up to you; it’s part of the attributes so that it is displayed during package installation. This is also not part of the actual core database table, nor does it have anything to do with Snippets; these tables are only for package management. You can delete these packages once installed with no effect on anything other than you would not be able to restore data/files that were preserved on install of that version of the package.

      I’ll let the dialog continue on how best to include/reference licensing so that it can be part of installation, and doesn’t take up too much extra space. Though I will say that the text of the GPL license is not very much bloat except maybe relative to the size of some very trivial components.
        • 26903
        • 1,336 Posts
        Keeping the package license info in the database does help with things like license auditing, you can just query the attributes column to pull out the license info for all your packages. We could have a tag system that the packager selects, similar to the one we use when we submit an extra, e.g a GPL2/GPL3/PD/ tag etc. but I’m not sure you can represent all licensing with at tag, some for instance reads ’use freely but not for commercial use, and always display this logo/line’. This needs to be captured as written by the author.

        I don’t think the size is an issue, say 2k average of text for maybe 20 packages installed, its not much really.

          Use MODx, or the cat gets it!
          • 32699 ☆ A M B ☆
          • 427 Posts
          Would there be any harm in either cleaning this table at the end of each snippet install, or setting a pointer to a localized version of each license type (even a chunk would work).

          BTW my attributes table is 288k with only 19 rows, each of the GPL’s weigh in at 14.9k. I would think most people would want to leave the weight in the table to their applications.

          I am curious if there would be a easy method of simply adding an assets/license/gpl2.html, etc. with each snippet using that license (or which ever) simply either creating the license in the asset or simply linking to it, if it already exists.

          I guess what I am thinking, is to not force people to have to periodically "clean" the table for simple MODx maintenance which could be implemented at the conclusion of the install or more simply stated: not giving people something else to do, which a simple line of code (or a function call) could do for them.





            Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

            Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com