PHP Classes

File: autoloader.php

Recommend this page to a friend!
  Classes of Oliver Lillie   PHP Video Toolkit   autoloader.php   Download  
File: autoloader.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Video Toolkit
Manipulate and convert videos with ffmpeg program
Author: By
Last change: updated version in source
Date: 1 year ago
Size: 1,042 bytes
 

Contents

Class file image Download
<?php
   
   
/**
     * This file is part of the PHP Video Toolkit v2 package.
     *
     * @author Oliver Lillie (aka buggedcom) <publicmail@buggedcom.co.uk>
     * @license Dual licensed under MIT and GPLv2
     * @copyright Copyright (c) 2008-2014 Oliver Lillie <http://www.buggedcom.co.uk>
     * @package PHPVideoToolkit V2
     * @version 2.1.7-beta
     * @uses ffmpeg http://ffmpeg.sourceforge.net/
     */
   
   
spl_autoload_register(function($class_name)
    {
       
$parts = explode('\\', $class_name);
       
$namespace = array_shift($parts);
        if(
$namespace === 'PHPVideoToolkit')
        {
           
$class = str_replace('_', DIRECTORY_SEPARATOR, array_pop($parts));
           
$path = dirname(__FILE__).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'PHPVideoToolkit'.DIRECTORY_SEPARATOR.ltrim(implode(DIRECTORY_SEPARATOR, $parts).DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR).$class.'.php';
            if(
is_file($path) === true)
            {
                require_once
$path;
            }
        }
    });