Download the PHP package arefshojaei/lite-php without Composer

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

Picture

Tutorial :

  1. Introduction
    • What is Lite-PHP ?
    • Why Lite-PHP ?
  2. Installation
  3. Flow chart of process
  4. Folder Structure
    • core/
    • bootstrap/
    • public/
    • modules/
    • plugins/
    • console/
    • resources/
    • hooks/
    • storage/
  5. Root Files
    • .env.example
    • .gitignore
    • .htaccess
    • cli
    • composer.json
    • gulpfile.mjs
    • init
    • package.json
    • README.md
    • robots.txt
    • server.php
  6. Modules
    • alias
    • config
    • enum
    • plugin
    • validator
  7. Template Engine
  8. Cli ( console )
  9. Helpers
    • import
    • route
    • dd
    • parse
    • view
    • command
    • test
    • abort
    • build
    • translate
    • url
    • assets
    • validator
    • assert
  10. Hooks
    • useHTTP
    • useGET
    • usePOST
    • useFetch
    • useID
    • useConfig
    • useEnum
    • useState
    • useGlobal
    • useHash
    • usePasswordVerfiy
    • useHTML
    • useMode
    • useEnv
    • useLog
    • useError
    • usePlugin
    • useQuery
    • useResponse
    • useRequest
    • useRedirect
    • useURL
    • useBody
    • useHeader
    • useMatch
    • useFlash
    • useFile
    • useUpload
    • useCache
    • useCookie
    • useSession
    • useToken
    • useVerifyToken
    • useValidator
    • useAction
    • useTable
    • useRecord

Introduction

What is Lite-PHP ?

Lite-PHP is a Micro Freamework for developing Back-end applications

Why Lite-PHP ?

Because Lite-PHP has:

Simple & Fast Development Env

Modular Strucutre

DBMS Like Mysql

Testing Module

Custom Plugins & Hooks

Custom Command-line in console

REST API Development

Functional Programming Structure

Folder Strucutre

No OOP & No Object & No Class


Installation

Using Composer

Using GIT


View of LITE PHP process in application

flow

Folder Structure

Here is default folder structure for starting new project !

core/

Main files or Lite-PHP core files that can be provided base files for every projects!

bootstrap/

Base files to boot the app

modules/

Modules that the app needs to run as main file

hooks/

Lets you to development custom hooks

plugins/

Lets you to development custom plugin

public/

Static files in production with entry point file ( index.php )

resources/

Asset and View files

storage/

Local folder & files like Log, Cache & Upload ...


Root Files

.env.example

This is a config for ENV , Then before starting the project you must changed it from .env.example to .env file!

.gitignore

This is a config to hide files to not push on Github

.htaccess

Apache web server config

cli

Console configuration to use commands

composer.json

Passport of package info

gulpfile.mjs

Task-runner configuration for assets

init

Basic setup configuration to development app

package.json

List of pacakge dependencies that the Task-runner needs to run

README.md

Lite-PHP Package info

robots.txt

This is configuration for crawlers of Google

server.php

Main file for launching the app


Modules

Alias

Registers custom Alias

1-Example:

2-How can I use that ?

Move to "bootstrap/alias.php" Then, register an Alias by this way :

Config

Registers new configuration for a module

1-How can I create a config ?

2-How can I use the config ?

Enum

Registers an Enum as constant

1-How can I create an Enum ?

2-How can I use the Enum ?

Plugin

Registers new Plugin

Note: We have two types for using plugin :

  1. Runner Type needs to register in "bootstrap/providers.php"

  2. Usage Type needs to use in function or logic code

1-How can I create a Runner type Plugin ?

2-How can I use the Runner Plugin ?

Move to "bootstrap/providers.php" , then use this way to register the Runner Plugin

3-How can I create a Usage type Plugin ?

4-How can I use the Usage Plugin ?

Note: for using the plugin, you should use this way

Validator

Defines Schema for input data

1-How can I create a Schema ?

2-How can I use that ?


Cli

These are list of commands that can be done works to develop your application!

carbon (2) carbon (1) carbon (3)


Template Engine

Provides to work as professional with templates instead of using usual php template engine !

Examples :

Before - views/user.php

After - views/user.hbs

NOTE: We want to work it as professional with customized .hbs template engine and we don't have this like JS lib ( handlebars ) template engine and you should know about it that we have a customized template engine !

Syntaxes

Directives

Condition

Loop

Partial

Script

Validation

Auth


Helpers

import

Loads file by Alias

Route

Adds new Route in a module

Note: You can use it by two ways:

  1. Add Single Route

  2. Group Routes

DD

Dumps and dies an Array in browser

Note : You don't need to load the helper, Because the helper has loaded !

Parse

Gets file content

View

Renders view template

Command

Adds new Command to use in console

Note: You can use it by two ways:

  1. Add Single Command

  2. Group Commands

Test

Tests module

Note: You can test by two ways:

  1. Test single module by name

  2. Test all modules

Abort

Throw HTTP error as Rendered page to show Error message

Build

Builds new path & URL

Translate

Translates content

URL

Provides to use helper functions for URL, Route and ...

Assets

Provides to use helper functions for Asset files

Validator

Provides to validate data

Assert

Provides to assert data in unit test


Hooks

Note: You should use hooks in logic code and don't use that outer of logic code!


UseHTTP

Provides to use http as $_SERVER super global

UseGET

Provides to use $_GET super global

UsePOST

Provides to use $_POST super global

UseFetch

Provides to send http request

Examples :

UseID

Provides to get random number ID

UseConfig

Provides to get Config by key

Note: Sometimes you don't want to get error for getting value from the hook usage, First you should load target module configuration in current file or script !

UseEnum

Provides to get Enum by key

Note: sometimes you dont' want to get error for getting value from the hook usage, First you should load target module configuration in current file or script !

UseState

Provides to define state in container as $GLOBALS['container'] super global

Note: The hook has more option that you will like that

  1. Define state as "value"

  2. Define state as "key" & "value"

  3. Define state as "key" (Nested) & "value"

UseGlobal

Provides to get value from container as $GLOBALS['container'] super global

UseHash

Provides to hash password

UseVerifyPassword

Provides to verify hashed password

UseHTML

Provides to get html content by url

UseMode

Provides to get current app mode from ".env" as APP_MODE ( Production | Development )

UseEnv

Provides to get env from ".env" by key

UseLog

Provides to put log message

UsePlugin

Provides to use plugins that has usage type

UseQuery

Provides to run SQL query

UseResponse

Provides to return content output to the response as JSON | HTML | TEXT

Note : You don't need to set content-type in header, Because the hook has done it

UseRequest

Provides the request data

UseRedirect

Provides to redirect to a route

UseURL

Provides to parse URL

UseBody

Provides to get the request body data

UseHeader

Provides to add & remove header by key and value

UseMatch

Provides to use regex

UseFlash

Provides to add & remove falsh message

useFile

Provides to get file from $_FILES

useUpload

Provides to upload file in local stroage

useCache

Provides to cache data

useCookie

Provides to use cookie in process of app

useSession

Provides to use session in process of app

UseToken

Provides to generate new token

UseVerifyToken

Provides to verify token

useValidator

Provides to validate input data

useAction

Provides to save action in local database

useRecord

Provides to save data in local database

useTable

Provides to get & delete data in local database

1-Getting data:

2-Deleteing data:


All versions of lite-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 arefshojaei/lite-php contains the following files

Loading the files please wait ....