Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package Manager] Re-Download missing packages #14018

Open
wants to merge 31 commits into
base: 3.x
Choose a base branch
from

Commits on Jul 11, 2018

  1. Filter user input used in phpthumb

    cherry-picked from modxcms#13979
    opengeek committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    3fc5038 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2018

  1. Configuration menu
    Copy the full SHA
    606dc0f View commit details
    Browse the repository at this point in the history
  2. MODX Revolution 2.6.5-pl

    opengeek committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    4ab3571 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2018

  1. Configuration menu
    Copy the full SHA
    eef48c8 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2018

  1. [Package Manager] Re-Download missing packages

    Was surprised that the package manager is not able to re-download packages in case the zip files / extracted folders are missing for an installed package (for whatever reason, in my particular case did I want to save space for backups and did not include the packages folder...). When trying to re-install a package with missing files it would proceed to the installation (of course without metadata displaying), then when hitting "Continue" show the modal and say could not download the package etc., but it never actually tried to re-download...
    
    This PR changes that so if the zip file is not present, it would actually try to re-download it. There is an edge case where the package is not available anymore on the provider (for example I had an old version of the "console" extra that was not available anymore) and the provider would return an error code (e.g. 404 in that case), but the old code would actually "package" the response HTML or JSON code into a .zip file and then of course the installation would fail with "could not unpack package"...This PR also solves that issue by handling error codes from the provider.
    
    Although not used very often, I did rewrite large parts of the _getByFsockopen() method as it needed some love.
    exside authored Jul 28, 2018
    Configuration menu
    Copy the full SHA
    f291a83 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2018

  1. Configuration menu
    Copy the full SHA
    51f4052 View commit details
    Browse the repository at this point in the history
  2. Split up oneliner into variables...

    Hopefully slightly more readable, also added comments.
    exside authored Jul 29, 2018
    Configuration menu
    Copy the full SHA
    bd29d3f View commit details
    Browse the repository at this point in the history
  3. Harmonize comment style + empty dir fix

    Switch comment style to the one used in the rest of the file. Also make sure that if there is a package directory it is checked that it has files in it, I occasionally have the scenario when that directory is there, but its empty, then the package re-unpack fails and so does the installation of the package.
    exside authored Jul 29, 2018
    Configuration menu
    Copy the full SHA
    43a626c View commit details
    Browse the repository at this point in the history
  4. Separate code into getMetadata() method

    Following the advice from @OptimusCrime, I added a more generic getMetadata() method to the class, like this any other metadata can also be accessed more easily in case its ever needed.
    exside authored Jul 29, 2018
    Configuration menu
    Copy the full SHA
    6a2f944 View commit details
    Browse the repository at this point in the history
  5. Fix issue with update mode

    When updating a package it would also trigger the re-download logic (as package file not present yet) and re-assign the `$sourceFile` variable passed to `transportPackage()` which would cause it to fail. Therefore it is now checked if the `$sourceFile` variable contains a URL already, if that's the case, the re-download logic is skipped. When triggering a re-install action from the manager the `$sourceFile` variable is set to the package string and not a URL like when an update is triggered.
    exside authored Jul 29, 2018
    Configuration menu
    Copy the full SHA
    69c081b View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2018

  1. Configuration menu
    Copy the full SHA
    290cee5 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2018

  1. Change getMetadata() to return directly

    also changed referrer URL scheme
    exside authored Aug 3, 2018
    Configuration menu
    Copy the full SHA
    4195e57 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2019

  1. Configuration menu
    Copy the full SHA
    d0fd631 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2019

  1. Merge pull request #1 from Ibochkarev/patch-2

    Otherwise a xx4 or xx5 would be detected too.
    exside authored Feb 20, 2019
    Configuration menu
    Copy the full SHA
    f459f06 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2019

  1. [Package Manager] Re-Download missing packages

    Was surprised that the package manager is not able to re-download packages in case the zip files / extracted folders are missing for an installed package (for whatever reason, in my particular case did I want to save space for backups and did not include the packages folder...). When trying to re-install a package with missing files it would proceed to the installation (of course without metadata displaying), then when hitting "Continue" show the modal and say could not download the package etc., but it never actually tried to re-download...
    
    This PR changes that so if the zip file is not present, it would actually try to re-download it. There is an edge case where the package is not available anymore on the provider (for example I had an old version of the "console" extra that was not available anymore) and the provider would return an error code (e.g. 404 in that case), but the old code would actually "package" the response HTML or JSON code into a .zip file and then of course the installation would fail with "could not unpack package"...This PR also solves that issue by handling error codes from the provider.
    
    Although not used very often, I did rewrite large parts of the _getByFsockopen() method as it needed some love.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    ade661c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    160b7d6 View commit details
    Browse the repository at this point in the history
  3. Split up oneliner into variables...

    Hopefully slightly more readable, also added comments.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    5bbb2b1 View commit details
    Browse the repository at this point in the history
  4. Harmonize comment style + empty dir fix

    Switch comment style to the one used in the rest of the file. Also make sure that if there is a package directory it is checked that it has files in it, I occasionally have the scenario when that directory is there, but its empty, then the package re-unpack fails and so does the installation of the package.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    8257b2d View commit details
    Browse the repository at this point in the history
  5. Separate code into getMetadata() method

    Following the advice from @OptimusCrime, I added a more generic getMetadata() method to the class, like this any other metadata can also be accessed more easily in case its ever needed.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    35eeb5f View commit details
    Browse the repository at this point in the history
  6. Fix issue with update mode

    When updating a package it would also trigger the re-download logic (as package file not present yet) and re-assign the `$sourceFile` variable passed to `transportPackage()` which would cause it to fail. Therefore it is now checked if the `$sourceFile` variable contains a URL already, if that's the case, the re-download logic is skipped. When triggering a re-install action from the manager the `$sourceFile` variable is set to the package string and not a URL like when an update is triggered.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    a2647cc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    317c829 View commit details
    Browse the repository at this point in the history
  8. Change getMetadata() to return directly

    also changed referrer URL scheme
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    1a00781 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    bb8318b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6353263 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    017304e View commit details
    Browse the repository at this point in the history
  12. it's my editor trying to be smart...

    sorry about that, doing it directly in the github editor... I did a 1:1 copy from the original repo^^
    exside authored May 22, 2019
    Configuration menu
    Copy the full SHA
    f4b6b9d View commit details
    Browse the repository at this point in the history
  13. Revert "revert unwanted file changes..."

    This reverts commit 017304e.
    exside committed May 22, 2019
    Configuration menu
    Copy the full SHA
    7dfa009 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4662482 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    509acd3 View commit details
    Browse the repository at this point in the history
  16. whitespace again

    exside authored May 22, 2019
    Configuration menu
    Copy the full SHA
    2136019 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2020

  1. Update core/model/modx/transport/modtransportpackage.class.php

    Co-authored-by: Joshua Lückers <[email protected]>
    Jako and JoshuaLuckers authored Sep 19, 2020
    Configuration menu
    Copy the full SHA
    4fb2db2 View commit details
    Browse the repository at this point in the history