Download the PHP package cuongnd88/atom without Composer

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

Atom

A lightweight PHP framework that implements the MVC pattern.

Please read more about the Request Lifecycle.

Table of Contents

Features

Installation

Requirements: PHP >= 7.0

Quick Start

Create your entry point public/index.php:

The Server constructor accepts an array of config file names to load. The env file (e.g., config/env.ini) is loaded to set environment variables.

Application Constants

Define these constants in your bootstrap to configure directory paths:

Directory Structure

Routing

Routes are defined as PHP arrays in routes/web.php and routes/api.php.

Dynamic parameters use {param} syntax and are automatically extracted and injected into the Request object.

Supported HTTP methods: GET, POST, PUT, PATCH, DELETE

API routes are automatically detected when the URI contains api or the Content-Type header is application/json.

Middleware

Configuration

Define middleware in config/middleware.php:

Creating Middleware

Place middleware files in your MIDDLEWARE_PATH directory. Each middleware must implement a handle() method:

Attaching Middleware to Routes

Middlewares are sorted by priority and executed in order before the controller action.

Controllers

Controllers are loaded from the CONTROLLER_PATH directory. Method parameters are automatically resolved via the service container.

Request

The Request class collects parameters from URI, query string, POST data, file uploads, and JSON body automatically.

Response

Database / Query Builder

Database credentials are loaded from environment variables: DB_CONNECTION, DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, DB_PORT.

Basic Queries

Where Conditions

Use the # prefix on a key to reference a raw column name (no quoting):

Joins

Grouping & Ordering

Insert

Update & Delete

Chunking

Process large result sets in chunks:

Transactions

Query Logging

Mass Assignment Protection

Only name and email columns will be inserted; any other keys in the input are ignored.

Models

Create models by extending the abstract Model class:

CRUD Operations

Models inherit all query builder methods:

Validation

Use the Validator trait in your controllers:

Custom Error Messages

Available Rules

Rule Description Example
required Must not be empty 'required'
string Must be a string 'string'
integer Must be an integer 'integer'
email Must be a valid email 'email'
array Must be an array 'array'
date Must be a valid date 'date'
date_format Must match date format 'date_format:Y-m-d'
image Must be an image (jpeg, png, bmp, gif, svg) 'image'
between Must be between min and max 'between:1,100'
min Must be >= value 'min:18'
max Must be <= value 'max:200'
in_array Must be one of the listed values 'in_array:a,b,c'
after Date must be after given date 'after:2024-01-01'
before Date must be before given date 'before:2025-12-31'
required_if Required if another field is present 'required_if:role,admin'

Rules are combined with |: 'required|email|string'

Authentication

Use the Auth trait for session-based and JWT authentication.

Configuration

In config/app.php:

Set APP_KEY and SESSION_LIFETIME (in minutes) in your env.ini.

Usage

API Authentication

When app.auth.response.success is empty, login() returns a JSON response with the JWT token:

The token can be sent in the Authorization header for subsequent requests.

Views & Templates

Simple Views

Views are PHP files located in VIEW_PATH. Use dot notation to reference subdirectories:

Inside view files, the data array is extracted into variables:

Templates

Templates allow composing multiple view files into a layout. Define templates in config/templates.php:

Use the template() helper to render:

Storage

Local Storage

Configure storage drivers in config/app.php:

Signed URLs

Generate URLs with HMAC signatures and optional expiration:

File Handling

CSV

Image

Logging

Service Container

The container automatically resolves type-hinted dependencies in controller methods:

In controller methods, dependencies are auto-injected:

Helpers

Function Description
config('app.key') Load config value using dot notation
route('web.users') Load route definition
env('DB_HOST') Get environment variable
view('users.index', $data) Render a view file
template('layout', 'page', $data) Render a template
url('/path') Get full URL
back() Redirect to previous page
now() Current timestamp (Y-m-d H:i:s)
today() Current date (Y-m-d)
json($data) Convert to JSON
isApi() Check if request is API
storage_path('uploads') Get storage directory path
resources_path('views') Get resources directory path
public_path('images') Get public directory path
assets('/css/app.css') Get asset URL
getHeaders() Get all HTTP request headers
imageLocation($file) Extract GPS coordinates from image EXIF

Example Project

For a full implementation example, see the EzyCrazy project built with Atom.

License

MIT


All versions of atom with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
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 cuongnd88/atom contains the following files

Loading the files please wait ...