Skip to content

Instantly share code, notes, and snippets.

@peterjaap
Last active September 6, 2023 08:12
Show Gist options
  • Select an option

  • Save peterjaap/b1b1fa6188ea1e0c8dfa5b336f2fb89b to your computer and use it in GitHub Desktop.

Select an option

Save peterjaap/b1b1fa6188ea1e0c8dfa5b336f2fb89b to your computer and use it in GitHub Desktop.

Revisions

  1. peterjaap revised this gist Nov 8, 2022. No changes.
  2. peterjaap revised this gist Jun 2, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion identify.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    <?php

    // Run with the URL pointing to a require-config.js as the first argument;
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/frontend/Magento/luma/en_US/requirejs-config.js

    $content = file_get_contents($argv[1]);
    preg_match_all(
  3. peterjaap revised this gist Jun 2, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions identify.php
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,11 @@

    $content = file_get_contents($argv[1]);
    preg_match_all(
    '/(?:\'|")((?:[A-z0-9]*?)_(?:[A-z0-9]*?))\/js\/[^\(?:\'|")]+(?:\'|")/',
    $content,
    '/(?P<quote>\'|")(?P<extension>[[:alnum:]]+_[[:alnum:]]+)\/js\/.+?(?P=quote)/m',
    $content,
    $matches
    );

    sort($matches[1]);
    sort($matches['extension']);

    print_r(array_unique($matches[1]));
    print_r(array_unique($matches['extension']));
  4. peterjaap revised this gist Jun 2, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions identify.php
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,11 @@
    // Run with the URL pointing to a require-config.js as the first argument;
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js

    $url = file_get_contents($argv[1]);
    $content = file_get_contents($argv[1]);
    preg_match_all(
    '/(?:\'|")((?:[A-z0-9]*?)_(?:[A-z0-9]*?))\/js\/[^\(?:\'|")]+(?:\'|")/',
    $content,
    $url
    $matches
    );

    sort($matches[1]);
  5. peterjaap revised this gist Jun 2, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion identify.php
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // Run with the URL pointing to a require-config.js as the first argument;
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js

    $url = file_get_contents($args[1]);
    $url = file_get_contents($argv[1]);
    preg_match_all(
    '/(?:\'|")((?:[A-z0-9]*?)_(?:[A-z0-9]*?))\/js\/[^\(?:\'|")]+(?:\'|")/',
    $content,
  6. peterjaap revised this gist Jun 2, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions identify.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    <?php

    // Run with the URL pointing to a require-config.js as the first argument
    // i.e.
    // Run with the URL pointing to a require-config.js as the first argument;
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js

    $url = file_get_contents($args[1]);
  7. peterjaap revised this gist Jun 2, 2022. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions identify.php
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,14 @@
    <?php

    // Run with the URL pointing to a require-config.js as the first argument
    // i.e.
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js

    $url = file_get_contents($args[1]);
    preg_match_all(
    '/(?:\'|")((?:[A-z0-9]*?)_(?:[A-z0-9]*?))\/js\/[^\(?:\'|")]+(?:\'|")/',
    $content,
    file_get_contents($args[1])
    $url
    );

    sort($matches[1]);
  8. peterjaap created this gist Jun 2, 2022.
    15 changes: 15 additions & 0 deletions identify.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?php

    // Run with the URL pointing to a require-config.js as the first argument
    // i.e.
    // php identify.php http://magento2demo.firebearstudio.com/pub/static/version1654131704/frontend/Magento/luma/en_US/requirejs-config.js

    preg_match_all(
    '/(?:\'|")((?:[A-z0-9]*?)_(?:[A-z0-9]*?))\/js\/[^\(?:\'|")]+(?:\'|")/',
    $content,
    file_get_contents($args[1])
    );

    sort($matches[1]);

    print_r(array_unique($matches[1]));