示例#1
0
 /**
  * Initialize WPametu
  */
 private static function init()
 {
     // Avoid double initialization
     if (self::$initialized) {
         trigger_error('Do not call WPametu::init twice!', E_USER_WARNING);
         return;
     }
     // Todo: i18n for plugin
     load_theme_textdomain(self::DOMAIN, dirname(__DIR__) . '/i18n');
     // Check version
     if (version_compare(phpversion(), self::PHP_VERSION, '<')) {
         trigger_error(sprintf(__('PHP version should be %s and over. Your version is %s.', self::DOMAIN), self::PHP_VERSION, phpversion()), E_USER_WARNING);
         return;
     }
     // Fire AutoLoader
     AutoLoader::get_instance();
     self::$initialized = true;
 }
示例#2
0
<?php

/*
Plugin Name: WPametu
Plugin URI: https://github.com/hametuha/wpametu
Description: A WordPress Theme framework
Author: Takahashi_Fumiki
Version: 0.4
Author URI: https://hametuha.co.jp/
*/
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
    require __DIR__ . '/vendor/autoload.php';
    WPametu::entry();
} else {
    trigger_error('WPametu: autoload.php doesn\'t exist. If this is from github, run composer install.');
}