altervista003.txt

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

Edit post in op. system file altervista003.txt ⟩⟩
We cre/edit .txt here and del .txt in op.system. TODO: del .txt here).

Edit post data in database table row ⟩⟩


Post summary :

3. Zwamp server development ibrowser menu

Image :

Image description :

$tmp_imgpath=/srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/post/Uploads/safe_image.jpg
$tmp_imgurlrel=Uploads/safe_image.jpg

Post content :

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
    */
    }

TXT AFTER EACH POST : I have odd cosmic thoughts every day

Science is an enterprise that should be cherished as an activity of the free human mind...

Venus has a runaway greenhouse effect. ... we're twiddling knobs here on Earth without knowing the consequences of it. Mars once had running water. Something bad happened there as well.

Comments

Share your thoughts about this post

/srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/post/Posts.php


      

~~~$pp1->dbg=1~~~/srv/disk16/3266814/www/phporacle.eu5.net/vendor/b12phpfw/ftr.php() , line 119 SAYS:
Coding step c s 0 1. GLOBAL VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PHP_OS=Linux, php_uname()=Linux f21.runhosting.com 5.10.138kvmcap #1 SMP Fri Aug 26 07:32:35 UTC 2022 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
OS doc root adress is $this->p p 1->wsroot_ path=/srv/disk16/3266814/www/phporacle.eu5.net
Same web server doc root adress is $this->p p 1->wsroot_ url=http://phporacle.eu5.net/

Module property pallete like in Oracle Forms :
$this->p p 1
=stdClass Object ( [module_version] => Blog Msg MySQL 10.0.3.0 Feb. 2023 [dbg] => 1 [dbicls] => Db_allsites [stack_trace] => Array ( [0] => Array ( [0] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog/index.php, lin=31 ) [1] => /srv/disk16/3266814/www/phporacle.eu5.net/vendor/b12phpfw/Autoload.php, lin=25 (B12phpfw\core\b12phpfw\Autoload::__construct) ) [dir_apl] => glomodul [wsroot_path] => /srv/disk16/3266814/www/phporacle.eu5.net [shares_path] => /srv/disk16/3266814/www/phporacle.eu5.net/vendor/b12phpfw [site_path] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp [module_path] => /srv/disk16/3266814/www/phporacle.eu5.net/fwphp/glomodul/blog [shared_dbadapter_obj] => B12phpfw\core\b12phpfw\Db_allsites Object ( [errmsg:B12phpfw\core\b12phpfw\Db_allsites:private] => ) [rblk] => 10 [Home_ctr_obj] => B12phpfw\module\blog\Home_ctr Object ( [pp1:B12phpfw\core\b12phpfw\Config_allsites:private] => stdClass Object *RECURSION* ) [uriq] => stdClass Object ( [i] => read_post [id] => 34 [HELP_ROUTING_AND_URL_QUERY] => ~~~~~~~~~~~~~~~~~ properties = key-keyvalue pairs : LINKALIAS => ?i/HOME_METHOD_TO_CALL/param1/param1value... (? is QS=Query Separator) 1. LINKALIAS 2. URLurlqrystring 3. Router (Config_allsites) extracts (from 2.) IN VIEW SCRIPT IN Home_ ctr CALLED METHOD IN Home_ ctr ,'cre_row_frm' => QS.'i/cc/' METHOD cc or cre_row_frm or... ,'home_url' => QS.'i/home/' METHOD home : key="i", value="home" ,'ldd_category' => QS.'i/del_category/id/' id value we assign in view script after $ p p 1->ldd_category ,'loginfrm' => QS.'i/loginfrm/' METHOD loginfrm (or include script) ,'login' => QS.'i/login/' METHOD login ) [HELP_STATES_ATTRIBUTES] => F O R $_S E S ARR. (D B S H E M A...) ~~~~~~~~~~~~~~~~~ [cncts] => stdClass Object ( ) [states] => stdClass Object ( ) [HELP_PATHS_IN_UTL_CLS] => cs02. R O U T I N G - A D R E S S E S in Config_ allsites.php ~~~~~~~~~~~~~~~~ [wsroot_url] => http://phporacle.eu5.net/ [shares_url] => http://phporacle.eu5.net/vendor/b12phpfw/ [img_url] => http://phporacle.eu5.net/vendor/b12phpfw/img/ [lang] => en [uri_qrystring] => i/read_post/id/34 [uri_qrystring_arr] => Array ( [0] => i [1] => read_post [2] => id [3] => 34 ) [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/ [site_url] => http://phporacle.eu5.net/fwphp/ [LINK_ALIASES] => $ p p 1->LINK_ALIAS => HOME METHOD TO CALL ~~~~~ eg1: in view script href="<?=$pp1->home_blog?>" calls home method in Home_ctr so : QS."i/home_blog/"~~~~~ where QS is question mark ("?") = urlQuerySeprator [home_blog] => ?i/home/ [home] => ?i/home/ [sitehome] => ?i/sitehome/ [ldd_category] => ?i/del_category/id/ [ldd_admins] => ?i/del_admins/id/ [ldd_posts] => ?i/del_posts/id/ [ldd_comments] => ?i/del_comments/id/ [filter_page] => p/ [admins] => ?i/admins/ [loginfrm] => ?i/loginfrm/ [login] => ?i/login/ [logout] => ?i/logout/r/i|loginfrm| [read_user] => ?i/read_user/id/ [upd_user_loggedin] => ?i/upd_user_loggedin/r/i|upd_user_loggedin|id| [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 ( [SuccessMessage] => Array ( ) [ErrorMessage] => Array ( ) )

/srv/disk16/3266814/www/phporacle.eu5.net/vendor/b12phpfw/ftr.php() , line 150 SAYS:
Coding step c s 0 2. R O U T I N G ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$_SERVER['REQUEST_URI'] =/fwphp/glomodul/blog/?i/read_post/id/34

$p p1->uri_ arr is exploded string $_SERVER['REQUEST_URI'] (part1 before QS=? and part2 after QS)
part1 index 0 is $p p 1->module_ relpath=fwphp/glomodul/blog
part2 index 1 is $p p 1<>uri_ qrystring = key-value pairs ee = url parameters after QS = i/read_post/id/34
$this->p p1->uri_ arr=Array ( [0] => /fwphp/glomodul/blog/ [1] => i/read_post/id/34 )

EXPLODED $p p1->uri_ qrystring (on /) is $this->p p1->uri_ qrystring_ arr=Array ( [0] => i [1] => read_post [2] => id [3] => 34 )
method in Home_ ctr and method parameters : $p p 1->u r i q=stdClass Object ( [i] => read_post [id] => 34 [HELP_ROUTING_AND_URL_QUERY] => ~~~~~~~~~~~~~~~~~ properties = key-keyvalue pairs : LINKALIAS => ?i/HOME_METHOD_TO_CALL/param1/param1value... (? is QS=Query Separator) 1. LINKALIAS 2. URLurlqrystring 3. Router (Config_allsites) extracts (from 2.) IN VIEW SCRIPT IN Home_ ctr CALLED METHOD IN Home_ ctr ,'cre_row_frm' => QS.'i/cc/' METHOD cc or cre_row_frm or... ,'home_url' => QS.'i/home/' METHOD home : key="i", value="home" ,'ldd_category' => QS.'i/del_category/id/' id value we assign in view script after $ p p 1->ldd_category ,'loginfrm' => QS.'i/loginfrm/' METHOD loginfrm (or include script) ,'login' => QS.'i/login/' METHOD login )