本文整理匯總了PHP中Variable::poke方法的典型用法代碼示例。如果您正苦於以下問題:PHP Variable::poke方法的具體用法?PHP Variable::poke怎麽用?PHP Variable::poke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Variable
的用法示例。
在下文中一共展示了Variable::poke方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: db_tableExists
}
}
if ($dryRun) {
print "---- DRY RUN ONLY ----\n";
}
$schemaVersion = db_tableExists('Variable') ? Variable::peek('Schema.version', '00000') : '00000';
print "Current schema version is <{$schemaVersion}>\n";
$patchFiles = getPatches(PATCH_DIR, $schemaVersion);
$numPatches = 0;
foreach ($patchFiles as $fileName) {
runPatch(PATCH_DIR . $fileName, $dryRun);
$numPatches++;
$schemaVersion = stripExtension($fileName);
if (!$dryRun) {
// Update after each patch, in case one of the patches terminates with error.
Variable::poke('Schema.version', $schemaVersion);
}
}
print "{$numPatches} patches applied.\n";
print "New schema version is <{$schemaVersion}>\n";
/*****************************************************************/
function getPatches($dir, $after)
{
$result = array();
if ($dirHandle = opendir($dir)) {
while (($fileName = readdir($dirHandle)) !== false) {
if (preg_match(PATCH_REGEXP, $fileName) && stripExtension($fileName) > $after && !StringUtil::endsWith($fileName, '~')) {
$result[] = $fileName;
}
}
closedir($dirHandle);