mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-10-15 20:06:58 +00:00
Add support for ibm extensions [skip ci]
This commit is contained in:
7 files changed
+177
-9
No files matched your search
@@ -215,7 +215,7 @@ This disables all core and third-party shared extensions and thus, can break som
|
||||
- These extensions have custom support:
|
||||
- `cubrid` and `pdo_cubrid` on `Ubuntu`.
|
||||
- `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`.
|
||||
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` on all supported OS.
|
||||
- `blackfire`, `couchbase`, `ibm_db2`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_ibm`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` on all supported OS.
|
||||
|
||||
- By default, extensions which cannot be added or disabled gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ describe('Extension tests', () => {
|
||||
${'oci8'} | ${'7.4'} | ${'Add-Oci oci8'}
|
||||
${'pcov'} | ${'5.6'} | ${'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
||||
${'pdo_oci'} | ${'7.4'} | ${'Add-Oci pdo_oci'}
|
||||
${'ibm_db2'} | ${'7.4'} | ${'Add-Ibm ibm_db2'}
|
||||
${'pdo_ibm'} | ${'7.4'} | ${'Add-Ibm pdo_ibm'}
|
||||
${'pecl_http'} | ${'7.4'} | ${'Add-Http'}
|
||||
${'pdo_sqlsrv'} | ${'7.4'} | ${'Add-Sqlsrv pdo_sqlsrv'}
|
||||
${'phalcon3'} | ${'7.2'} | ${'Add-Phalcon phalcon3'}
|
||||
@@ -56,11 +58,13 @@ describe('Extension tests', () => {
|
||||
${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
|
||||
${'oci8'} | ${'7.3'} | ${'add_oci oci8'}
|
||||
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6'}
|
||||
${'ibm_db2'} | ${'7.3'} | ${'add_ibm ibm_db2'}
|
||||
${'pdo-odbc'} | ${'7.4'} | ${'add_pdo_extension odbc'}
|
||||
${'pdo_cubrid'} | ${'7.0'} | ${'add_cubrid pdo_cubrid'}
|
||||
${'pdo_cubrid'} | ${'7.4'} | ${'add_pdo_extension cubrid'}
|
||||
${'pdo_mysql'} | ${'7.4'} | ${'add_pdo_extension mysql'}
|
||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||
${'pdo_ibm'} | ${'7.3'} | ${'add_ibm pdo_ibm'}
|
||||
${'pdo_sqlsrv'} | ${'7.4'} | ${'add_sqlsrv pdo_sqlsrv'}
|
||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
(()=>{var A={6472:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.addINIValuesUnix=addINIValuesUnix;e.addINIValuesWindows=addINIValuesWindows;e.addINIValues=addINIValues;const o=n(t(9277));async function addINIValuesUnix(A){const e=await o.CSVArray(A);let t="";await o.asyncForEach(e,(async function(A){t+="\n"+await o.addLog("$tick",A,"Added to php.ini","linux")}));return'echo "'+e.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1'+t}async function addINIValuesWindows(A){const e=await o.CSVArray(A);let t="\n";await o.asyncForEach(e,(async function(A){t+=await o.addLog("$tick",A,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+e.join("\n")+'"'+t}async function addINIValues(A,e,t=false){let r="\n";switch(t){case true:r+=await o.stepLog("Add php.ini values",e)+await o.suppressOutput(e)+"\n";break;case false:default:r+=await o.stepLog("Add php.ini values",e)+"\n";break}switch(e){case"win32":return r+await addINIValuesWindows(A);case"darwin":case"linux":return r+await addINIValuesUnix(A);default:return await o.log("Platform "+e+" is not supported",e,"error")}}},9524:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.checkXdebugError=checkXdebugError;e.addCoverageXdebug=addCoverageXdebug;e.addCoveragePCOV=addCoveragePCOV;e.disableCoverage=disableCoverage;e.addCoverage=addCoverage;const o=n(t(9277));const i=n(t(3252));const a=n(t(6472));async function checkXdebugError(A,e){if(/^5\.[3-6]$|^7\.[0-1]$/.test(e)&&A=="xdebug3"||/^8\.[0-9]$/.test(e)&&A=="xdebug2"){return A+" is not supported on PHP "+e}return""}async function addCoverageXdebug(A,e,t,r){let s="\n";const n=await checkXdebugError(A,e);if(!n){s+=await i.addExtension(":pcov:false",e,t,true)+r;A=A=="xdebug3"?"xdebug":A;s+=await i.addExtension(A,e,t,true)+r;s+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",t);s+=await o.getCommand(t,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{s+=await o.addLog("$cross",A,n,t)}return s}async function addCoveragePCOV(A,e,t){let r="\n";switch(true){default:r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await i.addExtension("pcov",A,e,true)+t;r+=await a.addINIValues("pcov.enabled=1",e,true)+"\n";r+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",e);r+=await o.getCommand(e,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(A):r+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",e);break}return r}async function disableCoverage(A,e,t){let r="\n";r+=await i.addExtension(":pcov:false",A,e,true)+t;r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",e);return r}async function addCoverage(A,e,t){A=A.toLowerCase();const r="\n"+await o.stepLog("Setup Coverage",t);const s=await o.suppressOutput(t)+"\n";switch(A){case"pcov":return r+await addCoveragePCOV(e,t,s);case"xdebug":case"xdebug2":case"xdebug3":return r+await addCoverageXdebug(A,e,t,s);case"none":return r+await disableCoverage(e,t,s);default:return""}}},3252:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r)Line truncated
|
||||
(()=>{var A={6472:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.addINIValuesUnix=addINIValuesUnix;e.addINIValuesWindows=addINIValuesWindows;e.addINIValues=addINIValues;const o=n(t(9277));async function addINIValuesUnix(A){const e=await o.CSVArray(A);let t="";await o.asyncForEach(e,(async function(A){t+="\n"+await o.addLog("$tick",A,"Added to php.ini","linux")}));return'echo "'+e.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1'+t}async function addINIValuesWindows(A){const e=await o.CSVArray(A);let t="\n";await o.asyncForEach(e,(async function(A){t+=await o.addLog("$tick",A,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+e.join("\n")+'"'+t}async function addINIValues(A,e,t=false){let r="\n";switch(t){case true:r+=await o.stepLog("Add php.ini values",e)+await o.suppressOutput(e)+"\n";break;case false:default:r+=await o.stepLog("Add php.ini values",e)+"\n";break}switch(e){case"win32":return r+await addINIValuesWindows(A);case"darwin":case"linux":return r+await addINIValuesUnix(A);default:return await o.log("Platform "+e+" is not supported",e,"error")}}},9524:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.checkXdebugError=checkXdebugError;e.addCoverageXdebug=addCoverageXdebug;e.addCoveragePCOV=addCoveragePCOV;e.disableCoverage=disableCoverage;e.addCoverage=addCoverage;const o=n(t(9277));const i=n(t(3252));const a=n(t(6472));async function checkXdebugError(A,e){if(/^5\.[3-6]$|^7\.[0-1]$/.test(e)&&A=="xdebug3"||/^8\.[0-9]$/.test(e)&&A=="xdebug2"){return A+" is not supported on PHP "+e}return""}async function addCoverageXdebug(A,e,t,r){let s="\n";const n=await checkXdebugError(A,e);if(!n){s+=await i.addExtension(":pcov:false",e,t,true)+r;A=A=="xdebug3"?"xdebug":A;s+=await i.addExtension(A,e,t,true)+r;s+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",t);s+=await o.getCommand(t,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{s+=await o.addLog("$cross",A,n,t)}return s}async function addCoveragePCOV(A,e,t){let r="\n";switch(true){default:r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await i.addExtension("pcov",A,e,true)+t;r+=await a.addINIValues("pcov.enabled=1",e,true)+"\n";r+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",e);r+=await o.getCommand(e,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(A):r+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",e);break}return r}async function disableCoverage(A,e,t){let r="\n";r+=await i.addExtension(":pcov:false",A,e,true)+t;r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",e);return r}async function addCoverage(A,e,t){A=A.toLowerCase();const r="\n"+await o.stepLog("Setup Coverage",t);const s=await o.suppressOutput(t)+"\n";switch(A){case"pcov":return r+await addCoveragePCOV(e,t,s);case"xdebug":case"xdebug2":case"xdebug3":return r+await addCoverageXdebug(A,e,t,s);case"none":return r+await disableCoverage(e,t,s);default:return""}}},3252:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r)Line truncated
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=A=>A.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=A=>A.replace(/\r?\n|\r/g,"\r\n");const r=[];const s=new Uint8Array([13,10]);E=0;let n=false;for(const[e,o]of A){if(typeof o==="string"){const A=F.encode(t+`; name="${escape(normalizeLinefeeds(e))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);r.push(A);E+=A.byteLength}else{const A=F.encode(`${t}; name="${escape(normalizeLinefeeds(e))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);r.push(A,o,s);if(typeof o.size==="number"){E+=A.byteLength+o.size+s.byteLength}else{n=true}}}const o=F.encode(`--${e}--`);r.push(o);E+=o.byteLength;if(n){E=null}g=A;c=async function*(){for(const A of r){if(A.stream){yield*A.stream()}else{yield A}}};Q="multipart/form-data; boundary="+e}else if(o(A)){g=A;E=A.size;if(A.type){Q=A.type}}else if(typeof A[Symbol.asyncIterator]==="function"){if(e){throw new TypeError("keepalive")}if(s.isDisturbed(A)||A.locked){throw new TypeError("Response body object should not be disturbed or locked")}r=A instanceof k?A:n(A)}if(typeof g==="string"||s.isBuffer(g)){E=Buffer.byteLength(g)}if(c!=null){let e;r=new k({async start(){e=c(A)[Symbol.asyncIterator]()},async pull(A){const{value:t,done:s}=await e.next();if(s){queueMicrotask((()=>{A.close()}))}else{if(!f(r)){A.enqueue(new Uint8Array(t))}}return A.desiredSize>0},async cancel(A){await e.return()},type:undefined})}const C={stream:r,source:g,length:E};return[C,Q]}function safelyExtractBody(A,e=false){if(!k){k=t(3774).ReadableStream}if(A instanceof k){d(!s.isDisturbed(A),"The body has already been consumed.");d(!A.locked,"The stream is locked.")}return extractBody(A,e)}function cloneBody(A){const[e,t]=A.stream.tee();const r=l(t,{transfer:[t]});const[,s]=r.tee();A.stream=e;return{stream:s,length:A.length,source:A.source}}async function*consumeBody(A){if(A){if(p(A)){yield A}else{const e=A.stream;if(s.isDisturbed(e)){throw new TypeError("The body has already been consumed.")}if(e.locked){throw new TypeError("The stream is locked.")}e[u]=true;yield*e}}}function throwIfAborted(A){if(A.aborted){throw new B("The operation was aborted.","AbortError")}}function bodyMixinMethods(A){const e={blob(){return specConsumeBody(this,(A=>{let e=bodyMimeType(this);if(e==="failure"){e=""}else if(e){e=D(e)}return new I([A],{type:e})}),A)},arrayBuffer(){return specConsumeBody(this,(A=>new Uint8Array(A).buffer),A)},text(){return specConsumeBody(this,utf8DecodeBytes,A)},json(){return specConsumeBody(this,parseJSONFromBytes,A)},async formData(){C.brandCheck(this,A);throwIfAborted(this[Q]);const e=this.headers.get("Content-Type");if(/multipart\/form-data/.test(e)){const A={};for(const[e,t]of this.headers)A[e.toLowerCase()]=t;const e=new E;let t;try{t=new r({headers:A,preservePath:true})}catch(A){throw new B(`${A}`,"AbortError")}t.on("field",((A,t)=>{e.append(A,t)}));t.on("file",((A,t,r,s,n)=>{const o=[];if(s==="base64"||s.toLowerCase()==="base64"){let s="";t.on("data",(A=>{s+=A.toString().replace(/[\r\n]/gm,"");const e=s.length-s.length%4;o.push(Buffer.from(s.slice(0,e),"base64"));s=s.slice(e)}));t.on("end",(()=>{o.push(Buffer.from(s,"base64"));e.append(A,new b(o,r,{type:n}))}))}else{t.on("data",(A=>{o.push(A)}));t.on("end",(()=>{e.append(A,new b(o,r,{type:n}))}))}}));const s=new Promise(((A,e)=>{t.on("finish",A);t.on("error",(A=>e(new TypeError(A))))}));if(this.body!==null)for await(const A of consumeBody(this[Q].body))t.write(A);t.end();await s;return e}else if(/application\/x-www-form-urlencoded/.test(e)){let A;try{let e="";const t=new TextDecoder("utf-8",{ignoreBOM:true});for await(const A of consumeBody(this[Q].body)){if(!p(A)){throw new TypeError("Expected Uint8Array chunk")}e+=t.decode(A,{stream:true})}e+=t.decode();A=new URLSearchParams(e)}catch(A){throw Object.assign(new TypeError,{cause:A})}const e=new E;for(const[t,r]of A){e.append(t,r)}return e}else{await Promise.resolve();throwIfAborted(this[Q]);throw C.errors.exception({header:`${A.name}.formData`,message:"Could not parse content as FormData."})}}};return e}function mixinBody(A){Object.assign(A.prototype,bodyMixinMethods(A))}async function specConsumeBody(A,e,t){C.brandCheck(A,t);throwIfAborted(A[Q]);if(bodyUnusable(A[Q].body)){throw new TypeError("Body is unusable")}const r=c();const errorSteps=A=>r.reject(A);const successSteps=A=>{try{r.resolve(e(A))}catch(A){errorSteps(A)}};if(A[Q].body==null){successSteps(new Uint8Array);return r.promise}await g(A[Q].body,successSteps,errorSteps);return r.promise}function bodyUnusable(A){return A!=null&&(A.stream.locked||s.isDisturbed(A.stream))}function utf8DecodeBytes(A){if(A.length===0){return""}if(A[0]===239&&A[1]===187&&A[2]===191){A=A.subarray(3)}const e=S.decode(A);return e}function parseJSONFromBytes(A){return JSON.parse(utf8DecodeBytes(A))}function bodyMimeType(A){const{headersList:e}=A[Q];const t=e.get("content-Line truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */n[s-4]=this.maskKey[0];n[s-3]=this.maskKey[1];n[s-2]=this.maskKey[2];n[s-1]=this.maskKey[3];n[1]=t;if(t===126){n.writeUInt16BE(e,2)}else if(t===127){n[2]=n[3]=0;n.writeUIntBE(e,4,6)}n[1]|=128;for(let A=0;A<e;A++){n[s+A]=this.frameData[A]^this.maskKey[A%4]}return n}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},3171:(A,e,t)=>{"use strict";const{Writable:r}=t(2203);const s=t(1637);const{parserStates:n,opcodes:o,states:i,emptyBuffer:a}=t(5913);const{kReadyState:c,kSentClose:g,kResponse:E,kReceivedClose:Q}=t(2933);const{isValidStatusCode:C,failWebsocketConnection:B,websocketMessageReceived:l}=t(3574);const{WebsocketFrameSend:I}=t(1237);const h={};h.ping=s.channel("undici:websocket:ping");h.pong=s.channel("undici:websocket:pong");class ByteParser extends r{#o=[];#i=0;#a=n.INFO;#c={};#g=[];constructor(A){super();this.ws=A}_write(A,e,t){this.#o.push(A);this.#i+=A.length;this.run(t)}run(A){while(true){if(this.#a===n.INFO){if(this.#i<2){return A()}const e=this.consume(2);this.#c.fin=(e[0]&128)!==0;this.#c.opcode=e[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==o.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==o.BINARY&&this.#c.opcode!==o.TEXT){B(this.ws,"Invalid frame type was fragmented.");return}const t=e[1]&127;if(t<=125){this.#c.payloadLength=t;this.#a=n.READ_DATA}else if(t===126){this.#a=n.PAYLOADLENGTH_16}else if(t===127){this.#a=n.PAYLOADLENGTH_64}if(this.#c.fragmented&&t>125){B(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===o.PING||this.#c.opcode===o.PONG||this.#c.opcode===o.CLOSE)&&t>125){B(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===o.CLOSE){if(t===1){B(this.ws,"Received close frame with a 1-byte body.");return}const A=this.consume(t);this.#c.closeInfo=this.parseCloseBody(false,A);if(!this.ws[g]){const A=Buffer.allocUnsafe(2);A.writeUInt16BE(this.#c.closeInfo.code,0);const e=new I(A);this.ws[E].socket.write(e.createFrame(o.CLOSE),(A=>{if(!A){this.ws[g]=true}}))}this.ws[c]=i.CLOSING;this.ws[Q]=true;this.end();return}else if(this.#c.opcode===o.PING){const e=this.consume(t);if(!this.ws[Q]){const A=new I(e);this.ws[E].socket.write(A.createFrame(o.PONG));if(h.ping.hasSubscribers){h.ping.publish({payload:e})}}this.#a=n.INFO;if(this.#i>0){continue}else{A();return}}else if(this.#c.opcode===o.PONG){const e=this.consume(t);if(h.pong.hasSubscribers){h.pong.publish({payload:e})}if(this.#i>0){continue}else{A();return}}}else if(this.#a===n.PAYLOADLENGTH_16){if(this.#i<2){return A()}const e=this.consume(2);this.#c.payloadLength=e.readUInt16BE(0);this.#a=n.READ_DATA}else if(this.#a===n.PAYLOADLENGTH_64){if(this.#i<8){return A()}const e=this.consume(8);const t=e.readUInt32BE(0);if(t>2**31-1){B(this.ws,"Received payload length > 2^31 bytes.");return}const r=e.readUInt32BE(4);this.#c.payloadLength=(t<<8)+r;this.#a=n.READ_DATA}else if(this.#a===n.READ_DATA){if(this.#i<this.#c.payloadLength){return A()}else if(this.#i>=this.#c.payloadLength){const A=this.consume(this.#c.payloadLength);this.#g.push(A);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===o.CONTINUATION){const A=Buffer.concat(this.#g);l(this.ws,this.#c.originalOpcode,A);this.#c={};this.#g.length=0}this.#a=n.INFO}}if(this.#i>0){continue}else{A();break}}}consume(A){if(A>this.#i){return null}else if(A===0){return a}if(this.#o[0].length===A){this.#i-=this.#o[0].length;return this.#o.shift()}const e=Buffer.allocUnsafe(A);let t=0;while(t!==A){const r=this.#o[0];const{length:s}=r;if(s+t===A){e.set(this.#o.shift(),t);break}else if(s+t>A){e.set(r.subarray(0,A-t),t);this.#o[0]=r.subarray(A-t);break}else{e.set(this.#o.shift(),t);t+=r.length}}this.#i-=A;return e}parseCloseBody(A,e){let t;if(e.length>=2){t=e.readUInt16BE(0)}if(A){if(!C(t)){return null}return{code:t}}let r=e.subarray(2);if(r[0]===239&&r[1]===187&&r[2]===191){r=r.subarray(3)}if(t!==undefined&&!C(t)){return null}try{r=new TextDecoder("utf-8",{fatal:true}).decode(r)}catch{return null}return{code:t,reason:r}}get closingInfo(){return this.#c.closeInfo}}A.exports={ByteParser:ByteParser}},2933:A=>{"use strict";A.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},3574:(A,e,t)=>{"use strict";const{kReadyState:r,kController:s,kResponse:n,kBinaryType:o,kWebSocketURL:i}=t(2933);const{states:a,opcodes:c}=t(5913);const{MessageEvent:g,ErrorEvent:E}=t(6255);function isEstablished(A){return A[r]===a.OPEN}function isClosing(A){return A[r]===a.CLOSING}function isClosed(A){return A[r]===a.CLOSED}function fireEvent(A,e,t=Event,r){const s=new t(A,r);e.dispatchEvent(s)}function websocketMessageReceived(A,e,t){if(A[r]!==a.OPEN){return}let s;if(e===c.TEXT){try{s=new TextDecoder("utf-8",{fatal:true}).decode(t)Line truncated
|
||||
+8
-6
@@ -34,7 +34,7 @@ export async function addExtensionDarwin(
|
||||
// match 7.4relay...8.5relay
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
||||
// match 7.0zephir_parser...8.4zephir_parser
|
||||
@@ -44,7 +44,7 @@ export async function addExtensionDarwin(
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
case /^couchbase|^event|^gearman$|^geos$|^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
|
||||
@@ -138,7 +138,7 @@ export async function addExtensionWindows(
|
||||
break;
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match pdo_oci and oci8
|
||||
// match ibm_db2, pdo_ibm, pdo_oci and oci8
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
||||
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
||||
@@ -146,7 +146,9 @@ export async function addExtensionWindows(
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
||||
case /^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
|
||||
version_extension
|
||||
@@ -269,7 +271,7 @@ export async function addExtensionLinux(
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match couchbase, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
|
||||
// match 7.0zephir_parser...8.4zephir_parser
|
||||
@@ -282,7 +284,7 @@ export async function addExtensionLinux(
|
||||
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
case /^couchbase|^event|^gearman$|^geos$|^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Function to log license information for ibm extensions.
|
||||
Function Add-LicenseLog() {
|
||||
printf "$env:GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $extension "Click to read the $extension related license information"
|
||||
printf "IBM Db2 ODBC and CLI Driver is required for %s extension.\n" $extension
|
||||
printf "It is provided under the IBM International Program License Agreement.\n"
|
||||
printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information"
|
||||
$licensePath = "$php_dir\clidriver\license\odbc_notices.rtf"
|
||||
if (Test-Path $licensePath) {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$rtBox = New-Object System.Windows.Forms.RichTextBox
|
||||
$rtBox.Rtf = [System.IO.File]::ReadAllText($licensePath);
|
||||
Write-Host $rtBox.Text;
|
||||
}
|
||||
Write-Output "$env:END_GROUP"
|
||||
}
|
||||
|
||||
# Function to install IBM Db2 CLI driver.
|
||||
Function Add-IbmCli() {
|
||||
$cliPath = "$php_dir\clidriver"
|
||||
if (-not (Test-Path "$cliPath\bin")) {
|
||||
$suffix = if ($arch -eq 'x86') { 'nt32' } else { 'ntx64' }
|
||||
$archive = "$suffix`_odbc_cli.zip"
|
||||
$destination = "$ENV:RUNNER_TOOL_CACHE\ibm_cli.zip"
|
||||
Get-File -Url "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/$archive" -OutFile $destination > $null 2>&1
|
||||
Expand-Archive -Path $destination -DestinationPath $php_dir -Force > $null 2>&1
|
||||
}
|
||||
$env:IBM_DB_HOME = $cliPath
|
||||
$env:LD_LIBRARY_PATH = "$cliPath\bin;$cliPath\lib;$env:LD_LIBRARY_PATH"
|
||||
Add-Path "$cliPath\bin"
|
||||
$env:PATH = "$cliPath\bin;$env:PATH"
|
||||
}
|
||||
|
||||
# Function to install ibm_db2 and pdo_ibm.
|
||||
Function Add-Ibm() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[ValidateSet('ibm_db2', 'pdo_ibm')]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
try {
|
||||
$status = 'Enabled'
|
||||
Add-IbmCli
|
||||
if (Test-Path "$ext_dir\php_$extension.dll") {
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
} else {
|
||||
Add-Extension $extension
|
||||
$status = 'Installed and enabled'
|
||||
}
|
||||
Add-ExtensionLog $extension $status
|
||||
Add-LicenseLog
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
# Function to log license details for ibm extensions.
|
||||
add_license_log() {
|
||||
printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
|
||||
printf "IBM Db2 ODBC and CLI Driver is required for %s extension.\n" "$ext"
|
||||
printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information"
|
||||
local license_file="$ibm_cli/license/odbc_notices.txt"
|
||||
if [ -f "$license_file" ]; then
|
||||
cat "$license_file"
|
||||
fi
|
||||
echo "$END_GROUP"
|
||||
}
|
||||
|
||||
# Function to determine the driver archive for the current platform.
|
||||
get_cli_archive() {
|
||||
local os=$1
|
||||
local arch=$2
|
||||
case $os in
|
||||
Linux)
|
||||
case $arch in
|
||||
x86_64|amd64) echo "linuxx64_odbc_cli.tar.gz";;
|
||||
i?86) echo "linuxia32_odbc_cli.tar.gz";;
|
||||
*) return 1;;
|
||||
esac
|
||||
;;
|
||||
Darwin)
|
||||
case $arch in
|
||||
x86_64) echo "macos64_odbc_cli.tar.gz";;
|
||||
arm64|aarch64) echo "macarm64_odbc_cli.tar.gz";;
|
||||
*) return 1;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Function to install IBM Db2 CLI driver.
|
||||
add_cli_driver() {
|
||||
local os arch archive url tmp libs
|
||||
if [ -d "$ibm_cli" ]; then
|
||||
return 0
|
||||
fi
|
||||
os=$(uname -s)
|
||||
arch=$(uname -m)
|
||||
archive=$(get_cli_archive "$os" "$arch") || return 1
|
||||
url="https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/$archive"
|
||||
tmp=/tmp/$archive
|
||||
get -q -n "$tmp" "$url"
|
||||
sudo mkdir -p "$ibm_home"
|
||||
sudo tar -xzf "$tmp" -C "$ibm_home"
|
||||
sudo rm -f "$tmp"
|
||||
if [ ! -d "$ibm_cli" ]; then
|
||||
local extracted
|
||||
extracted=$(find "$ibm_home" -maxdepth 1 -type d -name 'clidriver*' | head -n 1)
|
||||
[ -n "$extracted" ] && sudo mv "$extracted" "$ibm_cli"
|
||||
fi
|
||||
if [ "$os" = "Linux" ]; then
|
||||
echo "$ibm_cli/lib" | sudo tee /etc/ld.so.conf.d/ibm_db2.conf >/dev/null
|
||||
sudo ldconfig
|
||||
else
|
||||
libs='/usr/local/lib'
|
||||
sudo mkdir -p "$libs"
|
||||
sudo ln -sf "$ibm_cli"/lib/*.dylib "$libs" >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to install ibm_db2 and pdo_ibm.
|
||||
add_ibm_helper() {
|
||||
if ! shared_extension "$ext"; then
|
||||
status='Installed and enabled'
|
||||
export IBM_DB_HOME="$ibm_cli"
|
||||
export LD_LIBRARY_PATH="$IBM_DB_HOME/lib"
|
||||
add_env DYLD_LIBRARY_PATH "$IBM_DB_HOME/lib"
|
||||
local configure_flag
|
||||
if [ "$ext" = 'ibm_db2' ]; then
|
||||
configure_flag="--with-IBM_DB2=$IBM_DB_HOME"
|
||||
else
|
||||
configure_flag="--with-pdo-ibm=$IBM_DB_HOME"
|
||||
fi
|
||||
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) $configure_flag"
|
||||
patch_phpize
|
||||
add_extension_from_source "$ext" https://github.com php "pecl-database-$ext" master extension get
|
||||
restore_phpize
|
||||
else
|
||||
enable_extension "$ext" extension
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add ibm_db2 and pdo_ibm.
|
||||
add_ibm() {
|
||||
ext=$1
|
||||
status='Enabled'
|
||||
ibm_home='/opt/ibm'
|
||||
ibm_cli=$ibm_home/clidriver
|
||||
if ! add_cli_driver >/dev/null 2>&1; then
|
||||
add_log "${cross:?}" "$ext" "IBM Db2 CLI driver is not available on $(uname -s)/$(uname -m)"
|
||||
return 1
|
||||
fi
|
||||
add_ibm_helper >/dev/null 2>&1
|
||||
add_extension_log "$ext" "$status"
|
||||
check_extension "$ext" && add_license_log
|
||||
}
|
||||
|
||||
# shellcheck source=.
|
||||
. "${scripts:?}"/extensions/patches/phpize.sh
|
||||
+1
-1
@@ -400,7 +400,7 @@ export async function customPackage(
|
||||
version: string,
|
||||
os: string
|
||||
): Promise<string> {
|
||||
const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]/, '');
|
||||
const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]|[_-]db2/, '');
|
||||
const script_extension: string = await scriptExtension(os);
|
||||
const script: string = path.join(
|
||||
__dirname,
|
||||
|
||||
Reference in new issue
Block a user