*/
namespace Friendica\Core;
-use Friendica\Core\Cache\CacheDriverFactory;
+use Friendica\Factory\CacheDriverFactory;
/**
* @brief Class for storing data for a short time
+++ /dev/null
-<?php
-
-namespace Friendica\Core\Cache;
-
-use Friendica\Core\Config;
-
-/**
- * Class CacheDriverFactory
- *
- * @package Friendica\Core\Cache
- *
- * A basic class to generate a CacheDriver
- */
-class CacheDriverFactory
-{
- /**
- * This method creates a CacheDriver for the given cache driver name
- *
- * @param string $driver The name of the cache driver
- * @return ICacheDriver The instance of the CacheDriver
- * @throws \Exception The exception if something went wrong during the CacheDriver creation
- */
- public static function create($driver) {
-
- switch ($driver) {
- case 'memcache':
- $memcache_host = Config::get('system', 'memcache_host');
- $memcache_port = Config::get('system', 'memcache_port');
-
- return new MemcacheCacheDriver($memcache_host, $memcache_port);
- break;
-
- case 'memcached':
- $memcached_hosts = Config::get('system', 'memcached_hosts');
-
- return new MemcachedCacheDriver($memcached_hosts);
- break;
- case 'redis':
- $redis_host = Config::get('system', 'redis_host');
- $redis_port = Config::get('system', 'redis_port');
-
- return new RedisCacheDriver($redis_host, $redis_port);
- break;
- default:
- return new DatabaseCacheDriver();
- }
- }
-}
namespace Friendica\Core;
-use Friendica\Core\Cache\CacheDriverFactory;
+use Friendica\Factory\CacheDriverFactory;
use Friendica\Core\Cache\IMemoryCacheDriver;
/**
--- /dev/null
+## Friendica\Core
+
+The Core namespace contains classes, which are essential to Friendica.
+
\ No newline at end of file
--- /dev/null
+<?php
+
+namespace Friendica\Factory;
+
+use Friendica\Core\Cache\ICacheDriver;
+use Friendica\Core\Config;
+use Friendica\Core\Cache;
+
+/**
+ * Class CacheDriverFactory
+ *
+ * @package Friendica\Core\Cache
+ *
+ * A basic class to generate a CacheDriver
+ */
+class CacheDriverFactory
+{
+ /**
+ * This method creates a CacheDriver for the given cache driver name
+ *
+ * @param string $driver The name of the cache driver
+ * @return ICacheDriver The instance of the CacheDriver
+ * @throws \Exception The exception if something went wrong during the CacheDriver creation
+ */
+ public static function create($driver) {
+
+ switch ($driver) {
+ case 'memcache':
+ $memcache_host = Config::get('system', 'memcache_host');
+ $memcache_port = Config::get('system', 'memcache_port');
+
+ return new Cache\MemcacheCacheDriver($memcache_host, $memcache_port);
+ break;
+
+ case 'memcached':
+ $memcached_hosts = Config::get('system', 'memcached_hosts');
+
+ return new Cache\MemcachedCacheDriver($memcached_hosts);
+ break;
+ case 'redis':
+ $redis_host = Config::get('system', 'redis_host');
+ $redis_port = Config::get('system', 'redis_port');
+
+ return new Cache\RedisCacheDriver($redis_host, $redis_port);
+ break;
+ default:
+ return new Cache\DatabaseCacheDriver();
+ }
+ }
+}
--- /dev/null
+## Friendica\Factory
+
+This namespace contains Factories.
+A Factory is used to create specific objects based on its configuration.
+
+See [Factory Method](https://designpatternsphp.readthedocs.io/en/latest/Creational/FactoryMethod/README.html)
+
+Use the classes inside this directory if you want to change the way how new objects should get created.
+Don't use the classes to change the behaviour of the concrete objects.
--- /dev/null
+### Friendica\Model
+
+Models are the glue between the business logic of the app and the datastore(s).
+
+In the namespace Model should only be static classes that interact with the DB with the same name as a database table.
\ No newline at end of file
--- /dev/null
+## Friendica\Module
+
+The Module namespace contains the different modules of Friendica.
+Each module is loaded through the [`App`](https://github.com/friendica/friendica/blob/develop/src/App.php).
+
+Rules for Modules:
+- Named like the call (i.e. https://friendica.test/contact => `Contact`)
+- Start with capitals and are **not** camelCased.
+- Directly interacting with a given request (POST or GET)
+- Extending [`BaseModule`](https://github.com/friendica/friendica/blob/develop/src/BaseModule.php).
\ No newline at end of file
--- /dev/null
+## Friendica\Object
+
+The namespace Object contains dynamic classes which are **note** directly interacting with the datastore.
+
+They are used to implement business logic for a particular object (i.e. an Image).
\ No newline at end of file
--- /dev/null
+## Friendica\Worker
+
+The Worker namespace contains all asynchronous workers of Friendica.
+The all have to implement the function `public static function execute()`.
+
+They are all executed by the [`Worker`](https://github.com/friendica/friendica/blob/develop/src/Core/Worker.php).
\ No newline at end of file