Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigStorageSchema.php
<?php | <?php | ||||
abstract class PhabricatorConfigStorageSchema extends Phobject { | abstract class PhabricatorConfigStorageSchema extends Phobject { | ||||
const ISSUE_MISSING = 'missing'; | const ISSUE_MISSING = 'missing'; | ||||
const ISSUE_MISSINGKEY = 'missingkey'; | const ISSUE_MISSINGKEY = 'missingkey'; | ||||
const ISSUE_SURPLUS = 'surplus'; | const ISSUE_SURPLUS = 'surplus'; | ||||
const ISSUE_SURPLUSKEY = 'surpluskey'; | const ISSUE_SURPLUSKEY = 'surpluskey'; | ||||
const ISSUE_CHARSET = 'charset'; | const ISSUE_CHARSET = 'charset'; | ||||
const ISSUE_COLLATION = 'collation'; | const ISSUE_COLLATION = 'collation'; | ||||
const ISSUE_COLUMNTYPE = 'columntype'; | const ISSUE_COLUMNTYPE = 'columntype'; | ||||
const ISSUE_NULLABLE = 'nullable'; | const ISSUE_NULLABLE = 'nullable'; | ||||
const ISSUE_KEYCOLUMNS = 'keycolumns'; | const ISSUE_KEYCOLUMNS = 'keycolumns'; | ||||
const ISSUE_UNIQUE = 'unique'; | const ISSUE_UNIQUE = 'unique'; | ||||
const ISSUE_LONGKEY = 'longkey'; | |||||
const ISSUE_SUBWARN = 'subwarn'; | const ISSUE_SUBWARN = 'subwarn'; | ||||
const ISSUE_SUBFAIL = 'subfail'; | const ISSUE_SUBFAIL = 'subfail'; | ||||
const STATUS_OKAY = 'okay'; | const STATUS_OKAY = 'okay'; | ||||
const STATUS_WARN = 'warn'; | const STATUS_WARN = 'warn'; | ||||
const STATUS_FAIL = 'fail'; | const STATUS_FAIL = 'fail'; | ||||
private $issues = array(); | private $issues = array(); | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | switch ($issue) { | ||||
case self::ISSUE_COLUMNTYPE: | case self::ISSUE_COLUMNTYPE: | ||||
return pht('Wrong Column Type'); | return pht('Wrong Column Type'); | ||||
case self::ISSUE_NULLABLE: | case self::ISSUE_NULLABLE: | ||||
return pht('Wrong Nullable Setting'); | return pht('Wrong Nullable Setting'); | ||||
case self::ISSUE_KEYCOLUMNS: | case self::ISSUE_KEYCOLUMNS: | ||||
return pht('Key on Wrong Columns'); | return pht('Key on Wrong Columns'); | ||||
case self::ISSUE_UNIQUE: | case self::ISSUE_UNIQUE: | ||||
return pht('Key has Wrong Uniqueness'); | return pht('Key has Wrong Uniqueness'); | ||||
case self::ISSUE_LONGKEY: | |||||
return pht('Key is Too Long'); | |||||
case self::ISSUE_SUBWARN: | case self::ISSUE_SUBWARN: | ||||
return pht('Subschemata Have Warnings'); | return pht('Subschemata Have Warnings'); | ||||
case self::ISSUE_SUBFAIL: | case self::ISSUE_SUBFAIL: | ||||
return pht('Subschemata Have Failures'); | return pht('Subschemata Have Failures'); | ||||
default: | default: | ||||
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | ||||
} | } | ||||
} | } | ||||
Show All 12 Lines | switch ($issue) { | ||||
return pht('This schema can use a better character set.'); | return pht('This schema can use a better character set.'); | ||||
case self::ISSUE_COLLATION: | case self::ISSUE_COLLATION: | ||||
return pht('This schema can use a better collation.'); | return pht('This schema can use a better collation.'); | ||||
case self::ISSUE_COLUMNTYPE: | case self::ISSUE_COLUMNTYPE: | ||||
return pht('This schema can use a better column type.'); | return pht('This schema can use a better column type.'); | ||||
case self::ISSUE_NULLABLE: | case self::ISSUE_NULLABLE: | ||||
return pht('This schema has the wrong nullable setting.'); | return pht('This schema has the wrong nullable setting.'); | ||||
case self::ISSUE_KEYCOLUMNS: | case self::ISSUE_KEYCOLUMNS: | ||||
return pht('This schema is on the wrong columns.'); | return pht('This key is on the wrong columns.'); | ||||
case self::ISSUE_UNIQUE: | case self::ISSUE_UNIQUE: | ||||
return pht('This key has the wrong uniqueness setting.'); | return pht('This key has the wrong uniqueness setting.'); | ||||
case self::ISSUE_LONGKEY: | |||||
return pht('This key is too long for utf8mb4.'); | |||||
case self::ISSUE_SUBWARN: | case self::ISSUE_SUBWARN: | ||||
return pht('Subschemata have setup warnings.'); | return pht('Subschemata have setup warnings.'); | ||||
case self::ISSUE_SUBFAIL: | case self::ISSUE_SUBFAIL: | ||||
return pht('Subschemata have setup failures.'); | return pht('Subschemata have setup failures.'); | ||||
default: | default: | ||||
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | ||||
} | } | ||||
} | } | ||||
public static function getIssueStatus($issue) { | public static function getIssueStatus($issue) { | ||||
switch ($issue) { | switch ($issue) { | ||||
case self::ISSUE_MISSING: | case self::ISSUE_MISSING: | ||||
case self::ISSUE_SURPLUS: | case self::ISSUE_SURPLUS: | ||||
case self::ISSUE_NULLABLE: | case self::ISSUE_NULLABLE: | ||||
case self::ISSUE_SUBFAIL: | case self::ISSUE_SUBFAIL: | ||||
return self::STATUS_FAIL; | return self::STATUS_FAIL; | ||||
case self::ISSUE_SUBWARN: | case self::ISSUE_SUBWARN: | ||||
case self::ISSUE_COLUMNTYPE: | case self::ISSUE_COLUMNTYPE: | ||||
case self::ISSUE_CHARSET: | case self::ISSUE_CHARSET: | ||||
case self::ISSUE_COLLATION: | case self::ISSUE_COLLATION: | ||||
case self::ISSUE_MISSINGKEY: | case self::ISSUE_MISSINGKEY: | ||||
case self::ISSUE_SURPLUSKEY: | case self::ISSUE_SURPLUSKEY: | ||||
case self::ISSUE_UNIQUE: | case self::ISSUE_UNIQUE: | ||||
case self::ISSUE_KEYCOLUMNS: | case self::ISSUE_KEYCOLUMNS: | ||||
case self::ISSUE_LONGKEY: | |||||
return self::STATUS_WARN; | return self::STATUS_WARN; | ||||
default: | default: | ||||
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | ||||
} | } | ||||
} | } | ||||
public static function getStatusSeverity($status) { | public static function getStatusSeverity($status) { | ||||
switch ($status) { | switch ($status) { | ||||
Show All 24 Lines |