Code Bank

code view

Having problems with the button above? Try downloading the installer directly.

Code Bank is a code snippet manager with support for a local database as well as a shared database1. Code Bank also has syntax highlighting for multiple languages including C++, ActionScript, Flex, HTML and SQL to name a few. Code Bank also has a simple revision history with a compare viewer so you can see the changes side-by-side between two revisions.

 

Desktop Client Installation

Use the install button on the left to download and install Code Bank, Adobe AIR required.


Serverside Information

(Serverside is not required, Code Bank has built in support for local storage)

4 1

44

 

With the serverside application you can share a code snippet library between multiple users. Code Bank 3.0's serverside is now a SilverStripe module so you can install it into your existing SilverStripe 3.1 site or as a standalone SilverStripe Framework system, see here for the requirements of SilverStripe 3.1.

Installation (Module/Advanced):

If you already have a SilverStripe 3.1 powered website you can choose to install the module into your existing SilverStripe 3.1 site.

Via composer

composer require undefinedoffset/silverstripe-codebank

Manual Install
  1. Download and extract the latest Code Bank module release from here
  2. Extract the module archive to the root of your SilverStripe installation, opening the extracted folder should contain _config.php in the root along with other files/folders
  3. Hit http://{your domain}/{path to root of code bank server folder}/dev/build?flush=all in your browser
  4. You will now see a Code Bank option in the CMS Menu

Installation (Standalone):

  1. Download and extract the latest Code Bank release from here
  2. Extract the Code Bank to a location on your SilverStripe compatible web server, you should now see a Code Bank folder and a framework folder among others
  3. Follow the installation instructions on the SilverStripe website
  4. If the installer completes successfully you will now be able to use the remote server in Code Bank's desktop client. Just set the server path to be http://{your domain}/{path to root of code bank server folder}
  5. You should make sure that the SilverStripe installer removed the install files install.php, and install-frameworkmissing.html

Upgrading to 3.0.0 from 2.2.2 (Server side)

Code Bank 3.0's serverside is practically a complete re-write of the 2.2.2 server as such there are a number of steps required to preform the upgrade, see the upgrading guide for more information.

 

Upgrading to new versions:

Module Only (with composer, recommended):

composer update --no-dev undefinedoffset/silverstripe-codebank

Once you've done this make sure you hit dev/build?flush=all to re-build the database.

Module Only (without composer)
  1. Download the latest Code Bank release here
  2. Extract the archive to into the same folder as your SilverStripe Framework
  3. Hit http://{your domain}/{path to root of code bank server folder}/dev/build?flush=all in your browser
Stand Alone (with composer, recommended)

composer update --no-dev

Once you've done this hit http://{your domain}/{path to root of code bank server folder}/dev/build?flush=all in your browser.

Stand Alone (without composer)
  1. Download and extract the latest Code Bank release from here overwriting the Code Bank and themes folders
  2. Download and extract just the CodeBank, framework and themes folders replacing only those folders and their children
  3. Hit http://{your domain}/{path to root of code bank server folder}/dev/build?flush=all in your browser, then you may use Code Bank normally

Custom Languages with Brushes

Code Bank uses SyntaxHighlighter to highlight code snippets, to provide a language with syntax highlighting you must add to your yml configs the following then run dev/build?flush=all.

CodeBank:
    extra_languages:
        - Name: "Example Language" #Name of the language
          HighlightCode: "example" #Highlighter code
          FileName: "ex" #File extension
          Brush: "mysite/javascript/shBrushEx.js" #Relative Path to the snippet highlighter brush


Localizations

If you want to help localize Code Bank Desktop Client into your language I welcome the help, please use the contact page to ask about how you can help me with this. Once a translation has been made available it will be listed here with the language and your name/handle (if you wish) as the maintainer of the translation. If you are looking to translate the serverside feel free to fork it on GitHub and get started, Code Bank Server uses Yaml for it's translations since it is a SilverStripe module these files can be found in the lang folder.

(Right Click and Save As)

Language Maintainer
(no translations available)

 

Change Log

I've started publishing the change log, if you're interested in this see the change log here.

 

1.   Shared database requires the optional serverside. See that section above for more information