- /**
- * Create directory if it does not exist and return pathname with a trailing slash
- * @param string $fspath
- * @return null|string
- */
- private static function init_path( $fspath ) {
- if ( !isset( $fspath ) ) {
- return null;
- }
- # Create directory if needed
- if ( $fspath && !is_dir( $fspath ) ) {
- wfMkdirParents( $fspath, null, __METHOD__ ) or die( "Can not create directory $fspath.\n" );
- }
-
- return realpath( $fspath ) . DIRECTORY_SEPARATOR;
- }
-