How to properly introduce the curl extension as a dependency?
Simply trying to create an array that references constants from the curl extension like so
public function __construct()
{
let this->options = [
CURLOPT_SSL_VERIFYPEER : false,
CURLOPT_RETURNTRANSFER : true,
CURLOPT_CONNECTTIMEOUT : 30,
CURLOPT_TIMEOUT : 30
];
}
causes compile time warnings / errors
Warning: Constant 'CURLOPT_CONNECTTIMEOUT' does not exist at compile time in /home/nathan/gitRepos/zephir/rcurl/rcurl/curl.zep on 89 [nonexistent-constant]
CURLOPT_CONNECTTIMEOUT : "30", -----------------------------------^
Zephir\CompilerException: Invalid value type: string in /home/nathan/gitRepos/zephir/rcurl/rcurl/curl.zep on line 89
CURLOPT_CONNECTTIMEOUT : "30", -----------------------------------------^
I started looking in the generated config.json file and found a requires
section to which I added curl
so it now looks like this
"requires": {
"extensions": [
"curl"
]
},
However now the compiler errors have changed
Zephir\Exception: Could not load extension : curl, You must add extensions above before build this extension