Adding REAMDEs to directories

pull/6923/head
Philipp Holzer 2019-03-03 15:05:35 +01:00 zatwierdzone przez Hypolite Petovan
rodzic 3261ffbd99
commit 8237e73e26
9 zmienionych plików z 48 dodań i 7 usunięć

Wyświetl plik

@ -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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -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();
}
}
}

Wyświetl plik

@ -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.

Wyświetl plik

@ -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.

Wyświetl plik

@ -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).

Wyświetl plik

@ -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).

Wyświetl plik

@ -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).