PHPackages                             korstiaan/nsautoload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. korstiaan/nsautoload

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

korstiaan/nsautoload
====================

Namespace Autoloader for Drupal 7.x.

329PHP

Since Jul 29Pushed 12y agoCompare

[ Source](https://github.com/korstiaan/nsautoload)[ Packagist](https://packagist.org/packages/korstiaan/nsautoload)[ RSS](/packages/korstiaan-nsautoload/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Nsautoload for Drupal 7.x
=========================

[](#nsautoload-for-drupal-7x)

Drupal 7.x module which autoloads your modules namespaced classes.

[![Build Status](https://camo.githubusercontent.com/9e28c03f8a66c8179d911e9dee69d6c1ecdd6a66d7c84a436e225b2d7225817f/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6b6f7273746961616e2f6e736175746f6c6f61642e706e67)](http://travis-ci.org/korstiaan/nsautoload)

Requirements
------------

[](#requirements)

- Drupal 7.x
- PHP 5.3.3+

Installation
------------

[](#installation)

### Download the module

[](#download-the-module)

The recommended way to install Nsautoload is with [Composer](http://getcomposer.org). Just add the following to your `composer.json`:

```
   {
   	   "minimum-stability": "dev",
	   "require": {
		   "korstiaan/nsautoload": "dev-master"
	   }
   }
```

Now update Composer and install the newly added requirement and its dependencies:

```
$ php composer.phar update korstiaan/nsautoload
```

If all went well and `composer/installers` did its job, Nsautoload was installed to `modules/nsautoload`. If you don't want it there, or it's not part of your Drupal rootdir, symlink it to your folder of choice.

### Using Composer

[](#using-composer)

Using `Composer` means including its autoloader. Add the following to your Drupals settings.php:

```
// /path/to/sites/default/settings.php

require '/path/to/vendor/autoload.php';
```

#### 2. Use [composer\_loader](https://github.com/korstiaan/composer_loader)

[](#2-use-composer_loader)

Just follow its readme.

### Enable Nsautoload

[](#enable-nsautoload)

There are 2 ways to enable Nsautoload:

#### 1. Add a few lines to *settings.php* (recommended)

[](#1-add-a-few-lines-to-settingsphp-recommended)

Add the following to your project's settings.php:

```
