snappymail/rainloop/v/0.0.0/app/handle.php

37 lines
917 B
PHP
Raw Normal View History

2013-09-25 03:04:44 +08:00
<?php
namespace RainLoop;
if (!\defined('RAINLOOP_APP_ROOT_PATH'))
{
\define('RAINLOOP_APP_LIBRARIES_PATH', \rtrim(\realpath(__DIR__), '\\/').'/libraries/');
\spl_autoload_register(function ($sClassName) {
2013-10-03 06:14:31 +08:00
if (0 === \strpos($sClassName, 'RainLoop') && false !== \strpos($sClassName, '\\'))
2013-09-25 03:04:44 +08:00
{
2013-10-03 06:14:31 +08:00
return include RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/'.\str_replace('\\', '/', \substr($sClassName, 9)).'.php';
2013-09-25 03:04:44 +08:00
}
2013-12-20 00:04:56 +08:00
else if (0 === \strpos($sClassName, 'Sabre') && false !== \strpos($sClassName, '\\'))
{
return include RAINLOOP_APP_LIBRARIES_PATH.'Sabre/'.\str_replace('\\', '/', \substr($sClassName, 6)).'.php';
}
2013-09-25 03:04:44 +08:00
return false;
});
if (\class_exists('RainLoop\Service'))
{
$oException = null;
try
{
include APP_VERSION_ROOT_PATH.'app/libraries/MailSo/MailSo.php';
}
catch (\Exception $oException) {}
if (!$oException)
{
\RainLoop\Service::NewInstance()->Handle();
}
}
}