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
4abfd919
Commit
4abfd919
authored
May 25, 2016
by
Marco Boretto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from noplanman/monolog_fixes
A few suggestions
parents
d6362448
7cf99e65
Changes
2
Hide 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 @
4abfd919
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
namespace
Longman\TelegramBot
;
namespace
Longman\TelegramBot
;
use
Longman\TelegramBot\TelegramBot
;
use
Longman\TelegramBot\Entities\File
;
use
Longman\TelegramBot\Entities\File
;
use
Longman\TelegramBot\Entities\ServerResponse
;
use
Longman\TelegramBot\Entities\ServerResponse
;
use
Longman\TelegramBot\Exception\TelegramException
;
use
Longman\TelegramBot\Exception\TelegramException
;
...
@@ -177,9 +176,9 @@ class Request
...
@@ -177,9 +176,9 @@ class Request
}
}
if
(
TelegramLog
::
isDebugLogActive
())
{
if
(
TelegramLog
::
isDebugLogActive
())
{
$curlConfig
[
CURLOPT_VERBOSE
]
=
true
;
$verbose_curl_output
=
fopen
(
'php://temp'
,
'w+'
);
$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
);
curl_setopt_array
(
$ch
,
$curlConfig
);
...
@@ -199,10 +198,13 @@ class Request
...
@@ -199,10 +198,13 @@ class Request
self
::
setInputRaw
(
$result
);
self
::
setInputRaw
(
$result
);
}
}
$curl_error
=
curl_error
(
$ch
);
$curl_errno
=
curl_errno
(
$ch
);
curl_close
(
$ch
);
curl_close
(
$ch
);
if
(
$result
===
false
)
{
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
))
{
if
(
empty
(
$result
)
|
is_null
(
$result
))
{
throw
new
TelegramException
(
'Empty server response'
);
throw
new
TelegramException
(
'Empty server response'
);
...
...
src/TelegramLog.php
View file @
4abfd919
...
@@ -136,10 +136,7 @@ class TelegramLog
...
@@ -136,10 +136,7 @@ class TelegramLog
*/
*/
public
static
function
isErrorLogActive
()
public
static
function
isErrorLogActive
()
{
{
if
(
self
::
$error_log_path
===
null
)
{
return
(
self
::
$error_log_path
!==
null
);
return
0
;
}
return
1
;
}
}
/**
/**
...
@@ -149,10 +146,7 @@ class TelegramLog
...
@@ -149,10 +146,7 @@ class TelegramLog
*/
*/
public
static
function
isDebugLogActive
()
public
static
function
isDebugLogActive
()
{
{
if
(
self
::
$debug_log_path
===
null
)
{
return
(
self
::
$debug_log_path
!==
null
);
return
0
;
}
return
1
;
}
}
/**
/**
...
@@ -162,10 +156,7 @@ class TelegramLog
...
@@ -162,10 +156,7 @@ class TelegramLog
*/
*/
public
static
function
isUpdateLogActive
()
public
static
function
isUpdateLogActive
()
{
{
if
(
self
::
$update_log_path
===
null
)
{
return
(
self
::
$update_log_path
!==
null
);
return
0
;
}
return
1
;
}
}
/**
/**
...
...
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