当前位置: 首页>>代码示例>>PHP>>正文


PHP print_a函数代码示例

本文整理汇总了PHP中print_a函数的典型用法代码示例。如果您正苦于以下问题:PHP print_a函数的具体用法?PHP print_a怎么用?PHP print_a使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_a函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: token

 function token($options)
 {
     if ($options[0] == "thumb") {
         $sub_opts = explode("|", $options[1]);
         foreach ($sub_opts as $opt) {
             $this_opts[] = explode("=", $opt);
         }
         unset($options);
         foreach ($this_opts as $option) {
             $options[$option['0']] = $option[1];
         }
         if (isset($options['file']) && file_exists(path::file("images") . $options['file'])) {
             if (!isset($options['maxw'])) {
                 $options['maxw'] = 20000;
             } else {
                 $options['maxw'] = intval($options['maxw']);
             }
             if (!isset($options['maxh'])) {
                 $options['maxh'] = 20000;
             } else {
                 $options['maxh'] = intval($options['maxh']);
             }
             return $this->create_thumb($options['file'], $options['maxw'], $options['maxh']) . print_a($options, true);
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:wcms,代码行数:26,代码来源:Magic.php

示例2: __construct

    /**
     *
     */
    function __construct()
    {
        $html = '';
        if (!empty($_GET['debug']) && getperms('0')) {
            $debug = true;
            // For future use.
            $text = <<<TEMPL

\t[html][code]Something goes here [b]bold print[/b][/code][/html]

TEMPL;
            $_POST['content'] = $text;
            $_POST['mode'] = 'tohtml';
        } else {
            $debug = false;
        }
        if ($_POST['mode'] == 'tohtml') {
            $html = $this->toHtml($_POST['content']);
        }
        if ($_POST['mode'] == 'tobbcode') {
            $html = $this->toBBcode($_POST['content']);
        }
        if ($debug == true) {
            print_a($html);
            echo "<hr />";
            echo $html;
        } elseif ($this->gzipCompression == true) {
            header('Content-Encoding: gzip');
            $gzipoutput = gzencode($html, 6);
            header('Content-Length: ' . strlen($gzipoutput));
            echo $gzipoutput;
        } else {
            echo $html;
        }
    }
开发者ID:armpit,项目名称:e107,代码行数:38,代码来源:parser.php

示例3: debug

 function debug()
 {
     echo "<h3>Event Functions</h3>";
     print_a($this->functions);
     echo "<h3>Event Includes</h3>";
     print_a($this->includes);
 }
开发者ID:armpit,项目名称:e107,代码行数:7,代码来源:event_class.php

示例4: gitrepo

 /**
  * Update the current Repo. of this e107 installation.  (eg. e107 on github)
  */
 function gitrepo()
 {
     $mes = e107::getMessage();
     $fl = e107::getFile();
     if (is_dir(e_BASE . ".git")) {
         $gitPath = defset('e_GIT', 'git');
         // addo to e107_config.php to
         // Change Dir.
         $cmd = 'cd ' . e_ROOT;
         $mes->addDebug($cmd);
         $text = `{$cmd} 2>&1`;
         // Remove any local changes.
         $cmd = $gitPath . ' reset --hard';
         $mes->addDebug($cmd);
         $text .= `{$cmd} 2>&1`;
         // Run Pull request
         $cmd = $gitPath . ' pull';
         $mes->addDebug($cmd);
         $text .= `{$cmd} 2>&1`;
         $return = print_a($text, true);
         $mes->addSuccess($return);
         if (unlink(e_BASE . "install.php")) {
             $mes->addDebug("Removed install.php");
         }
     } else {
         $mes->addError("No git repo found");
         //TODO LAN
     }
     $fl->chmod(e_BASE . "cron.php", 0755);
     $fl->chmod(e_HANDLER . "bounce_handler.php", 0755);
 }
开发者ID:armpit,项目名称:e107,代码行数:34,代码来源:cron_class.php

示例5: smarty_modifier_printa

/**
 * print_a表示
 *
 * <pre>
 * デバック用表示(print_a)します
 *
 * Example
 * </pre>
 * <code>
 * {$body|printa}
 * </code>
 *
 * @category   BEAR
 * @package    BEAR_Smarty
 * @subpackage Plugin
 * @author     Akihito Koriyama <koriyama@bear-project.net>
 * @copyright  2008-2011 Akihito Koriyama  All rights reserved.
 * @license    http://opensource.org/licenses/bsd-license.php BSD
 * @version    SVN: Release: @package_version@ $Id: modifier.printa.php 2538 2011-06-12 17:37:53Z koriyama@bear-project.net $
 * @link       http://www.bear-project.net/
 * @param string $string 文字列
 *
 * @return $string
 */
function smarty_modifier_printa($string)
{
    if (!function_exists('print_a')) {
        include 'BEAR/vendors/debuglib.php';
    }
    $string = print_a($string, "return:true");
    return $string;
}
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:32,代码来源:modifier.printa.php

示例6: outputPrint

/**
 * 変数画面出力
 *
 * @param array $values  値
 * @param array $options オプション
 *
 * @return BEAR_Ro
 */
function outputPrint($values, array $options)
{
    $body = print_a($values, 'return:1');
    $headers = array('X-BEAR-Output: PRINT' => 'Content-Type: text/html; charset=utf-8');
    $ro = BEAR::factory('BEAR_Ro');
    $ro->setBody($body);
    $ro->setHeaders($headers);
    return $ro;
}
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:17,代码来源:print.php

示例7: process

 /**
  * Process Posted Data.
  * @param $ui admin-ui object
  */
 public function process($ui, $id = 0)
 {
     $data = $ui->getPosted();
     $action = $ui->getAction();
     // current mode: create, edit, list
     //e107::getHybridAuth('twitter');
     e107::getMessage()->addDebug("e107_plugins/social/e_admin.php :: process method called.");
     e107::getMessage()->addDebug("ID: " . $id);
     e107::getMessage()->addDebug("Action: " . $action);
     e107::getMessage()->addDebug(print_a($data, true));
 }
开发者ID:armpit,项目名称:e107,代码行数:15,代码来源:e_admin.php

示例8: d

 /**
  * Outputs a debug message, and optionally a variable's content.
  *
  * @param string $msg Message to output.
  * @param mixed $var Variable to be shown.
  */
 function d($msg, $var = NULL)
 {
     echo '<span>Debug: ' . nl2br($msg) . '</span><br>';
     if (!is_null($var)) {
         if (is_array($var)) {
             print_a($var, 0, TRUE);
         } else {
             print_a(array(gettype($var) => $var), 0, TRUE);
         }
     }
 }
开发者ID:JAMNConsultoria,项目名称:cataforte,代码行数:17,代码来源:debug.php

示例9: __construct

 function __construct()
 {
     $mes = e107::getMessage();
     $frm = e107::getForm();
     $tp = e107::getParser();
     //	$this->simulation();
     $mailoutPlugins = e107::getConfig()->get('e_mailout_list');
     if (empty($_GET['id'])) {
         return;
     }
     $tmp = base64_decode($_GET['id']);
     parse_str($tmp, $data);
     $data['plugin'] = $tp->filter($data['plugin'], 'str');
     $data['email'] = $tp->filter($data['email'], 'email');
     e107::getMessage()->addDebug(print_a($data, true));
     $plugin = vartrue($data['plugin'], false);
     if (empty($data) || !e107::isInstalled($plugin) || !in_array($plugin, $mailoutPlugins)) {
         $this->invalidURL();
         return;
     }
     $ml = e107::getAddon($plugin, 'e_mailout');
     if (!empty($data['userclass'])) {
         $data['userclass'] = intval($data['userclass']);
         $listName = e107::getUserClass()->getName($data['userclass']);
     } else {
         $listName = $ml->mailerName;
     }
     if (vartrue($_POST['remove']) && !empty($data)) {
         if ($ml->unsubscribe('process', $data) != false) {
             $text = "<p><b>" . $data['email'] . "</b> has been removed from " . $listName . ".</p>";
             $mes->addSuccess($text);
         } else {
             $text = "<p>There was a problem when attempting to remove <b>" . $data['email'] . "</b> from " . $listName . ".</p>";
             $mes->addError($text);
         }
         echo "<div class='container'>" . $mes->render() . "</div>";
         return;
     }
     if ($ml->unsubscribe('check', $data) != false) {
         $text = "<p>We are very sorry for the inconvenience. <br />Please click the button below to remove <b>" . $data['email'] . "</b> from <i>" . $listName . "</i>.</p>";
         $text .= $frm->open('unsub', 'post', e_REQUEST_URI);
         $text .= $frm->button('remove', 'Remove ', 'submit');
         $text .= $frm->close();
         $mes->setTitle('Unsubscribe', E_MESSAGE_INFO)->addInfo($text);
         echo "<div class='container'>" . $mes->render() . "</div>";
         return;
     } else {
         $this->invalidURL();
         return;
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:51,代码来源:unsubscribe.php

示例10: sc_featurebox

 /**
  * Available parameters (GET string format)
  * - cols (integer): number of items per column, default 1
  * - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
  * - tablestyle (string): mode to be used with <code>tablerender()</code>, default 'featurebox'
  * - notablestyle (null): if isset - disable <code>tablerender()</code>
  * - force (boolean): force category model load , default false
  * - ids (string): comma separated id list - load specific featurebox items, default empty 
  * 
  * @param string $parm parameters
  * @param string $mod category template
  * @example {FEATUREBOX=cols=2|tabs}
  */
 function sc_featurebox($parm = null, $mod = '')
 {
     if ($parm == null && $mod == '') {
         $type = vartrue(e107::getPlugPref('featurebox', 'menu_category'), 'bootstrap_carousel');
         $text = e107::getParser()->parseTemplate("{FEATUREBOX|" . $type . "}");
         return $text;
     }
     // TODO cache
     if (!e107::isInstalled('featurebox')) {
         return '';
     }
     if (!$mod) {
         $ctemplate = 'default';
     } else {
         $ctemplate = $mod;
     }
     parse_str($parm, $parm);
     $category = $this->getCategoryModel($ctemplate, vartrue($parm['force']) ? true : false);
     $defopt = array('force' => 0, 'no_fill_empty' => 0, 'tablestyle' => 'featurebox', 'cols' => 1, 'ids' => '', 'notablestyle' => null);
     // reset to default, update current
     $category->setParams($defopt)->updateParams($parm);
     if (!$category->hasData()) {
         return '';
     }
     $tmpl = $this->getFboxTemplate($ctemplate);
     $type = vartrue($tmpl['js_type'], '');
     // Legacy support (prototype.js)
     if (vartrue($tmpl['js'])) {
         $tmp = explode(',', $tmpl['js']);
         foreach ($tmp as $file) {
             e107::js('footer', $file, $type);
         }
     }
     $tp = e107::getParser();
     if (vartrue($tmpl['js_inline'])) {
         $data = $tp->toText($category->getData('fb_category_parms'));
         $jsInline = str_replace("{FEATUREBOX_PARMS}", "{" . trim($data) . "}", $tmpl['js_inline']);
         e107::js('footer-inline', $jsInline, $type, 3);
     }
     // Fix - don't use tablerender if no result (category could contain hidden items)
     $ret = $this->render($category, $ctemplate, $parm);
     if (empty($ret)) {
         e107::getMessage()->addDebug('Featurebox returned nothing.')->addDebug('Category: ' . print_a($category, true))->addDebug('Template: ' . $ctemplate)->addDebug('Param: ' . print_a($parm, true));
         return '';
     }
     $ret = $tp->parseTemplate($tmpl['list_start'], true, $category) . $ret . $tp->parseTemplate($tmpl['list_end'], true, $category);
     if (isset($parm['notablestyle'])) {
         return $ret;
     }
     return e107::getRender()->tablerender(LAN_PLUGIN_FEATUREBOX_NAME, $ret, vartrue($parm['tablestyle'], 'featurebox'), true);
 }
开发者ID:armpit,项目名称:e107,代码行数:64,代码来源:e_shortcode.php

示例11: init

 function init()
 {
     if (!empty($_POST['version'])) {
         $this->version = $_POST['version'];
     }
     if (!empty($_POST['baseUrl'])) {
         $this->baseUrl = $_POST['baseUrl'];
     }
     if (!empty($_POST['basePath'])) {
         $this->basePath = $_POST['basePath'];
     }
     if (!empty($_POST)) {
         e107::getMessage()->addDebug(print_a($_POST, true));
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:15,代码来源:drupal_import_class.php

示例12: actionTest

 public function actionTest()
 {
     echo 'Login controller<br /><br />';
     if (isset($_GET['lgt'])) {
         e107::getUser()->logout();
     }
     echo 'Logged in: ' . (e107::getUser()->isUser() ? 'true' : 'false');
     $provider = e107::getUser()->getProvider();
     if ($provider) {
         print_a($provider->getUserProfile());
     }
     echo '<br /><br /><a href="' . e107::getUrl()->create('system/xup/test?lgt') . '">Test logout</a>';
     echo '<br /><a href="' . e107::getUrl()->create('system/xup/login?provider=Facebook') . '">Test login with Facebook</a>';
     echo '<br /><a href="' . e107::getUrl()->create('system/xup/signup?provider=Facebook') . '">Test signup with Facebook</a>';
 }
开发者ID:notzen,项目名称:e107,代码行数:15,代码来源:xup.php

示例13: render2

 function render2()
 {
     $mes = e107::getMessage();
     $admin_cat = e107::getNav()->adminCats();
     $text = "<div class='center'>\n        \t   \n        \t\t\t<ul class='nav nav-tabs'>";
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         // $text .= "<li id='tab-main_".$cat_key."' ><span style='white-space:nowrap'><img class='icon S16' src='".$admin_cat['img'][$cat_key]."' alt='' style='margin-right:3px' /><a href='#core-main_".$cat_key."'>".$admin_cat['title'][$cat_key]."</a></span></li>";
         $text .= "<li id='tab-main_" . $cat_key . "' ><a data-toggle='tab' href='#core-main_" . $cat_key . "'>" . $admin_cat['title'][$cat_key] . "</a></li>";
     }
     $text .= "</ul>";
     $text .= "<div id='tab-content'>";
     print_a($admin_cat);
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         $text_check = FALSE;
         $text_cat = "";
         if ($cat_key != 5) {
             foreach ($newarray as $key => $funcinfo) {
                 if ($funcinfo[4] == $cat_key) {
                     $text_rend = e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'div');
                     if ($text_rend) {
                         $text_check = TRUE;
                     }
                     $text_cat .= $text_rend;
                 }
             }
         } else {
             $text_rend = e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "div");
             if ($text_rend) {
                 $text_check = TRUE;
             }
             $text_cat .= $text_rend;
         }
         //$text_cat .= render_clean();
         if ($text_check) {
             $text .= "<div class='tab-pane adminform' id='core-main_" . $cat_key . "'>\n";
             $text .= " <div class='main_caption bevel'><b>" . $admin_cat['title'][$cat_key] . "</b></div>";
             $text .= $text_cat;
             $text .= "</div><!-- End tab-pane -->";
         }
     }
     $text .= "</div></div>";
     $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
 }
开发者ID:armpit,项目名称:e107,代码行数:43,代码来源:tabbed.php

示例14: init

 public function init()
 {
     if (e_AJAX_REQUEST) {
         $tp = e107::getParser();
         if (!empty($_POST['pk']) && !empty($_POST['value'])) {
             $cfg = e107::getConfig();
             list($plug, $key) = explode("|", $_POST['pk']);
             if (is_string($cfg->get('e_url_alias'))) {
                 $cfg->setPostedData('e_url_alias', array(e_LAN => array($plug => array($key => $tp->filter($_POST['value'])))), false);
             } else {
                 $cfg->setPref('e_url_alias/' . e_LAN . '/' . $plug . "/" . $key, $tp->filter($_POST['value']));
             }
             $cfg->save(true, true, true);
         }
         //	file_put_contents(e_LOG."e_url.log", print_r($cfg->get('e_url_alias'),true));
         exit;
     }
     $htaccess = file_exists(e_BASE . ".htaccess");
     if (function_exists('apache_get_modules')) {
         $modules = apache_get_modules();
         $modRewrite = in_array('mod_rewrite', $modules);
     } else {
         $modRewrite = true;
         //we don't really know.
     }
     if ($modRewrite === false) {
         e107::getMessage()->addInfo("Apache mod_rewrite was not found on this server and is required to use this feature. ");
         e107::getMessage()->addDebug(print_a($modules, true));
     }
     if ($htaccess && $modRewrite && !deftrue('e_MOD_REWRITE')) {
         e107::getMessage()->addInfo("Mod-rewrite is disabled. To enable, please add the following line to your <b>e107_config.php</b> file:<br /><pre>define('e_MOD_REWRITE',true);</pre>");
     }
     if (is_array($_POST['rebuild'])) {
         $table = key($_POST['rebuild']);
         list($primary, $input, $output) = explode("::", $_POST['rebuild'][$table]);
         $this->rebuild($table, $primary, $input, $output);
     }
     $this->api = e107::getInstance();
     $this->addTitle(LAN_EURL_NAME);
     if ($this->getAction() != 'settings') {
         return;
     }
 }
开发者ID:KonzolozZ,项目名称:e107,代码行数:43,代码来源:eurl.php

示例15: onInit

    /**
     * 初期化
     *
     * @return void
     */
    public function onInit(array $args)
    {
        $q = $args['q'];
        $argv = explode(' ', $q);
        switch (true) {
            case $q == 'help':
                $help = <<<END
Commands:
  clear        clear screen
  config       show application configulation.
  info         show server info.
  bear         bear command, type bear -h for more info.
END;
                $this->_ajax->addAjax('js', array('shell' => "<pre>{$help}</pre>"));
                break;
            case $q == 'clear':
                $this->_ajax->addAjax('js', array('clear' => ''));
                break;
            case $q == 'config':
                $app = BEAR::get('app');
                $info = '<strong>app<strong><br />' . print_a($app, 'return:1');
                $this->_ajax->addAjax('js', array('shell' => $info));
                break;
            case $q == 'info':
                $info = '<strong>$_SERVER<strong><br />';
                $info .= print_a($_SERVER, 'return:1');
                $info .= '<strong>$_ENV<strong><br />';
                $info .= print_a($_ENV, 'return:1');
                $info .= '<strong>$_COOKIE<strong><br />';
                $info .= print_a($_COOKIE, 'return:1');
                $this->_ajax->addAjax('js', array('shell' => $info));
                break;
            case isset($argv[0]) && $argv[0] === 'bear':
                //bearコマンド
                $this->_shell($argv);
                break;
            default:
                $this->_ajax->addAjax('js', array('shell' => "BEAR: {$argv[0]}: Command not found<br/>"));
                break;
        }
    }
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:46,代码来源:shell.php


注:本文中的print_a函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。