CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.3 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Console
    • Controller
    • Core
      • Configure
      • Exception
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class ClassLoader

ClassLoader

Namespace: Cake\Core

Property Summary

  • $_prefixes protected
    array

    An associative array where the key is a namespace prefix and the value is an array of base directories for classes in that namespace.

Method Summary

  • _loadMappedFile() protected

    Load the mapped file for a namespace prefix and relative class.

  • _requireFile() protected

    If a file exists, require it from the file system.

  • addNamespace() public

    Adds a base directory for a namespace prefix.

  • loadClass() public

    Loads the class file for a given class name.

  • register() public

    Register loader with SPL autoloader stack.

Method Detail

_loadMappedFile() ¶ protected

_loadMappedFile(string $prefix, string $relativeClass): mixed

Load the mapped file for a namespace prefix and relative class.

Parameters
string $prefix

The namespace prefix.

string $relativeClass

The relative class name.

Returns
mixed

_requireFile() ¶ protected

_requireFile(string $file): bool

If a file exists, require it from the file system.

Parameters
string $file

The file to require.

Returns
bool

addNamespace() ¶ public

addNamespace(string $prefix, string $baseDir, bool $prepend = false): void

Adds a base directory for a namespace prefix.

Parameters
string $prefix

The namespace prefix.

string $baseDir

A base directory for class files in the namespace.

bool $prepend optional

If true, prepend the base directory to the stack instead of appending it; this causes it to be searched first rather than last.

Returns
void

loadClass() ¶ public

loadClass(string $class): string|false

Loads the class file for a given class name.

Parameters
string $class

The fully-qualified class name.

Returns
string|false

register() ¶ public

register(): void

Register loader with SPL autoloader stack.

Returns
void

Property Detail

$_prefixes ¶ protected

An associative array where the key is a namespace prefix and the value is an array of base directories for classes in that namespace.

Type
array
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs