1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-14 18:34:41 +02:00
Commit Graph

10645 Commits

Author SHA1 Message Date
db257956aa [feature/template-engine] Corrected an error message in template locator.
PHPBB3-9726
2011-08-07 19:17:22 -04:00
f3befa4b29 [feature/template-engine] Remaining documentation.
PHPBB3-9726
2011-08-07 19:07:27 -04:00
02fc533066 [feature/template-engine] More documentation for template class.
PHPBB3-9726
2011-08-07 15:42:04 -04:00
0b381516a0 [feature/template-engine] Create load_and_render to reduce code duplication.
PHPBB3-9726
2011-08-07 15:35:35 -04:00
52f208900f [feature/template-engine] Get rid of orig_tpl_* in template engine.
The origins of orig_tpl_* are not pretty. Please see the following commits
and associated tickets: r9823, r9839, r9847, r10150, r10460.

In short, multiple hacks were required due to template engine reading
inheritance/storedb flags from $user (global) even when the template that
was being looked up or rendered was not the "active style of the
current user".

We no longer store templates in the database, removing half of the problem.
This commit fixes the second half of the problem by deleting
set_template_path function from template locator, and moving that logic
back into the template class' set_template. set_template now calls
set_custom_template, the latter only taking the template path and the
fallback paths as parameters. With this change template locator no longer
uses $user and does not use phpbb root path either.

All logic involving setting the user's "active" template is now
encapsulated in a single template class's function, set_template.
Setting other templates is done via set_custom_template and the caller
is responsible for determining and passing in fallback/inheritance path,
if any.

PHPBB3-9726
2011-08-04 21:45:42 -04:00
1a6250d8b6 [feature/template-engine] Delete $style_name param from locator's set_custom_template.
This parameter was unused, it was only used by template's set_custom_template
to determine cache file prefix.

PHPBB3-9726
2011-08-04 21:24:40 -04:00
13536f2be5 [feature/template-engine] Add constructor to template locator.
PHPBB3-9726
2011-08-04 21:23:06 -04:00
05b71ca04e [feature/template-engine] Factor template locator out of template class.
Template locator is responsible for maintaining mapping from template
handles to filenames and paths, and provides resolution services
using these mappings.

Template locator is aware of template inheritance and is capable of
checking template file existence on the filesystem.

PHPBB3-9726
2011-07-30 17:06:22 -04:00
4126a571ac [feature/template-engine] Delete $files_template property.
This seems to have been used for db storage of templates.
We no longer offer db storage of templates, and thus currenty
$files_template is only written to but not read anywhere.

PHPBB3-9726
2011-07-30 15:20:25 -04:00
e116561348 [feature/template-engine] Rename is_absolute to phpbb_is_absolute.
PHPBB3-9726
2011-07-24 13:37:46 -04:00
bf34264f4f [feature/template-engine] Docblocks, no more constructor for filter
Add docblocks for phpbb_template_filter, remove the useless constructor.

PHPBB3-9726
2011-07-16 15:24:14 +02:00
e43d8732d4 [feature/template-engine] Add ampersands to return refs by reference.
PHPBB3-9726
2011-07-10 03:45:57 -04:00
66cef00589 [feature/template-engine] Delete useless assignment by reference for $lang.
PHPBB3-9726
2011-07-10 03:41:09 -04:00
c58b09e65d [feature/template-engine] Remove $include_once argument of display()
PHPBB3-9726
2011-07-10 01:05:54 +02:00
ae53623230 [feature/template-engine] Refactor $config dependency out of the filter
The template stream filter no longer depends on the $config global.
Instead it uses a 'allow_php' param that is passed via
stream_bucket_append's last argument.

Tests also adjusted.

PHPBB3-9726
2011-07-10 00:35:07 +02:00
ee0bba3ab6 [feature/template-engine] Fix some comments
PHPBB3-9726
2011-07-10 00:33:25 +02:00
f7b06ca12d [feature/template-engine] Move template.php to includes/template
This allows making use of autoloading.

PHPBB3-9726
2011-07-10 00:30:50 +02:00
6ae5a64f6c [feature/template-engine] Fixed absolute path PHP includes, added test.
PHPBB3-9726
2011-05-19 12:18:16 -04:00
7d911e0bc1 [feature/template-engine] Delete @version everywhere.
This is not used since the switch to git.

PHPBB3-9726
2011-05-14 15:30:20 -04:00
70ccf04e06 [feature/template-engine] Moved phpbb_template_filter into own file.
PHPBB3-9726
2011-05-14 15:30:20 -04:00
b04f0a5f70 [feature/template-engine] Delete @access everywhere.
Access specification in php 5 is done directly on functions/properties.

