??? ??? ??? ??? ???? Laravel? Eloquent ORM? ?? ?????? ?? MVC(Model-View-Controller) ????? ???? ??? ????. ??? ??? ????? ???? ??? ??? SQL ?? ??, ??? ?? ??? ?? ?? ??, ??? ??? ?? ??, ?? ??? API ?? ?? ??? ?????. ??? ???? ?? MVC? ??? ???? Laravel ?? ?????? DataForge? ??? ??? ?????. DataForge? ???, ??? ? ?? ?? ???? ????? ?? ?? ?? ??? ?????.
DataForge? ???
1. ??? SQL ??? ??
Eloquent? ?????? ?? ??? ?????? ??? ?? ?? ??(?: ?? ??? ?? ? ??)? ?? ???? ??? ??? ??? ????. DataForge? ??? ??? SQL ???? ?? ? ??? ???? ?? ?? ??? ????? ??? ? ?? ??? ?? ??? ?????.
?:
$query = new Query('ProductList'); $query->select('list', 'p.id, p.name, p.price, c.name AS category'); $query->select('item', 'p.id, p.name, p.description, p.price, c.name AS category'); $query->select('options', 'p.id, p.name'); $query->select('total', 'COUNT(p.id) AS totalCount'); $query->filterOptional('p.category_id = {category_id}'); $query->filterOptional('p.name LIKE {%keyword%}'); $query->order('{sort}', '{order}');
?? ??? ??? ? ????.
- ?? ??:
$products = Sql('Product:list', ['select' => 'list'])->fetchRowList();
- ????:
$product = Sql('Product:list', ['select' => 'item', 'id' => 123])->fetchRow();
- ? ??:
$count = Sql('Product:list', ['select' => 'total'])->fetchColumn();
2. ?? ??? ??
Eloquent ??? ??? ???? ???? ??? ???? ?? ??? ??? ??? ??? ????. DataForge? Entity ???? ??? ??? ???? ???? ?? ??? ???? ???? ??????.
-
?? ??: ???? ?? ??? ???? ???? ??? ???? ??? ??????.
$product = DataForge::getProduct(123); echo $product->Price;
(??? ????getPrice()
??). -
??? ? ??: ???? ??? ??? ?? ??? ?? ??? ?? ??.
$product = DataForge::getProduct(123); $category = $product->Category;
(?? Category ???? ?? ?????).
?: ?? ??
class Product extends Entity { function init($id) { return \Sql('Product:list', ['id' => $id, 'select' => 'entity'])->fetchRow(); } function getCategory() { return DataForge::getCategory($this->category_id); } }
3. ??? API ?????
DataForge? 7?? ??? API ?????? ???? ??? ?? ??? ?? ????? ?? ??? ?? ??? ?????.
- /api/list: ???? ??? ??? ??
- /api/all: ???? ?? ???(??? ?? ??)
- /api/item: ?? ??? ??.
- /api/field: ?? ? ? ??.
- /api/entity: ?? ?? ? ??? ??? ???? ??? ??
- /api/Task: SQL? Entity ??? ??? ??? ????
- /api/GuestTask: ?? ????? ?? ???? ??? ??? ???.
?: ???? ??? ?? ??: /api/list/Product:list?keyword=test&pageNo=1&limit=10&sort=price&order=asc
?? ??(JSON):
$query = new Query('ProductList'); $query->select('list', 'p.id, p.name, p.price, c.name AS category'); $query->select('item', 'p.id, p.name, p.description, p.price, c.name AS category'); $query->select('options', 'p.id, p.name'); $query->select('total', 'COUNT(p.id) AS totalCount'); $query->filterOptional('p.category_id = {category_id}'); $query->filterOptional('p.name LIKE {%keyword%}'); $query->order('{sort}', '{order}');
? ??? ?? ??? ???? ???? ????? API ??? ??????.
4. SQL ?? ????? ??
?? ???????? ??, ?? ? ?? ??? ???? ???? ? ??? ??? ??? ??? ????. DataForge? SQL ??? ??? ?? ??? ???? ??? ???? ???? ?? ?? ?? ??? ??? ??? ??? ? ????.
DataForge? Laravel ??
DataForge? Laravel ????? ???? ??? ?????.
- ??? ??? SQL ??? ?? ?? ??? ????????.
- ?? ??? ?? ? ?? ??
- ?? ?? ?? ??? ??? ??(??, ?, ?)? ?? ??
- ?? ??? ?????? ???? API ??? ???????.
-
filterOptional
,filterAnyOneRequired
?? ???? ??? ??? ???????.
?? ?? ? ????
DataForge? ????? ?? ??? ??? ????? ???? ?? ??? ???? ??? ?????.
- ??: data-forge.tech
- ????: LinkedIn ???
- ???: GitHub ???
DataForge? ?? ??? ??? ?????? ?? ???? ??? ?????.
????
- ?? SQL ??, API, ??? ??? ??? ???? ????
- Eloquent? ?? ORM? ????? ?? ???? ?????
??? ??? ????? ?? ?????.
? ??? MVC? ???: DataForge? ??? ?? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











ToversionAphp ??, forclarityandeasofrouting, ac

TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

ProceduralAndObject-OrientedProgramming (OOP) InphpDiffersiMINTIFINTIONTERINGLISTURE, ??? ? ? DATAHANDLING

phpdoesnothaveAbuilt-inweakMapButofferSweakReference.1.WeakReenceAllowsholdingReferences withoutpreventinggarbageCollection.2.ItusteForCaching, Eventlisteners, andMetAdataWithoutAftingObjectLifeCycles.3.youcoucococococococcinccing

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.
