Newer
Older
<?php
/**
* Autoloader class.
*
*/
namespace CiviCRM_WP_REST;
class Autoloader {
if (!self::$instance) {
self::$instance = new self();
}
* @param string $source_path The source path
*/
public static function add_source(string $source_path) {
return new \WP_Error('civicrm_wp_rest_error', sprintf(__('The source %s is not readable.', 'civicrm'), $source));
* @since 5.25
*
* @return bool Wehather the autoloader has been registered or not.
* @since 5.25
*
* @param string $class_name The class name to load.
if ($this->namespace !== $parts[0]) {
return;
}
$class_path = str_replace('_', '-', implode(DIRECTORY_SEPARATOR, array_slice($parts, 1)));