changed namespace from BSR\Lib to BSR\Webservice
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace BSR\Lib;
|
namespace BSR\Webservice;
|
||||||
|
|
||||||
class Configuration {
|
class Configuration {
|
||||||
private static $instance = null;
|
private static $instance = null;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Exception;
|
namespace BSR\Webservice\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This exception should be raised when an error
|
* This exception should be raised when an error
|
||||||
* related to the authentication mechanism arise.
|
* related to the authentication mechanism arise.
|
||||||
*
|
*
|
||||||
* @package BSR\Lib\Exception
|
* @package BSR\Webservice\Exception
|
||||||
*/
|
*/
|
||||||
class AuthenticationException extends WebException {
|
class AuthenticationException extends WebException {
|
||||||
const USER_NOT_FOUND = 200;
|
const USER_NOT_FOUND = 200;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Exception;
|
namespace BSR\Webservice\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception raised when an invalid attribute name is accessed
|
* Exception raised when an invalid attribute name is accessed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Exception;
|
namespace BSR\Webservice\Exception;
|
||||||
|
|
||||||
class SqlException extends \Exception
|
class SqlException extends \Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Exception;
|
namespace BSR\Webservice\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This exception should be raised by the WebService engine when
|
* This exception should be raised by the WebService engine when
|
||||||
* there is an error preventing the correct calling of a method.
|
* there is an error preventing the correct calling of a method.
|
||||||
*
|
*
|
||||||
* @package BSR\Lib\Exception
|
* @package BSR\Webservice\Exception
|
||||||
*/
|
*/
|
||||||
class UsageException extends WebException {
|
class UsageException extends WebException {
|
||||||
const NO_ARGS = 100;
|
const NO_ARGS = 100;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Exception;
|
namespace BSR\Webservice\Exception;
|
||||||
|
|
||||||
class WebException extends \Exception
|
class WebException extends \Exception
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Formatter;
|
namespace BSR\Webservice\Formatter;
|
||||||
|
|
||||||
abstract class Formatter {
|
abstract class Formatter {
|
||||||
private static $formats = array();
|
private static $formats = array();
|
||||||
@@ -49,7 +49,7 @@ abstract class Formatter {
|
|||||||
*/
|
*/
|
||||||
private static function getFormatFromHeader() {
|
private static function getFormatFromHeader() {
|
||||||
//TODO this is ugly
|
//TODO this is ugly
|
||||||
return 'BSR\Lib\Formatter\Json';
|
return 'BSR\Webservice\Formatter\Json';
|
||||||
if(isset($_SERVER['HTTP_ACCEPT'])) {
|
if(isset($_SERVER['HTTP_ACCEPT'])) {
|
||||||
$formats = array_map(function($f) {
|
$formats = array_map(function($f) {
|
||||||
$parts = explode(';', $f);
|
$parts = explode(';', $f);
|
||||||
@@ -67,7 +67,7 @@ abstract class Formatter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'BSR\Lib\Formatter\Json';
|
return 'BSR\Webservice\Formatter\Json';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Formatter;
|
namespace BSR\Webservice\Formatter;
|
||||||
|
|
||||||
use BSR\Lib\Logger;
|
use BSR\Webservice\Logger;
|
||||||
|
|
||||||
class Html extends Formatter {
|
class Html extends Formatter {
|
||||||
protected static function init() {
|
protected static function init() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Formatter;
|
namespace BSR\Webservice\Formatter;
|
||||||
|
|
||||||
class Json extends Formatter {
|
class Json extends Formatter {
|
||||||
protected static function init() {
|
protected static function init() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Formatter;
|
namespace BSR\Webservice\Formatter;
|
||||||
|
|
||||||
class Text extends Formatter {
|
class Text extends Formatter {
|
||||||
protected static function init() {
|
protected static function init() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib\Formatter;
|
namespace BSR\Webservice\Formatter;
|
||||||
|
|
||||||
class Xml extends Formatter {
|
class Xml extends Formatter {
|
||||||
protected static function init() {
|
protected static function init() {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib;
|
namespace BSR\Webservice;
|
||||||
|
|
||||||
use BSR\Lib\Exception\WebException;
|
use BSR\Webservice\Exception\WebException;
|
||||||
use BSR\Lib\Formatter\Html;
|
use BSR\Webservice\Formatter\Html;
|
||||||
|
|
||||||
class Help {
|
class Help {
|
||||||
private static function func($ws, $func) {
|
private static function func($ws, $func) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib;
|
namespace BSR\Webservice;
|
||||||
|
|
||||||
class Logger {
|
class Logger {
|
||||||
const QUIET = 0;
|
const QUIET = 0;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib;
|
namespace BSR\Webservice;
|
||||||
|
|
||||||
use BSR\Lib\Formatter\Formatter;
|
use BSR\Webservice\Formatter\Formatter;
|
||||||
|
|
||||||
class Renderer {
|
class Renderer {
|
||||||
private static $statusMessages = array(
|
private static $statusMessages = array(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BSR\Lib;
|
namespace BSR\Webservice;
|
||||||
|
|
||||||
use BSR\Lib\Exception\UsageException;
|
use BSR\Webservice\Exception\UsageException;
|
||||||
use BSR\Lib\Exception\WebException;
|
use BSR\Webservice\Exception\WebException;
|
||||||
|
|
||||||
abstract class WebService
|
abstract class WebService
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user