You are here

autoload.php in Anti Spam by CleanTalk 8.4

Same filename and directory in other branches
  1. 9.1.x src/lib/autoload.php

File

src/lib/autoload.php
View source
<?php

/**
 * Autoloader for \Cleantalk\* classes
 *
 * @param string $class
 *
 * @return void
 */
spl_autoload_register(function ($class) {

  // Register class auto loader
  // Custom modules1
  if (strpos($class, 'Cleantalk') !== false) {
    $class = str_replace('\\', DIRECTORY_SEPARATOR, $class);
    $class_file = __DIR__ . DIRECTORY_SEPARATOR . $class . '.php';
    if (file_exists($class_file)) {
      require_once $class_file;
    }
  }
});