本文整理汇总了PHP中Utils_Unicode::lessenAsByte方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_Unicode::lessenAsByte方法的具体用法?PHP Utils_Unicode::lessenAsByte怎么用?PHP Utils_Unicode::lessenAsByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_Unicode
的用法示例。
在下文中一共展示了Utils_Unicode::lessenAsByte方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SyndicateToEolin
/**
* @brief Syndicating routine.
* @see Tag, User, DBModel, Model_Context
*/
function SyndicateToEolin($entryId, $entry, $mode)
{
$context = Model_Context::getInstance();
$blogid = $context->getProperty('blog.id');
$rpc = new XMLRPC();
$rpc->url = 'http://ping.eolin.com/';
$summary = array('blogURL' => $context->getProperty('uri.default'), 'syncURL' => $context->getProperty('uri.default') . "/plugin/abstractToEolin?entryId={$entryId}");
if ($mode == 'create') {
$summary['blogTitle'] = $context->getProperty('blog.title');
$summary['language'] = $context->getProperty('blog.language');
$summary['permalink'] = $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$entry['slogan']}" : $entry['id']);
$summary['title'] = Utils_Unicode::lessenAsByte($entry['title'], 255);
$summary['content'] = Utils_Unicode::lessenAsByte(stripHTML(getEntryContentView($blogid, $entry['id'], $entry['content'], $entry['contentformatter'])), 1023, '');
$summary['author'] = User::authorName($entry['userid'], $entryId);
$summary['tags'] = Tag::getTagsWithEntryId($blogid, $entry);
$summary['location'] = $entry['location'];
$summary['written'] = Timestamp::getRFC1123($entry['published']);
}
return $rpc->call("sync.{$mode}", $summary);
}
示例2: validate
private function validate()
{
if (is_null($this->id)) {
$this->id = $this->getNextId();
}
$this->category = Utils_Unicode::lessenAsByte($this->category, 11);
$this->content = Utils_Unicode::lessenAsByte($this->content, 512);
if (empty($this->author)) {
$this->author = User::getName();
}
$this->author = Utils_Unicode::lessenAsByte($this->author, 32);
if (!Validator::isInteger($this->blogid, 1)) {
return $this->error('blogid');
}
if (!Validator::timestamp($this->created)) {
return $this->error('created');
}
return true;
}
示例3: lessenAsEncoding
static function lessenAsEncoding($str, $length = 255, $tail = '...')
{
$context = Model_Context::getInstance();
if ($context->getProperty('database.utf8') != true) {
return Utils_Unicode::lessen($str, $length, $tail);
} else {
return Utils_Unicode::lessenAsByte($str, $length, $tail);
}
}