Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
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
Anthony.Suerte
iwl-live
Commits
7071368f
Commit
7071368f
authored
Sep 19, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Library Composing Tool
parent
e55bed4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
DevTools.php
system/api/dev/DevTools.php
+49
-0
No files found.
system/api/dev/DevTools.php
View file @
7071368f
...
@@ -298,6 +298,51 @@ class DevTools extends DevComponents {
...
@@ -298,6 +298,51 @@ class DevTools extends DevComponents {
}
}
}
}
private
function
composing
(){
$composerSettings
=
$this
->
getDevSetting
(
"composer_conf"
);
$settingValue
=
$this
->
getColumnData
(
$composerSettings
,
"dev_setting_value"
);
if
(
$this
->
isJSON
(
$settingValue
))
$composerSettings
=
json_decode
(
$settingValue
);
$extDir
=
SITE_ROOT
.
"system/lib/ext/"
;
$pharCreation
=
false
;
$pharInstallationLog
=
[];
chdir
(
$extDir
);
if
(
@
file_exists
(
$extDir
)){
if
(
!@
file_exists
(
"composer.phar"
)){
copy
(
"https://getcomposer.org/installer"
,
"composer-setup.php"
);
if
(
hash_file
(
"sha384"
,
"composer-setup.php"
)
==
$composerSettings
->
hashed_file_key
){
exec
(
"php composer-setup.php"
,
$pharInstallationLog
);
unlink
(
"composer-setup.php"
);
if
(
@
file_exists
(
"composer.phar"
))
$pharCreation
=
"Installed."
;
}
else
{
$pharCreation
=
"Corrupted"
;
unlink
(
"composer-setup.php"
);
}
}
$output
=
[];
$returnCode
=
-
VAL_INT_1
;
exec
(
"php composer.phar
{
$this
->
decodedPayload
->
cstring
}
2>&1"
,
$output
,
$returnCode
);
$commandOutput
=
[
"pharOut"
=>
$pharCreation
,
"pharInstallationLog"
=>
$pharInstallationLog
,
"code"
=>
$returnCode
,
"output"
=>
$output
];
echo
json_encode
(
$commandOutput
);
}
}
public
function
listen
(){
public
function
listen
(){
switch
(
$this
->
decodedPayload
->
purpose
){
switch
(
$this
->
decodedPayload
->
purpose
){
case
"authentication"
:
{
case
"authentication"
:
{
...
@@ -312,6 +357,10 @@ class DevTools extends DevComponents {
...
@@ -312,6 +357,10 @@ class DevTools extends DevComponents {
$this
->
settingsPurpose
();
$this
->
settingsPurpose
();
break
;
break
;
}
}
case
"composer"
:
{
$this
->
composing
();
break
;
}
default
:
{
default
:
{
echo
json_encode
([
echo
json_encode
([
"code"
=>
"W01"
,
"code"
=>
"W01"
,
...
...
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