Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
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
Kulya
TelegramBot
Commits
5bdfccf4
Commit
5bdfccf4
authored
May 24, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'monolog' of
https://github.com/MBoretto/php-telegram-bot
into monolog
parents
3b517ce5
4abfd919
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
Request.php
src/Request.php
+6
-4
TelegramLog.php
src/TelegramLog.php
+3
-12
No files found.
src/Request.php
View file @
5bdfccf4
...
...
@@ -10,7 +10,6 @@
namespace
Longman\TelegramBot
;
use
Longman\TelegramBot\TelegramBot
;
use
Longman\TelegramBot\Entities\File
;
use
Longman\TelegramBot\Entities\ServerResponse
;
use
Longman\TelegramBot\Exception\TelegramException
;
...
...
@@ -177,9 +176,9 @@ class Request
}
if
(
TelegramLog
::
isDebugLogActive
())
{
$curlConfig
[
CURLOPT_VERBOSE
]
=
true
;
$verbose_curl_output
=
fopen
(
'php://temp'
,
'w+'
);
curl_setopt
(
$ch
,
CURLOPT_STDERR
,
$verbose_curl_output
);
$curlConfig
[
CURLOPT_VERBOSE
]
=
true
;
$curlConfig
[
CURLOPT_STDERR
]
=
$verbose_curl_output
;
}
curl_setopt_array
(
$ch
,
$curlConfig
);
...
...
@@ -199,10 +198,13 @@ class Request
self
::
setInputRaw
(
$result
);
}
$curl_error
=
curl_error
(
$ch
);
$curl_errno
=
curl_errno
(
$ch
);
curl_close
(
$ch
);
if
(
$result
===
false
)
{
throw
new
TelegramException
(
curl_error
(
$ch
),
curl_errno
(
$ch
)
);
throw
new
TelegramException
(
$curl_error
,
$curl_errno
);
}
if
(
empty
(
$result
)
|
is_null
(
$result
))
{
throw
new
TelegramException
(
'Empty server response'
);
...
...
src/TelegramLog.php
View file @
5bdfccf4
...
...
@@ -136,10 +136,7 @@ class TelegramLog
*/
public
static
function
isErrorLogActive
()
{
if
(
self
::
$error_log_path
===
null
)
{
return
0
;
}
return
1
;
return
(
self
::
$error_log_path
!==
null
);
}
/**
...
...
@@ -149,10 +146,7 @@ class TelegramLog
*/
public
static
function
isDebugLogActive
()
{
if
(
self
::
$debug_log_path
===
null
)
{
return
0
;
}
return
1
;
return
(
self
::
$debug_log_path
!==
null
);
}
/**
...
...
@@ -162,10 +156,7 @@ class TelegramLog
*/
public
static
function
isUpdateLogActive
()
{
if
(
self
::
$update_log_path
===
null
)
{
return
0
;
}
return
1
;
return
(
self
::
$update_log_path
!==
null
);
}
/**
...
...
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