new pisilinux web sites

This commit is contained in:
Erkan IŞIK
2026-07-01 16:44:17 +03:00
commit b58488b586
21740 changed files with 2066209 additions and 0 deletions
@@ -0,0 +1,116 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Support;
use ZN\Compression\Exception\FileNotFoundException;
use ZN\Compression\DriverMappingAbstract;
class BzDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::func('bzopen', 'BZ');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password)
{
return false;
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
$open = bzopen($file, 'w');
if( empty($open) )
{
throw new FileNotFoundException(NULL, $file); // @codeCoverageIgnore
}
$return = bzwrite($open, $data, strlen($data));
bzclose($open);
return $return;
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
$open = bzopen($file, 'r');
if( empty($open) )
{
throw new FileNotFoundException(NULL, $file);
}
$return = bzread($open, 8096);
bzclose($open);
return $return;
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return bzcompress($data);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return bzdecompress($data);
}
}
@@ -0,0 +1,116 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Support;
use ZN\Compression\Exception\FileNotFoundException;
use ZN\Compression\DriverMappingAbstract;
class GzDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::func('gzopen', 'GZ');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password)
{
return false;
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
$open = gzopen($file, 'w');
if( empty($open) )
{
throw new FileNotFoundException(NULL, $file); // @codeCoverageIgnore
}
$return = gzwrite($open, $data, strlen($data));
gzclose($open);
return $return;
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
$open = gzopen($file, 'r');
if( empty($open) )
{
throw new FileNotFoundException(NULL, $file);
}
$return = gzread($open, 8096);
gzclose($open);
return $return;
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return gzcompress($data);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return gzuncompress($data);
}
}
@@ -0,0 +1,100 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Support;
use ZN\Compression\DriverMappingAbstract;
/**
* @codeCoverageIgnore
*/
class LzfDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::func('lzf_compress', 'LZF');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password)
{
return false;
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
$data = $this->do($data);
return file_put_contents($file, $data);
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
$content = file_get_contents($file);
return $this->undo($content);
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return lzf_compress($data);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return lzf_decompress($data);
}
}
@@ -0,0 +1,111 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Base;
use ZN\Support;
use ZN\Singleton;
use ZN\Compression\DriverMappingAbstract;
/**
* @codeCoverageIgnore
*/
class RarDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::func('rar_open', 'RAR');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password)
{
$rarFile = rar_open(Base::suffix($source, '.rar'), $password);
$list = rar_list($rarFile);
if( ! empty($list) ) foreach( $list as $file )
{
$entry = rar_entry_get($rarFile, $file);
$entry->extract($target);
}
else
{
return false;
}
rar_close($rarFile);
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->write($file, $data);
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->read($file);
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->do($data);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->undo($data);
}
}
@@ -0,0 +1,95 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Support;
use ZN\Singleton;
use ZN\Filesystem;
use ZN\Compression\DriverMappingAbstract;
class ZipDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::library('ZipArchive', 'ZIP Archive');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password = NULL)
{
return Filesystem\Forge::zipExtract($source, $target);
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->write($file, $data);
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->read($file);
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->do($data);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return Singleton::class('ZN\Compression\Drivers\GzDriver')->undo($data);
}
}
@@ -0,0 +1,97 @@
<?php namespace ZN\Compression\Drivers;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
use ZN\Support;
use ZN\Compression\DriverMappingAbstract;
class ZlibDriver extends DriverMappingAbstract
{
/**
* Magic constructor
*
* Checking if your driver is supported.
*
* @param void
*
* @return void
*/
public function __construct()
{
Support::func('zlib_encode', 'ZLIB');
}
/**
* Extract data
*
* @param string $source
* @param string $target = NULL
* @param string $password = NULL
*
* @return bool
*/
public function extract($source, $target, $password)
{
return false;
}
/**
* Write data to file
*
* @param string $file
* @param string $data
*
* @return bool
*/
public function write($file, $data)
{
$data = $this->do($data);
return file_put_contents($file, $data);
}
/**
* Read file
*
* @param string $file
*
* @return bool
*/
public function read($file)
{
$content = file_get_contents($file);
return $this->undo($content);
}
/**
* Force do
*
* @param string $data
*
* @return string
*/
public function do($data)
{
return zlib_encode($data, ZLIB_ENCODING_GZIP);
}
/**
* Force undo
*
* @param string $data
*
* @return string
*/
public function undo($data)
{
return zlib_decode($data);
}
}