Created
January 17, 2011 21:32
-
-
Save iammerrick/783524 to your computer and use it in GitHub Desktop.
Party Foul?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Location | |
Description: Manage locations of restaurants, and the displaying of them. | |
Version: 1.0 | |
Author: Riser Media | |
Author URI: http://www.risermedia.com | |
License: Commercial | |
*/ | |
spl_autoload_register( | |
function($class) | |
{ | |
/** | |
* Only autoload classes under the Location Namespace. This prevents it from trying to autoload WordPress classes or colliding with other plugins. | |
* | |
* @author Merrick Christensen | |
*/ | |
if(preg_match('/^Location/', $class)) | |
{ | |
// Convert "\" namespace characters to folder references "/". | |
$file = __DIR__.'/'.str_replace('\\', '/', $class) . '.php'; | |
// If it exists require it. | |
if(file_exists($file)) | |
{ | |
require_once $file; | |
} | |
} | |
} | |
); | |
new Location\vendor\ActiveRecord; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment