Commits

Arjan Scherpenisse  committed f1351ce

Moved examples into doc/ directory; added readme, release and news files.

  • Participants
  • Parent commits 9ea138e
  • Tags release/1.0

Comments (0)

Files changed (9)

+php-anymeta version 1.0 released on 2011-01-25
+----------------------------------------------
+
+ - Initial release.
+AnyMetaAPI
+==========
+Support library for accessing AnyMeta-based websites from PHP.
+
+Very similar to the python-anymeta library:
+http://trac.mediamatic.nl/python-anymeta
+
+
+Authors
+=======
+Arjan Scherpenisse <arjan@mediamatic.nl>
+
+
+License
+=======
+Released under the MIT license. See LICENSE for details.
+
+
+Examples
+========
+See doc/ for different usage examples.
+php-anymeta version 1.0 released on 2011-01-25
+----------------------------------------------
+
+ - Initial release.

File doc/example-registry.php

+<?php
+
+// minimal example of how to use the php-anymeta library.
+
+require_once 'src/AnymetaAPI.php';
+
+$client = AnyMetaAPI::from_registry('sysadmin@ixion.local');
+
+$thing = array('kind' => 'ARTICLE',
+               'text' => array('title' => 'Dit is een nieuw artikel.',
+                               'subtitle' => 'Wat een leuk artikel weer....',
+                               'intro' => 'Vandaag gaan we es wat vertellen over nieuwe dingen. Blabfldjsfdks',
+                               'language' => 'nl')
+    );
+
+$result = $client->doMethod("anymeta.thing.insert", array('data' => $thing));
+
+var_dump($result);
+
+?>

File doc/example.php

+<?php
+
+// minimal example of how to use the php-anymeta library.
+
+require_once 'src/AnymetaAPI.php';
+
+
+
+$entrypoint = 'http://local.any/services/rest/';
+
+$ckey = 'sc-23548d2b62575bffcbefa59268478da004bceb8a1';
+$csec = '';
+$tkey = '39419d34eefa2c0cffae218ad594164104bceb8dd';
+$tsec = 'ae925e6245e8ae06af0f8a3aed57edb3';
+
+$client = new AnyMetaAPI($entrypoint, $ckey, $csec, $tkey, $tsec);
+
+$result = $client->doMethod("anymeta.user.info");
+
+var_dump($result);
+
+/* output: something like
+array(6) {
+  ["id"]=>
+  string(1) "1"
+  ["title"]=>
+  string(20) "System Administrator"
+  ["preferences"]=>
+  array(0) {
+  }
+  ["aro"]=>
+  array(1) {
+    [0]=>
+    array(2) {
+      ["id"]=>
+      string(2) "15"
+      ["name"]=>
+      string(21) "system administrators"
+    }
+  }
+  ["axo"]=>
+  array(2) {
+    [0]=>
+    string(7) "content"
+
+... etc ...
+
+*/
+
+?>

File doc/example2.php

+<?php
+
+// minimal example of how to use the php-anymeta library.
+
+require_once 'src/AnymetaAPI.php';
+
+
+
+$entrypoint = 'http://local.any/services/rest/';
+
+$ckey = 'sc-23548d2b62575bffcbefa59268478da004bceb8a1';
+$csec = '';
+$tkey = '39419d34eefa2c0cffae218ad594164104bceb8dd';
+$tsec = 'ae925e6245e8ae06af0f8a3aed57edb3';
+
+
+$entrypoint = 'http://jhm03.test.mediamatic.nl/services/rest/';
+
+$ckey = 'sc-05fa61b3fb7314d190c33eb7fbab1abb04b141eda';
+$csec = '';
+$tkey = 'c485b4b5280152d49861569c8eb8ddf904c7a407f';
+$tsec = 'f650de94bc62e72ec157bb0a94e73b0c';
+
+
+$client = new AnyMetaAPI($entrypoint, $ckey, $csec, $tkey, $tsec);
+
+$thing = array('kind' => 'ARTICLE',
+               'text' => array('title' => 'Dit is een nieuw artikel.',
+                               'subtitle' => 'Wat een leuk artikel weer....',
+                               'intro' => 'Vandaag gaan we es wat vertellen over nieuwe dingen. Blabfldjsfdks',
+                               'language' => 'nl')
+    );
+
+$result = $client->doMethod("anymeta.thing.insert", array('data' => $thing));
+
+var_dump($result);
+
+?>

