<?php

namespace openkm\util;

/**
 * PathUtils
 *
 * @author sochoa
 */
class PathUtils {

    	/**
	 * Get parent node.
	 */
    public static function getParent($path) {
        $lastSlash = strrpos($path, '/');
        return ($lastSlash > 0) ? substr($path, 0, $lastSlash) : "/";
    }

    	/**
	 * Get node name.
	 */
    public static function getName($path) {
        return substr($path, strrpos($path, '/') + 1);
    }

}
