Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmiBX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitrix
AmiBX
Commits
dfffb611
Commit
dfffb611
authored
Jan 12, 2022
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Billz curl req add progress func
parent
d14a4961
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
AloVoiceConnector.php
vendor/alovoice/src/AloVoiceConnector.php
+1
-1
AloVoiceRest.php
vendor/alovoice/src/AloVoiceRest.php
+3
-2
BillzRest.php
vendor/alovoice/src/BillzRest.php
+17
-5
No files found.
vendor/alovoice/src/AloVoiceConnector.php
View file @
dfffb611
...
...
@@ -2722,7 +2722,7 @@ CFU=';
'agentProcessBxLeads'
=>
65
,
'checkListenerStatus'
=>
30
,
'agentsCheckDeletedUsersNumber'
=>
60
,
'billz_catalog_infos_synch'
=>
12
0
,
// 'billz_catalog_infos_synch' => 1200
0,
'process_orders_synch'
=>
60
,
];
...
...
vendor/alovoice/src/AloVoiceRest.php
View file @
dfffb611
...
...
@@ -565,9 +565,10 @@ class AloVoiceRest
];
echo
"Загрузка данных из Billz..."
;
$sdata
=
self
::
get_products_last_update
();
//"2017-01-01T00:00:00Z";
echo
"Загрузка изменения из Billz на дату: "
.
$sdata
.
":..."
;
$first
=
BillzRest
::
getProducts
(
$sdata
);
...
...
vendor/alovoice/src/BillzRest.php
View file @
dfffb611
...
...
@@ -184,10 +184,8 @@ require_once (__DIR__.'/keys.php');
$result
[
"params"
]
=
$sendData
;
$result
[
"url"
]
=
$url
;
static
::
setLog
(
$url
,
'--==== Before billzCurl URL:'
);
try
{
static
::
setLog
(
$url
,
'--==== InTry billzCurl URL:'
);
$obCurl
=
curl_init
();
curl_setopt_array
(
$obCurl
,
array
(
...
...
@@ -203,6 +201,8 @@ require_once (__DIR__.'/keys.php');
CURLOPT_POSTFIELDS
=>
$sendData
,
CURLOPT_SSL_VERIFYPEER
=>
false
,
CURLOPT_SSL_VERIFYHOST
=>
false
,
CURLOPT_NOPROGRESS
=>
false
,
CURLOPT_PROGRESSFUNCTION
=>
'progress'
,
CURLOPT_HTTPHEADER
=>
array
(
'Authorization: Bearer '
.
$arSettings
[
"token"
],
'Content-Type: application/json'
...
...
@@ -230,8 +230,8 @@ require_once (__DIR__.'/keys.php');
$out
=
curl_exec
(
$obCurl
);
$info
=
curl_getinfo
(
$obCurl
);
static
::
setLog
(
$headers
,
'--==== billzCurl HEADRES:'
);
static
::
setLog
(
$out
,
'--==== billzCurl OUT:'
);
//
static::setLog( $headers, '--==== billzCurl HEADRES:' );
//
static::setLog( $out, '--==== billzCurl OUT:' );
if
(
curl_errno
(
$obCurl
))
{
$result
[
'curl_error'
]
=
curl_error
(
$obCurl
);
...
...
@@ -241,7 +241,7 @@ require_once (__DIR__.'/keys.php');
}
curl_close
(
$obCurl
);
static
::
setLog
(
$result
,
'billzCurl'
);
//
static::setLog( $result, 'billzCurl' );
}
catch
(
Exception
$e
)
...
...
@@ -262,10 +262,22 @@ require_once (__DIR__.'/keys.php');
'error_information'
=>
$e
->
getMessage
(),
];
}
}
return
$result
;
function
progress
(
$resource
,
$download_size
,
$downloaded
,
$upload_size
,
$uploaded
)
{
if
(
$download_size
>
0
)
// echo $downloaded / $download_size * 100;
$percDwn
=
$downloaded
/
$download_size
*
100
;
echo
"
\r
Загружено:
\033
[32m"
.
$percDwn
.
"%
\033
[0m [
\033
[36m"
.
$downloaded
.
"
\033
из 0m/"
.
$download_size
.
"..."
;
ob_flush
();
flush
();
sleep
(
1
);
// just to see effect
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment