Download the PHP package jeanisahakyan/motion-dots without Composer

On this page you can find all versions of the php package jeanisahakyan/motion-dots. 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 motion-dots

MotionDots

MotionDots is a lightweight PHP framework designed to simplify API development by providing tools for dynamic method invocation, input validation, structured responses, and TypeScript generation. It streamlines the process of building APIs by handling common tasks such as parameter validation, response formatting, error handling, and supports the use of native PHP 8.1 enums for robust type definitions.

License: MIT PHP Version

✨ Key Features

🎯 Perfect For

📚 Documentation

For comprehensive documentation, visit our Documentation Index:


🚀 Quick Start

Requirements

Installation

Install MotionDots via Composer:

Basic Setup

Create a simple API endpoint in just a few lines:

📖 Need more details? Check out our Complete Quick Start Guide for detailed setup instructions.

Project Structure

🔧 Core Concepts

API Methods

Create API endpoints by extending AbstractMethod:

Custom Types

Build type-safe parameters with validation:

Response Classes

Structure your API responses:

📖 Learn more: See our Response System documentation.

🛠️ Advanced Setup

Complete API Processor

📖 Detailed Examples

Creating API Methods

API methods are organized into classes extending AbstractMethod. Each public method becomes an API endpoint.

Implementing API Methods

Define public methods in your class using camelCase. The method's name, combined with the class name, forms the API endpoint.

Method: registerUser

Definition:

Usage of Context in Method:

Request Example:

Response Example:

Method: loginUser

Definition:

Request Example:

Response Example:

Method: updateUserStatus

Definition:

Request Example:

Response Example:

Creating a New Response

Responses extend AbstractResponse and define the structure of the data returned to the client. The AbstractResponse class automatically handles JSON serialization of public properties.

Example:

Note: The AbstractResponse class provides default implementations for JSON serialization by automatically including public properties.

Creating a New Parameter Type

Custom parameter types extend AbstractType and handle validation and parsing of input parameters. They have access to the context via $this->context.

Example:

Using Enums

Enums provide a way to define a set of named constants, which can be used for parameter validation and response fields. With PHP 8.1, you can use native enums.

Defining an Enum

Example:

Using Enums in Parameters

Enums can be used as parameter types to ensure that only valid values are passed.

Usage in Method:

Handling API Requests

Requests are handled by the Processor, which invokes the appropriate method based on the request URI.

Error Handling

Throwing Errors

To throw errors in your methods, use the ErrorException class.

Example:

Common Error Codes:

Handling Errors in the Processor

Errors thrown in your methods are caught in the YourProcessor.php and returned as structured error responses. Example Error Response:

📱 TypeScript Generation

Generate TypeScript definitions automatically for frontend integration:

This creates organized TypeScript files:

⚡ Error Handling

MotionDots provides comprehensive error handling with predefined error codes:

Common Error Codes:

🎯 What's Next?

Ready to dive deeper? Check out our comprehensive documentation:

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📞 Support


MotionDots - Building robust APIs with PHP 8.1+ features, type safety, and automatic TypeScript generation. 🚀


All versions of motion-dots with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
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 jeanisahakyan/motion-dots contains the following files

Loading the files please wait ...