Download the PHP package muhammetsafak/jsonbase without Composer

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

JSONBase

It is a library that allows to use JSON files as database.

Note : Do not use this library for big data. This library is suitable for use only for very small data.

Requirements

Installation

Include the JSonBase.php file and let it know in which directory to keep the JSon files.

Usage

Table Create

For JsonBase, each table is actually a .json file.

Definition of create_table() method:

Insert

Definition of insert() method

Multi Insert

Definition of multiInsert() method

This method may throw an error if $data is not a multi-array.

Update

Definition of update() method

Delete

Definition of delete() method

DROP

It tries to completely delete the table and its contents.

Definition of drop() method

Example

TRUNCATE

Empties all data in a table by deleting it.

Example

Rename

Changes the name of a table.

Example

Copy

Allows a table to be copied along with its data.

Caution: If there is a different table with the table name to be copied, it will overwrite (delete) it to avoid conflicts.

Example

Donwload

It allows you to download the JSonBase file. This method will try to initiate a download via the browser by adding a timestamp to the filename along with its contents.

Example

It stops the PHP script after it. It does nothing if the requested table does not exist.

Tables

Returns the loaded table names as an array.

Example

produces a similar output:

Size

Returns the total size of the table in bytes.

Example

produces a similar output:

rowSize

Returns the total number of rows in the table.

Example

produces a similar output:

QUERY BUILD

You can use the select(), from() and where() methods to create a query in the JSonBase library.

select() It is used to generate a Json query. Specifies the columns in the results from the row() and rows() methods. * means all columns. If more than one column is desired, they must be separated by ,.

Definition of select() method

from() It is used to generate a Json query. Indicates on which Json the query to be executed with get() method will be executed.

Definition of from() method

$from a table name.

where() It is used to generate a Json query. Creates a where array for the query to be executed with the get() method. Multiple matches can be made using this method chaining.

Definition of where() method

$key a column name

$value value in column

Multiple where can be added using the where() method multiple times in a row or chaining.

The query constructed with the from() and where() methods should be executed with the get() method.

get() Execute the query created with the select(), from() and where() methods and get the results if any. You can access the results obtained with this method with the row(), rows() methods.

Definition of get() method

Results

You can access the results obtained by executing the get() method with the row(), rows() methods.

row() Returns the first result obtained as an associative array.

Definition of row() method

rows() Returns the resulting results as an associative array.

Definition of rows() method

Num_Rows

_num_rows()_ Returns the number of rows affected.

Definition of num_rows() method


Examples

Suppose we have a students.json file like the one below.

Example 1 :

Output:

Example 2 :

Output:

Example 3 :

Output:


Getting Help

If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.

Getting Involved

All contributions to this project will be published under the MIT License. By submitting a pull request or filing a bug, issue, or feature request, you are agreeing to comply with this waiver of copyright interest.

There are two primary ways to help:

Using the issue tracker

Use the issue tracker to suggest feature requests, report bugs, and ask questions. This is also a great way to connect with the developers of the project as well as others who are interested in this solution.

Use the issue tracker to find ways to contribute. Find a bug or a feature, mention in the issue that you will take on that effort, then follow the Changing the code-base guidance below.

Changing the code-base

Generally speaking, you should fork this repository, make changes in your own fork, and then submit a pull request. All new code should have associated unit tests that validate implemented features and the presence or lack of defects. Additionally, the code should follow any stylistic and architectural guidelines prescribed by the project. In the absence of such guidelines, mimic the styles and patterns in the existing code-base.

Credits

License

Copyright © 2022 MIT License


All versions of jsonbase with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 muhammetsafak/jsonbase contains the following files

Loading the files please wait ....