-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatine
More file actions
78 lines (63 loc) · 2.03 KB
/
platine
File metadata and controls
78 lines (63 loc) · 2.03 KB
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
#!/usr/bin/env php
<?php
declare(strict_types=1);
/**
* the directory separator, under windows it is \ and Unix, Linux /
*/
define('DS', DIRECTORY_SEPARATOR);
/**
* The root directory of the application.
*
* you can place this directory outside of your web directory,
* for example "/home/your_app", etc.
*/
define('ROOT_PATH', realpath(__DIR__) . DS);
/**
* The path to the "app" directory.
*
* That contains most of the application files (Action,Entities, Repositories, etc.)
*/
define('APP_PATH', ROOT_PATH . 'app' . DS);
/**
* The path to the configuration directory.
*
* That contains most of the configuration files for your
* application (database, class loading file, functions, etc.)
*/
define('CONFIG_PATH', ROOT_PATH . 'config' . DS);
/**
* The path to the storage directory.
*
* That contains most of the application cache, session, migration, log files
*/
define('STORAGE_PATH', ROOT_PATH . 'storage' . DS);
/**
* The path to the directory of sources external to your application.
*
* If you have already used "composer" you know what that means.
*/
define('VENDOR_PATH', ROOT_PATH . 'vendor' . DS);
/**
* The environment of your application (production, test, development).
*
* if your application is still in development you use the value "dev"
* so you will have the display of the error messages, etc.
* Once you finish the development of your application that is to put it online
* you change this value to "prod" or "testing", in this case there will be deactivation of error messages,
* the loading of the system, will be fast.
*/
define('ENVIRONMENT', 'dev');
require VENDOR_PATH . 'autoload.php';
use Platine\Framework\App\Application;
use Platine\Framework\Kernel\ConsoleKernel;
$app = new Application();
$app->setConfigPath(CONFIG_PATH)
->setRootPath(ROOT_PATH)
->setAppPath(APP_PATH)
->setVendorPath(VENDOR_PATH)
->setStoragePath(STORAGE_PATH)
->setNamespace('Platine\\App\\')
->setEnvironment(ENVIRONMENT);
/** @var ConsoleKernel $kernel */
$kernel = $app->make(ConsoleKernel::class);
$kernel->run($_SERVER['argv'] ?? []);