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
8d5d3435
Commit
8d5d3435
authored
Jul 31, 2015
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed namespace bug for external commands
parent
f83b2b2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Telegram.php
src/Telegram.php
+5
-5
No files found.
src/Telegram.php
View file @
8d5d3435
...
...
@@ -405,14 +405,15 @@ class Telegram
$command
=
$this
->
sanitizeCommand
(
$command
);
$class_name
=
ucfirst
(
$command
)
.
'Command'
;
$class_name_space
=
__NAMESPACE__
.
'\\Commands\\'
.
$class_name
;
foreach
(
$this
->
commands_dir
as
$dir
)
{
if
(
is_file
(
$dir
.
'/'
.
$class_name
.
'.php'
))
{
require_once
(
$dir
.
'/'
.
$class_name
.
'.php'
);
if
(
!
class_exists
(
$class_name
))
{
if
(
!
class_exists
(
$class_name
_space
))
{
continue
;
}
$class
=
new
$class_name
(
$this
);
$class
=
new
$class_name
_space
(
$this
);
if
(
!
empty
(
$update
))
{
$class
->
setUpdate
(
$update
);
...
...
@@ -422,9 +423,8 @@ class Telegram
}
}
$class_name
=
__NAMESPACE__
.
'\\Commands\\'
.
$class_name
;
if
(
class_exists
(
$class_name
))
{
$class
=
new
$class_name
(
$this
);
if
(
class_exists
(
$class_name_space
))
{
$class
=
new
$class_name_space
(
$this
);
if
(
!
empty
(
$update
))
{
$class
->
setUpdate
(
$update
);
}
...
...
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