mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-15 07:58:40 +00:00
Formatting & bug fixes
This commit is contained in:
parent
292ac8d739
commit
ce182bab92
|
|
@ -422,7 +422,8 @@ class Account
|
||||||
$this->lastActive = new \DateTime('NOW');
|
$this->lastActive = new \DateTime('NOW');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCreatedAt(\DateTime $created) {
|
public function setCreatedAt(\DateTime $created)
|
||||||
|
{
|
||||||
$this->createdAt = $created;
|
$this->createdAt = $created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,8 @@ class AccountManager implements \Countable
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function count() : int {
|
public function count() : int
|
||||||
|
{
|
||||||
return count($this->accounts);
|
return count($this->accounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ class MemCache implements CacheInterface
|
||||||
*/
|
*/
|
||||||
public function stats() : array
|
public function stats() : array
|
||||||
{
|
{
|
||||||
|
/** @noinspection PhpMethodOrClassCallIsNotCaseSensitiveInspection */
|
||||||
return $this->memc->getExtendedStats();
|
return $this->memc->getExtendedStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpOMS\DataStorage\Database;
|
namespace phpOMS\DataStorage\Database;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,8 @@ abstract class DataMapperAbstract implements DataMapperInterface
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clear() {
|
public function clear()
|
||||||
|
{
|
||||||
$this->fields = [];
|
$this->fields = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\DataStorage\Session;
|
namespace phpOMS\DataStorage\Session;
|
||||||
|
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
use phpOMS\Utils\RnG\StringUtils;
|
use phpOMS\Utils\RnG\StringUtils;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,12 +262,12 @@ class FileLogger implements LoggerInterface
|
||||||
* @param array $a
|
* @param array $a
|
||||||
* @param array $b
|
* @param array $b
|
||||||
*
|
*
|
||||||
* @return bool the comparison
|
* @return int
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn
|
* @author Dennis Eichhorn
|
||||||
*/
|
*/
|
||||||
private function orderSort($a, $b)
|
private function orderSort($a, $b) : int
|
||||||
{
|
{
|
||||||
if ($a['time'] == $b['time']) {
|
if ($a['time'] == $b['time']) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,8 @@ class Functions
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public static function invMod($a, $n) {
|
public static function invMod($a, $n)
|
||||||
|
{
|
||||||
if ($n < 0) {
|
if ($n < 0) {
|
||||||
$n = -$n;
|
$n = -$n;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
namespace phpOMS\Math\Matrix;
|
namespace phpOMS\Math\Matrix;
|
||||||
|
|
||||||
class IdentityMatrix extends Matrix {
|
class IdentityMatrix extends Matrix
|
||||||
|
{
|
||||||
public function __constrcut(int $n)
|
public function __constrcut(int $n)
|
||||||
{
|
{
|
||||||
$this->n = $n;
|
$this->n = $n;
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,9 @@ class Matrix implements \ArrayAccess, \Iterator
|
||||||
$matrix = new Matrix($this->n, $this->n);
|
$matrix = new Matrix($this->n, $this->n);
|
||||||
|
|
||||||
$matrixArr = $this->matrix;
|
$matrixArr = $this->matrix;
|
||||||
$matrix->setMatrix($this->upperTrianglize($matrixArr));
|
$this->upperTrianglize($matrixArr);
|
||||||
|
|
||||||
|
$matrix->setMatrix($matrixArr);
|
||||||
|
|
||||||
return $matrix;
|
return $matrix;
|
||||||
}
|
}
|
||||||
|
|
@ -348,4 +350,122 @@ class Matrix implements \ArrayAccess, \Iterator
|
||||||
|
|
||||||
return $prod;
|
return $prod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the current element
|
||||||
|
* @link http://php.net/manual/en/iterator.current.php
|
||||||
|
* @return mixed Can return any type.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function current()
|
||||||
|
{
|
||||||
|
// TODO: Implement current() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move forward to next element
|
||||||
|
* @link http://php.net/manual/en/iterator.next.php
|
||||||
|
* @return void Any returned value is ignored.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function next()
|
||||||
|
{
|
||||||
|
// TODO: Implement next() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the key of the current element
|
||||||
|
* @link http://php.net/manual/en/iterator.key.php
|
||||||
|
* @return mixed scalar on success, or null on failure.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function key()
|
||||||
|
{
|
||||||
|
// TODO: Implement key() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if current position is valid
|
||||||
|
* @link http://php.net/manual/en/iterator.valid.php
|
||||||
|
* @return boolean The return value will be casted to boolean and then evaluated.
|
||||||
|
* Returns true on success or false on failure.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function valid()
|
||||||
|
{
|
||||||
|
// TODO: Implement valid() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewind the Iterator to the first element
|
||||||
|
* @link http://php.net/manual/en/iterator.rewind.php
|
||||||
|
* @return void Any returned value is ignored.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function rewind()
|
||||||
|
{
|
||||||
|
// TODO: Implement rewind() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether a offset exists
|
||||||
|
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
|
||||||
|
* @param mixed $offset <p>
|
||||||
|
* An offset to check for.
|
||||||
|
* </p>
|
||||||
|
* @return boolean true on success or false on failure.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* The return value will be casted to boolean if non-boolean was returned.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function offsetExists($offset)
|
||||||
|
{
|
||||||
|
// TODO: Implement offsetExists() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to retrieve
|
||||||
|
* @link http://php.net/manual/en/arrayaccess.offsetget.php
|
||||||
|
* @param mixed $offset <p>
|
||||||
|
* The offset to retrieve.
|
||||||
|
* </p>
|
||||||
|
* @return mixed Can return all value types.
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function offsetGet($offset)
|
||||||
|
{
|
||||||
|
// TODO: Implement offsetGet() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to set
|
||||||
|
* @link http://php.net/manual/en/arrayaccess.offsetset.php
|
||||||
|
* @param mixed $offset <p>
|
||||||
|
* The offset to assign the value to.
|
||||||
|
* </p>
|
||||||
|
* @param mixed $value <p>
|
||||||
|
* The value to set.
|
||||||
|
* </p>
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
// TODO: Implement offsetSet() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to unset
|
||||||
|
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
|
||||||
|
* @param mixed $offset <p>
|
||||||
|
* The offset to unset.
|
||||||
|
* </p>
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.0
|
||||||
|
*/
|
||||||
|
public function offsetUnset($offset)
|
||||||
|
{
|
||||||
|
// TODO: Implement offsetUnset() method.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
namespace phpOMS\Math\Matrix;
|
namespace phpOMS\Math\Matrix;
|
||||||
|
|
||||||
class Vector extends Matrix {
|
class Vector extends Matrix
|
||||||
|
{
|
||||||
public function __construct(int $m)
|
public function __construct(int $m)
|
||||||
{
|
{
|
||||||
parent::__construct($m);
|
parent::__construct($m);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
use phpOMS\Math\Number\Prime;
|
use phpOMS\Math\Number\Prime;
|
||||||
|
|
||||||
class Integer implements Number
|
class Integer
|
||||||
{
|
{
|
||||||
public static function isInteger($value) : bool
|
public static function isInteger($value) : bool
|
||||||
{
|
{
|
||||||
|
|
@ -24,7 +24,8 @@ class Integer implements Number
|
||||||
while (true) {
|
while (true) {
|
||||||
if ($n === $m) {
|
if ($n === $m) {
|
||||||
return $m;
|
return $m;
|
||||||
} if ($n > $m) {
|
}
|
||||||
|
if ($n > $m) {
|
||||||
$n -= $m;
|
$n -= $m;
|
||||||
} else {
|
} else {
|
||||||
$m -= $n;
|
$m -= $n;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Natural implements Number
|
class Natural
|
||||||
{
|
{
|
||||||
public static function isNatural($value) : bool
|
public static function isNatural($value) : bool
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
class Number {
|
<?php
|
||||||
public static function getType($number) {
|
|
||||||
|
class Number
|
||||||
|
{
|
||||||
|
public static function getType($number)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
interface NumberInterface {
|
|
||||||
public function add($number);
|
|
||||||
public function sub($number);
|
|
||||||
public function mult($number);
|
|
||||||
public function div($number);
|
|
||||||
public function pow($p);
|
|
||||||
public function abs($number);
|
|
||||||
}
|
|
||||||
16
Math/Number/OpperationInterface.php
Normal file
16
Math/Number/OpperationInterface.php
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
interface NumberInterface
|
||||||
|
{
|
||||||
|
public function add($number);
|
||||||
|
|
||||||
|
public function sub($number);
|
||||||
|
|
||||||
|
public function mult($number);
|
||||||
|
|
||||||
|
public function div($number);
|
||||||
|
|
||||||
|
public function pow($p);
|
||||||
|
|
||||||
|
public function abs($number);
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
namespace phpOMS\Math\Optimization\Graph;
|
namespace phpOMS\Math\Optimization\Graph;
|
||||||
|
|
||||||
class Dijkstra {
|
class Dijkstra
|
||||||
public static function dijkstra(Graph $graph, $source, $target) {
|
{
|
||||||
|
public static function dijkstra(Graph $graph, $source, $target)
|
||||||
|
{
|
||||||
$vertices = [];
|
$vertices = [];
|
||||||
$neighbours = [];
|
$neighbours = [];
|
||||||
|
|
||||||
|
|
@ -19,7 +21,7 @@ class Dijkstra {
|
||||||
$previous = [];
|
$previous = [];
|
||||||
foreach ($vertices as $vertex) {
|
foreach ($vertices as $vertex) {
|
||||||
$dist[$vertex] = INF;
|
$dist[$vertex] = INF;
|
||||||
$previous[$vertex] = NULL;
|
$previous[$vertex] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dist[$source] = 0;
|
$dist[$source] = 0;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Math\Optimization\Graph;
|
namespace phpOMS\Math\Optimization\Graph;
|
||||||
|
|
||||||
use phpOMS\Stdlib\Map\KeyType;
|
use phpOMS\Stdlib\Map\KeyType;
|
||||||
use phpOMS\Stdlib\Map\MultiMap;
|
use phpOMS\Stdlib\Map\MultiMap;
|
||||||
use phpOMS\Stdlib\Map\OrderType;
|
use phpOMS\Stdlib\Map\OrderType;
|
||||||
|
|
@ -149,8 +150,8 @@ class Graph
|
||||||
*/
|
*/
|
||||||
public function removeEdgeById($id) : bool
|
public function removeEdgeById($id) : bool
|
||||||
{
|
{
|
||||||
if (isset($this->edge[$id])) {
|
if (isset($this->edges[$id])) {
|
||||||
unset($this->edge[$id]);
|
unset($this->edges[$id]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +204,7 @@ class Graph
|
||||||
*/
|
*/
|
||||||
public function getEdgeById(int $id) : EdgeInterface
|
public function getEdgeById(int $id) : EdgeInterface
|
||||||
{
|
{
|
||||||
return $this->edges->get([$a, $b]) ?? new NullEdge();
|
return $this->edges->get($id) ?? new NullEdge();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.0
|
||||||
|
*
|
||||||
|
* @category TBD
|
||||||
|
* @package TBD
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @copyright 2013 Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
*/
|
||||||
|
namespace phpOMS\Math\Optimization\Graph;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Graph class
|
||||||
|
*
|
||||||
|
* @category Framework
|
||||||
|
* @package phpOMS\Asset
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class NullEdge
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.0
|
||||||
|
*
|
||||||
|
* @category TBD
|
||||||
|
* @package TBD
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @copyright 2013 Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
*/
|
||||||
|
namespace phpOMS\Math\Optimization\Graph;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Graph class
|
||||||
|
*
|
||||||
|
* @category Framework
|
||||||
|
* @package phpOMS\Asset
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class NullVertice
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Math\Shape\D2;
|
namespace phpOMS\Math\Shape\D2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Polygon class.
|
* Polygon class.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpOMS\Math\Stochastic\Distribution;
|
namespace phpOMS\Math\Stochastic\Distribution;
|
||||||
|
|
||||||
use phpOMS\Math\Functions;
|
use phpOMS\Math\Functions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpOMS\Math\Stochastic\Distribution;
|
namespace phpOMS\Math\Stochastic\Distribution;
|
||||||
|
|
||||||
use phpOMS\Math\Functions;
|
use phpOMS\Math\Functions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ class GeometricDistribution
|
||||||
*/
|
*/
|
||||||
public static function getSkewness(float $lambda) : float
|
public static function getSkewness(float $lambda) : float
|
||||||
{
|
{
|
||||||
return (2 - $p) / sqrt(1 - $p);
|
return (2 - $lambda) / sqrt(1 - $lambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -166,7 +166,7 @@ class GeometricDistribution
|
||||||
*/
|
*/
|
||||||
public static function getExKurtosis(float $lambda) : float
|
public static function getExKurtosis(float $lambda) : float
|
||||||
{
|
{
|
||||||
return 6 + $p ** 2 / (1 - $p);
|
return 6 + $lambda ** 2 / (1 - $lambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getRandom()
|
public static function getRandom()
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace phpOMS\Math\Stochastic\Distribution;
|
namespace phpOMS\Math\Stochastic\Distribution;
|
||||||
|
|
||||||
use phpOMS\Math\Functions;
|
use phpOMS\Math\Functions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Message;
|
namespace phpOMS\Message;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Cookie\CookieJar;
|
use phpOMS\DataStorage\Cookie\CookieJar;
|
||||||
use phpOMS\DataStorage\Session\HttpSession;
|
use phpOMS\DataStorage\Session\HttpSession;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,6 @@ class Response extends ResponseAbstract implements RenderableInterface
|
||||||
$render .= json_encode($response);
|
$render .= json_encode($response);
|
||||||
// TODO: remove this. This should never happen since then someone forgot to set the correct header. it should be json header!
|
// TODO: remove this. This should never happen since then someone forgot to set the correct header. it should be json header!
|
||||||
} else {
|
} else {
|
||||||
var_dump($response);
|
|
||||||
throw new \Exception('Wrong response type');
|
throw new \Exception('Wrong response type');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ class Rest
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn
|
* @author Dennis Eichhorn
|
||||||
*/
|
*/
|
||||||
public function setRequest(Request $request) {
|
public function setRequest(Request $request)
|
||||||
|
{
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,13 @@ class Imap extends Mail
|
||||||
return !($this->inbox === false);
|
return !($this->inbox === false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoxes() {
|
public function getBoxes()
|
||||||
|
{
|
||||||
return imap_list($this->inbox, $this->host, '*');
|
return imap_list($this->inbox, $this->host, '*');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQuota() {
|
public function getQuota()
|
||||||
|
{
|
||||||
return imap_get_quotaroot($this->inbox, "INBOX");
|
return imap_get_quotaroot($this->inbox, "INBOX");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,10 +135,12 @@ class Imap extends Mail
|
||||||
{
|
{
|
||||||
if ($encoding == 3) {
|
if ($encoding == 3) {
|
||||||
return imap_base64($content);
|
return imap_base64($content);
|
||||||
} else if ($encoding == 1) {
|
} else {
|
||||||
|
if ($encoding == 1) {
|
||||||
return imap_8bit($content);
|
return imap_8bit($content);
|
||||||
} else {
|
} else {
|
||||||
return imap_qprint($content);
|
return imap_qprint($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,8 @@ abstract class RequestAbstract implements MessageInterface
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function setMethod(string $method) {
|
public function setMethod(string $method)
|
||||||
|
{
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -261,6 +262,7 @@ abstract class RequestAbstract implements MessageInterface
|
||||||
public function getData($key = null)
|
public function getData($key = null)
|
||||||
{
|
{
|
||||||
$key = mb_strtolower($key);
|
$key = mb_strtolower($key);
|
||||||
|
|
||||||
return !isset($key) ? $this->data : $this->data[$key] ?? null;
|
return !isset($key) ? $this->data : $this->data[$key] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,8 @@ class InfoManager
|
||||||
/**
|
/**
|
||||||
* Update info file
|
* Update info file
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn
|
* @author Dennis Eichhorn
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Pattern;
|
namespace phpOMS\Pattern;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Observer.
|
* Observer.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Pattern;
|
namespace phpOMS\Pattern;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subject.
|
* Subject.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -48,35 +48,43 @@ class ClientConnection
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSocket() {
|
public function getSocket()
|
||||||
|
{
|
||||||
return $this->socket;
|
return $this->socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHandshake() {
|
public function getHandshake()
|
||||||
|
{
|
||||||
return $this->handshake;
|
return $this->handshake;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPid() {
|
public function getPid()
|
||||||
|
{
|
||||||
return $this->pid;
|
return $this->pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isConnected() {
|
public function isConnected()
|
||||||
|
{
|
||||||
return $this->connected;
|
return $this->connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSocket($socket) {
|
public function setSocket($socket)
|
||||||
|
{
|
||||||
$this->socket = $socket;
|
$this->socket = $socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHandshake($handshake) {
|
public function setHandshake($handshake)
|
||||||
|
{
|
||||||
$this->handshake = $handshake;
|
$this->handshake = $handshake;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPid($pid) {
|
public function setPid($pid)
|
||||||
|
{
|
||||||
$this->pid = $pid;
|
$this->pid = $pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setConnected(bool $connected) {
|
public function setConnected(bool $connected)
|
||||||
|
{
|
||||||
$this->connected = $connected;
|
$this->connected = $connected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Socket\Packets;
|
namespace phpOMS\Socket\Packets;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server class.
|
* Server class.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ class ClientManager
|
||||||
return $this->clients[$id] ?? new NullClientConnection(uniqid(), null);
|
return $this->clients[$id] ?? new NullClientConnection(uniqid(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBySocket($socket) {
|
public function getBySocket($socket)
|
||||||
|
{
|
||||||
foreach ($this->clients as $client) {
|
foreach ($this->clients as $client) {
|
||||||
if ($client->getSocket() === $socket) {
|
if ($client->getSocket() === $socket) {
|
||||||
return $client;
|
return $client;
|
||||||
|
|
@ -43,7 +44,8 @@ class ClientManager
|
||||||
return new NullClientConnection(uniqid(), null);
|
return new NullClientConnection(uniqid(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove($id) {
|
public function remove($id)
|
||||||
|
{
|
||||||
if (isset($this->clients[$id])) {
|
if (isset($this->clients[$id])) {
|
||||||
unset($this->clients[$id]);
|
unset($this->clients[$id]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ class Server extends SocketAbstract
|
||||||
$origin = $match[1];
|
$origin = $match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$key = '';
|
||||||
if (preg_match("/Sec-WebSocket-Key: (.*)\r\n/", $headers, $match)) {
|
if (preg_match("/Sec-WebSocket-Key: (.*)\r\n/", $headers, $match)) {
|
||||||
$key = $match[1];
|
$key = $match[1];
|
||||||
}
|
}
|
||||||
|
|
@ -159,6 +160,7 @@ class Server extends SocketAbstract
|
||||||
"\r\n\r\n";
|
"\r\n\r\n";
|
||||||
socket_write($client->getSocket(), $upgrade);
|
socket_write($client->getSocket(), $upgrade);
|
||||||
$client->setHandshake(true);
|
$client->setHandshake(true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Stdlib\Map;
|
namespace phpOMS\Stdlib\Map;
|
||||||
|
|
||||||
use phpOMS\Utils\Permutation;
|
use phpOMS\Utils\Permutation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,14 @@ class PriorityQueue implements \Countable, \Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* Unserialize queue.
|
||||||
|
*
|
||||||
|
* @param string $data Data to unserialze
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function unserialize($data) : array
|
public function unserialize($data) : array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -71,13 +71,15 @@ class Directory extends FileAbstract implements \Iterator, \ArrayAccess
|
||||||
if ($filename != ".." && $filename != ".") {
|
if ($filename != ".." && $filename != ".") {
|
||||||
if (is_dir($dir . "/" . $filename) && $recursive) {
|
if (is_dir($dir . "/" . $filename) && $recursive) {
|
||||||
$countSize += self::getFolderSize($dir . "/" . $filename, $recursive);
|
$countSize += self::getFolderSize($dir . "/" . $filename, $recursive);
|
||||||
} else if (is_file($dir . "/" . $filename)) {
|
} else {
|
||||||
|
if (is_file($dir . "/" . $filename)) {
|
||||||
$countSize += filesize($dir . "/" . $filename);
|
$countSize += filesize($dir . "/" . $filename);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (int) $countSize;
|
return (int) $countSize;
|
||||||
}
|
}
|
||||||
|
|
@ -216,7 +218,7 @@ class Directory extends FileAbstract implements \Iterator, \ArrayAccess
|
||||||
parent::__construct($path);
|
parent::__construct($path);
|
||||||
|
|
||||||
if (file_exists($this->path)) {
|
if (file_exists($this->path)) {
|
||||||
parent::index();
|
$this->index();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -287,6 +289,7 @@ class Directory extends FileAbstract implements \Iterator, \ArrayAccess
|
||||||
$this->size -= $this->nodes[$name]->getSize();
|
$this->size -= $this->nodes[$name]->getSize();
|
||||||
|
|
||||||
unset($this->nodes[$name]);
|
unset($this->nodes[$name]);
|
||||||
|
|
||||||
// todo: unlink???
|
// todo: unlink???
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ namespace phpOMS\System;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
final class OperatingSystem {
|
final class OperatingSystem
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Get OS.
|
* Get OS.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class SystemUtils
|
||||||
$mem = 0;
|
$mem = 0;
|
||||||
|
|
||||||
while ($line = fgets($fh)) {
|
while ($line = fgets($fh)) {
|
||||||
$pieces = array();
|
$pieces = [];
|
||||||
if (preg_match('/^MemTotal:\s+(\d+)\skB$/', $line, $pieces)) {
|
if (preg_match('/^MemTotal:\s+(\d+)\skB$/', $line, $pieces)) {
|
||||||
$mem = $pieces[1] * 1024;
|
$mem = $pieces[1] * 1024;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2,23 +2,28 @@
|
||||||
|
|
||||||
class Aztec
|
class Aztec
|
||||||
{
|
{
|
||||||
private function calculateSize() {
|
private function calculateSize()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function bitStuffing() {
|
private function bitStuffing()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function padding() {
|
private function padding()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function check() {
|
private function check()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function arange() {
|
private function arange()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,10 +110,11 @@ class Codebar extends C128Abstract
|
||||||
|
|
||||||
for ($posX = 1; $posX <= $length; $posX++) {
|
for ($posX = 1; $posX <= $length; $posX++) {
|
||||||
for ($posY = 0; $posY < $lenCodearr; $posY++) {
|
for ($posY = 0; $posY < $lenCodearr; $posY++) {
|
||||||
if (substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY])
|
if (substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY]) {
|
||||||
$codeString .= self::$CODEARRAY2[$posY] . '1';
|
$codeString .= self::$CODEARRAY2[$posY] . '1';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $codeString;
|
return $codeString;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ namespace phpOMS\Utils\Encoding;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Caesar {
|
class Caesar
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* ASCII lower char limit.
|
* ASCII lower char limit.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ namespace phpOMS\Utils\Encoding;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
final class Gray {
|
final class Gray
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ namespace phpOMS\Utils\Encoding;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
final class XorEncoding {
|
final class XorEncoding
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ require_once realpath(__DIR__ . '/../../../vendor/PHPExcel/Classes/PHPExcel.php'
|
||||||
* @package phpOMS\Utils\Excel
|
* @package phpOMS\Utils\Excel
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @noinspection PhpUndefinedClassInspection */
|
/** @noinspection PhpUndefinedClassInspection */
|
||||||
class Excel extends \PHPExcel
|
class Excel extends \PHPExcel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class Author
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function __construct(string $name, string $email)
|
public function __construct(string $name = '', string $email = '')
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
|
|
@ -69,7 +69,7 @@ class Author
|
||||||
*/
|
*/
|
||||||
public function getName() : string
|
public function getName() : string
|
||||||
{
|
{
|
||||||
return $name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -82,6 +82,6 @@ class Author
|
||||||
*/
|
*/
|
||||||
public function getEmail() : string
|
public function getEmail() : string
|
||||||
{
|
{
|
||||||
return $email;
|
return $this->email;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ class Branch
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function __construct(string $name)
|
public function __construct(string $name = '')
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Utils\Git;
|
namespace phpOMS\Utils\Git;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gray encoding class
|
* Gray encoding class
|
||||||
|
|
@ -101,10 +100,11 @@ class Commit
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function __construct(string $id = '') {
|
public function __construct(string $id = '')
|
||||||
$author = new Author();
|
{
|
||||||
$branch = new Branch();
|
$this->author = new Author();
|
||||||
$tag = new Tag();
|
$this->branch = new Branch();
|
||||||
|
$this->tag = new Tag();
|
||||||
|
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
// todo: fill base info
|
// todo: fill base info
|
||||||
|
|
@ -119,7 +119,8 @@ class Commit
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function addFile(string $path) {
|
public function addFile(string $path)
|
||||||
|
{
|
||||||
if (!isset($this->files[$path])) {
|
if (!isset($this->files[$path])) {
|
||||||
$this->files[$path] = [];
|
$this->files[$path] = [];
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +248,8 @@ class Commit
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function setBranch(Branch $branch) {
|
public function setBranch(Branch $branch)
|
||||||
|
{
|
||||||
$this->branch = $branch;
|
$this->branch = $branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -272,7 +274,8 @@ class Commit
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function setTag(Tag $tag) {
|
public function setTag(Tag $tag)
|
||||||
|
{
|
||||||
$this->tag = $tag;
|
$this->tag = $tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Utils\Git;
|
namespace phpOMS\Utils\Git;
|
||||||
|
|
||||||
use phpOMS\System\File\PathException;
|
use phpOMS\System\File\PathException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -27,7 +28,8 @@ use phpOMS\System\File\PathException;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Git {
|
class Git
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Git path.
|
* Git path.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Utils\Git;
|
namespace phpOMS\Utils\Git;
|
||||||
|
|
||||||
use phpOMS\System\File\PathException;
|
use phpOMS\System\File\PathException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -125,6 +126,8 @@ class Repository
|
||||||
*
|
*
|
||||||
* @param string $cmd Command to run
|
* @param string $cmd Command to run
|
||||||
*
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.0
|
||||||
|
*
|
||||||
|
* @category TBD
|
||||||
|
* @package TBD
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @copyright 2013 Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
*/
|
||||||
|
namespace phpOMS\Utils\Git;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gray encoding class
|
||||||
|
*
|
||||||
|
* @category Framework
|
||||||
|
* @package phpOMS\Asset
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Tag
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -15,9 +15,13 @@
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Utils\IO;
|
namespace phpOMS\Utils\IO;
|
||||||
|
|
||||||
interface IODatabaseMapper {
|
interface IODatabaseMapper
|
||||||
|
{
|
||||||
public function addSource(string $source);
|
public function addSource(string $source);
|
||||||
|
|
||||||
public function setSources(array $sources);
|
public function setSources(array $sources);
|
||||||
|
|
||||||
public function setLineBuffer(int $buffer);
|
public function setLineBuffer(int $buffer);
|
||||||
|
|
||||||
public function insert();
|
public function insert();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ include __DIR__ . '/../../../Resources/tcpdf/tcpdf.php';
|
||||||
* @package phpOMS\Utils\Pdf
|
* @package phpOMS\Utils\Pdf
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @noinspection PhpUndefinedClassInspection */
|
/** @noinspection PhpUndefinedClassInspection */
|
||||||
class Pdf extends \TCPDF
|
class Pdf extends \TCPDF
|
||||||
{
|
{
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -58,7 +58,9 @@ class ClassParser
|
||||||
|
|
||||||
private $functions = [];
|
private $functions = [];
|
||||||
|
|
||||||
public function __construct() {}
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saving class to file.
|
* Saving class to file.
|
||||||
|
|
@ -154,7 +156,8 @@ class ClassParser
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName(string $name) {
|
public function setName(string $name)
|
||||||
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ class FunctionParser
|
||||||
|
|
||||||
private $body = '';
|
private $body = '';
|
||||||
|
|
||||||
public function setName(string $name) {
|
public function setName(string $name)
|
||||||
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +56,8 @@ class FunctionParser
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function seBody(string $body) {
|
public function seBody(string $body)
|
||||||
|
{
|
||||||
$this->body = $body;
|
$this->body = $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +81,8 @@ class FunctionParser
|
||||||
return $this->visibility;
|
return $this->visibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStatic(bool $static) {
|
public function setStatic(bool $static)
|
||||||
|
{
|
||||||
$this->isStatic = $static;
|
$this->isStatic = $static;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@ class MemberParser
|
||||||
|
|
||||||
private $default = null;
|
private $default = null;
|
||||||
|
|
||||||
public function setName(string $name) {
|
public function setName(string $name)
|
||||||
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +60,8 @@ class MemberParser
|
||||||
return $this->visibility;
|
return $this->visibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStatic(bool $static) {
|
public function setStatic(bool $static)
|
||||||
|
{
|
||||||
$this->isStatic = $static;
|
$this->isStatic = $static;
|
||||||
|
|
||||||
if ($this->isStatic) {
|
if ($this->isStatic) {
|
||||||
|
|
@ -81,7 +83,8 @@ class MemberParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDefault($default) {
|
public function setDefault($default)
|
||||||
|
{
|
||||||
$this->default = $default;
|
$this->default = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Utils\RnG;
|
namespace phpOMS\Utils\RnG;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File generator.
|
* File generator.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@ class LinearCongruentialGenerator
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public static function msvcrt(int $seed) {
|
public static function msvcrt(int $seed)
|
||||||
|
{
|
||||||
return function () use (&$seed) {
|
return function () use (&$seed) {
|
||||||
return ($seed = (214013 * $seed + 2531011) % (1 << 31)) >> 16;
|
return ($seed = (214013 * $seed + 2531011) % (1 << 31)) >> 16;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Utils\RnG;
|
namespace phpOMS\Utils\RnG;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Phone generator.
|
* Phone generator.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
*/
|
*/
|
||||||
class Cron implements ScheduleInterface
|
class Cron implements ScheduleInterface
|
||||||
{
|
{
|
||||||
public function __construct() {
|
public function __construct()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,8 @@ class Interval
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStart(\DateTime $start) {
|
public function setStart(\DateTime $start)
|
||||||
|
{
|
||||||
$this->start = $start;
|
$this->start = $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -222,7 +223,8 @@ class Interval
|
||||||
return $this->end;
|
return $this->end;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEnd(\DateTime $end) {
|
public function setEnd(\DateTime $end)
|
||||||
|
{
|
||||||
$this->end = $end;
|
$this->end = $end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
use phpOMS\System\OperatingSystem;
|
use phpOMS\System\OperatingSystem;
|
||||||
use phpOMS\System\SystemType;
|
use phpOMS\System\SystemType;
|
||||||
|
|
||||||
final class SchedulerFactory {
|
final class SchedulerFactory
|
||||||
|
{
|
||||||
public static function create() : ScheduleInterface
|
public static function create() : ScheduleInterface
|
||||||
{
|
{
|
||||||
switch (OperatingSystem::getSystem()) {
|
switch (OperatingSystem::getSystem()) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
use phpOMS\System\OperatingSystem;
|
use phpOMS\System\OperatingSystem;
|
||||||
use phpOMS\System\SystemType;
|
use phpOMS\System\SystemType;
|
||||||
|
|
||||||
final class TaskFactory {
|
final class TaskFactory
|
||||||
|
{
|
||||||
public static function create(Interval $interval = null, string $cmd = '') : TaskInterface
|
public static function create(Interval $interval = null, string $cmd = '') : TaskInterface
|
||||||
{
|
{
|
||||||
switch (OperatingSystem::getSystem()) {
|
switch (OperatingSystem::getSystem()) {
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,6 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
interface TaskInterface
|
interface TaskInterface
|
||||||
{
|
{
|
||||||
public function setInterval(Interval $interval);
|
public function setInterval(Interval $interval);
|
||||||
|
|
||||||
public function setCommand(string $command);
|
public function setCommand(string $command);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
*/
|
*/
|
||||||
class TaskScheduler implements ScheduleInterface
|
class TaskScheduler implements ScheduleInterface
|
||||||
{
|
{
|
||||||
public function __construct() {
|
public function __construct()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator abstract.
|
* Validator abstract.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator abstract.
|
* Validator abstract.
|
||||||
*
|
*
|
||||||
|
|
@ -72,8 +71,10 @@ abstract class CreditCard extends ValidatorAbstract
|
||||||
return ($total % 10 == 0) ? true : false;
|
return ($total % 10 == 0) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function luhnTest(string $num) {
|
public static function luhnTest(string $num)
|
||||||
|
{
|
||||||
$len = strlen($num);
|
$len = strlen($num);
|
||||||
|
$sum = 0;
|
||||||
|
|
||||||
for ($i = $len - 1; $i >= 0; $i--) {
|
for ($i = $len - 1; $i >= 0; $i--) {
|
||||||
$ord = ord($num[$i]);
|
$ord = ord($num[$i]);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator abstract.
|
* Validator abstract.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator abstract.
|
* Validator abstract.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator abstract.
|
* Validator abstract.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
namespace phpOMS\Validation;
|
namespace phpOMS\Validation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model validation trait.
|
* Model validation trait.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user