Skip to content

Commit 44952cd

Browse files
committed
Add extensions naming conventions to ext_skel.php
- first character is a letter - followed by any number of letters, numbers, or underscores - prefferred are lower case letters
1 parent 63e43e1 commit 44952cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/ext_skel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ function process_args($argv, $argc) {
226226
error('The skeleton directory was not found');
227227
}
228228

229+
// Validate extension name
230+
if (!preg_match('/^[a-z][a-z0-9_]+$/i', $options['ext'])) {
231+
error('Invalid extension name. Valid names start with a letter,'
232+
.' followed by any number of letters, numbers, or underscores.'
233+
.' Using only lower case letters is preferred.');
234+
}
235+
229236
$options['ext'] = str_replace(['\\', '/'], '', strtolower($options['ext']));
230237

231238
return $options;

0 commit comments

Comments
 (0)