verot / class.upload.php

This PHP class uploads files and manipulates images very easily. It is in fact as much as an image processing class than it is an upload class. Compatible with PHP 4, 5, 7 and 8. Supports processing of local files, uploaded files, files sent through XMLHttpRequest.
http://www.verot.net/php_class_upload.htm
GNU General Public License v2.0
847 stars 358 forks source link

fix spelling of function calls and classes in source and website #103

Closed peterdd closed 5 years ago

peterdd commented 5 years ago

The spelling of some functions is inconsistent. Even if PHP tolerates this, it should be consistent within the project and related websites.

For example on:

https://www.verot.net/php_class_upload.htm
https://www.verot.net/php_class_upload_faq.htm

Here some findings for process() in the current source:

grep -rn '>Process(' *
README.md:141:echo $handle->Process();
README.md:151:echo $handle->Process();
test/upload.php:81:        // It could be something like $handle->Process('/home/www/my_uploads/');
test/upload.php:82:        $handle->Process($dir_dest);
test/upload.php:124:        $handle->Process($dir_dest);
test/upload.php:174:        // It could be something like $handle->Process('/home/www/my_uploads/');
test/upload.php:175:        $handle->Process($dir_dest);
test/upload.php:202:        $handle->Process($dir_dest);
test/upload.php:260:        // It could be something like $handle->Process('/home/www/my_uploads/');
test/upload.php:261:        $handle->Process($dir_dest);
test/upload.php:318:            // It could be something like $handle->Process('/home/www/my_uploads/');
test/upload.php:319:            $handle->Process($dir_dest);
test/upload.php:367:            $handle->Process($dir_dest);

Here for clean(), where also the space is a bit odd:

grep -rn 'Clean(' *
test/upload.php:101:        $handle-> Clean();
test/upload.php:143:        $handle-> Clean();
test/upload.php:223:        $handle-> Clean();
test/upload.php:280:        $handle-> Clean();

The class upload is currently lowercase:

grep -rn 'Upload(' *
test/upload.php:72:    $handle = new Upload($_FILES['my_field']);
test/upload.php:118:    $handle = new Upload((isset($_POST['my_field']) ? $_POST['my_field'] : (isset($_GET['file']) ? $_GET['file'] : '')));
test/upload.php:160:    $handle = new Upload($_FILES['my_field']);
test/upload.php:244:        $handle = new Upload('php:'.$_SERVER['HTTP_X_FILE_NAME']);
test/upload.php:250:        $handle = new Upload($_FILES['my_field']);
test/upload.php:310:        $handle = new Upload($file);
test/upload.php:356:    $handle = new Upload((isset($_POST['my_field']) ? $_POST['my_field'] : (isset($_GET['file']) ? $_GET['file'] : '')));
verot commented 5 years ago

Thank you, this is fixed in a9a9d586