PHP code example of jackalope / jackalope-jackrabbit
1. Go to this page and download the library: Download jackalope/jackalope-jackrabbit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// see Bootstrapping for how to get the session.
$rootNode = $session->getNode("/");
$whitewashing = $rootNode->addNode("www-whitewashing-de");
$session->save();
$posts = $whitewashing->addNode("posts");
$session->save();
$post = $posts->addNode("welcome-to-blog");
$post->addMixin("mix:title");
$post->setProperty("jcr:title", "Welcome to my Blog!");
$post->setProperty("jcr:description", "This is the first post on my blog! Do you like it?");
$session->save();
$factory = new \Jackalope\RepositoryFactoryJackrabbit();
$logger = new Jackalope\Transport\Logging\DebugStack();
$options = array(
'jackalope.jackrabbit_uri' => $jackrabbit_url,
'jackalope.logger' => $logger,
);
$repository = $factory->getRepository($options);
...
// at the end, output debug information
var_dump($logger->calls);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.