- sfViewCacheManager.class.php
- class sfViewCacheManager
- {
- protected
- $cache = null,
- $cacheConfig = array(),
- $context = null,
- $dispatcher = null,
- $controller = null,
- $routing = null,
- $request = null,
- $loaded = array();
-
- public function __construct($context, sfCache $cache, $options = array())
- {
- $this->initialize($context, $cache, $options);
- }
-
- public function initialize($context, sfCache $cache, $options = array())
- {
- $this->context = $context;
- $this->dispatcher = $context->getEventDispatcher();
- $this->controller = $context->getController();
- $this->request = $context->getRequest();
- $this->options = array_merge(array(
- 'cache_key_use_vary_headers' => true,
- 'cache_key_use_host_name' => true,
- ), $options);
- if (sfConfig::get('sf_web_debug'))
- {
- $this->dispatcher->connect('view.cache.filter_content', array($this, 'decorateContentWithDebug'));
- }
-
- $this->cacheConfig = array();
-
- $this->cache = $cache;
-
- $this->routing = $context->getRouting();
- }
-
- public function getContext()
- {
- return $this->context;
- }
-
- public function getCache()
- {
- return $this->cache;
- }
-
- public function generateCacheKey($internalUri, $hostName = '', $vary = '', $contextualPrefix = '')
- {
- if ($callable = sfConfig::get('sf_cache_namespace_callable'))
- {
- if (!is_callable($callable))
- {
- throw new sfException(sprintf('"%s" cannot be called as a function.', var_export($callable, true)));
- }
- return call_user_func($callable, $internalUri, $hostName, $vary, $contextualPrefix, $this);
- }
- if (strpos($internalUri, '@') === 0 && strpos($internalUri, '@sf_cache_partial') === false)
- {
- throw new sfException('A cache key cannot be generated for an internal URI using the @rule syntax');
- }
- $cacheKey = '';
- if ($this->isContextual($internalUri))
- {
-
- if (!$contextualPrefix)
- {
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($this->routing->getCurrentInternalUri());
- $cacheKey = $this->convertParametersToKey($params);
- }
- else
- {
- $cacheKey = $contextualPrefix;
- }
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($internalUri);
- $cacheKey .= sprintf('/%s/%s/%s', $params['module'], $params['action'], isset($params['sf_cache_key']) ? $params['sf_cache_key'] : '');
- }
- else
- {
-
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($internalUri);
- if ($route_name == 'sf_cache_partial')
- {
- $cacheKey = 'sf_cache_partial/';
- }
- $cacheKey .= $this->convertParametersToKey($params);
- }
- $cacheKey = sprintf('/%s/%s/%s', $this->getCacheKeyHostNamePart($hostName), $this->getCacheKeyVaryHeaderPart($internalUri, $vary), $cacheKey);
-
- $cacheKey = preg_replace('#/+#', '/', $cacheKey);
- return $cacheKey;
- }
-
- protected function getCacheKeyVaryHeaderPart($internalUri, $vary = '')
- {
- if (!$this->options['cache_key_use_vary_headers'])
- {
- return '';
- }
-
- if (!$vary)
- {
- $varyHeaders = $this->getVary($internalUri);
- if (!$varyHeaders)
- {
- return 'all';
- }
- sort($varyHeaders);
- $request = $this->context->getRequest();
- $varys = array();
- foreach ($varyHeaders as $header)
- {
- $varys[] = $header . '-' . preg_replace('/\W+/', '_', $request->getHttpHeader($header));
- }
- $vary = implode($varys, '-');
- }
- return $vary;
- }
-
- protected function getCacheKeyHostNamePart($hostName = '')
- {
- if (!$this->options['cache_key_use_host_name'])
- {
- return '';
- }
- if (!$hostName)
- {
- $hostName = $this->context->getRequest()->getHost();
- }
- $hostName = preg_replace('/[^a-z0-9\*]/i', '_', $hostName);
- $hostName = preg_replace('/_+/', '_', $hostName);
- return strtolower($hostName);
- }
-
- protected function convertParametersToKey($params)
- {
- if(!isset($params['module']) || !isset($params['action']))
- {
- throw new sfException('A cache key must contain both a module and an action parameter');
- }
- $module = $params['module'];
- unset($params['module']);
- $action = $params['action'];
- unset($params['action']);
- ksort($params);
- $cacheKey = sprintf('%s/%s', $module, $action);
- foreach ($params as $key => $value)
- {
- $cacheKey .= sprintf('/%s/%s', $key, $value);
- }
- return $cacheKey;
- }
-
- public function addCache($moduleName, $actionName, $options = array())
- {
-
- if (isset($options['vary']))
- {
- foreach ($options['vary'] as $key => $name)
- {
- $options['vary'][$key] = strtr(strtolower($name), '_', '-');
- }
- }
- $options['lifeTime'] = isset($options['lifeTime']) ? $options['lifeTime'] : 0;
- if (!isset($this->cacheConfig[$moduleName]))
- {
- $this->cacheConfig[$moduleName] = array();
- }
- $this->cacheConfig[$moduleName][$actionName] = array(
- 'withLayout' => isset($options['withLayout']) ? $options['withLayout'] : false,
- 'lifeTime' => $options['lifeTime'],
- 'clientLifeTime' => isset($options['clientLifeTime']) ? $options['clientLifeTime'] : $options['lifeTime'],
- 'contextual' => isset($options['contextual']) ? $options['contextual'] : false,
- 'vary' => isset($options['vary']) ? $options['vary'] : array(),
- );
- }
-
- public function registerConfiguration($moduleName)
- {
- if (!isset($this->loaded[$moduleName]))
- {
- require($this->context->getConfigCache()->checkConfig('modules/'.$moduleName.'/config/cache.yml'));
- $this->loaded[$moduleName] = true;
- }
- }
-
- public function withLayout($internalUri)
- {
- return $this->getCacheConfig($internalUri, 'withLayout', false);
- }
-
- public function getLifeTime($internalUri)
- {
- return $this->getCacheConfig($internalUri, 'lifeTime', 0);
- }
-
- public function getClientLifeTime($internalUri)
- {
- return $this->getCacheConfig($internalUri, 'clientLifeTime', 0);
- }
-
- public function isContextual($internalUri)
- {
- return $this->getCacheConfig($internalUri, 'contextual', false);
- }
-
- public function getVary($internalUri)
- {
- return $this->getCacheConfig($internalUri, 'vary', array());
- }
-
- protected function getCacheConfig($internalUri, $key, $defaultValue = null)
- {
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($internalUri);
- $this->registerConfiguration($params['module']);
- $value = $defaultValue;
- if (isset($this->cacheConfig[$params['module']][$params['action']][$key]))
- {
- $value = $this->cacheConfig[$params['module']][$params['action']][$key];
- }
- else if (isset($this->cacheConfig[$params['module']]['DEFAULT'][$key]))
- {
- $value = $this->cacheConfig[$params['module']]['DEFAULT'][$key];
- }
- return $value;
- }
-
- public function isCacheable($internalUri)
- {
- if ($this->request instanceof sfWebRequest && !$this->request->isMethod(sfRequest::GET))
- {
- return false;
- }
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($internalUri);
- $this->registerConfiguration($params['module']);
- if (isset($this->cacheConfig[$params['module']][$params['action']]))
- {
- return ($this->cacheConfig[$params['module']][$params['action']]['lifeTime'] > 0);
- }
- else if (isset($this->cacheConfig[$params['module']]['DEFAULT']))
- {
- return ($this->cacheConfig[$params['module']]['DEFAULT']['lifeTime'] > 0);
- }
- return false;
- }
-
- public function isActionCacheable($moduleName, $actionName)
- {
- if ($this->request instanceof sfWebRequest && !$this->request->isMethod(sfRequest::GET))
- {
- return false;
- }
- $this->registerConfiguration($moduleName);
- if (isset($this->cacheConfig[$moduleName][$actionName]))
- {
- return $this->cacheConfig[$moduleName][$actionName]['lifeTime'] > 0;
- }
- else if (isset($this->cacheConfig[$moduleName]['DEFAULT']))
- {
- return $this->cacheConfig[$moduleName]['DEFAULT']['lifeTime'] > 0;
- }
- return false;
- }
-
- public function get($internalUri)
- {
-
- if (!$this->isCacheable($internalUri) || $this->ignore())
- {
- return null;
- }
- $retval = $this->cache->get($this->generateCacheKey($internalUri));
- if (sfConfig::get('sf_logging_enabled'))
- {
- $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Cache for "%s" %s', $internalUri, $retval !== null ? 'exists' : 'does not exist'))));
- }
- return $retval;
- }
-
- public function has($internalUri)
- {
- if (!$this->isCacheable($internalUri) || $this->ignore())
- {
- return null;
- }
- return $this->cache->has($this->generateCacheKey($internalUri));
- }
-
- protected function ignore()
- {
-
- if (sfConfig::get('sf_debug') && $this->context->getRequest()->getAttribute('sf_ignore_cache'))
- {
- if (sfConfig::get('sf_logging_enabled'))
- {
- $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Discard cache')));
- }
- return true;
- }
- return false;
- }
-
- public function set($data, $internalUri)
- {
- if (!$this->isCacheable($internalUri))
- {
- return false;
- }
- try
- {
- $ret = $this->cache->set($this->generateCacheKey($internalUri), $data, $this->getLifeTime($internalUri));
- }
- catch (Exception $e)
- {
- return false;
- }
- if (sfConfig::get('sf_logging_enabled'))
- {
- $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Save cache for "%s"', $internalUri))));
- }
- return true;
- }
-
- public function remove($internalUri, $hostName = '', $vary = '', $contextualPrefix = '**')
- {
- if (sfConfig::get('sf_logging_enabled'))
- {
- $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Remove cache for "%s"', $internalUri))));
- }
- $cacheKey = $this->generateCacheKey($internalUri, $hostName, $vary, $contextualPrefix);
- if(strpos($cacheKey, '*'))
- {
- return $this->cache->removePattern($cacheKey);
- }
- elseif ($this->cache->has($cacheKey))
- {
- return $this->cache->remove($cacheKey);
- }
- }
-
- public function getLastModified($internalUri)
- {
- if (!$this->isCacheable($internalUri))
- {
- return 0;
- }
- return $this->cache->getLastModified($this->generateCacheKey($internalUri));
- }
-
- public function getTimeout($internalUri)
- {
- if (!$this->isCacheable($internalUri))
- {
- return 0;
- }
- return $this->cache->getTimeout($this->generateCacheKey($internalUri));
- }
-
- public function start($name, $lifeTime, $clientLifeTime = null, $vary = array())
- {
- $internalUri = $this->routing->getCurrentInternalUri();
- if (!$clientLifeTime)
- {
- $clientLifeTime = $lifeTime;
- }
-
- list($route_name, $params) = $this->controller->convertUrlStringToParameters($internalUri);
- $this->addCache($params['module'], $params['action'], array('withLayout' => false, 'lifeTime' => $lifeTime, 'clientLifeTime' => $clientLifeTime, 'vary' => $vary));
-
- $data = $this->get($internalUri.(strpos($internalUri, '?') ? '&' : '?').'_sf_cache_key='.$name);
- if ($data !== null)
- {
- return $data;
- }
- else
- {
- ob_start();
- ob_implicit_flush(0);
- return null;
- }
- }
-
- public function stop($name)
- {
- $data = ob_get_clean();
-
- $internalUri = $this->routing->getCurrentInternalUri();
- try
- {
- $this->set($data, $internalUri.(strpos($internalUri, '?') ? '&' : '?').'_sf_cache_key='.$name);
- }
- catch (Exception $e)
- {
- }
- return $data;
- }
-
- public function computeCacheKey(array $parameters)
- {
- if (isset($parameters['sf_cache_key']))
- {
- return $parameters['sf_cache_key'];
- }
- if (sfConfig::get('sf_logging_enabled'))
- {
- $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Generate cache key')));
- }
- return md5(serialize($parameters));
- }
-
- public function checkCacheKey(array & $parameters)
- {
- $parameters['sf_cache_key'] = $this->computeCacheKey($parameters);
- return $parameters['sf_cache_key'];
- }
-
- public function getPartialUri($module, $action, $cacheKey)
- {
- return sprintf('@sf_cache_partial?module=%s&action=%s&sf_cache_key=%s', $module, $action, $cacheKey);
- }
-
- public function hasPartialCache($module, $action, $cacheKey)
- {
- return $this->has($this->getPartialUri($module, $action, $cacheKey));
- }
-
- public function getPartialCache($module, $action, $cacheKey)
- {
- $uri = $this->getPartialUri($module, $action, $cacheKey);
- if (!$this->isCacheable($uri))
- {
- return null;
- }
-
- $cache = $this->get($uri);
- if (null === $cache)
- {
- return null;
- }
- $cache = unserialize($cache);
- $content = $cache['content'];
- $this->context->getResponse()->merge($cache['response']);
- if (sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => false)), $content)->getReturnValue();
- }
- return $content;
- }
-
- public function setPartialCache($module, $action, $cacheKey, $content)
- {
- $uri = $this->getPartialUri($module, $action, $cacheKey);
- if (!$this->isCacheable($uri))
- {
- return $content;
- }
- $saved = $this->set(serialize(array('content' => $content, 'response' => $this->context->getResponse())), $uri);
- if ($saved && sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => true)), $content)->getReturnValue();
- }
- return $content;
- }
-
- public function hasActionCache($uri)
- {
- return $this->has($uri) && !$this->withLayout($uri);
- }
-
- public function getActionCache($uri)
- {
- if (!$this->isCacheable($uri) || $this->withLayout($uri))
- {
- return null;
- }
-
- $cache = $this->get($uri);
- if (null === $cache)
- {
- return null;
- }
- $cache = unserialize($cache);
- $content = $cache['content'];
- $cache['response']->setEventDispatcher($this->dispatcher);
- $this->context->getResponse()->copyProperties($cache['response']);
- if (sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => false)), $content)->getReturnValue();
- }
- return array($content, $cache['decoratorTemplate']);
- }
-
- public function setActionCache($uri, $content, $decoratorTemplate)
- {
- if (!$this->isCacheable($uri) || $this->withLayout($uri))
- {
- return $content;
- }
- $saved = $this->set(serialize(array('content' => $content, 'decoratorTemplate' => $decoratorTemplate, 'response' => $this->context->getResponse())), $uri);
- if ($saved && sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => true)), $content)->getReturnValue();
- }
- return $content;
- }
-
- public function setPageCache($uri)
- {
- if (sfView::RENDER_CLIENT != $this->controller->getRenderMode())
- {
- return;
- }
-
- $saved = $this->set(serialize($this->context->getResponse()), $uri);
- if ($saved && sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => true)), $this->context->getResponse()->getContent())->getReturnValue();
- $this->context->getResponse()->setContent($content);
- }
- }
-
- public function getPageCache($uri)
- {
- $retval = $this->get($uri);
- if (null === $retval)
- {
- return false;
- }
- $cachedResponse = unserialize($retval);
- $cachedResponse->setEventDispatcher($this->dispatcher);
- if (sfView::RENDER_VAR == $this->controller->getRenderMode())
- {
- $this->controller->getActionStack()->getLastEntry()->setPresentation($cachedResponse->getContent());
- $this->context->getResponse()->setContent('');
- }
- else
- {
- $this->context->setResponse($cachedResponse);
- if (sfConfig::get('sf_web_debug'))
- {
- $content = $this->dispatcher->filter(new sfEvent($this, 'view.cache.filter_content', array('response' => $this->context->getResponse(), 'uri' => $uri, 'new' => false)), $this->context->getResponse()->getContent())->getReturnValue();
- $this->context->getResponse()->setContent($content);
- }
- }
- return true;
- }
-
- public function getCurrentCacheKey()
- {
- $cacheKey = $this->routing->getCurrentInternalUri();
- if ($getParameters = $this->request->getGetParameters())
- {
- $cacheKey .= false === strpos($cacheKey, '?') ? '?' : '&';
- $cacheKey .= http_build_query($getParameters, null, '&');
- }
- return $cacheKey;
- }
-
- public function decorateContentWithDebug(sfEvent $event, $content)
- {
-
- if (!$content || false === strpos($event['response']->getContentType(), 'html'))
- {
- return $content;
- }
- $this->context->getConfiguration()->loadHelpers(array('Helper', 'Url', 'Asset', 'Tag'));
- $sf_cache_key = $this->generateCacheKey($event['uri']);
- $bgColor = $event['new'] ? '#9ff' : '#ff9';
- $lastModified = $this->cache->getLastModified($sf_cache_key);
- $cacheKey = $this->cache->getOption('prefix').$sf_cache_key;
- $id = md5($event['uri']);
- return '
- <div id="main_'.$id.'" class="sfWebDebugActionCache" style="border: 1px solid #f00">
- <div id="sub_main_'.$id.'" class="sfWebDebugCache" style="background-color: '.$bgColor.'; border-right: 1px solid #f00; border-bottom: 1px solid #f00;">
- <div style="height: 16px; padding: 2px"><a href="#" onclick="sfWebDebugToggle(\'sub_main_info_'.$id.'\'); return false;"><strong>cache information</strong></a> <a href="#" onclick="sfWebDebugToggle(\'sub_main_'.$id.'\'); document.getElementById(\'main_'.$id.'\').style.border = \'none\'; return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/close.png', array('alt' => 'close')).'</a> </div>
- <div style="padding: 2px; display: none" id="sub_main_info_'.$id.'">
- [uri] '.htmlspecialchars($event['uri'], ENT_QUOTES, sfConfig::get('sf_charset')).'<br />
- [key for cache] '.htmlspecialchars($cacheKey, ENT_QUOTES, sfConfig::get('sf_charset')).'<br />
- [life time] '.$this->getLifeTime($event['uri']).' seconds<br />
- [last modified] '.(time() - $lastModified).' seconds<br />
- <br />
- </div>
- </div><div>
- '.$content.'
- </div></div>
- ';
- }
- }
Configuration
- debug
- xdebug
- logging
- cache
- compression
- tokenizer
- eaccelerator
- apc
- xcache
Request 
options:
path_info_key: PATH_INFO
path_info_array: SERVER
default_format: null
logging: '1'
relative_url_root: null
formats: { txt: text/plain, js: [application/javascript, application/x-javascript, text/javascript], css: text/css, json: [application/json, application/x-json], xml: [text/xml, application/xml, application/x-xml], rdf: application/rdf+xml, atom: application/atom+xml }
no_script_name: false
parameterHolder:
action: index
class: sfViewCacheManager
method: ''
module: sfCodeView
attributeHolder:
sf_route: 'sfRoute Object()'
Response 
status:
code: 200
text: OK
options:
http_protocol: HTTP/1.1
logging: '1'
charset: utf-8
send_http_headers: false
content_type: 'text/html; charset=utf-8'
cookies: { }
httpHeaders:
Content-Type: 'text/html; charset=utf-8'
javascripts:
'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js': { }
/sfCodeViewPlugin/js/sfCodeViewPlugin.js: { }
stylesheets:
main.css: { }
/sfCodeViewPlugin/css/sfCodeViewPlugin.css: { }
metas: { }
httpMetas:
Content-Type: 'text/html; charset=utf-8'
User 
options:
auto_shutdown: false
culture: null
default_culture: en
use_flash: true
logging: '1'
timeout: 1800
attributeHolder:
symfony/user/sfUser/attributes: { history: [sfViewCacheManager, sfView, sfVarLogger, sfValidatorUrl, sfValidatorTime, sfValidatorString, sfValidatorSchemaForEach, sfValidatorSchemaFilter, sfValidatorSchemaCompare, sfValidatorSchema] }
culture: en
Settings 
app_sfCodeViewPlugin_javascripts:
- /sfCodeViewPlugin/js/sfCodeViewPlugin.js
app_sfCodeViewPlugin_stylesheets:
- /sfCodeViewPlugin/css/sfCodeViewPlugin.css
mod_sfcodeview_enabled: true
mod_sfcodeview_view_class: sfPHP
sf_admin_module_web_dir: /sfDoctrinePlugin
sf_admin_web_dir: /sf/sf_admin
sf_app: frontend
sf_app_base_cache_dir: /www/redotheoffice/codeview/cache/frontend
sf_app_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev
sf_app_config_dir: /www/redotheoffice/codeview/apps/frontend/config
sf_app_dir: /www/redotheoffice/codeview/apps/frontend
sf_app_i18n_dir: /www/redotheoffice/codeview/apps/frontend/i18n
sf_app_lib_dir: /www/redotheoffice/codeview/apps/frontend/lib
sf_app_module_dir: /www/redotheoffice/codeview/apps/frontend/modules
sf_app_template_dir: /www/redotheoffice/codeview/apps/frontend/templates
sf_apps_dir: /www/redotheoffice/codeview/apps
sf_cache: false
sf_cache_dir: /www/redotheoffice/codeview/cache
sf_charset: utf-8
sf_check_lock: false
sf_compressed: false
sf_config_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/config
sf_config_dir: /www/redotheoffice/codeview/config
sf_csrf_secret: 220ab365e581d678efc07c41371dbc49a1fdcec3
sf_data_dir: /www/redotheoffice/codeview/data
sf_debug: true
sf_default_culture: en
sf_enabled_modules:
- default
- sfCodeView
sf_environment: dev
sf_error_404_action: error404
sf_error_404_module: default
sf_error_reporting: 8191
sf_escaping_method: ESC_SPECIALCHARS
sf_escaping_strategy: true
sf_etag: false
sf_file_link_format: null
sf_i18n: false
sf_i18n_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/i18n
sf_lib_dir: /www/redotheoffice/codeview/lib
sf_log_dir: /www/redotheoffice/codeview/log
sf_logging_enabled: true
sf_login_action: login
sf_login_module: default
sf_module_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/modules
sf_module_disabled_action: disabled
sf_module_disabled_module: default
sf_no_script_name: false
sf_orm: doctrine
sf_plugins_dir: /www/redotheoffice/codeview/plugins
sf_root_dir: /www/redotheoffice/codeview
sf_secure_action: secure
sf_secure_module: default
sf_standard_helpers:
- Partial
- Cache
sf_symfony_lib_dir: /www/redotheoffice/lib/symfony/1.4/lib
sf_template_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/template
sf_test_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/test
sf_test_dir: /www/redotheoffice/codeview/test
sf_upload_dir: /www/redotheoffice/codeview/web/uploads
sf_use_database: true
sf_web_debug: true
sf_web_debug_web_dir: /sf/sf_web_debug
sf_web_dir: /www/redotheoffice/codeview/web
symfony.asset.javascripts_included: true
symfony.asset.stylesheets_included: true
Globals 
cookie:
symfony: 02h64ddlgmn2hkmgs38ek09ah1
env: { }
files: { }
get: { }
post: { }
server:
DOCUMENT_ROOT: /Library/WebServer/Documents
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: 'text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
HTTP_CACHE_CONTROL: no-cache
HTTP_CONNECTION: close
HTTP_COOKIE: symfony=02h64ddlgmn2hkmgs38ek09ah1
HTTP_HOST: codeview.redotheoffice.com
HTTP_PRAGMA: no-cache
HTTP_USER_AGENT: 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)'
HTTP_X_CC_ID: ccc04-02
PATH: '/usr/bin:/bin:/usr/sbin:/sbin'
PATH_INFO: /sfCodeView/sfViewCacheManager
PATH_TRANSLATED: 'redirect:/www/redotheoffice/codeview/web/index.php/sfViewCacheManager'
PHP_SELF: /index.php/sfCodeView/sfViewCacheManager
QUERY_STRING: ''
REMOTE_ADDR: 38.107.179.240
REMOTE_PORT: '47208'
REQUEST_METHOD: GET
REQUEST_TIME: 1337660892
REQUEST_URI: /index.php/sfCodeView/sfViewCacheManager
SCRIPT_FILENAME: /www/redotheoffice/codeview/web/index.php
SCRIPT_NAME: /index.php
SERVER_ADDR: 192.168.0.108
SERVER_ADMIN: webmaster@weett.nl
SERVER_NAME: codeview.redotheoffice.com
SERVER_PORT: '80'
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: ''
SERVER_SOFTWARE: 'Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6'
session:
symfony/user/sfUser/attributes: { symfony/user/sfUser/attributes: { history: [sfView, sfVarLogger, sfValidatorUrl, sfValidatorTime, sfValidatorString, sfValidatorSchemaForEach, sfValidatorSchemaFilter, sfValidatorSchemaCompare, sfValidatorSchema, sfValidatorRegex] } }
symfony/user/sfUser/authenticated: false
symfony/user/sfUser/credentials: { }
symfony/user/sfUser/culture: en
symfony/user/sfUser/lastRequest: 1337660866
Php 
php: 5.3.6
os: 'Darwin Mac-mini-van-Sjoerd-de-Jong.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386'
extensions:
54: apache2handler
33: 'apc (3.1.7)'
8: bcmath
9: bz2
10: calendar
0: 'Core (5.3.6)'
11: ctype
56: curl
1: 'date (5.3.6)'
12: 'dom (20031129)'
2: ereg
42: 'exif (1.4 $Id: exif.c 308362 2011-02-15 14:02:26Z pajoye $)'
14: 'fileinfo (1.0.5-dev)'
15: 'filter (0.11.0)'
16: ftp
17: gd
18: gettext
13: 'hash (1.0)'
20: iconv
36: imap
57: 'intl (1.1.0)'
22: 'json (1.2.1)'
23: ldap
3: libxml
24: mbstring
58: mcrypt
59: 'memcache (3.0.4)'
60: 'memcached (1.0.1)'
71: mhash
61: 'mongo (1.1.4)'
62: mssql
29: 'mysql (1.0)'
27: 'mysqli (0.1)'
26: 'mysqlnd (mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $)'
63: 'OAuth (1.0-dev)'
28: 'odbc (1.0)'
4: openssl
5: pcre
30: 'PDO (1.0.4dev)'
64: 'pdo_dblib (1.0.1)'
31: 'pdo_mysql (1.0.2)'
65: 'pdo_pgsql (1.0.2)'
32: 'pdo_sqlite (1.0.1)'
66: pgsql
55: 'Phar (2.0.1)'
34: posix
35: 'Reflection ($Revision: 307971 $)'
21: session
37: shmop
38: 'SimpleXML (0.1)'
39: soap
40: sockets
67: 'solr (0.9.11)'
19: 'SPL (0.2)'
41: 'SQLite (2.0-dev)'
6: 'sqlite3 (0.7-dev)'
25: 'standard (5.3.6)'
43: sysvmsg
44: sysvsem
45: sysvshm
46: 'tidy (2.0)'
47: 'tokenizer (0.1)'
68: 'uploadprogress (1.0.1)'
48: wddx
72: 'xdebug (2.2.0-dev)'
69: 'xhprof (0.9.2)'
49: xml
50: 'xmlreader (0.1)'
51: 'xmlrpc (0.51)'
52: 'xmlwriter (0.1)'
70: 'xsl (0.1)'
53: 'zip (1.9.1)'
7: 'zlib (1.1)'
Symfony 
version: 1.4.2-DEV
path: /www/redotheoffice/lib/symfony/1.4/lib
View Layer
Template: sfCodeView … indexSuccess.php 
Parameters:
$class (string)
$method (NULL)
$viewer (sfCodeViewer)
$history (array)
Logs
| # |
type |
message |
| 1 | sfPatternRouting | Match route "sfCodeView" (/sfCodeView/:class/:method) for /sfCodeView/sfViewCacheManager with parameters array ( 'module' => 'sfCodeView', 'action' => 'index', 'class' => 'sfViewCacheManager', 'method' => '',) |
| 2 | sfFilterChain | Executing filter "sfRenderingFilter" |
| 3 | sfFilterChain | Executing filter "sfExecutionFilter" |
| 4 | sfCodeViewActions | Call "sfCodeViewActions->executeIndex()" |
| 5 | sfPHPView | Render "sf_root_dir/plugins/sfCodeViewPlugin/modules/sfCodeView/templates/indexSuccess.php" |
| 6 | sfPHPView | Decorate content with "sf_app_dir/templates/layout.php" |
| 7 | sfPHPView | Render "sf_app_dir/templates/layout.php" |
| 8 | sfWebResponse | Send status "HTTP/1.1 200 OK" |
| 9 | sfWebResponse | Send header "Content-Type: text/html; charset=utf-8" |
Timers
| type | calls | time (ms) | time (%) |
|---|
| Configuration | 11 | 34.42 | 8 |
| Factories | 1 | 6.90 | 1 |
| Action "sfCodeView/index" | 1 | 37.66 | 9 |
| View "Success" for "sfCodeView/index" | 1 | 309.44 | 79 |
View php class code
Enter the name of a class you want to view in the toolbar and hit 'enter' to view its code, or click one of the available classes below.
User classes
- apps/frontend/config
- apps/frontend/lib
- config
- lib/form
- plugins/sfCodeViewPlugin/config
- plugins/sfCodeViewPlugin/lib
- plugins/sfCodeViewPlugin/modules/sfCodeView/actions
- plugins/sfCodeViewPlugin/modules/sfCodeView/lib
Symfony classes
- action
- addon
- autoload
- cache
- command
- config
- controller
- database
- debug
- escaper
- exception
- filter
- form/addon
- form
- generator
- i18n/Gettext
- i18n/extract
- i18n
- log
- mailer
- plugin
- request
- response
- routing
- storage
- task/app
- task/cache
- task/configure
- task/generator
- task/help
- task/i18n
- task/log
- task/plugin
- task/project
- task/project/validation
- task
- task/symfony
- task/test
- test
- user
- util
- validator/i18n
- validator
- view
- widget/i18n
- widget