✏️ 编辑:autoload.php
路径:
/home/boguraj1/.trash/vendor.1/fakerphp/faker/src/autoload.php
大小:883 B · 修改:2024-11-21 05:46:38 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php /** * Simple autoloader that follow the PHP Standards Recommendation #0 (PSR-0) * * @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md for more informations. * * Code inspired from the SplClassLoader RFC * @see https://wiki.php.net/rfc/splclassloader#example_implementation */ spl_autoload_register(function ($className) { $className = ltrim($className, '\\'); $fileName = ''; if ($lastNsPos = strripos($className, '\\')) { $namespace = substr($className, 0, $lastNsPos); $className = substr($className, $lastNsPos + 1); $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } $fileName = __DIR__ . DIRECTORY_SEPARATOR . $fileName . $className . '.php'; if (file_exists($fileName)) { require $fileName; return true; } return false; });
💾 保存
取消
保存为 UTF-8,换行统一为 LF