Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
Show All 33 Lines | foreach ($this->getOldPatches() as $old_name => $old_patch) { | ||||
} | } | ||||
} | } | ||||
$patches[$old_name] = $old_patch; | $patches[$old_name] = $old_patch; | ||||
} | } | ||||
$root = dirname(phutil_get_library_root('phabricator')); | $root = dirname(phutil_get_library_root('phabricator')); | ||||
$auto_root = $root.'/resources/sql/autopatches/'; | $auto_root = $root.'/resources/sql/autopatches/'; | ||||
$auto_list = Filesystem::listDirectory($auto_root, $include_hidden = false); | $patches += $this->buildPatchesFromDirectory($auto_root); | ||||
sort($auto_list); | |||||
foreach ($auto_list as $auto_patch) { | |||||
$matches = null; | |||||
if (!preg_match('/\.(sql|php)$/', $auto_patch, $matches)) { | |||||
throw new Exception( | |||||
pht( | |||||
'Unknown patch "%s" in "%s", expected ".php" or ".sql" suffix.', | |||||
$auto_patch, | |||||
$auto_root)); | |||||
} | |||||
$patches[$auto_patch] = array( | |||||
'type' => $matches[1], | |||||
'name' => $auto_root.$auto_patch, | |||||
); | |||||
} | |||||
return $patches; | return $patches; | ||||
} | } | ||||
public function getOldPatches() { | public function getOldPatches() { | ||||
return array( | return array( | ||||
'db.audit' => array( | 'db.audit' => array( | ||||
'after' => array( /* First Patch */ ), | 'after' => array( /* First Patch */ ), | ||||
▲ Show 20 Lines • Show All 721 Lines • Show Last 20 Lines |