-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.php
62 lines (48 loc) · 1.39 KB
/
App.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
<?php
namespace demo;
use demo\SmartyRenderer;
use gnekoz\Application;
use \PEAR;
class App extends Application
{
public static function getInstance()
{
return Application::getApplication("demo");
}
public function onInitialize()
{
$conf = $this->getConfiguration();
// Configurazione renderer smarty
SmartyRenderer::setTemplateDir($this->getViewsDir());
SmartyRenderer::setCompileDir($conf->getProperty('/rendering/smarty/compile_dir'));
SmartyRenderer::setCacheDir($conf->getProperty('/rendering/smarty/cache_dir'));
SmartyRenderer::setWebRoot($this->getWebRoot());
// Workaround per librerie PEAR versione 1
set_include_path($this->getLibDir()
. DIRECTORY_SEPARATOR
. "pyrus"
. DIRECTORY_SEPARATOR
. "php");
// Inizializzazione DB_DataObject
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$basicOptions = $conf->getProperty("/persistence/db_dataobject/*");
//var_dump($basicOptions); exit();
foreach ($basicOptions as $name => $value)
{
$options[$name] = $value;
}
//var_dump($options); exit();
}
public function onShutdown()
{
}
public function onSessionCreate($id)
{
}
public function onSessionDestroy($id)
{
}
public function onSessionRestore($id)
{
}
}