Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Prepare the release of 1.1.0
  • Loading branch information
nohponex committed Dec 31, 2015
2 parents e6aa8fd + 58d42ad commit 5054890
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 106 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ script:
- composer test
after_script:
- php vendor/bin/coveralls -v
- php vendor/bin/codacycoverage clover build/logs/clover.xml
32 changes: 0 additions & 32 deletions Gruntfile.js

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version 1.x, _code name "Thales"_

A PHP framework for RESTful services and APIs

[![Build Status](https://travis-ci.org/phramework/phramework.svg?branch=master)](https://travis-ci.org/phramework/phramework)
[![Build Status](https://travis-ci.org/phramework/phramework.svg?branch=master)](https://travis-ci.org/phramework/phramework) [![Codacy Badge](https://api.codacy.com/project/badge/grade/3070b4d345594aadb447ea9a2c6a16e5)](https://www.codacy.com/app/NohponeX/phramework)

## Install

Expand All @@ -16,7 +16,6 @@ composer require phramework/phramework

```bash
composer update
npm update
```

### Test and lint code
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"squizlabs/php_codesniffer": "*",
"apigen/apigen": "^4.1",
"ext-pdo_sqlite": "*",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "dev-master",
"codacy/coverage": "^1.0"
},
"support": {
"email": "phramework@nohponex.gr"
Expand Down
30 changes: 19 additions & 11 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@

/**
* Database model
* Defined settings:
* - db[]
* - adapter, Adapter's name (lowercase)
* - name, Database name
* - username
* - password
* - host
* - port
* <br/>Defined settings:<br/>
* <ul>
* <li>
* array database <ul>
* <li>string adapter</li>
* <li>string name, Database name</li>
* <li>string username</li>
* <li>string password</li>
* <li>string host</li>
* <li>integer port</li>
* </ul>
* </li>
* <ul>
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
* @author Xenofon Spafaridis <nohponex@gmail.com>
* @since 0
Expand All @@ -37,11 +42,14 @@
class Database
{
/**
* @var IAdapter
* @var \Phramework\Database\IAdapter
*/
protected static $adapter = null;

public static function setAdapter($adapter)
/**
* @param PhrameworkDatabaseIAdapter $adapter
*/
public static function setAdapter(\Phramework\Database\IAdapter $adapter)
{
if (!($adapter instanceof \Phramework\Database\IAdapter)) {
throw new \Exception(
Expand All @@ -54,7 +62,7 @@ public static function setAdapter($adapter)

/**
* Get current adapter
* @return IAdapter|null
* @return \Phramework\Database\IAdapter|null
*/
public static function getAdapter()
{
Expand Down
21 changes: 13 additions & 8 deletions src/Database/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
use \Phramework\Exceptions\DatabaseException;

/**
* Defined settings:
* - db[]
* - adapter, Adapter's name (lowercase)
* - name, Database name
* - username
* - password
* - host
* - port
* <br/>Defined settings:<br/>
* <ul>
* <li>
* array database <ul>
* <li>string adapter</li>
* <li>string name, Database name</li>
* <li>string username</li>
* <li>string password</li>
* <li>string host</li>
* <li>integer port</li>
* </ul>
* </li>
* <ul>
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
* @author Xenofon Spafaridis <nohponex@gmail.com>
* @uses \PDO
Expand Down
21 changes: 13 additions & 8 deletions src/Database/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
use \Phramework\Exceptions\DatabaseException;

/**
* Defined settings:
* - db[]
* - adapter, Adapter's name (lowercase)
* - name, Database name
* - username
* - password
* - host
* - port
* <br/>Defined settings:<br/>
* <ul>
* <li>
* array database <ul>
* <li>string adapter</li>
* <li>string name, Database name</li>
* <li>string username</li>
* <li>string password</li>
* <li>string host</li>
* <li>integer port</li>
* </ul>
* </li>
* <ul>
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
* @author Xenofon Spafaridis <nohponex@gmail.com>
* @uses \PDO
Expand Down
1 change: 1 addition & 0 deletions src/Models/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @author Xenofon Spafaridis <nohponex@gmail.com>
* @since 0
* @todo add more methods
* @todo add defined settings documentation
*/
class Email
{
Expand Down
1 change: 1 addition & 0 deletions src/Models/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public static function image(
* @param $destination String Zip archive path
* @param $files array array( array( 'filename' => .. 'path' => .. ) )
* @param $blobs array array( array( 'filename' => .. 'contents' => .. ) )
* @todo update zip class namespace
*/
public static function createZip($destination, $files = [], $blobs = [], $overwrite = true)
{
Expand Down
15 changes: 9 additions & 6 deletions src/Models/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
* @author Xenofon Spafaridis <nohponex@gmail.com>
* @since 0
* @todo add defined settings
*/
class Util
{
Expand All @@ -41,14 +42,14 @@ class Util
*/
public static function url($endpoint = null, $suffix = '')
{
$api_base = Phramework::getSetting('api_base');
$base = Phramework::getSetting('base');

if ($endpoint) {
$suffix = $endpoint . '/' . $suffix;

$suffix = str_replace('//', '/', $suffix);
}
return $api_base . $suffix;
return $base . $suffix;
}

/**
Expand Down Expand Up @@ -173,14 +174,16 @@ public static function checkIncludeRoot()

/**
* Get an array that represents directory tree
* @param string $directory Directory path
* @param string $directory Directory path
* @param boolean $recursive Include sub directories
* @param boolean $listDirs Include directories on listing
* @param boolean $listFiles Include files on listing
* @param string $exclude [optional] Exclude paths that matches this
* @param string $exclude *[Optional]* Exclude paths that matches this
* regular expression
* @param array $allowed_filetypes Allowed file extensions. Optional. Default allow all
* @param boolean $relative_path Return paths in relative form. Optional. Default FALSE
* @param array $allowed_filetypes *[Optional]* Allowed file extensions,
* default `[]`` (allow all)
* @param boolean $relative_path *[Optional]* Return paths in relative form,
* default `false`
*/
public static function directoryToArray(
$directory,
Expand Down
Loading

0 comments on commit 5054890

Please sign in to comment.