mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Removing file_exists
This commit is contained in:
parent
ca03e96fb9
commit
ba865a67f3
|
|
@ -39,19 +39,18 @@ class Autoloader
|
|||
*
|
||||
* @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
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function default_autoloader(string $class)
|
||||
{
|
||||
if (($classNew = self::exists($class)) !== false) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
include __DIR__ . '/../' . $classNew . '.php';
|
||||
} else {
|
||||
throw new AutoloaderException($class);
|
||||
}
|
||||
$class = ltrim($class, '\\');
|
||||
$class = str_replace(['_', '\\'], DIRECTORY_SEPARATOR, $class);
|
||||
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
include_once __DIR__ . '/../' . $class . '.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ abstract class ViewAbstract implements \Serializable
|
|||
*/
|
||||
public function serialize()
|
||||
{
|
||||
if (!file_exists(__DIR__ . '/../..' . $this->template . '.tpl.php')) {
|
||||
if (empty($this->template)) {
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user