Notes in this project's code
Notes are marked in code by writing @NOTE
. Everything on the line after it is captured.
[line number] Trimmed Text of the line
Notes for code/addon/Cache.php
- [143] Does not check if cache is valid
- [156] Does not check if cache is enabled, existence of file or meta file, or expiration of file
- [170] This implementation is likely inefficient (not benchmarked)
- [171] Creates the cache directory if it does not exist. This feature may be removed in the future
Notes for code/addon/Hook.php
- [23] Hook addon has an 'on' prefix ... I think I might discontinue this feature
Notes for code/addon/Redirect.php
- [7] addon_name is 'goto'
Notes for code/addon/Resources.php
- [37] not currently implemented
- [38] $_GET['true'] or $_GET['false'] will change this setting
Notes for code/addon/Router.php
- [11]
$varDelim
is a string of characters used to separate dynamic portions of a url. - [12]
$varDelim
is a global setting, but you can change it, add routes, change it, add routes, etc. - [13]
pattern
refers to an unparsed url pattern like/{category}/{blog_name}/
- [14] added routers take a
\Lia\Obj\Request
object - [15] route derivers accept
false
and return array of patterns or a\Lia\Obj\Request
object - [16] test patterns (or testReg) are simplified patterns with
?
in place of dynamic paramater names & are used internally - [17]
$routeMap
contains all the info needed for selecting which route to use - [18] optional paramaters (
/blog/{?optional}/
) only allow for one optional paramater - [28] this setting is global across all routes. You can circumvent this by using a second router addon
- [54] Router provides the prefix 'route' which i may remove in the future
- [65] Router addon uses the 'on' prefix for hooks.
- [162] '.php' extension is removed when converting a file path to a url pattern
- [166] if
.php
extension is removed, then a trailing slash is added. This is a bug and may be fixed in the future. - [171] 'index' filename is removed when converting a file path to a url pattern
- [180] if there is no file extension in the final pattern, then a trailing slash is added (if .php extension is removed, trailing slash is also added, even if there is another extension. This is a bug and may be fixed in the future.)
- [184]
///
and//
are replaced with a single/
- [343] docblock not done for addDirectoryRoutes()
Notes for code/addon/Seo.php
- [52] Each key corresponds to a method on this class
- [53] Each array value will be expanded as multiple paramaters
- [54] Each string value will be used as a single paramater
Notes for code/addon/Server.php
- [18] Nov 30, 2021: Not currently used
- [26] $response->useTheme must ALSO be
true
for theme to be used. - [106] if
$_GET['theme']=='json'
, response will be returned as json. Idr the format exactly. You can override the 'themeName' of the Server addon inRouteResolved
. - [177] any public file route not ending in
.php
will set$response->useTheme = false;
and add static file & cache headers. - [245] Nov 30, 2021: Not currently in use
- [260] info about which paramaters are passed to public file route
Notes for code/addon/View.php
- [173] (jan 17, 2022) only scans cur_level ... does not descend
Notes for code/addon/View.php.bak
- [58] The second arg passed to your callable
$args
is a key=>value array that contains args passed to theview('view_name', $args)
call - [71] null-namespace refers to
$lia->view('view-name')
- [72] namespace refers to
$lia->view('namespace:view-name')
- [73] Always sets null-namespace view if it's not already set. (ignores conflictMode)
Notes for code/class/Addon.php
- [49] Addon::init_lia() is called with paramaters, but not defined with them, because existing addons are already implementing the naked version of this method. This will surely be updated in the future, likely with a different method name.
- [60] Addon::onPackageReady() is called with paramaters, but not defined with them, because existing addons are already implementing the naked version of this method. This will surely be updated in the future, likely with a different method name.
Notes for code/class/OldPackage.php
- [95] removed type from first param to support incremental backward-compatible changes
Notes for code/class/Package.php
- [54] subclass
\Lia\Package
or\Lia\Package\Server
and implement a custom 'bootstrap()' method.
Notes for code/class/Router/FastFileRouter.php
- [35] does not send php files ...
Notes for code/class/Server.php
- [91] I'm adding dir
/theme/
as a view dir in Server package setup, and I don't know why. I should remove this probably. - [104] old 'setup_public_routes()' method has been disabled. It had an error & doesn't appear to be used
Notes for code/class/Simple.php
- [226] there is no path normalization
Notes for test/run/Addon/Router.Other.php
- [37] this test changes the varDelim
- [68] this test changes the varDelim
Notes for test/run/Addon/Seo.php
- [62] if the underlying html changes, just copy+paste output from the test & copy it into the HTML HEREDOC
Notes for test/run/Other/BasePackage.php
- [12] this is NOT a test of the addons themselves.
- [14] nov 18 2021: this is a sample of using the base package to craft a unified environment in a functional manner. There will be a Server package that ... basically wraps all of this up. First, I will probably write another test that does these same things, but via package hooks or something? Like using $addon->package_ready($package_dir) or something instead of scripting each addon's setup here. It's hard to tell rn
Notes for test/run/Other/QualityOfLife.php
- [6] (12-16-2021) tests new quality of life features