We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    If you are doing a new install of MODx and your server has zLib support here is an easy way to get all of the files to your server quickly.

    1. Download the latest version of MODx.
    2. Upload the zip file to your server where you would like the files to be extracted.
    3. Get the pclzip library here: http://www.phpconcept.net/download.php?file=pclzip-2-5.zip
    4. upload the file pclzip.lib.php from the pclzip library into the same folder as your MODx zip.
    5. create a new php file named MODxUnzip.php with the following contents:

    <?php
        require_once('pclzip.lib.php');
        $archive = new PclZip('modx-0.9.2.2.zip');
        $list = $archive->extract(PCLZIP_OPT_REMOVE_PATH, "modx-0.9.2.2");
    ?> 
    


    6. upload the file MODXUnzip.php to your server in the same folder as the above files.
    7. point your browser to the file MODXUnzip.php
    8. when the browser stops working all files should be extracted.
    9. remove the files used above so no one re-extracts the files.

    This will extract all of the files in the zip to the folder where the zip was uploaded.

    notes:
    the MODxUnzip file will need updated with the correct file you are trying to extract. In the example I used MODx ver 0.9.2.2, the 3rd line in the program removes the folder modx-0.9.2.2 when extracting so the folders (assets,manager) are not placed inside that folder.
    • Very cool Kyle and thanks in general ... might wanna make a download for the resources library I guess. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        +1 here, I have been looking for something like this for a long time, not being a command line pro I never even tried using ssh to untar a MODx archive...

        This will make my life easier, thanks !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 7455
          • 2,204 Posts
          but you still need to set the permissions. you could add some chmod commands on the end of the script to set the permissions. could also be done using system command in php when you use linux server.

            follow me on twitter: @dimmy01
            • 6726
            • 7,075 Posts
            I have had some trouble using it : probably a permission / owner issue.
            I have even tried to chown the files to nobody and chmod to 777 but didn’t change the results... I’ll check the doc it was just a quick test...

            Could also be that I re-created the zip from the files on my HDD instead of using the RC2 zip... I’ll try again and report !
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 6726
              • 7,075 Posts
              OK I did try this again with the original zip but didn’t manage to make it work sad
              I can’t think of anything else to change : I have CHMODed and CHOWNed the files to nobody, why shouldn’t it work : ideas ?
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 22815
                • 1,097 Posts
                Perhaps you also need to set 777 on the folder to which the zip is being extracted?
                  No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 7455
                  • 2,204 Posts
                  could we not use tar? that way permissions on the folders and files like assets/images etc are not changed to default but stay the way is is set on tarring.
                  but then we need an untar class I think
                    follow me on twitter: @dimmy01
                    • 6726
                    • 7,075 Posts
                    Thanks Paul I’ll check that again...

                    @Dimmy : Is that what you’re looking for smiley ?
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 15987
                      • 786 Posts
                      David,
                      did you change the name of the zip file to the one you are using? try taking out the third line there also and see if that works. If you recreated a zip and the assets/manager folders are not inside of another folder you do not need that line. If they are in a folder then change the folder name to the correct value.

                      <?php
                          require_once('pclzip.lib.php');
                          $archive = new PclZip('name of zip here');
                          $list = $archive->extract(PCLZIP_OPT_REMOVE_PATH, "folder name");
                      ?> 
                      


                      I had no problems with permissions, or having to reset permissions on any files. Dimmy, could you explain the issue there a little more?