removed leftovers from submodule uglifyjs, added credits file,
cleaned up CSS, changed template to output clean XHTML 5, added unit tests for 60% of the code, found a few bugs by doing that and fixed them
This commit is contained in:
31
INSTALL.md
31
INSTALL.md
@@ -1,13 +1,13 @@
|
||||
Documentation
|
||||
=============
|
||||
Installation
|
||||
============
|
||||
|
||||
For Administrators
|
||||
------------------
|
||||
|
||||
In the index.php in the main folder you can define a different PATH. This is
|
||||
useful if you want to secure your installation and want to move the
|
||||
configuration, data files, templates and PHP libraries (directories cfg, lib
|
||||
and tpl) outside of your document root. This new location must still be
|
||||
configuration, data files, templates and PHP libraries (directories cfg, data,
|
||||
lib and tpl) outside of your document root. This new location must still be
|
||||
accessible to your webserver / PHP process.
|
||||
|
||||
> ### PATH Example ###
|
||||
@@ -26,7 +26,7 @@ In the file "cfg/conf.ini" you can configure ZeroBin. The config file is
|
||||
divided into multiple sections, which are enclosed in square brackets. In the
|
||||
"[main]" section you can enable or disable the discussion feature, set the
|
||||
limit of stored pastes and comments in bytes. The "[traffic]" section lets you
|
||||
set a time limit in seconds. Users may not post more often the this limit to
|
||||
set a time limit in seconds. Users may not post more often then this limit to
|
||||
your ZeroBin.
|
||||
|
||||
Finally the "[model]" and "[model_options]" sections let you configure your
|
||||
@@ -35,16 +35,16 @@ favourite way of storing the pastes and discussions on your server.
|
||||
data folder. This is the recommended setup for low traffic sites. Under high
|
||||
load, in distributed setups or if you are not allowed to store files locally,
|
||||
you might want to switch to the "zerobin_db" model. This lets you store your
|
||||
data in a database. Basically all databases, that are supported by PDO (PHP
|
||||
data in a database. Basically all databases that are supported by PDO (PHP
|
||||
data objects) may be used. Automatic table creation is provided for pdo_ibm,
|
||||
pdo_informix, pdo_mssql, pdo_mysql, pdo_oci, pdo_pgsql and pdo_sqlite. You may
|
||||
want to provide a table prefix, if you have to share the zerobin database with
|
||||
another application. The table prefix option is called "tbl".
|
||||
|
||||
> ### Note ###
|
||||
> The "zerobin_db" model has only been tested with sqlite and MySQL, although
|
||||
> it would not be recommended to use sqlite in a production environment. If you
|
||||
> gain any experience running ZeroBin on other RDBMS, let us know.
|
||||
> The "zerobin_db" model has only been tested with SQLite and MySQL, although
|
||||
> it would not be recommended to use SQLite in a production environment. If you
|
||||
> gain any experience running ZeroBin on other RDBMS, please let us know.
|
||||
|
||||
For reference or if you want to create the table schema for yourself:
|
||||
|
||||
@@ -69,7 +69,8 @@ For reference or if you want to create the table schema for yourself:
|
||||
|
||||
For Developers
|
||||
--------------
|
||||
If you want to create your own data models, you might want to know how the arrays, that you have to store, look like:
|
||||
If you want to create your own data models, you might want to know how the
|
||||
arrays, that you have to store, look like:
|
||||
|
||||
public function create($pasteid, $paste)
|
||||
{
|
||||
@@ -81,16 +82,16 @@ If you want to create your own data models, you might want to know how the array
|
||||
$paste['meta']['opendiscussion'] // true (if false it is unset)
|
||||
$paste['meta']['burnafterreading'] // true (if false it is unset; if true, then opendiscussion is unset)
|
||||
}
|
||||
|
||||
|
||||
public function createComment($pasteid, $parentid, $commentid, $comment)
|
||||
{
|
||||
$pasteid // the id of the paste this comment belongs to
|
||||
$parentid // the id of the parent of this comment, may be the paste id itself
|
||||
$commentid = substr(hash('md5', $paste['data']), 0, 16);
|
||||
|
||||
$paste['data'] // text
|
||||
$paste['meta']['nickname'] // text or null (if anonymous)
|
||||
$paste['meta']['vizhash'] // text or null (if anonymous)
|
||||
$paste['meta']['postdate'] // int UNIX timestamp
|
||||
$comment['data'] // text
|
||||
$comment['meta']['nickname'] // text or null (if anonymous)
|
||||
$comment['meta']['vizhash'] // text or null (if anonymous)
|
||||
$comment['meta']['postdate'] // int UNIX timestamp
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user