Wrapper for ldap_rename()

@see ldap_rename()
425962
public function rename($dn, $newrdn, $newparent = null, $deleteoldrdn = true)
    {
        $this->_debug("C: Rename $dn to $newrdn");

        if (!ldap_rename($this->conn, $dn, $newrdn, $newparent, $deleteoldrdn)) {
            $this->_error("ldap_rename() failed with " . ldap_error($this->conn));
            return false;
        }

        $this->_debug("S: OK");
        return true;
    }
1233871
public function move(LdapObject $ldapObject, $container)
    {
        $event = new LdapObjectMoveEvent(Event::LDAP_OBJECT_BEFORE_MOVE, $ldapObject, $container);
        $this->dispatcher->dispatch($event);
        $container = $event->getContainer();

        $this->validateObject($ldapObject);
        $operation = new RenameOperation(
            $ldapObject->get('dn'),
            LdapUtilities::getRdnFromDn($ldapObject->get('dn')),
            (string) $container,
            true
        );
        $this->connection->execute($operation);

        // Update the object to reference the new DN after the move...
        $newDn = LdapUtilities::getRdnFromDn($ldapObject->get('dn')).','.$container;
        $ldapObject->refresh(['dn' => $newDn]);
        $ldapObject->getBatchCollection()->setDn($newDn);

        $this->dispatcher->dispatch(new LdapObjectMoveEvent(Event::LDAP_OBJECT_AFTER_MOVE, $ldapObject, $container));
    }
897541
public function rename($name)
    {
        $retval = [
            'success' => false,
            'data'    => [],
        ];

        $response = self::$httpClient->patch(
            self::$account->getMetadataUrl() . "nodes/{$this['id']}",
            [
                'headers' => [
                    'Authorization' => 'Bearer ' . self::$account->getToken()['access_token'],
                ],
                'json' => [
                    'name' => $name,
                ],
                'exceptions' => false,
            ]
        );

        $retval['data'] = json_decode((string)$response->getBody(), true);

        if ($response->getStatusCode() === 200) {
            $retval['success'] = true;
            $this->replace($retval['data']);
            $this->save();
        }

        return $retval;
    }
485606
protected static function fill_classmap_renames_cache() {
        global $CFG;

        self::$classmaprenames = array();

        self::load_renamed_classes("$CFG->dirroot/lib/");

        foreach (self::$subsystems as $subsystem => $fulldir) {
            self::load_renamed_classes($fulldir);
        }

        foreach (self::$plugins as $plugintype => $plugins) {
            foreach ($plugins as $pluginname => $fulldir) {
                self::load_renamed_classes($fulldir);
            }
        }
    }
700549
public static function rename($oldName, $newName, $context = null)
    {
        return self::resourceExists($oldName) ? rename($oldName, $newName, $context) : false;
    }
229845
function rename_group($gid, $name, &$new_gid)
    {
        // make sure we have a unique name
        $name = $this->unique_groupname($name);

        $sql_result = $this->db->query(
            "UPDATE " . $this->db->table_name($this->db_groups, true).
            " SET `name` = ?, `changed` = ".$this->db->now().
            " WHERE `contactgroup_id` = ?".
                " AND `user_id` = ?",
            $name, $gid, $this->user_id
        );

        return $this->db->affected_rows($sql_result) ? $name : false;
    }
461276
public function initializeLdap() {
        //initialize from parent
        $this->initialize();
        
        //validate ldap settings
        $ldapSettings = $this->_passwordAuthenticationPlatformSettings;

        if(
            !(array_key_exists('ldap_account_suffix', $ldapSettings))
            ||!(array_key_exists('ad_password', $ldapSettings))
            || !(array_key_exists('ad_username', $ldapSettings))
            || !(array_key_exists('base_dn', $ldapSettings))
            || !(array_key_exists('cn_identifier', $ldapSettings))
            || !(array_key_exists('domain_controllers', $ldapSettings))
            || !(array_key_exists('group_attribute', $ldapSettings))
            || !(array_key_exists('group_cn_identifier', $ldapSettings))
            || !(array_key_exists('ldap_server_type', $ldapSettings))
            || !(array_key_exists('network_timeout', $ldapSettings))
            || !(array_key_exists('port', $ldapSettings))
            || !(array_key_exists('recursive_groups', $ldapSettings))
            || !(array_key_exists('time_limit', $ldapSettings))
            || !(array_key_exists('use_ssl', $ldapSettings))
            || !(array_key_exists('cache_support', $ldapSettings))
            || !(array_key_exists('cache_folder', $ldapSettings))
            || !(array_key_exists('expired_password_valid', $ldapSettings))
        ) {
           throw new UserCredentialException("The LDAP feature of the usercredential login service is not initialized with all parameters", 2000);
        }
        
        //inject settings to the ldap handler
        $this->_passwordAuthenticationPlatformSettings = $ldapSettings;       
        $this->initializeLdapAuthenticationHandler();
    }
