Page 1 of 1

Component Installer Help

Posted: Mon Sep 24, 2007 9:32 pm
by brandontlyon
I have a working component and decided to make an installer to distribute the component... so I used other components as guides to do this.  The _VALID_MOS check is spewing errors on the install.component.php.  Everything above line 20 (sans

Code: Select all


19:// no direct access
20:defined( '_VALID_MOS' ) or die( 'Restricted access' );
21:
22:function com_install() {




Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /mypath/install.mycomponent.php on line 20


Re: Component Installer Help

Posted: Tue Sep 25, 2007 10:20 pm
by ianmac
well, if you are developing for 1.0 (as it appears since you are using _VALID_MOS), you should have instead:
defined( _VALID_MOS ) or die( 'Restricted access' );

(notice the lack of quotes - PHP is expecting here a constant not a string)

In 1.5, it should be _JEXEC instead of _VALID_MOS.

Ian

Re: Component Installer Help

Posted: Wed Sep 26, 2007 3:18 am
by brandontlyon
ugh, always something obvious  :P
thanks