adaiasmagdiel/fullcrawl 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

adaiasmagdiel/fullcrawl

最新稳定版本:v1.2.1

Composer 安装命令:

composer require adaiasmagdiel/fullcrawl

包简介

A minimalist, framework-agnostic database migration system using dependency injection.

README 文档

README

FullCrawl is a high-performance, framework-agnostic database migration system for PHP. It follows a "Zero Configuration" philosophy by inheriting your project's existing PDO connection, ensuring atomic operations through native database transactions.

Why FullCrawl?

Most migration systems force you to re-configure database credentials or bind you to a specific framework's ORM. FullCrawl breaks this cycle:

  • Zero-Config: It uses the connection you already established.
  • Atomic Operations: Every migration batch is wrapped in a transaction. If one fails, they all roll back.
  • Framework Agnostic: Use it with Rubik, Slim, Lumen, WordPress, or your own custom-built engine.
  • True Injection: No global states. The $pdo instance is injected directly into your migration closures.

Quick Start

1. Installation

composer require AdaiasMagdiel/FullCrawl

2. The Hook (fullcrawl.php)

Create a file named fullcrawl.php in your project root. It must return your active PDO instance.

<?php
// fullcrawl.php

require_once __DIR__ . '/vendor/autoload.php';

// Return your existing PDO instance from your Service Container, 
// Singleton, or Connection factory.
return \App\Core\Database::getInstance()->getConnection();

Usage

Command Line Interface

FullCrawl provides a powerful CLI to manage your database schema:

Command Description
--new "name" Generates a new migration stub with a timestamped filename.
--run Executes all pending migrations within a new batch.
--rollback Reverts the last successful batch of migrations.
--status Displays a detailed list of applied and pending migrations.
--fresh Destructive: Drops all tables and re-runs all migrations.

Anatomy of a Migration

When you run fullcrawl --new, a file is created in database/migrations/. You have full access to the $pdo object:

<?php

/**
 * FullCrawl Migration: create_users_table
 */
return [
    'up' => function(PDO $pdo) {
        $pdo->exec("CREATE TABLE users (
            id INT AUTO_INCREMENT PRIMARY KEY,
            username VARCHAR(50) NOT NULL,
            email VARCHAR(255) NOT NULL UNIQUE
        ) ENGINE=InnoDB");
    },
    'down' => function(PDO $pdo) {
        $pdo->exec("DROP TABLE users");
    }
];

Directory Structure

.
├── database/
│   └── migrations/    # Your migration files (auto-created)
├── fullcrawl.php      # The PDO hook
└── vendor/

License

FullCrawl is licensed under the GPLv3. I believe in free and open software. See the LICENSE and the COPYRIGHT files for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2026-01-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固