Miva Script

MivaScript

Miva Script is the server side scripting language of the Miva Merchant shopping cart, but it's uses go much further. It is especially well suited for web development having built in support for MySQL, MivaSQL and xBase3 databases.

A typical Miva Script application combines HTML tags, Miva Script tags and functions; is compiled and uploaded to a web server running the FREE Miva Merchant Empresa. You can also run your scripts on your local computer by running the FREE Miva Merchant Mia, making it very easy to start learning Miva Script right away. Oh and did we mention the Miva Script Compiler is also FREE.

Miva Script tags and functions correspond to typical programming language constructs. The database, mail, commerce and new graphics functionality provide a rich set of tools for application development.

Miva Script is fast. Because it is efficiently coded and compiled, your server side scripts will execute quicker and your web pages will display faster providing your users with a better experience.

Start learning Miva Script now!   Online Module Builder for Miva Merchant

Examples in Each Chapter

Each chapter contains examples that you can copy, paste and compile as you learn Miva Script.

Example

<html>
<body>
<b><MvEVAL EXPR="{ 'This is my first Miva Script' }"></b><br />
</body>
</html>

Whats New

5.34 Major Changes

  • The following libraries are now dynamically loaded and need to be registered as system libraries:
    • MySQL: A system library with code "MYSQLCLIENT" must be registered and point to the location of the MySQL client library
    • E.g. <SYSTEM-LIB CODE="MYSQLCLIENT" LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib">>
    • PostgreSQL: A system library with code "PQ" must be registered and point to the location of the PostgreSQL library
    • E.g. <SYSTEM-LIB CODE="PQ" LIBRARY="/usr/lib/libpq.dylib">
    • bzip2: A system library with code "BZ2" must be registered and point to the location of the bzip2 library
    • E.g. <SYSTEM-LIB CODE="BZ2" LIBRARY="/usr/lib/libbz2.dylib">
  • Added support for routing TCP requests through a SOCKS proxy server.
  • Added support for OpenSSL 1.1.x.
  • Added the ability to log slow requests to the system log via the MvCONFIG_SLOWREQUEST_SYSLOG configuration settings
  • Tag error messages such as g.MvOPENVIEW_Error, g.MvCALL_Error, and g.MvDO_Error no longer contain entity encoded values. The MivaScript developer is now responsible for encoding any and all necessary values before outputting the data.
  • The FastCGI application now loads the MvCONFIG_LIBRARY environment variable from its own environment. This requires the environment variable to be set prior to the FastCGI process being spawned.
  • The FastCGI application now uses the SCRIPT_NAME environment variable instead of the PATH_INFO environment variable when parsing and executing the desired file path.

Spring 2018 Site updated to 5.32. Added Redis: Redis allows building advanced caching mechanisms into Miva Script applications.

8/8/2017 Site updated to 5.26, 5.27 and 5.28. The MvCall Page has better descriptions of the methods, links to more information and a few new examples.

9/19/2016, All function category assignments were re-evaluated and corrections made. A new category called Encoding was added below the String category and Inspection was moved below Strings. Also array and structure functions were removed from system and placed under the Array category.

Releases 5.23 and 5.24 continue adding functionality to the language. Releases 5.20 and 5.21 added to the Storemorph template compiler language. Releases 5.17 and 5.18 were the most significant updates in several years.  The list below is not comprehensive. See the release notes in Resources for more detail.

