/var/www-protected/php-debug.com/www/install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
 * This the installation notes page
 *
 * @version V2.0
 * @since 4 sept 2006
 * @author Vernet Loic
 * @copyright Phoenix
 * @package PHP_Debug_Website
 */
 
 
// CONFIG ======================================================================
 
 
// Applications variables & gen includes  ======================================
require_once '../config/ApplicationCfg.php';
require_once PD_WEB_INCLUDES_ROOT. 'common.inc.php';
 
// Page constants ==============================================================
define('PAGE_ID' ,    'install'. PD_WEB_FILE_EXT);
define('PAGE_TR_ID' , 'install');
define('_FILE_', basename(__FILE__));
define('DEFAULT_ACTION', 'INSTALLATION_NOTES');
 
 
// MODEL =======================================================================
 
 
// CONTROLLER ==================================================================
$Dbg->setAction(DEFAULT_ACTION);
 
//Include the class definition of highlighter
require_once 'Text/Highlighter.php';
require_once 'Text/Highlighter/Renderer/Html.php';
 
// Include the package to cache highlight results
require_once('Cache/Lite.php');
 
// Set a few options
$options = array(
    'cacheDir' => PD_WEB_TEMP,
    'lifeTime' => 3600
);
 
// Create a Cache_Lite object
$Cache_Lite = new Cache_Lite($options);
 
// Buil the array options for the HTML renderer to get the nice file numbering
$rendOptions = array( 
    'numbers' => $htmlOptions['HTML_TABLE_view_source_numbers'],
    'tabsize' => $htmlOptions['HTML_TABLE_view_source_tabsize'],
);
 
// Finish parser object creation 
$renderer = new Text_Highlighter_Renderer_Html($rendOptions);
$phpHighlighter = Text_Highlighter::factory("PHP");
$phpHighlighter->setRenderer($renderer);
 
//PHP_Debug::dumpVar(PD_WEB_TESTS_ROOT. DIRECTORY_SEPARATOR. 'PHP_Debug_test'. PD_WEB_FILE_EXT, '$allowedPath', 1);
 
// Cache, text highlight results because he is quiet long ! 
if ($minExample = $Cache_Lite->get('minExample')) {    
    $Dbg->add('Getting $minExample from cache');
} else {
 
    $minExample = $phpHighlighter->highlight(file_get_contents(PD_WEB_TESTS_ROOT. DIRECTORY_SEPARATOR. 'PHP_Debug_test'. PD_WEB_FILE_EXT));
    $Dbg->add('Saving $minExample to the cache');
    $Cache_Lite->save($minExample);
}
 
if ($fullExample = $Cache_Lite->get('fullExample')) {
    $Dbg->add('Getting $fullExample from cache');
} else {
    $fullExample = $phpHighlighter->highlight(file_get_contents(PD_WEB_TESTS_ROOT. DIRECTORY_SEPARATOR. 'PHP_Debug_HTML_Div_test'. PD_WEB_FILE_EXT));
    $Dbg->add('Saving $fullExample to the cache');
    $Cache_Lite->save($fullExample);
}
 
if ($arrayExample = $Cache_Lite->get('arrayExample')) {
    $Dbg->add('Getting $arrayExample from cache');
} else {
    $arrayExample = $phpHighlighter->highlight("
<?php
    /**
     * Options  array for Debug object
     */ 
    static private $options = array(
        'DEBUG_restrict_access'      => false,
        'DEBUG_allow_url_access'     => true,
        'DEBUG_url_key'              => 'pdw',
        'DEBUG_url_pass'             => 'pdw',
        'DEBUG_enable_watch'         => false,
        'DEBUG_replace_errorhandler' => true,
        'DEBUG_lang'                 => 'FR',
        'HTML_TABLE_view_source_script_name' => 'PHP_Debug_ShowSource.php',
        'HTML_TABLE_view_source_excluded_template' => array('')
    );
?>");
    $Dbg->add('Saving $arrayExample to the cache');
    $Cache_Lite->save($arrayExample);
}
 
  
// VIEW ========================================================================
 
$smarty->assign('arrayExample', $arrayExample);
$smarty->assign('minExample', $minExample);
$smarty->assign('fullExample', $fullExample);
 
 
// Assign debug infos
$smarty->assign('file', PD_WEB_PHP_DEBUG_ROOT. DIRECTORY_SEPARATOR. PAGE_ID);
$smarty->assign('bodyTpl', PAGE_TR_ID);
$smarty->assign('debugBuffer', $Dbg->getOutput());       
 
// Display template
$smarty->display('index.tpl');
 
?>