CodeView
Back to article:
prod
tests
integration
reference-output
Ko
resources
test-clones
xml
custom-file
default-file
dist-file
special
tools
Base
Ko
unit
<?php class Tools { /** * Adds a trailing slash or backslash to a directory path. * * @param string $dirpath * @return string */ public static function add_trailing_slash ( $dirpath ) { return ( preg_match( '%.*?[/\\\\]$%', $dirpath, $matches ) ? $matches[0] : $dirpath . DIRECTORY_SEPARATOR ); } /** * Removes a trailing slash or backslash from a directory path. * * @param string $dirpath * @return string */ public static function remove_trailing_slash ( $dirpath ) { return ( preg_match( '%(.*?)[/\\\\]$%', $dirpath, $matches ) ? $matches[1] : $dirpath ); } } ?>