$tmp_imgpath=/srv/disk16/3266814/www/phporacle.eu5.net/zinc/img/img_big/safe_image.jpg
$tmp_imgurlrel=/zinc/img/img_big/safe_image.jpg Edit post data in database table row ⟩⟩

Category: B12phpfw & Written by Xerox121 On 2015-01-04 12:20:29

3. Zwamp server development ibrowser menu

3. Zwamp server development ibrowser menu

HOME- old downloads are here, but betterhttps://github.com/slavkoss/fwphp/

2019.10.25 Recently I use XAMPP (since Apachefriends made 64 bit version) - simplest installation. Also fwphp is much simpler than MVC described below.

2.Sept.2015 Download - see site_ver2.rar from my article 9. Here is important lsweb.php - excellent for development (and very simple once you understand it).

zwamp.rar - this is old code, use it only to see how to work with static class elements. Folder names in .rar are simmilar to my development site folder names. (All is tested with ~newest 64 bit SW). Contains scripts to learn higher level begining PHP :

  1. Apache & php config scripts
  2. zwamp scripts - main development menu
  3. ls scripts - web server dirs navigation
  4. yiiinfo scripts

Goal is basic web development site. Best way to learn is start with small portion of code and add few lines step by step.

May 2015 Code refactored 3 : Not finished yet, later I shall write new article "Web development and production site (virtual hosts, aliases) on Windows 8.1 , Oracle 11gXE (and 11g), PHP (all 64 bit) on hard disk and on Usb stick". Code refactoring 3 consists of:

  1. simplify config class with static variables
  2. simplify ls scripts for web server dirs navigation
  3. simplify DBI - I tested PDOOCI DBI (Eustáquio Rangel http://github.com/taq/pdooci) -works. I think PDOOCI is usefull becouse it is PDO code sintax layer on OCI8 DBI code layer. One day, when PHP PDO will no more be experimental PDOOCI will not be needed.Eustáquio made also PHPreports (also on Github)

April. 2015 Code refactored 2 :

  1. config file defines constants and contains config class with static variables (visible in all scripts, can be changed). This is last large refactoting.
  2. Added top menu - I suppose best and simplest.
  3. explanations in this page for now are not updated but code is in .rar at top of this page.
  4. Now this scripts are : OOP, SPA, MVC domain-style, PHP outside web doc root, (paths & URLs) set up with constants and static class variables.

Feb. 2015 Code refactored 1 - php outside web doc root:
Intro explanations for now not updated. Now this scripts are :
OOP, SPA, MVC domain-style, PHP outside web doc root.

10 scripts - It is not easy - same as yii2 requirements scripts. Both examples are excellent for learning PHP.

  1. Installing Apache, PHP, Oracle 11XE (all 64 bit)
  2. 11g XE on Win 8.1.1, both 64bit - APEX VERSION 4.2.5, Maj 24, 2014
  3. Zwamp server development ibrowser menu - all on Win 8.1.1, 64bi
  4. How to recognize mobile device - oop, spa, mvc domain-style, php outside web doc root

zwamp_taskbartray_iconzwamp<-- Z_WAMP right click menu - Right click on house icon first left in the bottom

\~~~
Page with blue Z: icon is output of view script view_3cols_list.php

http://zwamp.sourceforge.net/
http://sourceforge.net/projects/zwamp/files - operating system (32-bit/i386 or 64-bit/x86_64).


MVC scripts which create this home page (ee bits 1-4 on picture above)

SPA = Single Page web Application
DOMAIN STYLE CODE structure = app. (form) scripts are in ONE subdir (and its subdirs), and index.php, if needed, is in dir above this ONE application directory.

Eg - this DEVELOPMENT MAIN MENU SCRIPTS are in zwamp dir,
- Controller script: zwamp.php and all other .php, .css, .jpg... can be in same dir. (no subdirs becouse it is small app.).

ZWAMP has no such home page, I made it from WAMPs home page, with many changes :

  1. SPA was excellent
  2. DOMAIN STYLE CODE was not implemented - everything was in appl. root dir, I had problems showing pictures (eg $imgwrench = "background: ...)...
  3. MVC not clear I had work on it...

bit 1.Alati (tools), eg link instalirano

  1. view_3cols_list.php - View main body: lin.14:
    $fleview_instalir = str_replace('zwamp.php',
    'view_instalirano_20150106.html',$flezwamp);
    ...MENU BIT CODE lin. 36 :
    <a style="${imgwrench}" target="_blank" href="instalirano=1">
    instalirano/a>

    ...CODE AT THIS PAGE BOTTOM lin 144:
    $fleview_instalirano - Installed on my PC kod edit
    kod_edit_run($mdpath.$rel_apldir_adr, basename($fleview_instalir));

  2. zwamp.php - Controller: if (isset($_GET['instalirano'])) {include(
    $mdpath.$rel_apldir_adr.'/view_instalirano_20150106.html' ); exit()

Menu "2.Programi (projekti)" is list of dirs ($projectContents) not in array $projectsListIgnore

  1. zwamp_conf.php - Configuration
    1. is model script for dirs list (better not but this is simple example)
    2. and stores label "2.Programi (projekti" in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: dirs list model code in zwamp.conf:
    $projectContents = ''; if ($idmape = opendir($mdpath))
    { while (false !== ($mapa = readdir($idmape)))
    { //if ($mapa != "." && $mapa != "..")
    { if (is_dir($mdpath."/".$mapa) === true
    && !in_array($mapa,$projectsListIgnore) )
    { //echo "DIRECTORY: ".$mapa.'
    ';
    $projectContents .= '

  2. '
    .'<a style="'.$imgdirgo.'" target="_blank" href="'
    .( $suppress_localhost 'http://dev:8083/inc/fw/' : '' )
    .$mapa.'">'.$mapa .'' .'
  3. '; } else {
    //echo "FILE: ".$mapa.'
    '; } } closedir($idmape); }
    if (empty($projectContents)) $projectContents =
    "
  4. ".$txtlang[$jezik]['txtNoProjet']."
  5. \n";

  6. view_3cols_list.php - View main displays array $projectContents :

      ${projectContents}

Menu "3.Aliasi i virt.hostovi" is list of files ($aliasContents)

  1. zwamp_conf.php - Configuration (Aliases are .conf files in dir "alias" below Z:.)
    1. is model script for files list (better not but this is simple example)
    2. and stores label "3.Aliasi i virt.hostovi" in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: files list model code in zwamp.conf: $aliasContents = '';
    // ucitavanje liste (récupération) alias-a
    if ($idmape = opendir($aliasDir))
    {
    while (false !== ($konfig_file = readdir($idmape)))
    { if (!is_dir($aliasDir.$konfig_file)
    && strstr($konfig_file, '.conf'))
    { //echo "DIRECTORY: ".$konfig_file.'
    ';
    $alias_ime = str_replace('.conf','',$konfig_file);
    $urlbit = $alias_ime;
    if ($alias_ime == 'dev') { // http://dev/
    // apache sada nece dodati localhost/ ispred dev :
    $urlbit = 'http://'.$alias\_ime ;
    $alias_ime = $alias_ime . ' (vhost)';
    } else // svi ostali aliasi su kao adminer ispod .sys :
    { // /.sys/adminer tj http://localhost/adminer/
    $urlbit = 'http://dev/'.$alias\_ime ;
    } ;
    $aliasContents .=
    '

  2. '.'<a style="'.$imgdir.'"'
    . ' href="'.$urlbit.'">'.$alias_ime.''.'
  3. ';
    }
    }
    closedir($idmape);
    } else {
    //echo "FILE: ".$konfig_file.'
    ';
    }

    if (empty($aliasContents))
    $aliasContents = "

  4. " . $txtlang[$jezik]['txtNoAlias']."
  5. \n";
    else $aliasContents = 'Aliasi su .conf u mapi "alias" ispod Z:.'
    .'
    '.'Služe za aplik. u mapi "apps" ispod Z:.'
    .$aliasContents;

  6. view_3cols_list.php - View main displays array $aliasContents :

      ${aliasContents}

List "4.Server configuration" is list of PHP extensions ($loaded_extensions)

  1. zwamp_conf.php - Configuration
    1. is model script PHP extensions (better not but this is simple example)
    2. and stores label "3.Aliasi i virt.hostovi" in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: PHP exstensions list model code in zwamp.conf: $phpExtContents = '';
    // read liste des PHP extensions
    $loaded_extensions = get_loaded_extensions();
    // [modif oto] classement alphabétique des extensions
    setlocale(LC_ALL,"{$txtlang[$jezik]['locale']}");
    sort($loaded_extensions,SORT_LOCALE_STRING);
    foreach ($loaded_extensions as $extension)
    $phpExtContents .=
    "<li style=\"${imgplugin};\">${extension}

  2. ;

    view_3cols_list.php - View main displays array $phpExtContents :

      ${phpExtContents}

II. Notepad Replacer - handy for taskbartrayicon-rightclickmenu, but Notepad++ workspaces, projects and sessions are enough.

http://www.binaryfortress.com/NotepadReplacer/Discussions/View/wont-install-properly-on-win2008-sp2-x64/ID=04b032d7-ba27-49cf-b6cd-5057ec4a7b8e
Replace Microsoft Notepad with Notepad++ (windows 8) :

Regedit node created with NotepadReplacerSetup-1.1.6.exe :

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe.

string (REG_SZ) name "Debugger"
value "C:\Program Files (x86)\Notepad Replacer\NotepadReplacer.exe" /z --BEZ " i BEZ /z

which opens J:\aplp\aplp\3_edit\3_Notepad++\notepad++.exe

III. SCRIPTS CODE (REFACTORED Feb, 2015)

  1. ****C:\Windows\system32\drivers\etc\hosts



    127.0.0.1 localhost
    ::1 localhost
    127.0.0.1 dev
    ::1 dev

  2. J:\zwamp\vdrive\.sys\Apache2\conf\httpd.conf

    or Z:\.sys\Apache2\conf\httpd.conf

  3. J:\zwamp\vdrive\.sys\Apache2\conf\vhosts.conf

    or Z:\.sys\Apache2\conf\vhosts.conf

    # ZWAMP does: (subst Z: "J:\zwamp\vdrive")

    # http://dev:8083/
    <VirtualHost *:8083>
    Options All

    Options +Includes +FollowSymLinks +Indexes +MultiViews

    +ExecCGI

    DocumentRoot "J:\dev_web\htdocs"
    ServerName dev
    # http://yii:8083/ - not available when listening port 8083 !
    <VirtualHost *:8083>
    DocumentRoot "J:\dev_web\htdocs\aplyii\frontend\web"
    ServerName yii

    # ---------------------------------
    # http://localhost:8083/
    <VirtualHost *:8083>
    DocumentRoot "J:\zwamp\vdrive\web"
    ServerName localhost

  4. J:\zwamp\vdrive\.sys\php\php.ini

    -----

  5. J:\dev_web\htdocs\index.php

    (if needed). Includes zwamp scripts - which all are outside Apache doc.root J:\dev_web\htdocs (http://dev:8083/):**require**(realpath($\_SERVER\['DOCUMENT\_ROOT'\].'/../inc/zwamp/zwamp.php')) ;
    exit;

  6. J:\dev_web\inc\zwamp\zwamp.php

    - Controller outside Apache doc.root (was : J:\dev_web\htdocs\01programi\zwamp\zwamp.php)
    ....
    ************************************************************
    // 3. SHOW VIEW BITS - ee THIS SPA WEB PAGE - Single Page App.
    // ************************************************************
    echo <<< EOPG
    $pghdr
    $view_3cols_list



    $view_nppreplacer
    $view_zwamp
    $view_hosts_apachephpconf



    $view_mongodb
    $view_f3fw
    $view_phpreports
    EOPG;/**
    * http://dev:8083/ = Apache virt.host
    * or zwamp docroot: http://localhost/
    * J:\dev_web\inc\zwamp\zwamp.php
    * or J:\zwamp\vdrive\web\index.php
    *~~~~~~~~~~~~~~
    * ~ C O N T R O L L E R ~
    * SPA web page (Single Page App.) - no url calls
    * DOMAIN STYLE code organization - every app (page, oracle form form) own subdir
    *~~~~~~~~~~~~~~
    *~~~~~~~~~~~~~~
    *SHOWS VIEWS: main menu (1,2,3):
    * 1.Alati (tools & help)
    * 2.Programs (projects, dirs)
    * 3.Aliases & virt.hosts
    * 4.List below (php extensions)
    * ... some help texts
    * No DBI - CRUD scripts (could be sqlite for langs).
    * - No page params of p o s t type - no forms
    *~~~~~~~~~~~~~~
    *
    ****************************************************
    * 1. PAGE PARAMS OF G E T TYPE (ACTION COMMANDS)
    ****************************************************
    * 1.1 Display image code (from zwamp_mdl.php)
    * 1.2 Language icons in page hdr top right
    * 1.3a PAGE NAVIGATION: PATH C A L L - I N C L U D E
    * 1.3b URL C A L L - Location ()
    *
    * No page params of p o s t type - no forms - no DBI
    * ********************************************************
    * 2. INCLUDE VIEW BITS - LOAD THEM IN CONTENT VARIJABLES
    * ********************************************************
    *
    * ********************************************************
    * 3. SHOW VIEW BITS - ee THIS SPA WEB PAGE - Single Page App.
    * ********************************************************
    *

  7. J:\dev_web\inc\zwamp\zwamp_mdl.php

    - Configuration, set up, data (img code !)
    -----

  8. J:\dev_web\inc\zwamp\zwamp_hdr.php

    - View main hdr

  9. J:\dev_web\inc\zwamp\view_3cols_list.php

    - View main body

  10. J:\dev_web\inc\zwamp\view_zwamp.php

    - View zwamp and simmilar view code bits

  11. Helpers - utils
    J:\dev_web\htdocs\inc\utl\showsource.php

    & phpinfo & edservertxt.php &

    <php
    // J:\dev_web\inc\utl\kod_edit_run.php
    function kod_edit_run($script_dir_path, $script_name, $web_docroot_url)
    {
    $ds = DIRECTORY_SEPARATOR;
    echo <<< EOKOD
     kod

     edit

     phpinfo
    EOKOD;
    /* call it so:
    kod_edit_run(
    $idx // script_dir_path
    , $idxscript // script_name
    , MDURL); // web_docroot_url = (Apache) web server URL
    */
    }


Comments

Share your thoughts about this post
Real life site code examples.

1. Teme (posts categories filter)

ALL    111     B12phpfw     Fitness     Movies     News     Politics     Science     Sports     Technology     World    

2. Recent posts (date filter)

Politics    
B12phpfw    
001. Menu_CRUD.txt

2019-10-18 15:10:29


Technology    
HTML5_CSS3.txt

2019-10-12 12:20:29


B12phpfw    
altervista013.txt

2019-03-16 12:20:29


B12phpfw    
altervista012.txt

2019-02-24 12:20:29


B12phpfw    
altervista011.txt

2018-05-29 08:20:29


B12phpfw    
altervista001c.txt

2017-09-27 12:20:29


B12phpfw    
altervista001b.txt

2017-09-13 12:20:29


B12phpfw    
altervista002a.txt

2017-05-27 12:20:29


B12phpfw    
altervista001a.txt

2016-10-26 12:20:29



      _.-'''''-._
    .'  _     _  '.
   /   (o)   (o)   \
  |        ©        |
  | Slavko Srakočić |
   \  '. Zagreb.'  /
    '.  ''---''  .'
      '-._____.-' 
    
/srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog/home_side_area.php

PHP_OS=Linux, php_uname()=Linux f21.runhosting.com 4.9.262kvmcap #1 SMP Mon Mar 22 12:49:19 UTC 2021 x86_64
$_SERVER['DOCUMENT_ROOT']=/home/www/phporacle.eu5.net
$_SERVER['REQUEST_URI']=/fwphp/glomodul/blog/?i/read_post/id/34
$_SERVER['QUERY_STRING']=i/read_post/id/34
$_SERVER['HTTP_HOST']=phporacle.eu5.net
~~~~~~~~~/srv/disk16/3266814/www/phporacle.eu5.net/zinc/ftr.php() , line 78 SAYS:
OS web server doc root $this->p p 1->wsroot_path=/srv/disk16/3266814/www/phporacle.eu5.net/
Same web server doc root as URL $this->p p1->wsroot_url=http://phporacle.eu5.net/
Module property pallete like in Oracle Forms :
$this->p p 1
=stdClass Object ( [dbg] => 1 [stack_trace] => Array ( [0] => Array ( [0] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog/index.php, lin=18 ) ) [module_towsroot] => ../../../ [module_version] => 6.0.4.0 Msg [vendor_namesp_prefix] => B12phpfw [module_path_arr] => Array ( [0] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog/ [1] => /srv/disk16/3266814/www/phporacle.eu5.net/zinc/ [2] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/user/ [3] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/post_category/ [4] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/post/ [5] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/post_comment/ ) [uriq] => stdClass Object ( [i] => read_post [id] => 34 ) [F O R $_S E S ARR. (D B S H E M A...)] => ~~~~~~~~~~~~~~~~~ [cncts] => stdClass Object ( ) [states] => stdClass Object ( ) [A D R E S S E S in Config_allsites.php] => ~~~~~~~~~~~~~~~~ [wsroot_path] => /srv/disk16/3266814/www/phporacle.eu5.net/ [wsroot_url] => http://phporacle.eu5.net/ [imgrel_path] => zinc/img/ [module_path] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog/ [uri_arr] => Array ( [0] => /fwphp/glomodul/blog/ [1] => i/read_post/id/34 ) [module_relpath] => fwphp/glomodul/blog [module_url] => http://phporacle.eu5.net/fwphp/glomodul/blog/ [uri_qrystring_arr] => Array ( [0] => i [1] => read_post [2] => id [3] => 34 ) [ROUTES (LINKS) IN M O D U L E CTR Home_ctr.php] => ~~~~~~~~~~~~~~~~~ [PP1_ MODULE] => ~~~~~in view script eg href = $pp1->login~~~~~ [loginfrm] => ?i/loginfrm/ [login] => ?i/login/ [logout] => ?i/logout/r/i|loginfrm| [del_row] => ?i/del_row_do/ [filter_page] => ?p/ [dashboard] => ?i/dashboard/ [admins] => ?i/admins/ [read_user] => ?i/read_user/ [upd_user_loggedin] => ?i/upd_user_loggedin/ [categories] => ?i/categories/ [posts] => ?i/posts/ [filter_postcateg] => ?i/filter_postcateg/c/ [addnewpost] => ?i/addnewpost/ [read_post] => ?i/read_post/ [editpost] => ?i/editpost/ [edmkdpost] => ?i/edmkdpost/ [readmkdpost] => ?i/readmkdpost/ [comments] => ?i/comments/ [upd_comment_stat] => ?i/upd_comment_stat/ [kalendar] => ?i/kalendar/ [about_us] => ?i/about/ [contact_us] => ?i/contact/ [features] => ?i/features/ ) $_ GET=Array ( [i/read_post/id/34] => ) $_POST=Array ( ) $_SESSION=Array ( )