Commit 9576a77e by Robbie Hott

Initial Commit

parents
composer.lock
composer.phar
vendor/
.idea/
src/ark/Config.php
Copyright (c) 2015, the Rector and Visitors of the University of Virginia, and
the Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ARK Manager
Manager for temporary and permanent ARKs. The ArkManager facilitates creation of unique testing arks and the requesting and assigning of real, permanent arks.
## Install Procedures
You can use Composer to automatically install this package. However, it does have some configuration dependencies. Copy `Config_dist.php` to `Config.php` and fill in the required configuration paramaters for your environment. Likewise, if you need to set up your own environment, run the `install.php` script found in the `install` directory.
{
"require": {
"php": "~7.0",
},
"require-dev": {
"phpdocumentor/phpdocumentor": "*",
"phpunit/phpunit": ">=5.0",
"phpunit/php-invoker": "*",
"phpunit/dbunit": ">=1.2",
"phpunit/phpunit-selenium": ">=1.2",
"phpunit/phpunit-story": "*"
},
"autoload": {
"psr-4": {
"ark\\": "src/ark/"
}
}
}
<?php
/**
* ARK Manager File
*
* Contains the ARK Manager code
*
* @author Robbie Hott
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause
* @copyright 2015 the Rector and Visitors of the University of Virginia, and
* the Regents of the University of California
*/
namespace ark;
/**
* ARK Manager
*
* This class manages ARK ids, including the assigning of real arks as well as the minting of temporary
* arks for testing purposes.
*
* @author Robbie Hott
*/
class ArkManager {
/**
* @var \ark\database\DatabaseConnector The helper class object for database connections
*/
private $db = null;
/**
* Constructor
*
* Sets up the ArkManager
*/
public function __construct() {
}
/**
* Mint Temporary Ark
*
* Mint arks used for testing purposes. These are not "valid" arks but are randomly generated based on
* a seed of the current timestamp. They should not be used for production purposes and are not guaranteed
* to resolve.
*
* @param integer $num optional The number of arks to generate. If more than one, this method will return an array
* @return string|string[] A temporary ark or a list of temporary arks
*/
public function mintTemporaryArk($num=1) {
}
/**
* Mint Real Ark
*
* Mint a real, unique, permanent, resolvable ark. Once an ark is minted using this method, it will never be reassigned. This
* process is irreversible, so use with caution. Because of this, only one may be requested at a time.
*
* @return string A new permanent arkID
*/
public function mintArk() {
}
}
<?php
/**
* Configuration File
*
* Contains the configuration options for this Ark Manager
*
* License:
*
*
* @author Robbie Hott
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause
* @copyright 2015 the Rector and Visitors of the University of Virginia, and
* the Regents of the University of California
*/
namespace ark;
/**
* Configuration class
*
* This class contains all the configuration variables for the entire system. It makes use of only
* public static fields that may be read by any other class in the system. We use this to better scope
* the configuration settings and avoid global variables and constants.
*
* @author Robbie Hott
*
*/
class Config {
/**
* Full database connection information
*
* Connection information for the POSTGRES database
*
* @var array database connection information
*/
public static $DATABASE = array (
"database" => "db_name",
"host" => "hostname.com",
"port" => 5432,
"user" => "user_id",
"password" => "full_password"
);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment