phix/autoloader

Phix's Autoloader is a PSR0-compliant autoloader which supports PHP's include_path

4.3.3 2013-06-09 11:32 UTC

This package is not auto-updated.

Last update: 2024-03-12 00:52:11 UTC


README

Autoloader4 is a simple-to-use PHP component that provides a generic, PSR0-compliant autoloader for use in PHP projects.

System-Wide Installation

Autoloader4 should be installed using the PEAR Installer. This installer is the PHP community's de-facto standard for installing PHP components.

sudo pear channel-discover pear.phix-project.org
sudo pear install --alldeps phix/Autoloader4

As A Dependency On Your Component

If you are creating a component that relies on Autoloader4, please make sure that you add Autoloader4 to your component's package.xml file:

<dependencies>
  <required>
    <package>
      <name>Autoloader4</name>
      <channel>pear.phix-project.org</channel>
      <min>4.0.0</min>
      <max>4.999.9999</max>
    </package>
  </required>
</dependencies>

Usage

Include the autoloader, and then tell it to start autoloading classes for you:

<?php

use Phix_Project\Autoloader4\PSR0_Autoloader;
require_once('Phix_Project/Autoloader4/PSR0/Autoloader.php');
PSR0_Autoloader::startAutoloading();

?>

Development Environment

If you want to patch or enhance this component, you will need to create a suitable development environment. The easiest way to do that is to install phix4componentdev:

# phix4componentdev
sudo apt-get install php5-xdebug
sudo apt-get install php5-imagick
sudo pear channel-discover pear.phix-project.org
sudo pear -D auto_discover=1 install -Ba phix/phix4componentdev

You can then clone the git repository:

# Autoloader4
git clone git://github.com/stuartherbert/Autoloader.git

Then, install a local copy of this component's dependencies to complete the development environment:

# build vendor/ folder
phing build-vendor

To make life easier for you, common tasks (such as running unit tests, generating code review analytics, and creating the PEAR package) have been automated using phing. You'll find the automated steps inside the build.xml file that ships with the component.

Run the command 'phing' in the component's top-level folder to see the full list of available automated tasks.

License

This component is released under the new-style BSD license.

  • Copyright (c) 2011-present, Stuart Herbert
  • Copyright (c) 2010, Gradwell dot com Ltd

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.