Compare commits
	
		
			3 commits
		
	
	
		
			ef25c5b3af
			...
			ed84e3be71
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							 | 
						ed84e3be71 | ||
| 
							 | 
						3d1713b050 | ||
| 
							 | 
						e53f04d0c0 | 
					 4 changed files with 83 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,3 +1,6 @@
 | 
				
			||||||
composer.lock
 | 
					composer.lock
 | 
				
			||||||
vendor
 | 
					vendor
 | 
				
			||||||
php/version.php
 | 
					php/version.php
 | 
				
			||||||
 | 
					php-docs
 | 
				
			||||||
 | 
					.phpdoc
 | 
				
			||||||
 | 
					phpdoc
 | 
				
			||||||
							
								
								
									
										23
									
								
								php/cache/cache.php
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								php/cache/cache.php
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,23 @@
 | 
				
			||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * SPDX-FileCopyrightText: 2024 Sascha Nitsch (grumpydeveloper) https://contentnation.net/@grumpydevelop
 | 
				
			||||||
 | 
					 * SPDX-License-Identifier: GPL-3.0-or-later
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author Sascha Nitsch (grumpydeveloper)
 | 
				
			||||||
 | 
					 **/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace Federator\Cache;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * base class for remote authentication
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					interface Cache extends \Federator\Connector\Connector
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * save remote user by given session
 | 
				
			||||||
 | 
					     * @param string $_session session id
 | 
				
			||||||
 | 
					     * @param string $_user user/profile name
 | 
				
			||||||
 | 
					     * @return \Federator\Data\User | null
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function saveRemoteUserBySession(string $_session, string $_user, \Federator\Data\User $user);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										15
									
								
								phpdoc.dist.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								phpdoc.dist.xml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?>
 | 
				
			||||||
 | 
					<phpdocumentor configVersion="3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpdoc.org">
 | 
				
			||||||
 | 
					    <title>Federator</title>
 | 
				
			||||||
 | 
					    <paths>
 | 
				
			||||||
 | 
					        <output>php-docs</output>
 | 
				
			||||||
 | 
					    </paths>
 | 
				
			||||||
 | 
					    <version number="develop">
 | 
				
			||||||
 | 
					        <api format="php">
 | 
				
			||||||
 | 
					            <visibility>internal</visibility>
 | 
				
			||||||
 | 
					            <ignore>
 | 
				
			||||||
 | 
					                <path>vendor</path>
 | 
				
			||||||
 | 
					            </ignore>
 | 
				
			||||||
 | 
					        </api>
 | 
				
			||||||
 | 
					    </version>
 | 
				
			||||||
 | 
					</phpdocumentor>
 | 
				
			||||||
							
								
								
									
										42
									
								
								plugins/rediscache.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								plugins/rediscache.php
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,42 @@
 | 
				
			||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * SPDX-FileCopyrightText: 2024 Sascha Nitsch (grumpydeveloper) https://contentnation.net/@grumpydevelop
 | 
				
			||||||
 | 
					 * SPDX-License-Identifier: GPL-3.0-or-later
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author Sascha Nitsch <grumpydevelop@contentnation.net>
 | 
				
			||||||
 | 
					 **/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace Federator\Cache;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Caching class using redis
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					class RedisCache implements Cache
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /** @var \Redis connection handle */
 | 
				
			||||||
 | 
					    private $redis;
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get remote user by given session
 | 
				
			||||||
 | 
					     * @param string $_session session id
 | 
				
			||||||
 | 
					     * @param string $_user user/profile name
 | 
				
			||||||
 | 
					     * @return \Data\User | null
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function getRemoteUserBySession(string $_session, string $_user)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function saveRemoteUserBySession(string $_session, string $_user, \Federator\Data\User $user)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function dummy_rediscache(\Federator\Main $main)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    $rc = new RedisCache();
 | 
				
			||||||
 | 
					    $main->setCache($rc);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue