Browse Source

Adding REAMDEs to directories

pull/6923/head
Philipp Holzer 3 years ago
committed by Hypolite Petovan
parent
commit
8237e73e26
  1. 2
      src/Core/Cache.php
  2. 2
      src/Core/Lock.php
  3. 4
      src/Core/README.md
  4. 12
      src/Factory/CacheDriverFactory.php
  5. 9
      src/Factory/README.md
  6. 5
      src/Model/README.md
  7. 10
      src/Module/README.md
  8. 5
      src/Object/README.md
  9. 6
      src/Worker/README.md

2
src/Core/Cache.php

@ -4,7 +4,7 @@
*/
namespace Friendica\Core;
use Friendica\Core\Cache\CacheDriverFactory;
use Friendica\Factory\CacheDriverFactory;
/**
* @brief Class for storing data for a short time

2
src/Core/Lock.php

@ -7,7 +7,7 @@
namespace Friendica\Core;
use Friendica\Core\Cache\CacheDriverFactory;
use Friendica\Factory\CacheDriverFactory;
use Friendica\Core\Cache\IMemoryCacheDriver;
/**

4
src/Core/README.md

@ -0,0 +1,4 @@
## Friendica\Core
The Core namespace contains classes, which are essential to Friendica.

12
src/Core/Cache/CacheDriverFactory.php → src/Factory/CacheDriverFactory.php

@ -1,8 +1,10 @@
<?php
namespace Friendica\Core\Cache;
namespace Friendica\Factory;
use Friendica\Core\Cache\ICacheDriver;
use Friendica\Core\Config;
use Friendica\Core\Cache;
/**
* Class CacheDriverFactory
@ -27,22 +29,22 @@ class CacheDriverFactory
$memcache_host = Config::get('system', 'memcache_host');
$memcache_port = Config::get('system', 'memcache_port');
return new MemcacheCacheDriver($memcache_host, $memcache_port);
return new Cache\MemcacheCacheDriver($memcache_host, $memcache_port);
break;
case 'memcached':
$memcached_hosts = Config::get('system', 'memcached_hosts');
return new MemcachedCacheDriver($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 RedisCacheDriver($redis_host, $redis_port);
return new Cache\RedisCacheDriver($redis_host, $redis_port);
break;
default:
return new DatabaseCacheDriver();
return new Cache\DatabaseCacheDriver();
}
}
}

9
src/Factory/README.md

@ -0,0 +1,9 @@
## 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.

5
src/Model/README.md

@ -0,0 +1,5 @@
### 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.

10
src/Module/README.md

@ -0,0 +1,10 @@
## 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).

5
src/Object/README.md

@ -0,0 +1,5 @@
## 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).

6
src/Worker/README.md

@ -0,0 +1,6 @@
## 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).
Loading…
Cancel
Save