Skip to content
This repository was archived by the owner on May 7, 2023. It is now read-only.

Commit dc9fb07

Browse files
author
Jan Halfar
committed
refactored session and worked on docs
1 parent e4c53eb commit dc9fb07

26 files changed

+1061
-573
lines changed

docs/en.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
+ Foomo
22
+ System requirements
3-
+ Installation
43
+ Hierarchy
5-
+ Modules
6-
+ Framework
7-
+ Best Practices
4+
+ Installation
5+
+ Framework

docs/en/framework.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
++ Modules
2+
++ Configuration
3+
++ Session
4+
++ Caching
15
++ Logging
2-
++ Session
6+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Foomo configuration is about configuration objects, that are serialized to \
2+
yaml files in the config directory.
3+
4+
+++ Defining configurations
5+
6+
To define a config object, you have to
7+
8+
* create an object called DomainConfig in yor namespace
9+
* extend Foomo\Config\AbstractConfig
10+
* give the class a NAME constant
11+
* make sure that all properties will serialize to and from yaml
12+
13+
and you may want to override
14+
15+
|| getValue() || if your configured object is too hard to translate to an array ||
16+
|| setValue($value) || if it is really hard to populate the object from an array ||
17+
|| __construct($createDefault = false)|| to make a nice default ||
18+
19+
Foomo\Session\DomainConfig
20+
21+
<geshi type="php" file="<?= Foomo\ROOT . DIRECTORY_SEPARATOR . 'lib'. DIRECTORY_SEPARATOR . 'Foomo' . DIRECTORY_SEPARATOR . 'Session' . DIRECTORY_SEPARATOR . 'DomainConfig.php' ?>">
22+
</geshi>
23+
24+
+++ Configuration API
25+
26+
Check if a configuration exists
27+
28+
<geshi type="php">
29+
$confExists = Foomo\Config::confExists(
30+
Foomo\Module::NAME,
31+
Foomo\Session\DomainConfig::NAME
32+
);
33+
</geshi>
34+
35+
Get a configuration default
36+
37+
<geshi type="php">
38+
39+
$defaultConfig = Foomo\Config::getDefaultConfig(Foomo\Session\DomainConfig::NAME);
40+
41+
</geshi>
42+
43+
Resulting yaml
44+
45+
<geshi type="rails">
46+
<?= Foomo\Yaml::dump(Foomo\Config::getDefaultConfig(Foomo\Session\DomainConfig::NAME)->getValue()) ?>
47+
</geshi>
48+
49+
Load a configuration
50+
51+
<geshi type="php">
52+
// obtaining the session config for the core module
53+
54+
$sessionConfig = Foomo\Config::getConf(
55+
Foomo\Module::NAME,
56+
Foomo\Session\DomainConfig::NAME
57+
);
58+
</geshi>
59+
60+
61+
+++ Breaking configurations / Hiccups
62+
63+
You may break configurations. That is not a bad thing, except in situations, when you broke them so much, that your system will not come up any more. There is a hiccup tool in the toolbox. Which will help you in such situations.
64+
65+
# You broke a config - the system does not respond anymore
66+
# fix your config yaml manually
67+
# use the hiccup page in the toolbox to delete the cache of your broken config
68+
69+
**Bookmark hiccup.php !!**
70+
71+
[<? $hiccup = Foomo\Utils::getServerUrl() . Foomo\ROOT_HTTP . '/hiccup.php'; echo $hiccup . ' ' . $hiccup ?>]

docs/en/framework/modules.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Foomo is all about modularization:
2+
3+
* installing modules
4+
* enabling / disabling modules
5+
* creating new modules
6+
7+
+++ Module hierarchy
8+
9+
|| /cli || command line scripts ||
10+
|| /docs || (wiki) documentation like this document ||
11+
|| /htdocs || resources that will be served by your web server available through an alias like /r/modules/foo/ ||
12+
|| /htdocs/index.php || if no ModuleApp is present, the toolbox will load this into a frameset ||
13+
|| /htdocs/css || style sheets ||
14+
|| /htdocs/css/module.css || common styles for ||
15+
|| /htdocs/js || javascript files ||
16+
|| /htdocs/js/modules.js || common javascript ||
17+
|| /htdocs/img || images ||
18+
|| /htdocs/swf || flash ||
19+
|| /lib || classes are here ||
20+
|| /lib/apps || mvc apps ||
21+
|| /lib/apps/<moduleName> || module app folder - this is optional ||
22+
|| /lib/apps/<moduleName>/RadModuleApp<moduleName>.class.php || module app ||
23+
|| /lib/apps/<moduleName>/RadModuleApp<moduleName>Controller.class.php || module app controller ||
24+
|| /lib/apps/<moduleName>/RadModuleApp<moduleName>Model.class.php || module app model ||
25+
|| /lib/apps/appFoo || sample app folder ||
26+
|| /lib/apps/appFoo/AppFoo.php || sample app extends RadMVCAppAbsract ||
27+
|| /lib/apps/appFoo/AppFooModel.php || sample app model ||
28+
|| /lib/apps/appFoo/AppFooController.php || sample app controller ||
29+
|| /locale || root folder for translation resources in this module ||
30+
|| /locale/en || english translations ||
31+
|| /locale/en_US || american english ||
32+
|| /locale/en_US/<resourceName>.yml || a translation resource yaml ||
33+
|| /views || views ||
34+
|| /tests || PHPUnit unit tests and suites ||
35+
|| /vendor || 3d party / vendor libraries used in the module ||
36+

0 commit comments

Comments
 (0)