Skip to content

Commit 5af33d6

Browse files
committed
adjusting namespaces to match the java packages(i.e. org.yetanotherwebstack -> Org\YetAnotherWebStack)
1 parent 01989f8 commit 5af33d6

12 files changed

+39
-39
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Yet-Another-Web-Stack/php-memcached-session",
2+
"name": "org/Yet-Another-Web-Stack/php-memcached-session",
33
"description": "Provides a sessionhandler for php and memcached",
44
"license": "MIT",
55
"type": "library",
@@ -15,7 +15,7 @@
1515
],
1616
"autoload": {
1717
"psr-4": {
18-
"YetAnotherWebStack\\PhpMemcachedSession\\": "src/"
18+
"Org\\YetAnotherWebStack\\PhpMemcachedSession\\": "src/"
1919
}
2020
},
2121
"support": {

src/Controller/Session.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Controller;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Controller;
44

5-
class Session implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Controller {
5+
class Session implements \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Controller {
66

77
/**
88
*
99
* @var string
1010
*/
11-
protected static $model = 'YetAnotherWebStack\PhpMemcachedSession\Interfaces\Model';
11+
protected static $model = 'Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Model';
1212

1313
/**
1414
*
@@ -18,17 +18,17 @@ class Session implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Cont
1818

1919
/**
2020
*
21-
* @var \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration
21+
* @var \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration
2222
*/
2323
protected $configuration;
2424

2525
/**
2626
*
2727
* @param \Psr\Log\LoggerInterface $logger
28-
* @param YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration
28+
* @param \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration
2929
*/
3030
public function __construct(\Psr\Log\LoggerInterface $logger,
31-
\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration) {
31+
\Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration) {
3232
$this->logger = $logger;
3333
$this->configuration = $configuration;
3434
}
@@ -60,7 +60,7 @@ public function create_sid() {
6060
*/
6161
public function destroy($session_id) {
6262
$this->logger->debug("Destroying session");
63-
return \YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
63+
return \Org\YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
6464
self::$model, [':sessionId' => $session_id])->delete();
6565
}
6666

@@ -92,7 +92,7 @@ public function open($save_path, $name) {
9292
*/
9393
public function read($session_id) {
9494
$this->logger->debug("Trying read session $session_id");
95-
return \YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
95+
return \Org\YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
9696
self::$model, [':sessionId' => $session_id])->load();
9797
}
9898

@@ -104,7 +104,7 @@ public function read($session_id) {
104104
*/
105105
public function write($session_id, $session_data) {
106106
$this->logger->debug("Trying write to the session $session_id");
107-
return \YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
107+
return \Org\YetAnotherWebStack\PhpMemcachedSession\Service\DependencyInjector::get(
108108
self::$model, [':sessionId' => $session_id])->save($session_data);
109109
}
110110

src/Initializer.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession;
44

55
class Initializer {
66

@@ -11,18 +11,18 @@ class Initializer {
1111
* @param boolean $isReadOnly
1212
*/
1313
public static function run(callable $callable,
14-
$configuration = 'YetAnotherWebStack\PhpMemcachedSession\Service\Configuration',
14+
$configuration = 'Org\YetAnotherWebStack\PhpMemcachedSession\Service\Configuration',
1515
$isReadOnly = false
1616
) {
1717
self::setClasses($configuration,
18-
'YetAnotherWebStack\PhpMemcachedSession\Repository\MemCacheRead' . (
18+
'Org\YetAnotherWebStack\PhpMemcachedSession\Repository\MemCacheRead' . (
1919
$isReadOnly ? '' : 'Write'
2020
));
2121
self::setSettings();
2222
call_user_func($callable);
2323
session_set_save_handler(
2424
Service\DependencyInjector::get(
25-
'YetAnotherWebStack\PhpMemcachedSession\Interfaces\Controller'
25+
'Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Controller'
2626
)
2727
);
2828
}
@@ -36,17 +36,17 @@ protected static function setClasses($configuration, $repository) {
3636
$mappings = [
3737
'Singleton' => [
3838
'Configuration' => $configuration,
39-
'Model' => 'YetAnotherWebStack\PhpMemcachedSession\Model\Session',
39+
'Model' => 'Org\YetAnotherWebStack\PhpMemcachedSession\Model\Session',
4040
],
4141
'Regular' => [
4242
'Repository' => $repository,
43-
'Controller' => 'YetAnotherWebStack\PhpMemcachedSession\Controller\Session',
43+
'Controller' => 'Org\YetAnotherWebStack\PhpMemcachedSession\Controller\Session',
4444
]
4545
];
4646
foreach ($mappings as $type => $list) {
4747
foreach ($list as $interface => $implementation) {
4848
Service\DependencyInjector::{'set' . $type}(
49-
'YetAnotherWebStack\PhpMemcachedSession\Interfaces\\' . $interface,
49+
'Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\\' . $interface,
5050
$implementation);
5151
}
5252
}
@@ -57,7 +57,7 @@ protected static function setClasses($configuration, $repository) {
5757
*/
5858
protected static function setSettings() {
5959
$configuration = Service\DependencyInjector::get(
60-
'YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration'
60+
'Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration'
6161
);
6262
$configuration->setGeneral('serialize_handler', 'php_serialize');
6363
$configuration->setGeneral('name', 'name');

src/Interfaces/Configuration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Interfaces;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces;
44

55
interface Configuration {
66

src/Interfaces/Controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Interfaces;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces;
44

55
interface Controller extends \SessionHandlerInterface {
66

src/Interfaces/Model.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Interfaces;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces;
44

55
interface Model {
66

77
/**
88
*
99
* @param string $sessionId
10-
* @param \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository
10+
* @param \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository
1111
*/
1212
public function __construct($sessionId,
13-
\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository,
13+
\Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository,
1414
\Psr\Log\LoggerInterface $logger);
1515

1616
/**

src/Interfaces/Repository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Interfaces;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces;
44

55
interface Repository {
66

src/Model/Session.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Model;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Model;
44

5-
class Session implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Model {
5+
class Session implements \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Model {
66

77
/**
88
*
@@ -12,7 +12,7 @@ class Session implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Mode
1212

1313
/**
1414
*
15-
* @var \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository
15+
* @var \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository
1616
*/
1717
protected $repository;
1818

@@ -49,10 +49,10 @@ class Session implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Mode
4949
/**
5050
*
5151
* @param string $sessionId
52-
* @param \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository
52+
* @param \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository
5353
*/
5454
public function __construct($sessionId,
55-
\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository,
55+
\Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository $repository,
5656
\Psr\Log\LoggerInterface $logger) {
5757
$this->logger = $logger;
5858
$this->sessionId = $sessionId;

src/Repository/MemCacheRead.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Repository;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Repository;
44

5-
class MemCacheRead implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository {
5+
class MemCacheRead implements \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Repository {
66

77
/**
88
*
@@ -14,7 +14,7 @@ class MemCacheRead implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces
1414
*
1515
* @var string[]
1616
*/
17-
protected $prefix = ['yet-another-web-stack', 'memcached-session'];
17+
protected $prefix = ['org', 'yet-another-web-stack', 'memcached-session'];
1818

1919
/**
2020
*
@@ -30,7 +30,7 @@ class MemCacheRead implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces
3030

3131
/**
3232
*
33-
* @var \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration
33+
* @var \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration
3434
*/
3535
protected $configuration;
3636

@@ -39,7 +39,7 @@ class MemCacheRead implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces
3939
*/
4040
public function __construct(\Memcached $memcache,
4141
\Psr\Log\LoggerInterface $logger,
42-
\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration) {
42+
\Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration $configuration) {
4343
$this->memcache = $memcache;
4444
$this->logger = $logger;
4545
$this->configuration = $configuration;

src/Repository/MemCacheReadWrite.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Repository;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Repository;
44

55
class MemCacheReadWrite extends MemCacheRead {
66

src/Service/Configuration.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Service;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Service;
44

5-
class Configuration implements \YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration {
5+
class Configuration implements \Org\YetAnotherWebStack\PhpMemcachedSession\Interfaces\Configuration {
66

77
/**
88
*

src/Service/DependencyInjector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace YetAnotherWebStack\PhpMemcachedSession\Service;
3+
namespace Org\YetAnotherWebStack\PhpMemcachedSession\Service;
44

55
class DependencyInjector {
66

0 commit comments

Comments
 (0)