Download the PHP package hades/framework without Composer

On this page you can find all versions of the php package hades/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package framework

Hades PHP Framework

Hades是一款容易上手的PHP框架,它在很大程度上借鉴了laravel框架,但是对于laravel中很多部分进行重新思考和构思。

所以如果你使用过laravel框架,你会非常容易上手这个框架。

特点

路由

支持get,post,any,group

示例:

<?php

use Hades\Route\Manager as Route;

Route::get('/login/index', '\App\Controllers\LoginController@index');
Route::post('/login/login', '\App\Controllers\LoginController@login');
Route::get('/login/logout', '\App\Controllers\LoginController@logout');

Route::group(['middleware' => ['\App\Middlewares\AuthMiddleware']], function(){

    Route::get('/welcome/index', '\App\Controllers\WelComeController@index');

});

ORM

遵循配置即一切的原则,只需要配置好配置文件就可以直接使用

<?php

// put all table and relation to this config
return [
    // 管理员表
    'admin' => [ 'pk' => 'id'],
    // 项目表
    'project' => [
        'pk' => 'id',
        'relations' => [
            'project_mechanics' => [
                'type' => 'has_many',
                'table' => 'project_mechanic',
                'key' => 'id',
                'relate_key' => 'project_id',
            ],
            'logs' => [
                'type' => 'has_many',
                'table' => 'log',
                'key' => 'id',
                'relate_key' => 'project_id',
                'builder' => [
                    'orderBy' => ['created_at', 'desc'],
                    'offset' => [0],
                    'limit' => [20],
                ],
            ]
        ]
    ],
    // 日志表
    'log' => [ 'pk' => 'id' ],

    // 服务器表
    'mechanic' => ['pk' => 'id'],
];

提供Dao和Model使用:

增加数据:

$log = new \LogModel();
$log->project_id = $project_id;
$log->admin_id = $myself->id;
$log->version = $reversion->sha1;
$log->created_at = time();
$log->save();

查找数据:

$log = \LogDao::find(1);

更新数据:

$log->version = $new;
$log->save();

删除数据:

$log->delete();

批量获取:

$logs = \LogDao::finds([1,2]);

Session

\Session::set('admin', serialize($admin));
\Session::del('admin');

目录结构

参考hades_install

License

The Hades framework is open-sourced software licensed under the MIT license


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
ext-pdo Version *
psr/log Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hades/framework contains the following files

Loading the files please wait ....