Update to Link Vault Setup Software

Updated 9/13/05:

Link Vault Client Software Beta Test

Download lvSecurityCode.zip version 1.4.01-5122117.

Make backup copies of your XXXXXXXXX.txt data file and lvXXXXXXXXX.php files before installing this version. It changes the data file format so the backups will make switching back (if needed) to the old version much easier.

Follow these instructions at the top of the file:
// Change ##SecurityCode## to match the Link Vault security code for your server.
// Change ##SiteUrl## to match the "Site Url" you specified for this site in your Link Vault settings.
// Change ##lvFolder## to match the "Script Folder" you specified for this site in your Link Vault settings.
// If you haven't specified a Script Folder in the Link Vault settings, change it to ''.

Replace your existing lvXXXXXXXXX.php with this one.

Optionally create a file called lvXXXXXXXXXlog.txt with correct permissions in the same directory as your data file and errors will be written to the file regardless of test mode state. The file length is truncated to 25K when it reaches 50K in size.

To get it to reset your data file, you will have to access a web page twice. It should start displaying links on the third access.

Change Log:
Release 5122117

  • BUG: The php filesize() function is cached and doesn’t always return the actual file size. filesize() was being used to determine how many bytes to read from the VarFile. If other processes increased the filesize before this process got a file lock, the end of the VarFile was being truncated, causing a checksum error.
  • FIX: 102400 bytes are always added to the length reported by filesize() to ensure that the EOF is reached.
  1. Put newurl and newurlbatch actions back
  2. Added LINK_VAULT_DefaultMaxPages constant for installs with more than 5000 pages
  3. Put the php processing instruction end bracket back
  4. Added LINK_VAULT_Debug constant. Debug mode is on when defined, regardless of value.
  5. Added VarFileLock() and VarFileUnlock()
  6. Added VarFileRead() and VarFileWrite()- These verify the file is locked. All VarFile I/O uses these functions
  7. Added _VarReadConvertShortData() Remove redundant code in _VarReadAll & _VarReadShort
  8. Added _VarSaveShortDataWrite() Remove redundant code in _VarSaveAll & _VarSaveShort

Release 5091311

  1. Client errors are now only logged to the optional log file and returned to LV server requests. They are never displayed on a page load regardless of the Test Mode setting.
  2. php error_reporting() is set to 0 during the DisplayLinks() function.
  3. Added utf-8 logic provided by expat. Call DisplayLinksUtf8() instead of DisplayLinks() to detect and convert iso links to utf8.
  4. Removed some of the info displayed by the getinstallinfo action.
  5. FindFile() Fixed problem with fallback second search loop used when LINK_VAULT_Folder != ‘’
  6. Set ignore_user_abort() to true when writing to data file to prevent possible corruption issues.
  7. Changed log file size limit to 50K and truncates to 25kb.
  8. Removed the php end processing bracket (’?’ followed by ‘>’) at the end of this file to eliminate problems with blank lines following the bracket being introduced during installation.
  9. UrlFindKey() The url is now listed in the error log when invalid urls are found.
  10. $LINK_VAULT_Object is now unset upon completion of ServerLoop()
  11. Removed newurl and newurlbatch actions. They are no longer used by LV servers.

Release 5090510

  1. _parse_str() and UrlFindKey() were adjusted to differentiate between empty vars with and w/o an ‘=’. A query string of ?var1=&var2 was being reported as ?var1&var2
  2. Test Mode now defaults to off to eliminate error message signature.

Release 5090207

  1. VarFileTestId() - If a RESET_ME attempt fails, a delay is observed until the next attempt. This prevents LV servers from being overloaded with “resetsite” requests. An error message is now displayed to indicate that this delay was being observed. Previously, VarFileTestId() failed without explaination in this case.

Release 5090117

  1. LINK_VAULT_ShutdownResetMe() - Now correctly recognizes LINK_VAULT_Folder.

Release 5083114

  1. An empty string and ‘Site Requires Activation’ are now a valid replies from the LV server for givemealllinks, givemeallplacements and givemeallurls. This fixes a problem with freshly added sites.
  2. Made an attempt at friendlier error messages in VarFileTestId()

