Results 1 to 6 of 6

Threaded View

  1. #3
    Join Date
    May 2016
    Location
    St. John's NL Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: How to override define_paths.php?

    Quote Originally Posted by DrByte View Post
    I think you misread those comments ... they were talking about going from v155 to v155a ... not from v154.
    .../docs/whatsnew_1.5.5.html (as included in 1.5.5a) says:
    Upgrade Instructions

    This document only mentions the actual changes specific to v1.5.5 since v1.5.4.
    From v1.5.4

    Simple: if you are using v1.5.4 already and have not customized any of the files listed in the changed_files-v1-5-5.html document, then simply replace those files with the new files as listed.

    If you HAVE customized or altered certain files, simply re-do your customizations in the new version of those particular files by making the same changes needed.

    If you are using Addons/Plugins that have made alterations to those files, it is best to compare those changed files against the original Zen Cart files for the version those plugins were built for, and see what changes were there ... and then re-build those changes in the v1.5.5 file.

    To v1.5.5 from v1.5.3 or older

    If you are upgrading from a version OLDER than v1.5.4, then please do a standard site upgrade. Be sure to review all the links in this article, including tips on staging the upgrade in a separate directory/folder.
    I don’t think it unreasonable to think that last line implies that upgrading from 1.5.4 to 1.5.5 (or 1.5.5a) only requires changes to the file system

    Quote Originally Posted by DrByte View Post
    What EXACTLY have you changed in that file?

    The system FIRST loads configure.php and THEN loads defined_paths.php .... so whatever you defined in configure.php takes precedence. And then defined_paths.php simply takes care of defining whatever else is needed by the system.

    You should NOT need to touch defined_paths.php at all.
    It is not so much changing as extending — the extensive customization means there are a small number of additional directories containing such things as “sample” files (extracts from e-books that customers can preview before committing to purchasing actual e-books) and so on.

    Quote Originally Posted by DrByte View Post
    No, not really. If it were done that way then none of the cascading effect I just described above would work at all. It's that way for this specific reason.
    A define(), as you know, is PHP’s way of letting programmers create their own constants; since they are constants, they cannot be redefined. The way I read the code and the documentation/announcements, was that configure.php sets the very top-level (basic site) constants to allow code to access the file system and database and defined_paths.php then builds on the top-level constants to define some additional constants. So, when the catalog location is known, one can create constants that give the location of sub-directories of the catalog and, crucially, those defines (in defined_paths.php) will not need to be changed if one moves the store's catalog to a different location (e.g. a differently named subdirectory of the web-root or to a different hosting server).

    So, based on this view of the architecture, defined_paths.php is not over-ridden by configure.php; defined_paths.php simply extends the former. Since we are talking “constants”, those defines should only be done in one place and should only be executed once. if (!defined()) is simply defensive programming to protect against errors (such as uploading an old version of defined_paths.php). It also, I am sure not coincidentally, means that running 1.5.5, having only uploaded changed files (which exludes configure.php) means it will run and can trap that the install script has not been run.

    So, I'm back to my original premise: either all the defines in
    Code:
    defined_paths.php
    have been executed, or none of them have.
    Last edited by JRGoold; 25 May 2016 at 04:20 PM. Reason: Bad highlighting of file names.

 

 

Similar Threads

  1. How to override breadcrumb.php?
    By ultimate_zc in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Apr 2012, 07:24 AM
  2. How to override header_php.php or how to add a new field to order confirmation email
    By monkeytown in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 25 Jan 2008, 06:01 PM
  3. How to override tpl_account_default.php?
    By mrtorrez in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Jan 2007, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg