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_SURPLUS = 'surplus'; | const ISSUE_SURPLUS = 'surplus'; | ||||
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_SUBNOTE = 'subnote'; | const ISSUE_SUBNOTE = 'subnote'; | ||||
const ISSUE_SUBWARN = 'subwarn'; | const ISSUE_SUBWARN = 'subwarn'; | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | public function getStatus() { | ||||
} | } | ||||
return $status; | return $status; | ||||
} | } | ||||
public static function getIssueName($issue) { | public static function getIssueName($issue) { | ||||
switch ($issue) { | switch ($issue) { | ||||
case self::ISSUE_MISSING: | case self::ISSUE_MISSING: | ||||
return pht('Missing'); | return pht('Missing'); | ||||
case self::ISSUE_MISSINGKEY: | |||||
return pht('Missing Key'); | |||||
case self::ISSUE_SURPLUS: | case self::ISSUE_SURPLUS: | ||||
return pht('Surplus'); | return pht('Surplus'); | ||||
case self::ISSUE_SURPLUSKEY: | |||||
return pht('Surplus Key'); | |||||
case self::ISSUE_CHARSET: | case self::ISSUE_CHARSET: | ||||
return pht('Better Character Set Available'); | return pht('Better Character Set Available'); | ||||
case self::ISSUE_COLLATION: | case self::ISSUE_COLLATION: | ||||
return pht('Better Collation Available'); | return pht('Better Collation Available'); | ||||
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'); | ||||
Show All 11 Lines | switch ($issue) { | ||||
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | ||||
} | } | ||||
} | } | ||||
public static function getIssueDescription($issue) { | public static function getIssueDescription($issue) { | ||||
switch ($issue) { | switch ($issue) { | ||||
case self::ISSUE_MISSING: | case self::ISSUE_MISSING: | ||||
return pht('This schema is expected to exist, but does not.'); | return pht('This schema is expected to exist, but does not.'); | ||||
case self::ISSUE_MISSINGKEY: | |||||
return pht('This key is expected to exist, but does not.'); | |||||
case self::ISSUE_SURPLUS: | case self::ISSUE_SURPLUS: | ||||
return pht('This schema is not expected to exist.'); | return pht('This schema is not expected to exist.'); | ||||
case self::ISSUE_SURPLUSKEY: | |||||
return pht('This key is not expected to exist.'); | |||||
case self::ISSUE_CHARSET: | case self::ISSUE_CHARSET: | ||||
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.'); | ||||
Show All 10 Lines | switch ($issue) { | ||||
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_MISSINGKEY: | |||||
case self::ISSUE_SUBFAIL: | case self::ISSUE_SUBFAIL: | ||||
return self::STATUS_FAIL; | return self::STATUS_FAIL; | ||||
case self::ISSUE_SURPLUS: | case self::ISSUE_SURPLUS: | ||||
case self::ISSUE_COLUMNTYPE: | case self::ISSUE_SURPLUSKEY: | ||||
case self::ISSUE_SUBWARN: | case self::ISSUE_SUBWARN: | ||||
case self::ISSUE_COLUMNTYPE: | |||||
case self::ISSUE_KEYCOLUMNS: | case self::ISSUE_KEYCOLUMNS: | ||||
case self::ISSUE_NULLABLE: | |||||
case self::ISSUE_UNIQUE: | case self::ISSUE_UNIQUE: | ||||
case self::ISSUE_NULLABLE: | |||||
return self::STATUS_WARN; | return self::STATUS_WARN; | ||||
case self::ISSUE_SUBNOTE: | case self::ISSUE_SUBNOTE: | ||||
case self::ISSUE_CHARSET: | case self::ISSUE_CHARSET: | ||||
case self::ISSUE_COLLATION: | case self::ISSUE_COLLATION: | ||||
return self::STATUS_NOTE; | return self::STATUS_NOTE; | ||||
default: | default: | ||||
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | throw new Exception(pht('Unknown schema issue "%s"!', $issue)); | ||||
} | } | ||||
Show All 30 Lines |