2017 © Pedro Peláez
 

library phiber

Simple PHP ORM

image

marciioluucas/phiber

Simple PHP ORM

  • Sunday, May 13, 2018
  • by marciioluucas
  • Repository
  • 1 Watchers
  • 5 Stars
  • 131 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

HitCount Build Status Codacy Badge Scrutinizer Code Quality GitHub issues GitHub forks GitHub stars GitHub license Twitter, (*1)

Phiber - ALPHA version 1.2

Imgur, (*2)

Phiber is a simple ORM framework that helps you code your applications faster., (*3)

  • MySQL integration
  • Object Orientation
  • Without SQL

New Features!

  • Persistence
  • Build websites, apps and api without a single SQL query line.
  • Choose if you wanna make your SQL manually or by Object Mapping.

You can also: - See generated SQL - Activate console logs., (*4)

This library has been made by a Internet Systems Tecnology's student from Morrinhos - GO, Brazil., (*5)

IFGoiano, (*6)

Creator [Márcio Lucas], (*7)

I made this library to increase my knowledge and to help my programmer friends build apps in PHP faster, because I see big difficulty to build SQLs and i think it is very boring., (*8)

This library are in alpha test, I don't recommend to production environments., (*9)

Technology

Phiber uses just pure PHP and until now only has been builded the part to MySQL 5.5+. *In the next versions we will implement in BDs like PostgreSQL and Oracle., (*10)

Dependencies

Phiber have only depdencies with Composer., (*11)

Installation

Phiber requires PHP 5.3.3+ to run and MySQL 5.5+., (*12)

Installing Phiber in your project., (*13)

The Phiber instalation is made by Composer, using the console code below:, (*14)

$ composer require marciioluucas/phiber

Config

To configure Phiber is very simple, you have to create an archive called phiber_config.json in your project root path same like this., (*15)

$ROOT_PROJECT_PATH/phiber_config.json, (*16)

{
  "phiber": {
    "language": "pt_br", 
    "link": {
      "database_technology": "mysql", 
      "database_name": "phiber_test", 
      "url": "mysql:host=localhost;dbname=teste_phiber", 
      "user": "root", 
      "password": "", 
      "connection_cache": true 
    },
    "log": true, 
    "execute_queries": true
  }
}

Examples

InnerJoin example:
$phiber = new Phiber();

$phiber->setTable("user");
$phiber->setFields(["user.id","user.name","user.email"]);
$phiber->add($phiber->restrictions->join("user_address", ["pk_user", "fk_user"]));
$phiber->add($phiber->restrictions->and($phiber->restrictions->equals("user.id","1"), $phiber->restrictions->like("user.name","Marcio") ));
$phiber->add($phiber->restrictions->limit(15));
$phiber->add($phiber->restrictions->offset(5));
$phiber->add($phiber->restrictions->orderBy(['user.id ASC']));
$phiber->select(); // Execute query
echo $phiber->show(); // After execute, prints the generated query
Generate->
SELECT user.id, user.name, user.email FROM user INNER JOIN user_address ON pk_user = fk_user  WHERE (user.id = :condition_user.id AND user.name LIKE CONCAT('%',:condition_user.name,'%')) ORDER BY user.id ASC LIMIT 15  OFFSET 5;

TODOS:

  • In the create method, make the support for the composition and others.
  • Split classes correctly
  • Do Relationables tables

License

MIT, (*17)

Free Software, Hell Yeah!, (*18)

The Versions

13/05 2018

dev-master

9999999-dev

Simple PHP ORM

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Márcio Lucas

orm php framework php orm simple orm automatize sql writing

08/09 2017

dev-alpha-v1.2

dev-alpha-v1.2

Simple PHP ORM

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Márcio Lucas

orm php framework php orm simple orm automatize sql writing

31/08 2017

dev-alpha-v1.1

dev-alpha-v1.1

Simple PHP ORM

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Márcio Lucas

orm php framework php orm simple orm automatize sql writing

15/06 2017

dev-alpha-v1.0

dev-alpha-v1.0

Simple PHP ORM

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Márcio Lucas

orm php framework php orm simple orm automatize sql writing