diff --git a/Herbert/Framework/Providers/HerbertServiceProvider.php b/Herbert/Framework/Providers/HerbertServiceProvider.php index 6bb5826..2804446 100644 --- a/Herbert/Framework/Providers/HerbertServiceProvider.php +++ b/Herbert/Framework/Providers/HerbertServiceProvider.php @@ -128,16 +128,26 @@ protected function registerEloquent() $capsule = new Capsule($this->app); - $capsule->addConnection([ - 'driver' => 'mysql', - 'host' => DB_HOST, - 'database' => DB_NAME, - 'username' => DB_USER, - 'password' => DB_PASSWORD, - 'charset' => DB_CHARSET, - 'collation' => DB_COLLATE ?: $wpdb->collate, - 'prefix' => $wpdb->prefix - ]); + if (defined('WP_MUFFIN') && WP_MUFFIN) { + $capsule->addConnection([ + 'driver' => 'sqlite', + 'database' => ':memory:', + 'charset' => DB_CHARSET, + 'collation' => DB_COLLATE ?: $wpdb->collate, + 'prefix' => $wpdb->prefix + ]); + } else { + $capsule->addConnection([ + 'driver' => 'mysql', + 'host' => DB_HOST, + 'database' => DB_NAME, + 'username' => DB_USER, + 'password' => DB_PASSWORD, + 'charset' => DB_CHARSET, + 'collation' => DB_COLLATE ?: $wpdb->collate, + 'prefix' => $wpdb->prefix + ]); + } $capsule->setAsGlobal(); $capsule->bootEloquent(); diff --git a/Herbert/Framework/Providers/TwigServiceProvider.php b/Herbert/Framework/Providers/TwigServiceProvider.php index beb4afb..cce2573 100644 --- a/Herbert/Framework/Providers/TwigServiceProvider.php +++ b/Herbert/Framework/Providers/TwigServiceProvider.php @@ -20,7 +20,7 @@ public function register() { $this->app->singleton('twig.loader', function () { - $loader = new Twig_Loader_Filesystem('/'); + $loader = new Twig_Loader_Filesystem(); foreach ($this->app->getPlugins() as $plugin) { diff --git a/Herbert/Framework/Shortcode.php b/Herbert/Framework/Shortcode.php index 4e99072..25b65b4 100644 --- a/Herbert/Framework/Shortcode.php +++ b/Herbert/Framework/Shortcode.php @@ -41,7 +41,7 @@ public function add($name, $callable, $arguments = []) $attributes = $this->renameArguments($arguments, $attributes); } - if (strpos($callable, '::') !== false) + if (is_string($callable) && strpos($callable, '::') !== false) { list($api, $method) = explode('::', $callable);