Exemplo n.º 1
0
 public function build()
 {
     $this->_root = DOCROOT . '/';
     $this->_path = @realpath(strlen(trim($_GET['browse'])) == 0 ? $this->_root : $_GET['browse']);
     $this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
     // Keep everything within DOCROOT:
     if (strpos($this->_path, $this->_root) !== 0) {
         $this->_path = $this->_root;
     }
     $this->_item = new PathListItem($this->_path);
     if ($this->_path != $this->_root) {
         $this->_link = '=' . $this->_item->path($this->_root);
     }
     // Toggle bookmarks:
     if (isset($_GET['bookmark'])) {
         $configuration = Frontend::instance()->Configuration;
         $bookmarks = $configuration->get('browsedevkit-bookmarks');
         $path = realpath($_GET['bookmark']);
         if (strpos($path, $this->_root) !== 0) {
             $path = $this->_root;
         }
         if (!is_array($bookmarks)) {
             $bookmarks = array();
         }
         if (in_array($path, $bookmarks)) {
             $bookmarks = array_diff($bookmarks, array($path));
         } else {
             $bookmarks[] = $path;
         }
         $configuration->set('browsedevkit-bookmarks', $bookmarks);
         General::writeFile(CONFIG, "<?php\n\t\$settings = {$configuration};\n", $configuration->get('write_mode', 'file'));
         redirect("?browse{$this->_link}{$this->_query_string}");
     }
     return parent::build();
 }
Exemplo n.º 2
0
 public function build()
 {
     $this->_view = strlen(trim($_GET['profile'])) == 0 ? 'general' : $_GET['profile'];
     // Build statistics
     $this->_dbstats = Symphony::Database()->getStatistics();
     $this->_records = array('general' => Symphony::Profiler()->retrieveGroup('General'), 'data-sources' => Symphony::Profiler()->retrieveGroup('Datasource'), 'events' => Symphony::Profiler()->retrieveGroup('Event'), 'delegates' => Symphony::Profiler()->retrieveGroup('Delegate'), 'slow-queries' => array());
     if (is_array($this->_dbstats['slow-queries']) && !empty($this->_dbstats['slow-queries'])) {
         foreach ($this->_dbstats['slow-queries'] as $q) {
             $this->_records['slow-queries'][] = array($q['execution_time'], $q['query'], null, null, false);
         }
     }
     return parent::build();
 }
Exemplo n.º 3
0
 public function build()
 {
     $this->_view = strlen(trim($_GET['profile'])) == 0 ? 'general' : $_GET['profile'];
     $this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
     // Build statistics:
     $this->_profiler = $this->_page->_Parent->Profiler;
     $this->_dbstats = $this->_page->_Parent->Database->getStatistics();
     $this->_records = array('general' => $this->_profiler->retrieveGroup('General'), 'data-sources' => $this->_profiler->retrieveGroup('Datasource'), 'events' => $this->_profiler->retrieveGroup('Event'), 'slow-queries' => array());
     if (is_array($this->_dbstats['slow-queries']) && !empty($this->_dbstats['slow-queries'])) {
         foreach ($this->_dbstats['slow-queries'] as $q) {
             $this->_records['slow-queries'][] = array($q['time'], $q['query'], null, null, false);
         }
     }
     return parent::build();
 }
Exemplo n.º 4
0
 public function build()
 {
     $this->_view = strlen(trim($_GET['logs'])) == 0 ? 'main' : $_GET['logs'];
     $this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
     $this->_path = MANIFEST . '/logs/';
     // Find log files:
     if (is_readable($this->_path) and is_dir($this->_path)) {
         $files = scandir($this->_path);
         foreach ($files as $file) {
             if ($file == 'main' || preg_match('/^main.[0-9]{10}.gz$/', $file)) {
                 $this->_files[$file] = filemtime($this->_path . $file);
             }
         }
         asort($this->_files);
         $this->_files = array_reverse($this->_files, true);
     }
     return parent::build();
 }
Exemplo n.º 5
0
		public function __construct(){
			parent::__construct();
		}
Exemplo n.º 6
0
 public function build()
 {
     $this->_view = strlen(trim($_GET['debug'])) == 0 ? 'xml' : $_GET['debug'];
     $this->_xsl = @file_get_contents($this->_pagedata['filelocation']);
     return parent::build();
 }
Exemplo n.º 7
0
 protected function appendContent(DOMElement $wrapper)
 {
     $content = parent::appendContent($wrapper);
     $source = null;
     $type = null;
     if ($this->show == 'frontend') {
         $url = clone $this->url;
         $url->parameters()->debug = 'iframe';
         $url->parameters()->{'debug-state'} = $this->state;
         $iframe = $this->document->createElement('iframe');
         $iframe->setAttribute('height', '400');
         $iframe->setAttribute('width', '400');
         $iframe->setAttribute('src', (string) $url);
         $content->appendChild($iframe);
         unset($url->parameters()->{'debug-get-output'});
     } else {
         if ($this->show == 'source') {
             $search = $this->document->createElement('div');
             $search->setAttribute('id', 'search');
             $input = Widget::Input('search');
             $search->appendChild($input);
             $content->appendChild($search);
             $this->appendSource($content, $this->input, 'xml');
         } else {
             if ($this->show == 'output') {
                 $this->appendSource($content, $this->output, 'xml');
             } else {
                 if ($this->show == 'params') {
                     $this->appendParams($content);
                 } else {
                     $this->appendFile($content);
                 }
             }
         }
     }
 }
 public function build()
 {
     $this->_view = strlen(trim($_GET['debug'])) == 0 ? 'xml' : $_GET['debug'];
     return parent::build();
 }