File: fwphp/glomodul/blog/msgmkd/altervista011.txt

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/blog/msgmkd/altervista011.txt  >  Download  
File: fwphp/glomodul/blog/msgmkd/altervista011.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: ver 7.0.1 mnu, msg, mkd FUNCTIONAL namespaces, CRUD PDO trait, pretty URL-s
Date: 2 months ago
Size: 8,972 bytes
 

Contents

Class file image Download
## 11\. PHP CMS - XAMP 64 bit on Windows 10, flat files CRud (u, d in Op.Sys - WYSIWYG SimleMDE or Summernote) or relational DB tblrows CRUD
Revised 2020.03.26    Code download : [**https://github.com/slavkoss/fwphp**](https://github.com/slavkoss/fwphp)     
I made **B12phpfw ver. 6** code skeleton on which are modules Mnu, Blog (Msg), Mkd and many PHP learning examples. 

### Conclusion for this and my previous 10 posts
Posts are organized as PHP learning book, so I change previous posts periodically !

### 5W of every activity (highest ideas, categories, eg in journalism...)

`who`: Web site - menu & CRUD code skeleton applied to 3 modules (wrong to say applications) : "Mnu", "Blog (Messages, Msg)", "Mkd" in dirs :

1.  WEBSERVERDOCROOT\\fwphp\\www (fwphp is group of applications, www is menu appl consisting of one module)
2.  WEBSERVERDOCROOT\\fwphp\\glomodul\\blog (**glomodul** is "application global modules" = group of global modules, )
3.  WEBSERVERDOCROOT\\fwphp\\glomodul\\mkd

`where`(is code) : All Sites level Globals, Modules Globals, Menu code skeleton, Config classes, Crud classes. 

`when`: Clear visible programming **steps** - **signal flow,** **data flow** & **code flow** 

`what`: Basic Menu & CRUD code skeleton for (who) 

`how`:

1.  FUNCTIONAL (DECLARATIVE) NAMING - descriptions of WHAT, NOT HOW STEPS -eg not programming steps M, V, C. Directory named invoice\_fmb, means bussiness proces, not how steps (ee not 3 dirs M, V, C for all modules - fmb-s) !
2.  index.php is MAIN MODULE'S SINGLE ENTRY POINT ee all (submenus) calls go through this script. Here is **configuration minimized, CONVENTIONS maximized**. Same all other modules.
3.  **simple OWN DEBUGGING** and XDEBUG.
4.  CLASSES FOR: Config, (Controllers), Models (CRUD), not for Views but could be.
5.  namespaces & own autoloading class scripts. Composer's PSR-4 is problem for not 3 dirs M, V, C for all modules but **each module in own dir (huge difference)** ?
6.  pagination in Blog pages
7.  beautiful urls without web server url rewritting (see QS="?" constant.
8.  search/filtering/sort in Blog pages
9.  password\_verify and password\_hash functions explained (in z\_examples)
10.  RTE (Rich Text Edit) markdown (SimpleMDE & Parsedown MD2HTML) or HTML (Summernote)

`why`: Not found hows above in learning sources : Simplest possible code skeleton, newest PHP coding style, good code explanations - code help.    

### Main (Root) module contains main index.php

[www](https://github.com/slavkoss/fwphp/tree/master/fwphp/www "Mnu module") subdir in fwphp dir contains root module, site's index.php. Has links on many test-learn examples.

### [Mkd](https://github.com/slavkoss/fwphp/tree/master/fwphp/glomodul/mkd "Mkd module") module is Dreamweaver replacement

Can WYSIWYG edit:

1.  markdown using SimpleMDE or other
2.  or html using Summernote or other.

No relational database CRUD (so code is simpler) but similar, based on same **B12phpfw** fw (program skeleton) as [**Msg**](https://github.com/slavkoss/fwphp/tree/master/fwphp/glomodul/blog "Blog, Msg module") realational DB tables rows PDO CRUD module, so Mkd is good for learning MVC framework skeleton coding. I think B12phpfw is best-simplest DB PDO CRUD framework (for framework haters which also am I partially: it is not framework, it is **standardized basic code skeleton**) . Why version 6 ? B12phpfw is good example how small but important changes in fw code cause:

1.  lot of work
2.  and when done much simpler use of basic code skeleton.

 
<br /><br /><br />
### PREREQUISITES FOR PHP WEB DEVELOPMENT

### 1\. XAMPP 64 bit, php 7.4.2 [https://www.apachefriends.org/download.html](https://www.apachefriends.org/download.html) (I do not use WAMP SERVER anymore)

If no XAMPP (more work) : PHP (for Windows **thread safe**) : php 7.4.x needs VC15 or VS16 (Visual Studio 2017 or 2019 compiler respectively) Apache : https://www.apachelounge.com/download/

### 2\. CONFIG SCRIPTS see 00info\_php2.php - all config scripts are here

J:\\xampp\\apache\\conf\\httpd.conf J:\\xampp\\apache\\conf\\extra\\httpd-vhosts.conf C:\\Windows\\System32\\drivers\\etc\\hosts J:\\xampp\\php\\php.ini  

### 3\. CONNECT PHP 7.2.4 TO OracleXE 11.2

ORACLE 11g PDO & OCI8 EXTENSION - OPTIONAL

**php\_pdo\_oci.dll** comes with XAMPP. 

In php.ini **extension=pdo\_oci** and **extension=php\_oci8\_11g**.dll (.dll is optional, not required) 

oci8.default\_prefetch = 100

[https://pecl.php.net/package/oci8](https://pecl.php.net/package/oci8) (for XAMPP on Windows **thread safe**) ver. [2.2.0](https://pecl.php.net/package/oci8/2.2.0) 

2018-12-10 copy 1\_php\_oci8-2.2.0-7.4-ts-vc15-x64.zip to J:\\xampp\\php\\ext and unzip php\_oci8\_11g.dll . 

CLI PHP : J:\\xampp\\php\\php.exe (before I used J:\\wamp64\\bin\\php\\php7.2.9\\php.exe) 

ORACLE 11g OCI8 EXTENSION ON NETWORK : OR for PC on on network ? : Feb 6 2018 Christopher Jones : ORACLE CLIENT LIBRARIES of same 32-bit or 64-bit architecture as PHP and are first in PATH. If you use Instant Client you need to have the correct VS Redistributable, see

1.  64 bit http://www.oracle.com/technetwork/topics/winx64soft-089540.html or
2.  32 bit http://www.oracle.com/technetwork/topics/winsoft-085727.html

### 4\. COMPOSER DEPENDENCY MANAGER FOR PHP (CODE DOWNLOADER)

For XAMPP on WINDOWS just install [https://getcomposer.org/Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe) from page [https://getcomposer.org/download/](https://getcomposer.org/download/) . 

WAMP does not like php in PATH variable. So composer update does not work. \[\*master\] J:\\awww\\w\\fwphp> J:\\wamp64\\bin\\php\\php7.2.9\\php.exe C:\\composer\\composer.phar update (1) or better C:\\composer\\composer7.bat : Save the file along with the originally installed composer.bat @echo OFF :: in case DelayedExpansion is on and a path contains ! setlocal DISABLEDELAYEDEXPANSION J:\\wamp64\\bin\\php\\php7.2.9\\php.exe "%~dp0composer.phar" %\* Now call php7 composer with the new command: \[\*master\] J:\\awww\\w\\fwphp> composer7 selfupdate (1.7.2, Use composer self-update --rollback to return to version 1.7.1) composer7 update (2) is same as (1)

### 5\. GIT MULTIUSER SCRIPTS SYNCHRONIZER see Git book
see https://github.com/slavkoss/fwphp#swfw 




<br /><br /><br />
#### WAMP 64 bit 2018\-05\-25 on Windows 10 64 bit - I do not use WAMP or ZWAMP anymore

Seems simpler than ZWAMP - no entries in PATH variable. Composer works after reinstal (asks php.exe dir) - see below.

#### Composer manual Command-line installation - I do not use this

For XAMPP on WINDOWS just install [https://getcomposer.org/Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe) from page [https://getcomposer.org/download/](https://getcomposer.org/download/) .

To automate the installation **on Linux only**, use [the guide on installing Composer programmatically](https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md).

1.  **Deinstall Composer if installed**
2.  **cd J:\\wamp64\\www\\fwphp** J:\\wamp64\\bin\\php\\php5.6.35\\php.exe -v PHP 5.6.35 (cli) (built: Mar 29 2018 14:27:15) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
3.  J:\\wamp64\\bin\\php\\php5.6.35\\php.exe \-r "copy('https://getcomposer.org/installer', 'composer-setup.php');"J:\\wamp64\\bin\\php\\php5.6.35\\php.exe -r "if (hash\_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP\_EOL;" outputs : Installer verifiedJ:\\wamp64\\bin\\php\\php5.6.35\\php.exe composer-setup.phpoutputs : Composer (version 1.6.5) successfully installed to: J:\\wamp64\\www\\fwphp\\composer.phar Use it: php composer.pharJ:\\wamp64\\bin\\php\\php5.6.35\\php.exe -r "unlink('composer-setup.php');"The 4 lines above will, in order:
    1.  Download the installer to the current directory
    2.  Verify the installer SHA-384 which you can also cross-check here [https://composer.github.io/pubkeys.html](https://composer.github.io/pubkeys.html)
    3.  Run the installer - will check some php.ini settings, warn you if they are set incorrectly, and then download the latest composer.phar in the current directory
    4.  Remove the installer
4.  Create a new composer.bat file alongside composer.phar: J:\\wamp64\\www\\fwphp\>echo @J:\\wamp64\\bin\\php\\php5.6.35\\php.exe "%~dp0composer.phar" %\*>composer.bat
5.  **Add directory J:\\wamp64\\www\\fwphp to your PATH environment variable if it isn't already.** For information on changing your PATH variable, please see this article [https://www.computerhope.com/issues/ch000549.htm](https://www.computerhope.com/issues/ch000549.htm) and/or use Google.
6.  Close your current terminal. Test usage with a new terminal: C:\\Windows\\System32>**composer -V** Composer version 1.6.5 2018-05-04 11:44:59
For more information send a message to info at phpclasses dot org.