snappymail/rainloop/v/0.0.0/app/libraries/MailSo/MailSo.php

40 lines
969 B
PHP
Raw Normal View History

2013-09-25 03:04:44 +08:00
<?php
2014-10-17 18:15:19 +08:00
/*
* This file is part of MailSo.
*
* (c) 2014 Usenko Timur
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2013-09-25 03:04:44 +08:00
namespace MailSo;
if (!\defined('MAILSO_LIBRARY_ROOT_PATH'))
{
\define('MAILSO_LIBRARY_ROOT_PATH', \defined('MAILSO_LIBRARY_USE_PHAR')
? 'phar://mailso.phar/' : \rtrim(\realpath(__DIR__), '\\/').'/');
2014-10-15 23:11:50 +08:00
/**
* @param string $sClassName
*
* @return mixed
*/
function MailSoSplAutoloadRegisterFunction($sClassName)
{
2013-09-25 03:04:44 +08:00
return (0 === \strpos($sClassName, 'MailSo') && false !== \strpos($sClassName, '\\')) ?
include MAILSO_LIBRARY_ROOT_PATH.\str_replace('\\', '/', \substr($sClassName, 7)).'.php' : false;
2014-10-15 23:11:50 +08:00
}
\spl_autoload_register('MailSo\MailSoSplAutoloadRegisterFunction', false);
2013-09-25 03:04:44 +08:00
if (\class_exists('MailSo\Base\Loader'))
{
\MailSo\Base\Loader::Init();
}
else
{
2014-10-15 23:11:50 +08:00
\spl_autoload_unregister('MailSo\MailSoSplAutoloadRegisterFunction');
2013-09-25 03:04:44 +08:00
}
}