Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aaPanel
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
aaPanel
Commits
72f2bd58
Commit
72f2bd58
authored
Jul 03, 2019
by
jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust the directory deletion process
parent
8efb4bb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
plugin_deployment.py
class/plugin_deployment.py
+7
-4
No files found.
class/plugin_deployment.py
View file @
72f2bd58
...
...
@@ -167,10 +167,11 @@ class plugin_deployment:
#取本地包信息
def
GetPackageOther
(
self
,
get
):
p_name
=
get
.
p_name
jsonFile
=
self
.
__setupPath
+
'/deployment_list_other.json'
;
if
not
os
.
path
.
exists
(
jsonFile
):
public
.
returnMsg
(
False
,
'could not find [
%
s]'
%
p_name
)
data
=
json
.
loads
(
public
.
readFile
(
jsonFile
));
p_name
=
get
.
p_name
for
i
in
range
(
len
(
data
)):
if
data
[
i
][
'name'
]
==
p_name
:
return
data
[
i
]
return
public
.
returnMsg
(
False
,
'could not find [
%
s]'
%
p_name
)
...
...
@@ -276,7 +277,7 @@ class plugin_deployment:
self
.
WriteLogs
(
json
.
dumps
({
'name'
:
'Setting permissions'
,
'total'
:
0
,
'used'
:
0
,
'pre'
:
0
,
'speed'
:
0
}));
os
.
system
(
'chmod -R 755 '
+
path
);
os
.
system
(
'chown -R www.www '
+
path
);
if
pinfo
[
'chmod'
]
!=
""
:
if
pinfo
[
'chmod'
]:
for
chm
in
pinfo
[
'chmod'
]:
os
.
system
(
'chmod -R '
+
str
(
chm
[
'mode'
])
+
' '
+
(
path
+
'/'
+
chm
[
'path'
])
.
replace
(
'//'
,
'/'
));
...
...
@@ -284,7 +285,7 @@ class plugin_deployment:
self
.
WriteLogs
(
json
.
dumps
({
'name'
:
'Install the necessary PHP extensions'
,
'total'
:
0
,
'used'
:
0
,
'pre'
:
0
,
'speed'
:
0
}));
import
files
mfile
=
files
.
files
();
pinfo
[
'php_ext'
]
=
pinfo
[
'php_ext'
]
.
strip
()
.
split
(
','
)
if
type
(
pinfo
[
'php_ext'
])
==
str
:
pinfo
[
'php_ext'
]
=
pinfo
[
'php_ext'
]
.
strip
()
.
split
(
','
)
for
ext
in
pinfo
[
'php_ext'
]:
if
ext
==
'pathinfo'
:
import
config
...
...
@@ -301,6 +302,7 @@ class plugin_deployment:
#解禁PHP函数
if
'enable_functions'
in
pinfo
:
try
:
if
type
(
pinfo
[
'enable_functions'
])
==
str
:
pinfo
[
'enable_functions'
]
=
pinfo
[
'enable_functions'
]
.
strip
()
.
split
(
','
)
php_f
=
public
.
GetConfigValue
(
'setup_path'
)
+
'/php/'
+
php_version
+
'/etc/php.ini'
php_c
=
public
.
readFile
(
php_f
)
rep
=
"disable_functions
\
s*=
\
s{0,1}(.*)
\n
"
...
...
@@ -319,7 +321,7 @@ class plugin_deployment:
#执行额外shell进行依赖安装
self
.
WriteLogs
(
json
.
dumps
({
'name'
:
'Execute extra SHELL'
,
'total'
:
0
,
'used'
:
0
,
'pre'
:
0
,
'speed'
:
0
}));
if
os
.
path
.
exists
(
path
+
'/install.sh'
):
os
.
system
(
'cd '
+
path
+
' && bash '
+
'install.sh '
+
find
[
'name'
]);
os
.
system
(
'cd '
+
path
+
' && bash '
+
'install.sh '
+
find
[
'name'
]
+
" &> install.log"
);
os
.
system
(
'rm -f '
+
path
+
'/install.sh'
)
#是否执行Composer
...
...
@@ -381,6 +383,7 @@ class plugin_deployment:
#清理文件和目录
self
.
WriteLogs
(
json
.
dumps
({
'name'
:
'清理多余的文件'
,
'total'
:
0
,
'used'
:
0
,
'pre'
:
0
,
'speed'
:
0
}));
if
type
(
pinfo
[
'remove_file'
])
==
str
:
pinfo
[
'remove_file'
]
=
pinfo
[
'remove_file'
]
.
strip
()
.
split
(
','
)
for
f_path
in
pinfo
[
'remove_file'
]:
filename
=
(
path
+
'/'
+
f_path
)
.
replace
(
'//'
,
'/'
)
if
os
.
path
.
exists
(
filename
):
...
...
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