File example-registry.php

-<?php
-
-// minimal example of how to use the php-anymeta library.
-
-require_once 'src/AnymetaAPI.php';
-
-$client = AnyMetaAPI::from_registry('sysadmin@ixion.local');
-
-$thing = array('kind' => 'ARTICLE',
-               'text' => array('title' => 'Dit is een nieuw artikel.',
-                               'subtitle' => 'Wat een leuk artikel weer....',
-                               'intro' => 'Vandaag gaan we es wat vertellen over nieuwe dingen. Blabfldjsfdks',
-                               'language' => 'nl')
-    );
-
-$result = $client->doMethod("anymeta.thing.insert", array('data' => $thing));
-
-var_dump($result);
-
-?>

File example.php

-<?php
-
-// minimal example of how to use the php-anymeta library.
-
-require_once 'src/AnymetaAPI.php';
-
-
-
-$entrypoint = 'http://local.any/services/rest/';
-
-$ckey = 'sc-23548d2b62575bffcbefa59268478da004bceb8a1';
-$csec = '';
-$tkey = '39419d34eefa2c0cffae218ad594164104bceb8dd';
-$tsec = 'ae925e6245e8ae06af0f8a3aed57edb3';
-
-$client = new AnyMetaAPI($entrypoint, $ckey, $csec, $tkey, $tsec);
-
-$result = $client->doMethod("anymeta.user.info");
-
-var_dump($result);
-
-/* output: something like
-array(6) {
-  ["id"]=>
-  string(1) "1"
-  ["title"]=>
-  string(20) "System Administrator"
-  ["preferences"]=>
-  array(0) {
-  }
-  ["aro"]=>
-  array(1) {
-    [0]=>
-    array(2) {
-      ["id"]=>
-      string(2) "15"
-      ["name"]=>
-      string(21) "system administrators"
-    }
-  }
-  ["axo"]=>
-  array(2) {
-    [0]=>
-    string(7) "content"
-
-... etc ...
-
-*/
-
-?>

File example2.php

-<?php
-
-// minimal example of how to use the php-anymeta library.
-
-require_once 'src/AnymetaAPI.php';
-
-
-
-$entrypoint = 'http://local.any/services/rest/';
-
-$ckey = 'sc-23548d2b62575bffcbefa59268478da004bceb8a1';
-$csec = '';
-$tkey = '39419d34eefa2c0cffae218ad594164104bceb8dd';
-$tsec = 'ae925e6245e8ae06af0f8a3aed57edb3';
-
-
-$entrypoint = 'http://jhm03.test.mediamatic.nl/services/rest/';
-
-$ckey = 'sc-05fa61b3fb7314d190c33eb7fbab1abb04b141eda';
-$csec = '';
-$tkey = 'c485b4b5280152d49861569c8eb8ddf904c7a407f';
-$tsec = 'f650de94bc62e72ec157bb0a94e73b0c';
-
-
-$client = new AnyMetaAPI($entrypoint, $ckey, $csec, $tkey, $tsec);
-
-$thing = array('kind' => 'ARTICLE',
-               'text' => array('title' => 'Dit is een nieuw artikel.',
-                               'subtitle' => 'Wat een leuk artikel weer....',
-                               'intro' => 'Vandaag gaan we es wat vertellen over nieuwe dingen. Blabfldjsfdks',
-                               'language' => 'nl')
-    );
-
-$result = $client->doMethod("anymeta.thing.insert", array('data' => $thing));
-
-var_dump($result);
-
-?>