Commit Graph

88 Commits

Author SHA1 Message Date
Andreas Gohr 46028c4c32 Move defines to their own file
As described in
https://github.com/dwp-forge/columns/issues/5#issuecomment-638467603
sometime the Lexer constants have not been (auto)loaded when a syntax plugin
is invoked (I'm not sure why).

In general PSR2 discourages a mix of main code and function/class setup
with the call to define() being considered main code.

This patch moves these the define calls to a separate new file, solving
both of the above problems.

These are not all our defines. Instead I focused on the ones that are
ENUM-like.

In the future we should think about what defines can be replaced by
class constants and what other define() calls should be moved.
2020-06-04 08:22:16 +02:00
Phy 2bfa4000e3
fix comment formating 2020-03-09 20:27:29 -04:00
Phy 08e9b52fd0
Renamed constant to RECENTS_ONLY_CREATION
This clarifies that it also works when requesting media changelog.
2020-03-09 20:24:19 -04:00
Tero Kivinen 68f43bcf6b
Implemented only_new option for RSS feed, so you can request RSS feed that contains only new files. 2020-03-09 20:21:11 -04:00
Phy aac83cd489
PHP8 fix part 4: Trying to access array offset on value of type bool/null 2019-12-01 14:25:32 -05:00
Phy 3e9ae63d53
PHP8 fix part 3: Trying to access array offset on value of type bool/null 2019-12-01 14:01:52 -05:00
Andreas Gohr f2b8faf5fc Merge branch 'master' into htmlvaliditytests
* master: (492 commits)
  Avoid flaky tests by waiting full seconds
  translation update
  translation update
  translation update
  translation update
  Check for null JS object on form field.
  translation update
  Rename _acl_add to _acl_addOrUpdate
  Fix #1115
  translation update
  translation update
  translation update
  Update config.class.php
  translation update
  translation update
  use inline template instead of .dist file to populate users.auth.php
  authpdo: fix _query return type issue per Scrutinizer inspection
  Update lang.php
  Add ugc hint to nofollow
  add UGC hint
  ...
2019-10-15 15:27:22 +02:00
Andreas Gohr bba3d82504 Merge branch 'pr/2401'
* pr/2401:
  fix: workaround premature metadata generation on page save 🐛
2019-10-15 14:51:25 +02:00
Andreas Gohr 8cbc5ee84f replaced deprecated utf8 functions
For now this uses full qualified namespaces, sensible imports may come
later.
2019-06-10 16:12:59 +02:00
Michael Große 923e149a1f
Merge branch 'master' into psr2 2019-02-15 01:05:01 +01:00
Phy 1b266025c9 getRecents(): prevent non-exist changelog error. Fixes #2440.
This is based on #2506 but with a different approach to deal with unknown read error: If file function doesn't return an array, set it to an empty array. Somewhat pythonic?
2018-10-12 21:44:18 -04:00
peterfromearth 2eaa0567bb add check if a page has once existed and show new onceexisted page 2018-09-20 22:10:17 +02:00
Andreas Gohr 0c3a570273 split changelog classes into their own namespace
The remaining functions in inc/changelog.php should be moved into a
utility class.
2018-06-15 11:45:58 +02:00
Michael Große 3af323c154
fix: workaround premature metadata generation on page save 🐛
This fixes a bug where the creator of a new page was not saved to metadata.
That could happen if a plugin calls pageinfo() in the IO_WIKIPAGE_WRITE
event AFTER handler. This creates a new .meta file for the page with the
page's mtime as the creation timestamp. That caused the if clause
changed in this commit to evaluate as false and thus the creator key was
not saved.

This commit now also treats the page as newly created if the created
date in the metadata to the file's current mtime.
2018-05-23 15:42:59 +02:00
Andreas Gohr aba86f383f visibility fixes
First start at declaring visibilites for methods and properties. Still
missing: the parser/renderer stuff and the plugins
2018-04-27 20:02:24 +02:00
Andreas Gohr 64159a61e9 line lengths shortened
This makes sure all files use line lenghts shorter than 120 characters.

This is a quick fix. It might not always be the nicest change.
2018-04-27 19:07:43 +02:00
Andreas Gohr 8e3e8693f6 handle empty changelogs correctly
The code would previously throw a warning when a changelog did not exist
or was empty.
2018-04-17 16:33:20 +02:00
lisps 5f4d97a0cd fix calculation of LastRevisionAt
if for example the current media file is deleted, the function would return '' instead of the correct LastRevision.
2016-08-29 12:23:02 +02:00
Anika Henke aa13c9aa45 removed deprecated changelog functions getRevisionInfo() and getRevisions() outside of class 2016-04-19 12:08:42 +01:00
Gerrit Uitslag ac3ed4af58 Store change of filesizes in revision log
Implements
https://bugs.dokuwiki.org/index.php?do=details&task_id=2525
2015-08-22 01:38:52 +02:00
Gerrit Uitslag 7de86af975 phpdocs, reformatting 2015-06-30 23:07:10 +02:00
Andreas Gohr 79e7937762 Remove error supression for file_exists()
In an older version of PHP a file_exists() call would issue a warning
when the file did not exist. This was fixed in later PHP releases. Since
we require PHP 5.3 now, there's no need to supress any error here
anymore. This might even give a minor performance boost.
2015-01-07 10:47:45 +01:00
Andreas Gohr 0153fa96cb Merge pull request #923 from splitbrain/addLogEntry
Make addLogEntry independent of global var INFO
2014-12-11 20:56:19 +01:00
Gerrit Uitslag 8702de7f7e Merge remote-tracking branch 'origin/master' into scrutinizerissues
Conflicts:
	inc/media.php
	inc/plugin.php
	inc/template.php
	lib/plugins/authplain/_test/escaping.test.php
	lib/plugins/syntax.php
2014-12-09 17:26:28 +01:00
Gerrit Uitslag fed2ee900d Make addLogEntry independent of global var INFO
In stead use the type as provided to the function. Fixes #920
2014-11-06 21:12:10 +01:00
Gerrit Uitslag 42ea7f447f Many PHPDocs, some unused and dyn declared vars
many PHPDocs
some unused variables
some dynamically declared variables declared
2014-10-01 11:30:27 +02:00
lisps 8d39e80d36 Merge remote-tracking branch master into revisions 2014-09-26 12:48:02 +02:00
Gerrit Uitslag 4f1e2cb398 PHPdocs changelog 2014-05-21 10:20:37 +02:00
Andreas Gohr 1419a485e3 log deprecated function calls FS#2399
This introduces a new dbg_deprecated() function which allows for easy
marking of deprecated functions. Each call is logged to the debuglog
when debuggin is enabled.
2014-05-10 15:49:53 +02:00
lisps e310313d79 Merge remote-tracking branch 'remotes/origin/master' into revisions_local 2014-03-19 08:07:16 +01:00
Andreas Gohr 3275c5d6fe Merge branch 'master' into diff_navigation
* master: (103 commits)
  Add a basic test case for the cache
  Events: Trigger a warning if the default action is not callable
  Fix caching (make the event callback public again)
  translation update
  translation update
  translation update
  translation update
  translation update
  translation update
  translation update
  avoid HTTP image screenshot urls. closes #595
  translation update
  Extension manager: Fix cache extension to be .repo
  adjusted the office type color again
  another instance of empty() where an array key might not exist
  remove placeholder van denied.txt
  updated file icons once more
  removed 'not logged in' text, loginform is shown already
  Revert "added stripped bit to language file"
  fixed index file
  ...

Conflicts:
	inc/html.php
2014-03-14 17:09:29 +01:00
Christopher Smith 585bf44e2b amend $_SERVER to $INPUT->server 2014-03-06 19:55:56 +00:00
Gerrit Uitslag 621bbd2a24 diff of removed page, require handling right rev=0
When page is removed, and diff can be requested between a revision and
current situation. This results in right revision is 0.

Similar case just after creating a page. A diff between the first
version and nothing before, result in left revision is 0.

In these cases a empty dummy revision is placed as selected value in
dropdown. Otherwise user got distracted by the revisions details shown
in select field,  which are not related to the diff below.
2014-02-19 17:58:36 +01:00
lisps d90a79c0ee Merge remote-tracking branch 'origin/diff_navigation' into revisions
Conflicts:
	inc/parser/xhtml.php
2014-02-17 23:15:36 +01:00
Gerrit Uitslag 2e608c5275 reverse revisions display order 2014-02-15 20:41:09 +01:00
lisps f2643d9ff3 Merge branch 'splitbrain/diff_navigation' into revisions 2013-11-27 16:40:06 +01:00
Gerrit Uitslag 1da8dc976a retrieve revisions around some given revisions
With unit tests

One case is not yet fixed:
when rev1 is first rev from changelog, only $max/2 revisions are
retrieved, but it should retrieve $max revisions.
2013-11-27 00:56:02 +01:00
Gerrit Uitslag 80e97297ed read changelog with chunks of chunksize size in getRevisions() 2013-11-27 00:39:35 +01:00
lisps a859b8c3c9 Merge remote-tracking branch 'remotes/splitbrain/diff_navigation' into revisions 2013-11-25 13:14:36 +01:00
Gerrit Uitslag 7d1e323e21 bugfix and reformatting changelog. small chunck unittests 2013-11-22 15:50:04 +01:00
Gerrit Uitslag 59cce2d943 Improve changelog reading. Inclusive unittests for chunks smaller than changelog lines. 2013-11-22 15:30:48 +01:00
lisps 78b874e68a fix function name media_isexternal()
remove empty rev from ml()
rename getProperRevision() to getLastRevisionAt()
make getLastRevisionAt() a method of ChangeLog
2013-11-22 10:51:16 +01:00
lisps ac6dc646a5 Merge remote-tracking branch 'remotes/splitbrain/diff_navigation' into revisions 2013-11-22 09:13:53 +01:00
lisps 4bde2196a1 remove property rev from xhtml.php
changed variable name $create_time to $modified_time
2013-11-22 09:04:44 +01:00
Gerrit Uitslag 047bad06fa refactor PageRevisionLog into Media- and PageChangelog extending Changelog 2013-11-21 21:07:08 +01:00
Gerrit Uitslag 0f13c836f0 Improved isCurrentRevision(), tests included 2013-11-21 18:02:12 +01:00
lisps 5c2eed9a19 add parameter at($DATE_AT) and mind revisions 2013-11-21 15:50:52 +01:00
Gerrit Uitslag ee33e0c562 isCurrentPage is page dependent 2013-11-20 13:47:13 +01:00
Gerrit Uitslag 8eccf945d3 page related changelog reading refactored to class 2013-11-20 13:18:44 +01:00
Gerrit Uitslag 703aeaef1a Merge remote-tracking branch 'origin/master' into diff_navigation 2013-11-19 21:26:50 +01:00