定制 bridgetphp/bridget 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bridgetphp/bridget

Composer 安装命令:

composer require bridgetphp/bridget

包简介

Bree - A modern PHP superset with strong typing and OOP enhancements

README 文档

README

packagist-version-icon packagist-download-icon

Bree is a modern PHP framework designed to enhance development with strong typing, advanced object-oriented features, and a powerful templating system inspired by Blade. 💡✨

⚡ Quick Start

📦 Install Bree

Install Bree via Composer with:

composer global require bree/bree:dev-main

🎉 Try Bree

Create a hello.bg file:

Hello, $name!

Run it with:

bree run hello --name=Bree

This displays: Hello, Bree! 🎊

❓ What is Bree?

Bree is a cutting-edge PHP framework that introduces:

Strong typing for better code reliability 🔍 ✅ Advanced OOP features for maintainable applications 🏗️ ✅ A powerful templating system for seamless UI rendering 🎨 ✅ Full PHP compatibility ensuring easy adoption 🔄

🔥 Why Choose Bree?

  • 🚀 Enhances PHP without breaking compatibility – Upgrade your projects without major rewrites.
  • ✍️ No need for PHPDoc & annotations – Types are enforced at both transpilation and runtime.
  • Inspired by TypeScript – Offers both static and dynamic typing for flexibility.
  • 🎭 Blade-like templating – Clean and structured HTML rendering.

🌟 Features

  • 🛡️ Strong Typing – Enforces types at compile-time and runtime.
  • 🏗️ Advanced OOP – Expands PHP’s object-oriented capabilities.
  • 🔄 Dynamic & Static Typing – Inspired by TypeScript.
  • 🖥️ Integrated Templating Engine – A Blade-like system for clean HTML rendering.
  • 🧩 Seamless PHP Integration – 100% compatible with existing PHP code.

📋 Requirements

🔹 PHP 8.4 or higher (8.4.3+ recommended)
🔹 Composer
🔹 Git
🔹 Node.js (Optional)

🚀 Installation

Install Bree from Packagist using Composer:

composer global require bree/bree:dev-main

🛠️ Usage

Bree transpiles .bg files into .php, introducing enhanced features while maintaining PHP compatibility.

🔧 Example Command

bree source.bree

This converts source.bg into an optimized PHP file.

📝 Example Code

<?php
// Strongly-typed function in Bree
function greet<T extends string>(T $name): T {
    return "Hello, $name!";
}

echo greet("World");

🏆 Transpiled PHP Code

<?php

function greet(string $name): string {
    return "Hello, $name!";
}

echo greet("World");

?>

Bree ensures type safety at transpilation, making PHP development more robust. 🛡️

🤝 Contributing

We welcome contributions! 💖 Whether it's bug fixes, new features, or documentation improvements, feel free to contribute.

📌 How to Contribute

  1. 🍴 Fork the repository.
  2. 🌱 Create a new branch.
  3. 🛠️ Implement your changes and add tests.
  4. 📤 Submit a pull request.

Please follow our coding style and contribution guidelines. 🙌

📜 License

Bree is licensed under the MIT License. See the LICENSE.md file for details.

💬 Support & Community

For questions, issues, or feedback:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-24