Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WikiCommander
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
47
Issues
47
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Luke081515
WikiCommander
Commits
2fdf82e8
Commit
2fdf82e8
authored
Apr 10, 2018
by
Luke081515
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'newCygnus'
parents
859de661
cbf64840
Pipeline
#1888
failed with stages
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
59 deletions
+30
-59
WikiCommander.php
WikiCommander.php
+30
-59
No files found.
WikiCommander.php
View file @
2fdf82e8
...
...
@@ -10,69 +10,40 @@ require './Cygnus/BotCore.php';
class
WikiCommander
extends
Core
{
public
function
__construct
(
$Account
,
$Job
,
$pUseHTTPS
=
true
)
{
$this
->
initcurl
(
$Account
,
$Job
,
$pUseHTTPS
);
while
(
true
)
{
$this
->
echoMsg
(
"This is currently an alpha version. Several features may be unavailable."
,
"warning"
);
$this
->
chooseType
();
}
}
/** echoCritical
* Writes out a critical message
* Use this only for critical messages
* Prints out the message in red
*/
private
function
echoCritical
(
$msg
)
{
echo
"
\n\033
[01;31m"
.
$msg
.
"
\033
[0m"
;
}
/** echoSuccessful
* Use this only when a task was successful
* Prints out the message in green
*/
private
function
echoSuccessful
(
$msg
)
{
echo
"
\n\033
[01;32m"
.
$msg
.
"
\033
[0m"
;
}
/** echoWarning
* Writes out a warning
* Use this only for non-critical warnings
* Prints the message out in yellow
*/
private
function
echoWarning
(
$msg
)
{
echo
"
\n\033
[01;33m"
.
$msg
.
"
\033
[0m"
;
}
/** echoNotice
* Writes out a notice
* Use this only for notices, no output, no warnings/errors
* Prints the message out in blue
*/
private
function
echoNotice
(
$msg
)
{
echo
"
\n\033
[01;34m"
.
$msg
.
"
\033
[0m"
;
}
/** echoOutput
* Writes out the output of a function
* Use this only for function output
* Prints the message out in purple
*/
private
function
echoOutput
(
$msg
)
{
if
(
$msg
===
true
)
{
echo
"
\n\033
[01;35mReturned value: true
\033
[0m"
;
}
else
if
(
$msg
===
false
)
{
echo
"
\n\033
[01;35mReturned value: false
\033
[0m"
;
}
else
if
(
$msg
===
null
)
{
echo
"
\n\033
[01;35mReturned value: NULL
\033
[0m"
;
}
else
{
echo
"
\n\033
[01;35m"
.
$msg
.
"
\033
[0m"
;
public
function
chooseType
()
{
$answer
=
strtoupper
(
$this
->
ask
(
"Enter the type [P/U/?]"
,
"required"
);
switch
(
$answer
)
{
case
'P'
:
$this
->
typePage
();
break
;
case
'U'
:
$this
->
typeUser
();
break
;
case
'?'
:
default
:
$this
->
echoMsg
(
"Currently available:
\n
* P - Page
\n
* U - User"
,
"notice"
);
}
}
/** askRequired
* Asks for something
* Use this only if the answer is required
* Prints the answer in yellow
*/
private
function
askRequired
(
$msg
)
{
return
$this
->
askOperator
(
"
\n\033
[01;33m"
.
$msg
.
"
\033
[0m"
);
private
function
typePage
()
{
$answer
=
strtoupper
(
$this
->
ask
(
"Enter the type [?]"
,
"required"
);
switch
(
$answer
)
{
case
'?'
:
default
:
$this
->
echoMsg
(
"Currently not implemented yet."
,
"error"
);
}
}
/** askOptional
* Asks for something
* Use this only if the answer is optional (additional param for example)
* Prints the answer in cyan
*/
private
function
askOptional
(
$msg
)
{
return
$this
->
askOperator
(
"
\n\033
[01;36m"
.
$msg
.
"
\033
[0m"
);
private
function
typeUser
()
{
$answer
=
strtoupper
(
$this
->
ask
(
"Enter the type [?]"
,
"required"
);
switch
(
$answer
)
{
case
'?'
:
default
:
$this
->
echoMsg
(
"Currently not implemented yet."
,
"error"
);
}
}
}
$Bot
=
new
ExampleProgramm
(
'WikiCommander'
,
'WikiCommander'
);
...
...
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