本文整理汇总了PHP中fs函数的典型用法代码示例。如果您正苦于以下问题:PHP fs函数的具体用法?PHP fs怎么用?PHP fs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fs函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: do_file
function do_file($file)
{
$content = @file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
// TODO: add line number
echo "/* {$file} */\n";
// credit: Mike van Lammeren 2005-02-14
$content = $matches[3][$i];
if (!preg_match('/formatmatters\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
$replace = array('@ *[\\n\\r]+@' => ' ');
$content = preg_replace(array_keys($replace), array_values($replace), $content);
}
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
echo 'ngettext("' . fs($content) . '","' . fs($match[1]) . '",x);' . "\n";
} else {
echo 'gettext("' . fs($content) . '");' . "\n";
}
echo "\n";
}
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:25,代码来源:smarty_to_gettext.php
示例2: do_file
function do_file($file)
{
global $xpaths;
try {
$content = file_get_contents($file);
if (!$content) {
return;
}
$xml = new SimpleXMLElement($content);
if (!$xml) {
return;
}
foreach ($xpaths as $xpath) {
$nodes = $xml->xpath($xpath);
foreach ($nodes as $node) {
$fs = fs($node);
if ($fs) {
print 'gettext("' . fs($node) . '");' . "\n";
}
}
}
} catch (Exception $e) {
return;
}
}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:25,代码来源:manifest2c.php
示例3: do_file
function do_file($file)
{
$content = @file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
print 'ngettext("' . fs($matches[3][$i]) . '","' . fs($match[1]) . '",x);' . "\n";
} else {
print 'gettext("' . fs($matches[3][$i]) . '");' . "\n";
}
}
}
开发者ID:KuberKode,项目名称:grase-www-portal,代码行数:16,代码来源:tsmarty2c.php
示例4: do_file
function do_file($file)
{
$content = @file_get_contents($file);
if (empty($content)) {
return;
}
preg_match_all("@(title=\"(.*?)\")|(>(.*?)<\\/item>)@", $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
$string = $matches[2][$i] ? $matches[2][$i] : $matches[4][$i];
if ($string != '') {
echo "/* {$file} */\n";
//
echo 'gettext("' . fs($string) . '");' . "\n";
}
echo "\n";
}
}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:17,代码来源:xml2c.php
示例5: do_file
function do_file($file)
{
$content = @file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
// TODO: add line number
echo "/* {$file} */\n";
// credit: Mike van Lammeren 2005-02-14
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
print 'ngettext("' . fs($matches[3][$i]) . '","' . fs($match[1]) . '",x);' . "\n";
} else {
print 'gettext("' . fs($matches[3][$i]) . '");' . "\n";
}
}
}
开发者ID:fg-ok,项目名称:codev,代码行数:19,代码来源:tsmarty2c.php
示例6: do_file
function do_file($file)
{
$content = @file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches);
for ($i = 0; $i < count($matches[0]); $i++) {
$output = array();
$output[] = "#: {$file}";
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
$output[] = 'msgid "' . fs($matches[3][$i]) . '"';
$output[] = 'msgid_plural "' . fs($match[1]) . '"';
$output[] = 'msgstr[0] ""';
$output[] = 'msgstr[1] ""';
} else {
$output[] = 'msgid "' . fs($matches[3][$i]) . '"';
$output[] = 'msgstr ""';
}
print implode("\n", $output) . "\n\n";
}
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:23,代码来源:smarty-extractor.php
示例7: do_file
function do_file($file)
{
$pi = pathinfo($file);
$content = file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
/*
preg_match_all(
"/{$ldq}\s*({$cmd})\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\/\\1{$rdq}/",
$content,
$matches
);
*/
// echo "asdasd";
if ($pi['extension'] == 'php') {
$regExp = "\\\$this->i18n->_\\([\\'\"](.*)[\\'\"]\\)";
} else {
$regExp = "{\\\$i18n->_\\([\\'\"]([^']*)[\\'\"]\\)}";
}
preg_match_all("/" . $regExp . "/", $content, $matches);
//if($matches)
// print_r($matches);
//echo $regExp."\n";
for ($i = 0; $i < count($matches[0]); $i++) {
// TODO: add line number
//echo "/* $file */\n"; // credit: Mike van Lammeren 2005-02-14
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i], $match)) {
//echo 'ngettext("'.fs($matches[3][$i]).'","'.fs($match[1]).'",x);'."\n";
} else {
echo 'gettext("' . fs($matches[1][$i]) . '");' . "\n";
}
//echo "\n";
}
}
开发者ID:Eximagen,项目名称:sochi,代码行数:36,代码来源:grab.php
示例8: do_file
function do_file($outfile, $file)
{
$content = file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}+([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches, PREG_OFFSET_CAPTURE);
$result_msgctxt = array();
//msgctxt -> msgid based content
$result_msgid = array();
//only msgid based content
for ($i = 0; $i < count($matches[0]); $i++) {
$msg_ctxt = null;
$plural = null;
if (preg_match('/context\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i][0], $match)) {
$msg_ctxt = $match[1];
}
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i][0], $match)) {
$msgid = $matches[3][$i][0];
$plural = $match[1];
} else {
$msgid = $matches[3][$i][0];
}
if ($msg_ctxt && empty($result_msgctxt[$msg_ctxt])) {
$result_msgctxt[$msg_ctxt] = array();
}
if ($msg_ctxt && empty($result_msgctxt[$msg_ctxt][$msgid])) {
$result_msgctxt[$msg_ctxt][$msgid] = array();
} elseif (empty($result_msgid[$msgid])) {
$result_msgid[$msgid] = array();
}
if ($plural) {
if ($msg_ctxt) {
$result_msgctxt[$msg_ctxt][$msgid]['plural'] = $plural;
} else {
$result_msgid[$msgid]['plural'] = $plural;
}
}
$lineno = lineno_from_offset($content, $matches[2][$i][1]);
if ($msg_ctxt) {
$result_msgctxt[$msg_ctxt][$msgid]['lineno'][] = "{$file}:{$lineno}";
} else {
$result_msgid[$msgid]['lineno'][] = "{$file}:{$lineno}";
}
}
ob_start();
echo MSGID_HEADER;
foreach ($result_msgctxt as $msgctxt => $data_msgid) {
foreach ($data_msgid as $msgid => $data) {
echo "#: ", join(' ', $data['lineno']), "\n";
echo 'msgctxt "' . fs($msgctxt) . '"', "\n";
echo 'msgid "' . fs($msgid) . '"', "\n";
if (isset($data['plural'])) {
echo 'msgid_plural "' . fs($data['plural']) . '"', "\n";
echo 'msgstr[0] ""', "\n";
echo 'msgstr[1] ""', "\n";
} else {
echo 'msgstr ""', "\n";
}
echo "\n";
}
}
//without msgctxt
foreach ($result_msgid as $msgid => $data) {
echo "#: ", join(' ', $data['lineno']), "\n";
echo 'msgid "' . fs($msgid) . '"', "\n";
if (isset($data['plural'])) {
echo 'msgid_plural "' . fs($data['plural']) . '"', "\n";
echo 'msgstr[0] ""', "\n";
echo 'msgstr[1] ""', "\n";
} else {
echo 'msgstr ""', "\n";
}
echo "\n";
}
$out = ob_get_contents();
ob_end_clean();
msgmerge($outfile, $out);
}
开发者ID:smarty-gettext,项目名称:smarty-gettext,代码行数:80,代码来源:tsmarty2c.php
示例9: foreach
if (defined('WP_FS__DEV_MODE') && WP_FS__DEV_MODE) {
?>
<th></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($addons_to_show as $addon_id) {
?>
<?php
$addon = $fs->get_addon($addon_id);
$is_addon_activated = $fs->is_addon_activated($addon->slug);
$fs_addon = $is_addon_activated ? fs($addon->slug) : false;
?>
<tr>
<td>
<?php
echo $addon->title;
?>
</td>
<?php
if ($is_addon_activated) {
?>
<?php
// Add-on Installed
?>
<?php
$addon_site = $fs_addon->get_site();
开发者ID:robertoAg,项目名称:wordpress_humor,代码行数:31,代码来源:account.php
示例10: do_file
function do_file($outfile, $file)
{
$content = file_get_contents($file);
if (empty($content)) {
return;
}
global $ldq, $rdq, $cmd;
preg_match_all("/{$ldq}\\s*({$cmd})\\s*([^{$rdq}]*){$rdq}+([^{$ldq}]*){$ldq}\\/\\1{$rdq}/", $content, $matches, PREG_OFFSET_CAPTURE);
$msgids = array();
$msgids_plural = array();
for ($i = 0; $i < count($matches[0]); $i++) {
if (preg_match('/plural\\s*=\\s*["\']?\\s*(.[^\\"\']*)\\s*["\']?/', $matches[2][$i][0], $match)) {
$msgid = $matches[3][$i][0];
$msgids_plural[$msgid] = $match[1];
} else {
$msgid = $matches[3][$i][0];
}
$lineno = lineno_from_offset($content, $matches[2][$i][1]);
$msgids[$msgid][] = "{$file}:{$lineno}";
}
ob_start();
echo MSGID_HEADER;
foreach ($msgids as $msgid => $files) {
echo "#: ", join(' ', $files), "\n";
if (isset($msgids_plural[$msgid])) {
echo 'msgid "' . fs($msgid) . '"', "\n";
echo 'msgid_plural "' . fs($msgids_plural[$msgid]) . '"', "\n";
echo 'msgstr[0] ""', "\n";
echo 'msgstr[1] ""', "\n";
} else {
echo 'msgid "' . fs($msgid) . '"', "\n";
echo 'msgstr ""', "\n";
}
echo "\n";
}
$out = ob_get_contents();
ob_end_clean();
msgmerge($outfile, $out);
}
开发者ID:Zaglov,项目名称:smarty-gettext,代码行数:39,代码来源:tsmarty2c.php
示例11: fs
<?php
$slug = $VARS['slug'];
$fs = fs($slug);
?>
<div class="wrap">
<h2 class="nav-tab-wrapper">
<a href="<?php
echo $fs->get_account_url();
?>
" class="nav-tab nav-tab-active"><?php
_e('Account', WP_FS__SLUG);
?>
</a>
<a href="<?php
echo fs_get_admin_plugin_url('addons');
?>
" class="nav-tab"><?php
_e('Add Ons', WP_FS__SLUG);
?>
</a>
<?php
if (!$fs->_rw_execute_over()) {
?>
<a href="<?php
echo $fs->get_upgrade_url();
?>
" class="nav-tab"><?php
_e('Upgrade', WP_FS__SLUG);
?>
开发者ID:AlexOreshkevich,项目名称:velomode.by,代码行数:31,代码来源:user-account.php
示例12: fs_ui_action_link
function fs_ui_action_link($slug, $page, $action, $title, $params = array())
{
?>
<a class="" href="<?php
echo wp_nonce_url(fs($slug)->_get_admin_page_url($page, array_merge($params, array('fs_action' => $action))), $action);
?>
"><?php
echo $title;
?>
</a><?php
}
开发者ID:kitchenseeker,项目名称:www,代码行数:11,代码来源:fs-core-functions.php
示例13: implode
$query = implode(" AND ", $query);
$items = q("select * from productos where " . $query . " order by nombre");
if ($items) {
//$out .= '<h3><a href="#">Contenidos</a></h3>';
foreach ($items as $item) {
$foto = array();
$img = a("select nombre, tabla from files where item_id = " . $item['id'] . " AND tipo = 'imagenes' and tabla = 'productos' order by orden");
$phpt = new PhpT();
$phpt->fileName = $img['nombre'];
$phpt->fileTitle = $item['nombre'];
$phpt->params = array('w' => 37, 'h' => 37, 'zc' => 1);
$phpt->folder = $img['tabla'];
$highlight1 = new highlight(cortar($item['nombre'], 40), $_POST['termino']);
$hiTitulo = $highlight1->output_text;
$hiTituloWords = $highlight1->output_words;
$hiTituloWords = fs($hiTituloWords, ' ', '');
$highlight2 = new highlight(cortar($item['resumen'], 80, array('ending' => '...', 'exact' => true, 'html' => false)), $_POST['termino']);
$hiResumen = $highlight2->output_text;
$foto[] = '<li class="foto">';
if ($img) {
$foto[] = '<a href="producto.php?id=' . $item['id'] . '&words=' . $hiTituloWords . '" title="' . $item['nombre'] . '">';
$foto[] = $phpt->getImgHtml();
$foto[] = '</a></li>';
}
$foto[] = '</li>';
$out[] = '<ul>';
$out[] = join("\n", $foto);
$out[] = '<li class="data"><strong><a href="producto.php?id=' . $item['id'] . '&words=' . $hiTituloWords . '" title="' . $item['nombre'] . '">' . $hiTitulo . '</a></strong><br />';
$out[] = $hiResumen . '</li>';
$out[] = '</ul>';
}
开发者ID:santikrass,项目名称:poliversal,代码行数:31,代码来源:busqueda.php
示例14: fs_init
/**
* @param string $slug
* @param string $developer_id
* @param string $public_key
* @param array $options
*
* @return Freemius
*/
function fs_init($slug, $developer_id, $public_key, array $options)
{
$fs = fs($slug);
$fs->init($developer_id, $public_key, $options);
return $fs;
}
开发者ID:AlexOreshkevich,项目名称:velomode.by,代码行数:14,代码来源:start.php
注:本文中的fs函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论