Mediamanager\Controller\Mediamanager::rename PHP Method

rename() protected method

protected rename ( )
    protected function rename()
    {
        $path = $this->param('path', false);
        $name = $this->param('name', false);
        if ($path && $name) {
            $source = $this->root . '/' . trim($path, '/');
            $target = dirname($source) . '/' . $name;
            rename($source, $target);
        }
        return json_encode(array("success" => true));
    }