本文整理匯總了PHP中Ostatus_profile::escape方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ostatus_profile::escape方法的具體用法?PHP Ostatus_profile::escape怎麽用?PHP Ostatus_profile::escape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Ostatus_profile
的用法示例。
在下文中一共展示了Ostatus_profile::escape方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
echo " - skipping\n";
} else {
echo " - removing bogus user_group entry...";
$evil = User_group::staticGet('id', $group->id);
$evil->delete();
echo " ok\n";
}
}
}
echo "\n";
// Fallback?
echo "Checking for bogus profiles blocking local users/groups by URI pattern match...\n";
$oprofile = new Ostatus_profile();
$marker = mt_rand(31337, 31337000);
$profileTemplate = common_local_url('userbyid', array('id' => $marker));
$encProfile = $oprofile->escape($profileTemplate, true);
$encProfile = str_replace($marker, '%', $encProfile);
echo " LIKE '{$encProfile}'\n";
$groupTemplate = common_local_url('groupbyid', array('id' => $marker));
$encGroup = $oprofile->escape($groupTemplate, true);
$encGroup = str_replace($marker, '%', $encGroup);
echo " LIKE '{$encGroup}'\n";
$sql = "SELECT * FROM ostatus_profile WHERE uri LIKE '%s' OR uri LIKE '%s'";
$oprofile->query(sprintf($sql, $encProfile, $encGroup));
$count = $oprofile->N;
echo "Found {$count}...\n";
while ($oprofile->fetch()) {
$uri = $oprofile->uri;
if (preg_match('!/group/(\\d+)/id!', $oprofile->uri, $matches)) {
$id = intval($matches[1]);
$group = Local_group::staticGet('group_id', $id);