Differential D13200 Diff 31965 src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php
| Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
| break; | break; | ||||
| case 'sql': | case 'sql': | ||||
| $this->applyPatchSQL($name); | $this->applyPatchSQL($name); | ||||
| break; | break; | ||||
| case 'php': | case 'php': | ||||
| $this->applyPatchPHP($name); | $this->applyPatchPHP($name); | ||||
| break; | break; | ||||
| default: | default: | ||||
| throw new Exception("Unable to apply patch of type '{$type}'."); | throw new Exception(pht("Unable to apply patch of type '%s'.", $type)); | ||||
| } | } | ||||
| } | } | ||||
| public function applyPatchSQL($sql) { | public function applyPatchSQL($sql) { | ||||
| $sql = Filesystem::readFile($sql); | $sql = Filesystem::readFile($sql); | ||||
| $queries = preg_split('/;\s+/', $sql); | $queries = preg_split('/;\s+/', $sql); | ||||
| $queries = array_filter($queries); | $queries = array_filter($queries); | ||||
| ▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines | |||||