mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-04 19:58:39 +00:00
Removing file_exists
This commit is contained in:
parent
ca03e96fb9
commit
ba865a67f3
|
|
@ -39,19 +39,18 @@ class Autoloader
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @throws \Exception Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation.
|
* @throws AutoloadException Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation.
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public static function default_autoloader(string $class)
|
public static function default_autoloader(string $class)
|
||||||
{
|
{
|
||||||
if (($classNew = self::exists($class)) !== false) {
|
$class = ltrim($class, '\\');
|
||||||
/** @noinspection PhpIncludeInspection */
|
$class = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class);
|
||||||
include __DIR__ . '/../' . $classNew . '.php';
|
|
||||||
} else {
|
/** @noinspection PhpIncludeInspection */
|
||||||
throw new AutoloaderException($class);
|
include_once __DIR__ . '/../' . $class . '.php';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ abstract class ViewAbstract implements \Serializable
|
||||||
*/
|
*/
|
||||||
public function serialize()
|
public function serialize()
|
||||||
{
|
{
|
||||||
if (!file_exists(__DIR__ . '/../..' . $this->template . '.tpl.php')) {
|
if (empty($this->template)) {
|
||||||
return $this->toArray();
|
return $this->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user