mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updated to phantomjscloud v2 API
This commit is contained in:
parent
c6c9a34c04
commit
64fec3b502
@ -443,8 +443,7 @@ if (!defined('CONTACT_EMAIL')) {
|
|||||||
define('ZAPIER_URL', 'https://zapier.com/zapbook/invoice-ninja');
|
define('ZAPIER_URL', 'https://zapier.com/zapbook/invoice-ninja');
|
||||||
define('OUTDATE_BROWSER_URL', 'http://browsehappy.com/');
|
define('OUTDATE_BROWSER_URL', 'http://browsehappy.com/');
|
||||||
define('PDFMAKE_DOCS', 'http://pdfmake.org/playground.html');
|
define('PDFMAKE_DOCS', 'http://pdfmake.org/playground.html');
|
||||||
define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/single/browser/v1/');
|
define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/api/browser/v2/');
|
||||||
//define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/api/browser/v2/');
|
|
||||||
define('PHP_DATE_FORMATS', 'http://php.net/manual/en/function.date.php');
|
define('PHP_DATE_FORMATS', 'http://php.net/manual/en/function.date.php');
|
||||||
define('REFERRAL_PROGRAM_URL', 'https://www.invoiceninja.com/referral-program/');
|
define('REFERRAL_PROGRAM_URL', 'https://www.invoiceninja.com/referral-program/');
|
||||||
|
|
||||||
@ -548,6 +547,7 @@ if (!defined('CONTACT_EMAIL')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log all SQL queries to laravel.log
|
// Log all SQL queries to laravel.log
|
||||||
|
/*
|
||||||
if (Utils::isNinjaDev()) {
|
if (Utils::isNinjaDev()) {
|
||||||
Event::listen('illuminate.query', function($query, $bindings, $time, $name) {
|
Event::listen('illuminate.query', function($query, $bindings, $time, $name) {
|
||||||
$data = compact('bindings', 'time', 'name');
|
$data = compact('bindings', 'time', 'name');
|
||||||
@ -568,10 +568,14 @@ if (Utils::isNinjaDev()) {
|
|||||||
Log::info($query, $data);
|
Log::info($query, $data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (Auth::check() && Auth::user()->id === 1)
|
if (Auth::check() && Auth::user()->id === 1)
|
||||||
{
|
{
|
||||||
Auth::loginUsingId(1);
|
Auth::loginUsingId(1);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -613,19 +613,27 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
$invitation = $this->invitations[0];
|
$invitation = $this->invitations[0];
|
||||||
$link = $invitation->getLink();
|
$link = $invitation->getLink();
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
$jsonEncodedData = json_encode([
|
$jsonEncodedData = json_encode([
|
||||||
'targetUrl' => "{$link}?phantomjs=true",
|
'url' => "{$link}?phantomjs=true",
|
||||||
'requestType' => 'raw',
|
'renderType' => 'html',
|
||||||
|
'outputAsJson' => false,
|
||||||
|
'renderSettings' => [
|
||||||
|
'passThroughHeaders' => true,
|
||||||
|
],
|
||||||
'delayTime' => 1000,
|
'delayTime' => 1000,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$opts = [
|
$opts = [
|
||||||
CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY'),
|
CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/',
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||||
CURLOPT_POST => 1,
|
CURLOPT_POST => 1,
|
||||||
CURLOPT_POSTFIELDS => $jsonEncodedData,
|
CURLOPT_POSTFIELDS => $jsonEncodedData,
|
||||||
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Content-Length: '.strlen($jsonEncodedData)],
|
CURLOPT_HTTPHEADER => [
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: '.strlen($jsonEncodedData)
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
curl_setopt_array($curl, $opts);
|
curl_setopt_array($curl, $opts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user