Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSize() didnt work / always zero #132

Open
DasFragezeichen opened this issue Jan 19, 2025 · 0 comments
Open

getSize() didnt work / always zero #132

DasFragezeichen opened this issue Jan 19, 2025 · 0 comments

Comments

@DasFragezeichen
Copy link

DasFragezeichen commented Jan 19, 2025

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant