示例#1
0
 function testWrite()
 {
     parent::$logger->debug('testWrite');
     $imageDoc = new MLPHP\ImageDocument(parent::$client);
     $imageDoc->setContentFile(__DIR__ . DIRECTORY_SEPARATOR . 'example.jpg');
     $uri = '/example.jpg';
     $imageDoc->write($uri);
     $response = $imageDoc->getResponse();
     $this->assertEquals(201, $response->getHttpCode());
     return $imageDoc;
 }
示例#2
0
文件: image.php 项目: marklogic/mlphp
<?php

/*
Copyright 2002-2012 MarkLogic Corporation.  All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
use MarkLogic\MLPHP;
// Set up global vars and class autoloading
require_once 'setup.php';
$client = $mlphp->newClient();
$img = new MLPHP\ImageDocument($client);
$uri = $_REQUEST['uri'];
$image = $img->read($uri);
header('content-type: image/jpeg');
echo $image;
示例#3
0
 /**
  * Create an iPhone Image object.
  *
  * @param RESTClient $restClient A REST client object.
  * @param string $uri A document URI.
  */
 public function __construct($restClient, $uri = null)
 {
     parent::__construct($restClient, $uri);
 }