Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
chore(): Release v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Aug 14, 2019
2 parents 011e694 + 535e81c commit 303d4fd
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions tonik-gin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
Plugin Name: tonik/gin
Plugin URI: http://tonik.pl
Description: Foundation of the Tonik WordPress Starter Theme. Provides all custom functionalities which it offers.
<<<<<<< HEAD
Version: 3.0.0
=======
Version: 3.1.0
>>>>>>> release-3.1.0
Author: Tonik
Author URI: http://tonik.pl
License: GPL-2.0+
Expand All @@ -13,7 +17,30 @@
Text Domain: tonik.gin
*/

if (file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
require $composer;
}
spl_autoload_register(function ($class) {
// Namespace prefix
$prefix = 'Tonik\\';

// Base directory for the namespace prefix
$base_dir = __DIR__ . '/src/';

// Does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// No, move to the next registered autoloader
return;
}

// Get the relative class name
$relative_class = substr($class, $len);

// Replace the namespace prefix with the base
// directory, replace namespace separators with directory
// separators in the relative class name, append with .php
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

// If the file exists, require it
if (file_exists($file)) {
require $file;
}
});

0 comments on commit 303d4fd

Please sign in to comment.