{"version":3,"sources":["../../../src/php/info/ini_set.js"],"names":["module","exports","ini_set","varname","newvalue","$global","window","global","$locutus","php","ini","oldval","local_value","lowerStr","toLowerCase","trim","_setArr","push"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,OAAlB,EAA2BC,QAA3B,EAAqC;AAAE;AACtD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;AACAF,UAAQG,QAAR,GAAmBH,QAAQG,QAAR,IAAoB,EAAvC;AACA,MAAIA,WAAWH,QAAQG,QAAvB;AACAA,WAASC,GAAT,GAAeD,SAASC,GAAT,IAAgB,EAA/B;AACAD,WAASC,GAAT,CAAaC,GAAb,GAAmBF,SAASC,GAAT,CAAaC,GAAb,IAAoB,EAAvC;;AAEAF,WAASC,GAAT,CAAaC,GAAb,GAAmBF,SAASC,GAAT,CAAaC,GAAb,IAAoB,EAAvC;AACAF,WAASC,GAAT,CAAaC,GAAb,CAAiBP,OAAjB,IAA4BK,SAASC,GAAT,CAAaC,GAAb,CAAiBP,OAAjB,KAA6B,EAAzD;;AAEA,MAAIQ,SAASH,SAASC,GAAT,CAAaC,GAAb,CAAiBP,OAAjB,EAA0BS,WAAvC;;AAEA,MAAIC,WAAW,CAACT,WAAW,EAAZ,EAAgBU,WAAhB,GAA8BC,IAA9B,EAAf;AACA,MAAIX,aAAa,IAAb,IAAqBS,aAAa,IAAlC,IAA0CA,aAAa,GAA3D,EAAgE;AAC9DT,eAAW,IAAX;AACD;AACD,MAAIA,aAAa,KAAb,IAAsBS,aAAa,KAAnC,IAA4CA,aAAa,GAA7D,EAAkE;AAChET,eAAW,KAAX;AACD;;AAED,MAAIY,UAAU,SAAVA,OAAU,CAAUL,MAAV,EAAkB;AAC9B;AACA,QAAI,OAAOA,MAAP,KAAkB,WAAtB,EAAmC;AACjCH,eAASE,GAAT,CAAaP,OAAb,EAAsBS,WAAtB,GAAoC,EAApC;AACD;AACDJ,aAASE,GAAT,CAAaP,OAAb,EAAsBS,WAAtB,CAAkCK,IAAlC,CAAuCb,QAAvC;AACD,GAND;;AAQA,UAAQD,OAAR;AACE,SAAK,WAAL;AACEa,cAAQL,MAAR,EAAgBP,QAAhB;AACA;AACF;AACEI,eAASC,GAAT,CAAaC,GAAb,CAAiBP,OAAjB,EAA0BS,WAA1B,GAAwCR,QAAxC;AACA;AANJ;;AASA,SAAOO,MAAP;AACD,CA7CD","file":"ini_set.js","sourcesContent":["module.exports = function ini_set (varname, newvalue) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/ini_set/\n // original by: Brett Zamir (http://brett-zamir.me)\n // note 1: This will not set a global_value or access level for the ini item\n // example 1: ini_set('date.timezone', 'Asia/Hong_Kong')\n // example 1: ini_set('date.timezone', 'America/Chicago')\n // returns 1: 'Asia/Hong_Kong'\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n $locutus.php.ini = $locutus.php.ini || {}\n\n $locutus.php.ini = $locutus.php.ini || {}\n $locutus.php.ini[varname] = $locutus.php.ini[varname] || {}\n\n var oldval = $locutus.php.ini[varname].local_value\n\n var lowerStr = (newvalue + '').toLowerCase().trim()\n if (newvalue === true || lowerStr === 'on' || lowerStr === '1') {\n newvalue = 'on'\n }\n if (newvalue === false || lowerStr === 'off' || lowerStr === '0') {\n newvalue = 'off'\n }\n\n var _setArr = function (oldval) {\n // Although these are set individually, they are all accumulated\n if (typeof oldval === 'undefined') {\n $locutus.ini[varname].local_value = []\n }\n $locutus.ini[varname].local_value.push(newvalue)\n }\n\n switch (varname) {\n case 'extension':\n _setArr(oldval, newvalue)\n break\n default:\n $locutus.php.ini[varname].local_value = newvalue\n break\n }\n\n return oldval\n}\n"]}