Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/.nvm/versions/node/v18.17.1/lib/node_modules/pm2/node_modules/js-git/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
// This is for working with git config files like .git/config and .gitmodules.
// I believe this is just INI format.
module.exports = {
encode: encode,
decode: decode
};
function encode(config) {
var lines = [];
Object.keys(config).forEach(function (name) {
var obj = config[name];
var deep = {};
var values = {};
var hasValues = false;
Object.keys(obj).forEach(function (key) {
var value = obj[key];
if (typeof value === 'object') {
deep[key] = value;
}
else {
hasValues = true;
values[key] = value;
}
});
if (hasValues) {
encodeBody('[' + name + ']', values);
}
Object.keys(deep).forEach(function (sub) {
var child = deep[sub];
encodeBody('[' + name + ' "' + sub + '"]', child);
});
});
return lines.join("\n") + "\n";
function encodeBody(header, obj) {
lines.push(header);
Object.keys(obj).forEach(function (name) {
lines.push( "\t" + name + " = " + obj[name]);
});
}
}
function decode(text) {
var config = {};
var section;
text.split(/[\r\n]+/).forEach(function (line) {
var match = line.match(/\[([^ \t"\]]+) *(?:"([^"]+)")?\]/);
if (match) {
section = config[match[1]] || (config[match[1]] = {});
if (match[2]) {
section = section[match[2]] = {};
}
return;
}
match = line.match(/([^ \t=]+)[ \t]*=[ \t]*(.+)/);
if (match) {
section[match[1]] = match[2];
}
});
return config;
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0034 ]-- |