src/fs/entity/FileEntity.php
public function splitName(string $defaultExtension = ""): array
    {
        $filename = basename($this->path);
        $extpos = strrpos($filename, ".");
        if ($extpos === false || $extpos === 0) {
            $name = $filename;
            $ext = $defaultExtension;
        }
        else {
            $name = substr($filename, 0, $extpos);
            $ext = substr($filename, $extpos + 1);
        }
        return [$name, $ext];
    }
public function splitName(string $defaultExtension = ""): array
    {
        $filename = basename($this->path);
        $extpos = strrpos($filename, ".");
        if ($extpos === false || $extpos === 0) {
            $name = $filename;
            $ext = $defaultExtension;
        }
        else {
            $name = substr($filename, 0, $extpos);
            $ext = substr($filename, $extpos + 1);
        }
        return [$name, $ext];
    }
Separate a filename and extension

bug (??) with pathinfo():
[http://bugs.php.net/bug.php?id=67048](http://bugs.php.net/bug.php?id=67048)

Example Usage:
<code>
$path = '/path/to/file.txt';
list($name, $ext) = File::splitName($path);
// => ['file', 'txt']
$ext = File::splitName($path)[1];
// => 'txt'
</code>

@param string $defaultExtension
@return array
- [0] string name
- [1] string|null extension