forked from delassiter/bav
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
116 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
} catch (DataBackendException $error) { | ||
die("Installation failed: {$error->getMessage()}\n"); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ | |
} catch (DataBackendException $error) { | ||
die("Deinstallation failed: {$error->getMessage()}\n"); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ | |
} catch (DataBackendException $error) { | ||
die("Installation failed: {$error->getMessage()}\n"); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ | |
|
||
/** | ||
* Facade for BAV's API. | ||
* | ||
* | ||
* This class provides methods for validation of German bank accounts. | ||
* | ||
* | ||
* If you don't inject a {@link Configuration} the facade will use the | ||
* {@link ConfigurationRegistry}. The registry provides per default the | ||
* {@link DefaultConfiguration}. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -37,10 +37,10 @@ class BAV | |
|
||
/** | ||
* Inject the configuration. | ||
* | ||
* | ||
* If the $configuration is null the configuration from | ||
* {@link ConfigurationRegistry::getConfiguration()} will be used. | ||
* | ||
* | ||
* @see ConfigurationRegistry | ||
*/ | ||
public function __construct(Configuration $configuration = null) | ||
|
@@ -69,9 +69,9 @@ public function getDataBackend() | |
/** | ||
* Updates bav with a new bundesbank file. | ||
* | ||
* You might consider enabling automatic update with setting | ||
* You might consider enabling automatic update with setting | ||
* AutomaticUpdatePlan as configuration. | ||
* | ||
* | ||
* @see AutomaticUpdatePlan | ||
* @see Configuration::setUpdatePlan() | ||
* @throws DataBackendException | ||
|
@@ -106,7 +106,7 @@ public function isValidBankAccount($bankID, $account) | |
|
||
/** | ||
* Returns true if the account is valid for the current context. | ||
* | ||
* | ||
* You have to have called isValidBank() before! If the current context | ||
* is no valid bank every account will validate to true. | ||
* | ||
|
@@ -136,7 +136,7 @@ public function isValidBank($bankID) | |
|
||
/** | ||
* Every bank has one main agency. | ||
* | ||
* | ||
* This agency is not included in getAgencies(). | ||
* | ||
* @throws DataBackendException | ||
|
@@ -153,7 +153,7 @@ public function getMainAgency($bankID) | |
|
||
/** | ||
* A bank may have more agencies. | ||
* | ||
* | ||
* The main agency is not included in this list. | ||
* | ||
* @param string $bankID Bank id (Bankleitzahl) | ||
|
@@ -207,9 +207,9 @@ public function isValidBIC($bic) | |
/** | ||
* Returns the third call back parameter for filter_var() for validating | ||
* a bank. | ||
* | ||
* | ||
* filter_var($bankID, FILTER_CALLBACK, $bav->getValidBankFilterCallback()); | ||
* | ||
* | ||
* @return array | ||
* @see isValidBank() | ||
* @see filter_var() | ||
|
@@ -222,9 +222,9 @@ public function getValidBankFilterCallback() | |
/** | ||
* Returns the third call back parameter for filter_var() for validating | ||
* a bank account. | ||
* | ||
* | ||
* filter_var($account, FILTER_CALLBACK, $bav->getValidBankFilterCallback()); | ||
* | ||
* | ||
* @return array | ||
* @see isValidAccount() | ||
* @see filter_var() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Configuration | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -41,7 +41,7 @@ class Configuration | |
|
||
/** | ||
* Sets the update plan. | ||
* | ||
* | ||
* Set to null if you don't want to use an update plan. | ||
*/ | ||
public function setUpdatePlan(UpdatePlan $updatePlan = null) | ||
|
@@ -61,10 +61,10 @@ public function getUpdatePlan() | |
|
||
/** | ||
* Turns automatic installation on or off. | ||
* | ||
* | ||
* If automatic installation is activated {@link DataBackendContainer} will | ||
* check if it is installed and if not install the backend. | ||
* | ||
* | ||
* @see DataBackend::install() | ||
* @param bool $automaticInstallation Set true to turn installation on | ||
*/ | ||
|
@@ -121,12 +121,12 @@ public function getEncoding() | |
|
||
/** | ||
* Sets the temporary directory. | ||
* | ||
* | ||
* If you set a temporary directory BAV will use this for temporary files. | ||
* This option is optional. If it is not set the system's path will be used. | ||
* | ||
* | ||
* The temporary directory is used for the installation and update process. | ||
* | ||
* | ||
* @param string $tempDirectory | ||
*/ | ||
public function setTempDirectory($tempDirectory) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Configuration exception | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Helper for locating a BAV configuration. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -20,9 +20,9 @@ class ConfigurationLocator | |
|
||
/** | ||
* Sets the paths where a location is expected. | ||
* | ||
* | ||
* Those paths may be relative to the include_path. | ||
* | ||
* | ||
* @param string[] $paths | ||
*/ | ||
public function __construct($paths = array()) | ||
|
@@ -32,7 +32,7 @@ public function __construct($paths = array()) | |
|
||
/** | ||
* Locates a configuration. | ||
* | ||
* | ||
* @return Configuration|null | ||
* @throws ConfigurationException | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,28 +4,28 @@ | |
|
||
/** | ||
* Registry for the configuration | ||
* | ||
* BAV uses this static container for its runtime configuration. Per default the | ||
* | ||
* BAV uses this static container for its runtime configuration. Per default the | ||
* registry is initialized with the {@link DefaultConfiguration}. You can | ||
* set your own configuration with {@link setConfiguration()} or preferably | ||
* by providing the file bav/configuration.php. This file should return a | ||
* {@link Configuration} object: | ||
* | ||
* | ||
* <code> | ||
* <?php | ||
* | ||
* | ||
* namespace malkusch\bav; | ||
* | ||
* | ||
* $configuration = new DefaultConfiguration(); | ||
* | ||
* | ||
* $pdo = new \PDO("mysql:host=localhost;dbname=test"); | ||
* $configuration->setDataBackendContainer(new PDODataBackendContainer($pdo)); | ||
* | ||
* | ||
* $configuration->setUpdatePlan(new AutomaticUpdatePlan()); | ||
* | ||
* return $configuration; | ||
* </code> | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -46,10 +46,10 @@ class ConfigurationRegistry | |
|
||
/** | ||
* locate a configuration or register the default configuration. | ||
* | ||
* | ||
* You may define the file bav/configuration.php. This file should return | ||
* a Configuration object. | ||
* | ||
* | ||
* @see DefaultConfiguration | ||
* @throws ConfigurationException | ||
*/ | ||
|
@@ -69,7 +69,7 @@ public static function classConstructor() | |
|
||
/** | ||
* Register a configuration programmatically. | ||
* | ||
* | ||
* Alternatively you can provide the file bav/configuration.php which | ||
* returns a {@link Configuration} object. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
/** | ||
* Default configuration uses {@link FileDataBackendContainer} | ||
* and any available UTF-8 encoder. | ||
* | ||
* | ||
* Automatic installation is enabled. | ||
* | ||
* | ||
* The update plan is set to {@link LogUpdatePlan} | ||
* | ||
* | ||
* If no UTF-8 encoding is supported ISO-8859-15 will be used. | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Container for DataBackend objects. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -37,7 +37,7 @@ abstract protected function makeDataBackend(); | |
* | ||
* If configured this method would automatically install the backend. I.e. a first | ||
* call will take some amount of time. | ||
* | ||
* | ||
* @return DataBackend | ||
* @throws DataBackendException | ||
*/ | ||
|
@@ -77,7 +77,7 @@ public function applyUpdatePlan(DataBackend $backend) | |
/** | ||
* Returns a configured data backend. | ||
* | ||
* If configured this method would automatically install and update the backend. I.e. | ||
* If configured this method would automatically install and update the backend. I.e. | ||
* some calls might take longer. | ||
* | ||
* @see Configuration::setAutomaticInstallation() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Missing context during context validation | ||
* | ||
* | ||
* @see ContextValidation | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Container for FileDataBackend objects. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -21,7 +21,7 @@ class FileDataBackendContainer extends DataBackendContainer | |
|
||
/** | ||
* Sets the path for the backend. | ||
* | ||
* | ||
* @param string $file Path to the bundesbank file | ||
*/ | ||
public function __construct($file = null) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Downloads an URI | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -58,7 +58,7 @@ private function download($uri) | |
|
||
/** | ||
* Downloads the content of an URI | ||
* | ||
* | ||
* @param string $uri URI | ||
* @return string Content of the page | ||
* @throws DownloaderException | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Finds the download URI in the Bundesbank HTML page with XPath. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -24,7 +24,7 @@ public function isAvailable() | |
|
||
/** | ||
* Returns the download URI from the Bundesbank html page. | ||
* | ||
* | ||
* @throws URIPickerException | ||
* @return string | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
/** | ||
* Finds the download URI in the Bundesbank HTML page with any URI picker. | ||
* | ||
* | ||
* @author Markus Malkusch <[email protected]> | ||
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations | ||
* @license WTFPL | ||
|
@@ -47,7 +47,7 @@ public function isAvailable() | |
|
||
/** | ||
* Returns the download URI from the Bundesbank html page. | ||
* | ||
* | ||
* @throws URIPickerException | ||
* @return string | ||
*/ | ||
|
Oops, something went wrong.