/** * Plugin boostrap. */ private function bootstrap() { // Set plugin file variables $this->file = __FILE__; $this->basename = plugin_basename($this->file); $this->plugin_dir = plugin_dir_path($this->file); $this->plugin_url = plugin_dir_url($this->file); // Load textdomain load_plugin_textdomain(self::TEXT_DOMAIN, false, dirname($this->basename) . '/languages'); // Autoload classes if not already autoloaded if (file_exists($this->plugin_dir . 'vendor/autoload.php')) { require $this->plugin_dir . 'vendor/autoload.php'; } // Bootstrap $bootstrap = new Core\Bootstrap(); $bootstrap->bootstrap(); }
<? include_once( 'app/config.php' ); spl_autoload_register(function($class){ require_once( ROOT . $class . '.php' ); }); $app = new Core\Bootstrap; $app->init();