承接 sadiq-bd/alkane-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sadiq-bd/alkane-php

最新稳定版本:2.1.0

Composer 安装命令:

composer create-project sadiq-bd/alkane-php

包简介

The PHP Framework for easy and flexible Development (v2.1)

README 文档

README

Repository Views

Alkane PHP v2.1

The lightweight, flexible PHP framework for rapid and robust development.

🚀 Features

  • Minimal, expressive routing
  • Simple, chainable database queries
  • Powerful session management
  • PSR-4 autoloading support
  • Easy integration with Apache or Nginx
  • Composer-ready

📦 Installation

composer create-project sadiq-bd/alkane-php

📝 Quick Start

Routing

use Core\Router;

// Basic route
Router::get('/', function() {
    return 'Hello World';
});

// Route with parameter
Router::get('/user/{id}', function($param) {
    return 'User ID - ' . $param['id'];
});

// Route with controller
Router::get('/home', App\Controller\HomeController::class, 'method');

Database Querying

$db = Core\Database::getInstance();
// or: $db = new Alkane\Database(?$custom_connection_name);

$sql = new Core\SqlQuery($db);
$sql->select(['ID', 'name', 'email'])
    ->from('table')
    ->where('ID = :id', ['id' => 20]);

$result = $sql->exec();
print_r($result->fetch(Core\SqlQuery::FETCH_ASSOC));

Session Management

Core\SessionController::set('mail.smtp.host', 'smtp.gmail.com');
Core\SessionController::set('mail.smtp.user', 'user@gmail.com');
Core\SessionController::set('mail.smtp.password', 'your_password');

// Retrieve session data
print_r(Core\SessionController::get('mail.smtp'));

/* Output:
Array (
    [host] => smtp.gmail.com
    [user] => user@gmail.com
    [password] => your_password
)
*/

🌐 Web Server Configuration

Apache

Add the following rewrite rules to your .htaccess:

RewriteEngine On
RewriteRule ^(.*)$ index.php [L,QSA]

ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php
ErrorDocument 502 /index.php
ErrorDocument 503 /index.php

Nginx

Paste this in your server block:

location / {
    rewrite ^(.*)$ /index.php?$1 last;
}

📚 Documentation

Official documentation is coming soon. For now, see the example code above or explore the source!

🤝 Contributing

Pull requests and issues are welcome! For major changes, please open an issue first to discuss what you would like to change.

📄 License

This project is licensed under the MIT License.

💬 Contact

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-09