|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / vendor / magento / framework / Code / Generator / |
Filename | /home/a/home/dev2.destoffenstraat.com/vendor/magento/framework/Code/Generator/DefinedClasses.php |
Size | 1.65 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Jan-2021 21:08 |
Last accessed | 23-Aug-2025 05:31 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Code\Generator;
use Magento\Framework\Autoload\AutoloaderRegistry;
/**
* DefinedClasses class detects if a class has been defined
*/
class DefinedClasses
{
/**
* Determine if a class can be loaded without using Code\Generator\Autoloader.
*
* @param string $className
* @return bool
*/
public function isClassLoadable($className)
{
return $this->isClassLoadableFromMemory($className) || $this->isClassLoadableFromDisk($className);
}
/**
* Determine if a class exists in memory
*
* @param string $className
* @return bool
*/
public function isClassLoadableFromMemory($className)
{
return class_exists($className, false) || interface_exists($className, false);
}
/**
* Determine if a class exists on disk
*
* @param string $className
* @return bool
* @deprecated 102.0.0
*/
public function isClassLoadableFromDisc($className)
{
return $this->isClassLoadableFromDisk($className);
}
/**
* Determine if a class exists on disk
*
* @param string $className
* @return bool
*/
public function isClassLoadableFromDisk($className)
{
try {
return (bool)AutoloaderRegistry::getAutoloader()->findFile($className);
} catch (\Exception $e) {
// Couldn't get access to the autoloader so we need to allow class_exists to call autoloader chain
return (class_exists($className) || interface_exists($className));
}
}
}
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Code\Generator;
use Magento\Framework\Autoload\AutoloaderRegistry;
/**
* DefinedClasses class detects if a class has been defined
*/
class DefinedClasses
{
/**
* Determine if a class can be loaded without using Code\Generator\Autoloader.
*
* @param string $className
* @return bool
*/
public function isClassLoadable($className)
{
return $this->isClassLoadableFromMemory($className) || $this->isClassLoadableFromDisk($className);
}
/**
* Determine if a class exists in memory
*
* @param string $className
* @return bool
*/
public function isClassLoadableFromMemory($className)
{
return class_exists($className, false) || interface_exists($className, false);
}
/**
* Determine if a class exists on disk
*
* @param string $className
* @return bool
* @deprecated 102.0.0
*/
public function isClassLoadableFromDisc($className)
{
return $this->isClassLoadableFromDisk($className);
}
/**
* Determine if a class exists on disk
*
* @param string $className
* @return bool
*/
public function isClassLoadableFromDisk($className)
{
try {
return (bool)AutoloaderRegistry::getAutoloader()->findFile($className);
} catch (\Exception $e) {
// Couldn't get access to the autoloader so we need to allow class_exists to call autoloader chain
return (class_exists($className) || interface_exists($className));
}
}
}