From 8c501e08b744d77152912823f5a9da1dca4f1c3b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 4 Aug 2016 14:55:37 -0400 Subject: [PATCH] First commit -- split from timw4mail/HummingBirdAnimeClient --- .gitignore | 29 ++ .gitlab-ci.yml | 37 +++ README.md | 3 + build/animeclient_header_comment.txt | 11 + build/ion_header_comment.txt | 10 + build/phpdox.xml | 131 +++++++++ build/phpunit.xml | 33 +++ build/update_header_comments.php | 70 +++++ composer.json | 29 ++ humbug.json.dist | 12 + phpdoc.dist.xml | 16 ++ phpunit.xml | 25 ++ src/Aviat/Ion/ArrayWrapper.php | 34 +++ src/Aviat/Ion/Cache/CacheInterface.php | 48 ++++ src/Aviat/Ion/Cache/CacheManager.php | 117 ++++++++ .../Ion/Cache/Driver/DriverInterface.php | 51 ++++ src/Aviat/Ion/Cache/Driver/DriverTrait.php | 62 +++++ src/Aviat/Ion/Cache/Driver/NullDriver.php | 74 +++++ src/Aviat/Ion/Cache/Driver/RedisDriver.php | 117 ++++++++ src/Aviat/Ion/Cache/Driver/SQLDriver.php | 119 ++++++++ src/Aviat/Ion/Config.php | 106 +++++++ src/Aviat/Ion/ConfigInterface.php | 41 +++ src/Aviat/Ion/Di/Container.php | 171 ++++++++++++ src/Aviat/Ion/Di/ContainerAware.php | 49 ++++ src/Aviat/Ion/Di/ContainerAwareInterface.php | 36 +++ src/Aviat/Ion/Di/ContainerInterface.php | 54 ++++ .../Ion/Di/Exception/ContainerException.php | 21 ++ .../Ion/Di/Exception/NotFoundException.php | 22 ++ src/Aviat/Ion/Enum.php | 49 ++++ src/Aviat/Ion/Exception/ConfigException.php | 20 ++ src/Aviat/Ion/Friend.php | 129 +++++++++ src/Aviat/Ion/Json.php | 130 +++++++++ src/Aviat/Ion/JsonException.php | 18 ++ src/Aviat/Ion/Model.php | 21 ++ src/Aviat/Ion/Model/DB.php | 51 ++++ src/Aviat/Ion/StaticInstance.php | 63 +++++ src/Aviat/Ion/StringWrapper.php | 33 +++ .../Ion/Transformer/AbstractTransformer.php | 42 +++ .../Ion/Transformer/TransformerInterface.php | 27 ++ src/Aviat/Ion/Type/ArrayType.php | 261 ++++++++++++++++++ src/Aviat/Ion/Type/StringType.php | 23 ++ src/Aviat/Ion/View.php | 137 +++++++++ src/Aviat/Ion/View/HtmlView.php | 69 +++++ src/Aviat/Ion/View/HttpView.php | 91 ++++++ src/Aviat/Ion/View/JsonView.php | 47 ++++ tests/Ion/BaseModelTest.php | 12 + tests/Ion/Cache/CacheManagerTest.php | 40 +++ tests/Ion/Cache/Driver/CacheDriverBase.php | 43 +++ tests/Ion/Cache/Driver/NullDriverTest.php | 17 ++ tests/Ion/Cache/Driver/RedisDriver2Test.php | 38 +++ tests/Ion/Cache/Driver/RedisDriverTest.php | 29 ++ tests/Ion/Cache/Driver/SQLDriverTest.php | 20 ++ tests/Ion/ConfigTest.php | 120 ++++++++ tests/Ion/Di/ContainerAwareTest.php | 39 +++ tests/Ion/Di/ContainerTest.php | 91 ++++++ tests/Ion/EnumTest.php | 68 +++++ tests/Ion/FriendTest.php | 56 ++++ tests/Ion/JsonTest.php | 68 +++++ tests/Ion/Model/BaseDBModelTest.php | 12 + .../Transformer/AbstractTransformerTest.php | 89 ++++++ tests/Ion/Type/ArrayTypeTest.php | 173 ++++++++++++ tests/Ion/View/HtmlViewTest.php | 25 ++ tests/Ion/View/HttpViewTest.php | 46 +++ tests/Ion/View/JsonViewTest.php | 43 +++ tests/Ion_TestCase.php | 117 ++++++++ tests/TestSessionHandler.php | 53 ++++ tests/bootstrap.php | 76 +++++ tests/di.php | 41 +++ tests/mocks.php | 134 +++++++++ tests/test_data/invalid_json.json | 1 + tests/test_data/valid_json.json | 5 + tests/test_views/test_view.php | 1 + 72 files changed, 4196 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml create mode 100644 README.md create mode 100644 build/animeclient_header_comment.txt create mode 100644 build/ion_header_comment.txt create mode 100644 build/phpdox.xml create mode 100644 build/phpunit.xml create mode 100644 build/update_header_comments.php create mode 100644 composer.json create mode 100644 humbug.json.dist create mode 100644 phpdoc.dist.xml create mode 100644 phpunit.xml create mode 100644 src/Aviat/Ion/ArrayWrapper.php create mode 100644 src/Aviat/Ion/Cache/CacheInterface.php create mode 100644 src/Aviat/Ion/Cache/CacheManager.php create mode 100644 src/Aviat/Ion/Cache/Driver/DriverInterface.php create mode 100644 src/Aviat/Ion/Cache/Driver/DriverTrait.php create mode 100644 src/Aviat/Ion/Cache/Driver/NullDriver.php create mode 100644 src/Aviat/Ion/Cache/Driver/RedisDriver.php create mode 100644 src/Aviat/Ion/Cache/Driver/SQLDriver.php create mode 100644 src/Aviat/Ion/Config.php create mode 100644 src/Aviat/Ion/ConfigInterface.php create mode 100644 src/Aviat/Ion/Di/Container.php create mode 100644 src/Aviat/Ion/Di/ContainerAware.php create mode 100644 src/Aviat/Ion/Di/ContainerAwareInterface.php create mode 100644 src/Aviat/Ion/Di/ContainerInterface.php create mode 100644 src/Aviat/Ion/Di/Exception/ContainerException.php create mode 100644 src/Aviat/Ion/Di/Exception/NotFoundException.php create mode 100644 src/Aviat/Ion/Enum.php create mode 100644 src/Aviat/Ion/Exception/ConfigException.php create mode 100644 src/Aviat/Ion/Friend.php create mode 100644 src/Aviat/Ion/Json.php create mode 100644 src/Aviat/Ion/JsonException.php create mode 100644 src/Aviat/Ion/Model.php create mode 100644 src/Aviat/Ion/Model/DB.php create mode 100644 src/Aviat/Ion/StaticInstance.php create mode 100644 src/Aviat/Ion/StringWrapper.php create mode 100644 src/Aviat/Ion/Transformer/AbstractTransformer.php create mode 100644 src/Aviat/Ion/Transformer/TransformerInterface.php create mode 100644 src/Aviat/Ion/Type/ArrayType.php create mode 100644 src/Aviat/Ion/Type/StringType.php create mode 100644 src/Aviat/Ion/View.php create mode 100644 src/Aviat/Ion/View/HtmlView.php create mode 100644 src/Aviat/Ion/View/HttpView.php create mode 100644 src/Aviat/Ion/View/JsonView.php create mode 100644 tests/Ion/BaseModelTest.php create mode 100644 tests/Ion/Cache/CacheManagerTest.php create mode 100644 tests/Ion/Cache/Driver/CacheDriverBase.php create mode 100644 tests/Ion/Cache/Driver/NullDriverTest.php create mode 100644 tests/Ion/Cache/Driver/RedisDriver2Test.php create mode 100644 tests/Ion/Cache/Driver/RedisDriverTest.php create mode 100644 tests/Ion/Cache/Driver/SQLDriverTest.php create mode 100644 tests/Ion/ConfigTest.php create mode 100644 tests/Ion/Di/ContainerAwareTest.php create mode 100644 tests/Ion/Di/ContainerTest.php create mode 100644 tests/Ion/EnumTest.php create mode 100644 tests/Ion/FriendTest.php create mode 100644 tests/Ion/JsonTest.php create mode 100644 tests/Ion/Model/BaseDBModelTest.php create mode 100644 tests/Ion/Transformer/AbstractTransformerTest.php create mode 100644 tests/Ion/Type/ArrayTypeTest.php create mode 100644 tests/Ion/View/HtmlViewTest.php create mode 100644 tests/Ion/View/HttpViewTest.php create mode 100644 tests/Ion/View/JsonViewTest.php create mode 100644 tests/Ion_TestCase.php create mode 100644 tests/TestSessionHandler.php create mode 100644 tests/bootstrap.php create mode 100644 tests/di.php create mode 100644 tests/mocks.php create mode 100644 tests/test_data/invalid_json.json create mode 100644 tests/test_data/valid_json.json create mode 100644 tests/test_views/test_view.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78031d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +.codelite +.phing_targets +.sonar/ +*.phprj +*.workspace +vendor +**/cache/** +**/logs/** +**/coverage/** +**/docs/** +**/node_modules/** +public/images/* +composer.lock +*.sqlite +*.db +*.sqlite3 +docs/* +tests/test_data/sessions/* +cache.properties +build/** +!build/*.txt +!build/*.xml +!build/*.php +app/config/*.toml +!app/config/*.toml.example +phinx.yml +.idea/ +Caddyfile +build/humbuglog.txt \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..265afb8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +# Composer stores all downloaded packages in the vendor/ directory. +# Do not use the following if the vendor/ directory is commited to +# your git repository. +cache: + paths: + - vendor/ + +services: + - redis:latest + +test:5.6: + before_script: + - bash build/docker_install.sh > /dev/null + - curl -sS https://getcomposer.org/installer | php + - php composer.phar install --no-dev + image: php:5.6 + script: + - phpunit -c build + +test:7: + before_script: + - bash build/docker_install.sh > /dev/null + - curl -sS https://getcomposer.org/installer | php + - php composer.phar install --no-dev + image: php:7 + script: + - phpunit -c build + +test:hhvm: + before_script: + - /usr/local/bin/composer self-update + - curl -Lo /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar + - chmod +x /usr/local/bin/phpunit + - composer install --no-dev + image: 51systems/docker-gitlab-ci-runner-hhvm + script: + - phpunit -c build \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc2ffc9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Ion + +Ion is a set of helpful PHP libraries for general web development \ No newline at end of file diff --git a/build/animeclient_header_comment.txt b/build/animeclient_header_comment.txt new file mode 100644 index 0000000..a2a4ecb --- /dev/null +++ b/build/animeclient_header_comment.txt @@ -0,0 +1,11 @@ +/** + * Hummingbird Anime Client + * + * An API client for Hummingbird to manage anime and manga watch lists + * + * @package HummingbirdAnimeClient + * @author Timothy J. Warren + * @copyright Copyright (c) 2015 - 2016 + * @link https://github.com/timw4mail/HummingBirdAnimeClient + * @license MIT + */ \ No newline at end of file diff --git a/build/ion_header_comment.txt b/build/ion_header_comment.txt new file mode 100644 index 0000000..50a3025 --- /dev/null +++ b/build/ion_header_comment.txt @@ -0,0 +1,10 @@ +/** + * Ion + * + * Building blocks for web development + * + * @package Ion + * @author Timothy J. Warren + * @copyright Copyright (c) 2015 - 2016 + * @license MIT + */ \ No newline at end of file diff --git a/build/phpdox.xml b/build/phpdox.xml new file mode 100644 index 0000000..0be4b97 --- /dev/null +++ b/build/phpdox.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +