phiber
1.0.0
Phiber是一個簡單的ORM框架,可幫助您更快地編碼應用程序。
您也可以:
該圖書館是由Internet Systems Tecnology從Morrinhos的學生製作的 - 巴西Go。
創造者[MárcioLucas]
我製作了這個圖書館來增加我的知識,並幫助我的程序員朋友更快地構建PHP的應用程序,因為我看到建立SQLS的困難很大,而且我認為這很無聊。
該庫正在Alpha測試中,我不建議對生產環境進行。
PHIBER僅使用純PHP,直到現在,僅將MySQL 5.5+的零件構建。 *在接下來的版本中,我們將在諸如PostgreSQL和Oracle之類的BD中實現。
Phiber僅具有作曲家的份量。
PHIBER需要PHP 5.3.3+運行和MySQL 5.5+。
在您的項目中安裝Phiber。
phiber的構造是由作曲家製作的,使用以下控制台代碼:
$ composer require marciioluucas/phiber要配置Phiber非常簡單,您必須在項目root路徑中創建一個名為phiber_config.json的存檔。
$ root_project_path/phiber_config.json
{
"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
}
}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 ;麻省理工學院
免費軟件,地獄!