954990
static function rename($from, $to)
    {
        $result = false;
        if (file_exists($from)){
            $to = self::makeVirtualDir($to);
            $dir = dirname($to);
            if (!is_dir($dir)) mkdir($dir, true);
            if (mb_strtoupper($from) != mb_strtoupper($to)){
                if (is_dir($to)){
                    self::clear_dir($to, true);
                }else
                if (is_file($to)){
                    unlink($to);
                }
            }
            $result = rename($from, $to);
            self::deleteVirtualDir($to);
        }
        return $result;
    }
23275
protected function _connectLdap()
    {
        $config = $this->getConfig();

        $this->_ldap->connect(
            $config['host'],
            $config['port'],
            $this->getConfig('options')
        );
    }
1292256
def rename(self, new_name):
    
    update = copy.copy(self)
    update.name = new_name
    return self._do_update(update)
604289
public function rename($oldName, $newName)
    {
        if (! ftp_rename($this->session, $oldName, $newName)) {
            throw new \RuntimeException('Name can not be changed');
        }
        return true;
    }
1347198
public static function move($oldName, $newName, $context = null)
    {
        return self::rename($oldName, $newName, $context);
    }
74567
public function deleteIfReplace($name, $data)
    {
        if ($name && isset($data['name']) && $name !== $data['name']) {
            $this->ldapUserRepo->updateUsersByServerName($name, $data['name']);
            $this->deleteServer($name);
        }
    }
46092
public function rename($new_name)
	{
		$info = pathinfo($this->path);

		$new_name = str_replace(array('..', '/', '\\'), array('', '', ''), $new_name);

		$new_path = $info['dirname'].DS.$new_name;

		$return =  $this->area->rename_dir($this->path, $new_path);
		$return and $this->path = $new_path;

		return $return;
	}
1176107
function rename($oldname, $newname)
    {
        if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
            return false;
        }

        $oldname = $this->_realpath($oldname);
        $newname = $this->_realpath($newname);
        if ($oldname === false || $newname === false) {
            return false;
        }

        // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.3
        $packet = pack('Na*Na*', strlen($oldname), $oldname, strlen($newname), $newname);
        if (!$this->_send_sftp_packet(NET_SFTP_RENAME, $packet)) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        if ($this->packet_type != NET_SFTP_STATUS) {
            user_error('Expected SSH_FXP_STATUS');
            return false;
        }

        // if $status isn't SSH_FX_OK it's probably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
        if (strlen($response) < 4) {
            return false;
        }
        extract(unpack('Nstatus', $this->_string_shift($response, 4)));
        if ($status != NET_SFTP_STATUS_OK) {
            $this->_logError($response, $status);
            return false;
        }

        // don't move the stat cache entry over since this operation could very well change the
        // atime and mtime attributes
        //$this->_update_stat_cache($newname, $this->_query_stat_cache($oldname));
        $this->_remove_from_stat_cache($oldname);
        $this->_remove_from_stat_cache($newname);

        return true;
    }
263565
def rename(self, name, **kwargs):
        

        return self._rename(self._dxid, {"project": self._proj,
                                         "name": name}, **kwargs)
62881
public function rename(string $newName) : bool
    {
        $renamed = rename($this->realPath, $newName);

        if ($renamed) {
            $this->realPath = realpath($newName);
        }

        return $renamed;
    }