Download the PHP package planetbiru/magic-object without Composer

On this page you can find all versions of the php package planetbiru/magic-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magic-object

MagicObject

Introduction

MagicObject is a powerful library for developing applications in PHP with ease. It enables the dynamic creation of classes for various intended uses. Below are some of its key features:

Features

  1. Dynamic Object Creation: Easily create objects at runtime.
  2. Setters and Getters: Simplify property management with automatic methods.
  3. Multi-Level Objects: Support for nested objects.
  4. ORM: Object-Relational Mapping support for easier interactions with databases.
  5. Filtering and Pagination: Built-in methods for managing data display.
  6. Native Query: Defining native queries for a function will increase flexibility and resource efficiency in accessing the database.
  7. Multiple Database Connection: MagicObject supports the configuration of multiple database connections, allowing applications to interact with different databases simultaneously.
  8. Database Dumping: Export database contents efficiently.
  9. Serialization/Deserialization: Handle JSON and YAML formats seamlessly.
  10. Data Importing: Import data even if source and destination schemas differ.
  11. File Reading: Read INI, YAML, and JSON configuration files.
  12. Environment Variable Access: Easily fetch environment variable values.
  13. Configuration Encryption: Secure application settings.
  14. HTTP Data Handling: Create objects from global request variables (POST, GET, etc.).
  15. Session Management: Integrate with PHP sessions.
  16. Object Labeling: Enhance object identification.
  17. Multi-Language Support: Facilitate localization.
  18. File Uploads: Handle file uploads efficiently.
  19. Annotations: Add metadata to objects for better structure.
  20. Debugging: Tools to debug and inspect objects.

This library provides a versatile toolkit for building robust PHP applications!

Installation

Installing MagicObject

To install MagicObject, run:

If Composer is not installed, use:

To remove MagicObject:

Or if Composer is not installed:

Installing Composer

To install Composer on your system or download the latest composer.phar, visit https://getcomposer.org/download/

To see available versions of MagicObject, visit https://packagist.org/packages/planetbiru/magic-object

Installing MagicObject on PHP 5

This guide walks you through the steps to install MagicObject using Composer on a PHP project, particularly if you're working with a PHP version that might not meet the platform requirements for the package.

Prerequisites:


Steps to Install MagicObject

1. Navigate to Your Project Directory

Open your terminal and navigate to your PHP project folder:

Make sure you're in the correct directory where your PHP project resides.

2. Install MagicObject Using Composer

Run the following command to require MagicObject in your project:

This command will:

3. Update Dependencies with Ignored Platform Requirements

If you're using a PHP version or configuration that doesn't meet the platform requirements specified by MagicObject, you can use the --ignore-platform-reqs flag to bypass those checks during the installation process:

This command will:

4. Autoload Composer in Your PHP Script

After the installation completes, include Composer's autoloader in your PHP scripts to make MagicObject available for use:

This ensures that all your dependencies, including MagicObject, are loaded automatically.

5. Verify Installation

Check that MagicObject is installed by verifying its presence in the vendor directory:

You should see the MagicObject files in the vendor/planetbiru/magic-object folder.

6. Start Using MagicObject

You can now start using MagicObject in your PHP application. Example usage:

Replace this with your specific use cases as needed.

Advantages

MagicObject is designed for ease of use and can even be used with a code generator. An example of a code generator that successfully creates MagicObject code using only parameters is MagicAppBuilder. MagicObject offers many flexible ways to write code, allowing users to choose the approach that best suits their needs.

In addition to prioritizing ease of use, MagicObject is also optimized for efficiency in terms of both time and resource usage, enabling applications to run smoothly even on servers with minimal specifications. This reduces costs in both development and operational phases.

Application Scaling

For large applications, MagicObject supports database and storage scaling. You can distribute user access across multiple servers and use Redis for session storage. MagicObject integrates with Redis for cloud-based session storage, which can be secured using a password.

Example

Simple Object

Yaml

Yaml File

Configuration Object

Create class ConfigApp by extends MagicObject

Entity

Usage

Conclusion

MagicObject is designed to offer ease and speed in creating and managing database entities. Here are several reasons why the methods used by MagicObject can be considered intuitive:

  1. Declarative and Annotation-Based:

    • By using annotations, MagicObject allows developers to declare entity properties and metadata directly within the code. This makes it easier to understand the structure and relationships of the entities.
  2. Easy Integration with Configuration:

    • MagicObject can be easily integrated with configuration systems like ConfigApp, making database and development environment setup more straightforward and organized.
  3. Automation:

    • MagicObject automatically handles many routine tasks, such as CRUD (Create, Read, Update, Delete) operations and table relationships. Developers don’t need to write manual SQL code, reducing the potential for errors.
  4. Object-Oriented Approach:

    • MagicObject uses an object-oriented approach, allowing developers to work with entities as PHP objects, utilizing methods and properties directly on the entities.
  5. Support for Various Data Formats:

    • MagicObject can accept data in various formats, including stdClass objects, associative arrays, and form inputs from HTML. This provides flexibility in handling data from different sources.
  6. Easy Relationship Management:

    • By defining relationships between entities, such as ManyToOne and OneToMany, MagicObject makes it easy to manage complex relationships without needing to write explicit join SQL.
  7. Automatic Conversion Capabilities:

    • MagicObject has the capability to automatically convert objects to JSON, which is extremely useful for APIs and modern web applications.

Tutorial

A tutorial is available here: https://github.com/Planetbiru/MagicObject/blob/main/tutorial.md

Applications Using MagicObject

  1. Music Production Manager https://github.com/kamshory/MusicProductionManager
  2. MagicApp https://github.com/Planetbiru/MagicApp
  3. MagicAppBuilder https://github.com/Planetbiru/MagicAppBuilder
  4. Koperasi-Simpan-Pinjam-Syariah https://github.com/kamshory/Koperasi-Simpan-Pinjam-Syariah
  5. Toserba Online https://toserba-online.top/

Credit

  1. Kamshory - https://github.com/kamshory/

Contributors

  1. Kamshory - https://github.com/kamshory/

All versions of magic-object with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package planetbiru/magic-object contains the following files

Loading the files please wait ....