本文整理汇总了PHP中fb函数的典型用法代码示例。如果您正苦于以下问题:PHP fb函数的具体用法?PHP fb怎么用?PHP fb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit()
{
$id = (int) $_GET['id'];
if (!empty($_POST)) {
$level = $this->category->get_level($_POST['p_id']);
if ($level <= 3 && $level > 0) {
$data = array('id' => $id, 'name' => $_POST['name'], 'intro' => $_POST['intro'], 'sort' => $_POST['sort'], 'pid' => $_POST['p_id'], 'level' => $level);
$this->category->save($data);
$this->success('更新成功', '/category');
return;
} else {
$this->success('更新失败,最大分类不能超过三级', '/category/edit?id=' . $id);
}
}
$p_name = '根节点';
$categories = $this->category->format_tree($this->category->get_all());
$root = array(array('id' => -1, 'pId' => 0, 'name' => $p_name));
$categories = array_merge($root, $categories);
fb($categories);
$category = $this->category->find($id);
foreach ($categories as $value) {
if ($value['id'] == $category['pid']) {
$p_name = $value['name'];
}
}
$this->assign('categories', $categories);
$this->assign('category', $category);
$this->assign('p_name', $p_name);
$this->display();
}
开发者ID:qinzhi,项目名称:taoj,代码行数:30,代码来源:CategoryController.class.php
示例2: ajax_carga_capa
/**
*
*/
public function ajax_carga_capa()
{
header('Content-type: application/json');
$this->load->library("visor/capa/visor_capa_elemento");
$params = $this->input->post(null, true);
$data = array("correcto" => true, "capa" => array("zona" => "", "icono" => "", "nombre" => "", "color" => "", "json" => array()));
/*$regiones_usuario = explode(",",$this->session->userdata('session_regiones'));
foreach($regiones_usuario as $region){
$retorno = $this->visor_capa_elemento->cargaCapasRegion($region);
$data["capa"]["nombre"] = $retorno["capa"]["nombre"];
$data["capa"]["icono"] = $retorno["capa"]["icono"];
$data["capa"]["color"] = $retorno["capa"]["color"];
$data["capa"]["zona"] = $retorno["capa"]["zona"];
if(is_array($retorno["capa"]["json"])){
$data["capa"]["json"] = array_merge($retorno["capa"]["json"], $data["capa"]["json"]);
}
}*/
foreach ($params["emergencia"] as $id_emergencia) {
fb($id_emergencia);
$this->visor_capa_elemento->setEmergencia($id_emergencia);
$retorno = $this->visor_capa_elemento->cargaCapa($params["id"]);
$data["capa"]["nombre"] = $retorno["capa"]["nombre"];
$data["capa"]["icono"] = $retorno["capa"]["icono"];
$data["capa"]["color"] = $retorno["capa"]["color"];
$data["capa"]["zona"] = $retorno["capa"]["zona"];
if (is_array($retorno["capa"]["json"])) {
$data["capa"]["json"] = array_merge($retorno["capa"]["json"], $data["capa"]["json"]);
}
}
echo json_encode($data);
}
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:36,代码来源:mapa_publico_evento.php
示例3: showTrace
/**
+----------------------------------------------------------
* 显示页面Trace信息
+----------------------------------------------------------
* @access private
+----------------------------------------------------------
*/
private function showTrace()
{
// 系统默认显示信息
$log = Log::$log;
$files = get_included_files();
$trace = array('请求时间' => date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']), '当前页面' => __SELF__, '请求协议' => $_SERVER['SERVER_PROTOCOL'] . ' ' . $_SERVER['REQUEST_METHOD'], '运行信息' => $this->showTime(), '会话ID' => session_id(), '日志记录' => !empty($log) ? $log : '无日志记录', '加载文件' => $files);
// 读取项目定义的Trace文件
$traceFile = CONF_PATH . 'trace.php';
if (is_file($traceFile)) {
// 定义格式 return array('当前页面'=>$_SERVER['PHP_SELF'],'通信协议'=>$_SERVER['SERVER_PROTOCOL'],...);
$trace = array_merge(include $traceFile, $trace);
}
// 设置trace信息
trace($trace);
$fire = array(array('', ''));
foreach (trace() as $key => $value) {
$fire[] = array($key, $value);
}
if (headers_sent($filename, $linenum)) {
$fileInfo = !empty($filename) ? "(在{$filename}文件的第{$linenum}行)" : '';
Log::record("已经有Http Header信息头输出{$fileInfo},请在你的入口文件加入ob_start() 或通过配置output_buffering,已确保headers不被提前输出");
} else {
fb(array('页面Trace信息', $fire), FirePHP::TABLE);
}
}
开发者ID:chenyongze,项目名称:januarybuy_develop,代码行数:32,代码来源:FireShowPageTraceBehavior.class.php
示例4: beforeSave
/**
* 修改之前,如果没有修改权限的权力,而且又对权限进行了修改,则强制失败并提示
* @see \yii\db\BaseActiveRecord::beforeSave($insert)
*/
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if ($insert) {
//新建插入
//没有新建的权限(插入前检查)
// Yii::$app->getSession()->setFlash('denger', 'You do not have permission to modify the user permissions!');
// return false;
} else {
//更新
$is_admin = Yii::$app->getUser()->getIdentity()->attributes['is_admin'];
if (!$is_admin && !Yii::$app->getUser()->can('auth/auth')) {
//无权修改
fb('ddd');
exit;
//如果修改了权限则
if ($this->getAttribute('role_name') != $this->getOldAttribute('role_name')) {
$this->setAttribute('role_name', $this->getOldAttribute('role_name'));
//恢复并提示
Yii::$app->getSession()->setFlash('warning', 'You do not have permission to modify the user permissions!');
}
}
}
return true;
} else {
return false;
}
}
开发者ID:jorry2008,项目名称:turen,代码行数:32,代码来源:User.php
示例5: getAllNetworksByAid
public static function getAllNetworksByAid($aid)
{
$sdb = SDB::getInstance();
$domain = Network::$SDBDomain;
$aaa = array();
foreach (Network::$SDBFields as $field => $meta) {
$aaa[] = $field;
}
$where = "where `aid` = '{$aid}'";
if (!$sdb->select($domain, $aaa, $where)) {
return null;
}
fb("aaa", $aaa);
$appNetworks = array();
foreach ($aaa as $aa) {
$appNetwork = new Network();
foreach (Network::$SDBFields as $field => $meta) {
if (array_key_exists($field, $aa)) {
$appNetwork->{$field} = $aa[$field];
}
}
$appNetwork->id = $aa['id'];
$appNetwork->postGet();
$appNetworks[] = $appNetwork;
}
return $appNetworks;
}
开发者ID:amoikevin,项目名称:adwhirl.servers-website,代码行数:27,代码来源:NetworkUtil.php
示例6: listaByCapaPropiedad
/**
* Lista la capa por una propiedad del elemento
* @param int $id_capa
* @param string $string
* @return html
*/
public function listaByCapaPropiedad($id_capa, $string)
{
$query = $this->_query->select("p.*")->from($this->_tabla . " p")->join("capas_geometria g", "g.geometria_id = p.poligono_capitem", "INNER")->whereAND("g.geometria_capa", $id_capa)->whereAND("p.poligono_propiedades", $string, "like");
fb($query->getQuery());
$result = $query->getAllResult();
return $result;
}
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:13,代码来源:capa_detalle_elemento_model.php
示例7: _handle_permission_check_logging
/**
* Log permission checks to the permission_checks.log file
*
* @param MEMBER The user checking against
* @param ID_TEXT The function that was called to check a permission
* @param array Parameters to this permission-checking function
* @param boolean Whether the permission was held
*/
function _handle_permission_check_logging($member, $op, $params, $result)
{
global $PERMISSION_CHECK_LOGGER;
if ($op == 'has_specific_permission') {
require_all_lang();
$params[0] = $params[0] . ' ("' . do_lang('PT_' . $params[0]) . '")';
}
$str = $op;
if (count($params) != 0) {
$str .= ': ';
foreach ($params as $i => $p) {
if ($i != 0) {
$str .= ',';
}
$str .= is_string($p) ? $p : (is_null($p) ? '' : strval($p));
}
}
if ($PERMISSION_CHECK_LOGGER !== false && !$result) {
fwrite($PERMISSION_CHECK_LOGGER, "\t" . $str);
$username = $GLOBALS['FORUM_DRIVER']->get_username($member);
if (is_null($username)) {
$username = do_lang('UNKNOWN');
}
if ($member != get_member()) {
fwrite($PERMISSION_CHECK_LOGGER, ' -- ' . $username);
}
// fwrite($PERMISSION_CHECK_LOGGER,' --> '.($result?do_lang('YES'):do_lang('NO')).chr(10));
fwrite($PERMISSION_CHECK_LOGGER, chr(10));
sync_file(get_custom_file_base() . '/data_custom/permissioncheckslog.php');
}
if (function_exists('fb') && get_param_integer('keep_firephp', 0) == 1 && !headers_sent()) {
fb('Permission check ' . ($result ? 'PASSED' : 'FAILED') . ': ' . $str);
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:permissions2.php
示例8: write
protected function write(array $record)
{
if (function_exists('fb')) {
switch ($record['level_name']) {
case 'DEBUG':
$l = 'LOG';
break;
case 'INFO':
case 'NOTICE':
$l = 'INFO';
break;
case 'WARNING':
$l = 'WARN';
break;
case 'ERROR':
case 'CRITICAL':
case 'ALERT':
case 'EMERGENCY':
$l = 'ERROR';
break;
default:
$l = 'LOG';
break;
}
if (!empty($record['context'])) {
fb($record['context'], $record['message'], $l);
} else {
fb($record['message'], $l);
}
}
}
开发者ID:jenolan,项目名称:jmonolog,代码行数:31,代码来源:jFirebugHandler.php
示例9: kataDebugOutput
/**
* replace internal katadebug-function
*/
function kataDebugOutput($var = null, $isTable = false)
{
if (!$isTable) {
fb($var);
} else {
/*
$widths = array();
foreach ($var as $line) {
$cellNo = 0;
foreach ($line as $cell) {
if (!isset($widths[$cellNo])) { $widths[$cellNo]=0; }
$widths[$cellNo] = max($widths[$cellNo],strlen($cell));
$cellNo++;
}
}
foreach ($var as $line) {
$s = '';
$cellNo = 0;
foreach ($line as $cell) {
$s.=$cell.str_repeat(' ',$widths[$cellNo]-strlen($cell)).' | ';
$cellNo++;
}
fb($s);
}
*/
fb($var, 'see below', FirePHP::TABLE);
}
}
开发者ID:emente,项目名称:kataii---kata-framework-2.x,代码行数:31,代码来源:firephp.php
示例10: index
public function index()
{
$articles = $this->articleModel->getArticles();
fb($articles);
$this->assign('articles', $articles);
$this->display();
}
开发者ID:qinzhi,项目名称:fruiter,代码行数:7,代码来源:ArticleController.class.php
示例11: __construct
function __construct($text1, $text2)
{
$this->text1 = $text1;
$this->text2 = $text2;
$this->get_trial1();
fb($this);
}
开发者ID:laiello,项目名称:firephp,代码行数:7,代码来源:LogPrivateObjectMembers2.php
示例12: js
public function js()
{
$row = $this->input->getInt('row');
$col = $this->input->getInt('col');
$uid = $this->input->getInt('uid');
$count = $row * $col;
$sql = 'SELECT
ads.*
FROM ck_ads as ads
JOIN ck_packages as pack
ON(ads.package_id=pack.id)
WHERE
ads.status="approve" AND
ads.clicked < pack.max_click
ORDER BY RAND()
LIMIT ' . $count;
$query = $this->db->query($sql);
$tmpl = Template::getInstance('empty.tpl');
$tmpl->loadPage('jsAds');
fb($col, 'row');
for ($i = 0; $i < $row; ++$i) {
$tmp = array();
for ($j = 0; $j < $col; ++$j) {
$tmp[] = $query->fetch();
}
$data[] = $tmp;
}
fb($data);
$tmpl->assign('uid', $uid);
$tmpl->assign('row', $row);
$tmpl->assign('col', $col);
$tmpl->assign('data', $data);
Response::getInstance()->setTemplate($tmpl);
}
开发者ID:redknight,项目名称:frot,代码行数:34,代码来源:ClickAdsService.php
示例13: show
public function show()
{
if ($this->input->getString('traceID') || $this->input->getString('traceCode')) {
$this->traceID = $this->input->getString('traceID');
$this->traceCode = $this->input->getString('traceCode');
$this->tmpl->assign('hasResult', true);
$req = array();
$req[] = $this->db->SimpleSelect('sh_requests', 'status,code', array('code' => $this->traceID))->fetch();
$req[] = $this->db->SimpleSelect('sh_requests', 'status,code', array('code' => $this->traceCode))->fetch();
$req[] = $this->db->SimpleSelect('fr_requests', 'status,code', array('code' => $this->traceID))->fetch();
$req[] = $this->db->SimpleSelect('fr_requests', 'status,code', array('code' => $this->traceCode))->fetch();
for ($i = 0; $i < 4; ++$i) {
if ($req[$i] != null) {
if ($i < 2) {
$this->tmpl->assign('shop_type', 'شخصی');
} else {
$this->tmpl->assign('shop_type', 'مشارکتی');
}
$this->tmpl->assign('status', $req[$i]->status);
$this->tmpl->assign('trace_code', $req[$i]->code);
fb($req);
}
}
}
$this->reponse->setTitle('لیست کالاها');
$this->tmpl->loadPage('traceShow');
$this->reponse->setTemplate($this->tmpl);
}
开发者ID:redknight,项目名称:frot,代码行数:28,代码来源:TraceService.php
示例14: _send
protected function _send($content)
{
if (!function_exists('fb')) {
throw new lmbException("FirePHP function 'fb' not found");
}
fb($content, 'new mail');
}
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbFirePHPMailer.class.php
示例15: fbDebug
/**
* firephp debug
*
* @param string $info debug信息
*/
public static function fbDebug($info = '')
{
if (!RThink_Config::get('app.debug')) {
return;
}
require_once 'Debug/Firephp/Fb.php';
fb($info, FirePHP::TRACE);
}
开发者ID:tomorrowdemo,项目名称:haojiaolexue,代码行数:13,代码来源:Debug.php
示例16: _dump
function _dump()
{
if (is_terminal) {
print_r($message);
} else {
fb($message);
}
}
开发者ID:reedboat,项目名称:applib,代码行数:8,代码来源:phpdebug.func.php
示例17: doWell
public function doWell($text)
{
$k = array_keys($this->data);
$v = array_values($this->data);
fb(array_shift($k));
fb(array_shift($v));
return str_replace(array_keys($this->data), array_values($this->data), $text);
}
开发者ID:limitium,项目名称:uberlov,代码行数:8,代码来源:Syncer.php
示例18: select
public function select($domain, &$aaa, $where, $showAliveOnly = true, $attempts = 2)
{
if ($attempts <= 0) {
return;
}
if ($showAliveOnly) {
if (empty($where)) {
$where = "where deleted is null";
} else {
$where .= " intersection deleted is null";
}
}
if (is_array($aaa)) {
$select = "select `" . implode("`, `", $aaa) . "` from `" . $domain . "` " . $where;
} else {
$select = "select {$aaa} from `{$domain}` {$where}";
}
fb($select, "");
$aaa = array();
$selectRequest = new Amazon_SimpleDB_Model_SelectRequest();
$selectRequest->setSelectExpression($select);
try {
do {
$response = $this->service->select($selectRequest);
if ($response->isSetSelectResult()) {
$selectResult = $response->getSelectResult();
$itemList = $selectResult->getItem();
foreach ($itemList as $item) {
$aa = array();
if ($item->isSetName()) {
$aa['id'] = $item->getName();
}
$attributeList = $item->getAttribute();
foreach ($attributeList as $attribute) {
if ($attribute->isSetName()) {
if ($attribute->isSetValue()) {
$aa[$attribute->getName()] = $attribute->getValue();
}
}
}
array_push($aaa, $aa);
$selectRequest->setNextToken($selectResult->getNextToken());
}
}
} while ($selectResult->isSetNextToken());
return true;
} catch (Amazon_SimpleDB_Exception $ex) {
//select($domain, $aaa, $where, $showAliveOnly, $attempts-1);
echo "Caught Exception: " . $ex->getMessage() . "<br />\n";
// echo("Response Status Code: ".$ex->getStatusCode()."<br />\n");
// echo("Error Code: ".$ex->getErrorCode()."<br />\n");
// echo("Error Type: ".$ex->getErrorType()."<br />\n");
// echo("Request ID: ".$ex->getRequestId()."<br />\n");
// echo("XML: ".$ex->getXML()."<br />\n");
// echo("Select: $select<br />\n");
}
return false;
}
开发者ID:idol2001,项目名称:private-ad-mediation,代码行数:58,代码来源:SDB.php
示例19: syncPluginCollection
/**
* 同步指定项目的指定插件
*
* @param string $project_id
* 项目编号
* @param string $plugin_id
* 插件编号
* @param string $collectionName
* 集合名称
* @return true false
*/
public function syncPluginCollection($project_id, $plugin_id, $collectionName)
{
$pluginCollectionInfo = $this->findOne(array('plugin_id' => $plugin_id, 'alias' => $collectionName));
if ($pluginCollectionInfo == null) {
fb('$pluginCollectionInfo is null', 'LOG');
return false;
}
// 同步数据结构
$syncPluginStructure = function ($plugin_id, $collection_id) use($pluginCollectionInfo) {
if ($collection_id instanceof \MongoId) {
$collection_id = $collection_id->__toString();
}
$this->_structure->physicalRemove(array('collection_id' => $collection_id));
// 插入新的数据结构
$cursor = $this->_plugin_structure->find(array('plugin_id' => $plugin_id, 'plugin_collection_id' => $pluginCollectionInfo['_id']->__toString()));
while ($cursor->hasNext()) {
$row = $cursor->getNext();
array_unset_recursive($row, array('_id', 'collection_id', '__CREATE_TIME__', '__MODIFY_TIME__', '__REMOVED__'));
$row['collection_id'] = $collection_id;
$this->_structure->update(array('collection_id' => $collection_id, 'field' => $row['field']), array('$set' => $row), array('upsert' => true));
}
return true;
};
// 添加映射关系
$createMapping = function ($collection_id, $collectionName) use($project_id, $plugin_id) {
if ($collection_id instanceof \MongoId) {
$collection_id = $collection_id->__toString();
}
$projectPluginInfo = $this->_project_plugin->findOne(array('project_id' => $project_id, 'plugin_id' => $plugin_id));
if ($projectPluginInfo !== null) {
$source_project_id = $projectPluginInfo['source_project_id'];
if (!empty($source_project_id)) {
$collectionInfo = $this->_collection->findOne(array('project_id' => $source_project_id, 'plugin_id' => $plugin_id, 'alias' => $collectionName));
$this->_mapping->update(array('project_id' => $project_id, 'collection_id' => $collection_id), array('$set' => array('collection' => 'idatabase_collection_' . myMongoId($collectionInfo['_id']), 'database' => DEFAULT_DATABASE, 'cluster' => DEFAULT_CLUSTER, 'active' => true)), array('upsert' => true));
return true;
}
}
return false;
};
if ($pluginCollectionInfo != null) {
unset($pluginCollectionInfo['_id']);
$collectionInfo = $pluginCollectionInfo;
$collectionInfo['project_id'] = array($project_id);
$check = $this->_collection->findOne(array('project_id' => $project_id, 'alias' => $collectionName));
if ($check == null) {
$this->_collection->insertRef($collectionInfo);
$syncPluginStructure($plugin_id, $collectionInfo['_id']);
$createMapping($collectionInfo['_id'], $collectionName);
return $collectionInfo;
} else {
$this->_collection->update(array('_id' => $check['_id']), array('$set' => $collectionInfo));
$syncPluginStructure($plugin_id, $check['_id']);
$createMapping($check['_id'], $collectionName);
}
return $check;
}
return false;
}
开发者ID:im286er,项目名称:ent,代码行数:69,代码来源:PluginCollection.php
示例20: __construct
/**
*
*
* @param unknown $safeFile
* @param unknown $srid
* @param unknown $file
* @param unknown $pdo
*/
function __construct($safeFile, $srid, $file, $pdo)
{
parent::__construct();
$this->safeFile = $safeFile;
$this->srid = $srid;
$this->file = $file;
$this->pdo = $pdo;
fb($pdo);
}
开发者ID:netconstructor,项目名称:MyGeoCloud,代码行数:17,代码来源:shapefile.php
注:本文中的fb函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论