Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12586

\phpbb\extension\manager::all_available() should only locate ext files two levels deep and ignore dot-files/folders

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b3
    • Fix Version/s: 3.1.0-b4
    • Component/s: Extensions
    • Labels:
      None

      Description

      phpbb\extension\manager\all_available() and others like it use the RecursiveDirectoryIterator to search for \ext\VENDOR\ext.php (and composer.json) files, but it does so with no limit on the depth search. This can take a long time to load for some extensions that include many files.

      Possible change the code to make use of the finder instead, which might be able to restrict the depth to just /ext/VENDOR/.

        Activity

        Hide
        nickvergessen Joas Schilling added a comment -

        Well depth must be 2 as VENDOR/EXTENSION/ext.php is what we are looking for

        Show
        nickvergessen Joas Schilling added a comment - Well depth must be 2 as VENDOR/EXTENSION/ext.php is what we are looking for
        Hide
        nickvergessen Joas Schilling added a comment -

        Also we can not really use the finder, as the finder uses this method to know where to look for files.
        Also we seem to check stuff already

        				// Ignore the extension if directory depth is not correct or if the directory structure
        				// does not match the name value specified in composer.json.
        				if (substr_count($ext_name, '/') !== 1 || !isset($ext_info['name']) || $ext_name != $ext_info['name'])
        				{
        					continue;
        				}

        Show
        nickvergessen Joas Schilling added a comment - Also we can not really use the finder, as the finder uses this method to know where to look for files. Also we seem to check stuff already // Ignore the extension if directory depth is not correct or if the directory structure // does not match the name value specified in composer.json. if (substr_count($ext_name, '/') !== 1 || !isset($ext_info['name']) || $ext_name != $ext_info['name']) { continue; }
        Hide
        rfdy rfdy added a comment -

        Confirmed that fix works. Load time decreased considerably. Thanks.

        Show
        rfdy rfdy added a comment - Confirmed that fix works. Load time decreased considerably. Thanks.

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            rfdy rfdy
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development