顶部..... 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 (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) | 最佳的 | 对许多人 |
| 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) | 改进 | 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.