Inheritance: extends Facade
コード例 #1
0
 public function ignite()
 {
     $models = Config::get('registration');
     $this->register($models['options']);
     $this->register($models['roles']);
     $this->register($models['users']);
     $this->register($models['taxonomies']);
     $this->register($models['posttypes']);
 }
コード例 #2
0
ファイル: functions.php プロジェクト: themosis/theme
$paths['theme.resources'] = __DIR__ . DS . 'resources' . DS;
$paths['theme.admin'] = __DIR__ . DS . 'resources' . DS . 'admin' . DS;
themosis_set_paths($paths);
/*
 * Register all paths into the service container.
 */
$theme->registerAllPaths(themosis_path());
/*
 * Load theme configuration files.
 */
$theme['config.finder']->addPaths([themosis_path('theme.resources') . 'config' . DS]);
/*
 * Autoloading.
 */
$loader = new \Composer\Autoload\ClassLoader();
$classes = \Themosis\Facades\Config::get('loading');
foreach ($classes as $prefix => $path) {
    $loader->addPsr4($prefix, $path);
}
$loader->register();
/*
 * Register theme views folder path.
 */
$theme['view.finder']->addLocation(themosis_path('theme.resources') . 'views');
/*
 * Register theme public assets folder [dist directory].
 */
$theme['asset.finder']->addPaths([themosis_theme_assets() => themosis_path('theme') . 'dist']);
/*
 * Theme constants.
 */
コード例 #3
0
ファイル: start.php プロジェクト: andrijdavid/wordpress
function themosisInstallThemeGlobalObject()
{
    $namespace = Config::get('application.namespace');
    $url = admin_url() . Config::get('application.ajaxurl') . '.php';
    $datas = apply_filters('themosisGlobalObject', []);
    $output = "<script type=\"text/javascript\">\n\r";
    $output .= "//<![CDATA[\n\r";
    $output .= "var " . $namespace . " = {\n\r";
    $output .= "ajaxurl: '" . $url . "',\n\r";
    if (!empty($datas)) {
        foreach ($datas as $key => $value) {
            $output .= $key . ": " . json_encode($value) . ",\n\r";
        }
    }
    $output .= "};\n\r";
    $output .= "//]]>\n\r";
    $output .= "</script>";
    // Output the datas.
    echo $output;
}
コード例 #4
0
ファイル: cache.php プロジェクト: andrijdavid/MyTheme
 * Created by Andrij David.
 * Copyright Andrij David.
 * All right reserved.
 * Date: 2/16/16
 * Time: 11:15 AM
 * As: cache.php
 * For: business
 */
use Illuminate\Cache\CacheManager;
use Illuminate\Cache\MemcachedConnector;
use Themosis\Facades\Config;
/*----------------------------------------------------*/
// Load Cache
/*-----------------------------------------------------*/
$cacheConfig = Config::get('cache');
$databaseConfig = Config::get('database');
$cnt = new \Illuminate\Container\Container();
\Illuminate\Container\Container::setInstance($cnt);
$cnt->singleton('memcached.connector', function () {
    return new MemcachedConnector();
});
$cnt->singleton('cache', function ($app) {
    return new CacheManager($app);
});
$cnt->singleton('config', function () use($cacheConfig) {
    $cc = array_dot(array_except($cacheConfig, 'stores'), 'cache.');
    foreach ($cacheConfig["stores"] as $key => $value) {
        $cc["cache.stores." . $key] = $value;
    }
    return $cc;
});