Release 5082915

  1. The RESET_ME process, used when the varfile is corrupt or when updating from an old data file version, has been redesigned.
    • VarFileTestId() now uses register_shutdown_function() to start a separate lv*.php process to perform the site reset
    • LINK_VAULT_SiteUrl contains the domain used to access lv*.php and is used by the shutdown function.
    • The time is saved with the RESET_ME tag when a reset is initiated.
    • $this->InitiateResetDelay seconds must pass after a failed RESET_ME attempt before trying again.
    • TestMode defaults to off after the RESET_ME process.
  2. ActionGetInstallInfo() displays several new parameters.
  3. ServerLoop() - Added ignore_user_abort() and now attempt to set max_execution_time to 900.
  4. Removed LastResetInitiated from VarFile (Now stored with RESET_ME tag)
  5. Changed var name $isResetWanted to $isResetTagWanted

Release 5071810

  1. Varfile now stays locked between time when the ‘RESETME’ tag is discovered and the VarFile reset is complete
  2. Added UrlKey validity checks. Excluding the quotes: UrlKey must start with “/”, must not contain “//”,”/../”,”/./”,”#” and must not end with “?”,”/.”

Release 5062022

  1. Changed InitiateResetDelay from 15 minutes to 5 minutes
  2. Changed ShortDelayNormal from 1 minute to 5 minutes
  3. MaxPages and TestMode can be set with a query string variable when calling the following actions: getnewurls, newurl, newurlbatch, resetsite, settestmode

Release 5061807

  1. Url count wasn’t getting updated properly in ActionNewUrl() and ActionNewUrlBatch() - fixed.
  2. Made allowances for magic_quotes_gpc and magic_quotes_runtime.

Release 5061613

  1. Added detection of failed connection to LV servers when using fsockopen().
  2. Added ‘getinstallinfo’ action to display basic diagnostic information about the client software installation.
  3. Place the error log file in the same directory as your data file. lv*.php now uses the same logic to search for the data file and log file.
  4. The error log file is now truncated to 15Kbytes when it reaches a size of 30Kbytes.

Release 5061422

  1. The version & release numbers are now included with every request to LV servers.
  2. More updates to query string handling.

Release 5061314

  1. Fix bug involving query strings in UrlKey

Release 5061307

  1. Added a check for a valid HTTP status code int the reply from the LV server when using fsockopen() in HttpOpen()
  2. fixed bug that prevented ActionGiveMeAllNewUrls() from being called
  3. New urls are now removed from $this->UrlListNew when the LV server returns them instead of when they are sent to LV
  4. Added sanity checks for data recieved from LV for some of the givemeall* requests.

Release 5061220

  1. Bug fix regarding urls with query strings.

Release 5061122

  1. New file format allows faster short data reads and writes. The entire data file is read/written only if necessary.
  2. Session Id is stripped from urls instead of refusing the url completely.
  3. Url fragments (after a #) are stripped from urls.
  4. Diagnostic error messages are display on screen if test mode is on. No errors are displayed with test mode off
  5. Create a file called lvXXXXXXXXXlog.txt with correct permissions in the default directory and errors will be written to the file regardless of test mode state. The file length is randomly truncated to 20k.
  6. Automatically does a resetsite action if corrupt data is detected. This is done in two page loads: #1 write ‘RESET_ME’ over beginning of file. #2 if ‘RESET_ME’ is found at the beginning of the file, a resetsite action is performed. This insures that the file is truely writable before data is requested from LV servers.
  7. Supports a ‘newurlbatch’ action when implimented by LV servers. Instead of getting one url at a time from LV servers, several new urls can be downloaded in a single batch.
  8. getscriptversion action now returns the release number if ‘release’ is set in the query string

3 Responses to “Update to Link Vault Setup Software”

  1. Sarah Says:

    Thanks, much appreciated!

  2. Von Says:

    Is there an easier way to set up link vault ? Is it possible to copy & paste source code into my web pages html? I am having a difficult time. Any suggestions would be appreciated. Thanks.

  3. MikeMajorowicz Says:

    There’s no way to get by without installing the LV client software.

    If your having problems, Link Vault forum http://forum.link-vault.com/ is an excellent place to get help.