1<?php 2/** 3 * Copyright (c) 2009-2013, Laurent Laville <pear@laurent-laville.org> 4 * Bertrand Mansion <bmansion@mamasam.com> 5 * 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * * Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * * Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * * Neither the name of the authors nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 * 33 * PHP version 5 34 * 35 * @category Networking 36 * @package Net_Growl 37 * @author Laurent Laville <pear@laurent-laville.org> 38 * @author Bertrand Mansion <bmansion@mamasam.com> 39 * @license http://www.opensource.org/licenses/bsd-license.php BSD 40 * @version SVN: $Id$ 41 * @link http://growl.laurent-laville.org/ 42 * @link http://pear.php.net/package/Net_Growl 43 * @since File available since Release 2.4.0 44 */ 45 46/** 47 * Autoloader for Net_Growl 48 * 49 * @param string $className Class name to load 50 * 51 * @return void 52 * @version Release: 2.7.0 53 */ 54function NetGrowl_autoload($className) 55{ 56 static $classes = null; 57 static $path = null; 58 59 if ($classes === null) { 60 61 $classes = array( 62 'Net_Growl' => 'Growl.php', 63 'Net_Growl_Application' => 'Growl/Application.php', 64 'Net_Growl_Icon' => 'Growl/Icon.php', 65 'Net_Growl_Exception' => 'Growl/Exception.php', 66 'Net_Growl_Gntp' => 'Growl/Gntp.php', 67 'Net_Growl_GntpMock' => 'Growl/GntpMock.php', 68 'Net_Growl_Response' => 'Growl/Response.php', 69 'Net_Growl_Udp' => 'Growl/Udp.php', 70 ); 71 $path = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR; 72 } 73 74 if (isset($classes[$className])) { 75 include $path . $classes[$className]; 76 } 77} 78 79spl_autoload_register('NetGrowl_autoload'); 80