Merge branch 'develop' of github.hpcloud.net:butchema/HPCloud-PHP into develop
This commit is contained in:
7
CHANGELOG.md
Normal file
7
CHANGELOG.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Release Notes
|
||||||
|
|
||||||
|
This changelog contains the relevant feature additions and bug fixes. To obtain a complete diff between versions you can got to https://github.com/hpcloud/HPCloud-PHP/compare/XXX...XXX where the XXX values are two different tagged versions of the library. For example, https://github.com/hpcloud/HPCloud-PHP/compare/1.0.0-beta6...1.0.0
|
||||||
|
|
||||||
|
* 1.0.0 (2012-08-09)
|
||||||
|
|
||||||
|
* This is the initial stable release for object storage, CDN, and identity services. DBaaS is currently in private beta as such the bindings for this component are still in beta.
|
||||||
@@ -26,9 +26,9 @@ Coming soon:
|
|||||||
We also have support for using PHP's native HTTP stream wrapper, but it
|
We also have support for using PHP's native HTTP stream wrapper, but it
|
||||||
is not as reliable. We recommend cURL.
|
is not as reliable. We recommend cURL.
|
||||||
|
|
||||||
## Warnings
|
## Versioning
|
||||||
|
|
||||||
The API for services in beta (e.g., DBaaS) should be considered beta as well.
|
We have a goal to be as consistent as possible with [Semantic Versioning](http://semver.org/). For released HP Cloud services this is what you can expect. For products in beta expect the included components to be in beta. For example, [HP Cloud Relational Database for MySQL](https://www.hpcloud.com/products/RDB) (our DBaaS offering) is private beta.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
%SUMMARY%
|
|
||||||
|
|
||||||
%DESCRIPTION%
|
|
||||||
17
RELEASE
17
RELEASE
@@ -1,17 +0,0 @@
|
|||||||
Release notes for HPCloud-PHP
|
|
||||||
|
|
||||||
1.0.0
|
|
||||||
|
|
||||||
1.0.0-alpha1
|
|
||||||
|
|
||||||
* Added ACL support
|
|
||||||
* Added ability to update obj metadata without re-submitting the entire
|
|
||||||
object.
|
|
||||||
* Added container metadata.
|
|
||||||
* Added support for setting the following header types:
|
|
||||||
- Content Disposition
|
|
||||||
- Content Encoding
|
|
||||||
- CORS headers
|
|
||||||
* Added support for server-side copying of objects.
|
|
||||||
* Added the ability to upload a file straight from a stream, instead of
|
|
||||||
having to buffer the entire stream into memory.
|
|
||||||
626
build.xml
626
build.xml
@@ -1,626 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<project
|
|
||||||
name="HPCloud-PHP"
|
|
||||||
description="API for working with HPCloud"
|
|
||||||
default="longhelp">
|
|
||||||
<!--
|
|
||||||
This is the Phing build file for HPCloud-PHP.
|
|
||||||
|
|
||||||
Phing is a build tool. Learn more about it at http://phing.info.
|
|
||||||
|
|
||||||
Copyright (c) 2011, mattbutcher.
|
|
||||||
-->
|
|
||||||
<target name="help" description="Print short help message.">
|
|
||||||
<echo>
|
|
||||||
|
|
||||||
#############
|
|
||||||
# Basic Usage #
|
|
||||||
#############
|
|
||||||
|
|
||||||
Use Phing to manage this project.
|
|
||||||
|
|
||||||
To list all of the available commands, do:
|
|
||||||
|
|
||||||
phing -l
|
|
||||||
|
|
||||||
To build a release, type:
|
|
||||||
|
|
||||||
phing build -Dversion=1.0.0
|
|
||||||
|
|
||||||
Leaving -Dversion off will result in a "snapshot" release.
|
|
||||||
|
|
||||||
To learn about more options, type
|
|
||||||
|
|
||||||
phing longhelp
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
<target name="longhelp" description="Information on the build system.">
|
|
||||||
<echo>
|
|
||||||
############
|
|
||||||
# THE BASICS #
|
|
||||||
############
|
|
||||||
|
|
||||||
To build HPCloud-PHP, run:
|
|
||||||
|
|
||||||
phing build
|
|
||||||
|
|
||||||
This will create a complete distribution of the project in /dist, with the build files in /bin/build. Documentation will be generated if the appropriate target is configured.
|
|
||||||
|
|
||||||
A versioned release can be built with:
|
|
||||||
|
|
||||||
phing build -Dversion=2.1.1alpha1
|
|
||||||
|
|
||||||
To see all available build targets, run this command:
|
|
||||||
|
|
||||||
phing -l
|
|
||||||
|
|
||||||
Check Configuration
|
|
||||||
===================
|
|
||||||
|
|
||||||
To check how your project is configured, use the 'info' target:
|
|
||||||
|
|
||||||
phing info
|
|
||||||
|
|
||||||
This will print details about the project.
|
|
||||||
|
|
||||||
Syntax Check
|
|
||||||
============
|
|
||||||
|
|
||||||
To check the syntax of all of your PHP source code, run this:
|
|
||||||
|
|
||||||
phing lint
|
|
||||||
|
|
||||||
It will generate a report on any files that fail to parse correctly.
|
|
||||||
|
|
||||||
Generating Documentation
|
|
||||||
========================
|
|
||||||
|
|
||||||
To generate docs, do:
|
|
||||||
|
|
||||||
phing doc
|
|
||||||
|
|
||||||
Documentation will be stored in doc/. You can start with doc/index.html.
|
|
||||||
|
|
||||||
Running Unit Tests
|
|
||||||
==================
|
|
||||||
|
|
||||||
To run any configured tests, do:
|
|
||||||
|
|
||||||
phing test
|
|
||||||
|
|
||||||
The above will generate HTML test results which will be placed in test/reports/. If you wish to run the test and print the results directly the the command line (fast tests), you should run 'phing ftest' instead.
|
|
||||||
|
|
||||||
phing ftest
|
|
||||||
|
|
||||||
Code Coverage Reports
|
|
||||||
=====================
|
|
||||||
|
|
||||||
To run coverage analysis, do:
|
|
||||||
|
|
||||||
phing coverage
|
|
||||||
|
|
||||||
This will create HTML pages describing code coverage. The coverage analysis will be available in test/coverage
|
|
||||||
|
|
||||||
###################
|
|
||||||
# OPTIONAL FEATURES #
|
|
||||||
###################
|
|
||||||
|
|
||||||
Phar Packages
|
|
||||||
=============
|
|
||||||
|
|
||||||
This script can produce Phar packages on systems with PHP 5.3:
|
|
||||||
|
|
||||||
phing pharBuild
|
|
||||||
|
|
||||||
TextMate Integration
|
|
||||||
====================
|
|
||||||
|
|
||||||
If you are a TextMate user, you can install the Phing TextMate bundle
|
|
||||||
(http://github.com/technosophos/phing-tmbundle) to get some special TextMate features.
|
|
||||||
|
|
||||||
Special TextMate keybindings:
|
|
||||||
|
|
||||||
CMD-U: Run any target in the build file
|
|
||||||
CMD-SHIFT-I: Run the tmtest unit test target
|
|
||||||
CMD-SHIFT-U: Run the tmtarget target, which you can configure to do whatever you want
|
|
||||||
|
|
||||||
Pear Channel Support
|
|
||||||
====================
|
|
||||||
|
|
||||||
This script will generate PEAR-compatible packages, provided you configure your settings correctly.
|
|
||||||
If you use Pirum (http://pirum-project.org) to manage your PEAR channel, you can use the
|
|
||||||
Phing-Pirum package (http://github.com/technosophos/Phing-Pirum) to build or manage the channel from
|
|
||||||
these scripts. You need to edit the Pirum configuration in build.xml, though.
|
|
||||||
|
|
||||||
Pyrus Support
|
|
||||||
=============
|
|
||||||
|
|
||||||
We are experimenting with supporting Pyrus, the next generation PEAR client. Pyrus can build
|
|
||||||
packages much more effectively, and supports a wide range of useful commands. Currently, we are
|
|
||||||
working on two targets:
|
|
||||||
|
|
||||||
phing pyrusMake
|
|
||||||
phing pyrusPackage
|
|
||||||
|
|
||||||
========
|
|
||||||
To print this message, do:
|
|
||||||
|
|
||||||
phing longhelp
|
|
||||||
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<property file="project.properties"/>
|
|
||||||
|
|
||||||
<!-- IMPORTANT: Project settings. -->
|
|
||||||
<property name="project.name" value="${phing.project.name}"/>
|
|
||||||
<property name="project.homepage" value="http://github.com/technosophos/metaphing"/>
|
|
||||||
<property name="project.summary" value="A PHP project"/>
|
|
||||||
<property name="project.description">
|
|
||||||
PHP language bindings for the HP Cloud.
|
|
||||||
</property>
|
|
||||||
<property name="project.license" value="MIT License"/>
|
|
||||||
<property name="project.php.version" value="5.1.0"/>
|
|
||||||
<property name="project.lead" value="mattbutcher"/>
|
|
||||||
<property name="project.lead.email" value="someone@example.com"/>
|
|
||||||
|
|
||||||
<!-- PEAR-specific settings -->
|
|
||||||
<property name="pear.version" value="1.4.6"/>
|
|
||||||
<property name="pear.channel" value="pear.myserver.net"/>
|
|
||||||
|
|
||||||
<!-- PhpDocumentor-specific settings. -->
|
|
||||||
<!-- Documentation style used by PHPDocumentor -->
|
|
||||||
<property name="phpdoc.style" value="HTML:frames:earthli"/>
|
|
||||||
|
|
||||||
<property name="doxygen.config" value="./config.doxy"/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
If you are using Pirum to manage PEAR channels, install Phing-Pirum
|
|
||||||
and uncomment this section:
|
|
||||||
* Includepath only if you didn't install Phing-Pirum from http://pear.querypath.org
|
|
||||||
* Two taskdefs for Phing Pirum tasks
|
|
||||||
* A property, pearchannel, setting the location of your PEAR channel.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<includepath classpath="../Phing-Pirum/src"/>
|
|
||||||
<taskdef classname="PhingPirum.Task.PirumBuildTask" name="pirumbuild"/>
|
|
||||||
<taskdef classname="PhingPirum.Task.PirumAddTask" name="pirumadd"/>
|
|
||||||
<property name="pearchannel" value="../pear.querypath.org/pear"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<includepath classpath="../../PhingDoxygen/src"/>
|
|
||||||
<taskdef classname="PhingDoxygen.Task.DoxygenTask" name="doxygen"/>
|
|
||||||
|
|
||||||
<!-- Pyrus tasks. -->
|
|
||||||
<includepath classpath="/Users/mbutcher/Code"/> <!-- Pyrus is here. -->
|
|
||||||
<includepath classpath="../../PhingPyrus/src"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusMakeTask" name="pyrusmake"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusPackageTask" name="pyruspackage"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusHelpTask" name="pyrushelp"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusExecTask" name="pyrusexec"/>
|
|
||||||
|
|
||||||
<!-- Directory locations -->
|
|
||||||
<property name="srcdir" value="${project.basedir}/src"/>
|
|
||||||
<property name="testdir" value="${project.basedir}/test"/>
|
|
||||||
<property name="builddir" value="${project.basedir}/bin/build"/>
|
|
||||||
<property name="docsdir" value="${project.basedir}/doc/api"/>
|
|
||||||
<property name="packagedir" value="${project.basedir}/dist"/>
|
|
||||||
<property name="datadir" value="${project.basedir}/data"/>
|
|
||||||
<property name="exampledir" value="${project.basedir}/examples"/>
|
|
||||||
<property name="tutorialdir" value="${project.basedir}/tutorials"/>
|
|
||||||
|
|
||||||
<!-- If you are writing Phar files, use this for Phar stubs: -->
|
|
||||||
<property name="phardir" value="${project.basedir}/phar"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ====================================================================
|
|
||||||
PHING FILE SETS
|
|
||||||
==================================================================== -->
|
|
||||||
|
|
||||||
<!-- Files that must be included in the release -->
|
|
||||||
<fileset id="licensefiles" dir=".">
|
|
||||||
<include name="README.md"/>
|
|
||||||
<include name="INSTALL"/>
|
|
||||||
<include name="COPYING-MIT.txt"/>
|
|
||||||
<include name="CREDITS"/>
|
|
||||||
<include name="README.pear"/>
|
|
||||||
<include name="RELEASE"/>
|
|
||||||
<include name="API"/>
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Files to be treated as source code -->
|
|
||||||
<fileset id="sourcecode" dir="${srcdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Unit tests and auxilliary files -->
|
|
||||||
<fileset id="unittests" dir="${testdir}/Tests">
|
|
||||||
<include name="**/*Test.php" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Examples -->
|
|
||||||
<fileset id="examplecode" dir="${exampledir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- DocBook Tutorials imported into PhpDocumentor -->
|
|
||||||
<fileset id="tutorials" dir="${tutorialdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Documentation -->
|
|
||||||
<fileset id="docs" dir="${docsdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Data -->
|
|
||||||
<fileset id="data" dir="${datadir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- ====================================================================
|
|
||||||
PHING TARGETS
|
|
||||||
==================================================================== -->
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Print useful information and exit.
|
|
||||||
-->
|
|
||||||
<target name="info" description="Print information about this project" depends="setup">
|
|
||||||
<echo>
|
|
||||||
|
|
||||||
Project name: ${project.name}
|
|
||||||
By ${project.lead} (${project.lead.email})
|
|
||||||
Summary: ${project.summary}
|
|
||||||
Description: ${project.description}
|
|
||||||
|
|
||||||
Source code: ${srcdir}
|
|
||||||
Complete packages: ${packagedir}
|
|
||||||
Version string pattern: ${project.name}-dev${DSTAMP}
|
|
||||||
|
|
||||||
Edit project.properties (or build.xml) to set the above.
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
The primary build target.
|
|
||||||
|
|
||||||
Runs the following:
|
|
||||||
* lint
|
|
||||||
* setup
|
|
||||||
* prebuild
|
|
||||||
* docBuild
|
|
||||||
* fullBuild
|
|
||||||
-->
|
|
||||||
<target name="build" depends="lint, setup, prebuild, docBuild, fullBuild"
|
|
||||||
description="Generate docs, and full build and then creates packages."
|
|
||||||
>
|
|
||||||
<!-- Main build target. Calls all dependencies and exits. -->
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Target that should be run always.
|
|
||||||
-->
|
|
||||||
<target name="setup" description="Run required configuration for any build.">
|
|
||||||
<tstamp/>
|
|
||||||
<!--
|
|
||||||
Default version.
|
|
||||||
Note that this is designed to appear to match the PEAR conventions. However,
|
|
||||||
it uses a date stamp instead of an incrementing integer, making this more suitable
|
|
||||||
for daily snapshots.
|
|
||||||
-->
|
|
||||||
<property name="version" value="dev${DSTAMP}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Tasks to do before any build.
|
|
||||||
-->
|
|
||||||
<target name="prebuild" description="Prepare for building. No need to call directly.">
|
|
||||||
<mkdir dir="./dist"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build the full package.
|
|
||||||
|
|
||||||
We do this by copying all important components into ${builddir} and then
|
|
||||||
packaging them all up. Along the way, we create a package.xml file. With a little
|
|
||||||
tweaking, you can use the distributed package as a PEAR package.
|
|
||||||
-->
|
|
||||||
<target name="fullBuild" description="Full ${project.name} build, including docs."
|
|
||||||
depends="setup,prebuild">
|
|
||||||
<property name="releasedir" value="${builddir}/${project.name}-${version}" override="true"/>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
|
|
||||||
<!-- Make all necessary directories. -->
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
<mkdir dir="${releasedir}/data"/>
|
|
||||||
<mkdir dir="${releasedir}/doc"/>
|
|
||||||
<mkdir dir="${releasedir}/examples"/>
|
|
||||||
<mkdir dir="${releasedir}/scripts"/>
|
|
||||||
<mkdir dir="${releasedir}/src"/>
|
|
||||||
<mkdir dir="${releasedir}/test"/>
|
|
||||||
<!-- mkdir dir="${releasedir}/tutorials"/ -->
|
|
||||||
|
|
||||||
<!-- Copy license files. -->
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PROJECT" value="${project.name}"/>
|
|
||||||
<token key="SUMMARY" value="${project.summary}"/>
|
|
||||||
<token key="DESCRIPTION" value="${project.description}"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Pyrus wants README, not README.pear -->
|
|
||||||
<copy file="${releasedir}/README.pear" tofile="${releasedir}/README"/>
|
|
||||||
|
|
||||||
<!-- Create API and RELEASE files -->
|
|
||||||
<copy file="${releasedir}/API" tofile="${releasedir}/API-${version}"/>
|
|
||||||
<copy file="${releasedir}/RELEASE" tofile="${releasedir}/RELEASE-${version}"/>
|
|
||||||
|
|
||||||
<!-- Copy source code, doing token replacement on version. -->
|
|
||||||
<copy todir="${releasedir}/src">
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy examples. -->
|
|
||||||
<copy todir="${releasedir}/examples">
|
|
||||||
<fileset refid="examplecode"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy tests. -->
|
|
||||||
<copy todir="${releasedir}/tests">
|
|
||||||
<fileset refid="unittests"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy tutorials -->
|
|
||||||
<!--
|
|
||||||
<copy todir="${releasedir}/tutorials">
|
|
||||||
<fileset refid="tutorials"/>
|
|
||||||
</copy>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Copy documentation -->
|
|
||||||
<copy todir="${releasedir}/doc">
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy data dir -->
|
|
||||||
<copy todir="${releasedir}/data">
|
|
||||||
<fileset refid="data"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Use Pyrus to create a package. -->
|
|
||||||
<pyrusmake dir="${releasedir}" packagename="${project.name}" channel="${pear.channel}"/>
|
|
||||||
<pyruspackage packagexml="${releasedir}/package.xml"/>
|
|
||||||
|
|
||||||
<!-- Add the package to the PEAR channel. -->
|
|
||||||
<move file="./${project.name}-${version}.tgz" tofile="${packagedir}/${project.name}-${version}.tgz"/>
|
|
||||||
<pirumadd targetdir="${pearchannel}" packagefile="${packagedir}/${project.name}-${version}.tgz"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Check syntax of all source code files.
|
|
||||||
-->
|
|
||||||
<target name="lint" description="Check syntax of source.">
|
|
||||||
<phplint>
|
|
||||||
<fileset refid="sourcecode" />
|
|
||||||
</phplint>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Build documentation.
|
|
||||||
|
|
||||||
Run PhpDocumentor to generate the documentation for a site.
|
|
||||||
-->
|
|
||||||
<target name="doc" depends="lint,setup" description="Generate API docs.">
|
|
||||||
<delete dir="${docsdir}"/>
|
|
||||||
<doxygen config="${doxygen.config}"/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
During documentation generation, this will replace the string -UNSTABLE% with
|
|
||||||
the release version ID. You can use this to generate documents with information
|
|
||||||
about the release they are part of.
|
|
||||||
-->
|
|
||||||
<reflexive>
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="-" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PROJECT" value="${project.name}"/>
|
|
||||||
<token key="SUMMARY" value="${project.summary}"/>
|
|
||||||
<token key="DESCRIPTION" value="${project.description}"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
</reflexive>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
This is the tmtarget for the TextMate Phing package. This allows you to run
|
|
||||||
your phing builds from inside of TextMate.
|
|
||||||
|
|
||||||
To execute this in TextMate, use CMD-SHIFT-I.
|
|
||||||
|
|
||||||
See http://github.com/technosophos/phing-tmbundle
|
|
||||||
|
|
||||||
To set this to execute different things, simply change depends= to something else.
|
|
||||||
-->
|
|
||||||
<target name="tmtarget" depends="info" description="Target for textmate">
|
|
||||||
<echo>Executed tmtarget in build.xml.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a fast test and print the results to the console.
|
|
||||||
-->
|
|
||||||
<target name="ftest" description="Run a quick unit test." depends="pretest">
|
|
||||||
<exec command="php mageekguy.atoum.phar -d test/Tests" passthru="true"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Run any necessary preliminaries before executing tests.
|
|
||||||
-->
|
|
||||||
<target name="pretest" description="tasks done before any unit testing.">
|
|
||||||
<mkdir dir="test/reports"/>
|
|
||||||
<mkdir dir="test/reports/html"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Run unit tests with HTML output optimized for display inside of TextMate.
|
|
||||||
|
|
||||||
If you have Phing-TMBundle installed (http://github.com/technosophos/phing-tmbundle) then
|
|
||||||
you can press CMD-SHIFT-I to run these tests.
|
|
||||||
-->
|
|
||||||
<target name="tmtest" description="Run test, optimized for TextMate output." depends="pretest">
|
|
||||||
<phpunit>
|
|
||||||
<formatter todir="test/reports" type="xml" usefile="yes"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset refid="unittests"/>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<phpunitreport
|
|
||||||
infile="test/reports/testsuites.xml"
|
|
||||||
format="noframes"
|
|
||||||
todir="test/reports/html"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a coverage report.
|
|
||||||
|
|
||||||
Run a report to determine to what extent your code has been covered by the unit tests.
|
|
||||||
-->
|
|
||||||
<target name="coverage" depends="lint" description="Run a coverage analysis.">
|
|
||||||
<coverage-setup database="./test/db/coverage.db">
|
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
</coverage-setup>
|
|
||||||
<phpunit codecoverage="true" haltonfailure="true">
|
|
||||||
<formatter type="plain" todir="test/reports" outfile="coverage.xml"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset dir="test/Tests">
|
|
||||||
<include name="**/*Test.php"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<coverage-report outfile="test/reports/coverage.xml">
|
|
||||||
<report todir="test/coverage"/>
|
|
||||||
</coverage-report>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a full test and format an HTML report.
|
|
||||||
|
|
||||||
This differs from tmtest in that the output for this report is more robust, designed for
|
|
||||||
detailed viewing, not viewing quickly in a pop-up window.
|
|
||||||
-->
|
|
||||||
<target name="test" depends="lint,pretest" description="Run full tests">
|
|
||||||
<mkdir dir="test/reports/html"/>
|
|
||||||
<mkdir dir="test/db"/>
|
|
||||||
<phpunit>
|
|
||||||
<formatter todir="test/reports" type="xml"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset dir="test/Tests">
|
|
||||||
<include name="**/*Test.php"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<phpunitreport
|
|
||||||
infile="test/reports/testsuites.xml"
|
|
||||||
format="frames"
|
|
||||||
todir="test/reports/html"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build a documentation-only package.
|
|
||||||
|
|
||||||
This just runs the 'doc' target and then packages the output into a tar and a zip file.
|
|
||||||
-->
|
|
||||||
<target name="docBuild" description="Build a package containing just docs."
|
|
||||||
depends="setup,prebuild,doc">
|
|
||||||
<property name="releasedir" value="${builddir}/${project.name}-${version}-docs"/>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
|
|
||||||
<!-- Make all necessary directories. -->
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
|
|
||||||
<!-- Copy license files. -->
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy documentation -->
|
|
||||||
<copy todir="${releasedir}/doc">
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Create tgz and zip versions. -->
|
|
||||||
<tar destfile="${packagedir}/${project.name}-${version}-docs.tgz" compression="gzip">
|
|
||||||
<fileset dir="${builddir}">
|
|
||||||
<include name="${project.name}-${version}-docs/**/*"/>
|
|
||||||
</fileset>
|
|
||||||
</tar>
|
|
||||||
<zip destfile="${packagedir}/${project.name}-${version}-docs.zip" basedir="${releasedir}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build a Phar package.
|
|
||||||
|
|
||||||
For PHP 5.3 and up, this is another way of building a release - a much better way.
|
|
||||||
|
|
||||||
This target is not called by the default build.
|
|
||||||
-->
|
|
||||||
<target name="pharBuild" depends="setup,prebuild" description="Build a Phar package of this project.">
|
|
||||||
|
|
||||||
<property name="releasedir" value="${builddir}/${project.name}-${version}-phar" override="true"/>
|
|
||||||
<echo>${releasedir}</echo>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<filterchain>
|
|
||||||
<stripphpcomments/>
|
|
||||||
<stripwhitespace/>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PHAR_FILENAME" value="${project.name}.phar"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset dir="${srcdir}">
|
|
||||||
<include name="**/*"/>
|
|
||||||
</fileset>
|
|
||||||
</copy>
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<pharpackage
|
|
||||||
destfile="${packagedir}/${project.name}-${version}.phar"
|
|
||||||
basedir="${releasedir}"
|
|
||||||
alias="${project.name}.phar">
|
|
||||||
<!-- stub="${releasedir}/basic_loader.php" -->
|
|
||||||
<fileset dir="${releasedir}">
|
|
||||||
<include name="**/**"/>
|
|
||||||
</fileset>
|
|
||||||
<metadata>
|
|
||||||
<element name="version" value="${version}" />
|
|
||||||
<element name="authors">
|
|
||||||
<element name="${project.lead}">
|
|
||||||
<element name="e-mail" value="${project.lead.email}" />
|
|
||||||
</element>
|
|
||||||
</element>
|
|
||||||
</metadata>
|
|
||||||
</pharpackage>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,751 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<project
|
|
||||||
name="HPCloud-PHP"
|
|
||||||
description="A PHP project"
|
|
||||||
default="longhelp">
|
|
||||||
<!--
|
|
||||||
This is the Phing build file for HPCloud-PHP.
|
|
||||||
|
|
||||||
THIS BUILD FILE SHOWS EXAMPLES USING BUILT-IN Phing COMMANDS.
|
|
||||||
|
|
||||||
Phing is a build tool. Learn more about it at http://phing.info.
|
|
||||||
|
|
||||||
Copyright (c) 2011, mattbutcher.
|
|
||||||
-->
|
|
||||||
<target name="help" description="Print short help message.">
|
|
||||||
<echo>
|
|
||||||
|
|
||||||
#############
|
|
||||||
# Basic Usage #
|
|
||||||
#############
|
|
||||||
|
|
||||||
Use Phing to manage this project.
|
|
||||||
|
|
||||||
To list all of the available commands, do:
|
|
||||||
|
|
||||||
phing -l
|
|
||||||
|
|
||||||
To build a release, type:
|
|
||||||
|
|
||||||
phing build -Dversion=1.0.0
|
|
||||||
|
|
||||||
Leaving -Dversion off will result in a "snapshot" release.
|
|
||||||
|
|
||||||
To learn about more options, type
|
|
||||||
|
|
||||||
phing longhelp
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
<target name="longhelp" description="Information on the build system.">
|
|
||||||
<echo>
|
|
||||||
############
|
|
||||||
# THE BASICS #
|
|
||||||
############
|
|
||||||
|
|
||||||
To build HPCloud-PHP, run:
|
|
||||||
|
|
||||||
phing build
|
|
||||||
|
|
||||||
This will create a complete distribution of the project in /dist, with the build files in /bin/build. Documentation will be generated if the appropriate target is configured.
|
|
||||||
|
|
||||||
A versioned release can be built with:
|
|
||||||
|
|
||||||
phing build -Dversion=2.1.1alpha1
|
|
||||||
|
|
||||||
To see all available build targets, run this command:
|
|
||||||
|
|
||||||
phing -l
|
|
||||||
|
|
||||||
Check Configuration
|
|
||||||
===================
|
|
||||||
|
|
||||||
To check how your project is configured, use the 'info' target:
|
|
||||||
|
|
||||||
phing info
|
|
||||||
|
|
||||||
This will print details about the project.
|
|
||||||
|
|
||||||
Syntax Check
|
|
||||||
============
|
|
||||||
|
|
||||||
To check the syntax of all of your PHP source code, run this:
|
|
||||||
|
|
||||||
phing lint
|
|
||||||
|
|
||||||
It will generate a report on any files that fail to parse correctly.
|
|
||||||
|
|
||||||
Generating Documentation
|
|
||||||
========================
|
|
||||||
|
|
||||||
To generate docs, do:
|
|
||||||
|
|
||||||
phing doc
|
|
||||||
|
|
||||||
Documentation will be stored in doc/. You can start with doc/index.html.
|
|
||||||
|
|
||||||
Running Unit Tests
|
|
||||||
==================
|
|
||||||
|
|
||||||
To run any configured tests, do:
|
|
||||||
|
|
||||||
phing test
|
|
||||||
|
|
||||||
The above will generate HTML test results which will be placed in test/reports/. If you wish to run the test and print the results directly the the command line (fast tests), you should run 'phing ftest' instead.
|
|
||||||
|
|
||||||
phing ftest
|
|
||||||
|
|
||||||
Code Coverage Reports
|
|
||||||
=====================
|
|
||||||
|
|
||||||
To run coverage analysis, do:
|
|
||||||
|
|
||||||
phing coverage
|
|
||||||
|
|
||||||
This will create HTML pages describing code coverage. The coverage analysis will be available in test/coverage
|
|
||||||
|
|
||||||
###################
|
|
||||||
# OPTIONAL FEATURES #
|
|
||||||
###################
|
|
||||||
|
|
||||||
Phar Packages
|
|
||||||
=============
|
|
||||||
|
|
||||||
This script can produce Phar packages on systems with PHP 5.3:
|
|
||||||
|
|
||||||
phing pharBuild
|
|
||||||
|
|
||||||
TextMate Integration
|
|
||||||
====================
|
|
||||||
|
|
||||||
If you are a TextMate user, you can install the Phing TextMate bundle
|
|
||||||
(http://github.com/technosophos/phing-tmbundle) to get some special TextMate features.
|
|
||||||
|
|
||||||
Special TextMate keybindings:
|
|
||||||
|
|
||||||
CMD-U: Run any target in the build file
|
|
||||||
CMD-SHIFT-I: Run the tmtest unit test target
|
|
||||||
CMD-SHIFT-U: Run the tmtarget target, which you can configure to do whatever you want
|
|
||||||
|
|
||||||
Pear Channel Support
|
|
||||||
====================
|
|
||||||
|
|
||||||
This script will generate PEAR-compatible packages, provided you configure your settings correctly.
|
|
||||||
If you use Pirum (http://pirum-project.org) to manage your PEAR channel, you can use the
|
|
||||||
Phing-Pirum package (http://github.com/technosophos/Phing-Pirum) to build or manage the channel from
|
|
||||||
these scripts. You need to edit the Pirum configuration in build.xml, though.
|
|
||||||
|
|
||||||
Pyrus Support
|
|
||||||
=============
|
|
||||||
|
|
||||||
We are experimenting with supporting Pyrus, the next generation PEAR client. Pyrus can build
|
|
||||||
packages much more effectively, and supports a wide range of useful commands. Currently, we are
|
|
||||||
working on two targets:
|
|
||||||
|
|
||||||
phing pyrusMake
|
|
||||||
phing pyrusPackage
|
|
||||||
|
|
||||||
========
|
|
||||||
To print this message, do:
|
|
||||||
|
|
||||||
phing longhelp
|
|
||||||
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<property file="project.properties"/>
|
|
||||||
|
|
||||||
<!-- IMPORTANT: Project settings. -->
|
|
||||||
<property name="projectname" value="HPCloud-PHP"/>
|
|
||||||
<property name="project.homepage" value="http://github.com/technosophos/metaphing"/>
|
|
||||||
<property name="project.summary" value="A PHP project"/>
|
|
||||||
<property name="project.description">
|
|
||||||
This is a useful PHP project.
|
|
||||||
</property>
|
|
||||||
<property name="project.license" value="MIT License"/>
|
|
||||||
<property name="project.php.version" value="5.1.0"/>
|
|
||||||
<property name="project.lead" value="mattbutcher"/>
|
|
||||||
<property name="project.lead.email" value="someone@example.com"/>
|
|
||||||
|
|
||||||
<!-- PEAR-specific settings -->
|
|
||||||
<property name="pear.version" value="1.4.6"/>
|
|
||||||
<property name="pear.channel" value="pear.myserver.net"/>
|
|
||||||
|
|
||||||
<!-- PhpDocumentor-specific settings. -->
|
|
||||||
<!-- Documentation style used by PHPDocumentor -->
|
|
||||||
<property name="phpdoc.style" value="HTML:frames:earthli"/>
|
|
||||||
|
|
||||||
<property name="doxygen.config" value="./config.doxy"/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
If you are using Pirum to manage PEAR channels, install Phing-Pirum
|
|
||||||
and uncomment this section:
|
|
||||||
* Includepath only if you didn't install Phing-Pirum from http://pear.querypath.org
|
|
||||||
* Two taskdefs for Phing Pirum tasks
|
|
||||||
* A property, pearchannel, setting the location of your PEAR channel.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<includepath classpath="../Phing-Pirum/src"/>
|
|
||||||
<taskdef classname="PhingPirum.Task.PirumBuildTask" name="pirumbuild"/>
|
|
||||||
<taskdef classname="PhingPirum.Task.PirumAddTask" name="pirumadd"/>
|
|
||||||
<property name="pearchannel" value="../pear.querypath.org/pear"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<includepath classpath="../PhingDoxygen/src"/>
|
|
||||||
<taskdef classname="PhingDoxygen.Task.DoxygenTask" name="doxygen"/>
|
|
||||||
|
|
||||||
<!-- Pyrus tasks. -->
|
|
||||||
<includepath classpath="/Users/mbutcher/Code"/> <!-- Pyrus is here. -->
|
|
||||||
<includepath classpath="../PhingPyrus/src"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusMakeTask" name="pyrusmake"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusPackageTask" name="pyruspackage"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusHelpTask" name="pyrushelp"/>
|
|
||||||
<taskdef classname="PhingPyrus.Task.PyrusExecTask" name="pyrusexec"/>
|
|
||||||
|
|
||||||
<!-- Directory locations -->
|
|
||||||
<property name="srcdir" value="./src"/>
|
|
||||||
<property name="testdir" value="./test"/>
|
|
||||||
<property name="builddir" value="./bin/build"/>
|
|
||||||
<property name="docsdir" value="./doc/api"/>
|
|
||||||
<property name="packagedir" value="./dist"/>
|
|
||||||
<property name="datadir" value="./data"/>
|
|
||||||
<property name="exampledir" value="./examples"/>
|
|
||||||
<property name="tutorialdir" value="./tutorials"/>
|
|
||||||
|
|
||||||
<!-- If you are writing Phar files, use this for Phar stubs: -->
|
|
||||||
<property name="phardir" value="./phar"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ====================================================================
|
|
||||||
PHING FILE SETS
|
|
||||||
==================================================================== -->
|
|
||||||
|
|
||||||
<!-- Files that must be included in the release -->
|
|
||||||
<fileset id="licensefiles" dir=".">
|
|
||||||
<include name="README.md"/>
|
|
||||||
<include name="INSTALL"/>
|
|
||||||
<include name="COPYING-MIT.txt"/>
|
|
||||||
<include name="CREDITS"/>
|
|
||||||
<include name="README.pear"/>
|
|
||||||
<include name="RELEASE"/>
|
|
||||||
<include name="API"/>
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Files to be treated as source code -->
|
|
||||||
<fileset id="sourcecode" dir="${srcdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Unit tests and auxilliary files -->
|
|
||||||
<fileset id="unittests" dir="${testdir}/Tests">
|
|
||||||
<include name="**/*Test.php" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Examples -->
|
|
||||||
<fileset id="examplecode" dir="${exampledir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- DocBook Tutorials imported into PhpDocumentor -->
|
|
||||||
<fileset id="tutorials" dir="${tutorialdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Documentation -->
|
|
||||||
<fileset id="docs" dir="${docsdir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Data -->
|
|
||||||
<fileset id="data" dir="${datadir}">
|
|
||||||
<include name="**/*" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- ====================================================================
|
|
||||||
PHING TARGETS
|
|
||||||
==================================================================== -->
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Print useful information and exit.
|
|
||||||
-->
|
|
||||||
<target name="info" description="Print information about this project" depends="setup">
|
|
||||||
<echo>
|
|
||||||
|
|
||||||
Project name: ${projectname}
|
|
||||||
By ${project.lead} (${project.lead.email})
|
|
||||||
Summary: ${project.summary}
|
|
||||||
Description: ${project.description}
|
|
||||||
|
|
||||||
Source code: ${srcdir}
|
|
||||||
Complete packages: ${packagedir}
|
|
||||||
Version string pattern: ${projectname}-dev${DSTAMP}
|
|
||||||
|
|
||||||
Edit project.properties (or build.xml) to set the above.
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
The primary build target.
|
|
||||||
|
|
||||||
Runs the following:
|
|
||||||
* lint
|
|
||||||
* setup
|
|
||||||
* prebuild
|
|
||||||
* docBuild
|
|
||||||
* fullBuild
|
|
||||||
-->
|
|
||||||
<target name="build" depends="lint, setup, prebuild, docBuild, fullBuild"
|
|
||||||
description="Generate docs, and full build and then creates packages."
|
|
||||||
>
|
|
||||||
<!-- Main build target. Calls all dependencies and exits. -->
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Target that should be run always.
|
|
||||||
-->
|
|
||||||
<target name="setup" description="Run required configuration for any build.">
|
|
||||||
<tstamp/>
|
|
||||||
<!--
|
|
||||||
Default version.
|
|
||||||
Note that this is designed to appear to match the PEAR conventions. However,
|
|
||||||
it uses a date stamp instead of an incrementing integer, making this more suitable
|
|
||||||
for daily snapshots.
|
|
||||||
-->
|
|
||||||
<property name="version" value="dev${DSTAMP}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Tasks to do before any build.
|
|
||||||
-->
|
|
||||||
<target name="prebuild" description="Prepare for building. No need to call directly.">
|
|
||||||
<mkdir dir="./dist"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build the full package.
|
|
||||||
|
|
||||||
We do this by copying all important components into ${builddir} and then
|
|
||||||
packaging them all up. Along the way, we create a package.xml file. With a little
|
|
||||||
tweaking, you can use the distributed package as a PEAR package.
|
|
||||||
-->
|
|
||||||
<target name="fullBuild" description="Full ${projectname} build, including docs."
|
|
||||||
depends="setup,prebuild,setPearStability">
|
|
||||||
<property name="releasedir" value="${builddir}/${projectname}-${version}" override="true"/>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
|
|
||||||
<!-- Make all necessary directories. -->
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
<mkdir dir="${releasedir}/data"/>
|
|
||||||
<mkdir dir="${releasedir}/doc"/>
|
|
||||||
<mkdir dir="${releasedir}/examples"/>
|
|
||||||
<mkdir dir="${releasedir}/scripts"/>
|
|
||||||
<mkdir dir="${releasedir}/src"/>
|
|
||||||
<mkdir dir="${releasedir}/test"/>
|
|
||||||
<!-- mkdir dir="${releasedir}/tutorials"/ -->
|
|
||||||
|
|
||||||
<!-- Copy license files. -->
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PROJECT" value="${projectname}"/>
|
|
||||||
<token key="SUMMARY" value="${project.summary}"/>
|
|
||||||
<token key="DESCRIPTION" value="${project.description}"
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Pyrus wants README, not README.md -->
|
|
||||||
<copy file="${releasedir}/README.pear" tofile="${releasedir}/README"/>
|
|
||||||
|
|
||||||
<!-- Create API and RELEASE files -->
|
|
||||||
<copy file="{$releasedir}/API" tofile="${releasedir}/API-${version}"/>
|
|
||||||
<copy file="{$releasedir}/API" tofile="${releasedir}/RELEASE-${version}"/>
|
|
||||||
|
|
||||||
<!-- Copy source code, doing token replacement on version. -->
|
|
||||||
<copy todir="${releasedir}/src">
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy examples. -->
|
|
||||||
<copy todir="${releasedir}/examples">
|
|
||||||
<fileset refid="examplecode"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy tests. -->
|
|
||||||
<copy todir="${releasedir}/tests">
|
|
||||||
<fileset refid="unittests"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy tutorials -->
|
|
||||||
<!--
|
|
||||||
<copy todir="${releasedir}/tutorials">
|
|
||||||
<fileset refid="tutorials"/>
|
|
||||||
</copy>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Copy documentation -->
|
|
||||||
<copy todir="${releasedir}/doc">
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy data dir -->
|
|
||||||
<copy todir="${releasedir}/data">
|
|
||||||
<fileset refid="data"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Alternate toolchain: Use Pyrus and Pirum to create a package. -->
|
|
||||||
<!--
|
|
||||||
<pyrusmake dir="${releasedir}" packagename="${projectname}" channel="${pear.channel}"/>
|
|
||||||
<pyruspackage packagexml="${releasedir}/package.xml"/>
|
|
||||||
<move file="./${projectname}-${version}.tgz" tofile="${packagedir}/${projectname}-${version}.tgz"/>
|
|
||||||
<pirumadd targetdir="${pearchannel}" packagefile="${packagedir}/${projectname}-${version}.tgz"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Create a PEAR package.xml file -->
|
|
||||||
<pearpkg2 name="${projectname}" dir="./">
|
|
||||||
<fileset dir="${releasedir}">
|
|
||||||
<include name="**/**"/>
|
|
||||||
</fileset>
|
|
||||||
<option name="uri" value="${project.homepage}"/>
|
|
||||||
<option name="packagefile" value="package2.xml"/>
|
|
||||||
<option name="channel" value="${pear.channel}"/>
|
|
||||||
<option name="baseinstalldir" value="${projectname}"/>
|
|
||||||
<option name="summary" value="${project.summary}"/>
|
|
||||||
<option name="description" value="${project.description}"/>
|
|
||||||
<option name="apiversion" value="${version}"/>
|
|
||||||
<option name="apistability" value="${stability}"/>
|
|
||||||
<option name="releaseversion" value="${version}"/>
|
|
||||||
<option name="releasestability" value="${stability}"/>
|
|
||||||
<option name="license" value="${project.license}"/>
|
|
||||||
<option name="phpdep" value="${project.php.version}"/>
|
|
||||||
<option name="pearinstallerdep" value="${pear.version}"/>
|
|
||||||
<option name="packagetype" value="php"/>
|
|
||||||
<option name="notes" value="This package was built automatically by Phing/MetaPhing"/>
|
|
||||||
<option name="outputdirectory" value="./${builddir}"/>
|
|
||||||
<option name="packagedirectory" value="./${releasedir}"/>
|
|
||||||
<mapping name="maintainers">
|
|
||||||
<element>
|
|
||||||
<element key="handle" value="${project.lead}"/>
|
|
||||||
<element key="name" value="${project.lead}"/>
|
|
||||||
<element key="email" value="${project.lead.email}"/>
|
|
||||||
<element key="role" value="lead"/>
|
|
||||||
</element>
|
|
||||||
</mapping>
|
|
||||||
</pearpkg2>
|
|
||||||
|
|
||||||
<!-- Move the package.xml to the releasedir -->
|
|
||||||
<move file="${builddir}/package2.xml" tofile="${packagedir}/package.xml"/>
|
|
||||||
|
|
||||||
<!-- Create Gzipped Tar file that acts like a PEAR package. This will be put in dist/ -->
|
|
||||||
<tar destfile="${packagedir}/${projectname}-${version}.tgz" compression="gzip">
|
|
||||||
<fileset dir="${builddir}">
|
|
||||||
<include name="${projectname}-${version}/**/*"/>
|
|
||||||
<include name="package.xml"/>
|
|
||||||
</fileset>
|
|
||||||
</tar>
|
|
||||||
|
|
||||||
<!-- Create a ZIP version which is NOT a PEAR package. Put in dist/. -->
|
|
||||||
<zip destfile="${packagedir}/${projectname}-${version}.zip" basedir="${releasedir}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Check syntax of all source code files.
|
|
||||||
-->
|
|
||||||
<target name="lint" description="Check syntax of source.">
|
|
||||||
<phplint>
|
|
||||||
<fileset refid="sourcecode" />
|
|
||||||
</phplint>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Build documentation.
|
|
||||||
|
|
||||||
Run PhpDocumentor to generate the documentation for a site.
|
|
||||||
-->
|
|
||||||
<target name="doc" depends="lint,setup" description="Generate API docs.">
|
|
||||||
<delete dir="${docsdir}"/>
|
|
||||||
<doxygen config="${doxygen.config}"/>
|
|
||||||
<!--
|
|
||||||
<phpdoc title="${projectname} ${version}"
|
|
||||||
sourcecode="yes"
|
|
||||||
destdir="${docsdir}"
|
|
||||||
output="${phpdoc.style}"
|
|
||||||
defaultcategoryname="${projectname}"
|
|
||||||
defaultpackagename="${projectname}"
|
|
||||||
examplesdir="examples"
|
|
||||||
quiet="true"
|
|
||||||
>
|
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
<fileset refid="tutorials"/>
|
|
||||||
<fileset refid="examplecode"/>
|
|
||||||
<projdocfileset dir=".">
|
|
||||||
<include name="README.md"/>
|
|
||||||
<include name="README"/>
|
|
||||||
<include name="INSTALL"/>
|
|
||||||
<include name="COPYING-MIT.txt"/>
|
|
||||||
<include name="RELEASE-*"/>
|
|
||||||
<include name="API-*"/>
|
|
||||||
</projdocfileset>
|
|
||||||
</phpdoc>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
During documentation generation, this will replace the string @UNSTABLE@ with
|
|
||||||
the release version ID. You can use this to generate documents with information
|
|
||||||
about the release they are part of.
|
|
||||||
-->
|
|
||||||
<reflexive>
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
<filterchain>
|
|
||||||
<replacetokens begintoken="%" endtoken="%">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PROJECT" value="${projectname}"/>
|
|
||||||
<token key="SUMMARY" value="${project.summary}"/>
|
|
||||||
<token key="DESCRIPTION" value="${project.description}"
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
</reflexive>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
This is the tmtarget for the TextMate Phing package. This allows you to run
|
|
||||||
your phing builds from inside of TextMate.
|
|
||||||
|
|
||||||
To execute this in TextMate, use CMD-SHIFT-I.
|
|
||||||
|
|
||||||
See http://github.com/technosophos/phing-tmbundle
|
|
||||||
|
|
||||||
To set this to execute different things, simply change depends= to something else.
|
|
||||||
-->
|
|
||||||
<target name="tmtarget" depends="info" description="Target for textmate">
|
|
||||||
<echo>Executed tmtarget in build.xml.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a fast test and print the results to the console.
|
|
||||||
-->
|
|
||||||
<target name="ftest" description="Run a quick unit test." depends="pretest">
|
|
||||||
<!-- Fast test. -->
|
|
||||||
<phpunit>
|
|
||||||
<formatter type="summary" usefile="no"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset refid="unittests"/>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Run any necessary preliminaries before executing tests.
|
|
||||||
-->
|
|
||||||
<target name="pretest" description="tasks done before any unit testing.">
|
|
||||||
<mkdir dir="test/reports"/>
|
|
||||||
<mkdir dir="test/reports/html"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Run unit tests with HTML output optimized for display inside of TextMate.
|
|
||||||
|
|
||||||
If you have Phing-TMBundle installed (http://github.com/technosophos/phing-tmbundle) then
|
|
||||||
you can press CMD-SHIFT-I to run these tests.
|
|
||||||
-->
|
|
||||||
<target name="tmtest" description="Run test, optimized for TextMate output." depends="pretest">
|
|
||||||
<phpunit>
|
|
||||||
<formatter todir="test/reports" type="xml" usefile="yes"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset refid="unittests"/>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<phpunitreport
|
|
||||||
infile="test/reports/testsuites.xml"
|
|
||||||
format="noframes"
|
|
||||||
todir="test/reports/html"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a coverage report.
|
|
||||||
|
|
||||||
Run a report to determine to what extent your code has been covered by the unit tests.
|
|
||||||
-->
|
|
||||||
<target name="coverage" depends="lint" description="Run a coverage analysis.">
|
|
||||||
<coverage-setup database="./test/db/coverage.db">
|
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
</coverage-setup>
|
|
||||||
<phpunit codecoverage="true" haltonfailure="true">
|
|
||||||
<formatter type="plain" todir="test/reports" outfile="coverage.xml"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset dir="test/Tests">
|
|
||||||
<include name="**/*Test.php"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<coverage-report outfile="test/reports/coverage.xml">
|
|
||||||
<report todir="test/coverage"/>
|
|
||||||
</coverage-report>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Run a full test and format an HTML report.
|
|
||||||
|
|
||||||
This differs from tmtest in that the output for this report is more robust, designed for
|
|
||||||
detailed viewing, not viewing quickly in a pop-up window.
|
|
||||||
-->
|
|
||||||
<target name="test" depends="lint,pretest" description="Run full tests">
|
|
||||||
<mkdir dir="test/reports/html"/>
|
|
||||||
<mkdir dir="test/db"/>
|
|
||||||
<phpunit>
|
|
||||||
<formatter todir="test/reports" type="xml"/>
|
|
||||||
<batchtest>
|
|
||||||
<fileset dir="test/Tests">
|
|
||||||
<include name="**/*Test.php"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
</phpunit>
|
|
||||||
<phpunitreport
|
|
||||||
infile="test/reports/testsuites.xml"
|
|
||||||
format="frames"
|
|
||||||
todir="test/reports/html"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build a documentation-only package.
|
|
||||||
|
|
||||||
This just runs the 'doc' target and then packages the output into a tar and a zip file.
|
|
||||||
-->
|
|
||||||
<target name="docBuild" description="Build a package containing just docs."
|
|
||||||
depends="setup,prebuild,doc">
|
|
||||||
<property name="releasedir" value="${builddir}/${projectname}-${version}-docs"/>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
|
|
||||||
<!-- Make all necessary directories. -->
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
|
|
||||||
<!-- Copy license files. -->
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Copy documentation -->
|
|
||||||
<copy todir="${releasedir}/doc">
|
|
||||||
<fileset refid="docs"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Create tgz and zip versions. -->
|
|
||||||
<tar destfile="${packagedir}/${projectname}-${version}-docs.tgz" compression="gzip">
|
|
||||||
<fileset dir="${builddir}">
|
|
||||||
<include name="${projectname}-${version}-docs/**/*"/>
|
|
||||||
</fileset>
|
|
||||||
</tar>
|
|
||||||
<zip destfile="${packagedir}/${projectname}-${version}-docs.zip" basedir="${releasedir}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Build a Phar package.
|
|
||||||
|
|
||||||
For PHP 5.3 and up, this is another way of building a release - a much better way.
|
|
||||||
|
|
||||||
This target is not called by the default build.
|
|
||||||
-->
|
|
||||||
<target name="pharBuild" depends="setup,prebuild" description="Build a Phar package of this project.">
|
|
||||||
|
|
||||||
<property name="releasedir" value="${builddir}/${projectname}-${version}-phar" override="true"/>
|
|
||||||
<echo>${releasedir}</echo>
|
|
||||||
<delete dir="${releasedir}" />
|
|
||||||
<mkdir dir="${releasedir}"/>
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<filterchain>
|
|
||||||
<stripphpcomments/>
|
|
||||||
<stripwhitespace/>
|
|
||||||
<replacetokens begintoken="@" endtoken="@">
|
|
||||||
<token key="UNSTABLE" value="${version}"/>
|
|
||||||
<token key="PHAR_FILENAME" value="${projectname}.phar"/>
|
|
||||||
</replacetokens>
|
|
||||||
</filterchain>
|
|
||||||
<fileset dir="${srcdir}">
|
|
||||||
<include name="**/*"/>
|
|
||||||
</fileset>
|
|
||||||
</copy>
|
|
||||||
<copy todir="${releasedir}">
|
|
||||||
<fileset refid="licensefiles"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<pharpackage
|
|
||||||
destfile="${packagedir}/${projectname}-${version}.phar"
|
|
||||||
basedir="${releasedir}"
|
|
||||||
alias="${projectname}.phar">
|
|
||||||
<!-- stub="${releasedir}/basic_loader.php" -->
|
|
||||||
<fileset dir="${releasedir}">
|
|
||||||
<include name="**/**"/>
|
|
||||||
</fileset>
|
|
||||||
<metadata>
|
|
||||||
<element name="version" value="${version}" />
|
|
||||||
<element name="authors">
|
|
||||||
<element name="${project.lead}">
|
|
||||||
<element name="e-mail" value="${project.lead.email}" />
|
|
||||||
</element>
|
|
||||||
</element>
|
|
||||||
</metadata>
|
|
||||||
</pharpackage>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Use Pyrus to generate package.xml files.
|
|
||||||
-->
|
|
||||||
<target name="pyrusMake" depends="setup,prebuild" description="EXPERIMENTAL: Use Pyrus to generate a package.xml file from this project.">
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
|
|
||||||
Use Pyrus to create a PEAR package.
|
|
||||||
-->
|
|
||||||
<target name="pyrusPackage" depends="setup,prebuild" description="EXPERIMENTAL: Use Pyrus to generate a PEAR package.">
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- TARGET
|
|
||||||
Release code to a PEAR channel.
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<target name="release" depends="build">
|
|
||||||
<property name="pirumdir" value="${pearchannel}"/>
|
|
||||||
<pirumbuild targetdir="${pirumdir}"/>
|
|
||||||
<pirumadd targetdir="${pirumdir}" packagefile="${packagedir}/${packagename}-${version}.tgz"/>
|
|
||||||
</target>
|
|
||||||
-->
|
|
||||||
<target name="setPearStability" depends="setup">
|
|
||||||
<property name="stability">stable</property>
|
|
||||||
<if>
|
|
||||||
<contains string="${version}" substring="dev"/>
|
|
||||||
<then>
|
|
||||||
<property name="stability" override="true">snapshot</property>
|
|
||||||
</then>
|
|
||||||
<elseif>
|
|
||||||
<contains string="${version}" substring="alpha"/>
|
|
||||||
<then>
|
|
||||||
<property name="stability" override="true">alpha</property>
|
|
||||||
</then>
|
|
||||||
</elseif>
|
|
||||||
<elseif>
|
|
||||||
<contains string="${version}" substring="beta"/>
|
|
||||||
<then>
|
|
||||||
<property name="stability" override="true">beta</property>
|
|
||||||
</then>
|
|
||||||
</elseif>
|
|
||||||
</if>
|
|
||||||
<echo>${stability}</echo>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
{
|
{
|
||||||
"name": "M Butcher",
|
"name": "M Butcher",
|
||||||
"email": "matthew.butcher@hp.com"
|
"email": "matthew.butcher@hp.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Matt Farina",
|
||||||
|
"email": "matthew.farina@hp.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
# Project build properties for HPCloud-PHP
|
|
||||||
#
|
|
||||||
# You can set your project-wide settings here.
|
|
||||||
#
|
|
||||||
# This file has some of the common properties -- the ones we think you probably
|
|
||||||
# want to change -- declared here. There are other available properties at the
|
|
||||||
# top of the build.xml file.
|
|
||||||
|
|
||||||
# The name of the project. Alpha-Num and underscores allowed. NO SPACES.
|
|
||||||
#project.name=HPCloud-PHP
|
|
||||||
|
|
||||||
# Where people can go to learn more about this project.
|
|
||||||
project.homepage=http://github.com/hpcloud
|
|
||||||
|
|
||||||
# A short phrase describing this project.
|
|
||||||
project.summary=PHP API for HP Cloud
|
|
||||||
|
|
||||||
# Technical description of this project.
|
|
||||||
project.description=Provides an API for working with the HP Cloud
|
|
||||||
|
|
||||||
# The name of the license under which this is released.
|
|
||||||
project.license=MIT License
|
|
||||||
|
|
||||||
# The minimal PHP version required to run this project.
|
|
||||||
project.php.version=5.3.1
|
|
||||||
|
|
||||||
# Name and email of the "lead developer" of this project.
|
|
||||||
project.lead=technosophos
|
|
||||||
project.lead.email=matthew.butcher@hp.com
|
|
||||||
|
|
||||||
# If you are building PEAR packages, set this.
|
|
||||||
# (By default, our tgz files are PEAR packages)
|
|
||||||
pear.channel=pear.hpcloud.com
|
|
||||||
|
|
||||||
# If you are using PhpDocumentor for documentation, set the output format
|
|
||||||
# using this.
|
|
||||||
phpdoc.style=HTML:frames:earthli
|
|
||||||
@@ -285,6 +285,7 @@ class Bootstrap {
|
|||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* The default value to return if the name is not found.
|
* The default value to return if the name is not found.
|
||||||
* @retval mixed
|
* @retval mixed
|
||||||
|
* @return mixed
|
||||||
* The value, if found; or the default, if set; or NULL.
|
* The value, if found; or the default, if set; or NULL.
|
||||||
*/
|
*/
|
||||||
public static function config($name = NULL, $default = NULL) {
|
public static function config($name = NULL, $default = NULL) {
|
||||||
@@ -315,6 +316,7 @@ class Bootstrap {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the item to check for.
|
* The name of the item to check for.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the named option is set, FALSE otherwise. Note that the value may
|
* TRUE if the named option is set, FALSE otherwise. Note that the value may
|
||||||
* be falsey (FALSE, 0, etc.), but if the value is NULL, this will return
|
* be falsey (FALSE, 0, etc.), but if the value is NULL, this will return
|
||||||
* false.
|
* false.
|
||||||
@@ -333,6 +335,7 @@ class Bootstrap {
|
|||||||
* Whether to force the generation of a new object even if one is already
|
* Whether to force the generation of a new object even if one is already
|
||||||
* cached.
|
* cached.
|
||||||
* @retval HPCloud::Services::IdentityService
|
* @retval HPCloud::Services::IdentityService
|
||||||
|
* @return \HPCloud\Services\:IdentityService
|
||||||
* An authenticated ready to use HPCloud::Services::IdentityService object.
|
* An authenticated ready to use HPCloud::Services::IdentityService object.
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
* When the needed configuration to authenticate is not available.
|
* When the needed configuration to authenticate is not available.
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ class DBaaS {
|
|||||||
* Get the project ID for this session.
|
* Get the project ID for this session.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The project ID.
|
* The project ID.
|
||||||
*/
|
*/
|
||||||
public function projectId() {
|
public function projectId() {
|
||||||
@@ -147,6 +148,7 @@ class DBaaS {
|
|||||||
* Get the endpoint URL to the DBaaS session.
|
* Get the endpoint URL to the DBaaS session.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The URL.
|
* The URL.
|
||||||
*/
|
*/
|
||||||
public function url() {
|
public function url() {
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ class Instance extends Operations {
|
|||||||
*- medium
|
*- medium
|
||||||
* @param array $typeSpec
|
* @param array $typeSpec
|
||||||
* A typespec array. Currently, only 'mysql', '5.5' is supported.
|
* A typespec array. Currently, only 'mysql', '5.5' is supported.
|
||||||
* @retval object HPCloud::Services::DBaaS::InstanceDetails
|
* @retval HPCloud::Services::DBaaS::InstanceDetails
|
||||||
|
* @return \HPCloud\Services\DBaaS\InstanceDetails
|
||||||
* The details of creation, including login and password info.
|
* The details of creation, including login and password info.
|
||||||
* @see http://api-docs.hpcloud.com/hpcloud-dbaas/1.0/content/instance-create.html
|
* @see http://api-docs.hpcloud.com/hpcloud-dbaas/1.0/content/instance-create.html
|
||||||
*/
|
*/
|
||||||
@@ -132,6 +133,7 @@ class Instance extends Operations {
|
|||||||
* Reset the primary password on this instance.
|
* Reset the primary password on this instance.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The new (autogenerated) password.
|
* The new (autogenerated) password.
|
||||||
*/
|
*/
|
||||||
public function resetPassword($instanceId) {
|
public function resetPassword($instanceId) {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class InstanceDetails {
|
|||||||
* Get the name of this instance.
|
* Get the name of this instance.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The name of the instance.
|
* The name of the instance.
|
||||||
*/
|
*/
|
||||||
public function name() {
|
public function name() {
|
||||||
@@ -84,6 +85,7 @@ class InstanceDetails {
|
|||||||
* Get the ID of the instance.
|
* Get the ID of the instance.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The ID.
|
* The ID.
|
||||||
*/
|
*/
|
||||||
public function id() {
|
public function id() {
|
||||||
@@ -96,6 +98,7 @@ class InstanceDetails {
|
|||||||
* This may only be set during CREATE or DESCRIBE results.
|
* This may only be set during CREATE or DESCRIBE results.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A string indicating the creation time.
|
* A string indicating the creation time.
|
||||||
* Format is in ISO date format.
|
* Format is in ISO date format.
|
||||||
*/
|
*/
|
||||||
@@ -115,6 +118,7 @@ class InstanceDetails {
|
|||||||
*- restarting: Instance has been restarted, and is still coming online.
|
*- restarting: Instance has been restarted, and is still coming online.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A short status message.
|
* A short status message.
|
||||||
*/
|
*/
|
||||||
public function status() {
|
public function status() {
|
||||||
@@ -129,6 +133,7 @@ class InstanceDetails {
|
|||||||
* checking that status() returns 'running'.
|
* checking that status() returns 'running'.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if this is running, FALSE otherwise.
|
* TRUE if this is running, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function isRunning() {
|
public function isRunning() {
|
||||||
@@ -148,6 +153,7 @@ class InstanceDetails {
|
|||||||
* This returns the DNS name of the host (or possibly an IP address).
|
* This returns the DNS name of the host (or possibly an IP address).
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The FQDN or IP address of the MySQL server.
|
* The FQDN or IP address of the MySQL server.
|
||||||
*/
|
*/
|
||||||
public function hostname() {
|
public function hostname() {
|
||||||
@@ -177,6 +183,7 @@ class InstanceDetails {
|
|||||||
* Typically this is only available at creation time!
|
* Typically this is only available at creation time!
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The username for the MySQL instance.
|
* The username for the MySQL instance.
|
||||||
*/
|
*/
|
||||||
public function username() {
|
public function username() {
|
||||||
@@ -208,6 +215,7 @@ class InstanceDetails {
|
|||||||
* This is only returned when a database is first created.
|
* This is only returned when a database is first created.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A password string.
|
* A password string.
|
||||||
*/
|
*/
|
||||||
public function password() {
|
public function password() {
|
||||||
@@ -250,6 +258,7 @@ class InstanceDetails {
|
|||||||
* definition.
|
* definition.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of related links to DBaaS URLs.
|
* An array of related links to DBaaS URLs.
|
||||||
*/
|
*/
|
||||||
public function links() {
|
public function links() {
|
||||||
@@ -271,6 +280,7 @@ class InstanceDetails {
|
|||||||
* of PHP use this.
|
* of PHP use this.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The DSN, including driver, host, port, and database name.
|
* The DSN, including driver, host, port, and database name.
|
||||||
* @todo
|
* @todo
|
||||||
* At this time, 'mysql' is hard-coded as the driver name. Does this
|
* At this time, 'mysql' is hard-coded as the driver name. Does this
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class Snapshot extends Operations {
|
|||||||
* An optional database instance ID. If set, only snapshots for
|
* An optional database instance ID. If set, only snapshots for
|
||||||
* the given instance will be returned.
|
* the given instance will be returned.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of HPCloud::Services::DBaaS::SnapshotDetails
|
* An array of HPCloud::Services::DBaaS::SnapshotDetails
|
||||||
* instances.
|
* instances.
|
||||||
*/
|
*/
|
||||||
@@ -102,7 +103,8 @@ class Snapshot extends Operations {
|
|||||||
* A human-readable name for the snapshot. Internally,
|
* A human-readable name for the snapshot. Internally,
|
||||||
* a snapshot ID will be used to reference this
|
* a snapshot ID will be used to reference this
|
||||||
* snapshot.
|
* snapshot.
|
||||||
* @retval object HPCloud::Services::DBaaS::SnapshotDetails
|
* @retval HPCloud::Services::DBaaS::SnapshotDetails
|
||||||
|
* @return \HPCloud\Services\DBaaS\SnapshotDetails
|
||||||
* A snapshot details object containing information about
|
* A snapshot details object containing information about
|
||||||
* the snapshot.
|
* the snapshot.
|
||||||
*/
|
*/
|
||||||
@@ -130,6 +132,7 @@ class Snapshot extends Operations {
|
|||||||
* The snapshot ID for the snapshot that should
|
* The snapshot ID for the snapshot that should
|
||||||
* be deleted.
|
* be deleted.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* Returns boolean TRUE on success. Throws one of the
|
* Returns boolean TRUE on success. Throws one of the
|
||||||
* HPCloud::Exception instances on failure.
|
* HPCloud::Exception instances on failure.
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
@@ -148,7 +151,8 @@ class Snapshot extends Operations {
|
|||||||
* @param string $snapshotId
|
* @param string $snapshotId
|
||||||
* The snapshot ID.
|
* The snapshot ID.
|
||||||
*
|
*
|
||||||
* @retval object HPCloud::Services::DBaaS::SnapshotDetails
|
* @retval HPCloud::Services::DBaaS::SnapshotDetails
|
||||||
|
* @return \HPCloud\Services\DBaaS\SnapshotDetails
|
||||||
* The details object.
|
* The details object.
|
||||||
*/
|
*/
|
||||||
public function describe($snapshotId) {
|
public function describe($snapshotId) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class SnapshotDetails {
|
|||||||
* The ID of the snapshot.
|
* The ID of the snapshot.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The ID.
|
* The ID.
|
||||||
*/
|
*/
|
||||||
public function id() {
|
public function id() {
|
||||||
@@ -66,6 +67,7 @@ class SnapshotDetails {
|
|||||||
* is a snapshot.
|
* is a snapshot.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The database instance ID.
|
* The database instance ID.
|
||||||
*/
|
*/
|
||||||
public function instanceId() {
|
public function instanceId() {
|
||||||
@@ -75,6 +77,7 @@ class SnapshotDetails {
|
|||||||
* The data upon which this snapshot was created.
|
* The data upon which this snapshot was created.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* An ISO data string representing the date and time
|
* An ISO data string representing the date and time
|
||||||
* that this snapshot was created.
|
* that this snapshot was created.
|
||||||
*/
|
*/
|
||||||
@@ -90,6 +93,7 @@ class SnapshotDetails {
|
|||||||
* The data returned from this may be in flux during the beta release
|
* The data returned from this may be in flux during the beta release
|
||||||
* of this product.
|
* of this product.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of links. Typically, at least an URL to the snapshot should
|
* An array of links. Typically, at least an URL to the snapshot should
|
||||||
* be provided.
|
* be provided.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* URL to the one passed into the constructor.
|
* URL to the one passed into the constructor.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The complete URL to the identity services endpoint.
|
* The complete URL to the identity services endpoint.
|
||||||
*/
|
*/
|
||||||
public function url() {
|
public function url() {
|
||||||
@@ -258,6 +259,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* An associative array of authentication operations and their respective
|
* An associative array of authentication operations and their respective
|
||||||
* parameters.
|
* parameters.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The token. This is returned for simplicity. The full response is used
|
* The token. This is returned for simplicity. The full response is used
|
||||||
* to populate this object's service catalog, etc. The token is also
|
* to populate this object's service catalog, etc. The token is also
|
||||||
* retrievable with token().
|
* retrievable with token().
|
||||||
@@ -383,6 +385,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* The tenant Name for this account. This can be obtained through the
|
* The tenant Name for this account. This can be obtained through the
|
||||||
* HPCloud console.
|
* HPCloud console.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The auth token.
|
* The auth token.
|
||||||
* @throws HPCloud::Transport::AuthorizationException
|
* @throws HPCloud::Transport::AuthorizationException
|
||||||
* If authentication failed.
|
* If authentication failed.
|
||||||
@@ -416,6 +419,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* methods has been run.
|
* methods has been run.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The token ID to be used in subsequent calls.
|
* The token ID to be used in subsequent calls.
|
||||||
*/
|
*/
|
||||||
public function token() {
|
public function token() {
|
||||||
@@ -432,6 +436,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* run.
|
* run.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The tenant ID if available, or NULL.
|
* The tenant ID if available, or NULL.
|
||||||
*/
|
*/
|
||||||
public function tenantId() {
|
public function tenantId() {
|
||||||
@@ -450,6 +455,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* run.
|
* run.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The tenant name if available, or NULL.
|
* The tenant name if available, or NULL.
|
||||||
*/
|
*/
|
||||||
public function tenantName() {
|
public function tenantName() {
|
||||||
@@ -484,6 +490,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* This will not be populated until after authentication has been done.
|
* This will not be populated until after authentication has been done.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of details.
|
* An associative array of details.
|
||||||
*/
|
*/
|
||||||
public function tokenDetails() {
|
public function tokenDetails() {
|
||||||
@@ -498,6 +505,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* mis-configured machine timestamp could give spurious results.
|
* mis-configured machine timestamp could give spurious results.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* This will return FALSE if there is a current token and it has
|
* This will return FALSE if there is a current token and it has
|
||||||
* not yet expired (according to the date info). In all other cases
|
* not yet expired (according to the date info). In all other cases
|
||||||
* it returns TRUE.
|
* it returns TRUE.
|
||||||
@@ -581,6 +589,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* @todo Paging on the service catalog is not yet implemented.
|
* @todo Paging on the service catalog is not yet implemented.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array representing
|
* An associative array representing
|
||||||
* the service catalog.
|
* the service catalog.
|
||||||
*/
|
*/
|
||||||
@@ -628,6 +637,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* This will not have data until after authentication has been done.
|
* This will not have data until after authentication has been done.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array, as described above.
|
* An associative array, as described above.
|
||||||
*/
|
*/
|
||||||
public function user() {
|
public function user() {
|
||||||
@@ -661,6 +671,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* Note that this method invokes a new request against the remote server.
|
* Note that this method invokes a new request against the remote server.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An indexed array of tenant info. Each entry will be an associative
|
* An indexed array of tenant info. Each entry will be an associative
|
||||||
* array containing tenant details.
|
* array containing tenant details.
|
||||||
* @throws HPCloud::Transport::AuthorizationException
|
* @throws HPCloud::Transport::AuthorizationException
|
||||||
@@ -723,6 +734,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* ID will be removed.
|
* ID will be removed.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The authentication token.
|
* The authentication token.
|
||||||
* @throws HPCloud::Transport::AuthorizationException
|
* @throws HPCloud::Transport::AuthorizationException
|
||||||
* If authentication failed.
|
* If authentication failed.
|
||||||
@@ -780,6 +792,7 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
* name will be removed.
|
* name will be removed.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The authentication token.
|
* The authentication token.
|
||||||
* @throws HPCloud::Transport::AuthorizationException
|
* @throws HPCloud::Transport::AuthorizationException
|
||||||
* If authentication failed.
|
* If authentication failed.
|
||||||
@@ -822,6 +835,10 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
*
|
*
|
||||||
* @param object $response HPCloud::Transport::Response
|
* @param object $response HPCloud::Transport::Response
|
||||||
* A response object.
|
* A response object.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Services::IdentityServices
|
||||||
|
* @return \HPCloud\Services\IdentityServices
|
||||||
|
* $this for the current object so it can be used in chaining.
|
||||||
*/
|
*/
|
||||||
protected function handleResponse($response) {
|
protected function handleResponse($response) {
|
||||||
$json = json_decode($response->content(), TRUE);
|
$json = json_decode($response->content(), TRUE);
|
||||||
@@ -830,6 +847,8 @@ class IdentityServices /*implements Serializable*/ {
|
|||||||
$this->tokenDetails = $json['access']['token'];
|
$this->tokenDetails = $json['access']['token'];
|
||||||
$this->userDetails = $json['access']['user'];
|
$this->userDetails = $json['access']['user'];
|
||||||
$this->serviceCatalog = $json['access']['serviceCatalog'];
|
$this->serviceCatalog = $json['access']['serviceCatalog'];
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not necessary.
|
/* Not necessary.
|
||||||
|
|||||||
@@ -149,7 +149,9 @@ class CDN {
|
|||||||
*
|
*
|
||||||
* @param HPCloud::Services::IdentityServices $identity
|
* @param HPCloud::Services::IdentityServices $identity
|
||||||
* The identity to use.
|
* The identity to use.
|
||||||
* @retval object
|
* @retval boolean
|
||||||
|
* @retval HPCloud::Storage::CDN
|
||||||
|
* @return \HPCloud\Storage\CDN|boolean
|
||||||
* A CDN object or FALSE if no CDN services could be found
|
* A CDN object or FALSE if no CDN services could be found
|
||||||
* in the catalog.
|
* in the catalog.
|
||||||
*/
|
*/
|
||||||
@@ -195,7 +197,9 @@ class CDN {
|
|||||||
* A service catalog; see HPCloud::Services::IdentityServices::serviceCatalog().
|
* A service catalog; see HPCloud::Services::IdentityServices::serviceCatalog().
|
||||||
* @param string $token
|
* @param string $token
|
||||||
* The token.
|
* The token.
|
||||||
* @retval object
|
* @retval boolean
|
||||||
|
* @retval HPCloud::Storage::CDN
|
||||||
|
* @return boolean|\HPCloud\Storage\CDN
|
||||||
* A CDN object or FALSE if no CDN services could be found
|
* A CDN object or FALSE if no CDN services could be found
|
||||||
* in the catalog.
|
* in the catalog.
|
||||||
*/
|
*/
|
||||||
@@ -305,6 +309,7 @@ class CDN {
|
|||||||
* If this is set to TRUE, then only containers that are
|
* If this is set to TRUE, then only containers that are
|
||||||
* CDN-enabled will be returned.
|
* CDN-enabled will be returned.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An indexed array of associative arrays. The format of each
|
* An indexed array of associative arrays. The format of each
|
||||||
* associative array is explained on container().
|
* associative array is explained on container().
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
@@ -357,6 +362,7 @@ class CDN {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the container to fetch.
|
* The name of the container to fetch.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array in the exact format as in containers.
|
* An associative array in the exact format as in containers.
|
||||||
*/
|
*/
|
||||||
public function container($name) {
|
public function container($name) {
|
||||||
@@ -412,6 +418,7 @@ class CDN {
|
|||||||
* If this is passed, then its value will be set to TRUE if the
|
* If this is passed, then its value will be set to TRUE if the
|
||||||
* container was created in the CDN, or FALSE if the container
|
* container was created in the CDN, or FALSE if the container
|
||||||
* already existed in CDN.
|
* already existed in CDN.
|
||||||
|
* @retval string
|
||||||
* @return string
|
* @return string
|
||||||
* TRUE if the container was created, FALSE if the container was already
|
* TRUE if the container was created, FALSE if the container was already
|
||||||
* added to the CDN (and thus nothing happened).
|
* added to the CDN (and thus nothing happened).
|
||||||
@@ -450,6 +457,7 @@ class CDN {
|
|||||||
* @param array $attrs
|
* @param array $attrs
|
||||||
* An associative array of attributes.
|
* An associative array of attributes.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the update was successful.
|
* TRUE if the update was successful.
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
* Possibly throws one of the HTTP exceptions.
|
* Possibly throws one of the HTTP exceptions.
|
||||||
@@ -509,6 +517,7 @@ class CDN {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the container whose cache should be suspended.
|
* The name of the container whose cache should be suspended.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the container is disabled.
|
* TRUE if the container is disabled.
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
* HTTP exceptions may be thrown if an error occurs.
|
* HTTP exceptions may be thrown if an error occurs.
|
||||||
@@ -535,6 +544,7 @@ class CDN {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The Container name.
|
* The Container name.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the container was successfully deleted,
|
* TRUE if the container was successfully deleted,
|
||||||
* FALSE if the container was not removed, but no
|
* FALSE if the container was not removed, but no
|
||||||
* error occurred.
|
* error occurred.
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ class ObjectStorage {
|
|||||||
* @param HPCloud::Services::IdentityServices $identity
|
* @param HPCloud::Services::IdentityServices $identity
|
||||||
* An identity services object that already has a valid token and a
|
* An identity services object that already has a valid token and a
|
||||||
* service catalog.
|
* service catalog.
|
||||||
* @retval object ObjectStorage
|
* @retval HPCloud::Storage::ObjectStorage
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage
|
||||||
* A new ObjectStorage instance.
|
* A new ObjectStorage instance.
|
||||||
*/
|
*/
|
||||||
public static function newFromIdentity($identity) {
|
public static function newFromIdentity($identity) {
|
||||||
@@ -196,7 +197,8 @@ class ObjectStorage {
|
|||||||
* just ObjectStorage::SERVICE_TYPE.
|
* just ObjectStorage::SERVICE_TYPE.
|
||||||
* @param string $authToken
|
* @param string $authToken
|
||||||
* The auth token returned by IdentityServices.
|
* The auth token returned by IdentityServices.
|
||||||
* @retval object ObjectStorage
|
* @retval HPCloud::Storage::ObjectStorage
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage
|
||||||
* A new ObjectStorage instance.
|
* A new ObjectStorage instance.
|
||||||
*/
|
*/
|
||||||
public static function newFromServiceCatalog($catalog, $authToken) {
|
public static function newFromServiceCatalog($catalog, $authToken) {
|
||||||
@@ -245,6 +247,10 @@ class ObjectStorage {
|
|||||||
* objects in CDN can be older than objects in Swift itself. For that
|
* objects in CDN can be older than objects in Swift itself. For that
|
||||||
* reason, CDN should not be used when a combination of read and write
|
* reason, CDN should not be used when a combination of read and write
|
||||||
* operations occur.
|
* operations occur.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage
|
||||||
|
* $this for current object so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function useCDN($cdn) {
|
public function useCDN($cdn) {
|
||||||
|
|
||||||
@@ -268,6 +274,8 @@ class ObjectStorage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->cdnContainers = $buffer;
|
$this->cdnContainers = $buffer;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasCDN() {
|
public function hasCDN() {
|
||||||
@@ -286,6 +294,7 @@ class ObjectStorage {
|
|||||||
* If this is TRUE (default), get the URL to the SSL CDN;
|
* If this is TRUE (default), get the URL to the SSL CDN;
|
||||||
* otherwise get the URL to the plain HTTP CDN.
|
* otherwise get the URL to the plain HTTP CDN.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The URL to the CDN container, or NULL if no such
|
* The URL to the CDN container, or NULL if no such
|
||||||
* URL is found.
|
* URL is found.
|
||||||
*/
|
*/
|
||||||
@@ -300,6 +309,7 @@ class ObjectStorage {
|
|||||||
* Get the authentication token.
|
* Get the authentication token.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The authentication token.
|
* The authentication token.
|
||||||
*/
|
*/
|
||||||
public function token() {
|
public function token() {
|
||||||
@@ -310,6 +320,7 @@ class ObjectStorage {
|
|||||||
* Get the URL endpoint.
|
* Get the URL endpoint.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The URL that is the endpoint for this service.
|
* The URL that is the endpoint for this service.
|
||||||
*/
|
*/
|
||||||
public function url() {
|
public function url() {
|
||||||
@@ -346,6 +357,7 @@ class ObjectStorage {
|
|||||||
* The name of the last object seen. Used when paging.
|
* The name of the last object seen. Used when paging.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of containers, where the key is the
|
* An associative array of containers, where the key is the
|
||||||
* container's name and the value is an
|
* container's name and the value is an
|
||||||
* HPCloud::Storage::ObjectStorage::Container object. Results are
|
* HPCloud::Storage::ObjectStorage::Container object. Results are
|
||||||
@@ -387,6 +399,7 @@ class ObjectStorage {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the container to load.
|
* The name of the container to load.
|
||||||
* @retval HPCloud::Storage::ObjectStorage::Container
|
* @retval HPCloud::Storage::ObjectStorage::Container
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Container
|
||||||
* A container.
|
* A container.
|
||||||
* @throws HPCloud::Transport::FileNotFoundException
|
* @throws HPCloud::Transport::FileNotFoundException
|
||||||
* if the named container is not found on the remote server.
|
* if the named container is not found on the remote server.
|
||||||
@@ -422,6 +435,7 @@ class ObjectStorage {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the container to test.
|
* The name of the container to test.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the container exists, FALSE if it does not.
|
* TRUE if the container exists, FALSE if it does not.
|
||||||
* @throws HPCloud::Exception
|
* @throws HPCloud::Exception
|
||||||
* If an unexpected network error occurs.
|
* If an unexpected network error occurs.
|
||||||
@@ -495,6 +509,7 @@ class ObjectStorage {
|
|||||||
* @param array $metadata
|
* @param array $metadata
|
||||||
* An associative array of metadata to attach to the container.
|
* An associative array of metadata to attach to the container.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the container was created, FALSE if the container was not
|
* TRUE if the container was created, FALSE if the container was not
|
||||||
* created because it already exists.
|
* created because it already exists.
|
||||||
*/
|
*/
|
||||||
@@ -558,6 +573,7 @@ class ObjectStorage {
|
|||||||
* An ACL. To make the container publically readable, use
|
* An ACL. To make the container publically readable, use
|
||||||
* ACL::makePublic().
|
* ACL::makePublic().
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the cointainer was created, FALSE otherwise.
|
* TRUE if the cointainer was created, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function changeContainerACL($name, ACL $acl) {
|
public function changeContainerACL($name, ACL $acl) {
|
||||||
@@ -579,6 +595,7 @@ class ObjectStorage {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the container.
|
* The name of the container.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the container was deleted, FALSE if the container was not
|
* TRUE if the container was deleted, FALSE if the container was not
|
||||||
* found (and hence, was not deleted).
|
* found (and hence, was not deleted).
|
||||||
* @throws HPCloud::Storage::ObjectStorage::ContainerNotEmptyException
|
* @throws HPCloud::Storage::ObjectStorage::ContainerNotEmptyException
|
||||||
@@ -625,6 +642,7 @@ class ObjectStorage {
|
|||||||
* - The number of containers (`count`).
|
* - The number of containers (`count`).
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of account info. Typical keys are:
|
* An associative array of account info. Typical keys are:
|
||||||
* - bytes: Bytes consumed by existing content.
|
* - bytes: Bytes consumed by existing content.
|
||||||
* - containers: Number of containers.
|
* - containers: Number of containers.
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ class ACL {
|
|||||||
* - READ to any host, with container listings.
|
* - READ to any host, with container listings.
|
||||||
*
|
*
|
||||||
* @retval HPCloud::Storage::ObjectStorage::ACL
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
* an ACL object with the appopriate permissions set.
|
* an ACL object with the appopriate permissions set.
|
||||||
*/
|
*/
|
||||||
public static function makePublic() {
|
public static function makePublic() {
|
||||||
@@ -172,6 +173,7 @@ class ACL {
|
|||||||
* with no permissions as a private object.
|
* with no permissions as a private object.
|
||||||
*
|
*
|
||||||
* @retval HPCloud::Storage::ObjectStorage::ACL
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
* an ACL object with the appopriate permissions set.
|
* an ACL object with the appopriate permissions set.
|
||||||
*/
|
*/
|
||||||
public static function makeNonPublic() {
|
public static function makeNonPublic() {
|
||||||
@@ -194,7 +196,8 @@ class ACL {
|
|||||||
*
|
*
|
||||||
* @param array $headers
|
* @param array $headers
|
||||||
* An associative array of headers.
|
* An associative array of headers.
|
||||||
* @retval ACL
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
* A new ACL.
|
* A new ACL.
|
||||||
*/
|
*/
|
||||||
public static function newFromHeaders($headers) {
|
public static function newFromHeaders($headers) {
|
||||||
@@ -242,6 +245,7 @@ class ACL {
|
|||||||
* @param string $rule
|
* @param string $rule
|
||||||
* The string rule to parse.
|
* The string rule to parse.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* The rule as an array.
|
* The rule as an array.
|
||||||
*/
|
*/
|
||||||
public static function parseRule($perm, $rule) {
|
public static function parseRule($perm, $rule) {
|
||||||
@@ -319,6 +323,10 @@ class ACL {
|
|||||||
* @param mixed $user
|
* @param mixed $user
|
||||||
* The name of the user, or optionally an indexed array of user
|
* The name of the user, or optionally an indexed array of user
|
||||||
* names.
|
* names.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
|
* $this for current object so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function addAccount($perm, $account, $user = NULL) {
|
public function addAccount($perm, $account, $user = NULL) {
|
||||||
$rule = array('account' => $account);
|
$rule = array('account' => $account);
|
||||||
@@ -328,6 +336,8 @@ class ACL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->addRule($perm, $rule);
|
$this->addRule($perm, $rule);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -350,9 +360,15 @@ class ACL {
|
|||||||
* The permission being granted. One of ACL:READ, ACL::WRITE, or ACL::READ_WRITE.
|
* The permission being granted. One of ACL:READ, ACL::WRITE, or ACL::READ_WRITE.
|
||||||
* @param string $host
|
* @param string $host
|
||||||
* A host specification string as described above.
|
* A host specification string as described above.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
|
* $this for current object so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function addReferrer($perm, $host = '*') {
|
public function addReferrer($perm, $host = '*') {
|
||||||
$this->addRule($perm, array('host' => $host));
|
$this->addRule($perm, array('host' => $host));
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -362,11 +378,17 @@ class ACL {
|
|||||||
* One of the predefined permission constants.
|
* One of the predefined permission constants.
|
||||||
* @param array $rule
|
* @param array $rule
|
||||||
* A rule array.
|
* A rule array.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
|
* $this for current object so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
protected function addRule($perm, $rule) {
|
protected function addRule($perm, $rule) {
|
||||||
$rule['mask'] = $perm;
|
$rule['mask'] = $perm;
|
||||||
|
|
||||||
$this->rules[] = $rule;
|
$this->rules[] = $rule;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -379,6 +401,10 @@ class ACL {
|
|||||||
*
|
*
|
||||||
* In the current Swift implementation, there is no mechanism for
|
* In the current Swift implementation, there is no mechanism for
|
||||||
* allowing some hosts to get listings, while denying others.
|
* allowing some hosts to get listings, while denying others.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::ACL
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\ACL
|
||||||
|
* $this for current object so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function allowListings() {
|
public function allowListings() {
|
||||||
|
|
||||||
@@ -386,12 +412,15 @@ class ACL {
|
|||||||
'mask' => self::READ,
|
'mask' => self::READ,
|
||||||
'rlistings' => TRUE,
|
'rlistings' => TRUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the rules array for this ACL.
|
* Get the rules array for this ACL.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of associative arrays of rules.
|
* An array of associative arrays of rules.
|
||||||
*/
|
*/
|
||||||
public function rules() {
|
public function rules() {
|
||||||
@@ -496,6 +525,7 @@ class ACL {
|
|||||||
* at all.
|
* at all.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if this is private (non-public), FALSE if
|
* TRUE if this is private (non-public), FALSE if
|
||||||
* any permissions are granted via this ACL.
|
* any permissions are granted via this ACL.
|
||||||
*/
|
*/
|
||||||
@@ -544,6 +574,7 @@ class ACL {
|
|||||||
* a pretty string.
|
* a pretty string.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The ACL represented as a string.
|
* The ACL represented as a string.
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $prefix
|
* @param string $prefix
|
||||||
* A prefix for the metadata headers.
|
* A prefix for the metadata headers.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of headers.
|
* An array of headers.
|
||||||
* @see http://docs.openstack.org/bexar/openstack-object-storage/developer/content/ch03s03.html#d5e635
|
* @see http://docs.openstack.org/bexar/openstack-object-storage/developer/content/ch03s03.html#d5e635
|
||||||
* @see http://docs.openstack.org/bexar/openstack-object-storage/developer/content/ch03s03.html#d5e700
|
* @see http://docs.openstack.org/bexar/openstack-object-storage/developer/content/ch03s03.html#d5e700
|
||||||
@@ -143,6 +144,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $oname
|
* @param string $oname
|
||||||
* The name of the object.
|
* The name of the object.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The URL to the object. Characters that need escaping will be escaped,
|
* The URL to the object. Characters that need escaping will be escaped,
|
||||||
* while slash characters are not. Thus, the URL will look pathy.
|
* while slash characters are not. Thus, the URL will look pathy.
|
||||||
*/
|
*/
|
||||||
@@ -179,6 +181,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $prefix
|
* @param string $prefix
|
||||||
* The prefix on metadata headers.
|
* The prefix on metadata headers.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of name/value attribute pairs.
|
* An associative array of name/value attribute pairs.
|
||||||
*/
|
*/
|
||||||
public static function extractHeaderAttributes($headers, $prefix = NULL) {
|
public static function extractHeaderAttributes($headers, $prefix = NULL) {
|
||||||
@@ -211,6 +214,10 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* The base URL. The container name is automatically appended to
|
* The base URL. The container name is automatically appended to
|
||||||
* this at construction time.
|
* this at construction time.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Comtainer
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Container
|
||||||
|
* A new container object.
|
||||||
*/
|
*/
|
||||||
public static function newFromJSON($jsonArray, $token, $url) {
|
public static function newFromJSON($jsonArray, $token, $url) {
|
||||||
$container = new Container($jsonArray['name']);
|
$container = new Container($jsonArray['name']);
|
||||||
@@ -252,7 +259,8 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* The base URL. The container name is automatically appended to
|
* The base URL. The container name is automatically appended to
|
||||||
* this at construction time.
|
* this at construction time.
|
||||||
* @retval Container
|
* @retval HPCloud::Storage::ObjectStorage::Container
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Container
|
||||||
* The Container object, initialized and ready for use.
|
* The Container object, initialized and ready for use.
|
||||||
*/
|
*/
|
||||||
public static function newFromResponse($name, $response, $token, $url) {
|
public static function newFromResponse($name, $response, $token, $url) {
|
||||||
@@ -348,6 +356,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* Get the name of this container.
|
* Get the name of this container.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The name of the container.
|
* The name of the container.
|
||||||
*/
|
*/
|
||||||
public function name() {
|
public function name() {
|
||||||
@@ -358,6 +367,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* Get the number of bytes in this container.
|
* Get the number of bytes in this container.
|
||||||
*
|
*
|
||||||
* @retval int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The number of bytes in this container.
|
* The number of bytes in this container.
|
||||||
*/
|
*/
|
||||||
public function bytes() {
|
public function bytes() {
|
||||||
@@ -383,6 +393,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* directly does.
|
* directly does.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of metadata name/value pairs.
|
* An array of metadata name/value pairs.
|
||||||
*/
|
*/
|
||||||
public function metadata() {
|
public function metadata() {
|
||||||
@@ -412,9 +423,15 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* Names can be no longer than 128 characters, and values can be no
|
* Names can be no longer than 128 characters, and values can be no
|
||||||
* more than 256. UTF-8 or ASCII characters are allowed, though ASCII
|
* more than 256. UTF-8 or ASCII characters are allowed, though ASCII
|
||||||
* seems to be preferred.
|
* seems to be preferred.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Container
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Container
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setMetadata($metadata) {
|
public function setMetadata($metadata) {
|
||||||
$this->metadata = $metadata;
|
$this->metadata = $metadata;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -430,6 +447,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @retval int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The number of items in this container.
|
* The number of items in this container.
|
||||||
*/
|
*/
|
||||||
public function count() {
|
public function count() {
|
||||||
@@ -452,6 +470,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* An optional file argument that, if set, will be treated as the
|
* An optional file argument that, if set, will be treated as the
|
||||||
* contents of the object.
|
* contents of the object.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the object was saved.
|
* TRUE if the object was saved.
|
||||||
* @throws HPCloud::Transport::LengthRequiredException
|
* @throws HPCloud::Transport::LengthRequiredException
|
||||||
* if the Content-Length could not be determined and chunked
|
* if the Content-Length could not be determined and chunked
|
||||||
@@ -571,6 +590,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* The object to update.
|
* The object to update.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the metadata was updated.
|
* TRUE if the metadata was updated.
|
||||||
*
|
*
|
||||||
* @throws HPCloud::Transport::FileNotFoundException
|
* @throws HPCloud::Transport::FileNotFoundException
|
||||||
@@ -689,7 +709,8 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* If this is TRUE (the default), then SSL will always be
|
* If this is TRUE (the default), then SSL will always be
|
||||||
* used. If this is FALSE, then CDN-based fetching will
|
* used. If this is FALSE, then CDN-based fetching will
|
||||||
* use non-SSL, which is faster.
|
* use non-SSL, which is faster.
|
||||||
* @retval \HPCloud\Storage\ObjectStorage\RemoteObject
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
* A remote object with the content already stored locally.
|
* A remote object with the content already stored locally.
|
||||||
*/
|
*/
|
||||||
public function object($name, $requireSSL = TRUE) {
|
public function object($name, $requireSSL = TRUE) {
|
||||||
@@ -753,7 +774,8 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the object to fetch.
|
* The name of the object to fetch.
|
||||||
* @retval \HPCloud\Storage\ObjectStorage\RemoteObject
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
* A remote object ready for use.
|
* A remote object ready for use.
|
||||||
*/
|
*/
|
||||||
public function proxyObject($name) {
|
public function proxyObject($name) {
|
||||||
@@ -824,6 +846,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* The name of the object to start with. The query will begin with
|
* The name of the object to start with. The query will begin with
|
||||||
* the next object AFTER this one.
|
* the next object AFTER this one.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* List of RemoteObject or Subdir instances.
|
* List of RemoteObject or Subdir instances.
|
||||||
*/
|
*/
|
||||||
public function objects($limit = NULL, $marker = NULL) {
|
public function objects($limit = NULL, $marker = NULL) {
|
||||||
@@ -885,6 +908,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* The name of the object to start with. The query will begin with
|
* The name of the object to start with. The query will begin with
|
||||||
* the next object AFTER this one.
|
* the next object AFTER this one.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* List of RemoteObject or Subdir instances.
|
* List of RemoteObject or Subdir instances.
|
||||||
*/
|
*/
|
||||||
public function objectsWithPrefix($prefix, $delimiter = '/', $limit = NULL, $marker = NULL) {
|
public function objectsWithPrefix($prefix, $delimiter = '/', $limit = NULL, $marker = NULL) {
|
||||||
@@ -950,6 +974,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* ObjectStorage::createContainer()) will be accessible by this URL.
|
* ObjectStorage::createContainer()) will be accessible by this URL.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The URL.
|
* The URL.
|
||||||
*/
|
*/
|
||||||
public function url() {
|
public function url() {
|
||||||
@@ -975,6 +1000,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
*
|
*
|
||||||
* @todo Determine how to get the ACL from JSON data.
|
* @todo Determine how to get the ACL from JSON data.
|
||||||
* @retval \HPCloud\Storage\ObjectStorage\ACL
|
* @retval \HPCloud\Storage\ObjectStorage\ACL
|
||||||
|
* @return HPCloud::Storage::ObjectStorage::ACL
|
||||||
* An ACL, or NULL if the ACL could not be retrieved.
|
* An ACL, or NULL if the ACL could not be retrieved.
|
||||||
*/
|
*/
|
||||||
public function acl() {
|
public function acl() {
|
||||||
@@ -989,6 +1015,9 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
*
|
*
|
||||||
* Not all containers come fully instantiated. This method is sometimes
|
* Not all containers come fully instantiated. This method is sometimes
|
||||||
* called to "fill in" missing fields.
|
* called to "fill in" missing fields.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Comtainer
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Container
|
||||||
*/
|
*/
|
||||||
protected function loadExtraData() {
|
protected function loadExtraData() {
|
||||||
|
|
||||||
@@ -1017,6 +1046,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
$prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
|
$prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
|
||||||
$this->setMetadata(Container::extractHeaderAttributes($response->headers(), $prefix));
|
$this->setMetadata(Container::extractHeaderAttributes($response->headers(), $prefix));
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1111,6 +1141,7 @@ class Container implements \Countable, \IteratorAggregate {
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* The name of the object to remove.
|
* The name of the object to remove.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the file was deleted, FALSE if no such file is found.
|
* TRUE if the file was deleted, FALSE if no such file is found.
|
||||||
*/
|
*/
|
||||||
public function delete($name) {
|
public function delete($name) {
|
||||||
|
|||||||
@@ -147,9 +147,14 @@ class Object {
|
|||||||
*
|
*
|
||||||
* @param array $array
|
* @param array $array
|
||||||
* An associative array of metadata names to values.
|
* An associative array of metadata names to values.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setMetadata(array $array) {
|
public function setMetadata(array $array) {
|
||||||
$this->metadata = $array;
|
$this->metadata = $array;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,6 +164,7 @@ class Object {
|
|||||||
* This returns an associative array of all metadata for this object.
|
* This returns an associative array of all metadata for this object.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of metadata. This may be empty.
|
* An associative array of metadata. This may be empty.
|
||||||
*/
|
*/
|
||||||
public function metadata() {
|
public function metadata() {
|
||||||
@@ -178,6 +184,10 @@ class Object {
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* A file or object name.
|
* A file or object name.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setName($name) {
|
public function setName($name) {
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
@@ -191,6 +201,7 @@ class Object {
|
|||||||
* using setName(), this will return the latest (overwritten) name.
|
* using setName(), this will return the latest (overwritten) name.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The name of the object.
|
* The name of the object.
|
||||||
*/
|
*/
|
||||||
public function name() {
|
public function name() {
|
||||||
@@ -223,6 +234,10 @@ class Object {
|
|||||||
*
|
*
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* A valid content type.
|
* A valid content type.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setContentType($type) {
|
public function setContentType($type) {
|
||||||
$this->contentType = $type;
|
$this->contentType = $type;
|
||||||
@@ -235,6 +250,7 @@ class Object {
|
|||||||
* This returns the currently set content type.
|
* This returns the currently set content type.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The content type, including any additional options.
|
* The content type, including any additional options.
|
||||||
*/
|
*/
|
||||||
public function contentType() {
|
public function contentType() {
|
||||||
@@ -261,6 +277,10 @@ class Object {
|
|||||||
* @param string $type
|
* @param string $type
|
||||||
* The content type (MIME type). This can be set here for
|
* The content type (MIME type). This can be set here for
|
||||||
* convenience, or you can call setContentType() directly.
|
* convenience, or you can call setContentType() directly.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setContent($content, $type = NULL) {
|
public function setContent($content, $type = NULL) {
|
||||||
$this->content = $content;
|
$this->content = $content;
|
||||||
@@ -289,6 +309,7 @@ class Object {
|
|||||||
* returns the entire contents of an object.
|
* returns the entire contents of an object.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The content of the file.
|
* The content of the file.
|
||||||
*/
|
*/
|
||||||
public function content() {
|
public function content() {
|
||||||
@@ -306,7 +327,8 @@ class Object {
|
|||||||
* When extending this class, you should make sure to calculate the
|
* When extending this class, you should make sure to calculate the
|
||||||
* content length appropriately.
|
* content length appropriately.
|
||||||
*
|
*
|
||||||
* return int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The length of the content, in bytes.
|
* The length of the content, in bytes.
|
||||||
*/
|
*/
|
||||||
public function contentLength() {
|
public function contentLength() {
|
||||||
@@ -324,6 +346,7 @@ class Object {
|
|||||||
* the entire object's content (but not the metadata or name).
|
* the entire object's content (but not the metadata or name).
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* An MD5 value as a string of 32 hex digits (0-9a-f).
|
* An MD5 value as a string of 32 hex digits (0-9a-f).
|
||||||
*/
|
*/
|
||||||
public function eTag() {
|
public function eTag() {
|
||||||
@@ -348,9 +371,15 @@ class Object {
|
|||||||
*
|
*
|
||||||
* @param string $encoding
|
* @param string $encoding
|
||||||
* A valid encoding type.
|
* A valid encoding type.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setEncoding($encoding) {
|
public function setEncoding($encoding) {
|
||||||
$this->contentEncoding = $encoding;
|
$this->contentEncoding = $encoding;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -360,6 +389,7 @@ class Object {
|
|||||||
* See setEncoding() for more information.
|
* See setEncoding() for more information.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The encoding type.
|
* The encoding type.
|
||||||
*/
|
*/
|
||||||
public function encoding() {
|
public function encoding() {
|
||||||
@@ -386,9 +416,15 @@ class Object {
|
|||||||
* @param string $disposition
|
* @param string $disposition
|
||||||
* A valid disposition declaration. These are defined in various
|
* A valid disposition declaration. These are defined in various
|
||||||
* HTTP specifications.
|
* HTTP specifications.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setDisposition($disposition) {
|
public function setDisposition($disposition) {
|
||||||
$this->contentDisposition = $disposition;
|
$this->contentDisposition = $disposition;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -397,6 +433,7 @@ class Object {
|
|||||||
* See setDisposition() for discussion.
|
* See setDisposition() for discussion.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The disposition string, or NULL if none is set.
|
* The disposition string, or NULL if none is set.
|
||||||
*/
|
*/
|
||||||
public function disposition() {
|
public function disposition() {
|
||||||
@@ -436,9 +473,14 @@ class Object {
|
|||||||
* An associative array where each name is an HTTP header name, and
|
* An associative array where each name is an HTTP header name, and
|
||||||
* each value is the HTTP header value. No encoding or escaping is
|
* each value is the HTTP header value. No encoding or escaping is
|
||||||
* done.
|
* done.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setAdditionalHeaders($headers) {
|
public function setAdditionalHeaders($headers) {
|
||||||
$this->additionalHeaders = $headers;
|
$this->additionalHeaders = $headers;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -466,11 +508,17 @@ class Object {
|
|||||||
*
|
*
|
||||||
* @param array $keys
|
* @param array $keys
|
||||||
* The header names to be removed.
|
* The header names to be removed.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::Object
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\Object
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
*/
|
*/
|
||||||
public function removeHeaders($keys) {
|
public function removeHeaders($keys) {
|
||||||
foreach ($keys as $k) {
|
foreach ($keys as $k) {
|
||||||
unset($this->additionalHeaders[$k]);
|
unset($this->additionalHeaders[$k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,6 +538,7 @@ class Object {
|
|||||||
* if this returns TRUE, contentLength() is ignored.
|
* if this returns TRUE, contentLength() is ignored.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE to recommend chunked transfer, FALSE otherwise.
|
* TRUE to recommend chunked transfer, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function isChunked() {
|
public function isChunked() {
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ class RemoteObject extends Object {
|
|||||||
* CDN URL when requested.
|
* CDN URL when requested.
|
||||||
* @param string $cdnSslUrl
|
* @param string $cdnSslUrl
|
||||||
* The URL to the SSL-protected CDN version of the object.
|
* The URL to the SSL-protected CDN version of the object.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* A new RemoteObject.
|
||||||
*/
|
*/
|
||||||
public static function newFromHeaders($name, $headers, $token, $url, $cdnUrl = NULL, $cdnSslUrl = NULL) {
|
public static function newFromHeaders($name, $headers, $token, $url, $cdnUrl = NULL, $cdnSslUrl = NULL) {
|
||||||
$object = new RemoteObject($name);
|
$object = new RemoteObject($name);
|
||||||
@@ -183,10 +187,16 @@ class RemoteObject extends Object {
|
|||||||
* The URL to this object in CDN.
|
* The URL to this object in CDN.
|
||||||
* @param string $sslUrl
|
* @param string $sslUrl
|
||||||
* The SSL URL to this object in CDN.
|
* The SSL URL to this object in CDN.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
*/
|
*/
|
||||||
public function useCDN($url, $sslUrl) {
|
public function useCDN($url, $sslUrl) {
|
||||||
$this->cdnUrl = $url;
|
$this->cdnUrl = $url;
|
||||||
$this->cdnSslUrl = $sslUrl;
|
$this->cdnSslUrl = $sslUrl;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,6 +220,7 @@ class RemoteObject extends Object {
|
|||||||
* (b) it mirrors non-CDN behavior. This can be turned off by setting
|
* (b) it mirrors non-CDN behavior. This can be turned off by setting
|
||||||
* $useSSL to FALSE.
|
* $useSSL to FALSE.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A URL to the object. The following considerations apply:
|
* A URL to the object. The following considerations apply:
|
||||||
* - If the container is public, this URL can be loaded without
|
* - If the container is public, this URL can be loaded without
|
||||||
* authentication. You can, for example, pass the URL to a browser
|
* authentication. You can, for example, pass the URL to a browser
|
||||||
@@ -260,6 +271,13 @@ class RemoteObject extends Object {
|
|||||||
return $this->metadata;
|
return $this->metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the headers
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
|
*/
|
||||||
public function setHeaders($headers) {
|
public function setHeaders($headers) {
|
||||||
$this->allHeaders = array();
|
$this->allHeaders = array();
|
||||||
|
|
||||||
@@ -268,6 +286,8 @@ class RemoteObject extends Object {
|
|||||||
$this->allHeaders[$name] = $value;
|
$this->allHeaders[$name] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,6 +299,7 @@ class RemoteObject extends Object {
|
|||||||
* were sent from the server.
|
* were sent from the server.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of header names and values.
|
* An associative array of header names and values.
|
||||||
*/
|
*/
|
||||||
public function headers() {
|
public function headers() {
|
||||||
@@ -307,6 +328,14 @@ class RemoteObject extends Object {
|
|||||||
'transfer-encoding' => TRUE,
|
'transfer-encoding' => TRUE,
|
||||||
'x-trans-id' => TRUE,
|
'x-trans-id' => TRUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the headers.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
|
*/
|
||||||
public function filterHeaders(&$headers) {
|
public function filterHeaders(&$headers) {
|
||||||
$unset = array();
|
$unset = array();
|
||||||
foreach ($headers as $name => $value) {
|
foreach ($headers as $name => $value) {
|
||||||
@@ -318,6 +347,8 @@ class RemoteObject extends Object {
|
|||||||
foreach ($unset as $u) {
|
foreach ($unset as $u) {
|
||||||
unset($headers[$u]);
|
unset($headers[$u]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -337,12 +368,18 @@ class RemoteObject extends Object {
|
|||||||
*
|
*
|
||||||
* @param array $keys
|
* @param array $keys
|
||||||
* The header names to be removed.
|
* The header names to be removed.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
*/
|
*/
|
||||||
public function removeHeaders($keys) {
|
public function removeHeaders($keys) {
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
unset($this->allHeaders[$key]);
|
unset($this->allHeaders[$key]);
|
||||||
unset($this->additionalHeaders[$key]);
|
unset($this->additionalHeaders[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -361,6 +398,7 @@ class RemoteObject extends Object {
|
|||||||
* Be wary of using this method with large files.
|
* Be wary of using this method with large files.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The contents of the file as a string.
|
* The contents of the file as a string.
|
||||||
* @throws \HPCloud\Transport\FileNotFoundException
|
* @throws \HPCloud\Transport\FileNotFoundException
|
||||||
* when the requested content cannot be located on the remote
|
* when the requested content cannot be located on the remote
|
||||||
@@ -427,6 +465,7 @@ class RemoteObject extends Object {
|
|||||||
* and the content will be refreshed from the server. Any
|
* and the content will be refreshed from the server. Any
|
||||||
* local changes to the object will be discarded.
|
* local changes to the object will be discarded.
|
||||||
* @retval resource
|
* @retval resource
|
||||||
|
* @return resource
|
||||||
* A handle to the stream, which is already opened and positioned at
|
* A handle to the stream, which is already opened and positioned at
|
||||||
* the beginning of the stream.
|
* the beginning of the stream.
|
||||||
*/
|
*/
|
||||||
@@ -478,9 +517,14 @@ class RemoteObject extends Object {
|
|||||||
* @param boolean $enabled
|
* @param boolean $enabled
|
||||||
* If this is TRUE, caching will be enabled. If this is FALSE,
|
* If this is TRUE, caching will be enabled. If this is FALSE,
|
||||||
* caching will be disabled.
|
* caching will be disabled.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setCaching($enabled) {
|
public function setCaching($enabled) {
|
||||||
$this->caching = $enabled;
|
$this->caching = $enabled;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,6 +534,7 @@ class RemoteObject extends Object {
|
|||||||
* its contents, not whether anything is actually cached.
|
* its contents, not whether anything is actually cached.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if caching is enabled, FALSE otherwise.
|
* TRUE if caching is enabled, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function isCaching() {
|
public function isCaching() {
|
||||||
@@ -518,9 +563,14 @@ class RemoteObject extends Object {
|
|||||||
* If this is TRUE, content verification is performed. The content
|
* If this is TRUE, content verification is performed. The content
|
||||||
* is hashed and checked against a server-supplied MD5 hashcode. If
|
* is hashed and checked against a server-supplied MD5 hashcode. If
|
||||||
* this is FALSE, no checking is done.
|
* this is FALSE, no checking is done.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
public function setContentVerification($enabled) {
|
public function setContentVerification($enabled) {
|
||||||
$this->contentVerification = $enabled;
|
$this->contentVerification = $enabled;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -532,6 +582,7 @@ class RemoteObject extends Object {
|
|||||||
* supplied ETag hash.
|
* supplied ETag hash.
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if this is verifying, FALSE otherwise.
|
* TRUE if this is verifying, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function isVerifyingContent() {
|
public function isVerifyingContent() {
|
||||||
@@ -588,6 +639,10 @@ class RemoteObject extends Object {
|
|||||||
*
|
*
|
||||||
* @param boolean $fetchContent
|
* @param boolean $fetchContent
|
||||||
* If this is TRUE, the content will be downloaded as well.
|
* If this is TRUE, the content will be downloaded as well.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
*/
|
*/
|
||||||
public function refresh($fetchContent = FALSE) {
|
public function refresh($fetchContent = FALSE) {
|
||||||
|
|
||||||
@@ -600,6 +655,8 @@ class RemoteObject extends Object {
|
|||||||
if ($fetchContent) {
|
if ($fetchContent) {
|
||||||
$this->setContent($response->content());
|
$this->setContent($response->content());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -610,7 +667,8 @@ class RemoteObject extends Object {
|
|||||||
* cause the remote host to return the object in the response body.
|
* cause the remote host to return the object in the response body.
|
||||||
* The response body is not handled, though. If this is set to
|
* The response body is not handled, though. If this is set to
|
||||||
* FALSE, a HEAD request is sent, and no body is returned.
|
* FALSE, a HEAD request is sent, and no body is returned.
|
||||||
* @retval \HPCloud\Transport\Response
|
* @retval HPCloud::Transport::Response
|
||||||
|
* @return \HPCloud\Transport\Response
|
||||||
* containing the object metadata and (depending on the
|
* containing the object metadata and (depending on the
|
||||||
* $fetchContent flag) optionally the data.
|
* $fetchContent flag) optionally the data.
|
||||||
*/
|
*/
|
||||||
@@ -642,6 +700,10 @@ class RemoteObject extends Object {
|
|||||||
* Extract information from HTTP headers.
|
* Extract information from HTTP headers.
|
||||||
*
|
*
|
||||||
* This is used internally to set object properties from headers.
|
* This is used internally to set object properties from headers.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::RemoteObject
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\RemoteObject
|
||||||
|
* $this for the current object so it can be used in chaining methods.
|
||||||
*/
|
*/
|
||||||
protected function extractFromHeaders($response) {
|
protected function extractFromHeaders($response) {
|
||||||
$this->setContentType($response->header('Content-Type', $this->contentType()));
|
$this->setContentType($response->header('Content-Type', $this->contentType()));
|
||||||
@@ -655,5 +717,7 @@ class RemoteObject extends Object {
|
|||||||
// Reset the metadata, too:
|
// Reset the metadata, too:
|
||||||
$this->setMetadata(Container::extractHeaderAttributes($response->headers()));
|
$this->setMetadata(Container::extractHeaderAttributes($response->headers()));
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ class StreamWrapper {
|
|||||||
* @param int $options
|
* @param int $options
|
||||||
* Unused.
|
* Unused.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the directory is opened, FALSE otherwise.
|
* TRUE if the directory is opened, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function dir_opendir($path, $options) {
|
public function dir_opendir($path, $options) {
|
||||||
@@ -462,6 +463,7 @@ class StreamWrapper {
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The name of the resource or FALSE when the directory has no more
|
* The name of the resource or FALSE when the directory has no more
|
||||||
* entries.
|
* entries.
|
||||||
*/
|
*/
|
||||||
@@ -562,6 +564,7 @@ class StreamWrapper {
|
|||||||
* @param string $path_to
|
* @param string $path_to
|
||||||
* A swift URL to another path.
|
* A swift URL to another path.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE on success, FALSE otherwise.
|
* TRUE on success, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function rename($path_from, $path_to) {
|
public function rename($path_from, $path_to) {
|
||||||
@@ -609,6 +612,7 @@ class StreamWrapper {
|
|||||||
* side effects.
|
* side effects.
|
||||||
*
|
*
|
||||||
* @retval resource
|
* @retval resource
|
||||||
|
* @return resource
|
||||||
* this returns the underlying stream.
|
* this returns the underlying stream.
|
||||||
*/
|
*/
|
||||||
public function stream_cast($cast_as) {
|
public function stream_cast($cast_as) {
|
||||||
@@ -662,6 +666,7 @@ class StreamWrapper {
|
|||||||
* See stream_seek().
|
* See stream_seek().
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if it has reached the end, FALSE otherwise.
|
* TRUE if it has reached the end, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function stream_eof() {
|
public function stream_eof() {
|
||||||
@@ -969,6 +974,7 @@ class StreamWrapper {
|
|||||||
* @param int $count
|
* @param int $count
|
||||||
* The number of bytes to read (usually 8192).
|
* The number of bytes to read (usually 8192).
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The data read.
|
* The data read.
|
||||||
*/
|
*/
|
||||||
public function stream_read($count) {
|
public function stream_read($count) {
|
||||||
@@ -1034,6 +1040,7 @@ class StreamWrapper {
|
|||||||
* etc.) through HPCloud::Bootstrap::setConfiguration().
|
* etc.) through HPCloud::Bootstrap::setConfiguration().
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* The stats array.
|
* The stats array.
|
||||||
*/
|
*/
|
||||||
public function stream_stat() {
|
public function stream_stat() {
|
||||||
@@ -1052,6 +1059,7 @@ class StreamWrapper {
|
|||||||
* See ftell() and fseek().
|
* See ftell() and fseek().
|
||||||
*
|
*
|
||||||
* @retval int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The current position in the stream.
|
* The current position in the stream.
|
||||||
*/
|
*/
|
||||||
public function stream_tell() {
|
public function stream_tell() {
|
||||||
@@ -1068,6 +1076,7 @@ class StreamWrapper {
|
|||||||
* @param string $data
|
* @param string $data
|
||||||
* Data to write to the stream.
|
* Data to write to the stream.
|
||||||
* @retval int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The number of bytes written. 0 indicates and error.
|
* The number of bytes written. 0 indicates and error.
|
||||||
*/
|
*/
|
||||||
public function stream_write($data) {
|
public function stream_write($data) {
|
||||||
@@ -1094,6 +1103,7 @@ class StreamWrapper {
|
|||||||
* @param string $path
|
* @param string $path
|
||||||
* The URL.
|
* The URL.
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the file was deleted, FALSE otherwise.
|
* TRUE if the file was deleted, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
public function unlink($path) {
|
public function unlink($path) {
|
||||||
@@ -1320,6 +1330,10 @@ class StreamWrapper {
|
|||||||
*
|
*
|
||||||
* @param string $mode
|
* @param string $mode
|
||||||
* The mode string, e.g. `r+` or `wb`.
|
* The mode string, e.g. `r+` or `wb`.
|
||||||
|
*
|
||||||
|
* @retval HPCloud::Storage::ObjectStorage::StreamWrapper
|
||||||
|
* @return \HPCloud\Storage\ObjectStorage\StreamWrapper
|
||||||
|
* $this so the method can be used in chaining.
|
||||||
*/
|
*/
|
||||||
protected function setMode($mode) {
|
protected function setMode($mode) {
|
||||||
$mode = strtolower($mode);
|
$mode = strtolower($mode);
|
||||||
@@ -1391,6 +1405,7 @@ class StreamWrapper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1404,6 +1419,7 @@ class StreamWrapper {
|
|||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* The default value to return if no config param was found.
|
* The default value to return if no config param was found.
|
||||||
* @retval mixed
|
* @retval mixed
|
||||||
|
* @return mixed
|
||||||
* The discovered result, or $default if specified, or NULL if
|
* The discovered result, or $default if specified, or NULL if
|
||||||
* no $default is specified.
|
* no $default is specified.
|
||||||
*/
|
*/
|
||||||
@@ -1450,6 +1466,7 @@ class StreamWrapper {
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* A Swift URL.
|
* A Swift URL.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array as documented in parse_url().
|
* An array as documented in parse_url().
|
||||||
*/
|
*/
|
||||||
protected function parseUrl($url) {
|
protected function parseUrl($url) {
|
||||||
|
|||||||
@@ -148,7 +148,8 @@ class StreamWrapperFS extends StreamWrapper {
|
|||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* The directory path to test.
|
* The directory path to test.
|
||||||
* @retval bool
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* TRUE if the directory prefix exists and FALSE otherwise.
|
* TRUE if the directory prefix exists and FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
protected function testDirectoryExists($path) {
|
protected function testDirectoryExists($path) {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class Subdir {
|
|||||||
* The path is delimited using the string returned by delimiter().
|
* The path is delimited using the string returned by delimiter().
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The path.
|
* The path.
|
||||||
*/
|
*/
|
||||||
public function path() {
|
public function path() {
|
||||||
@@ -70,6 +71,7 @@ class Subdir {
|
|||||||
* Get the delimiter used by the server.
|
* Get the delimiter used by the server.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The value used as a delimiter.
|
* The value used as a delimiter.
|
||||||
*/
|
*/
|
||||||
public function delimiter() {
|
public function delimiter() {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class Transport {
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @retval HPCloud::Transport::Transporter
|
* @retval HPCloud::Transport::Transporter
|
||||||
|
* @return \HPCloud\Transport\Transporter
|
||||||
* An initialized transporter.
|
* An initialized transporter.
|
||||||
*/
|
*/
|
||||||
public static function instance() {
|
public static function instance() {
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ class CURLTransport implements Transporter {
|
|||||||
* @param resource $handle
|
* @param resource $handle
|
||||||
* A CURL handle from curl_init().
|
* A CURL handle from curl_init().
|
||||||
* @retval boolean
|
* @retval boolean
|
||||||
|
* @return boolean
|
||||||
* Returns a boolean value indicating whether or not CURL could process the
|
* Returns a boolean value indicating whether or not CURL could process the
|
||||||
* request.
|
* request.
|
||||||
*/
|
*/
|
||||||
@@ -322,6 +323,7 @@ class CURLTransport implements Transporter {
|
|||||||
* @param resource $file
|
* @param resource $file
|
||||||
* A file pointer to the file that has the headers.
|
* A file pointer to the file that has the headers.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An array of headers, one header per line.
|
* An array of headers, one header per line.
|
||||||
*/
|
*/
|
||||||
protected function fetchHeaders($file) {
|
protected function fetchHeaders($file) {
|
||||||
@@ -389,5 +391,7 @@ class CURLTransport implements Transporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $buffer);
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $buffer);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ class PHPStreamTransport implements Transporter {
|
|||||||
* @param array $headers
|
* @param array $headers
|
||||||
* An associative array of header names to header values.
|
* An associative array of header names to header values.
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A string containing formatted headers.
|
* A string containing formatted headers.
|
||||||
*/
|
*/
|
||||||
protected function smashHeaders($headers) {
|
protected function smashHeaders($headers) {
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ class Response {
|
|||||||
* (they are one and the same).
|
* (they are one and the same).
|
||||||
*
|
*
|
||||||
* @retval resource
|
* @retval resource
|
||||||
|
* @return resource
|
||||||
* A file handle.
|
* A file handle.
|
||||||
*/
|
*/
|
||||||
public function file() {
|
public function file() {
|
||||||
@@ -162,6 +163,7 @@ class Response {
|
|||||||
* entire content in a string.
|
* entire content in a string.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The contents of the response body.
|
* The contents of the response body.
|
||||||
*/
|
*/
|
||||||
public function content() {
|
public function content() {
|
||||||
@@ -203,6 +205,7 @@ class Response {
|
|||||||
* data.
|
* data.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of metadata about the
|
* An associative array of metadata about the
|
||||||
* transaction resulting in this response.
|
* transaction resulting in this response.
|
||||||
*/
|
*/
|
||||||
@@ -219,6 +222,7 @@ class Response {
|
|||||||
* An optional default value.
|
* An optional default value.
|
||||||
*
|
*
|
||||||
* @retval mixed
|
* @retval mixed
|
||||||
|
* @return mixed
|
||||||
* The value, if found, or the default, is specified, or NULL.
|
* The value, if found, or the default, is specified, or NULL.
|
||||||
*/
|
*/
|
||||||
public function header($name, $default = NULL) {
|
public function header($name, $default = NULL) {
|
||||||
@@ -237,8 +241,9 @@ class Response {
|
|||||||
*
|
*
|
||||||
* These are available even if the stream has been closed.
|
* These are available even if the stream has been closed.
|
||||||
*
|
*
|
||||||
* @retval
|
* @retval array
|
||||||
* array The array of headers.
|
* @return array
|
||||||
|
* The array of headers.
|
||||||
*/
|
*/
|
||||||
public function headers() {
|
public function headers() {
|
||||||
return $this->headers;
|
return $this->headers;
|
||||||
@@ -266,6 +271,7 @@ class Response {
|
|||||||
* appear in a Response object.
|
* appear in a Response object.
|
||||||
*
|
*
|
||||||
* @retval int
|
* @retval int
|
||||||
|
* @return int
|
||||||
* The HTTP code, e.g. 200 or 202.
|
* The HTTP code, e.g. 200 or 202.
|
||||||
*/
|
*/
|
||||||
public function status() {
|
public function status() {
|
||||||
@@ -279,6 +285,7 @@ class Response {
|
|||||||
* recommendations. e.g. 200 returns 'OK'.
|
* recommendations. e.g. 200 returns 'OK'.
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* A server-generated status message.
|
* A server-generated status message.
|
||||||
*/
|
*/
|
||||||
public function statusMessage() {
|
public function statusMessage() {
|
||||||
@@ -291,6 +298,7 @@ class Response {
|
|||||||
* Example: HTTP/1.1
|
* Example: HTTP/1.1
|
||||||
*
|
*
|
||||||
* @retval string
|
* @retval string
|
||||||
|
* @return string
|
||||||
* The protocol name and version.
|
* The protocol name and version.
|
||||||
*/
|
*/
|
||||||
public function protocol() {
|
public function protocol() {
|
||||||
@@ -308,6 +316,7 @@ class Response {
|
|||||||
* An indexed array of headers, as returned by the PHP stream
|
* An indexed array of headers, as returned by the PHP stream
|
||||||
* library.
|
* library.
|
||||||
* @retval array
|
* @retval array
|
||||||
|
* @return array
|
||||||
* An associative array of header name/value pairs.
|
* An associative array of header name/value pairs.
|
||||||
*/
|
*/
|
||||||
protected function parseHeaders($headerArray) {
|
protected function parseHeaders($headerArray) {
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ class DBaaSInstanceTest extends DBaaSTestCase {
|
|||||||
$ident = $this->identity();
|
$ident = $this->identity();
|
||||||
$dbaas = DBaaS::newFromIdentity($ident);
|
$dbaas = DBaaS::newFromIdentity($ident);
|
||||||
|
|
||||||
$endpoint = self::conf('hpcloud.dbaas.endpoint') . '/' . $ident->tenantId();
|
// $endpoint = self::conf('hpcloud.dbaas.endpoint') . '/' . $ident->tenantId();
|
||||||
|
|
||||||
// Test #1: Build from scratch.
|
// // Test #1: Build from scratch.
|
||||||
$inst = new Instance($ident->token(), $ident->tenantName(), $endpoint);
|
// $inst = new Instance($ident->token(), $ident->tenantName(), $endpoint);
|
||||||
$this->assertInstanceOf('\HPCloud\Services\DBaaS\Instance', $inst);
|
// $this->assertInstanceOf('\HPCloud\Services\DBaaS\Instance', $inst);
|
||||||
|
|
||||||
// Test #2: Build from DBaaS.
|
// Test #2: Build from DBaaS.
|
||||||
$inst = $dbaas->instance();
|
$inst = $dbaas->instance();
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ hpcloud.identity.password =
|
|||||||
hpcloud.identity.account =
|
hpcloud.identity.account =
|
||||||
hpcloud.identity.secret =
|
hpcloud.identity.secret =
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
; Database as a Service ;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
hpcloud.dbaas.database = "ponycorns"
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Configuration Parameters ;
|
; Configuration Parameters ;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
Reference in New Issue
Block a user