xdrm-framework/README.md

81 lines
2.7 KiB
Markdown
Raw Normal View History

2016-12-11 17:41:37 +00:00
# xdrm-framework
#### Description
xdrm-framework is a tool that wraps my framework and all it's component's versions. It allows to build a web framework's base with chosen modules and their versions.
#### 1. Build a project
To use the xdrm-framework's project builder, just open a linux terminal and type :
1. `./xfw packages` - to display the available modules
2. `./xfw install @pkg_name:1.2` - to install a package and its version (1.2 here)
3. `./xfw remove @pkg_name` - to disable a module
4. `./xfw build @project_root` - will create your project in the folder `@project_root`
5. `./xfw init` - to remove all enabled modules
#### 2. Project's file structure
xdrm-framework is based on `all in config` so you will have this structure :
- folder `/build` which contains framework's modules (core + data).
- folder `/public_html` which contains visible content (html, css, js).
- folder `/config` which contains the modules' config files (mainly json).
- file `/autoloader.php` which will auto-load the components.
**Note:** In every php file you want to use framework's classes, you have to begin your file by :
```php
<?php
/* [1] load the autoloader with correct path */
require_once '../autoloader.php';
/* [2] then you can load your classes */
use api\core\Request; // ex1: api request manager
use error\core\Error; // ex2: error manager
use error\core\Err; // ex3: error codes
/* [3] and use them as long as you want without namespace */
$request = new Request('module/method', ['id_user' => 10]);
$response = $request->dispatch();
if( $response->error->get() === Err::Success )
echo "All is going right!\n";
```
**Note:** Some global constants are created into the autoloader so they are accessible from any file which loads the autoloader:
- `__BUILD__` - The absolute `build` folder path
- `__PUBLIC__` - The absolute `public_html` folder path
- `__ROOT__` - The absolute `root` path (project root)
- `__CONFIG__` - The absolute `config` folder path
### 3. Packages
#### 3.1 API - self-managed API
2016-12-11 14:22:39 +00:00
> version 1.0 - [documentation](/notice/api/1.0.md)
2017-05-12 12:15:39 +00:00
2016-12-11 14:22:39 +00:00
> version 2.0 - [documentation](/notice/api/2.0.md)
2017-05-12 12:15:39 +00:00
2016-12-11 14:22:39 +00:00
> version 2.2 - [documentation](/notice/api/2.2.md)
#### 3.2 Log - multilog system
> version 1.0 - [documentation](/notice/log/1.0.md)
2017-05-12 12:15:39 +00:00
#### 3.3 Filedriver - optimized file driver
> version 1.0 - [documentation](/notice/filedriver/1.0.md)
#### [3.2] error - error system
#### [3.3] database - database wrapper and repository manager
#### [3.4] orm - sql orm
2017-09-09 16:46:41 +00:00
> version 0.8-2 - [documentation](/notice/orm/0.8-2.md)
#### [3.5] router - apache2 router
#### [3.6] lightdb - fast key-value storage
2017-09-09 11:02:19 +00:00
#### [3.7] db-schema - Json to Mysql
> version 1.0 - [documentation](/notice/db-schema/1.0.md)