Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (62 sloc) 1.51 KB
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\utilities;
use Craft;
use craft\base\Utility;
/**
* Migrations represents a Migrations utility.
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 3.0.0
*/
class Migrations extends Utility
{
// Static
// =========================================================================
/**
* @inheritdoc
*/
public static function displayName(): string
{
return Craft::t('app', 'Migrations');
}
/**
* @inheritdoc
*/
public static function id(): string
{
return 'migrations';
}
/**
* @inheritdoc
*/
public static function iconPath()
{
return Craft::getAlias('@app/icons/arrow-up.svg');
}
/**
* @inheritdoc
*/
public static function badgeCount(): int
{
return count(Craft::$app->getContentMigrator()->getNewMigrations());
}
/**
* @inheritdoc
*/
public static function contentHtml(): string
{
$view = Craft::$app->getView();
$migrator = Craft::$app->getContentMigrator();
$migrationHistory = $migrator->getMigrationHistory();
$newMigrations = $migrator->getNewMigrations();
return $view->renderTemplate('_components/utilities/Migrations', [
'migrationHistory' => $migrationHistory,
'newMigrations' => $newMigrations
]);
}
}
You can’t perform that action at this time.