ด้านบน ..... 1.4 Dirs ..... 1.3 uml ..... 1.5 dm ..... ide ..... 3. crud ..... sw fw
โมดูล CRUD ตัวอย่างรหัส 7 สคริปต์:
crud ที่ง่ายที่สุด ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
B12PHPFW: พัฒนา บนพีซีที่บ้านบน (ใหม่ล่าสุด) Windows 10 64 บิตพร้อม XAMPP (Apache Web Server, Mariadb) ทดสอบ บน Windows Oracle Virtual Box Oracle Linux Virtual Machine (Apache Web Server) และบนเว็บไซต์สาธิต Linux B12PHPFW เป็น ผลมาจากการเรียนรู้ PHP เป็นเวลา 20 ปีเป็นงานอดิเรก (แต่ฉันไม่มีการติดตั้งการผลิต)
ดูรหัส (สัญญาณ) การไหลและการไหลของข้อมูลหรือที่นี่ - ไม่ทำงานเนื่องจากการ จำกัด เวลา
สารสกัดจาก fwphp-master.zip เพียง ~ 300 kb (B12PHPFW Core นั้นน้อยกว่า 100 kb โดยมีตัวอย่างการเรียนรู้เพิ่มจำนวนมากและรูปภาพ ~ 3 MB):
(Apache or nginx...) WEB SERVER DOCROOT J:\xampp\htdocs\, my is virtual host J:\awww\www\
│
│
│─I.fwphp (app or SITE1 or APLications1) = Main site dir. fwphp is optional name.
│ └── Contains MODULE GROUPS eg APLication1 or glomodul (under which is www =main menu) :
│ glomodul, finance, material, salary
│ └── They contain MODULES eg www or post under glomodul dir
│
│
│─II.index.php redirects to main menu url : /fwphp/glomodul/www/index.php
│
│
│─III.vendor
│ └── b12phpfw dir = internal resources, external sresources are in other vendor subdirs.
│ Here are class Autoload and other for all sites shared - common - global
│ classes Db_allsites and Config_allsites....
│ └── erusev = external resources
│ └── parsedown = external resources
│ └── simplemde
ดาวน์โหลดจาก https://github.com/slavkoss/fwphp
ครั้งแรก "/" ในเส้นทางด้านล่างคือ "j: awww www " = "http: // dev1: 8083/" = OwnWebserver_or_hosting_docroot_path, เช่น แรก "/" ใน "/ผู้ขาย/b12phpfw"
โฟลเดอร์: ผู้ขาย (เป็นสังกะสีตอนนี้สังกะสีไม่มีอยู่อีกแล้วหุ้นอยู่ใน /ผู้ขาย /B12PHPFW )
ในหน้า phpmyadmin:
นำเข้าใน sql j: awww www fwphp glomodul blog_akram 01_phpcms.sql : ขั้นตอนการเรียนรู้ครั้งแรก "1a. msg mysql" ในหน้าเมนูหลัก - การเขียนโปรแกรมขั้นตอนที่เก่ากว่า Namespaces, Globals ที่มีประโยชน์สำหรับไซต์ขนาดใหญ่ - หลายร้อยโมดูล)
Later to learn create big sites - hundreds of modules create database z_blogcms , utf8mb4 :
J:\awww\www\z_DDL_and_other\01_DDL_mysql_blog.sql
or in Oracle DB J:\awww\www\z_DDL_and_other\01_DDL_oracle_blog.sql
j: awww www fwphp glomodul adrs is โมดูล ADRS - ขั้นตอนการเรียนรู้ครั้งที่สองข้างโมดูล MNU ใน J: awww www fwphp glomodul www ADRs ไม่ใช่ตัวอย่างง่ายๆ แต่ไม่เพียงพอที่จะเรียนรู้เมนู B12PHPFW & Skeleton รหัส CRUD! เพียงพอที่จะไม่เรียนการเรียนรู้อย่างง่ายคือโมดูล MNU, MKD และ MSG! ดูเหมือนจะซับซ้อน แต่ไม่ได้
ส่วนใหญ่ (ทั้งหมด?) แหล่งการเรียนรู้ PHP บนอินเทอร์เน็ตและหนังสือ (นิกสัน, พลัง, ดึง, Ullman ... ) ดูเหมือนง่าย แต่อยู่ในความคิดของฉันดีสำหรับ sintax ขั้นพื้นฐานเท่านั้นและนำไปสู่การเข้ารหัสที่ผิดของเมนูและโครงกระดูกรหัส Book CMS Duckett 2022 ปีเป็นสิ่งที่ดีสำหรับการเรียนรู้ PHP แต่ตัวอย่าง CMS นั้นไม่ค่อยดีนัก มันเป็นหนึ่งในความขัดแย้งในชีวิต: "ภาพลวงตา, รูปร่างหน้าตาของรูปร่างหน้าตา"
MNU - โมดูลเมนูในโฟลเดอร์ /fwphp /www
MKD - โมดูลการจัดการเนื้อหา Markdown ในโฟลเดอร์/FWPHP/Glomodul/MKD
MSG - CRUD MSG -Blog Module ใน/FWPHP/glomodul/บล็อก, ... ผู้ใช้, ... post_category, ... โพสต์, ... post_comment (ทั้งหมดใน glomodul dir)
ปัจจุบัน 2023.01.15, B12PHPFW เวอร์ชัน 10.0.0.0 "อะแดปเตอร์ DB โมดูลเดียวกันสำหรับอะแดปเตอร์ DB ที่ใช้ร่วมกัน" 10.0.0.0 หมายถึง:
มกราคม 2023: เฉพาะโมดูล ADRS เท่านั้นที่ทำงานบน MySQL หรือ Oracle (11G) DB (ไม่ใช่ฟังก์ชันทั้งหมด แต่เพียงพอที่จะเห็นทุกสิ่งที่สำคัญอย่างชัดเจน) ไม่ใช่เรื่องยากที่จะอัปเดตโมดูล Addrs ทั้งหมดและโมดูลผงชูรสเป็นเวอร์ชัน 10 แต่ต้องใช้ เวลามากดังนั้นฉันจึงไม่รีบร้อน เพราะฉันคิดว่า ฉันบรรลุ เป้าหมายของเมนูและรหัสโครงกระดูก Crud B12PHPFW เวลามากในประโยคก่อนหน้านี้หมายความว่าเครื่องมือ SW และแอปพลิเคชันผู้ใช้ต้องใช้เวลามากในการจบหากเราเปลี่ยนบางสิ่ง ตัวอย่างที่ดีที่สุดของวิธีการหลีกเลี่ยงสิ่งนี้คือรหัส (ทั่วโลก) เช่น "อะแดปเตอร์ DB โมดูลเดียวกันสำหรับอะแดปเตอร์ DB ที่ใช้ร่วมกัน"
เป้าหมายของเครื่องมือ B12PHPFW PHP SW นั้นขึ้นอยู่กับการทำงานมากกว่ายี่สิบปีกับ Oracle Forms 6i เพื่อสร้างเครื่องมือสำหรับเว็บไซต์ *.php ที่มีตรรกะเช่น Oracle Forms 6i
MNU, addrs ... โฟลเดอร์ (โมดูล) เป็นเหมือน Oracle Forms 6i *.fmb และ . php เป็นเหมือนโปรแกรมภายใน. FMB บางส่วน ฉันเชื่อว่าวิธีนี้ดีกว่าสามโฟลเดอร์ M, V, C สำหรับทุกหน้า ( .FMB) ซึ่งดูเหมือนว่าฉันจะเป็นผู้เขียนเครื่องมือ SW ที่ไม่มีประสบการณ์ในทางปฏิบัติมากพอ ผู้เขียนดังกล่าวได้สร้างความเสียหายอย่างมากในเวลาของเรา (Microsoft, Oracle, Linux Stupid ทั้งหมดและแม้แต่ Windows)
http: // dev1: 8083/fwphp/glomodul/adrs/
แทนที่ http: // dev1: 8083 ด้วยที่อยู่เว็บของคุณเช่น http: // localhost b12 - เปิดโฮมเพจโมดูล ADRS:
หน้าแรก ....... ตัวอย่าง 1 ....... ตัวอย่าง 2 ....... ที่อยู่ - เมนูหลักในโมดูล (หรือไซต์) HDR
หน้าแรก -หน้าชื่อ
-เนื้อหาหน้า:
คุณอยู่ในมุมมอง: j: awww www fwphp glomodul adrs home.php
$ pp1-> module_relpath ด้านล่าง site root = fwphp/glomodul/adrs
$ pp1-> module_url = http: // dev1: 8083/fwphp/glomodul/adrs/
B12PHPFW แตกต่างจากกรอบอื่น ๆ (PHP) (โครงกระดูกเมนูและรหัส CRUD) ความแตกต่างหลัก (ใหญ่):
แต่ละโมดูล (เป็นเหมือน Oracle Forms6i .fmb) อยู่ในโฟลเดอร์ของตัวเองไม่ใช่โมดูลทั้งหมดใน 3 dirs: M, V, C.
ดังนั้น J: awww www fwphp glomodul adrs ... mini3 adrs ... nppses
มีสคริปต์ในโฟลเดอร์โมดูล ADRS เดียวเท่านั้น: ADRS
สคริปต์ทั่วโลกอยู่ใน: j: awww www ผู้ขาย b12phpfw โฟลเดอร์
เนมสเปซนั้นใช้งานได้ไม่ใช่ตำแหน่ง (ไม่ใช่ต้นไม้ DIR ซึ่งไม่จำเป็น แต่ DIR ก็เพียงพอแล้ว!)
เช่นเนมสเปซ B12PHPFW site_home www; หรือ b12phpfw site2_home www (!) หรือ b12phpfw module adrs
1. B12PHPFW MODULE เป็นส่วนหนึ่งของการทำงานของเนมสเปซ - สคริปต์ทำอะไร - เราอาจเขียนที่นี่
2. ADRS เป็นโฟลเดอร์ที่สคริปต์คือ (j: awww www fwphp glomodul adrs home_ctr.php, http: // dev1: 8083/fwphp/glomodul/adrs/))
โลโก้ไซต์ (ถ้าคุณต้องการ): ในพื้นหลัง CSS: URL ('ข้อมูล: รูปภาพ/png; base64, ivborw0kggoaa ... qmcc');
-ส่วนท้ายของโมดูล (หรือไซต์):
นี่คือ MINI3 PHP FW บน B12PHPFW ตาม MINI3 บน GitHub
หน้านี้ตัวอย่าง 1 URL (เว็บที่อยู่ - ชื่อเว็บ) คือ: http: // dev1: 8083/fwphp/glomodul/adrs/? i/ex1/ที่ Ex1 เป็นวิธีการใน Home CLS
วิธีการ EX1 รวมถึงหน้านี้ = ดูที่ erap.system adress คือ: j: awww www fwphp glomodul adrs example_one.php
หน้านี้ตัวอย่าง 2 recives พารามิเตอร์สองพารามิเตอร์ p1 = 'param1' และ p2 = 'param2' หน้านี้รวมอยู่ในวิธีการ Home CLS EX2 หน้านี้ URL คือ: http: // dev1: 8083/fwphp/glomodul/adrs/? i/ex2/p1/param1/p2/param2/
ส่วนสำคัญของ Property Pallette $ pp1 คือ uriq = url (uri) ชิ้นส่วนการสืบค้น: [i] => ex2 โดยที่ Ex2 เป็นวิธีการในบ้าน CLS ที่จะเรียกว่าวิธีการบางวิธีหรือรวมถึงสคริปต์ [p1] => param1 นี่คือพารามิเตอร์วิธี (สคริปต์) 1 [p2] => param2
url รับพารามิเตอร์ p1 = param1 url รับพารามิเตอร์ p2 = param2
คุณอยู่ในมุมมอง: j: awww www fwphp glomodul adrs example_two.php
ลักษณะ DB_ALLSITES ฟังก์ชั่นสาธารณะคงที่ rrcnt เรียกจาก "คลาส tbl_crud" มีปัญหา:
เลิกใช้แล้ว: การเรียกวิธีการคงที่วิธีการ B12PHPFW CORE B12PHPFW DB_ALLSITES :: RRCOUNT เลิกใช้แล้วควรเรียกใช้ในชั้นเรียนโดยใช้ลักษณะ - ผู้เขียน PHP ไม่ได้อธิบายปัญหานี้หรือไม่? ดังนั้นจึงเป็นคลาสสำหรับตอนนี้ (2022-07-03) (กฎเก่าที่ดี: อย่าใช้คุณสมบัติภาษาขั้นสูงเพราะผู้เขียนภาษาไม่ได้ทดสอบการเปลี่ยนแปลงในรายละเอียดเพียงพอ!)
มีมากมายให้เรียนรู้เกี่ยวกับโมดูล ADRS ถ้าดูเหมือนยากลอง Mini3 ก่อน โมดูลผงชูรสเพิ่มฟังก์ชั่น "โมดูลเพิ่มเติม" ซึ่งเป็นการเขียนโปรแกรมชีวิตจริงไม่ใช่เรื่องง่าย แต่จำเป็น
เอาต์พุตจากคลาส AutoLoad หลังจากเราเปลี่ยน IF ('') {... ถึง IF ('1') {... แสดงโฟลว์รหัสหลังจากคลิกที่ปุ่ม "ที่อยู่" หรือลิงค์อื่น ๆ
ดู Clean_architecture.md ภาพระดับรหัสอยู่ที่ไหนจาก https://github.com/nazonohito51/clean-architecture-sample
ลองแก้ไขไฟล์ MD: http: // dev1: 8083/fwphp/glomodul/mkd/? i/showhtml/path/j: awww www clean_architecture.md
ด้านบน ...... Dirs ..... uml ..... dm ..... ide ..... crud ..... sw fw
ดู https://help.github.com/en/github/writing-on-github https://git-scm.com/book/en/v2
หรือเช่น https://git-scm.com/docs/git-checkout
J: symenu programfiles spssuite symenusuite cmder_sps
ไปที่ไดเรกทอรีการทำงานหรือโฟลเดอร์โครงการของคุณ (หากไม่ได้รับสถานะ GIT กล่าวว่า: "ร้ายแรง: ไม่ใช่ที่เก็บ GIT (หรือไดเรกทอรีหลักใด ๆ ): .GIT")
git config -global user.name 'yourname'
git config-global-retplace-user.email 'youremail'
GIT Config-local -l ติดตั้งตัวจัดการข้อมูลรับรอง GIT สำหรับ Windows เพื่อหลีกเลี่ยงการเข้าสู่ระบบในแต่ละพุช-ในส่วนขยาย CMDER GIT (GIT Update-Git-for-Windows)
J: awww www (ต้นแบบ -> Origin)
หรือ git เพิ่ม fwphp (หรืออะไรก็ตามที่ถาม) หรือเพิ่ม git -a หรือ git เพิ่ม index.html
เราเก็บไฟล์โครงการไว้ในฮาร์ดไดรฟ์ระบบของเรา
หาก CMDER แสดงข้อผิดพลาด "Fatal: ไม่สามารถตรวจจับที่อยู่อีเมลได้โดยอัตโนมัติ": ดูการกำหนดค่า GIT ด้านบน ...
git config -global user.email "[email protected]" และ git config -global user.name "ชื่อของคุณ"
เพื่อตั้งค่าข้อมูลประจำตัวเริ่มต้นของบัญชีของคุณ ละเว้น -global เพื่อตั้งค่าตัวตนเฉพาะในที่เก็บนี้
เราเก็บไฟล์โครงการของเราไว้ในไซต์ GitHub ของเรา
คุณต้องการกู้คืนการแก้ไขไฟล์เก่า: GIT Checkout 8A7B201 INDEX.html หากคุณระบุ "หัว" เป็นการแก้ไขคุณจะกู้คืนเวอร์ชันล่าสุดของไฟล์ที่มุ่งมั่นอย่างมีประสิทธิภาพยกเลิกการเปลี่ยนแปลงใด ๆ ที่คุณมีอยู่ในไฟล์นั้น:
Git Checkout Head Index.html
เราสามารถย้อนกลับไฟล์ที่ถูกลบในไดเรกทอรีการทำงานโดยใช้คำสั่ง:
Git Checkout -.
หรือ git checkout - filemame ...
Git Is Program และ GitHub เป็นไซต์ - การปรับใช้ (หนังสือ) การสอน
Git เราใช้เช่นเพื่อ syncronize สคริปต์ของเรา:
เริ่มตั้งแต่วันที่ 13 สิงหาคม 2564 GitHub ไม่ยอมรับรหัสผ่านบัญชีอีกต่อไปเมื่อตรวจสอบการดำเนินการ GIT บน gitHub.com และต้องใช้ การตรวจสอบความถูกต้องตามโทเค็น เช่น ** PAT, โทเค็นการเข้าถึงส่วนบุคคลผ่าน HTTPS = PSW 40 อักขระ (แนะนำ) คุณอาจใช้คีย์ SSH ที่คุณต้องการต่อไป
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
λ git remote -v outputs:
Origin https: // [token]@github.com/slavkoss/fwphp.git (fetch)
Origin https:/[token]@github.com/slavkoss/fwphp.git (push)
ดังนั้นการกระทำครั้งสุดท้ายก็ยังคงอยู่และเป็นครั้งแรกที่กระทำ:
บันทึก. git/config ของคุณก่อนและกู้คืนหลังจาก (ฉันลบมันในถังรีไซเคิล)
PHP IDE ของฉันคือ แพ็คเกจซิป Symenu เป็นตัวเรียกใช้สำหรับ SW ทั้งหมดที่แสดงอยู่ด้านล่าง (พกพาถ้าเป็นไปได้):
ปลั๊กอิน Notepad ++ Markdown
คัดลอก tmarkdownviewerplusplus.dll ไปยังปลั๊กอินย่อยโฟลเดอร์ที่ไดเรกทอรีการติดตั้ง Notepad ++ ของคุณ
ปลั๊กอินเพิ่มไอคอน markdown ขนาดเล็กลงในแถบเครื่องมือเพื่อสลับตัวชมเป็นแผงเทียบท่า
จากนั้นในการตั้งค่า NPP -> นำเข้า -> นำเข้าปลั๊กอิน
ดูใน j: awww www globals ไฟล์ nppsess และไฟล์ nppsess อื่น ๆ
ตัวแปลง MD เป็น HTML บน Inet:
นอกจากนี้ยังดีพกพาทั้งหมดใน Symenu: Notepad2-Mod (2 MB), อะตอม (524 MB),,,
Visual Studio Code (247 MB), Cudatext (28 MB), PSPAD (23 MB), RJ Texted (416 MB),
HTML WYSIWYG Editors: Microsoft Expression Web (ถูกทอดทิ้ง แต่ยังดี)
ฉันหลีกเลี่ยง DreamVeaver, Komposer (ถูกทิ้งร้างเก่าเกินไป)
ผู้บัญชาการ :
เก่า แต่ดีที่สุด (Janne Huttunen) หรือ Simmilar ทุกอย่าง ดู Symenu
Meinplatz (x64) (เป็นส่วนหนึ่งของโปรแกรม Symenu Portable) เช่น Treesize
หรือ Multicommander, Q-DIR, TotalCommander ...
เบราว์เซอร์ :
Google Chrome, Cyberfox, Pale Moon
(ใน symenu) เป็น Win CMD Line มี Git
นักแต่งเพลงช่วยให้คุณประกาศจัดการและติดตั้งการพึ่งพาโครงการ PHP
ไคลเอนต์ FTP WinSCP ไม่สนใจ: | *.zip; J: awww www.git; J: awww www ผู้ขาย/b12phpfw/dbconn_allsites.php;
ชุมชน Serva ของ FTP Server Symenu
คู่มือ PHP
คู่มือสไตล์ PHP
การสอน PHP โดย W3Schools
Guzzle เป็นไคลเอนต์ PHP HTTP ที่ทำให้ง่ายต่อการส่งคำขอ HTTP และเล็กน้อยเพื่อรวมเข้ากับบริการเว็บ
DesignPatternSPHP เป็นคอลเลกชันของรูปแบบการออกแบบที่รู้จักและรหัสตัวอย่างบางส่วนวิธีการใช้งานใน PHP 7.4 ทุกรูปแบบมีรายการตัวอย่างเล็ก ๆ
Grav Portable Flat-File CMS พร้อมระบบการจัดการแพ็คเกจที่ทรงพลังของปลั๊กอินและธีมและ GRAV เอง
คู่มือ PHP
_.-'''''-._
.' _ _ '.
/ (o) (o)
| |
| / |
'. .' /
'. ''---'' .'
'-._____.-'
แสดงโครงสร้างคลาส - คุณลักษณะและวิธีการ
ด้านบน ...... Dirs ..... uml ..... dm ..... ide ..... crud ..... sw fw
<?php
// J:awwwwwwvendor/b12phpfwDbconn_allsites.php
// Is required in trait Db_allsites
//$conn_params =
return [
null
, ' mysql '
, ' localhost '
, ' z_blogcms '
, ' root '
, ''
] ; รหัสหลัก B12PHPFW
ระดับ: ไซต์ทั้งหมด (รหัสเดียวกันสำหรับทุกไซต์ EE ที่แชร์, ทั่วโลก, ทั่วไป)
( โมเดล นามธรรม)
คลาส DBCONN_ALLSITES ลักษณะคล้ายกับชั้นเรียน เหตุผลสำหรับลักษณะเป็นโครงสร้างรหัสสุทธิ:
บางชั้นเรียนอาจใช้คุณลักษณะมากขึ้น - NET - ผู้ปกครองมากขึ้น แต่อาจขยายชั้นเรียนเพียงชั้นเดียว - ลำดับชั้น
ฉันไม่ได้ใช้ลักษณะ - มีข้อผิดพลาดบางอย่างเป็นรหัสขั้นสูงบ่อยครั้ง
// see class script // see class script
โดยทั่วไป db_allsites.php อ่าน (RR, รายงาน) ทำงานเหมือนรหัสใน:
/awww/www/clean_architecture.md ฉันทำในเวอร์ชัน 10 มกราคม 2023
รหัสหลัก B12PHPFW
ระดับ: ไซต์ทั้งหมด (รหัสเดียวกันสำหรับทุกไซต์ที่ใช้ร่วมกันทั่วโลก)
// see class script // see class script เพื่อหลีกเลี่ยงคำสั่ง inc. ในหลายสคริปต์
รหัสหลัก B12PHPFW
ระดับ: ไซต์ทั้งหมด (รหัสเดียวกันสำหรับทุกไซต์ EE ที่แชร์, ทั่วโลก, ทั่วไป)
// see class script // see script รหัสโมดูล B12PHPFW
ระดับ: โมดูล (รหัสเดียวกันสำหรับโมดูล EE โฟลเดอร์เช่น MNU หรือ MKD หรือ MSG = บล็อก)
สำหรับการดำเนินการโปรแกรมลำดับชั้นของคลาสคือ: ราวกับว่าแอตทริบิวต์และวิธีการทั้งหมดในชั้นเรียนด้านบน home_ctr อยู่ในคลาส home_ctr นั่นคือพวกเขาอยู่ใน $ วัตถุนี้ ซึ่งเป็นอินสแตนซ์ (สร้างในหน่วยความจำ) ใน home_ctr (ซึ่งดูเหมือนว่าจะมีคลาสทั้งหมด - คำอธิบายของแอตทริบิวต์และวิธีการข้างต้น)
เหตุใดคุณลักษณะและวิธีการที่ใช้ร่วมกัน (ทั่วไป) ในลำดับชั้นด้านบน home_ctr และไม่ได้อยู่ใน home_ctr?
เราไม่ต้องการเขียนสคริปต์ home_ctr ทุกตัวรหัสที่ใช้ร่วมกันทั้งหมด (ทั่วไป) ด้านบน home_ctr
ด้านบน ..... dirs ..... uml ..... DM ..... ide ..... crud ..... sw fw
ดู รหัสข้อมูล:
http://phporacle.eu5.net/fwphp/glomodul/z_examples/03_info_php_apache_config_scripts.php
https://github.com/slavkoss/fwphp/blob/master/fwphp/glomodul/z_examples/03_info_php_apache_config_scripts.php
B12PHPFW แตกต่างกันมากกว่า (ทั้งหมด?) เฟรมเวิร์กอื่น ๆ (ฉันชอบ "เมนูและรหัสโครงร่าง crud") เพราะ::
dirs เป็นแบบฟอร์ม Oracle Forms โมดูล. fmb https://github.com/ngrt/mvc_todo - การเข้ารหัสที่ดีมาก (แต่เป็นตัวอย่างง่ายๆไม่มี globals ไม่มี namespaces ... ) แสดงเฟรม php frameworks และความคิดการกำหนดเส้นทางอื่น ๆ : ... mvc_fw dir หรือค้นหา Google: GitHub PHP Framework
และเหตุผลอื่น ๆ ที่กล่าวถึงด้านล่าง
ดู Mini3 PHP Framework https://github.com/panique/mini3 ซึ่งเป็นตัวอย่างที่หายากที่ยอดเยี่ยมไม่ใช่ตัวอย่าง MVC ง่าย ๆ (การเข้ารหัสที่ดีจำนวนมาก) การกำหนดเส้นทางของฉันโดยใช้ค่าคีย์นั้น แตกต่างกัน แต่ การจัดส่งโดยใช้วิธีการคลาสโฮมจะขึ้นอยู่กับ MINI3
B12PHPFW มี 3 โมดูลและสาธารณูปโภคบางอย่าง:
ด้านบน ...... Dirs ..... uml ..... dm ..... ide ..... crud ..... sw fw
ดูการใช้ mkd fwphp/glomodul/mkd/02/01_fwphp/php_dip_di.txt
ด้านบน ...... Dirs ..... uml ..... dm ..... ide ..... crud ..... sw fw
อาจเป็น jQuery, php, bootstrap ajax db ตารางตาราง crud เป็น crud ที่ง่ายที่สุดเร็วที่สุด แต่ฉันไม่ชอบ jQuery ไม่มี Ajax เฉพาะ JavaScript ที่ฉันต้องการคือกล่องโต้ตอบใช่หรือไม่
Crud Rows in Table Song (#ID, ศิลปิน, แทร็ก, ลิงค์) Mini3 Framework https://github.com/panique/mini3 คือฉันคิดว่าดีที่สุดที่จะเรียนรู้ PHP และกรอบโครงร่างโครงกระดูก โมดูล ADRS ของฉันใน Glomodul Modules-Group คือ MINI3 บน B12PHPFW ทำไม ? ฉันคิดว่า สำหรับไซต์ขนาดใหญ่ Mini3 นั้นเรียบง่าย - ไม่มีหุ้น ...
ดูสคริปต์
crud ที่ง่ายที่สุด ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
เราต้องการจุดเริ่มต้นเดียวในโมดูลเพื่อหลีกเลี่ยงความยุ่งเหยิงกับลิงก์ (https: // ... ลิงก์ไม่ชัดเจนดีกว่าและมีการโทรวิธี)
<?php
/**
* J:awwwwwwfwphpglomoduladrsindex.php
*/
. . .
/**
* J:awwwwwwfwphpglomoduladrsindex.php
* DISPATCHING is calling method according URL parts (extracted with ROUTING code).
* Because MODULE METHODS PARAMS ARE MOSTLY GLOBAL (same for all modules), eg paths,
* to avoid lot of same code in modules (code redundancy) :
* 1. WE ASSIGN GLOBALS IN PARENT CONF&UTL CLS METHOD
* (not knowing which module is going to use them)
* 2. THEN, FROM PARENT CLS WE CALL METHOD IN CHILD MODULE CLS.
* Module method knows how to use globals
* and what module needs for parameters beside globals.
*/
/**
* ns (NAMESPACES) we use in clses script autoloading.
* vendor_namesp_prefix processing (behavior) clsdir [ cls] [as clsalias]
* eg B12phpfw is vendor_namesp_prefix ; //FUNCTIONAL, NOT POSITIONAL
* FUNCTIONAL parts are not requirad, we use them to better understand script purpose.
*eg clsdir - only this part of namespace is POSITIONAL, CAREFULLY !
*/
/**
* **HELPNS
* first namespace part B12phpfw is NOT REQUIRED : vendor's name NS's prefix (FUNCTIONAL NSPART)
* 2nd ns part m o d u l e is NOT REQUIRED : FUNCTIONAL NSPART = processing (behavior)
*
* FNSPs (FUNCTIONAL NS PARTS) are ignored by fw, ee we name them as we wish.
* We use FNSPs as description to depict WHAT CODE DOES (processing, behavior).
* May be more functional ns parts as we wish - all are ignored !
*
* PNSP (POSITIONAL NS Part) CAREFULLY! : LAST NS part (BEFORE CLSNAME IF ANY) eg "blog" is DIRNAME.
* PNSP is actually (de facto, in fact, indeedded) DIRNAME and module name.
* Path OF DIRNAME (of PNSP) is in $pp1 array,
* used for Autoload class to include classes from dir DIRNAME.
* Autoload class is include, global, common, reusable.
*/ index.php ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
. . .
* ------------------------------------------------------------------------------
* ROUTING TBL - module links, ( IS OK FOR MODULES IN OWN DIR ) key-keyvalue pairs :
* LINK ALIAS IN VIEW SCRIPT (eg l d d) => HOME METHOD TO CALL (eg del_ row_do)
* ------------------------------------------------------------------------------
* 1. ALL MODULE VIEWS LINKS SHOULD BE IN $ pp1_ module, SHAPED SO :
* 2. $ pp1 -> urlqrystringpart1_name => i/M E T H O D NAME /param1name/ param1value. . . 2 , 3. . .
* (urlqrystring LAST PART IS IN VIEW SCRIPT WHICH KNOWS IT , eg idvalue !)
* 3. IF LINK key-keyvalue pair IS NOT HERE THEN EG :
* in URLurlqrystring : QS . ' i/home/ ' home must be M E T H O D NAME in this script.
* Eg http: //dev1:8083/fwphp/glomodul/adrs/?i/ex1/ or
* http: //dev1:8083/fwphp/glomodul/adrs/?i/home/ or
* http: //dev1:8083/fwphp/glomodul/adrs/
*/
/** *****************************************
* CALL DISPATCH M E T H O D S
* they 1.call other fns or 2.include script or 3.URL call script
* CALLED FROM abstract class Config_ allsites, m ethod __c onstruct
* so: $pp1->call_module_m ethod($akc, $pp1) ;
* $ a k c is m o d u l e m ethod (in MM Home_ ctr, not global fn !!
* because MM Home_ ctr knows akc parameters)
* ******************************************
*/index.php ..... index.php ..... home_ctr ..... ** หน้าแรก (หน้าตาราง ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
<!-- J:awwwwwwfwphpglomoduladrshome.php -->
< div class =" container " >
< h1 > Homepage </ h1 >
< p > You are in View: < ?=__FILE__? > </ p >
< p > $pp1- > module_relpath below site root = < ?=$pp1- > module_relpath? > </ p >
< p > $pp1- > module_url= < ?=$pp1- > module_url? > </ p >
< p > Namespaces are FUNCTIONAL, not POSITIONAL (not dir tree). </ p >
< p > Each module (is like Oracle Forms .fmb) is in own folder, not all modules in 3 dirs: M, V, C. </ p >
< p > In CSS background: url('data:image/png;base64,iVBORw0KGgoAA...QmCC'); </ p >
</ div >
<!-- J:awwwwwwfwphpglomoduladrsexample_one.php -->
< div class =" container " >
This page EXAMPLE1 URL (web adress - web name) is :
< h3 > < ?=$pp1- > module_url? > ?i/ex1/ </ h3 >
where ex1 is method in Home cls.
< p >
ex1 method I N C L U D E S this page = view whose oper.system adress is : < ?=__FILE__? > .
</ p >
< p > </ p >
</ div >
<!-- J:awwwwwwfwphpglomoduladrsexample_two.php -->
< div class =" container " >
This page EXAMPLE2 RECIVES TWO PARAMETERS p1='param1' and p2='param2'. < br >
This page is i n c l u d e d with Home cls ex2 method. < br >
This page URL is :
< h3 > < ?=$pp1- > module_url? > ?i/ex2/p1/param1/p2/param2/ </ h3 >
< p > Important part of Property pallette $pp1 is < b > uriq = URL (URI) query parts </ b > : </ p >
[i] = > ex2 where ex2 is method in Home cls to be called which calls some method or includes some script < br >
[p1] = > param1 This is method (script) parameter 1 < br >
[p2] = > param2 This is method (script) parameter 2
</ p >
< p > url GET parameter p1= < ?=$param1? > < br >
url GET parameter p2= < ?=$param2? > </ p >
< p > You are in View: < ?=__FILE__? > </ p >
</ div >index.php ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
<?php
// J:awwwwwwfwphpglomoduladrscre_row_frm.php
. . .index.php ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม ..... อัปเดต .... อะแดปเตอร์
<?php
//J:awwwwwwfwphpglomoduladrsread_tbl.phpindex.php ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... อะแดปเตอร์
<?php
// J:awwwwwwfwphpglomoduladrsupd_row_frm.phpsimplestcrud index.php ..... index.php ..... home_ctr ..... หน้าแรก (หน้าตาราง) ..... สร้าง ..... อ่าน (โปรไฟล์ผู้ใช้ - แบบฟอร์ม) ..... อัปเดต .... [อะแดปเตอร์]
<?php
/**
* J:awwwwwwfwphpglomoduladrsTbl_crud.php
* DB (PERSISTENT STORAGE) ADAPTER C L A S S - PDO DBI
* (PRE) CRUD class - DAO (Data Access Object) or data mapper
* This c l a s s is for one module - does know module's CRUD
* Other such scripts should be (may be not ?) for csv persistent storage, web services...
*
* DM=domain model aproach not M,V,C classes but functional classes (domains,pages,dirs)
* MVC is code separation not functionality !
*/
/**
* (PRE) CRUD class - DAO (Data Access Object) or data mapper
*/
} // e n d c l s T b l_ c r u d
ไม่ใช่เรื่องง่ายที่จะเห็นว่าจำเป็นต้องมีเช่นสำหรับโมดูลผู้ใช้แปลงรหัสจากขั้นตอน MVC ถึง OOP MVC ด้วยเนมสเปซและการโหลดอัตโนมัติสำหรับการนำทาง (URL -S, รหัสลิงก์) เหมือนกัน - OOP ไม่ได้ช่วยอะไร ขั้นตอน MVC เช่นรหัสโมดูลผู้ใช้สามารถชัดเจนและอ่านได้มากขึ้น แล้วทำไม OOP ถึงดีกว่า?
บางคนพูดว่า: "OOP ผิดพลาดหรือไม่" - เช่น การขาดการใช้ซ้ำใน OOP - เพื่อรับกล้วย (บางวิธีหรือคุณลักษณะ) คุณจะได้รับกอริลลาถือกล้วยและป่ากอริลลาทั้งหมด ( คลาสที่สูงกว่าทั้งหมดที่มีการพึ่งพาที่ซับซ้อน )
EG อินเตอร์เฟสช่วยให้ได้กล้วยเท่านั้น แต่การเข้ารหัสมีความซับซ้อน-ฉันสามารถหาตัวอย่างโค้ดที่ทำงานได้อย่างแรงกล้าเกี่ยวกับเรื่องนี้เท่านั้น
J: awww www ผู้ขาย b12phpfw db_allsites_intf.php (17 ฮิต) บรรทัดที่ 15: ฟังก์ชั่นสาธารณะคงที่ get_or_new_dball (สตริง $ เรียกว่า _from = ' ผู้โทรที่ไม่รู้จัก '); บรรทัดที่ 16: ฟังก์ชั่นสาธารณะแบบคงที่ sclowbconn (); บรรทัดที่ 17: ฟังก์ชั่นสาธารณะคงที่ getdbi (); บรรทัดที่ 18: ฟังก์ชั่นสาธารณะคงที่ setdo_pgntion ($ new_val); บรรทัด 22: // 11111 ******************** ฟังก์ชั่น: บรรทัด 24: ฟังก์ชั่นสาธารณะคง ที่ get_cursor (// วัตถุ $ pp1 // เหมือนเคอร์เซอร์ Oracle // แทน RR Line 27: ฟังก์ชั่นสาธารณะคงที่ rrnext (Object $ Cursor, Array $ อื่น ๆ = [] ฟังก์ชั่นสาธารณะคงที่ rr_last_id (สตริง $ tbl, อาร์เรย์ $ อื่น ๆ = []): int; ; // สร้างแถว TBL
บรรทัดที่ 45: // ฟังก์ชั่นสาธารณะแบบคงที่ pre_cc_uu (บรรทัด 56: ฟังก์ชั่นสาธารณะคง ที่ uu ($ tbl, $ flds, $ ที่ไหน, $ binds = []); บรรทัด 62: // 33333 ********************************************* $ ph_val_arr): สตริง;
เช่นโมดูลใบแจ้งหนี้ทำงานกับสองตาราง: ใบแจ้งหนี้และใบแจ้งหนี้ _items (หรือสามตาราง: บิล, ใบแจ้งหนี้, ใบแจ้งหนี้, ใบแจ้งหนี้ _items) Simmilar "โซลูชันที่ง่ายที่สุด" สาม dirs m, v, c ไม่ดี - :) - 3dirs lovers ใส่ technik การเข้ารหัส (M, V, การแยกรหัส C) ในหน้าเว็บแทน (ฟังก์ชั่น, ตรรกะทางธุรกิจ)
RR Banana ไม่ได้อยู่ในป่าอีกต่อไป Gorilla และ Jungle เป็นเพียงหนึ่งคลาสนามธรรม config_allsites ซึ่งเป็นคุณสมบัติ $ pp1 = คุณสมบัติ
Banana $ pp1 = Properties Palette อาจทำให้เกิดความยากลำบากในการรวม (สารประกอบ, ประกอบด้วย multiplex) เช่นบล็อก, ใบแจ้งหนี้ ... แต่ $ pp1 นั้นหลีกเลี่ยงไม่ได้ ฉันทำงาน 20 ปีใน $ pp1 และ Globals Jungle (Oracle Forms 6i) ไม่ค่อยดีเท่าที่นี่
ดู https://phpthewrongway.com/ หรือ Joe Armstrong ทำไม OOP จึงดูด http://harmful.cat-v.org/software/oo_programming/why_oo_sucks
B12PHPFW ขึ้นอยู่กับความคิดในบทเรียนหลายอย่างเช่นไม่กี่คนถัดไปเป็นหนึ่งในสิ่งที่ดีที่สุด (แต่ยังรวมถึงแนวคิดบางอย่างในกรอบ PHP ที่ดีที่สุด Laravel, Simfony, Yii, Phalcon ... )
ฉันใช้รหัส B12PHPFW ที่ง่ายกว่ามากตามแนวคิดในบล็อก Jazeb Akram CMS - การออกแบบหน้า และ MINI3 PHP FW - Skeleton รหัส การกำหนดเส้นทาง หนังสือเกี่ยวกับตัวอย่างรหัส PHP ไม่ค่อยดีนัก
วิดีโอบล็อก CMS (7.7 GB) Jazeb Akram: Udemy - หลักสูตร PHP MySQL Professional ที่สมบูรณ์พร้อม 5 โครงการ - หายากไม่ใช่การสอนง่ายๆ ที่คล้ายกันคือวิดีโอ (12.3 GB) EDWIN_DIAZ_PHP สำหรับผู้เริ่มต้น - กลายเป็นโครงการ PHP Master - CMS นอกจากนี้วิดีโออื่น ๆ - ดูเหมือนว่าพวกเขาจะ ออกแบบหน้าเว็บที่ดีที่สุด/ง่ายที่สุด (ไม่ใช่โครงกระดูกโค้ด) สำหรับ CMS บล็อกโพสต์ข้อความ วิดีโอมีขนาดใหญ่มากสำหรับเหตุผลเชิงพาณิชย์ที่จะเข้าถึง num_of_gb ee $/gb ที่สูงขึ้น แต่ไม่มีรหัสที่ดีที่สุด - มีรูปแบบการเขียนโปรแกรมที่เก่ากว่า
MINI3 (MINI3 PHP FW https://github.com/panique/mini3 - หายากไม่ง่าย ๆ โมดูลตารางเดียว แต่อาจมีฟังก์ชั่นมากขึ้น
/glomodul/z_examples/mvc_fw/hcstudio_easy/สาธารณะ/ตัวอย่าง FW ง่าย ๆ แต่รหัสที่ดีสำหรับการเรียนรู้ PHP (อ่านเฉพาะ CRUD) มิดเดิลแวร์ อธิบาย ในการกำหนดเส้นทางที่ซับซ้อนและมิดเดิลแวร์ดังนั้นจึงไม่ใช่เรื่องง่าย!
https://github.com/ngrt/mvc_todo รหัสอธิบายไว้ในบทความนี้บล็อก 2017.12.17: https://medium.com/@noufel.gouirhate/create-your-own-mvc-framework-in-php-af7bd1f0ca1f0ca
https://dev.to/jorgecc/a-minimalist-mvc-project-using-php-and-without-a-framework-4pd8
https://github.com/trpb/immutableMvc
อื่น :
ฉันทำการเปลี่ยนแปลงมากมาย (ฉันหวังว่าการปรับปรุง) ซึ่งฉันทำเพราะฉันไม่ชอบวิธีแก้ปัญหาที่เสนอในกรอบ PHP ที่ดีที่สุดและในแหล่งเรียนรู้ที่กล่าวถึงข้างต้น หุ้น (reusables, globals รวม) ไม่ได้อธิบายอย่างดีและเขียนรหัสที่นั่น
ฉันคิดว่าควรเป็นเรื่องง่าย/รวดเร็ว/เป็นมืออาชีพ: การแชร์ การกำหนดเส้นทางการจัดการ, การทำงานเนมสเปซและการโหลดคลาส, การแก้ไขข้อความที่หลากหลายเว็บ ...
นี่คือเหตุผลที่ฉันใช้เวลาหลายชั่วโมงในเรื่องนี้
Skeleton รหัสนี้ซับซ้อนเมื่อเทียบกับ https://github.com/panique/***mini3*** ซึ่งอาจเป็นเทมเพลตรหัส FW ที่ดีที่สุดสำหรับโครงการขนาดเล็ก (และการเรียนรู้ PHP)
สำหรับ การแบ่งปันโครงการขนาดใหญ่ - Globals - reusple ที่ฉันใช้ที่นี่มีความสำคัญมากเช่นเดียวกับ โมดูลในโฟลเดอร์ของตัวเอง (ไม่ใช่ทั้งหมดใน 3 dirs m, v, c)
เกี่ยวกับหุ้น (globals) ดูการสนทนา:
https://medium.com/@sameernyaupane/php-software-architecture-part-1-mvc-1c7bf042a695
https: //medium.co## 3.2m/@sameernyaupane/php-software-architecture-part-2-the-alternatives-1bd54e7f7b6d
https://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html
ในช่วงฤดูหนาว 2019/2020 ปี (จนถึงช้ามากเพราะฉันทดสอบสิ่งที่คนอื่นทำ) ฉันทำรุ่น 6 ของ เมนูและโครงกระดูก CRUD PHP (กรอบการทำงานของตัวเองชื่อ "B12PHPFW") - รหัสหลักคือ ~ 50 kb เวอร์ชัน 7: PHP 7 และ Trait DBI อยู่ในเดือนตุลาคม 2563
ทำไม ? ฉันไม่ชอบวิธีแก้ปัญหาที่เสนอในกรอบ PHP ที่ดีที่สุด (Laravel, Simfony, Yii ... ) และแหล่งเรียนรู้ (อินเทอร์เน็ต, หนังสือ) ฉันคิดว่ารหัสโมดูลโมดูล PHP ควรอยู่ในโฟลเดอร์ของตัวเองเช่น Oracle Forms Form.fmb (ไม่ใช่ทุกรูปแบบ/รายงานใน 3 โฟลเดอร์: M, V, C) ฉันคิดว่าควรจะง่าย/รวดเร็ว/เป็นมืออาชีพ: globals , การกำหนดเส้นทาง, dispaching, classes loading, การแก้ไขข้อความที่อุดมไปด้วยเว็บ - นี่คือเหตุผลที่ฉันเสียเวลาหลายชั่วโมงในการเขียนโค้ด B12PHPFW ของฉัน
ทำไมฉันไม่ชอบวิธีแก้ปัญหาที่เสนอและสิ่งที่ฉันทำเพื่อ (หวังว่า) ปรับปรุงพวกเขา คุณสมบัติสีแดงเป็นเหตุผลหลักสำหรับ B12PHPFW แต่ฉันปรับปรุงคุณสมบัติอื่น ๆ -
TraversyMVC (has video) and Mini3 are simplified, with some (many?) differences compared to Laravel, Simfony, Yii, Falcon... B12phpfw is much more different - see red colored features. PHP framework authors do not show such fitures table, for me it is hiding fitures (sell cat in bag).
| คุณสมบัติ | B12phpfw | Mini3 MVC PHP fw and TraversyMVC |
|---|---|---|
| 1. Modules in own folder like Oracle Forms .fmb | has - it is one of main reasons for B12phpfw ! | has not all forms/reports in 3 dirs: M,V,C |
| 2. Name spaced classes (functional name spacing) | มี | Mini3 which is in my opinion better than TraversyMVC : https://github.com/panique/mini3 has name spaced classes. TraversyMVC blog has not |
| 3. Number of folders (my opinion) | เหมาะสมที่สุด | to many |
| 4. Minimal PHP code to learn (medium) PHP (my opinion) | optimal (but we could add additional code) | good but not enough eg see WYSIWYG, globals... |
| 5. Functional methods, attr. etc naming (my opinion) | ดี | could be better |
| 6. Global classes, methods etc (my opinion) | good see below CRUD test output | แย่ |
| 7. (Posts edited with any) WYSIWYG editor | มี | has not |
| 8. Home_ctr or Home_mdl CRUD layer methods do not know for underlaying Db_allsites layer PDO methods, MySql, Oracle... | has much improved | has not |
| 9. OOP | มี | has like Mini3 |
| 10. namespaces (own PSR-4 (or Composer's) autoloading classes scripts) | improved | Mini3 has, TraversyMVC blog has not |
| 11. All scripts are included (ee no http jumps except some jumps in other module) | มี | Mini3 has, B12phpfw took it from Mini3, TraversyMVC blog has not |
| 12. jQuery only for Bootstrap 5 | ใช่ | Mini3 has own CSS, TraversyMVC blog has |
| 13. AJAX, JSON | has not | Mini3 has basic jQuery AJAX explained, TraversyMVC blog has |
| 14. server side validation | มี | มี |
| 15. authentification (log in / out) | มี | has not, TraversyMVC blog has |
| 16. authorization (only logged in users may execute some code ee CRUD code...) | มี | Mini3 has not, TraversyMVC blog has |
| 17. Own debugging very simple and useful : msg in pre tag or popup JS msg). xdebug also helps. | มี | has not |
| 18. PHP code here is good for (more) large sites | ใช่ | เลขที่ |
| 19. multilanguage pages | has, see https://github.com/slavkoss/fwphp/tree/master/fwphp/glomodul/z_examples/multilang/ | has not |
| 20. DM (Domain model) | has, simplest possible, no complicated namespaces, interfaces, adapters, data mappers... see https://github.com/slavkoss/fwphp/tree/master/fwphp/glomodul/z_examples/02_MVC/03xuding_glob | has not |
(Apache or nginx...) WEB SERVER DOCROOT J:\xampp\htdocs\, my is virtual host J:\awww\www\
│
│
│─I.fwphp (app or SITE1 or APLications1) = Main site dir. fwphp is optional name.
│ └── Contains MODULE GROUPS eg APLication1 or glomodul (under which is www =main menu) :
│ glomodul, finance, material, salary
│ └── They contain MODULES eg www or post under glomodul dir
│
│
│─II.index.php redirects to main menu url : /fwphp/glomodul/www/index.php
│
│
│─III.vendor
│ └── b12phpfw dir = internal resources, external sresources are in other vendor subdirs.
│ Here are class Autoload and other for all sites shared - common - global
│ classes Db_allsites and Config_allsites....
│ └── erusev = external resources
│ └── parsedown = external resources
│ └── simplemde
One of (Apache) WEB SERVER DOCROOT-s, my is J:\awww\www\
|
|
|-- **I. fwphp** (app) # **or SITE1, or APLications1** = Main MVC site dirs structure,
| | # my J:awwwwwwfwphp = Apache_docrootfwphp
| | # Contains **MODULE GROUPS** eg APLication1 or **www** (main menu), **glomodul**,
| | # **finance**, **material**. fwphp is optional name. Namespace is only one: B12phpfw.
| |-- ~~Controllers~~ # **NO M,V,C dirs but dirs are like Oracle FORMS form module.fmb !**
| └── ~~example.php~~ # NO Example Controller
| |
| |
| |-- ~~Models~~ # **NO M,V,C dirs** ee NO Models directory
| └── ~~example.php~~ # Example Model with functionality explanation
| |
| |
| |--~~Views~~ # **NO M,V,C dirs** ee NO Views directory, no template engines (PHP is template language)
|
|
| |-- ~~app.php~~ # **NO** Main fw file. nice abstraction (questionable value in real life programming) :
| | # **$app = new App(); $app->autoload(); $app->config(); $app->start();**
| | # Where is UML diagram for this beauty ?
| | # I think much better is **new Home_ctr($pp1) ** // Home_ ctr "inherits" index.php
| | # ee "inherits" $pp1, (global & module prroperties palette array),
| | # but also inherits see B12phpfw core UML diagram below. .
| |
| |-- ~~classes~~ # **NO** classes directory for autoloading.
| | | # B12phpfw global classes are in vendor/b12phpfw dir, module clses are in module dir.
| | └──-- ~~controller.php~~ # **NO** but **in module dir global abstract DISPATCHER (RESPONSE) class**
| | | # **Home_ctr ** extends Config_allsites
| | |--~~model.php~~ # **NO, no model class for each table** but **in vendor/b12phpfw** dir
| | # global abstract CRUD class **Db_allsites ** includes Dbconn_allsites
| | # In Db_allsites are **cc, rr, uu, dd methods** instead model class for each table !
| | # cc, rr, uu, dd methods are like Oracle Forms
| | # pre-insert, pre- and execute- query, pre-update instead model class for each table !
| | # To me seems not needed : model class for each table and ORM-s, active records
| |
| |-- ~~config~~ # **NO** config dir but in vendor/B12phpfw dir
| | | # **Config_allsites** extends Db_allsites (see core UML diagram).
| | | # Here is property palette array.
| | |-- ~~database.php~~ # = in vendor/b12phpfw **Dbconn_allsites.php**
| | |-- ~~session.php~~
| |
| |-- ~~helpers~~ # **NO** helpers dir, but classes Db_allsites and Config_allsites.
| |-- ~~examplhelper.php~~ # **NO** but own debugging (and Xdebug php extension - I do not use it any more).
|
|
|-- **II. index.php** # redirects to main menu url fwphp/www/index.php
|
|
| |-- **III. vendor **
| |--**B12phpfw** # B12phpfw has own (internal) resources here, external in other vendor subdirs.
| # Here are **class Autoload and other for all sites shared - common - global**
| # **classes** Db_allsites and Config_allsites....
|
|-- .htaccess # **NO** .htaccess (Apache mod_rewrite) URL rewriting all requests to MVC endpoint
# index.php (single module entry point). B12phpfw has **QS=?** constant instead.
Common fw dir structure are items in marked with NO - are not used in B12phpfw but basics are same. B12phpfw is better for large sites.
Top......Dirs.....UML.....DM.....IDE.....CRUD..... SW fw
For me SW fw is a few tens (hundreds) of code snippets for ctrl+c,v (global code snippets don't even need ctrl+c,v, so they are highly desirable).
See "What is SW fw (Software framework)" (using mkd in fwphp/glomodul/mkd/02/01_fwphp/ PHP_DIP_DI.txt/ ) which states :
Code flow terms : DI is about code flow tie - wiring , IoC is about code flow direction , and DIP is about code flow shape .
To be sure, use DI or IoC with DIP.
B12phpfw means: B=table rows blocks for CRUD like in Oracle Forms eg invoice.fmb master (B1) and detail rows (B2).
12 = steps of code flow must be clear, good explained. cs01 means code flow step 1.
phpfw = PHP framework = code skeleton for menus & CRUD (and many other functionalities,
I never understood enough fw authors explanations which is one of reasons why I do not believe them).
Code is small and simple but needs :
few hours (advanced user) - days (intermediate) - weeks/months (beginner) to understand it.
Understand code is must for any good code skeleton !
Clean code : "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Martin Fowler).
When you are dead, you don't know that you are dead. It is difficult only for the others. It is the same when you are lazy (or stupid).
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." (John Woods). adapter "Clean code reads like well-written prose" (Grady Booch). Good code reads close to natural speech.
Naming is the best tool we have to express what we do in code (avoid comments). Classes and variables are nouns: Price, CurrentTrade. Booleans are predicates: isScheduled, isRunning. Methods should start with a verb: getStrategyResult, createStrategyResult. Common naming errors : Very small names ( $tr, dd() ), Names that are not real words ($dgrtty), Methods that are nouns.
Notable package does something special, is also frequently innovative.
I developed B12phpfw in my free time (my work for last 20 years was : Oracle Forms & Reports 6i and Crystal reports. We wanted migrate them to PHP - never happend
because I cound not find near so good tool as abandoned Oracle Forms 6i - shame. See also below "...compared to all PHP frameworks...".
B12phpfw is good for developing large sites (more of them under web server root dir. path).
Innovative is :
Compared to all PHP frameworks and learning sources :
Based on best PHP learning code I could find. See [web server root dir. path]fwphp/glomodul/z_examples, where :
Conclusion : B12phpfw is most useful for CRUD in msg-blog and simmilar modules, so it is precisely B12phpCRUDfw . For mnu and mkd markdown WYSIWYG editor and simmilar modules we do not nead B12phpfw code skeleton, but I did it.
Includes and method calls instead URL jumps (http// jump to pages) - this is interesting question. http// jump to pages in B12phpfw is used only to jump somethimes in other module.
It is a shame that Oracle does not support the latest client-server SW Forms6i (replacement for the infamous Power objects) and Reports6i, but only the WEB version, which has repeatedly changed some basic functionalities (incompatibilities as with Microsoft tools) and which, for smaller companies, has too many flaws . Why does the WEB version of F6i, R6i not generate something like razor code or PHP code that do not need several servers and have no problem with large Java libraries, with starting... (The simplest Blazor form (#ID, name) is ~ 6 MB, PHP form 6 kB !)
Mr. Ferrante says "strongly discourage" which means "with the lure of Power objects, F6i, R6i..." we have hooked you on expensive and for smaller businesses inappropriate SW.
Is this the reason why very few developers start new projects with Oracle Forms, the transition from Oracle to Java, APEX (declarative programming with attributes - can clicking be done seriously!?) . These are harmful wanderings similar to those of Microsoft, which is unable to explain the basics of, for example, Blazor without killing several months of hard work for a student?
Do Microsoft, Oracle and other manufacturers of SW tools have anyone from real life who can save us from their children's games?
Any systematic work is (at first) very difficult . For example, high officials do not work systematically. The proof is incompatible SW tools, world crises (robbery of savings by inflation, printing money), crimes of inhuman predators like Hitler, Milošević, Putin, some religious high officials and their "brainwashed" believers (kill dissenters, mask women, ban their education and some other rights, for example abortion because of the imbecile idea that the fetus should be preserved at the cost of killing both the mother and the child through poverty - let them support the unwanted child and no one will ask for an abortion). In an orderly, non-anarchic society of educated people, such non-humans would not come to power. Voters do not recognize high officials who work unsystematic, ie they are not aware that by not going to the polls or by electing always the same incompetent / liars / thieves they are working against themselves, ie through ignorance / stupidity they fall prey to intense brainwashing by propagandists and commit a kind of suicide. Vote for someone else so that we don't always get squeezed by the same mafia octopuses of incompetent / lying / thieving high officials.
We have to look at the whole - all the (main) functions of the code , but PHP learning resources are more self-advertising to make money, not teaching all the (main) functions of the code. I wish Microsoft Oracle, PHP "experts - ha,ha" and others would teach (eg Blazor) the way I teach PHP here . Who can understand many megabytes of inexplicable inclusions? If something goes wrong look for an error in many megabytes of code? It's child's play for me, as complicated as Oracle Forms after the last client-server version of 6i. Installing, calling and maintaining servers is an (inexplicable) science. The post-6i call pattern is replaced by Oracle every few years with an incompatible one (problem: huge Java core library!). Microsoft's development tools, like Oracle's, are incompatible and some have been abandoned like Oracle Forms 6i.
เสร็จแล้ว :
I not intend to do :
Difficult parts are :
version 8.0.0.0 means (https://semver.org/) :
November 2021. Current version code is 8. Msg module version 8 is not finished, but is visible what should be done during next few months (Mkd ver. 8 was finished in half hour, Mnu simmilar, Msg needs much more time because of bootstrap 5, improve CRUD sintax...).
See http://phporacle.eu5.net/ (freehostingeu - fast, stable, has free MySQL) how it should work.
What's new in version 8.1.0.0 :
User (TODO: or any) module may be caled from blog module so http://dev1:8083/fwphp/glomodul/blog/?i/home/p/1/ -> login -> tables (dashboard) ->admins
but also independent of some compound module so : http://dev1:8083/fwphp/glomodul/user/ .
What's new in version 8.0.0.0 :
2021.08.28 ver 7.0.5 : I added folder (module) WEBSERVERROOT/fwphp/glomodul/img_gallery
J:awwwwww is my WEBSERVERROOT.
J:awwwwwwfwphp is MYDEVSITEROOT1. You may have more MYDEVSITEROOT2, 3... See how in WEBSERVERROOT/index_laragon.php script.
glomodul is group of folders - modules which are not 01mater or 02financ or 03... glomodul may be named othermodules.
img_gallery module is first lesson about (theory behind) code skeleton (application architecture) B12phpfw
2020.09.30 DONE version 7.0.0.0 1. declare(strict_types=1) ; - PHP 7 2. DBI improved : trait Db_allsites instead class Db_allsites. 3. Each DB table (persistent storage) has adapter class Tbl_crud : which uses B12phpfwcorevendor/B12phpfwDb_allsites and implements Interf_Tbl_crud This means that : 1. Module's views or ctrs, eg blog module (see blog folder) work much easier with more Tbl_crud, ee with own Tbl_crud and with other tables Tbl_crud's. 2. class Home_ctr extends class Config_allsites. ( Logically all is in Home_ctr ).
2020.09.05 DONE On Linux demo sites : some PHP statement works different than on Windows (about dozen incompatibilities), eg links do not work in msg module, but work in mnu and mkd modules) : DONE in wsroot_pathvendor/b12phpfwConfig_allsites.php :
Error on Linux not on Windows : $REQUEST_URI = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_STRING);
No error on both OS : $REQUEST_URI = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL) ;
I use xampp-portable-windows-x64-8.1.5-0-VS16.7z 92 Mb or newer on newest Windows 10, 64 bit. No more : Laragon portable laragon.7z, 19 MB. No more WAMP because is not fully portable, Composer needs coding displayed below and it is only for Windows. It seems WAMP and Laragon not giving newest/simplest solutions as xampp does.
WAMP does not like PHP in Windows PATH variable, so :
1. I installed Composer-Setup.exe and removed PHP from PATH.
2. **C:composercomposer7.bat** :
```
@echo OFF
:: in case DelayedExpansion is on and a path contains !
setlocal DISABLEDELAYEDEXPANSION
J:wamp64binphpphp7.2.9php.exe "%~dp0composer.phar" %*
```
Save file along with the originally installed composer.bat file.
3. Now call the php7 composer with the new command:
```
In Windows CLI, cd J:awwwwww and as admin :
composer7 selfupdate (1.8.4, 2019-02-25, Use composer self-update --rollback to return to version 1.7.3)
composer7 update
```
https://kevinsmith.io/modern-php-without-a-framework/
https://github.com/PatrickLouys/no-framework-tutorial
https://github.com/mmeyer724/Frameworkless
https://symfony.com/doc/current/create_framework/index.html
http://dev1:8083/fwphp/glomodul/mkd/?edit=001_MDcheatsheet.txt
http://dev1:8083/fwphp/www/
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/01_oracle_DB_18c_instalac.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/02_oracle_APEX_20_1_instalac.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/03_1oracle_apex_sales_module.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/03_2oracle_apex_sales_apl_cloud.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/devsuite10g_instalac.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_db/devsuite10g_F6i_to_apex.txt
http://dev1:8083/fwphp/glomodul/mkd/?edit=01/001_vbox/001_instalac_moj_vbox_oralin76.mkd
http://dev1:8083/fwphp/glomodul/mkd/?showhtml=J:/awww/www/readme.md
Top.....Dirs.....UML.....DM.....IDE.....CRUD.....SW fw
SimplestCRUD index.php.....index.php.....Home_ctr.....home (table page).....create.....read (user profile - form).....update....adapter
See http://dev1:8083/fwphp/glomodul/mkd/?i/edit/path/J:awwwwwwreadme_thoughts.md for my earlier thoughts.