myclabs/DeepCopy
Create deep copies (clones) of your objects
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository của tuần
#8 Repository của tuần
📦 DeepCopy: Sao chép đối tượng PHP một cách thông minh
DeepCopy giúp tạo bản sao sâu (clones) của các đối tượng PHP, đặc biệt xử lý tốt các chu trình tham chiếu (cycles).
DeepCopy là thư viện PHP giúp tạo bản sao sâu của đối tượng — sao chép cả các thuộc tính tham chiếu đến đối tượng khác. Không chỉ vậy, nó còn xử lý hiệu quả các chu trình (cycles) trong đồ thị tham chiếu, trường hợp thường gây lỗi với clone thông thường.
✨ Điểm nổi bật
- Sao chép sâu toàn bộ: Duyệt đệ quy tất cả thuộc tính và sao chép cả đối tượng tham chiếu.
- Xử lý chu trình tham chiếu: Dùng bảng băm (hash map) để tránh sao chép trùng lặp và giữ nguyên cấu trúc đồ thị.
- Hỗ trợ bộ lọc (filters): Tùy chỉnh hành vi sao chép bằng cách thêm filter và matcher.
- Hàm tiện ích
deep_copy(): Cung cấp hàm nhanh để sao chép bất kỳ biến nào. - Tùy biến đối tượng DeepCopy: Cho phép cấu hình riêng thông qua lớp
DeepCopy. - Hỗ trợ Doctrine: Các bộ lọc như
DoctrineCollectionFilter,DoctrineEmptyCollectionFilterhỗ trợ thực thể Doctrine.
💡 Vì sao đáng chú ý
DeepCopy khác với clone thông thường ở khả năng xử lý chu trình tham chiếu — trường hợp thường dẫn đến vòng lặp vô hạn hoặc lỗi bộ nhớ. Ngoài ra, hệ thống filter và matcher linh hoạt giúp người dùng kiểm soát chi tiết quá trình sao chép, phù hợp cho các ứng dụng phức tạp như quản lý thực thể Doctrine hoặc xử lý dữ liệu có cấu trúc đối tượng phức tạp.
#PHP #Clone #DeepCopy #OpenSource #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects
XG Proyect is an OGame clone open-source web application framework designed for creating game clones, particularly those inspired by the popular game OGame, set in a vast and captivating space-themed universe.
Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
Clone any website with one command using AI coding agents
Official Repository: Telegram bot which can download direct links, torrents, nzb, google drive, telegram document, any file/folder from rclone supported clouds, all yt-dlp supported sites and jdownloader supported sites, then upload them to google drive, telegram cloud or to one of rclone supported clouds
Quickly clone or backup massive amounts of org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more 🐇🥚