Download the PHP package crocodile2u/tinyorm without Composer

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

tinyorm

Very minimalistic ORM & DB tools for PHP

Why yet another library?

I know quite a lot of similar projects but they all don't satisfy me. Therefore, I made a list of requirements that my perfect ORM library should meet.

While there are tools that conform to some of the requirements, I failed to find a library that has it all.

Show me the code!

Select usage:

You can set fetch modes for Select:

Working with multiple DB connections:

This way, if anything goes wrong with the first or the second INSERT, transactions in both connection will be rolled back, no rows will be inserted. On the other hand, if everything goes fine, transactions in both connection will be commited.

Transaction manager supports nested transactions, and the tinyorm\Db class also supports them.

The approach

I used an approach similar to that of Zend Framework 2 ( http://framework.zend.com/manual/current/en/user-guide/database-and-models.html ). The entity classes are just simple data containers that do not have DB connection/persistence logic. However, in the end, tinyorm entities do have minimal "knowledge" about their relationship to a storage layer. First, they have getSourceName() method which essentially is meant to return a storage table/collection name. Second, there are getPK() and setPK() methods to access primary key. The name primary key column is stored in protected pkName property. And finally, entities have getSequenceName(). I made all this for the sake of simplicity, in order not to have to introduce more classes. tinyorm only supports _AUTOINCREMENT'ed primary keys. In contracts to Zend Framework 2, all the stuff related to persistence is just a few classes/interfaces:

Persistence driver operates on Entities. In case of ZF2, we can talk about their Table Gateway as a persistence driver. See the link above for reference. In tinyorm, things are way more simple. You just create a persistence driver instance and call its' save(), insert(), update(), delete() methods providing an Entity as an argument.

For a query object, I took a look at Phalcon framework ( https://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Model_Query_Builder.html ). However, I modified the interface a little, so I find it a little bit better.

I also implemented a database transaction manager capable of handling multiple DB connections.

Credits

Thanks RasmiKanta Moharana (https://github.com/rashmi8105) for early feedback & spotting bugs in the example app!


All versions of tinyorm with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-pdo 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 crocodile2u/tinyorm contains the following files

Loading the files please wait ....