Commit 81aadfe7 authored by  JosephK's avatar JosephK

Merge branch 'master' into 'master'

Master

See merge request !4
parents 6396010c a5c6b5cb
u/*
shaarli/plugins/demo_plugin
shaarli/plugins/playvideos
\ No newline at end of file
shaarli/
\ No newline at end of file
[submodule "shaarli"]
path = shaarli
url = https://github.com/shaarli/Shaarli.git
......@@ -21,9 +21,29 @@ define('PATH_ROOT', dirname(__FILE__));
define('PATH_ACCOUNTS', join_path(PATH_ROOT, 'u'));
define('PATH_SHAARLI', join_path(PATH_ROOT, 'shaarli'));
// Init plugins, template and users folders
if ($handle = opendir('plugins')) {
while (false !== ($file = readdir($handle))) {
if (!file_exists(join_path(PATH_SHAARLI, 'plugins', $file))) {
symlink( '../../plugins/' . $file, 'shaarli/plugins/' . $file);
}
}
closedir($handle);
}
if (!file_exists(join_path(PATH_SHAARLI, 'tpl', 'frama'))) {
symlink( '../../tpl/frama', 'shaarli/tpl/frama');
}
if(!file_exists(PATH_ACCOUNTS)) {
mkdir('u');
chmod('u' , 0755);
}
if(file_exists(join_path(PATH_SHAARLI, 'data'))) {
chmod('shaarli/data' , 0500);
}
require_once( 'setconfig.php');
// Dirty thing to call locale files form 'i18n' and 'myframa' plugins
// Dirty thing to call locale files from 'i18n' and 'myframa' plugins
$GLOBALS['config']['ENABLED_PLUGINS'] = array(
0 => 'i18n',
1 => 'myframa'
......
......@@ -241,6 +241,7 @@
<li>'.t('Log into your account;').'</li>
<li>'.t('Bookmark links and share them;').'</li>
</ol>
<p>'.t('Actually, there are ').'<b>'.(iterator_count(new DirectoryIterator(PATH_ACCOUNTS))-2).t(' users registered').'</b>.</p>
</div>
</div>
......
......@@ -42,6 +42,8 @@ $t['<b class="violet">My</b><b class="vert">Frama</b> is a free online service l
$t['Create your account;'] = 'Créez votre compte ;';
$t['Log into your account;'] = 'Connectez-vous à votre nouveau compte ;';
$t['Bookmark links and share them;'] = 'Marquez des pages et partagez-les ;';
$t['Actually, there are '] = 'Actuellement, il y a ';
$t[' users registered'] = ' utilisateurs enregistrés';
$t['The software'] = 'Le logiciel';
$t['<b class="violet">My</b><b class="vert">Frama</b> is an instance of the software '] = '<b class="violet">My</b><b class="vert">Frama</b> est une instance du logiciel ';
......
......@@ -3,7 +3,7 @@ $ShaarliRoot = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
require_once $ShaarliRoot . '/data/config.php';
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists(t)) {
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists('t')) {
function t($txt) { return $txt; }
} else {
require_once $ShaarliRoot . '/plugins/i18n/i18n.php';
......@@ -94,7 +94,7 @@ jQuery(document).ready(function(){
// Locked plugins
if(/do=pluginadmin/i.test(window.location.href)) {
jQuery('#i18n, #myframa, #recovery, #tags_advanced<?php if (in_array('framanav',$GLOBALS['config']['ENABLED_PLUGINS'])) { echo ', #framanav'; } ?>')
jQuery('#i18n, #myframa, #recovery, #tags_advanced, #demo_plugin, #playvideos<?php if (in_array('framanav',$GLOBALS['config']['ENABLED_PLUGINS'])) { echo ', #framanav'; } ?>')
.attr('readonly', 'true')
.parent().parent().find('a:contains("▲"),a:contains("▼")').remove();
jQuery('#plugin_table a:contains("▲"):visible:first').css('visibility','hidden');
......
......@@ -3,7 +3,7 @@ $ShaarliRoot = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
require_once $ShaarliRoot . '/data/config.php';
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists(t)) {
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists('t')) {
function t($txt) { return $txt; }
} else {
require_once $ShaarliRoot . '/plugins/i18n/i18n.php';
......
<?php
$ShaarliRoot = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists(t)) {
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists('t')) {
function t($txt) { return $txt; }
}
......
<?php
$ShaarliRoot = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists(t)) {
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists('t')) {
function t($txt) { return $txt; }
}
......
Subproject commit 340777ad3f0b4e798a3eedfb730d993972adbe3e
# Set default behavior
* text=auto eol=lf
# Ensure sources are processed
*.conf text
*.css text
*.html text diff=html
*.js text
*.md text
*.php text diff=php
Dockerfile text
# Do not alter images nor minified scripts
*.ico binary
*.jpg binary
*.png binary
*.min.css binary
*.min.js binary
# Exclude from Git archives
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
composer.json export-ignore
doc/**/*.json export-ignore
doc/**/*.md export-ignore
docker/ export-ignore
Doxyfile export-ignore
Makefile export-ignore
phpunit.xml export-ignore
tests/ export-ignore
# Ignore data/, tmp/, cache/ and pagecache/
data
tmp
cache
pagecache
# Eclipse project files
.settings
.buildpath
.project
# Ignore raintpl generated pages
*.rtpl.php
# Ignore test dependencies
composer.lock
/vendor/
# Ignore development and test resources
coverage
doxygen
sandbox
phpmd.html
# Ignore user plugin configuration
plugins/*/config.php
sudo: false
language: php
php:
- 7.0
- 5.6
- 5.5
- 5.4
- 5.3
install:
- composer self-update
- composer install
script:
- make clean
- make check_permissions
- make test
## Contributing to Shaarli (community repository)
### Bugs and feature requests
**Reporting bugs, feature requests: issues management**
You can look through existing bugs/requests and help reporting them [here](https://github.com/shaarli/Shaarli/issues).
Constructive input/experience reports/helping other users is welcome.
The general guideline of the fork is to keep Shaarli simple (project and code maintenance, and features-wise), while providing customization capabilities (plugin system, making more settings configurable).
Check the [milestones](https://github.com/shaarli/Shaarli/milestones) to see what issues have priority.
* The issues list should preferably contain **only tasks that can be actioned immediately**. Anyone should be able to open the issues list, pick one and start working on it immediately.
* If you have a clear idea of a **feature you expect, or have a specific bug/defect to report**, [search the issues list, both open and closed](https://github.com/shaarli/Shaarli/issues?q=is%3Aissue) to check if it has been discussed, and comment on the appropriate issue. If you can't find one, please open a [new issue](https://github.com/shaarli/Shaarli/issues/new)
* **General discussions** fit in #44 so that we don't follow a slope where users and contributors have to track 90 "maybe" items in the bug tracker. Separate issues about clear, separate steps can be opened after discussion.
* You can also join instant discussion at https://gitter.im/shaarli/Shaarli, or via IRC as described [here](https://github.com/shaarli/Shaarli/issues/44#issuecomment-77745105)
### Documentation
**the [wiki](https://github.com/shaarli/Shaarli/wiki) is world-writable** - anyone can edit or add chapters and pages.
* Large changes should preferably be discussed in [General discussion](https://github.com/shaarli/Shaarli/issues/44) beforehand (you can post a draft there and edit it).
* If you create a new page, please link it from the new page (eg from the [Other links](https://github.com/shaarli/Shaarli/wiki#other-links) section.
* The wiki is a general documentation about Shaarli: usage, development, hacks, usage tricks, related links, projects. Try to keep it organized.
* The wiki will be synced to Shaarli's `doc/` directory on each release. Keep that in mind when reviewing the quality of your edits.
You can make the project known by publishing blog posts/articles/videos about it and adding them to the links section in the wiki.
### Translations
Currently Shaarli has no translation/internationalization/localization system available and is single-language. You can help by proposing an i18n system (issue https://github.com/shaarli/Shaarli/issues/121)
### Beta testing
You can help testing Shaarli releases by immediately upgrading your installation after a [new version has been releases](https://github.com/shaarli/Shaarli/releases).
All current development happens in [Pull Requests](https://github.com/shaarli/Shaarli/pulls). You can test proposed patches by cloning the Shaarli repo, adding the Pull Request branch and `git checkout` to it. You can also merge multiple Pull Requests to a testing branch.
```bash
git clone https://github.com/shaarli/Shaarli
git remote add pull-request-25 owner/cool-new-feature
git remote add pull-request-26 anotherowner/bugfix
git remote update
git checkout -b testing
git merge cool-new-feature
git merge bugfix
```
Or see [Checkout Github Pull Requests locally](https://gist.github.com/piscisaureus/3342247)
Please report any problem you might find.
### Contributing code
#### Adding your own changes
* Pick or open an issue
* Fork the Shaarli repository on github
* `git clone` your fork
* starting from branch ` master`, switch to a new branch (eg. `git checkout -b my-awesome-feature`)
* edit the required files (from the Github web interface or your text editor)
* add and commit your changes with a meaningful commit message (eg `Cool new feature, fixes issue #1001`)
* run unit tests against your patched version, see [Running unit tests](https://github.com/shaarli/Shaarli/wiki/Running-unit-tests)
* Open your fork in the Github web interface and click the "Compare and Pull Request" button, enter required info and submit your Pull Request.
All changes you will do on the `my-awesome-feature` in the future will be added to your Pull Request. Don't work directly on the master branch, don't do unrelated work on your `my-awesome-feature` branch.
#### Contributing to an existing Pull Request
TODO
#### Useful links
If you are not familiar with Git or Github, here are a few links to set you on track:
* https://try.github.io/ - 10 minutes Github workflow interactive tutorial
* http://ndpsoftware.com/git-cheatsheet.html - A Git cheatsheet
* http://www.wei-wang.com/ExplainGitWithD3 - Helps you understand some basic Git concepts visually
* https://www.atlassian.com/git/tutorial - Git tutorials
* https://www.atlassian.com/git/workflows - Git workflows
* http://git-scm.com/book - The official Git book, multiple languages
* http://www.vogella.com/tutorials/Git/article.html - Git tutorials
* http://think-like-a-git.net/resources.html - Guide to Git
* http://gitready.com/ - medium to advanced Git docs/tips/blog/articles
* https://github.com/btford/participating-in-open-source - Participating in Open Source
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
# Shaarli, the personal, minimalist, super-fast, no-database delicious clone.
# Makefile for PHP code analysis & testing
# Prerequisites:
# - install Composer, either:
# - from your distro's package manager;
# - from the official website (https://getcomposer.org/download/);
# - install/update test dependencies:
# $ composer install # 1st setup
# $ composer update
# - install Xdebug for PHPUnit code coverage reports:
# - see http://xdebug.org/docs/install
# - enable in php.ini
BIN = vendor/bin
PHP_SOURCE = index.php application tests plugins
PHP_COMMA_SOURCE = index.php,application,tests,plugins
all: static_analysis_summary check_permissions test
##
# Concise status of the project
# These targets are non-blocking: || exit 0
##
static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
@echo
##
# PHP_CodeSniffer
# Detects PHP syntax errors
# Documentation (usage, output formatting):
# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
##
code_sniffer: code_sniffer_full
### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
PHPCS_%:
@$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$*
### - errors by Git author
code_sniffer_blame:
@$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame
### - all errors/warnings
code_sniffer_full:
@$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200
### - errors grouped by kind
code_sniffer_source:
@$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
##
# PHP Copy/Paste Detector
# Detects code redundancy
# Documentation: https://github.com/sebastianbergmann/phpcpd
##
copy_paste:
@echo "-----------------------"
@echo "PHP COPY/PASTE DETECTOR"
@echo "-----------------------"
@$(BIN)/phpcpd $(PHP_SOURCE) || exit 0
@echo
##
# PHP Mess Detector
# Detects PHP syntax errors, sorted by category
# Rules documentation: http://phpmd.org/rules/index.html
##
MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode
mess_title:
@echo "-----------------"
@echo "PHP MESS DETECTOR"
@echo "-----------------"
### - all warnings
mess_detector: mess_title
@$(BIN)/phpmd $(PHP_COMMA_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__'
### - all warnings + HTML output contains links to PHPMD's documentation
mess_detector_html:
@$(BIN)/phpmd $(PHP_COMMA_SOURCE) html $(MESS_DETECTOR_RULES) \
--reportfile phpmd.html || exit 0
### - warnings grouped by message, sorted by descending frequency order
mess_detector_grouped: mess_title
@$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \
| cut -f 2 | sort | uniq -c | sort -nr
### - summary: number of warnings by rule set
mess_detector_summary: mess_title
@for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \
warnings=$$($(BIN)/phpmd $(PHP_COMMA_SOURCE) text $$rule | wc -l); \
printf "$$warnings\t$$rule\n"; \
done;
##
# Checks source file & script permissions
##
check_permissions:
@echo "----------------------"
@echo "Check file permissions"
@echo "----------------------"
@for file in `git ls-files`; do \
if [ -x $$file ]; then \
errors=true; \
echo "$${file} is executable"; \
fi \
done; [ -z $$errors ] || false
##
# PHPUnit
# Runs unitary and functional tests
# Generates an HTML coverage report if Xdebug is enabled
#
# See phpunit.xml for configuration
# https://phpunit.de/manual/current/en/appendixes.configuration.html
##
test:
@echo "-------"
@echo "PHPUNIT"
@echo "-------"
@mkdir -p sandbox
@$(BIN)/phpunit tests
##
# Targets for repository and documentation maintenance
##
### remove all unversioned files
clean:
@git clean -df
@rm -rf sandbox
### generate Doxygen documentation
doxygen: clean
@rm -rf doxygen
@( cat Doxyfile ; echo "PROJECT_NUMBER=`git describe`" ) | doxygen -
### update the local copy of the documentation
doc: clean
@rm -rf doc
@git clone https://github.com/shaarli/Shaarli.wiki.git doc
@rm -rf doc/.git
### Generate a custom sidebar
#
# Sidebar content:
# - convert GitHub-flavoured relative links to standard Markdown
# - trim HTML, only keep the list (<ul>[...]</ul>) part
htmlsidebar:
@echo '<div id="local-sidebar">' > doc/sidebar.html
@awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
'!m { print $$0 }' doc/_Sidebar.md > doc/tmp.md
@pandoc -f markdown -t html5 -s doc/tmp.md | awk '/(ul>|li>)/' >> doc/sidebar.html
@echo '</div>' >> doc/sidebar.html
@rm doc/tmp.md
### Convert local markdown documentation to HTML
#
# For all pages:
# - infer title from the file name
# - convert GitHub-flavoured relative links to standard Markdown
# - insert the sidebar menu
htmlpages:
@for file in `find doc/ -maxdepth 1 -name "*.md"`; do \
base=`basename $$file .md`; \
sed -i "1i #$${base//-/ }" $$file; \
awk 'BEGIN { FS = "[\\[\\]]{2}" }'\
'm = /\[/ { t=$$2; gsub(/ /, "-", $$2); print $$1"["t"]("$$2".html)"$$3 }'\
'!m { print $$0 }' $$file > doc/tmp.md; \
mv doc/tmp.md $$file; \
pandoc -f markdown_github -t html5 -s \
-c "github-markdown.css" \
-T Shaarli -M pagetitle:"$${base//-/ }" -B doc/sidebar.html \
-o doc/$$base.html $$file; \
done;
htmldoc: doc htmlsidebar htmlpages
![Shaarli logo](doc/images/doc-logo.png)
The personal, minimalist, super-fast, database free, bookmarking service.
_Do you want to share the links you discover?_
_Shaarli is a minimalist delicious clone that you can install on your own server._
_It is designed to be personal (single-user), fast and handy._
[![](https://img.shields.io/travis/shaarli/Shaarli.svg?label=master)](https://travis-ci.org/shaarli/Shaarli)
[![](https://img.shields.io/travis/shaarli/Shaarli/stable.svg?label=stable)](https://travis-ci.org/shaarli/Shaarli)
[![](https://img.shields.io/github/release/shaarli/shaarli.svg)](https://github.com/shaarli/Shaarli/releases/latest/)
[![Docker repository](https://img.shields.io/docker/pulls/shaarli/shaarli.svg)](https://hub.docker.com/r/shaarli/shaarli/)
[![Join the chat at https://gitter.im/shaarli/Shaarli](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/shaarli/Shaarli)
[![Bountysource](https://www.bountysource.com/badge/team?team_id=19583&style=bounties_received)](https://www.bountysource.com/teams/shaarli/issues)
## Quickstart
- [Wiki/documentation](https://github.com/shaarli/Shaarli/wiki)
- [Bugs/Feature requests/Discussion](https://github.com/shaarli/Shaarli/issues/)
### Demo
You can use this [public demo instance of Shaarli](http://shaarlidemo.tuxfamily.org/Shaarli).
It runs the latest development version of Shaarli and is updated/reset daily.
Login: `demo`; Password: `demo`
### Installation & upgrade
- [Download](https://github.com/shaarli/Shaarli/wiki/Download)
- [Server requirements](https://github.com/shaarli/Shaarli/wiki/Server-requirements)
- [Server configuration](https://github.com/shaarli/Shaarli/wiki/Server-configuration)
- [Shaarli configuration](https://github.com/shaarli/Shaarli/wiki/Shaarli-configuration)
## Features
### Interface
- minimalist design (simple is beautiful)
- FAST
- ATOM and RSS feeds
- views:
- paginated link list
- tag cloud
- picture wall: image and video thumbnails
- daily: newspaper-like daily digest
- daily RSS feed
- permalinks for easy reference
- links can be public or private
- extensible through [plugins](https://github.com/shaarli/Shaarli/wiki/Plugins#plugin-usage)
### Tag, view and search your links!
- add a custom title and description to archived links
- add tags to classify and search links
- features tag autocompletion, renaming, merging and deletion
- full-text and tag search
### Easy setup
- dead-simple installation: drop the files, open the page
- links are stored in a file
- compact storage
- no database required
- easy backup: simply copy the datastore file
- import and export links as Netscape bookmarks
### Accessibility
- Firefox bookmarlet to share links in one click
- support for mobile browsers
- works with Javascript disabled
- easy page customization through HTML/CSS/RainTPL
### Security
- bruteforce-proof login form
- protected against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
and session cookie hijacking
### Goodies
- thumbnail generation for images and video services:
dailymotion, flickr, imageshack, imgur, vimeo, xkcd, youtube...
- lazy-loading with [bLazy](http://dinbror.dk/blazy/)
- [PubSubHubbub](https://code.google.com/p/pubsubhubbub/) protocol support
- URL cleanup: automatic removal of `?utm_source=...`, `fb=...`
- discreet pop-up notification when a new release is available