/** * @param null $basePath * @param array $requiredFields * @param bool $exceptionOnInvalid * * @return \ThemeManager\ThemeManager */ function theme_manager($basePath = null, array $requiredFields = [], $exceptionOnInvalid = false) { if (function_exists('app') && class_exists('Illuminate\\Container\\Container') && Config::get('app.aliases.ThemeManager') == 'ThemeManager\\Facade\\ThemeManager') { return \ThemeManager::returnThis(); } return new ThemeManager(theme_manager_starter()->start($basePath, $requiredFields, $exceptionOnInvalid)); }
<?php define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Register The Composer Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader | for our application. We just need to utilize it! We'll require it | into the script here so that we do not have to worry about the | loading of any our classes "manually". Feels great to relax. | */ require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- | Include The Compiled Class File |-------------------------------------------------------------------------- | | To dramatically increase your application's performance, you may use a | compiled class file which contains all of the classes commonly used | by a request. The Artisan "optimize" is used to create this file. | */ $compiledPath = __DIR__ . '/cache/compiled.php'; if (file_exists($compiledPath)) { require $compiledPath; } theme_manager_starter()->bootstrapAutoload();
* Via new Class */ //Bootstrapping theme php files if autoload.php file is present (new \ThemeManager\Starter())->bootstrapAutoload(); //OR via helper theme_manager_starter()->bootstrapAutoload(); //Via new $themeManager = new \ThemeManager\ThemeManager((new \ThemeManager\Starter())->start()); //Optionally pass in initial base path $themeManager = new \ThemeManager\ThemeManager((new \ThemeManager\Starter())->start(__DIR__ . '/path/to/themes/')); //Optional Required Field(s) $themeManager = new \ThemeManager\ThemeManager((new \ThemeManager\Starter())->start($basePath, $requiredFields)); //Via Theme Manager Starter Helper $themeManager = new \ThemeManager\ThemeManager(theme_manager_starter()->start()); // Exception On Invalid $themeManager = new \ThemeManager\ThemeManager(theme_manager_starter()->start($basePath, $requiredFields, true)); /** * Via Helper */ $themeManager = theme_manager(); //Optionally pass in initial base path $themeManager = theme_manager(__DIR__ . '/path/to/themes/'); //Optional Required Field(s) $themeManager = theme_manager($basePath, $requiredFields); // Exception On Invalid $themeManager = theme_manager($basePath, $requiredFields, true); //ThemeCollection $allThemes = $themeManager->all(); //Returns bool $myThemeExists = $themeManager->themeExists('theme-name') ? 'yes' : 'nope'; //Theme Obj or null
/** * @param null $basePath * * @param array $requiredFields * @param boolean $exceptionOnInvalid * * @return \ThemeManager\ThemeManager */ function theme_manager($basePath = null, array $requiredFields = [], $exceptionOnInvalid = false) { return new \ThemeManager\ThemeManager(theme_manager_starter()->start($basePath, $requiredFields, $exceptionOnInvalid)); }