Download the PHP package illogical/lava without Composer
On this page you can find all versions of the php package illogical/lava. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lava
Lava
Micro-Framework
Requirements: PHP 5.4+, 7+, 8+
Installation
If you are using Composer, run the command
Or you can download the archive
Usage
Use the Lava\App class
If you downloaded the archive, use the autoloader
Environment
Lava\App::conf([data]) : accessor
Config
Lava\App::env() : accessor
Environment
Lava\App::args() : accessor
Variables
Value priority: custom, POST, GET
Lava\App::cookie() : accessor
Cookies
Offsets for expire:
- s - second
- m - minute
- h - hour
- D - day
- W - week
- M - month
- Y - year
Lava\App::host([scheme [, subdomain]]) : host
Returns the name of the host
If scheme is TRUE, then the current scheme
Lava\App::home([node, ...]) : home
Returns the home folder
If not set in the config, then the current folder where the script is running
Lava\App::pub([node, ...]) : pub
Returns the public folder
If not set in the config, then the current folder
Lava\App::uri([path|route [, data [, append]]]) : uri
Returns URI
Variables from data will be appended as query_string
The append flag adds the current query_string
Lava\App::url([path|route [, data [, append]]]) : url
Returns URL
Routes
Lava\App::route([rule [, cond]]) : route
Placeholder :name corresponds to the full fragment ([^\/]+)
Placeholder #name matches the name ([^\/]+?)(?:\.\w*)?
Placeholder *name matches the remainder (.+)
You can add a restriction on environment variables in the additional cond conditions
If the rule does not start with a slash, it will be appended to the public folder Lava\App::pub()
Lava\App::route_get([rule]) : route
Restrict the route to the GET method
Lava\App::route_post([rule]) : route
Lava\App::routes_match() : result
Executes handlers for matched routes
If the handler returns TRUE, it continues checking the rest of the routes, otherwise it stops checking and returns the result of the handler
route->cond(cond) : route
Add an environment constraint to the route
route->name(name) : route
Used to convert a route to a path
route->to(mixed) : route
Route handler
Default method Lava\App::env()->method
Rendering
Lava\App::render(handlers) : has_handler
Executes a handler with type Lava\App::type(), if none exists, then with index 0
If there is no type of the requested data, Lava\App::conf()->type is used
If the type is json and there is a Lava\App::args()->callback value, returns JSONP
Lava\App::redirect([url|uri|route [, data [, append]]]) : void
Appends to the Location header
Security
Lava\App::safe()->uuid() : uuid
Returns UUID
You can specify the hashing algorithm in the config, the default is md5
Lava\App::safe()->uuid_signed() : [signed_uuid, uuid]
Returns the signed UUID
You can specify the signature in the config, defaults to an empty string
Lava\App::safe()->check(signed_uuid) : uuid
Checks the signed UUID
Lava\App::safe()->salt(size) : random_string
Returns a random string of the given length
You can change the list of available characters in the config, default is 0123456789abcdef
Validation
Lava\App::is_valid(val, tests) : bool_result
Tests:
- tinyint[:unsigned]
- smallint[:unsigned]
- mediumint[:unsigned]
- integer[:unsigned]
- bigint[:unsigned]
- numeric[:precision[:scale]]
- boolean
- string[:min_size[:max_size]]
- char[:size]
- url
- ipv4
- date
- time
- datetime
- lt[:num]
- lte[:num]
- gt[:num]
-
gte[:num]
- bool
- array
- regexp
- function
Storage\PDO
Lava\Storage::source('PDO', opts) : storage
Creation
storage->exec(query[, bind]) : row_count
Runs the SQL query and returns the number of rows involved in its execution
storage->fetch(query[, bind]) : row
Fetching a row from the result set
storage->fetch_all(query[, bind[, index]]) : rows
Fetching all rows from the result set
index is used to specify the name of the field whose value will become the index
storage->last_insert_id() : id
ID of the last inserted row
storage->error() : error_info
Driver-defined error message
storage->factory([target]) : factory
Query factory
factory->get([index]) : rows
Data selection
factory->one() : row
Selecting one record
factory->columns(expression) : factory
Columns or calculations
factory->*join(target, relations[, bind]) : factory
Table joins
factory->filter*(expression) : factory
Data filtering: filter_eq, filter_ne, filter_lt, filter_gt, filter_lte, filter_gte, filter_like, filter_not_like, filter_in, filter_not_in, filter_between, filter_is_null, filter_is_not_null, filter_raw
Context change: filter_and, filter_or, filter_not
filter works depending on context, for data as filter_eq, for closures as filter_and
factory->group_by(expression) : factory
Grouping
factory->having*(expression) : factory
Similar to filter
Filtering data: having_eq, having_ne, having_lt, having_gt, having_lte, having_gte, having_like, having_not_like, having_in, having_not_in, having_between, having_is_null, having_is_not_null, having_raw
Context change: having_and, having_or, having_not
having works depending on context, for data as having_eq, for closures as having_and
factory->order_by*(expression) : factory
Sorting
factory->limit(count[, offset]) : factory
Limits the number of records returned
factory->add(data[, update]) : row_count
Inserting data
factory->set(data) : row_count
Update data
factory->del() : row_count
Deleting data
factory->count([key]) : count
Returns the number of expressions
factory->min(key) : value
Returns the minimum value
factory->max(key) : value
Returns the maximum value
factory->avg(key) : value
Returns the average value
factory->sum(key) : value
Returns the sum of values
Model\SQL
Creation
Selecting
Default values
Relationship
Import & Export
All versions of lava with dependencies
ext-json Version *