From 20beb7f226ce2438d50fc8220b7701e0192dd33e Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Fri, 28 Nov 2025 16:02:37 +0000 Subject: [PATCH] Disable new packages from being created on PECL website --- public_html/package-new.php | 62 +-------------------------- templates/pages/package_new.php | 75 +-------------------------------- 2 files changed, 3 insertions(+), 134 deletions(-) diff --git a/public_html/package-new.php b/public_html/package-new.php index ee0d7b7a..61e7cfd6 100644 --- a/public_html/package-new.php +++ b/public_html/package-new.php @@ -26,64 +26,4 @@ require_once __DIR__.'/../include/pear-prepend.php'; $container->get(Auth::class)->secure(); -$errors = []; -$jumpTo = 'name'; - -if (isset($_POST['submit'])) { - $required = [ - 'name' => 'Please enter the package name.', - 'license' => 'Please choose a license type.', - 'category' => 'Please choose a category.', - 'summary' => 'Please enter the one-liner description.', - 'desc' => 'Please enter the full description.', - ]; - - foreach ($required as $field => $desc) { - if (empty($_POST[$field])) { - $errors[] = $desc; - $jumpTo = $field; - } - } - - $_POST['license'] = trim($_POST['license']); - - if ( - !strcasecmp($_POST['license'], 'GPL') - || !strcasecmp($_POST['license'], 'LGPL') - ) { - $errors[] = 'Illegal license type. PECL packages CANNOT be GPL/LGPL licensed and thus MUST NOT be linked to GPL code. Talk to pecl-dev@lists.php.net for more information.'; - $jumpTo = 'license'; - } - - if (!preg_match($container->get('valid_extension_name_regex'), $_POST['name'])) { - $errors[] = 'Invalid package name. PECL package names must start with a letter and preferably include only lowercase letters. Optionally, numbers and underscores are also allowed.'; - } - - if ($container->get(PackageRepository::class)->findOneByName($_POST['name'])) { - $errors[] = 'The '.$_POST['name'].' package already exists!'; - } - - if (0 === count($errors)) { - try { - $pkg = $packageEntity->add([ - 'name' => $_POST['name'], - 'type' => 'pecl', - 'category' => $_POST['category'], - 'license' => $_POST['license'], - 'summary' => $_POST['summary'], - 'description' => $_POST['desc'], - 'homepage' => $_POST['homepage'], - 'cvs_link' => $_POST['cvs_link'], - 'lead' => $auth_user->handle - ]); - } catch (\Exception $e) { - $errors[] = 'Error occurred.'; - } - } -} - -echo $template->render('pages/package_new.php', [ - 'categories' => $container->get(CategoryRepository::class)->findAll(), - 'jumpTo' => $jumpTo, - 'errors' => $errors, -]); +echo $template->render('pages/package_new.php', []); diff --git a/templates/pages/package_new.php b/templates/pages/package_new.php index f947052a..e2f0e081 100644 --- a/templates/pages/package_new.php +++ b/templates/pages/package_new.php @@ -2,83 +2,12 @@ start('content') ?> -

New package

insert('includes/pie.php'); ?> -

Use this form to register a new PECL package.

+

PECL has been deprecated. No new packages will be accepted onto PECL.

-

Before proceeding, make sure you pick the right name for your - package. This is usually done through community consensus, which - means posting a suggestion to the - pecl-dev@lists.php.net mailing - list and have people agree with you. -

- - - -
e($error) ?>
- - - -
-

Register a new PECL package

- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - - - - -

The package - - noHtml($_POST['name']) ?> - - has been registered in PECL.
- You have been assigned as lead developer.

- +

Please follow the instructions to add your extension to the PIE ecosystem: PIE for Extension Maintainers.

end('content') ?>