limeberry/autopulse

此包已被放弃,不再维护。作者建议使用 nessphp/application 包。

Autopulse 是 limeberry 框架的一部分。您可以在 limeberry 项目中使用 autopulse 执行所有数据库相关操作。

维护者

详细信息

github.com/limeberry/autopulse

此包尚未发布版本,信息不多。


README

limeberry.library.png

Autopulse 扩展

此仓库包含 limeberry 框架的源代码。如果您想使用 limeberry 框架创建项目,请使用 limeberry 仓库

Autopulse 是 limeberry 框架的一部分。您可以在 limeberry 项目中使用 autopulse 执行所有数据库相关操作。

limeberry 框架的一些功能作为独立的包提供。此仓库包含框架的一些核心代码。请保持 composer 更新以获取最新的包。

下载

composer require limeberry/autopulse

探索 Autopulse 的易用性

让我们创建一个数据库类来处理数据库生成和迁移。

project_root\application\library\database.php

<?php

use limeberry\autopulse\MySqlConnect;
use limeberry\autopulse\factory\Column;
use limeberry\autopulse\factory\Table;
use limeberry\autopulse\factory\Schema;
use limeberry\autopulse\factory\Migration;
use limeberry\Configuration;


class database
{
    private $connection;
    private $schema;

    function __construct()
    {
        $this->connection = new MySqlConnect("localhost", "root", "pass");
    }


    function migration(){

        $database = new Schema("db_name");
        $database->Version(1)
                ->Tables(new Table("users",
                            new Column("id", "int", "primary key AUTO_INCREMENT"),
                            new Column("username", "varchar(25)","unique not null"),
                            new Column("password", "varchar(16) not null")));

        /** Optional; If you do not want to write database name manualy later. */
        $this->schema = $database;
        //If you are in 'development' mode run
        //the migration action to check the database
        //version and migrate if needed
        
        if(Configuration::isErrorsEnabled()){
            Migration::Up($database, $this->connection->Source());
        }

    }

    public function getConnection()
    {
        return $this->connection;
    }

    /**
     * optional.
     */
    public function getDatabaseName(){
        return $this->schema->Name();
    }
}

学习 Limeberry 框架

我们尝试在简单的用户手册中解释框架的定义和用法。您可以从用户手册开始学习 Limeberry。我们正在努力创建关于框架的幻灯片教程和一些教育材料。我们将尽快开始发布新的教程。

联系

对于任何建议或安全漏洞,您可以发送电子邮件到 limeberry.framework@gmail.com 与 Limeberry 联系。