Most significant is the inclusion of the gd library graphic functions.

  • V 5.34
  • gethostbyname( hostname, ip var )
  • mysql_get_client_info()
  • redis_client_id( conn_id )
  • redis_connect_with_timeout( ip, port, timeout, conn_id var )
  • redis_connect_unix( path, conn_id var )
  • rsa_public_encrypt_oaep( rsa, plaintext, encrypted var )
  • rsa_private_decrypt_oaep( rsa, encrypted, plaintext var )
  • strcmp( left, right )
  • strcasecmp( left, right )
  • file_last_error()
  • V 5.33
  • miva_struct_member_callback( struct var, function, data var )
  • CustomCallback( struct var, member, data var )
  • V 5.32
  • file_set_time()
  • crypto_next_error()
  • crypto_clear_error()
  • crypto_evp_sign()
  • crypto_evp_verify()
  • evp_pkey_load_pubkey_x509()
  • crypto_last_error() updated.
  • trim(), ltrim(), rtrim() updated for arrays.
  • MvCALL: added content "application/json"
  • evp_pkey_load_mem() updated.
  • Redis: Added support for Redis
  • V 5.31
  • miva_joinstring()
  • miva_splitstring() fixed
    diagtool.mvc -- added MvCALL Test
  • V 5.30 Minor Fixes
  • V 5.29 Minor Fixes
  • V 5.28
  • evp_pkey_free()
  • min()
  • max()
  • file_overwrite()
  • MvCALL changes
  • miva_variable_type()
  • * MivaSQL Additions
    • SELECT COUNT( DISTINCT column )
    • UPDATE now support JOINs
    • DELETE now support JOINs
    • Added IFNULL function
    • Added RECNO virtual column
  • V 5.27
  • x509_load_mem()
  • x509_get_subject_name()
  • x509_get_issuer_name()
  • x509_get_extensions()
  • x509_digest()
  • x509_pubkey_digest()
  • crypto_evp_encrypt_auth()
  • pkcs7_load_mem()
  • pkcs7_get_certs()
  • pkcs7_get_signer_info()
  • pkcs7_verify()
  • pkcs7_free()
  • evp_pkey_load_mem()
  • evp_pkey_load_pubkey_mem()
  • evp_pkey_derive()
  • V 5.26 -- Fixed indexofl(), indexofli()
  • V 5.25 -- Minor fixes
  • V 5.24
  • miva_setprocessname()
  • miva_async_sleep()
  • miva_csv_encode()
  • miva_html_strip()
  • miva_cdata_encode()
  • file_touch()
  • miva_struct_merge_ref()
  • indexofl()
  • indexofli()
  • miva_array_filter()
  • miva_array_filter_ref()
  • miva_ieee754_normalize()
  • rsa_load_publickey_engine()
  • rsa_load_privatekey_engine()
  • crypto_rand_set_rand_engine()
  • MvASYNCHRONOUS new tag
  • MvCALL changes
  • MvINCLUDE changes
  • New API Functions
  • PostgreSQL connector available
  • FastCGI available
  • V 5.23
  • MacOS X Support
  • slugify()
  • miva_splitstring()
  • fssymlink()
  • sfsymlink()
  • New in StoreMorph
    &mvts:varname; slugify encoded
  • New API Functions
  • V 5.22 -- Minor fixes
  • V 5.21
  • encodejavascriptstring()
  • miva_json_decode()
  • miva_json_decode_last_error()
  • New in StoreMorph
    mvt:call
    mvt:callcontinue
    mvt:callstop
    mvt:do
    &mvtj:varname; json encoded
  • New API Functions
  • V 5.20
  • MvCALL uses HTTP/1.1
  • MivaSQL Added
    LENGTH() & BETWEEN
  • New in StoreMorph
    backslash in expressions
    mvt:foreachcontinue
    mvt:foreachstop
    mvt:whilecontinue
    mvt:whilestop
  • New API Functions
  • V 5.19 -- Minor fixes
  • V 5.18
  • diagtool.mvc executable -- debugging tool
  • new POST content type support
  • New in StoreMorph
    mvt:assign
    mvt:while
    mvt:eval
  • MvSMTP new parameters
  • MvASSEMBLY
  • crypto_hmac_md5()
  • miva_array_clear()
  • miva_array_delete()
  • miva_array_merge()
  • miva_array_copy()
  • miva_array_copy_ref()
  • miva_array_insert()
  • miva_array_insert_var()
  • miva_array_insert_ref()
  • miva_array_pop()
  • miva_array_pop_ref()
  • miva_array_shif()
  • miva_array_shift_ref()
  • miva_array_find()
  • miva_array_search()
  • miva_array_binarysearch()
  • V 5.17
  • New Operators. (++) and (--)
  • miva_sleep()
  • miva_hex_encode()
  • miva_hex_decode()
  • crypto_cipher_block_size()
  • crypto_cipher_key_length()
  • crypto_cipher_iv_length()
  • crypto_cipher_mode()
  • crypto_evp_encrypt()
  • crypto_evp_decrypt()
  • crypto_digest_block_size()
  • crypto_digest_size()
  • crypto_evp_digest()
  • crypto_evp_hmac()
  • crypto_xor()
  • crypto_pbkdf1()
  • crypto_pbkdf2()
  • rsa_generate_keypair_mem_cipher()
  • rsa_save_privatekey_mem_cipher()
  • V 5.16
  • mvcov executable -- script analysis tool
  • mvprof executable -- script profiling tool
  • V 5.15 -- Minor fixes
  • V 5.14 -- Major fixes
  • MvLOCALIZED
  • MvSMTP
  • MvFOR
  • MvCALL
  • MvDO
  • MvSMTP
  • MvDBCOMMAND
  • Multle Functions fixed
  • V 5.13
  • srandom( seed )
  • MvCall changes
  • V 5.12 -- Minor fixes
  • V 5.11 -- Minor fixes
    64 bit version available
  • V 5.10
  • substring_var()
  • len_var()
  • indexof()
  • indexofi()
  • file_read_bytes()
  • <MvFOREACH>
  • <MvFOR>
  • V 5.09
  • crypto_sha256()
  • crypto_hmac_sha256()
  • V 5.08
  • miva_openlog()
  • miva_closelog()
  • miva_setlogmask()
  • miva_writelog()
  • V 5.07
  • xml_parse_var()
  • xml_parse_set_colon_replacement()
  • miva_struct_members()
  • miva_array_sort()
  • miva_array_min()
  • miva_array_next()
  • miva_array_next()
  • miva_array_previous()
  • miva_template_compile_itemlist()
  • miva_template_compile_dump()

User Annotations:
Miva Merchant : mivascript at, pcinet d0t com
02/03/2011 16:12 p.m.
Users can comment and post examples of their scripts.
<b>Sample script: </b>