Skip to content
Browse files

Add scriptfile

  • Loading branch information...
1 parent cf55da4 commit 455fd043d59a9d71c0e396386ca36e661038fb3d @mbabker committed
Showing with 48 additions and 1 deletion.
  1. +7 −1 build.xml
  2. +1 −0 language/1.7/en-GB/en-GB.mod_github.sys.ini
  3. +1 −0 mod_github.xml
  4. +39 −0 script.php
View
8 build.xml
@@ -4,7 +4,7 @@
<property file="./build.properties" />
<property name="repo.dir" value="." />
<resolvepath propertyName="repo.dir.resolved" file="${repo.dir}" />
- <property name="version" value="1.0.0" />
+ <property name="version" value="1.0.beta" />
<tstamp>
<format property="build.date" pattern="%Y-%m-%d" />
</tstamp>
@@ -83,6 +83,12 @@
</replacetokens>
</filterchain>
</copy>
+ <echo msg="Copy scriptfile" />
+ <copy
+ file="script.php"
+ tofile="packages/1.7/script.php"
+ overwrite="true">
+ </copy>
</target>
<target name="rebuild-packages" description="Delete old packages">
<echo msg="Deleting packages dir" />
View
1 language/1.7/en-GB/en-GB.mod_github.sys.ini
@@ -4,4 +4,5 @@
; Double quotes in the values have to be formatted as "_QQ_"
MOD_GITHUB="GitHub Commits Module"
+MOD_GITHUB_ERROR_INSTALL_J17="This module requires Joomla! 1.7 or newer"
MOD_GITHUB_XML_DESCRIPTION="The GitHub Commits module is a simple module to display the latest commits on GitHub for a specified repository."
View
1 mod_github.xml
@@ -9,6 +9,7 @@
<version>##VERSION##</version>
<license>GNU/GPL</license>
<description>MOD_GITHUB_XML_DESCRIPTION</description>
+ <scriptfile>script.php</scriptfile>
<files>
<folder>tmpl</folder>
<filename module="mod_github">mod_github.php</filename>
View
39 script.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * GitHub Module for Joomla!
+ *
+ * @package GitHubModule
+ *
+ * @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
+ * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * Installation class to perform additional changes during install/uninstall/update
+ *
+ * @package GitHubModule
+ * @since 1.0
+ */
+class Mod_GitHubInstallerScript
+{
+ /**
+ * Function to act prior to installation process begins
+ *
+ * @param string $type The action being performed
+ * @param string $parent The function calling this method
+ *
+ * @return mixed Boolean false on failure, void otherwise
+ *
+ * @since 1.0
+ */
+ function preflight($type, $parent)
+ {
+ // Requires Joomla! 1.7
+ $jversion = new JVersion;
+ if (version_compare($jversion->getShortVersion(), '1.7', 'lt'))
+ {
+ JError::raiseNotice(null, JText::_('MOD_GITHUB_ERROR_INSTALL_J17'));
+ return false;
+ }
+ }
+}

0 comments on commit 455fd04

Please sign in to comment.
Something went wrong with that request. Please try again.