Download the PHP package icewind/smb without Composer

On this page you can find all versions of the php package icewind/smb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smb

SMB

CI codecov

PHP wrapper for smbclient and libsmbclient-php

Examples

Connect to a share

The server factory will automatically pick between the smbclient and libsmbclient-php based backend depending on what is available.

Using anonymous authentication

Using kerberos authentication

There are two ways of using kerberos to authenticate against the smb server:

Using a server ticket

Using a server ticket allows the web server to authenticate against the smb server using an existing machine account.

The ticket needs to be available in the environment of the php process.

Re-using a client ticket

By re-using a client ticket you can create a single sign-on setup where the user authenticates against the web service using kerberos. And the web server can forward that ticket to the smb server, allowing it to act on the behalf of the user without requiring the user to enter his password.

The setup for such a system is fairly involved and requires roughly the following this

Upload a file

Download a file

List shares on the remote server

List the content of a folder

Using read streams

Using write streams

Note: write() will truncate your file to 0bytes. You may open a writeable stream with append() which will point the cursor to the end of the file or create it if it does not exist yet. (append() is only compatible with libsmbclient-php)

Using notify

Changing network timeouts

Setting protocol version

Note, setting the protocol version is not supported with php-smbclient version 1.0.1 or lower.

Customizing system integration

The smbclient backend needs to get various information about the system it's running on to function such as the paths of various binaries or the system timezone. While the default logic for getting this information should work on most systems, it is possible to customize this behaviour.

In order to customize the integration you provide a custom implementation of ITimezoneProvider and/or ISystem and pass them as arguments to the ServerFactory.

Testing SMB

Use the following steps to check if the library can connect to your SMB share.

  1. Clone this repository or download the source as zip
  2. Make sure composer is installed
  3. Run composer install in the root of the repository
  4. Edit example.php with the relevant settings for your share.
  5. Run php example.php

If everything works correctly then the contents of the share should be outputted.


All versions of smb with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
icewind/streams Version >=0.7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package icewind/smb contains the following files

Loading the files please wait ....