eduardok / libsmbclient-php

smbclient's extension for PHP
Other
99 stars 21 forks source link

Use smbclient_state_init with the stream wrapper #58

Open filerun opened 6 years ago

filerun commented 6 years ago

It would be fantastic if one could initialize the state using "smbclient_state_init" then continue to use the stream wrapper, so that regular file management functions can be used, while authenticated, but not including the username and password in the used paths/URLs.

filerun commented 6 years ago

Nevermind. After having a look at the code I realized I can set a default context: $default = stream_context_set_default([ 'smb' => [ 'username' => '******', 'password' => '******' ] ]); Thank you for a very useful tool!

filerun commented 6 years ago

Well, disappointed because the wrapper doesn't cover some basic functions, such as "is_dir" or "file_exists", so it's too limited.