From 753f61234b52fe4e40b9669b60964221efbf5094 Mon Sep 17 00:00:00 2001 From: huyanping Date: Mon, 23 Nov 2015 16:48:47 +0800 Subject: [PATCH] update phpdoc --- src/AbstractPool.php | 5 +++ src/Autoloader.php | 56 ------------------------------- src/Cache/CacheInterface.php | 5 +++ src/Cache/RedisCache.php | 5 +++ src/Cache/SharedMemory.php | 5 +++ src/FixedPool.php | 5 +++ src/Lock/FileLock.php | 5 +++ src/Lock/LockInterface.php | 5 +++ src/Lock/Semaphore.php | 5 +++ src/ParallelPool.php | 5 +++ src/Pool.php | 5 +++ src/Queue/QueueInterface.php | 6 ++++ src/Queue/RedisQueue.php | 5 +++ src/Queue/SystemVMessageQueue.php | 5 +++ tests/AutoloaderTest.php | 17 ---------- 15 files changed, 66 insertions(+), 73 deletions(-) delete mode 100644 src/Autoloader.php delete mode 100644 tests/AutoloaderTest.php diff --git a/src/AbstractPool.php b/src/AbstractPool.php index d7ec9f8..f240fc9 100644 --- a/src/AbstractPool.php +++ b/src/AbstractPool.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork; +/** + * processes' pool + * + * @package Jenner\SimpleFork + */ abstract class AbstractPool { /** diff --git a/src/Autoloader.php b/src/Autoloader.php deleted file mode 100644 index 8a5b241..0000000 --- a/src/Autoloader.php +++ /dev/null @@ -1,56 +0,0 @@ -path = $path; - $this->prefix = __NAMESPACE__ . '\\'; - $this->prefix_length = strlen($this->prefix); - } - - /** - * register simple-fork autoload - */ - public static function register() - { - spl_autoload_register(array(new self(), 'autoload')); - } - - /** - * @param $class_name - */ - protected function autoload($class_name) - { - if (0 !== strpos($class_name, $this->prefix)) { - return; - } - $short_name = str_replace('\\', DIRECTORY_SEPARATOR, substr($class_name, $this->prefix_length)); - $filename = $this->path . DIRECTORY_SEPARATOR . $short_name . '.php'; - if (file_exists($filename)) { - require $filename; - } - } -} \ No newline at end of file diff --git a/src/Cache/CacheInterface.php b/src/Cache/CacheInterface.php index a80a01f..da96398 100644 --- a/src/Cache/CacheInterface.php +++ b/src/Cache/CacheInterface.php @@ -8,6 +8,11 @@ namespace Jenner\SimpleFork\Cache; +/** + * cache for processes shared variables + * + * @package Jenner\SimpleFork\Cache + */ interface CacheInterface { diff --git a/src/Cache/RedisCache.php b/src/Cache/RedisCache.php index 84fd3bb..d3cbdcd 100644 --- a/src/Cache/RedisCache.php +++ b/src/Cache/RedisCache.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Cache; +/** + * redis cache + * + * @package Jenner\SimpleFork\Cache + */ class RedisCache implements CacheInterface { diff --git a/src/Cache/SharedMemory.php b/src/Cache/SharedMemory.php index 75a80e6..a08538e 100644 --- a/src/Cache/SharedMemory.php +++ b/src/Cache/SharedMemory.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Cache; +/** + * shared memory cache + * + * @package Jenner\SimpleFork\Cache + */ class SharedMemory implements CacheInterface { /** diff --git a/src/FixedPool.php b/src/FixedPool.php index 9b3fac0..ba25681 100644 --- a/src/FixedPool.php +++ b/src/FixedPool.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork; +/** + * fixed pool + * + * @package Jenner\SimpleFork + */ class FixedPool extends AbstractPool { /** diff --git a/src/Lock/FileLock.php b/src/Lock/FileLock.php index 14610ff..7101c2a 100644 --- a/src/Lock/FileLock.php +++ b/src/Lock/FileLock.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Lock; +/** + * file lock + * + * @package Jenner\SimpleFork\Lock + */ class FileLock implements LockInterface { /** diff --git a/src/Lock/LockInterface.php b/src/Lock/LockInterface.php index 4f9aee1..e55c319 100644 --- a/src/Lock/LockInterface.php +++ b/src/Lock/LockInterface.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Lock; +/** + * lock for processes to mutual exclusion + * + * @package Jenner\SimpleFork\Lock + */ interface LockInterface { /** diff --git a/src/Lock/Semaphore.php b/src/Lock/Semaphore.php index 4f0ee8d..803b8e6 100644 --- a/src/Lock/Semaphore.php +++ b/src/Lock/Semaphore.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Lock; +/** + * sem lock + * + * @package Jenner\SimpleFork\Lock + */ class Semaphore implements LockInterface { /** diff --git a/src/ParallelPool.php b/src/ParallelPool.php index de8caf0..f5d8d5c 100644 --- a/src/ParallelPool.php +++ b/src/ParallelPool.php @@ -8,6 +8,11 @@ namespace Jenner\SimpleFork; +/** + * parallel pool + * + * @package Jenner\SimpleFork + */ class ParallelPool extends AbstractPool { diff --git a/src/Pool.php b/src/Pool.php index 134110c..526eee0 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork; +/** + * pool + * + * @package Jenner\SimpleFork + */ class Pool extends AbstractPool { diff --git a/src/Queue/QueueInterface.php b/src/Queue/QueueInterface.php index c5a13e8..0bad047 100644 --- a/src/Queue/QueueInterface.php +++ b/src/Queue/QueueInterface.php @@ -8,6 +8,12 @@ namespace Jenner\SimpleFork\Queue; + +/** + * queue for processes to transfer data + * + * @package Jenner\SimpleFork\Queue + */ interface QueueInterface { /** diff --git a/src/Queue/RedisQueue.php b/src/Queue/RedisQueue.php index 534ccc5..b42875c 100644 --- a/src/Queue/RedisQueue.php +++ b/src/Queue/RedisQueue.php @@ -8,6 +8,11 @@ namespace Jenner\SimpleFork\Queue; +/** + * redis queue + * + * @package Jenner\SimpleFork\Queue + */ class RedisQueue implements QueueInterface { /** diff --git a/src/Queue/SystemVMessageQueue.php b/src/Queue/SystemVMessageQueue.php index 7205080..84fb52f 100644 --- a/src/Queue/SystemVMessageQueue.php +++ b/src/Queue/SystemVMessageQueue.php @@ -9,6 +9,11 @@ namespace Jenner\SimpleFork\Queue; +/** + * system v message queue + * + * @package Jenner\SimpleFork\Queue + */ class SystemVMessageQueue implements QueueInterface { /** diff --git a/tests/AutoloaderTest.php b/tests/AutoloaderTest.php deleted file mode 100644 index f8faa16..0000000 --- a/tests/AutoloaderTest.php +++ /dev/null @@ -1,17 +0,0 @@ -assertTrue(class_exists("\\Jenner\\SimpleFork\\Lock\\FileLock")); - $this->assertTrue(class_exists("\\Jenner\\SimpleFork\\Process")); - } -} \ No newline at end of file