示例#1
0
use SMW\NamespaceManager;
use SMW\ApplicationFactory;
use SMW\Setup;
if (!defined('MEDIAWIKI')) {
    die('Not an entry point.');
}
/**
 * ExtensionRegistry only maps classes and functions after all extensions have
 * been queued from the LocalSettings.php resulting in DefaultSettings not being
 * loaded in-time.
 *
 * When changing the load order, please ensure that this function is run either
 * via Composer's autoloading or as part of your internal registration.
 */
SemanticMediaWiki::load();
/**
 * @codeCoverageIgnore
 */
class SemanticMediaWiki
{
    /**
     * @since 2.5
     *
     * @note It is expected that this function is loaded before LocalSettings.php
     * to ensure that settings and global functions are available by the time
     * the extension is activated.
     */
    public static function load()
    {
        if (is_readable(__DIR__ . '/vendor/autoload.php')) {
示例#2
0
 * Third-party users that require SMW as integration platform should
 * add the following to the bootstrap.php
 *
 * require __DIR__ . '/../../SemanticMediaWiki/tests/autoloader.php'
 */
if (PHP_SAPI !== 'cli') {
    die('Not an entry point');
}
if (!defined('MEDIAWIKI')) {
    die('MediaWiki is not available.');
}
if (!class_exists('SemanticMediaWiki') || ($version = SemanticMediaWiki::getVersion()) === null) {
    die("\\Semantic MediaWiki is not available, please check your LocalSettings or Composer settings.\n");
}
// @codingStandardsIgnoreStart phpcs, ignore --sniffs=Generic.Files.LineLength.MaxExceeded
print sprintf("\n%-20s%s\n", "Semantic MediaWiki:", $version . ' (' . implode(', ', SemanticMediaWiki::getEnvironment()) . ')');
// @codingStandardsIgnoreEnd
if (is_readable($path = __DIR__ . '/../vendor/autoload.php')) {
    print sprintf("%-20s%s\n", "MediaWiki:", $GLOBALS['wgVersion'] . " (Extension vendor autoloader)");
} elseif (is_readable($path = __DIR__ . '/../../../vendor/autoload.php')) {
    print sprintf("%-20s%s\n", "MediaWiki:", $GLOBALS['wgVersion'] . " (MediaWiki vendor autoloader)");
} else {
    die('To run tests it is required that packages are installed using Composer.');
}
print sprintf("%-20s%s\n", "Site language:", $GLOBALS['wgLanguageCode']);
$dateTimeUtc = new \DateTime('now', new \DateTimeZone('UTC'));
print sprintf("\n%-20s%s\n", "Execution time:", $dateTimeUtc->format('Y-m-d h:i'));
if (extension_loaded('xdebug') && xdebug_is_enabled()) {
    print sprintf("%-20s%s\n\n", "Xdebug:", phpversion('xdebug') . ' (enabled)');
} else {
    print sprintf("%-20s%s\n\n", "Xdebug:", 'Disabled (or not installed)');