remaned BSR as Bsr esier to type

master
Guillermo Dev 7 years ago
parent 0f776705fb
commit 9c4430a19d

@ -1,12 +1,12 @@
<?php <?php
namespace BSR\Webservice\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\Webservice\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\Webservice\Exception; namespace Bsr\Webservice\Exception;
class SqlException extends \Exception class SqlException extends \Exception
{ {

@ -1,12 +1,12 @@
<?php <?php
namespace BSR\Webservice\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\Webservice\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\Webservice\Exception; namespace Bsr\Webservice\Exception;
class WebException extends \Exception class WebException extends \Exception
{ {

@ -1,5 +1,5 @@
<?php <?php
namespace BSR\Webservice\Formatter; namespace Bsr\Webservice\Formatter;
abstract class Formatter { abstract class Formatter {
private static $formats = array(); private static $formats = array();
@ -59,7 +59,7 @@ abstract class Formatter {
*/ */
private static function getFormatFromHeader() { private static function getFormatFromHeader() {
//TODO this is ugly //TODO this is ugly
return 'BSR\Webservice\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);
@ -76,7 +76,7 @@ abstract class Formatter {
} }
} }
return 'BSR\Webservice\Formatter\Json'; return 'Bsr\Webservice\Formatter\Json';
} }
/** /**

@ -1,7 +1,7 @@
<?php <?php
namespace BSR\Webservice\Formatter; namespace Bsr\Webservice\Formatter;
use BSR\Utils\Logger\Logger; use Bsr\Utils\Logger\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\Webservice\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\Webservice\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\Webservice\Formatter; namespace Bsr\Webservice\Formatter;
class Xml extends Formatter { class Xml extends Formatter {
protected static function init() { protected static function init() {

@ -1,8 +1,8 @@
<?php <?php
namespace BSR\Webservice; namespace Bsr\Webservice;
use BSR\Webservice\Exception\WebException; use Bsr\Webservice\Exception\WebException;
use BSR\Webservice\Formatter\Html; use Bsr\Webservice\Formatter\Html;
class Help { class Help {
private static function func($ws, $func) { private static function func($ws, $func) {

@ -1,7 +1,7 @@
<?php <?php
namespace BSR\Webservice; namespace Bsr\Webservice;
use BSR\Webservice\Formatter\Formatter; use Bsr\Webservice\Formatter\Formatter;
class Renderer class Renderer
{ {

@ -1,11 +1,11 @@
<?php <?php
namespace BSR\Webservice; namespace Bsr\Webservice;
use BSR\Webservice\Exception\UsageException; use Bsr\Webservice\Exception\UsageException;
use BSR\Webservice\Exception\WebException; use Bsr\Webservice\Exception\WebException;
use BSR\Utils\Configuration\Configuration; use Bsr\Utils\Configuration\Configuration;
use BSR\Utils\Logger\Logger; use Bsr\Utils\Logger\Logger;
abstract class WebService abstract class WebService
{ {

Loading…
Cancel
Save