SlideShare a Scribd company logo
HeadCouch
CouchDB PHP client
Table of Content
1. Requirements
2. Server
3. Database
4. Document
5. Design Document
6. Further reading
1. Requirements
● PHP 5.x
● cURL
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->ping();
?>
2.1. Accessing the root of a CouchDB instance
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->uuid();
?>
2.2. Requests a Universally Unique Identifier from the CouchDB instance
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->allDbs();
?>
2.3. Returns a list of all the databases
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->activeTasks();
?>
2.4. List of running tasks
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->dbUpdates();
?>
2.5. Returns a list of all database events in the CouchDB instance
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->log();
?>
2.6. Gets the CouchDB log
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->restart();
?>
2.7. Restarts the CouchDB instance
2. Server
<?php
require_once 'HeadCouch.php';
$result = HeadCouchServer::newInstance()->stats();
?>
2.8. Returns the statistics for the running server
3. Database
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDatabase::newInstance('db_name')->create();
?>
3.1. Create database
3. Database
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDatabase::newInstance('db_name')->delete();
?>
3.2. Delete database
3. Database
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDatabase::newInstance('db_name')->get();
?>
3.3. Gets information about the specified database
3. Database
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDatabase::newInstance('db_name')->head();
?>
3.4. Returns the HTTP Headers about the specified database
3. Database
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDatabase::newInstance('db_name')->post(array(
'key1' => 'val1',
'key2' => 'val2'
));
?>
3.5. Creates a new document in the specified database
4. Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDocument::newInstance('db_name', 'doc_name')->create
(array(
'key1' => 'val1',
'key2' => 'val2'
));
?>
4.1. Creates a new document
4. Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDocument::newInstance('db_name', 'doc_name')-
>delete();
?>
4.2. Deletes the specified document from the database
4. Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDocument::newInstance('db_name', 'doc_name')->get();
?>
4.3. Returns document
4. Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDocument::newInstance('db_name', 'doc_name')-
>getRevision();
?>
4.4. Returns document's revision token
4. Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDocument::newInstance('db_name', 'doc_name')->head();
?>
4.5. Returns the HTTP Headers about the specified document
5. Design Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDdoc::newInstance('db_name', 'doc_name')->head();
?>
5.1. Returns the HTTP Headers about the specified design document
5. Design Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDdoc::newInstance('db_name', 'doc_name')->get();
?>
5.2. Returns design document
5. Design Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDdoc::newInstance('db_name', 'doc_name')->put();
?>
5.3. Creates a new design document
5. Design Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDdoc::newInstance('db_name', 'doc_name')->delete();
?>
5.4. Deletes the specified document from the database
5. Design Document
<?php
require_once 'HeadCouch.php';
$result = HeadCouchDdoc::newInstance('db_name', 'doc_name')-
>getRevision();
?>
5.5. Returns document's revision token
6. Further reading
● http://zinoui.com/blog/headcouch-couchdb-
php-client
● https://github.com/riverside/HeadCouch
https://twitter.com/DimitarIvanov
Dimitar Ivanov

More Related Content

PDF
Mongo db for C# Developers
PDF
Mongo db for c# developers
PPTX
So cal0365productivitygroup feb2019
PDF
Streaming using Kafka Flink & Elasticsearch
PDF
Decoupling Objects With Standard Interfaces
PPTX
Node collaboration - Exported Resources and PuppetDB
Mongo db for C# Developers
Mongo db for c# developers
So cal0365productivitygroup feb2019
Streaming using Kafka Flink & Elasticsearch
Decoupling Objects With Standard Interfaces
Node collaboration - Exported Resources and PuppetDB

What's hot (20)

PDF
NoSQL Injections in Node.js - The case of MongoDB
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PPTX
Correcting Common .NET Async/Await Mistakes
PDF
Security Challenges in Node.js
PDF
Redis for the Everyday Developer
KEY
занятие8
PDF
Git as NoSQL
PDF
MongoDB World 2016: Deciphering .explain() Output
PDF
Softshake - Offline applications
PDF
What do you mean, Backwards Compatibility?
PPTX
Getting Started with MongoDB and NodeJS
PDF
San Francisco Java User Group
PDF
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
PDF
VBA API for scriptDB primer
PDF
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
PDF
Lean React - Patterns for High Performance [ploneconf2017]
PDF
神に近づくx/net/context (Finding God with x/net/context)
PDF
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
TXT
New text document
KEY
Zendcon 09
NoSQL Injections in Node.js - The case of MongoDB
MySQL Slow Query log Monitoring using Beats & ELK
Correcting Common .NET Async/Await Mistakes
Security Challenges in Node.js
Redis for the Everyday Developer
занятие8
Git as NoSQL
MongoDB World 2016: Deciphering .explain() Output
Softshake - Offline applications
What do you mean, Backwards Compatibility?
Getting Started with MongoDB and NodeJS
San Francisco Java User Group
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
VBA API for scriptDB primer
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
Lean React - Patterns for High Performance [ploneconf2017]
神に近づくx/net/context (Finding God with x/net/context)
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
New text document
Zendcon 09
Ad

Similar to HeadCouch - CouchDB PHP Client (20)

PPTX
This slide show will brief about database handling
PDF
Doctrine for NoSQL
PDF
Doctrine and NoSQL
ODP
PHP Data Objects
PDF
Diving into php
PDF
Introduction to php database connectivity
PDF
Cache metadata
PDF
Rapid Prototyping with PEAR
PPTX
Drupal 8 database api
PPTX
Learn PHP Lacture2
PDF
Codeigniter : Two Step View - Concept Implementation
PDF
Getting Started with MongoDB: 4 Application Designs
PDF
Migrating to dependency injection
PDF
From mysql to MongoDB(MongoDB2011北京交流会)
PPTX
19. CodeIgniter imagini in mysql
PPTX
Code Igniter 2
PDF
ABCD firebase
PDF
Migrate database to Exadata using RMAN duplicate
PDF
Ajax chap 4
This slide show will brief about database handling
Doctrine for NoSQL
Doctrine and NoSQL
PHP Data Objects
Diving into php
Introduction to php database connectivity
Cache metadata
Rapid Prototyping with PEAR
Drupal 8 database api
Learn PHP Lacture2
Codeigniter : Two Step View - Concept Implementation
Getting Started with MongoDB: 4 Application Designs
Migrating to dependency injection
From mysql to MongoDB(MongoDB2011北京交流会)
19. CodeIgniter imagini in mysql
Code Igniter 2
ABCD firebase
Migrate database to Exadata using RMAN duplicate
Ajax chap 4
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation theory and applications.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation theory and applications.pdf
Electronic commerce courselecture one. Pdf
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity

HeadCouch - CouchDB PHP Client