Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
S
sidekick
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
Privat - Marco Schmiedel
sidekick
Commits
7cc44f02
Commit
7cc44f02
authored
Dec 20, 2021
by
Marco Schmiedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautified some scripts...
parent
345f746c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1227 additions
and
78 deletions
+1227
-78
BashColorDemoCommand.php
src/Commands/BashColorDemoCommand/BashColorDemoCommand.php
+50
-10
CodebeautifierCommand.php
src/Commands/CodebeautifierCommand/CodebeautifierCommand.php
+941
-2
Template.tpl
src/Commands/CodebeautifierCommand/Template.tpl
+27
-0
TerminalManager.php
src/Managers/TerminalManager/TerminalManager.php
+115
-49
CommandServiceProvider.php
...oviders/CommandServiceProvider/CommandServiceProvider.php
+45
-7
CoreServiceProvider.php
src/Providers/CoreServiceProvider.php
+49
-10
No files found.
src/Commands/BashColorDemoCommand/BashColorDemoCommand.php
View file @
7cc44f02
<?php
namespace
Ceetrox\Commands\BashColorDemoCommand
;
use
Illuminate\Console\Command
;
use
Ceetrox\Managers\TerminalManager\TerminalManager
;
// This provider implements all artisan commands of sidekick and is triggered by the core provider.
class
BashColorDemoCommand
extends
Command
{
public
function
__construct
()
{
/*
|------------------------------------------------------------------------------------------------
| Information
|------------------------------------------------------------------------------------------------
|
| This file is beautified by the command "sidekick:CodebeautifierCommand" of the ceetrox
| sidekick package.
|
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Date: 2021-12-20 15:08:24
|
*/
namespace
Ceetrox\Commands\BashColorDemoCommand
;
/*
|------------------------------------------------------------------------------------------------
| Dependencies
|------------------------------------------------------------------------------------------------
*/
use
Ceetrox\Managers\TerminalManager\TerminalManager
;
use
Illuminate\Console\Command
;
/*
|------------------------------------------------------------------------------------------------
| Class "BashColorDemoCommand"
|------------------------------------------------------------------------------------------------
*/
class
BashColorDemoCommand
extends
Command
{
/*
|--------------------------------------------------------------------------------------------
| Method "__construct"
|--------------------------------------------------------------------------------------------
*/
public
function
__construct
()
{
$this
->
signature
=
'sidekick:BashColorDemoCommand'
;
$this
->
description
=
TerminalManager
::
brightBlue
(
"This command returns all available colors of the terminal manager."
);
parent
::
__construct
();
}
/*
|--------------------------------------------------------------------------------------------
| Method "handle"
|--------------------------------------------------------------------------------------------
*/
public
function
handle
()
{
$this
->
info
(
TerminalManager
::
demo
()
);
}
}
}
src/Commands/CodebeautifierCommand/CodebeautifierCommand.php
View file @
7cc44f02
This diff is collapsed.
Click to expand it.
src/Commands/CodebeautifierCommand/Template.tpl
0 → 100644
View file @
7cc44f02
<
?
php
/*
|
------------------------------------------------------------------------------------------------
|
Information
|
------------------------------------------------------------------------------------------------
|
|
This
file
is
beautified
by
the
command
"
sidekick:CodebeautifierCommand
"
of
the
ceetrox
|
sidekick
package
.
|
|
Author:
%
author
%
|
Date:
%
timestasmp
%
|
*/
%
namespace
%
/*
|
------------------------------------------------------------------------------------------------
|
Dependencies
|
------------------------------------------------------------------------------------------------
*/
%
relations
%
%
classes
%
src/Managers/TerminalManager/TerminalManager.php
View file @
7cc44f02
<?php
/* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ *\
|◦ Namespaces
\* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ */
/*
|------------------------------------------------------------------------------------------------
| Information
|------------------------------------------------------------------------------------------------
|
| This file is beautified by the command "sidekick:CodebeautifierCommand" of the ceetrox
| sidekick package.
|
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Date: 2021-12-20 15:21:14
|
*/
namespace
Ceetrox\Managers\TerminalManager
;
/* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ */
class
TerminalManager
/*
|------------------------------------------------------------------------------------------------
| Dependencies
|------------------------------------------------------------------------------------------------
*/
/*
|------------------------------------------------------------------------------------------------
| Class "TerminalManager"
|------------------------------------------------------------------------------------------------
*/
class
TerminalManager
{
/*
|--------------------------------------------------------------------------------------------
| Method "brightBlue"
|--------------------------------------------------------------------------------------------
*/
static
function
brightBlue
(
$text
)
{
return
TerminalManager
::
brightColor
(
$text
,
33
);
}
/*
|--------------------------------------------------------------------------------------------
| Method "darkColor"
|--------------------------------------------------------------------------------------------
| This method generates the dark color palette.
*/
static
function
darkColor
(
$text
,
$color
)
{
return
"\e[0m"
.
"\e[48;5;234m"
.
"\e[38;5;"
.
$color
.
"m"
.
$text
.
"\e[0m"
;
}
/*
|--------------------------------------------------------------------------------------------
| Method "brightColor"
|--------------------------------------------------------------------------------------------
| This method generates the bright color palette.
*/
static
function
brightColor
(
$text
,
$color
)
{
return
"\e[0m"
.
"\e[38;5;16m"
.
"\e[48;5;"
.
$color
.
"m"
.
$text
.
"\e[0m"
;
}
/*
|--------------------------------------------------------------------------------------------
| Method "demo"
|--------------------------------------------------------------------------------------------
| This method generates all available terminal colors for a demo output.
*/
static
function
demo
()
{
/*
|----------------------------------------------------------------------------------------
| Create an empty string for all upcoming colors...
*/
$text
=
"
\n
"
;
/*
|----------------------------------------------------------------------------------------
| Create counter value...
*/
$i1
=
16
;
while
(
$i1
<
52
)
{
$i2
=
$i1
+
36
;
$i3
=
$i2
+
36
;
$i4
=
$i3
+
36
;
$i5
=
$i4
+
36
;
$i6
=
$i5
+
36
;
$i7
=
$i6
+
36
;
if
(
$i7
>
250
)
{
$i7
=
$i7
-
251
;
}
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
$text
.=
"
\n
"
;
/*
|----------------------------------------------------------------------------------------
| Loop counter value within the color range...
*/
while
(
$i1
<
52
)
{
/*
|------------------------------------------------------------------------------------
| Calculate 7 columns per line...
*/
$i1
=
$i1
;
$i2
=
$i1
+
36
;
$i3
=
$i2
+
36
;
$i4
=
$i3
+
36
;
$i5
=
$i4
+
36
;
$i6
=
$i5
+
36
;
$i7
=
$i6
+
36
;
if
(
$i7
>
250
)
{
$i7
=
$i7
-
251
;
}
/*
|------------------------------------------------------------------------------------
| Calculate for bright and dark...
*/
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
/*
|------------------------------------------------------------------------------------
| Add linebreak...
*/
$text
.=
"
\n
"
;
/*
|------------------------------------------------------------------------------------
| Add value to counter...
*/
$i1
+=
1
;
}
return
$text
;
$i1
+=
1
;
}
return
$text
;
}
}
}
src/Providers/CommandServiceProvider/CommandServiceProvider.php
View file @
7cc44f02
<?php
namespace
Ceetrox\Providers\CommandServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
// This provider implements all artisan commands of sidekick and is triggered by the core provider.
class
CommandServiceProvider
extends
ServiceProvider
{
public
function
register
()
/*
|------------------------------------------------------------------------------------------------
| Information
|------------------------------------------------------------------------------------------------
|
| This file is beautified by the command "sidekick:CodebeautifierCommand" of the ceetrox
| sidekick package.
|
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Date: 2021-12-20 15:22:21
|
*/
namespace
Ceetrox\Providers\CommandServiceProvider
;
/*
|------------------------------------------------------------------------------------------------
| Dependencies
|------------------------------------------------------------------------------------------------
*/
use
Illuminate\Support\ServiceProvider
;
/*
|------------------------------------------------------------------------------------------------
| Class "CommandServiceProvider"
|------------------------------------------------------------------------------------------------
| This provider implements all artisan commands of sidekick and is triggered by the core
| provider.
*/
class
CommandServiceProvider
extends
ServiceProvider
{
/*
|--------------------------------------------------------------------------------------------
| Method "register"
|--------------------------------------------------------------------------------------------
*/
public
function
register
()
{
$this
->
commands
(
'Ceetrox\Commands\CodebeautifierCommand\CodebeautifierCommand'
);
$this
->
commands
(
'Ceetrox\Commands\BashColorDemoCommand\BashColorDemoCommand'
);
}
}
}
src/Providers/CoreServiceProvider.php
View file @
7cc44f02
<?php
namespace
Ceetrox\Providers
;
use
Illuminate\Support\ServiceProvider
;
use
Ceetrox\Providers\CommandServiceProvider\CommandServiceProvider
;
/*
|------------------------------------------------------------------------------------------------
| Information
|------------------------------------------------------------------------------------------------
|
| This file is beautified by the command "sidekick:CodebeautifierCommand" of the ceetrox
| sidekick package.
|
| Author: Marco Schmiedel <marco.schmiedel@itmax.email>
| Date: 2021-12-20 15:21:50
|
*/
namespace
Ceetrox\Providers
;
// This provider implements the core system of sidekick.
class
CoreServiceProvider
extends
ServiceProvider
{
public
function
register
()
/*
|------------------------------------------------------------------------------------------------
| Dependencies
|------------------------------------------------------------------------------------------------
*/
use
Ceetrox\Providers\CommandServiceProvider\CommandServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
/*
|------------------------------------------------------------------------------------------------
| Class "CoreServiceProvider"
|------------------------------------------------------------------------------------------------
| This provider implements the core system of sidekick.
*/
class
CoreServiceProvider
extends
ServiceProvider
{
// Register the artisan command service provider.
app
()
->
register
(
new
CommandServiceProvider
(
app
()
)
);
/*
|--------------------------------------------------------------------------------------------
| Method "register"
|--------------------------------------------------------------------------------------------
*/
public
function
register
()
{
/*
|----------------------------------------------------------------------------------------
| Register the artisan command service provider.
*/
app
()
->
register
(
new
CommandServiceProvider
(
app
()
)
);
}
}
}
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