本文整理汇总了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);