DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:releases:refactor2022

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:releases:refactor2022 [2022-07-31 21:46] Klap-indevel:releases:refactor2022 [2023-10-22 00:10] (current) – [Remove .gif icons] Klap-in
Line 3: Line 3:
 ====== Refactoring 2022====== ====== Refactoring 2022======
  
-[[devel:develonly]] -- Update of this page is in Progress+Update of this page is in Progress
  
-This page lists changes since August 2022. For older changes see [[devel:releases:refactor2021]] and [[devel:releases:refactor2020]].+This page lists changes from August 2022 to April 2023 as included in the "Jack Jackrum" release. For older changes see [[devel:releases:refactor2021]] and [[devel:releases:refactor2020]], for newer [[devel:releases:refactor2023]].
 ^Welcome to add more notes/examples/etc on this page, to make updating of plugins and templates easy! Please share all remarks and possible improvements. See [[https://forum.dokuwiki.org/d/18268-guidance-for-finding-deprecated-code-and-how-to-update|forum topic]]. Thank you very much! [[user>Klap-in]]^ ^Welcome to add more notes/examples/etc on this page, to make updating of plugins and templates easy! Please share all remarks and possible improvements. See [[https://forum.dokuwiki.org/d/18268-guidance-for-finding-deprecated-code-and-how-to-update|forum topic]]. Thank you very much! [[user>Klap-in]]^
  
Line 12: Line 12:
  
 Plugin/template authors can easily check if they use any deprecated functions, classes or methods: Plugin/template authors can easily check if they use any deprecated functions, classes or methods:
 +
 +Since the Igor 2022 release:
 +  * logging of //deprecated// messages is default enabled, otherwise you need to uncheck ''deprecated'' in the [[config:dontlog]] configuration setting
 +  * use the plugin
 +  * check [[plugin:LogViewer]] (or ''data/log/deprecated/<date>.log'').
 +
 +Up to the Hogfather 2020 release:
  
   * enable the [[config:allowdebug]] setting in the Configuration Manager   * enable the [[config:allowdebug]] setting in the Configuration Manager
   * use the plugin   * use the plugin
-  * Check logs for any information about deprecated calls caused by the plugin+  * Check logs for any information about deprecated calls caused by the plugin in ''data/cache/debug.log''
-    * Up to the Summer 2020 "Hogfather" release: check ''data/cache/debug.log''+ 
-    Since the Summer 2022 "Igor" release: check ''data/log/deprecated/<date>.log''+ 
 +===== sexplode() instead of explode() to list===== 
 + 
 +[[pr>3754]] introduces a PHP8 safe way to do an explode to an list/array. 
 + 
 +<code diff> 
 +- list($foo, $bar) = explode(',', $input, 2); 
 ++ [$foo, $bar] = sexplode(',', $input, 2); 
 +this is a convenient alternative for 
 ++ [$foo, $bar] = array_pad(explode(',', $input, 2), 2, null); 
 +</code> 
 + 
 +Since PHP 7.1 ''%%[.., ..] = ..%%'' is supported instead of ''%%list(.., ..) = ..%%'' 
 + 
 + 
 +===== Remove .gif icons ===== 
 +DokuWiki upgrades, using the ''data/deleted.files'' file, **removes** the .gif icons.  
 + 
 +The ''.gif'' icons need to be replaced by the ''.svg'' icons in ''lib/images/smileys''. See also [[devel:releases:refactor2021#from gif to svg smileys]]. 
 +===== Replace phpquery by php-dom-wrapper in tests ===== 
 +[[pr>3814]] replaced phpquery by [[https://github.com/scotteh/php-dom-wrapper|php-dom-wrapper]]. Usage is similar but not a 1:1 replacement. In plugin tests small changes will be needed. 
 + 
 +<code diff> 
 +- $doc = phpQuery::newDocumentXHTML($html); 
 ++ $doc = (new Document())->html($html); 
 +</code>
  
 +Some examples (see further also the docs referred above for the new syntax)
 +<code diff>
 +//probably the biggest change
 +- $paragraphs = pq("p", $doc);
 +- $divs = pq("div");
 ++ $paragraphs = $doc->find('p')
 ++ $divs = $doc->find('div')
  
  
 +$input = $doc->find('button[name=foo]');
 +- $this->assertTrue($input->length == 1);
 ++ $this->assertTrue($input->count() == 1);
  
-===== Refactor fulltext search functions and class Doku_Indexer ===== +- $this->assertEquals('bam', $input->val()); 
- ++ $this->assertEquals('bam', $input->attr('value'));
  
-[[pr>2943]]+$inputs = $doc->find('input[name=foo]'); 
 +- $this->assertEquals('first', pq($inputs->elements[0])->val()); 
 ++ $this->assertEquals('first', $inputs->get(0)->attr('value'));
  
-Following Functions will be Deprecated:  +//more?? other examples welcome.
  
-Indexer: +</code>
-[[codesearch>idx_get_version]],  +
-[[codesearch>idx_addPage]],  +
-[[codesearch>idx_getIndex]],  +
-[[codesearch>idx_listIndexLengths]],  +
-[[codesearch>idx_indexLengths]],  +
-[[codesearch>idx_get_indexer]]+
  
-MetadataIndex: 
-[[codesearch>ft_pageLookup]],  
-[[codesearch>ft_mediainuse]],  
-[[codesearch>ft_backlinks]], 
  
-FulltextIndex: 
-[[codesearch>ft_pageSearch]],  
-[[codesearch>ft_snippet]],  
-[[codesearch>ft_snippet_re_preprocess]],  
-[[codesearch>ft_queryParser]],  
-[[codesearch>ft_queryUnparser_simple]] 
  
  
devel/releases/refactor2022.1659296769.txt.gz · Last modified: 2022-07-31 21:46 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki