When I attempted to install TinyPortal 1.0 RC2 on an SMF 2.0 Gold forum, the installation process showed one of the six installation tests for
./Sources/Subs.php
failing. The
one that failed was the following:
Code: (Find)
'calendar' => array(
Code: (Add Before)
'tpadmin' => array(
'title' => 'TinyPortal',
'href' => $scripturl . '?action=tpadmin',
'show' => TPcheckAdminAreas(),
'sub_buttons' => array(
),
),
'calendar' => array(
When I edited ./Sources/Subs.php
, I
saw the searched for code was in the file. When I used a
hexadecimal editor
to examine the file, I saw the following in Sources/Subs.php
:
) , LF TAB ' c a l e n d a r ' = > a r r a y ( LF LF TAB TAB TAB TAB '
29 2C 0A 09 27 63 61 6C 65 6E 64 61 72 27 20 3D 3E 20 61 72 72 61 79 28 0A 0A 09 09 09 09 27
Note: hex 09 represents the "tab" character
I looked at the package-info.xml
file that was inside
the zip file for installing TinyPortal, I found that the installation
process uses the SMF2/tinyportal200.mod
file to determine
what files to change during the installation. Note: when you start
the installation process with the SMF Package Manager, when you get
to the point where the installation process tells you whether installation
tests have failed or succeeded, you can find the extracted files from
the zip file you are installing in Packages/temp
. The temp
directory and its files will be deleted after the installion is completed.
That file instructs the installation process to look for the following:
00000FB0 3C 73 65 61 72 63 68 20 66 6F 72 3E 0D 0A 09 09 <search for>....
00000FC0 09 27 63 61 6C 65 6E 64 61 72 27 20 3D 3E 20 61 .'calendar' => a
00000FD0 72 72 61 79 28 0D 0A 3C 2F 73 65 61 72 63 68 20 rray(..</search
I.e., the installation process looks for a CR, LF, then 3 tab characters
then 'calendar' => array(
. After the "(", the installation
process looks for a carriage return (CR), represented by hex 0D, character
followed by a new line, aka line feed (LF) character represented by hexadecimal 0A -
see ASCII Table and Description.
represented by hexadecimal 0A.
The system on which I was installing TinyPortal was a Linux system. Linux, Mac OS X, and Microsoft Windows systems use different conventions for marking the end of a line - see OS X Line Endings for a discussion of the differences.
So the TinyPortal developers appear to be expecting the software to be
installed on a Windows system or did their development on a Windows system. Thus
the presence of the CRL LF in the
. But, the code actually present in the SMF2/tinyportal200.mod
Subs.php
file was
what one normally finds for line endings on a Linux system, i.e., a LF
character, though actually two LF characters, one after the other in this case.
Looking at previously installed packages on the system, I saw that
one, Tagging
System for Topics 2.4.2 had modified Subs.php
. I could see by
going to the
webpage for the module on the SMF site and clicking on the
Parse button with 2.0
selected for Manual Install
Instructions for SMF that code near the 'calendar' => array
line had been modified.
'calendar' => array(
Replace With: [Select]
'tags' => array( 'title' => $txt['smftags_menu'], 'href' => $scripturl . '?action=tags', 'show' => true, 'sub_buttons' => array( ), ), 'calendar' => array(
I thought I might uninstall it to see whether TinyPortal would install without error, but when I tried uninstalling it, I saw errors for other files for the uninstall tests. I saw errors for the following files:
./Sources/ManagePermissions.php
./Sources/Display.php
./Sources/Admin.php
The installation of other packages must have modified code the uninstall process for Tagging System For Topics was expecting to find. So I didn't uninstall it.
Instead, I dealt with the problem by editing Subs.php
with
the
Freeware Hex Editor XVI32. I transferred the file to a Windows system
and edited it there adding the extra tabs and making the file match what
the installation process expected using XVI32, then transferred the file
back to the Linux system. When I then retried the install, I didn't see
any error messages.
References:
-
TinyPortal
SMF Customization - Simple Marchines - TinyPortal Support - Developer's site
- ASCII Table and Description
-
OS X Line Endings
Date: March 2, 2010
MoonPoint Support