頂部..... 1.4 dirs ..... 1.3 UML ..... 1.5 dm ..... IDE ..... 3。 crud ..... SW FW
CRUD模塊示例代碼7腳本:
最簡單的crud ..... index.php ..... home_ctr ..... home(表頁).....創建.....
B12PHPFW:在Home PC上開發(最新)Windows 10 64位使用XAMPP(Apache Web Server,Mariadb)開發。還可以在Windows Oracle虛擬框上測試Oracle Linux虛擬機(Apache Web服務器)和Linux演示站點。 B12PHPFW是20年來學習PHP的結果(但我沒有生產裝置)。
請參閱代碼(信號)流量和數據流,或者在這裡 - 由於時間限製而行不通。
提取fwphp-master.zip僅約300 kb(B12PhPFW核心小於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 www ” =“ http://dev1:8083/“ = ownwebserver_or_hosting_docroot_path
文件夾:供應商(鋅是鋅,現在不再存在鋅,股票已在/供應商 /b12phpfw中)
在phpmyadmin頁面中:
import in My SQL J:awwwwwwfwphpglomodulblog_akram 1_phpcms.sql : is first learning step "1a. Msg MySQL" on main menu page - older procedural programming style but enough if we want only blog module (no need for OOP - classess - autoloaders - routing - dispatching, B12phpfw,名稱空間,用於大站點的全球 - 數百個模塊)。
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 as adrs模塊 - j: awww www www fwphp fwphp glomodul www www www www www www www www www www www 。 ADR並不是一個簡單的例子,但不足以學習B12PHPFW菜單和CRUD代碼骨架!足夠簡單的學習模塊是MNU,MKD和MSG模塊!似乎很複雜,但不是。
大多數(全部?)互聯網和書籍上的PHP學習來源(尼克松,勢力,Yank,Ullman ...)看起來很簡單,但我認為僅對基本的Sintax有好處,並導致菜單和CRUD代碼骨架的錯誤編碼,因此比B12Phpfw更為複雜! Book CMS Duckett 2022年非常適合學習PHP,但CMS示例不是很好。它是生活悖論之一:“幻覺,外觀的外觀”。
MNU- /fwphp /www文件夾中的菜單模塊
MKD- /fwphp/glomodul/mkd文件夾中的降價內容管理模塊
MSG-/fwphp/glomodul/blog,...用戶,... post_category,... post,... post_comment(全部in Glomodul dir)中的crud msg -blog模塊。
當前2023.01.15,B12PHPFW版本10.0.0.0“對於任何共享DB適配器的同一模塊DB適配器”。 10.0.0.0表示:
2023年1月:只有ADRS模塊在MySQL或Oracle(11G)DB上工作(不是所有功能,但足以清楚地看到所有內容)。將整個ADDRS模塊和MSG模塊更新為版本10並不難,但是需要很多時間,所以我不著急,因為我認為我已經實現了菜單的目標和Crud Skeleton Code B12Phpfw。上一句話中的大量時間意味著SW工具以及用戶應用程序需要大量時間來完成,如果我們更改某些內容。如何避免這種情況的最佳示例是共享的(全局)代碼,例如“任何共享DB適配器的同一模塊DB適配器”。
B12PHPFW PHP SW工具的目標是,基於與Oracle Forms 6i的二十年合作,可以為具有邏輯(例如Oracle Forms 6i)的 *.php網站製作工具。
mnu,addrs ...文件夾(模塊)就像oracle表單6i *.fmb和.php一樣,就像某些.fmb中的程序一樣。我堅信,這種方法比所有頁面(.fmb)的三個文件夾M,V,C,這在我看來是SW工具作者的作品,而SW工具的作品沒有足夠的實踐經驗。這些作者在我們的時間裡造成了很多損害(Microsoft,Oracle,所有Linux愚蠢版本,甚至是Windows)。
http:// dev1:8083/fwphp/glomodul/adrs/
用您的Web Adress替換http:// dev1:8083,例如http:// localhost b12-打開ADRS模塊的主頁:
家.......
主頁- 頁面標題
- 頁面內容:
您正在查看:j: awww www fwphp glomodul adrs home.php
$ pp1-> module_relpath站點下方root = fwphp/glomodul/adrs
$ pp1-> module_url = http://dev1:8083/fwphp/glomodul/adrs/
B12PHPFW與其他(PHP)框架(菜單和CRUD代碼骨架)不同。主要(大)差異:
每個模塊(就像Oracle Forms6i .fmb)都在自己的文件夾中,並非所有模塊中的所有模塊:M,V,C。 C。
因此,J: awww www fwphp glomodul adrs ... mini3 adrs ... nppses
僅包含一個ADRS模塊文件夾中的腳本:ADR。
全局腳本在:j: awww www vendor b12phpfw 文件夾中。
名稱空間是功能性的,而不是位置(不是不必要的DIR樹,但DIR就足夠了!)。
例如,名稱空間B12phpfw site_home www;或b12phpfw site2_home www(!)或b12phpfw module adrs
1。 B12PHPFW模塊是命名空間的功能性一部分 - 腳本做什麼 - 我們可以在這裡編寫任何我們希望的
2。 adrs是腳本的文件夾(j: awww www fwphp glomodul adr adrs home_ctr.php,http:// dev1:8083/fwphp/fwphp/glomodul/adrs/)
站點徽標(如果願意):在CSS背景中:URL('數據:Image/png; base64,ivborw0kggoaa ... qmcc');
- 模塊(或站點)頁腳:
這是基於github上Mini3的B12PHPFW上的Mini3 PHP FW。
此頁面示例1 URL(Web Adress -Web名稱)是:http:// dev1:8083/fwphp/glomodul/adrs/? i/ex1/ex1在home cls中的方法是ex1。
EX1方法包括此頁=視圖WHOR.SYSTEM ADRESS是:J: awww www fwphp fwphp glomodul adrs example_one.php。
此頁示例2恢復兩個參數p1 ='param1'和p2 ='param2'。此頁麵包含在Home CLS EX2方法中。此頁URL是:http:// dev1:8083/fwphp/glomodul/adrs/? i/ex2/p1/parm1/param1/p2/param2/param2/
屬性pallette $ pp1的重要組成部分是uriq = url(uri)查詢部分:[i] => ex2其中ex2是要調用的home cls中的ex2是調用某些方法或包含一些腳本[p1] => param1 this方法(script)參數1 [p2] => param2 => param2
URL獲取參數p1 = param1 url獲取參數p2 = param2
您正在查看:j: awww www fwphp glomodul adrs example_two.php
特質db_allsites靜態公共函數rrcnt從“ class tbl_crud”中調用有問題:
棄用:調用靜態性狀方法B12phpfw core b12phpfw db_allsites :: rrcount被棄用,只能使用該性狀在類上調用它 - PHP作者沒有解釋這個問題?因此,現在是課程(2022-07-03)。 (舊的好規則:不要使用高級語言功能,因為語言作者沒有在足夠細節中測試更改!)
關於ADRS模塊有很多需要了解的內容。如果看起來很困難,請嘗試第一個mini3。 MSG模塊添加了“更多模塊”功能,該功能是現實生活編程,並不容易,但可以進行。
在更改(''){... if('1'){...單擊“地址”按鈕或任何其他鏈接後顯示代碼流程後,我們更改自動加載類的輸出。
請參閱https://github.com/nazonohito51/clean-architecture-sample,請參見clean_architecture.md代碼級別的圖像。
嘗試編輯MD文件:http:// dev1:8083/fwphp/glomodul/mkd/? i/showhtml/path/j: awww www www www www clean_architecture.md
頂部...... dirs ..... uml ..... dm ..... id .... id ..... crud .....
請參閱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 -lobal user.name'yourname'
git config -global-replace-all user.email'youremail'
git config-local -l安裝windows的git憑據管理器,以避免在每次推動時登錄 - 在cmder git擴展中(git update update git-for-for-windows)
j: awww www(主 - > origin)
或git添加fwphp (或任何git要求)或git add -a或git add index.html
我們將項目文件存儲在系統硬盤驅動器中。
如果CMDER顯示錯誤“致命:無法自動檢測電子郵件地址”:請參見上面的Git Config ...
git config -lobal user.email“ [email protected]”和git config -global user.name“ your name”
設置您的帳戶的默認身份。省略 - 全球僅在此存儲庫中設置身份。
我們將項目文件存儲在GitHub站點中。
您需要還原文件的舊修訂:git Checkout 8A7B201 index.html如果將“ head”指定為修訂版,則將恢復文件的最後一個投入版本,有效地消除您當前在該文件中所具有的任何本地更改:
git結帳頭索引.html
我們可以使用命令中的工作目錄中回滾刪除的文件:
git結帳 - 。
或Git Checkout -Filemame ...
git是程序,github是站點 - 部署(書)教程
git我們使用例如同步我們的腳本:
Beginning August 13, 2021, Github no longer accepts account passwords when authenticating Git operations on GitHub.com, and requires the use of token-based authentication , such as a **PAT, personal access token over HTTPS = psw 40 characters length (recommended) ** (for developers) or an OAuth or GitHub App installation token (for integrators) for all authenticated Git operations on GitHub.com.您也可以繼續使用您喜歡的SSH鍵。
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-anccount-and-data-secure/creating-a-personal-access-cess-token
λgit Remote -V輸出:
原點https:// [token]@github.com/slavkoss/fwphp.git(fetch)
原點https:/[token]@github.com/slavkoss/fwphp.git(push)
因此,只有最後一個提議仍然存在,這是第一個提交:
保存您的.git/config之前,然後將其恢復。 (我將其刪除在回收箱中)。
我的PHP IDE是Symenu Zip軟件包作為下面列出的所有SW的啟動器(如果可能的話):
Notepad ++ Markdown插件
將tmarkDownViewerPlus.dll複製到Notepad ++安裝目錄處的插件子文件夾。
該插件在工具欄上添加一個小的Markdown圖標,以將查看器切換為Dockable面板。
然後在NPP設置 - >導入 - >導入插件。
請參閱j: awww www globals nppsess文件和其他nppsess文件。
MD到INET上的HTML轉換器:
也很好,所有便攜式所有人都在Symenu:Notepad2-Mod(2 MB),Atom(524 MB),
Visual Studio Code(247 MB),Cudatext(28 MB),PSPAD(23 MB),RJ發短信(416 MB),
HTML Wysiwyg編輯: Microsoft Expression Web (放棄但仍然不錯)。
我避免Dreamveawer,Komposer(被遺棄,太老)。
指揮官:
是舊的,但最好(Janne Huttunen)或同樣的一切,請參閱Symenu
Meinplatz (x64)(Symenu Portable程序的一部分)
或Multicommander,Q-Dir,TotalCommander ...
瀏覽器:
Google Chrome,Cyberfox,蒼白的月亮
(在Symenu中)是贏得CMD系列,有Git。
作曲家可幫助您聲明,管理和安裝PHP項目的依賴關係。
FTP客戶端WINSCP 。忽略:| *。拉鍊; j: awww www.git; j: awww www vendor/b12phpfw/dbconn_allsites.php;
FTP服務器Symenu的Serva社區
PHP手冊
PHP樣式指南
W3Schools的PHP教程
Guzzle是PHP HTTP客戶端,它可以輕鬆發送HTTP請求並與Web服務集成。
DesignPatternSPHP是已知設計模式和一些示例代碼的集合,如何在PHP 7.4中實現它們。每個模式都有一個少量示例列表。
帶有功能強大的插件和主題的包裝管理系統以及墳墓本身的墳墓便攜式扁平文件。
PHP指南
_.-'''''-._
.' _ _ '.
/ (o) (o)
| |
| / |
'. .' /
'. ''---'' .'
'-._____.-'
顯示類結構 - 屬性和方法
頂部...... dirs ..... uml ..... dm ..... id .... id ..... crud .....
<?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類。特質與課程一樣。特質的原因是淨代碼結構:
有些課程可能會使用更多的特徵 -網絡- 更多的父母,但只能擴展一個類別的層次結構。
我不使用特質 - 像經常高級代碼一樣有一些錯誤。
// see class script // see class script
基本上是db_allsites.php read(RR,報告)的工作原理類似於:
/awww/www/clean_architecture.md。我在2023年1月10日在版本中做到了。
B12PHPFW核心代碼。
級別:所有站點(所有站點的相同代碼EE共享,全局)
// see class script // see class script避免在許多腳本中命令
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上方的完整共享(常見)代碼。
top ..... dirs ..... uml ..... dm ..... id ..... crud .....
請參閱信息代碼:
http://phporacle.eu5.5.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_php_apache_config_scripts.php
B12PHPFW與(全部?)其他PHP框架(我更喜歡“菜單和CRUD代碼骨架”)不同,因為:
dirs就像oracle形式的形式模塊.fmb https://github.com/ngrt/mvc_todo-非常好的編碼(但要簡單示例,沒有Globals,沒有名稱空間...),顯示了常規的PHP框架dirs dirs and Ruting Ideas:... glomodul Z_____________________________________________________ MVC_FW DIR或搜索Google:GitHub PHP框架
以及下面提到的其他原因
請參閱Mini3 PHP框架https://github.com/panique/mini3,它極為罕見,不適合簡單的MVC示例(很多好的編碼)。我使用鍵值的路由是不同的,但是使用家庭類方法進行調度是基於Mini3 。
B12PHPFW具有3個模塊和一些實用程序:
頂部...... dirs ..... uml ..... dm ..... id .... id ..... crud .....
請參閱使用MKD FWPHP/glomodul/MKD/02/01_fwphp/php_dip_di.txt
頂部...... dirs ..... uml ..... dm ..... id .... id ..... crud .....
可能是JQuery,PHP,Bootstrap Ajax DB表行CRUD是最簡單,最快的crud,但我不喜歡jQuery,沒有Ajax。我需要的只有JavaScript是對話框是或否。
crud排在桌上歌曲(#id,藝術家,曲目,鏈接) 。 Mini3框架https://github.com/panique/mini3我認為最好學習PHP和Frameworks代碼骨架。我在glomodul模塊組中的ADRS模塊在B12PHPFW上是Mini3。為什麼 ?我認為對於大型網站而言,mini3很簡單- 沒有分享...
請參閱腳本。
最簡單的crud ..... index.php ..... home_ctr ..... home(表頁).....創建.....
我們需要模塊中的單個入口點,以避免與鏈接混亂(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 ..... home(表頁).....創建.....
. . .
* ------------------------------------------------------------------------------
* 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 ..... ** home(表頁.....創建.....
<!-- 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 ..... home(表頁).....創建.....
<?php
// J:awwwwwwfwphpglomoduladrscre_row_frm.php
. . .index.php ..... index.php ..... home_ctr ..... home(表頁).....創建.....
<?php
//J:awwwwwwfwphpglomoduladrsread_tbl.phpindex.php ..... index.php ..... home_ctr ..... home(表頁).....創建.....
<?php
// J:awwwwwwfwphpglomoduladrsupd_row_frm.phpSimplEstCrud index.php ..... index.php ..... home_ctr ..... home(表頁).....創建.....
<?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
對於用戶模塊,使用命名空間和自動加載進行導航(url -s,鏈接)代碼的用戶模塊將代碼從過程MVC轉換為OOP MVC並不容易看到,而OOP無濟於事。程序MVC,例如用戶模塊代碼可以更清晰,可讀。那麼為什麼OOP會更好?
有人說:“ OOP錯誤嗎?” - 例如, OOP缺乏可重複性- 要獲取香蕉(某些方法或屬性),您還可以獲得大猩猩握著香蕉和整個大猩猩的叢林(所有具有復雜依賴性的較高階層)。
例如,接口有助於僅獲取香蕉,但是編碼很複雜 - 我只能找到有關此主題的強烈戀人工作代碼示例。
j: awww www vendor b12phpfw db_allsites_intf.php (17 hits)第15行:靜態public public函數get_or_new_dball (字符串$ nater_from = _from =' unknownne Caller ');第16行:靜態公共函數linterbconn();第17行:靜態公共功能getdbi();第18行:靜態公共功能setDo_pgntion($ new_val);第22行:// 11111 ******************** r功能:第24行:靜態公共函數get_cursor (//對象$ pp1 //喜歡oracle cursor //替換rr行27:靜態公共函數rrnext (object $ cursor $ cursor $ cursor $ cursor,array $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $靜態公共函數RR_LAST_ID(字符串$ tbl,數組$ other = []):int; line 32:// static public函數rrcnt(字符串$ tbl ,array $ other = []):int; int; int; ; //創建TBL行
Line 45: // static public function pre_cc_uu( Line 56: static public function uu ( $tbl, $flds, $where, $binds = [] ) ; Line 62: // 33333 ******************** enterprise bussiness functions (rules, utilities) Line 64: static public function debugPDO(string $dmlxx, array $binds, array $ ph_val_arr):字符串;
例如,發票模塊可與兩張表一起使用:發票和Invoice_Items(或三個表:Bill,Invoice,Invoice_Items)。模仿“最簡單的解決方案”三個dirs m,v,c是不好的 - :) -3dirs Lovers將編碼技術(M,V,C代碼分離)放在前景中,而不是頁面(功能,業務邏輯)。
RR香蕉不再在叢林中,大猩猩和叢林只是一個抽像類Config_allsites,即事實上$ pp1 =屬性。
香蕉$ pp1 =屬性調色板可能會導致匯總(複合,組成,多重)模塊(如博客,發票...我在$ PP1的工作中工作了20年,而Globals Jungle(Oracle Forms 6i)的紮根不如這裡。
請參閱https://phpthewrongway.com/或Joe Armstrong為什麼OOP糟糕http://harmful.cat-v.org/software/ooo_programming/why_oo_sucks。
B12PHPFW基於許多教程中的想法,例如接下來的幾個是最好的(但也是最佳PHP框架Laravel,Simfony,yii,phalcon的一些想法之一。
我根據Jazeb Akram CMS博客中的想法進行了更簡單的B12PHPFW代碼 -頁面設計和Mini3 PHP FW-代碼骨架,路由。有關PHP代碼示例的書籍不是很好。
CMS博客視頻(7.7 GB)Jazeb Akram:Udemy-完整的PHP MySQL專業課程,具有5個項目 -很少沒有簡單的教程。類似的視頻(12.3 GB)EDWIN_DIAZ_PHP的初學者 - 成為PHP主 -CMS項目。還有其他一些視頻 - 因此,它們是CMS博客EE帖子,消息的最佳/最簡單的頁面設計(不是代碼骨架)。由於商業原因,視頻是巨大的,以達到更高的num_of_gb ee $/gb,但沒有最好的代碼 - 有較舊的編程樣式。
mini3 (Mini3 PHP FW https://github.com/panique/mini3-罕見不適合簡單的一個表模塊,但可能具有更多功能。
中間件解釋說,/glomodul/z_examples/mvc_fw/hcstudio_easy/public/to簡單的fw示例,但要學習php的好代碼(僅讀取crud)。對於復雜的路由和中間件,這並不容易!
https://github.com/ngrt/mvc_todo代碼在本文中說明
https://dev.to/jorgecc/a-minimalist-mvc-project-project-using-php-and-without-a-framework-4pd8
https://github.com/trpb/immutablemvc
其他 :
我做了許多更改(我希望改進),因為我不喜歡最佳PHP框架和上述學習來源中提出的解決方案(ESPECLALILY編碼,例如Travery Tutorial)。在那裡沒有很好的解釋和編碼。
我認為這應該很簡單/快速/專業:分享,路由,破壞性,功能名稱空間和類加載,Web Rich Text Editing ...
這就是為什麼我花了很多時間在此上花了很多時間(浪費大量時間應該做工具軟件作者,而不是像我這樣的工具軟件用戶)。
與https://github.com/panique/dydemini3dydagy相比,該代碼骨架似乎很複雜,這可能是用於較小項目(和學習PHP)的最佳FW代碼模板。
對於大型項目,我在這裡使用的可重用非常重要,與自己的文件夾中的模塊相同(不僅僅是3個Dirs M,V,C) 。
關於股票(全球群體),請參見討論:
https://medium.com/@sameernyaupane/php-software-architecture-part-1-mvc-1c7bf042a695
https://medium.co## 3.2m/@sameernyaupane/php-software-architecture-part-part-2-the-anternatives-1bd54e7f7b6d
https://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html
在2019/2020年冬季期間(因為我測試了很多其他人所做的事情),我製作了6版。菜單和CRUD PHP代碼骨架(自己的框架為“ B12phpfw”) - 核心代碼為〜50 kb。版本7。 :PHP 7和特質DBI在2020年10月。
為什麼 ?我不喜歡最佳PHP框架(Laravel,Simfony,yii ...)和學習資源(Internet,Books)中的建議解決方案。我認為EG模塊發票PHP代碼應在自己的文件夾中,例如Oracle form form form invoice.fmb(並非3個文件夾中的所有表單/報告:m,v,c)。我認為這應該很簡單/快速/專業:全球,路由,破壞性,課程加載,富含網絡文本編輯 - 這就是為什麼我浪費了很多小時來編碼我的B12PHPFW(浪費大量時間,應該助長軟件作者,而不是像我這樣的SW用戶編寫者)。
為什麼我不喜歡擬議的解決方案以及(我希望)改善這些解決方案。紅色功能是B12PHPFW的主要原因,但我也提高了其他功能。 :
traversymvc(具有視頻)和mini3被簡化,與Laravel,Simfony,Yii,Falcon相比,有一些(許多?)差異... B12PhPFW有很多不同 - 請參見紅色特徵。 PHP Framework作者沒有顯示這樣的鍛煉表,對我來說,它是隱藏的(袋裝貓)。
| 特徵 | B12phpfw | Mini3 MVC PHP FW和traversymvc |
|---|---|---|
| 1。在自己的文件夾中的模塊,例如oracle forms .fmb | 有 - 這是B12PhPFW的主要原因之一! | 3個dir中的所有表格/報告都沒有:m,v,c |
| 2。名稱間隔類(功能名稱間距) | 有 | 在我看來, Mini3比traversymvc更好:https://github.com/panique/mini3具有姓名間隔類。 traversymvc博客尚未 |
| 3。文件夾數(我的看法) | 最佳的 | 對許多人 |
| 4。最小的PHP代碼要學習(中)PHP(我的看法) | 最佳(但我們可以添加其他代碼) | 很好,但不夠 |
| 5。功能方法,attr。等命名(我的看法) | 好的 | 可能會更好 |
| 6。全球課程,方法等(我的意見) | 好見下面的CRUD測試輸出 | 壞的 |
| 7。 (郵政編輯) Wysiwyg編輯 | 有 | 沒有 |
| 8。 HOME_CTR或HOME_MDL CRUD層方法不知道底層DB_Allsites層PDO方法,mysql,oracle ... | 有了很大的改善 | 沒有 |
| 9。 OOP | 有 | 像Mini3一樣 |
| 10。名稱空間(自己的PSR-4(或作曲家)自動加載類腳本) | 改進 | mini3有,traversymvc博客尚未 |
| 11。所有腳本都包括在內(EE沒有HTTP跳躍,除了其他模塊中的某些跳躍) | 有 | Mini3具有B12PHPFW從Mini3獲取,Traversymvc博客尚未 |
| 12。僅用於Bootstrap 5 | 是的 | Mini3擁有自己的CSS,traversymvc博客有 |
| 13。 Ajax,JSON | 沒有 | Mini3有基本的JQuery Ajax解釋說,Traversymvc博客有 |
| 14。服務器端驗證 | 有 | 有 |
| 15。身份驗證(登錄 /輸出) | 有 | 沒有,traversymvc博客有 |
| 16。授權(僅登錄用戶可以執行某些代碼EE CRUD代碼...) | 有 | mini3沒有,traversymvc博客有 |
| 17.自己的調試非常簡單且有用:pre tag或彈出式js msg中的msg)。 Xdebug也有幫助。 | 有 | 沒有 |
| 18。這裡的PHP代碼非常適合(更多)大型網站 | 是的 | 不 |
| 19。多語言頁面 | 有,請參見https://github.com/slavkoss/fwphp/tree/master/master/fwphp/glomodul/z_examples/multilang/ | 沒有 |
| 20。 DM (域模型) | 最簡單,沒有復雜的命名空間,接口,適配器,數據映射者...請參閱https://github.com/slavkoss/fwphp/tree/master/master/master/fwphp/glomodul/z_examples/02_mvc/03xuding_glob | 沒有 |
(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.
常見的FW DIR結構是標記為NO-的項目 - 在B12PHPFW中未使用,但基礎是相同的。 B12PHPFW更適合大型站點。
頂部...... dirs ..... uml ..... dm .....
對我來說,SW FW是Ctrl+C,V的幾十(數百個)代碼片段(全局代碼片段甚至不需要Ctrl+C,V,因此非常需要它們)。
請參閱“什麼是SW FW(軟件框架)”(在FWPHP/glomodul/MKD/MKD/02/01_fwphp/ php_dip_di.txt/ )中使用:
代碼流術語:di是關於代碼流扎 - 接線,IOC是關於代碼流方向的,而傾角則與代碼流有關。
可以肯定的是,將DI或IOC與DIP一起使用。
B12PHPFW表示:B = crud的表行塊,例如Oracle表單,例如Invoice.fmb Master(B1)和詳細行(B2)。
12 =代碼流的步驟必須清楚,很好地解釋了。 CS01表示代碼流步驟1。
phpfw = php框架=菜單和CRUD的代碼骨架(以及許多其他功能,
我從來沒有理解足夠的FW作者解釋,這是我不相信它們的原因之一)。
代碼小而簡單,但需要:
幾個小時(高級用戶) - 天(中級) - 幾週/幾個月(初學者)來理解它。
了解任何好的代碼骨架都必須使用代碼!
乾淨的代碼:“任何傻瓜都可以編寫計算機可以理解的代碼。好的程序員編寫人類可以理解的代碼。” (馬丁·福勒)。
當你死了,你不知道你已經死了。它僅對其他人很難。當您懶惰(或愚蠢)時,情況是一樣的。
“總是代碼好像最終維護您的代碼的人將是一個暴力的精神病患者,他知道您的住所。” (約翰·伍茲)。適配器“乾淨的代碼讀取就像寫得好的散文”(Grady Booch)。好的代碼讀取接近自然語音。
命名是我們必須表達我們在代碼中所做的工作的最佳工具(避免評論)。類和變量是名詞:價格,電流貿易。布爾人是謂詞:isseduled,Isrunning。方法應該以動詞:getTrateGyResult,createstrategyResult開頭。常見的命名錯誤:非常小的名稱($ tr,dd()),不是真實單詞($ dgrtty)的名稱,是名詞的方法。
著名的軟件包做一些特別的事情,也經常創新。
我在業餘時間開發了B12PHPFW(我過去20年的工作是:Oracle Forms&Reports 6i和Crystal Reports。我們希望將它們遷移到PHP - 永遠不會發生
因為我沒有發現像廢棄的甲骨文形式6i的好工具 - 羞恥。另請參見下面的“與所有PHP框架相比……”。
B12PHPFW非常適合開發大型站點(其中更多在Web Server root dir。路徑下)。
創新是:
與所有PHP框架和學習來源相比:
根據我能找到的最佳PHP學習代碼。請參閱[Web Server root dir。路徑] fwphp/glomodul/z__examples,在哪裡:
結論:B12PHPFW對於MSG-BLOG和SIMMMILAR模塊中的CRUD最有用,因此它是B12phpCrudFW 。對於MNU和MKD MARKDOWN WYSIWYG編輯器和模塊,我們不釘B12PHPFW代碼骨架,但我做到了。
包括和方法調用URL跳躍(http //跳到頁面) - 這是有趣的問題。 http //跳到B12phpfw中的頁面僅用於在其他模塊中跳躍。
可惜的是,Oracle不支持最新的客戶服務器SW Forms6i(替代了臭名昭著的功率對象)和Reports6i,但只有Web版本反復改變了一些基本功能(與Microsoft工具一樣不兼容),並且對於較小的公司而言,它具有太多的毛線。為什麼Web版本的F6i,R6i不會生成不需要多個服務器的剃須刀代碼或PHP代碼之類的東西,並且在大型Java庫中沒有問題,而開始...(最簡單的javor表單(#id,名稱)為〜6 MB,php form 6 kb!)
Ferrante先生說,“強烈勸阻”,這意味著“用電源物體誘餌,F6i,r6i ...“我們已經將您與昂貴的且小型企業相連,而較小的企業不合適。
這是很少有開發人員以Oracle表單啟動新項目的原因,從Oracle到Java,Apex(具有屬性的聲明性編程)可以認真地單擊!這些是與微軟類似的有害徘徊,它無法解釋例如大火的基本知識而不會殺死學生幾個月的辛勤工作?
Microsoft,Oracle和SW工具的其他製造商是否有現實生活中的任何人可以將我們從孩子的遊戲中拯救出來?
任何系統的工作都非常困難。例如,高級官員無法系統地工作。 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貧困 - 讓他們支持不需要的孩子,沒有人會要求墮胎)。在一個有序的,非政治的受教育人士的社會中,這種非人類不會上台。選民不認識高級官員,他們不知道他們不參加民意調查或選舉他們在對抗自己的情況下始終與自己對抗自己的無能 /騙子 /小偷,即通過無知 /愚蠢而被宣傳主義者強烈地洗腦並自殺。投票給其他人,這樣我們就不會總是被同樣的黑手黨章魚所擠壓,即無能 /騙人 /盜賊高級官員。
我們必須查看整個代碼的所有(主要)功能,但是PHP學習資源更自我開發以賺錢,而不是教授代碼的所有(主要)功能。我希望Microsoft Oracle,PHP“專家-HA,HA”和其他人能教我在這裡教PHP的方式(例如,julazor) 。誰能理解許多莫名其妙的包含物的兆字節?如果出現問題,請在許多兆字節中尋找錯誤嗎?對我來說,這是孩子的玩法,就像6i的最後一個客戶服務器版本之後一樣複雜。安裝,呼叫和維護服務器是一門(莫名其妙的)科學。 6i後的呼叫模式每隔幾年就用不兼容的呼叫模式取代(問題:巨大的Java Core Library!)。微軟的開發工具(例如Oracle's)是不兼容的,有些像Oracle Forms 6i一樣被放棄。
完畢 :
我不打算這樣做:
困難的部分是:
版本8.0.0.0表示(https://semver.org/):
2021年11月。當前版本代碼為8。 MSG模塊版本8尚未完成,但可見,在接下來的幾個月中應該做什麼(MKDVer。8在半小時內完成,Mnu Simmilar,MSG,MSG需要更多的時間,因為Bootstrap 5,改善Crud Sintax ...)。
參見http://phporacle.eu5.net/(FreeHostingeu-快速,穩定,具有免費的mysql)。
版本8.1.0.0中的新功能:
用戶(todo:或任何)模塊可以從博客模塊中平靜下來,因此http:// dev1:8083/fwphp/glomodul/blog/? i/home/home/p/1/ - > login-> login->表(dashboard) - > admins - > admins
但也獨立於某些複合模塊,因此:http:// dev1:8083/fwphp/glomodul/user/。
版本8.0.0.0中的新功能:
2021.08.28 VER 7.0.5:我添加了文件夾(模塊)Weberverroot/fwphp/glomodul/img_gallery
J: awww www是我的Weberverroot。
j: awww www fwphp是mydevsiteroot1。您可能擁有更多的myDevSiteroot2,3 ...請參閱Weberverroot/index_laragon.php腳本中的內容。
glomodul是一組文件夾 - 不是01Mater或02financ或03 ... glomodul的模塊可以命名為其他模塊。
IMG_Gallery模塊是有關(理論背後)代碼骨架(應用程序架構)B12PHPFW的第一課
2020.09.30完成版本7.0.0.0 1。聲明(strict_types = 1); -php 7 2。 dbi改進:特質db_allsites而不是類db_allsites。 3。每個db表(持久存儲)都有適配器類TBL_Crud:它使用B12Phpfw core core vendor/b12phpfw db_allsites並實現Interf_tbl_crud in Internf_tbl_crud this Interm in Internf_tbl_crud this: 1。 Module的視圖或CTRS,請參閱Blog flobs _和其他tbl _的視圖,請參見其他tbl _的crud tbl tl tbl tbl tl tbl, tbl_crud's。 2。 class home_ctr擴展了類Config_allsites。 (從邏輯上講,全部都在home_ctr中)。
2020.09.05在Linux演示站點上完成:某些PHP語句與Windows(大約十幾個無兼容性)不同,例如鍊接在MSG模塊中不起作用,而是在MNU和MKD模塊中工作):在WSRoot_path ventor vendor vendor/b12phppfw confiption.phpfw fifform.phpf figplion.php:ppath中完成。
Linux上的錯誤不在Windows上:$ request_uri = filter_input(input_server,'request_uri',filter_sanitize_string);
兩個OS上沒有錯誤:$ request_uri = filter_var($ _ server ['request_uri'],filter_sanitize_url);
我使用Xampp-Portable-Windows-X64-8.1.5-0-VS16.7Z 92 MB或在最新Windows 10,64位上使用較新。沒有更多:laragon便攜式laragon.7z,19 Mb。沒有更多的WAMP,因為不完全便攜,作曲家需要下面顯示的編碼,僅適用於Windows。似乎Wamp和Laragon沒有像XAMPP那樣提供最新/最簡單的解決方案。
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_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_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_f_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/www/readme.md
頂部..... dirs ..... uml ..... dm ..... id ..... crud ..... sw fw
SimplestCrud index.php ..... index.php ..... home_ctr ..... home(表頁).....創建.....
請參閱http:// dev1:8083/fwphp/glomodul/mkd/? i/edit/path/j: awww www www www readme_thoughts.md,以了解我的早期想法。