https://wiki.mahara.org/api.php?action=feedcontributions&user=Brki&feedformat=atomMahara Wiki - User contributions [en-gb]2024-03-29T09:25:56ZUser contributionsMediaWiki 1.35.10https://wiki.mahara.org/index.php?title=BasicPHPFileTemplates&diff=2264BasicPHPFileTemplates2011-08-04T12:57:24Z<p>Brki: removed reference to non-existant /examples, removed require('init.php) for non-hittable files</p>
<hr />
<div>These are the templates for all new PHP files. There is a different template depending on whether you file is able to be publicly hittable or not.<br />
<br />
This project uses PHPDoc for API documentation. This project is also licensed under the GPL, which causes some header bloat (it is a requirement of licensing your program under the GPL, see [http://www.gnu.org/copyleft/gpl.html <span style="white-space: nowrap">http://www.gnu.org/copyleft/gpl.html</span>] ).<br />
<br />
<div id="section_1"><br />
<br />
===Template for files you expect to be hit by visitors===<br />
<br />
.<br />
*<br />
* @package mahara<br />
* @subpackage core<br />
* @author Firstname Lastname<br />
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL<br />
* @copyright (C) 2010 Firstname Lastname<br />
*<br />
*/<br />
<br />
define('INTERNAL', 1);<br />
require('init.php');<br />
<br />
// Your code here :)<br />
<br />
<br />
</div><div id="section_2"><br />
<br />
===Template for files you do NOT want to be hit by visitors===<br />
<br />
.<br />
*<br />
* @package mahara<br />
* @subpackage core or plugintype/pluginname<br />
* @author Firstname Lastname<br />
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL<br />
* @copyright (C) 2010 Firstname Lastname<br />
*<br />
*/<br />
<br />
defined('INTERNAL') || die();<br />
<br />
// Your code here :)<br />
<br />
<br />
'''Notes:'''<br />
<br />
* Omit the closing php tag "?&gt;"<br />
* Catalyst employees should assign copyright to "Catalyst IT Ltd [http://catalyst.net.nz/ <span style="white-space: nowrap">http://catalyst.net.nz</span>]", if they are working on the project in company time.<br />
<br />
</div></div>Brki