PHPBB3-9726
2011-05-14 15:30:20 -04:00
94560d7086 [feature/template-engine] Make INCLUDEPHP relative to board root.
PHPBB3-9726
2011-05-12 20:13:32 -04:00
d2ac05aa74 [feature/template-engine] Replaced globals with dependency injection.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
345852d240 [feature/template-engine] Clarify cache directory path for set_custom_template
Even if the template may be outside of phpBB, phpBB's cache directory
is still going to be used for storing compiled template code.

PHPBB3-9726
2011-05-12 20:13:31 -04:00
d2daaf0317 [feature/template-engine] Try to handle failed template includes.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
7638bcb560 [feature/template-engine] Rename $filename to $compiled_path for clarity.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
7778771819 [feature/template-engine] Move DEBUG_EXTRA check for $recompile up.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
504acaba6b [feature/template-engine] Deleted useless assignment.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
d6f75e97d6 [feature/template-engine] Added docblocks to get_*_ref in context.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
635460fa6d [feature/template-engine] Fixed reference usage.
Hopefully this is right, I have not checked it against the manual
(assuming the manual even covers these things).

PHPBB3-9726
2011-05-12 20:13:31 -04:00
169c4377e9 [feature/template-engine] Disposed of underscores in property names.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
97d2a6527e [feature/template-engine] Remove commented out error reporting logic.
PHPBB3-9726
2011-05-12 20:13:30 -04:00
0ca7ad66dc [feature/template-engine] Refactor hook logic into a separate function.
PHPBB3-9726
2011-05-12 20:13:30 -04:00
df76885b11 [feature/template-engine] Reinstate phpbb_template#destroy function.
PHPBB3-9726
2011-05-12 20:13:30 -04:00
0462ab3a4a [feature/template-engine] Add back IN_PHPBB preamble.
PHPBB3-9726
2011-05-12 20:13:30 -04:00
49cf28a9c4 [feature/template-engine] Moved template classes to subdirectory.
PHPBB3-9726
2011-05-08 04:06:25 -04:00
84bc485ccc [feature/template-engine] Renamed template executor and friends to renderer.
PHPBB3-9726
2011-05-08 04:03:41 -04:00
1cba674b9a [feature/template-engine] Added docblocks and boilerplate to new files.
PHPBB3-9726
2011-05-07 17:58:56 -04:00
b5444a7d7d [feature/template-engine] Removed more dead code.
PHPBB3-9726
2011-05-07 17:50:48 -04:00
0501640d5d [feature/template-engine] Added phpbb_template_context class.
Objects of this class hold variables assigned to templates.

PHPBB3-9726
2011-05-07 17:47:02 -04:00
d8122df332 [feature/template-engine] Always call ob_end_clean.
We have to stop output buffering even when rendering fails.

PHPBB3-9726
2011-05-05 19:03:46 -04:00
b057d7439e [feature/template-engine] Removed some dead code.
PHPBB3-9726
2011-05-04 01:21:45 -04:00
d06e59f63b [feature/template-engine] Split template execution logic into classes.
Template executor interface defines a template executor object.
It is an object which can execute (i.e. display/render) a template.
Currently there are two implementations:

 * phpbb_template_executor_include includes php code from a file.
 * phpbb_template_executor_eval eval's php code.

PHPBB3-9726
2011-05-04 01:21:44 -04:00
237deb12ce [feature/template-engine] Removed storedb-related logic.
phpBB 3.1 will not provide the option to store templates in the database.

This commit removes code that handles templates stored in database
from the template engine.

PHPBB3-9726
2011-05-04 00:09:39 -04:00
87832d06cc [feature/template-engine] Delete template class, use phpbb_template instead.
PHPBB3-9726
2011-05-04 00:08:20 -04:00
48691b53a6 [feature/template-engine] Rename template_compile methods for clarity.
PHPBB3-9726
2011-05-04 00:07:58 -04:00
d840de560c [feature/template-engine] Extracted compile_stream_to_stream.
PHPBB3-9726
2011-05-01 03:28:53 -04:00
63ca4c2104 [feature/template-engine] Close output stream in compile().
There is no need to leave the stream to the garbage collector,
and the amount of data stuck in it may be substantial.

PHPBB3-9726
2011-05-01 03:25:22 -04:00
234b891a4b [feature/template-engine] Fixed description of assign_display().
This function returns false on failure, which can happen if
display() failed. Document the failure return value.

PHPBB3-9726
2011-05-01 03:14:11 -04:00
c844a277b2 [feature/template-engine] Check return value of display() in assign_display().
If display() failed, propagate the failure out of assign_display().

PHPBB3-9726
2011-05-01 03:09:49 -04:00