/**
  * Converts an array to HTML.
  *
  * @param string $id     The identifier to use
  * @param array  $values The array of values
  *
  * @return string An HTML string
  */
 protected function formatArrayAsHtml($id, $values)
 {
     $id = ucfirst(strtolower($id));
     return '
 <h2>' . $id . ' ' . $this->getToggler('sfWebDebug' . $id) . '</h2>
 <div id="sfWebDebug' . $id . '" style="display: none"><pre>' . htmlspecialchars(sfYaml::dump(sfDebug::removeObjects($values)), ENT_QUOTES, sfConfig::get('sf_charset')) . '</pre></div>
 ';
 }
Exemplo n.º 2
0
 /**
  * Converts an array to HTML.
  *
  * @param string $id      The identifier to use
  * @param array  $values  The array of values
  *
  * @return string An HTML string
  */
 protected function formatArrayAsHtml($id, $values)
 {
     $id = ucfirst(strtolower($id));
     return '
 <h2>' . $id . ' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug' . $id . '\'); return false;"><img src="' . $this->webDebug->getOption('image_root_path') . '/toggle.gif" alt="Toggle details" /></a></h2>
 <div id="sfWebDebug' . $id . '" style="display: none"><pre>' . htmlspecialchars(sfYaml::dump(sfDebug::removeObjects($values)), ENT_QUOTES, sfConfig::get('sf_charset')) . '</pre></div>
 ';
 }
Exemplo n.º 3
0
 protected function sendConfig()
 {
     $context = sfContext::getInstance();
     $config = array('debug' => sfConfig::get('sf_debug') ? 'on' : 'off', 'xdebug' => extension_loaded('xdebug') ? 'on' : 'off', 'logging' => sfConfig::get('sf_logging_enabled') ? 'on' : 'off', 'cache' => sfConfig::get('sf_cache') ? 'on' : 'off', 'compression' => sfConfig::get('sf_compressed') ? 'on' : 'off', 'tokenizer' => function_exists('token_get_all') ? 'on' : 'off', 'eaccelerator' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable') ? 'on' : 'off', 'apc' => extension_loaded('apc') && ini_get('apc.enabled') ? 'on' : 'off', 'xcache' => extension_loaded('xcache') && ini_get('xcache.cacher') ? 'on' : 'off', 'request' => sfDebug::removeObjects(sfDebug::requestAsArray($context->getRequest())), 'response' => sfDebug::removeObjects(sfDebug::responseAsArray($context->getResponse())), 'user' => sfDebug::removeObjects(sfDebug::userAsArray($context->getUser())), 'settings' => sfDebug::removeObjects(sfDebug::settingsAsArray()), 'globals' => sfDebug::removeObjects(sfDebug::globalsAsArray()), 'php' => sfDebug::removeObjects(sfDebug::phpInfoAsArray()), 'symfony' => sfDebug::removeObjects(sfDebug::symfonyInfoAsArray()));
     $this->sfFire->dump('Config', $config);
 }
Exemplo n.º 4
0
<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once dirname(__FILE__) . '/../../bootstrap/unit.php';
$t = new lime_test(1);
// ::removeObjects()
$t->diag('::removeObjects()');
$objectArray = array('foo', 42, new sfDebug(), array('bar', 23, new lime_test(null)));
$cleanedArray = array('foo', 42, 'sfDebug Object()', array('bar', 23, 'lime_test Object()'));
$t->is_deeply(sfDebug::removeObjects($objectArray), $cleanedArray, '::removeObjects() converts objects to String representations using the class name');