1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,55 @@ |
1 |
+<?php |
|
2 |
+class Constants{ |
|
3 |
+ /* |
|
4 |
+ |
|
5 |
+//définition des chemins de l'application |
|
6 |
+//les fonction n'ont pas l'air de fonctionner dans la definitions de constantes |
|
7 |
+// de classes, en effet elle ne peuvent pas être déclarée de façon dynamique. |
|
8 |
+ const PUBLIC_PATH = __DIR__; |
|
9 |
+ const APPLICATION_PATH = dirname(__DIR__) . |
|
10 |
+ DIRECTORY_SEPARATOR . 'application' |
|
11 |
+ ; |
|
12 |
+ const PAGES_PATH = |
|
13 |
+ self::APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
14 |
+ 'pages' |
|
15 |
+ ; |
|
16 |
+ const INC_PATH = |
|
17 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
18 |
+ 'includes' |
|
19 |
+ ; |
|
20 |
+ const TPL_PATH = |
|
21 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
22 |
+ 'templates' |
|
23 |
+ ; |
|
24 |
+ const CLASS_PATH = |
|
25 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
26 |
+ 'classes' |
|
27 |
+ ; |
|
28 |
+ //définition des chemins de l'application |
|
29 |
+ // ne fonctionne pas ( tout le temps ou pour l'instant?!? ) |
|
30 |
+ define('PUBLIC_PATH', __DIR__); |
|
31 |
+ define( 'APPLICATION_PATH', dirname(__DIR__) . |
|
32 |
+ DIRECTORY_SEPARATOR . 'application' |
|
33 |
+ ); |
|
34 |
+ define( |
|
35 |
+ 'PAGES_PATH', |
|
36 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
37 |
+ 'pages' |
|
38 |
+ ); |
|
39 |
+ define( |
|
40 |
+ 'INC_PATH', |
|
41 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
42 |
+ 'includes' |
|
43 |
+ ); |
|
44 |
+ define( |
|
45 |
+ 'TPL_PATH', |
|
46 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
47 |
+ 'templates' |
|
48 |
+ ); |
|
49 |
+ define( |
|
50 |
+ 'CLASS_PATH', |
|
51 |
+ APPLICATION_PATH . DIRECTORY_SEPARATOR . |
|
52 |
+ 'classes' |
|
53 |
+ ); |
|
54 |
+ |
|
55 |
+} |
|
0 | 56 |
\ No newline at end of file |