<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Setting up a Repository</title><link>https://sourceforge.net/p/rapidhook/wiki/Setting%2520up%2520a%2520Repository/</link><description>Recent changes to Setting up a Repository</description><atom:link href="https://sourceforge.net/p/rapidhook/wiki/Setting%20up%20a%20Repository/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 10 May 2015 04:50:54 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/rapidhook/wiki/Setting%20up%20a%20Repository/feed" rel="self" type="application/rss+xml"/><item><title>Setting up a Repository modified by BioNetWorksCorp</title><link>https://sourceforge.net/p/rapidhook/wiki/Setting%2520up%2520a%2520Repository/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;You only need &lt;strong&gt;two files&lt;/strong&gt; to set up a repository on a server, and &lt;strong&gt;only one&lt;/strong&gt; if you don't want users to be able to add files to the repository.&lt;/p&gt;
&lt;h2 id="the-main-repository-file"&gt;The Main Repository File&lt;/h2&gt;
&lt;p&gt;This file can have just about any file extension, as long as it is text-readable (i.e. can be opened in notepad). The way you share access to this repository is sharing the link location to the file with others, who can then set the repository as their default in their clients. However, users cannot add to this file, they will only be allowed to download from it, which is where the second file comes in.&lt;/p&gt;
&lt;h2 id="repository-file-format"&gt;Repository File Format&lt;/h2&gt;
&lt;p&gt;The Repository File is basically a list of file locations and their names that the client can access them from. The format is as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;FILENAME|FILELOCATION
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;"FILENAME" must not have any spaces in it. So an example would be:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;firefox|http://www.mozilla.org/firefoxinstaller.exe
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A user connected to this repository could then get this file by entering "get firefox".&lt;/p&gt;
&lt;h2 id="allowing-users-to-add-files-to-the-repository"&gt;Allowing users to Add Files to the Repository&lt;/h2&gt;
&lt;p&gt;This file must be named &lt;strong&gt;repoadd.php&lt;/strong&gt; or else the client will not be able to access it. It must also be in the same location as the repository file. You do not need to share the link to this file, the client only needs the Repository File location. In the repoadd.php file add the following:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nv"&gt;$msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'f'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$ukeyfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"testrepo.txt"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$fp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ukeyfile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$newl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$msg&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;fwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$newl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;fclose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$fp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="x"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Change the testrepo.txt to the name of the repo file. And that's it, you have now set up a RapidHook repository.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">BioNetWorksCorp</dc:creator><pubDate>Sun, 10 May 2015 04:50:54 -0000</pubDate><guid>https://sourceforge.neta5616bef140bd7bfb0abbf4d8be5b629dc8ce5ce</guid></item></channel></rss>