Move to PSR-4 for autoloading

This commit is contained in:
Robin Appelman 2014-04-07 13:54:49 +02:00
commit 46e2daf1ee
12 changed files with 55 additions and 56 deletions

View file

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
namespace SMB;
namespace Icewind\SMB;
class Connection extends RawConnection {
const DELIMITER = 'smb:';

View file

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
namespace SMB;
namespace Icewind\SMB;
class NotFoundException extends \Exception {
}

View file

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
namespace SMB;
namespace Icewind\SMB;
class RawConnection {
/**

View file

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
namespace SMB;
namespace Icewind\SMB;
class Server {
const CLIENT = 'smbclient';
@ -68,8 +68,8 @@ class Server {
/**
* @return Share[]
* @throws \SMB\AuthenticationException
* @throws \SMB\InvalidHostException
* @throws \Icewind\SMB\AuthenticationException
* @throws \Icewind\SMB\InvalidHostException
*/
public function listShares() {
$user = escapeshellarg($this->getUser());

View file

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
namespace SMB;
namespace Icewind\SMB;
class Share {
/**

View file

@ -1,19 +0,0 @@
<?php
/**
* Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);
require_once 'errors.php';
spl_autoload_register(function ($class) {
if (substr($class, 0, 4) == 'SMB\\') {
$class = strtolower($class);
$file = str_replace('\\', '/', substr($class, 4));
include __DIR__ . '/' . $file . '.php';
}
});