I've got for example a watermark file: ROOT.'/media/watermarks/1.jpg'
.
In the future user can use (in some custom php template system) for example: 'watermark-filename'
, 'watermark-basename'
, , 'watermark-directory'
, etc to get needed data.
I'm trying to create some reasonable global variables names.
The question is, what does really 'basename' mean?
Terminal:
basename /path/to/source/file.ext -> "file"
PHP:
<?php
echo basename('/path/to/source/file.ext'); // file.ext
$path_parts = pathinfo('/path/to/source/file.ext');
echo $path_parts['basename']; // file.ext
?>
Wikipedia:
Many file systems, including FAT, NTFS, and VMS systems, allow a filename extension that consists of one or more characters following the last period in the filename, dividing the filename into two parts: a basename or stem and an extension or suffix used by some applications to indicate the file type.
I know Wikipedia is not a source, but according to my best knowledge, in operating systems
filename = file.ext
basename = file
extension = ext
While in php:
filename = file
basename = file.ext
extension = ext
Why?