Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
f2bba9c6
Commit
f2bba9c6
authored
Feb 23, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- improved phpdoc
parent
1d15094e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
11 deletions
+44
-11
library/Solarium/Client.php
library/Solarium/Client.php
+6
-3
library/Solarium/Configurable.php
library/Solarium/Configurable.php
+23
-4
library/Solarium/Exception.php
library/Solarium/Exception.php
+6
-1
library/Solarium/Version.php
library/Solarium/Version.php
+9
-3
No files found.
library/Solarium/Client.php
View file @
f2bba9c6
...
@@ -74,9 +74,12 @@ class Solarium_Client extends Solarium_Configurable
...
@@ -74,9 +74,12 @@ class Solarium_Client extends Solarium_Configurable
/**
/**
* Adapter instance
* Adapter instance
*
*
* The adapter is lazy-loading, it will be instantiated on first use by
* If an adapter instance is set using {@link setAdapter()} this var will
* {@link getAdapter()} based on the 'adapter' entry in {@link $_options}.
* contain a reference to that instance.
* This option can be set using {@link setAdapter()}
*
* In all other cases the adapter is lazy-loading, it will be instantiated
* on first use by {@link getAdapter()} based on the 'adapter' entry in
* {@link $_options}. This option can be set using {@link setAdapter()}
*
*
* @var Solarium_Client_Adapter
* @var Solarium_Client_Adapter
*/
*/
...
...
library/Solarium/Configurable.php
View file @
f2bba9c6
...
@@ -35,8 +35,13 @@
...
@@ -35,8 +35,13 @@
*/
*/
/**
/**
* Base class for creating a class that is configurable using the constructor or
* Base class for configurable classes
* setOption calls. Used by many solarium classes.
*
* All classes extending this class are configurable using the constructor or
* setOption calls. This is the base for many Solarium classes, providing a
* uniform interface for various models.
*
* @package Solarium
*/
*/
class
Solarium_Configurable
class
Solarium_Configurable
{
{
...
@@ -52,6 +57,15 @@ class Solarium_Configurable
...
@@ -52,6 +57,15 @@ class Solarium_Configurable
/**
/**
* Constructor
* Constructor
*
*
* If options are passed they will be merged with {@link $_options}, with
* new values overwriting any existing (default) values.
*
* If $options is an object it will be converted into an array by called
* it's toArray method. This is compatible with the Zend_Config classes in
* Zend Framework, but can also easily be implemented in any other object.
*
* After handling the options the {@link _init()} method is called.
*
* @throws Solarium_Exception
* @throws Solarium_Exception
* @param array|Zend_Config $options
* @param array|Zend_Config $options
* @return void
* @return void
...
@@ -69,11 +83,10 @@ class Solarium_Configurable
...
@@ -69,11 +83,10 @@ class Solarium_Configurable
}
}
}
}
// merge with default values, new values overwrite defaults
$this
->
_options
=
array_merge
(
$this
->
_options
,
$options
);
$this
->
_options
=
array_merge
(
$this
->
_options
,
$options
);
}
}
// Hook for extending classes (for end user classes)
$this
->
_init
();
$this
->
_init
();
}
}
...
@@ -87,6 +100,10 @@ class Solarium_Configurable
...
@@ -87,6 +100,10 @@ class Solarium_Configurable
* This hook is called by the constructor after saving the constructor
* This hook is called by the constructor after saving the constructor
* arguments in {@link $_options}
* arguments in {@link $_options}
*
*
* @internal This empty implementation can optionally be implemented in
* descending classes. It's not an abstract method on purpose, there are
* many cases where no initialization is needed.
*
* @return void
* @return void
*/
*/
protected
function
_init
()
protected
function
_init
()
...
@@ -111,6 +128,8 @@ class Solarium_Configurable
...
@@ -111,6 +128,8 @@ class Solarium_Configurable
/**
/**
* Get an option value
* Get an option value
*
*
* If the options is empty or not set a NULL value will be returned.
*
* @param string $name
* @param string $name
* @return mixed
* @return mixed
*/
*/
...
...
library/Solarium/Exception.php
View file @
f2bba9c6
...
@@ -35,7 +35,12 @@
...
@@ -35,7 +35,12 @@
*/
*/
/**
/**
* Custom exception case to allow for catching specific exceptions
* Solarium specific exception
*
* All exceptions thrown by Solarium are of this type. This way you can easily
* catch Solarium exception and keep them separate from you own exceptions.
*
* @package Solarium
*/
*/
class
Solarium_Exception
extends
Exception
class
Solarium_Exception
extends
Exception
{
{
...
...
library/Solarium/Version.php
View file @
f2bba9c6
...
@@ -35,14 +35,20 @@
...
@@ -35,14 +35,20 @@
*/
*/
/**
/**
* This class can be used to check the library version within your code.
* Version indicator
* For example to check for a required version.
*
* This class can be used to check the library version within your code. This
* can be important if you rely on a minimal version for the features you use.
*
* @package Solarium
*/
*/
class
Solarium_Version
class
Solarium_Version
{
{
/**
/**
* Version number
* Version number of the Solarium library
*
* @var string
*/
*/
const
VERSION
=
'0.1-dev'
;
const
VERSION
=
'0.1-dev'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment