From c007b6497478ee9e925f45598be325be9813024c Mon Sep 17 00:00:00 2001 From: Hunter Perrin Date: Thu, 26 Oct 2017 17:31:04 -0700 Subject: [PATCH] Version bump. Last Composer update for this package. Install server and pubsub packages directly to get Nymph 2. --- README.md | 130 ++------------------------------------------------ composer.json | 8 ++-- composer.lock | 70 +++++++++++++-------------- 3 files changed, 42 insertions(+), 166 deletions(-) diff --git a/README.md b/README.md index 6d90def..33db293 100644 --- a/README.md +++ b/README.md @@ -1,132 +1,8 @@ # Nymph - collaborative app data -[![Build Status](https://img.shields.io/travis/sciactive/nymph-server/master.svg?style=flat)](http://travis-ci.org/sciactive/nymph-server) [![Latest Stable Version](https://img.shields.io/packagist/v/sciactive/nymph.svg?style=flat)](https://packagist.org/packages/sciactive/nymph) [![License](https://img.shields.io/packagist/l/sciactive/nymph.svg?style=flat)](https://packagist.org/packages/sciactive/nymph) [![Open Issues](https://img.shields.io/github/issues/sciactive/nymph.svg?style=flat)](https://github.com/sciactive/nymph/issues) - -Nymph is an object data store that is easy to use in JavaScript and PHP. - -## Installation - -You can install Nymph with Composer for the server side files, and NPM for the client side files. - -```sh -composer require sciactive/nymph - -npm install --save nymph-client -``` - -This repository is a container for the [server](https://github.com/sciactive/nymph-server), [pubsub](https://github.com/sciactive/nymph-pubsub), and [client](https://github.com/sciactive/nymph-client) files. - -## Demos - -Try opening the same one in two windows, and see one window react to changes in the other. - -- [Todo](http://nymph-demo.herokuapp.com/examples/todo/svelte/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/todo/)) -- [Sudoku](http://nymph-demo.herokuapp.com/examples/sudoku/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/sudoku)) -- [Simple Clicker](http://nymph-demo.herokuapp.com/examples/clicker/) ([source](https://github.com/sciactive/nymph-examples/tree/master/examples/clicker)) - -## Nymph Query Language vs Just SQL - -#### Nymph Query from Frontend - -```js -Nymph.getEntities({"class":"BlogPost"}, {"type":"&", "like":["title","%easy%"], "data":["archived",false]}).then(function(entities){ - console.log(entities); -}, function(){ - alert("Error"); -}); -``` -*No need for a specific endpoint here. Nymph uses the same endpoint for all client side queries.* - -#### Equivalent SQL Query from Frontend - -```js -$.ajax({ - "url": "titlesearch.php", - "data": {"title":"%not as easy%","archived":"false"}, - "dataType": "JSON", - "success": function(entities){ - console.log(entities); - }, - "error": function(){ - alert("Error"); - } -}); -``` -```php -prepare("SELECT * FROM BlogPosts WHERE title LIKE '?' AND archived=?")) { - $stmt->bind_param("ss", $title, $archived); - $stmt->execute(); - $result = $stmt->get_result(); - while ($row = $result->fetch_assoc()) { - $entities[] = $row; - } - $stmt->close(); -} - -header("Content-Type: application/json"); -echo json_encode($entities); -$mysqli->close(); -``` -*Without Nymph, every time you want a new type of query available on the frontend, you're going to need to either modify this endpoint or create a new one.* - -## What is Nymph? - -Nymph takes the objects that hold your data and translates them to relational data to be stored in a SQL database. Nymph has two parts, in both JavaScript and PHP: - -
-
Nymph Object
-
The Nymph object is where you communicate with the database and make queries. It also has sorting methods to help you sort arrays of entities.
-
Entity Class
-
The Entity class is what you will extend to make data objects.
-
- -Both of these exist in PHP and JavaScript, and interacting with them in either environment is very similar. In JavaScript, since data can't be retrieved immediately, Nymph will return promises instead of actual data. - -Nymph in JavaScript handles any database interaction by using a NymphREST endpoint. You can build an endpoint by following the instructions in the [Setup Guide](https://github.com/sciactive/nymph/wiki/Setup-Guide). - -## Setting up a Nymph Application - -
Quick Setup with Composer
+This used to be a package for Composer to include both `sciactive/nymph-server` and `sciactive/nymph-pubsub`. As of Nymph version 2.0, this package will no longer be updated. Instead, you should install nymph-server and nymph-pubsub directly. ```sh -composer require sciactive/nymph +composer require sciactive/nymph-server +composer require sciactive/nymph-pubsub ``` -```php -require 'vendor/autoload.php'; -use Nymph\Nymph; -Nymph::configure([ - 'MySQL' => [ - 'host' => 'your_db_host', - 'database' => 'your_database', - 'user' => 'your_user', - 'password' => 'your_password' - ] -]); - -// You are set up. Now make a class like `MyEntity` and use it. - -require 'my_autoloader.php'; - -$myEntity = new MyEntity(); -$myEntity->myVar = "myValue"; -$myEntity->save(); - -$allMyEntities = Nymph::getEntities(['class' => 'MyEntity']); -``` - -For a thorough step by step guide to setting up Nymph on your own server, visit the [Setup Guide](https://github.com/sciactive/nymph/wiki/Setup-Guide). - -## Documentation - -Check out the documentation in the wiki, [Technical Documentation Index](https://github.com/sciactive/nymph/wiki/Technical-Documentation). - -## What's Next - -Up next is an ACL system for Nymph. It will allow you to restrict what entities a user, or group of users, has access to. It will include a user and group entity class. It will soon be available at [tilmeld.org](http://tilmeld.org/). diff --git a/composer.json b/composer.json index 66ad004..bdefab6 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "sciactive/nymph", - "description": "Powerful object data storage and querying for collaborative web apps.", - "version": "1.6.0", - "time": "2017-07-21", + "description": "Don't use sciactive/nymph anymore. You should use sciactive/nymph-server and sciactive/nymph-pubsub.", + "version": "1.6.2", + "time": "2017-10-26", "homepage": "http://nymph.io/", "type": "library", "authors": [ @@ -36,7 +36,7 @@ ] }, "require": { - "sciactive/nymph-server": "1.6.0", + "sciactive/nymph-server": "1.6.2", "sciactive/nymph-pubsub": "1.6.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 2af69e8..2d2e51f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "9038c761ea844c5ab4996343573b00fd", + "content-hash": "c88050a23c51e1363dda6fa52bdfa8db", "packages": [ { "name": "cboden/ratchet", @@ -607,16 +607,16 @@ }, { "name": "sciactive/hookphp", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sciactive/hookphp.git", - "reference": "f0605a702ee42eeb1d58220c1ad900e47a0b37cb" + "reference": "adde48e776bd98d01a639c9bccff0fbca0cea6d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sciactive/hookphp/zipball/f0605a702ee42eeb1d58220c1ad900e47a0b37cb", - "reference": "f0605a702ee42eeb1d58220c1ad900e47a0b37cb", + "url": "https://api.github.com/repos/sciactive/hookphp/zipball/adde48e776bd98d01a639c9bccff0fbca0cea6d6", + "reference": "adde48e776bd98d01a639c9bccff0fbca0cea6d6", "shasum": "" }, "require": { @@ -653,7 +653,7 @@ "interception", "method hooking" ], - "time": "2017-06-17T00:00:00+00:00" + "time": "2017-10-24T00:00:00+00:00" }, { "name": "sciactive/nymph-pubsub", @@ -711,16 +711,16 @@ }, { "name": "sciactive/nymph-server", - "version": "1.6.0", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/sciactive/nymph-server.git", - "reference": "e6258395fde11b789a67478e0b418c004c54a15d" + "reference": "04cf4295f25d9420adced29c632a0b6a44ff3be6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sciactive/nymph-server/zipball/e6258395fde11b789a67478e0b418c004c54a15d", - "reference": "e6258395fde11b789a67478e0b418c004c54a15d", + "url": "https://api.github.com/repos/sciactive/nymph-server/zipball/04cf4295f25d9420adced29c632a0b6a44ff3be6", + "reference": "04cf4295f25d9420adced29c632a0b6a44ff3be6", "shasum": "" }, "require": { @@ -763,7 +763,7 @@ "postgres", "postgresql" ], - "time": "2017-06-18T00:00:00+00:00" + "time": "2017-10-18T00:00:00+00:00" }, { "name": "sciactive/requirephp", @@ -813,20 +813,20 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.3.5", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e" + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67535f1e3fd662bdc68d7ba317c93eecd973617e", - "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "conflict": { "symfony/dependency-injection": "<3.3" @@ -872,24 +872,24 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-06-09T14:53:08+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.3.5", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e307abe4b79ccbbfdced9b91c132fd128f456bc5" + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e307abe4b79ccbbfdced9b91c132fd128f456bc5", - "reference": "e307abe4b79ccbbfdced9b91c132fd128f456bc5", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", + "reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { @@ -925,20 +925,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-07-17T14:07:10+00:00" + "time": "2017-10-05T23:10:23+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -950,7 +950,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -984,24 +984,24 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/routing", - "version": "v3.3.5", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "dc70bbd0ca7b19259f63cdacc8af370bc32a4728" + "reference": "2e26fa63da029dab49bf9377b3b4f60a8fecb009" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/dc70bbd0ca7b19259f63cdacc8af370bc32a4728", - "reference": "dc70bbd0ca7b19259f63cdacc8af370bc32a4728", + "url": "https://api.github.com/repos/symfony/routing/zipball/2e26fa63da029dab49bf9377b3b4f60a8fecb009", + "reference": "2e26fa63da029dab49bf9377b3b4f60a8fecb009", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "conflict": { "symfony/config": "<2.8", @@ -1062,7 +1062,7 @@ "uri", "url" ], - "time": "2017-06-24T09:29:48+00:00" + "time": "2017-10-02T07:25:00+00:00" }, { "name": "textalk/websocket",