📁
SKYSHELL MANAGER
PHP v8.0.30
Create
Create
Path:
root
/
home
/
godaofbq
/
hyperxpod.com
/
wp-includes
/
Name
Size
Perm
Actions
📁
ID3
-
0555
🗑️
🏷️
🔒
📁
IXR
-
0555
🗑️
🏷️
🔒
📁
PHPMailer
-
0555
🗑️
🏷️
🔒
📁
Requests
-
0755
🗑️
🏷️
🔒
📁
SimplePie
-
0555
🗑️
🏷️
🔒
📁
Text
-
0555
🗑️
🏷️
🔒
📁
abilities-api
-
0555
🗑️
🏷️
🔒
📁
ai-client
-
0555
🗑️
🏷️
🔒
📁
assets
-
0555
🗑️
🏷️
🔒
📁
block-bindings
-
0555
🗑️
🏷️
🔒
📁
block-patterns
-
0555
🗑️
🏷️
🔒
📁
block-supports
-
0555
🗑️
🏷️
🔒
📁
blocks
-
0555
🗑️
🏷️
🔒
📁
build
-
0555
🗑️
🏷️
🔒
📁
certificates
-
0555
🗑️
🏷️
🔒
📁
css
-
0755
🗑️
🏷️
🔒
📁
customize
-
0755
🗑️
🏷️
🔒
📁
fonts
-
0755
🗑️
🏷️
🔒
📁
html-api
-
0555
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
interactivity-api
-
0555
🗑️
🏷️
🔒
📁
js
-
0555
🗑️
🏷️
🔒
📁
l10n
-
0755
🗑️
🏷️
🔒
📁
php-ai-client
-
0555
🗑️
🏷️
🔒
📁
php-compat
-
0755
🗑️
🏷️
🔒
📁
pomo
-
0755
🗑️
🏷️
🔒
📁
rest-api
-
0555
🗑️
🏷️
🔒
📁
sitemaps
-
0555
🗑️
🏷️
🔒
📁
sodium_compat
-
0755
🗑️
🏷️
🔒
📁
style-engine
-
0555
🗑️
🏷️
🔒
📁
theme-compat
-
0755
🗑️
🏷️
🔒
📁
widgets
-
0755
🗑️
🏷️
🔒
📄
abilities-api.php
23.8 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
abilities.php
7.82 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
admin-bar.php
38.39 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
admin.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
atomlib.php
11.9 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
author-template.php
19.38 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
block-template.php
17.83 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
blocks.php
116.64 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
bookmark-template.php
12.47 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
bookmark.php
15.29 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
cache-compat.php
10.76 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
canonical.php
34.18 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
capabilities.php
42.61 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
category.php
12.92 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
class-feed.php
0.53 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-phpass.php
6.61 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-phpmailer.php
0.65 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-pop3.php
20.63 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-requests.php
2.18 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-simplepie.php
0.44 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-smtp.php
0.45 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-walker-nav-menu.php
11.76 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-walker-page-dropdown.php
2.65 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-walker-page.php
7.43 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-admin-bar.php
17.58 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-ajax-response.php
5.14 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-application-passwords.php
16.7 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-bindings-registry.php
8.07 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-bindings-source.php
2.92 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-editor-context.php
1.32 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-list.php
4.6 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-parser-block.php
2.5 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-parser-frame.php
1.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-pattern-categories-registry.php
4.28 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-processor.php
68.32 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-supports.php
6.4 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-template.php
1.99 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-templates-registry.php
6.91 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-type-registry.php
4.91 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block-type.php
16.83 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-block.php
24.14 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-comment-query.php
47.49 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-customize-manager.php
198.13 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-customize-nav-menus.php
56.61 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-customize-setting.php
29.26 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-date-query.php
35.13 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-dependency.php
2.59 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-duotone.php
39.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-embed.php
15.54 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-exception.php
0.48 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-fatal-error-handler.php
7.96 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-feed-cache-transient.php
3.23 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-hook.php
16.25 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-http-cookie.php
7.1 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-http-curl.php
12.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-http-ixr-client.php
3.43 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-http-requests-hooks.php
1.97 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-http-response.php
2.91 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-icons-registry.php
7.67 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-list-util.php
7.27 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-locale-switcher.php
6.62 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-locale.php
16.45 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-matchesmapregex.php
1.79 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-meta-query.php
29.79 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-metadata-lazyloader.php
6.67 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-navigation-fallback.php
8.98 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-network-query.php
19.25 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-network.php
12.01 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-object-cache.php
17.11 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-oembed-controller.php
6.74 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-oembed.php
30.86 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-paused-extensions-storage.php
4.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-phpmailer.php
4.25 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-plugin-dependencies.php
24.59 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-post-type.php
29.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-post.php
6.33 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-query.php
159.73 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-recovery-mode.php
11.18 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-rewrite.php
62.2 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-roles.php
9.1 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-scripts.php
35.93 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-session-tokens.php
7.15 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-simplepie-file.php
3.47 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-site-query.php
30.74 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-speculation-rules.php
7.38 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-styles.php
13.04 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-tax-query.php
19.12 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-taxonomy.php
18.12 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-term-query.php
39.8 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-term.php
5.14 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-text-diff-renderer-table.php
18.49 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-theme-json-data.php
1.77 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-theme-json-resolver.php
34.86 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-theme-json-schema.php
7.19 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-theme-json.php
169.57 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-theme.php
64.22 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-token-map.php
27.95 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-url-pattern-prefixer.php
4.69 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-user-query.php
43.07 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-user.php
22.48 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-walker.php
13.01 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-widget-factory.php
3.27 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp-xmlrpc-server.php
209.98 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wp.php
26.01 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
class-wpdb.php
115.86 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
compat-utf8.php
19.1 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
connectors.php
23.52 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
core.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
cron.php
44.18 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
date.php
0.39 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
default-constants.php
11.35 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
default-filters.php
36.8 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
default-widgets.php
2.24 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
deprecated.php
189.43 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
embed-template.php
0.33 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
error-protection.php
4.25 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
error_log
17.4 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
feed-atom-comments.php
5.38 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
feed-atom.php
3.05 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
feed-rss.php
1.16 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
feed-rss2-comments.php
4.04 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
feed-rss2.php
3.71 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
feed.php
24.6 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
fonts.php
9.94 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
formatting.php
346.87 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
functions.php
283.77 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
functions.wp-scripts.php
20.01 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
functions.wp-styles.php
8.45 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
general-template.php
170.83 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
global-styles-and-settings.php
20.29 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
l10n.php
69.74 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
link-template.php
156.39 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
load.php
55.41 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
media-template.php
61.79 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
meta.php
65.17 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
ms-default-filters.php
6.48 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
ms-deprecated.php
21.24 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
ms-files.php
2.79 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
ms-network.php
3.69 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
ms-site.php
40.75 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
option.php
102.62 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
post-formats.php
6.9 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
post-template.php
67.01 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
post.php
289.58 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
query.php
36.23 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
rest-api.php
98.84 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
rewrite.php
19.36 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
robots-template.php
5.06 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
rss.php
22.66 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
session.php
0.25 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
shortcodes.php
23.47 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
sitemaps.php
3.16 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
speculative-loading.php
8.4 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
spl-autoload-compat.php
0.43 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
taxonomy.php
173.37 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
template-canvas.php
0.53 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
theme-i18n.json
1.85 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
theme-previews.php
2.82 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
theme-templates.php
3.96 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
theme.json
8.83 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
update.php
37.38 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
user.php
175.64 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
vars.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
version.php
1.32 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
view-transitions.php
0.59 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
widgets.php
69.17 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-blog-header.php
9.57 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-cron.php
2.74 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-db.php
0.43 KB
0755
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-settings.php
7.11 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
xmlrpc.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: migrate_local_ini_to_php_ini
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/migrate_local_ini_to_php_ini Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited package scripts::migrate_local_ini_to_php_ini; use strict; use warnings; use Try::Tiny; use Getopt::Param::Tiny (); use Cpanel::ProgLang (); use Cpanel::FileUtils::Write (); use Cpanel::LoadFile (); my %ignore_directives = ( "session.bug_compat_42" => 1, "sybct.allow_persistent" => 1, "sybct.max_links" => 1, "sybct.min_client_severity" => 1, "session.bug_compat_warn" => 1, "sybct.min_server_severity" => 1, "sybct.max_persistent" => 1, "ifx.default_host" => 1, "ifx.default_user" => 1, "ifx.default_password" => 1, "ifx.allow_persistent" => 1, "ifx.max_persistent" => 1, "ifx.max_links" => 1, "ifx.textasvarchar" => 1, "ifx.byteasvarchar" => 1, "ifx.charasvarchar" => 1, "ifx.blobinfile" => 1, "ifx.nullformat" => 1, ); exit( run(@ARGV) ? 0 : 1 ) unless caller; sub run { my @args = @_; my $prm = Getopt::Param::Tiny->new( { array_ref => \@args, help_coderef => \&_help, known_only => [ 'run', 'verbose' ], no_args_help => 1, validate => \&_validate } ); my $php = eval { Cpanel::ProgLang->new( type => 'php' ) }; my @installed = $php ? @{ $php->get_installed_packages() } : (); if ( !$php || !@installed ) { print "Nothing to do, no PHP packages installed.\n"; return 1; } my $error_count = 0; for my $php_pkg (@installed) { print "Processing $php_pkg …\n"; my $ini = $php->get_ini( 'package' => $php_pkg ); my $localini = $ini->get_system_ini('local.ini'); my $phpini = $ini->get_default_system_ini(); if ( !$localini ) { print "\tNo local.ini.\n"; } else { my $bad_tries = 0; my %bad_directives; TRY_INI: try { _migrate_extension_directives( $localini, $phpini ); # See EA-6768 for why this hack is necessary my $valid_directive_info_hr = $ini->get_valid_directive_info(); my $local_directives_meta_hr = $ini->get_basic_php_directives_from_file( path => $localini, all => 1 ); my $local_directives_hr = { map { $_ !~ m/^\s*;/ && !exists $bad_directives{$_} && !exists $ignore_directives{$_} ? ( $_ => $local_directives_meta_hr->{$_}{value} ) : () } keys %{$local_directives_meta_hr} }; for my $k ( keys %{$local_directives_hr} ) { # Hack to avoid: The PHP directive “…” is not formatted correctly: “O…”. next if !$valid_directive_info_hr->{$k} || !$valid_directive_info_hr->{$k}{type} || ( $valid_directive_info_hr->{$k}{type} ne 'boolean' && $valid_directive_info_hr->{$k}{type} ne 'integer' ); $local_directives_hr->{$k} = 0 if $local_directives_hr->{$k} =~ m/^off$/i; $local_directives_hr->{$k} = 1 if $local_directives_hr->{$k} =~ m/^on$/i; } if ( keys %{$local_directives_hr} > 0 ) { $ini->set_directives( path => $phpini, directives => $local_directives_hr ); } unlink $localini; # TODO/YAGNI? move it to $localini.migrated_to_php.ini_on_$rfc8601_datetimestamp print "\tMigrated $localini to $phpini.\n"; } catch { my $err = $_; my $try_again = 0; for my $excp ( $err, ( exists $err->{_metadata}{exceptions} ? @{ $err->{_metadata}{exceptions} } : () ) # internals gross, patches welcome … ) { my $invalid_param = _get_invalid_param($excp); if ($invalid_param) { $bad_tries++; if ( $bad_tries < 6 ) { warn "\tIgnoring invalid directive “$invalid_param”\n"; $bad_directives{$invalid_param}++; $try_again++; } } } goto TRY_INI if $try_again; $error_count++; warn "\tFailed to migrate $localini to $phpini. This will need done manually.\n"; if ( $prm->param('verbose') ) { my $err_str = ref($err) ? $err->to_string() : $err; $err_str =~ s/^Error #/\t\tError #/mg; print "\tError: $err_str\n"; } } } print " … done!\n"; } return if $error_count; return 1; } ############### #### helpers ## ############### sub _get_invalid_param { my ($excp) = @_; my $excp_rt = ref($excp) || ''; if ( $excp_rt eq 'Cpanel::Exception::InvalidParameter' ) { return $excp->{_mt_args}[1]; # internals gross, patches welcome … } return; } sub _validate { my ($prm) = @_; if ( !$prm->param('run') ) { warn "You must pass --run to indicate you want the script to make the changes to your system.\n"; return; } return 1; } sub _help { my ($prm) = @_; print <<"END_HELP"; Usage: $0 --run Migrate each installed PHP’s …/etc/php.d/local.ini to …/etc/php.ini. This is needed because EasyAapache 4 no longer utilizes local.ini file. Options: --help this screen --run perform the migration --verbose Enable verbose output END_HELP exit( $prm->param('help') ? 0 : 1 ); } sub _migrate_extension_directives { # See EA-6768 for why this hack is necessary my ( $localini, $phpini ) = @_; # 1. grab all extension directives from $localini my @localini_cont = @{ Cpanel::LoadFile::loadfileasarrayref($localini) }; # could get undef if the file disappears after the check that then calls this function and here, in that case an unit warning is OK and not worth making what should be a simple slurp any more complicated than our gross file utils are already making it return 1 if !@localini_cont; $localini_cont[-1] .= "\n" if substr( $localini_cont[-1], -1, 1 ) ne "\n"; # ensure trailing newline on last line my @extensions = grep { m/^\s*extension\s*=/ } @localini_cont; if (@extensions) { # 2. write them to $phpini my @phpini_cont = @{ Cpanel::LoadFile::loadfileasarrayref($phpini) }; # see comment above about why checking for undef is not really needed here Cpanel::FileUtils::Write::overwrite( $phpini, join( "", @extensions, @phpini_cont ), ( stat($phpini) )[2] ); # yes, it takes a string for the content and if we don't pass the current mode it is re-set to a default /facepalm # 3. remove them from $localini Cpanel::FileUtils::Write::overwrite( $localini, join( "", grep( !m/\s*extension\s*=/, @localini_cont ) ), ( stat($localini) )[2] ); # yes, it takes a string for the content and if we don't pass the current mode it is re-set to a default /facepalm } return 1; } 1;
Save