Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

getSize() didnt work / always zero #132

Description

@DasFragezeichen

It seems that the method getSize() didnt work.
I always get the result 0 (zero)

I connect to a Windows Server 2022 with administrators privilege.
getName() is working as expected.

Here is my code I used, but I also tested the example code on the main page. (Same result)

try {
	$serverFactory = new ServerFactory();
	$auth = new BasicAuth($_ENV['LDAP_USERNAME'], '', $_ENV['LDAP_PASSWORD']);
	$server = $serverFactory->createServer($_ENV['LDAP_IP'], $auth);

	$shares = array_map('trim', explode(',', $_ENV['LDAP_SHARES']));

	$folders = [];
	
	foreach ($shares as $shareName) {
		$share = $server->getShare($shareName);

		foreach ($share->dir('/') as $fileInfo) {
			if ($fileInfo->isDirectory()) {
				$folders[] = [
					'name' => $fileInfo->getName(),
					'size' => $fileInfo->getSize(),
				];
			}
		}
	}

	return $folders;

} catch (LdapException $e) {
	$this->logger->error('LDAP Error: ' . $e->getMessage());
	throw $e;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions