Skip to content

Commit

Permalink
Trying upload all project files
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodanilojr committed Feb 21, 2020
0 parents commit 3b6504a
Show file tree
Hide file tree
Showing 14 changed files with 667 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/sergiodanilojr/zipper).

## Pull Requests

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **Document any change in behaviour** - Make sure the README and any other relevant documentation are kept up-to-date.
- **Create topic branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

**We're Together**!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Sérgio Danilo Jr. @sergiodanilojr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
156 changes: 156 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# zipper Name

[![Maintainer](http://img.shields.io/badge/[email protected]?style=flat-square)](https://twitter.com/sergiodanilojr)
[![Source Code](http://img.shields.io/badge/source-sergiodanilojr/zipper-blue.svg?style=flat-square)](https://github.com/sergiodanilojr/zipper)
[![PHP from Packagist](https://img.shields.io/packagist/php-v/sergiodanilojr/zipper.svg?style=flat-square)](https://packagist.org/packages/sergiodanilojr/zipper)
[![Latest Version](https://img.shields.io/github/release/sergiodanilojr/zipper.svg?style=flat-square)](https://github.com/sergiodanilojr/zipper/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build](https://img.shields.io/scrutinizer/build/g/sergiodanilojr/zipper.svg?style=flat-square)](https://scrutinizer-ci.com/g/sergiodanilojr/zipper)
[![Quality Score](https://img.shields.io/scrutinizer/g/sergiodanilojr/zipper.svg?style=flat-square)](https://scrutinizer-ci.com/g/sergiodanilojr/zipper)
[![Total Downloads](https://img.shields.io/packagist/dt/sergiodanilojr/zipper.svg?style=flat-square)](https://packagist.org/packages/csergiodanilojr/zipper)

###### Zipper is a facilitator for creating Zip Files in an uncomplicated way, with features of Download, insertion of License and Extraction Files and Creation of Zipping with multiples in one!

Zipper é um facilitador para criação de Arquivos Zip de maneira descomplicada, contando com recursos de Download, inserção de Arquvios de Licença e Extração e Criação de Zipagem com múltiplos em um só!

Você pode saber mais **[clicando aqui](https://www.sergiodanilojr.com.br/componentes/zipper)**.

### Highlights

- Hall of Highlights
- Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)

## Installation

Zipper is available via Composer:

```bash
"sergiodanilojr/zipper": "^1.0"
```

or run

```bash
composer require sergiodanilojr/zipper
```

## Documentation

###### For details on how to use, see a sample folder in the zipper directory. In it you will have an example of use for each class. It works like this:

Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do zipper. Nela terá um exemplo de uso para cada classe. Ele funciona assim:

#### Zipper for a single File

```php
<?php
require __DIR__ . "/vendor/autoload.php";

use SergioDaniloJr\Zipper\Zipper;

$zipper = new Zipper();

$fileExample = __DIR__."/assets/files/example-file.txt";

$single = $zipper->zipFile($fileExample);

//It'll bring the way of the zip File
echo $single;



```

#### Zipper for Several Files

```php
<?php
require __DIR__ . "/vendor/autoload.php";

use SergioDaniloJr\Zipper\Zipper;

$zipper = new Zipper();

$fileOne = __DIR__."/assets/files/example-file.txt";
$fileTwo = __DIR__."/assets/files/example-file-two.txt";

$files = [
$fileOne,
$fileTwo
];

//Here I'll set a new folder that not exists yet.
$path = __DIR__."/assets/files/ZipperFiles";

$several = $zipper->zipFiles($files, "MadeWithZipper", $path);

echo $several;

```


#### Zipper for Extract File

```php
<?php
require __DIR__ . "/vendor/autoload.php";

use SergioDaniloJr\Zipper\Zipper;

$zipper = new Zipper();

$fileToExtract = __DIR__ . "/assets/files/MadeWithZipper.zip";

//Here I'll set a new folder that not exists yet. But You can set a existent folder.
$destiny = __DIR__ . "/assets/files/Storage";

$extracted = $zipper->extract($fileToExtract,$destiny);

echo $extracted;

```


#### Zipper for Download a File zipped

```php
<?php
require __DIR__ . "/vendor/autoload.php";

use SergioDaniloJr\Zipper\Zipper;

$zipper = new Zipper();

$fileExample = __DIR__ . "/assets/files/example-file.txt";

//This method don't return, obvly, a way!
$zipper->download($fileExample);

```

### Others

###### Here is possible write about others explanations...

Aqui você pode mencionar outras características do zipper

## Contributing

Please see [CONTRIBUTING](https://github.com/sergiodanilojr/zipper/blob/master/CONTRIBUTING.md) for details.

## Support

###### Security: If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Se você descobrir algum problema relacionado à segurança, envie um e-mail para [email protected] em vez de usar o rastreador de problemas.

Thank you

## Credits

- [Sérgio Danilo Jr.](https://github.com/sergiodanilojr) (Developer)
- [All Contributors](https://github.com/sergiodanilojr/zipper/contributors)

## License

The MIT License (MIT). Please see [License File](https://github.com/sergiodanilojr/zipper/blob/master/LICENSE) for more information.
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "sergiodanilojr/zipper",
"description": "Zipper é um facilitador para criação de Arquivos Zip de maneira descomplicada, contando com recursos de Download, inserção de Arquvios de Licença e Extração e Criação de Zipagem com múltiplos arquivos em um só!",
"keywords": [
"Sérgio Danilo Jr",
"zip",
"zipper",
"rar"
],
"license": "MIT",
"authors": [
{
"name": "Sérgio Danilo Jr.",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^7.1",
"ext-zip": "*"
},
"autoload": {
"psr-4": {
"SergioDaniloJr\\Zipper\\": "src"
}
}
}
33 changes: 33 additions & 0 deletions example/assets/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* @author Sérgio Danilo Jr. <https://www.sergiodanilojr.com.br>
*
* Document content and charset
*/
header("Content-Type: text/html; charset=utf-8");

/**
* [ PHP Basic Config ] Configurações basicas do sistema
* Configura o timezone da aplicação
*/
date_default_timezone_set("America/Sao_Paulo");

ini_set("display_errors", 1);
ini_set("error_reporting", E_ALL);
ini_set('xdebug.overload_var_dump', 1);


/**
* [ php config ] Altera modo de erro e exibição do var_dump.
* display_errors: Erros devem ser exibidos.
* error_reporting: Todos os tipos de erros
* overload_var_dump: Omitir a linha de caminho do var_dump.
*/
ini_set("display_errors", 1);
ini_set("error_reporting", E_ALL);
ini_set('xdebug.overload_var_dump', 1);

/**
* [ interface ] Style
*/
echo "<link rel=\"stylesheet\" href=\"assets/style.css\"/>";
Binary file added example/assets/files/MadeWithZipper.zip
Binary file not shown.
1 change: 1 addition & 0 deletions example/assets/files/example-file-two.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mussum Ipsum, cacilds vidis litro abertis. Em pé sem cair, deitado sem dormir, sentado sem cochilar e fazendo pose. Nullam volutpat risus nec leo commodo, ut interdum diam laoreet. Sed non consequat odio. Paisis, filhis, espiritis santis. Interagi no mé, cursus quis, vehicula ac nisi.
1 change: 1 addition & 0 deletions example/assets/files/example-file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mussum Ipsum, cacilds vidis litro abertis. Em pé sem cair, deitado sem dormir, sentado sem cochilar e fazendo pose. Nullam volutpat risus nec leo commodo, ut interdum diam laoreet. Sed non consequat odio. Paisis, filhis, espiritis santis. Interagi no mé, cursus quis, vehicula ac nisi.
108 changes: 108 additions & 0 deletions example/assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
Full Stack PHP Developer Console CSS
*/
@import url('https://fonts.googleapis.com/css?family=Open+sans|Source+Code+Pro');

:root {
--fsphp: #1F2026;
--fsline: #475163;
--green: #35ba9b;
--blue: #3aadd9;
--yellow: #f5b945;
--red: #d94452;
}

* {
margin: 0;
padding: 0;
font-family: "Source Code Pro", serif;
}

body {
padding: 30px 30px 0 30px;
font-family: "Source Code Pro", serif;
overflow-x: hidden;
color: #333333;
}

h1, h2, h3, h4, h5, h6, p, article, pre {
margin: 20px 0;
padding-left: 10px;
border-left: 5px solid var(--fsline);
}

p {
font-size: 0.875em;
margin: 10px 0;
}

.error {
color: var(--red);
font-size: 0.9em;
font-weight: bold;
padding: 15px;
border: 1px solid var(--red);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
margin: 0 0 20px 0;
}

form {
margin-bottom: 30px;
padding: 20px;
background-color: rgba(0, 0, 0, 0.05);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border-left: 5px solid var(--fsline);
}

form input {
display: block;
width: 100%;
padding: 8px;
font-size: 0.875em;
font-family: "Open Sans", serif;
border: 1px solid var(--fsline);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
margin: 10px 0;
}

form button {
border: none;
display: block;
width: 100%;
padding: 10px;
font-size: 1em;
font-weight: bold;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
margin: 20px 0 0 0;
transition-duration: 0.2s;
cursor: pointer;
}

form button:hover {
color: #FFFFFF;
background-color: var(--green);
}

.xdebug-var-dump {
font-size: 0.8em !important;
overflow: auto;
background: rgba(0, 0, 0, 0.05);
margin: 0 0 30px 0;
padding: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}

.xdebug-var-dump * {
font-family: "Source Code Pro", serif;
margin: 0;
}
13 changes: 13 additions & 0 deletions example/download.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require __DIR__ . "/assets/config.php";
require __DIR__ . "single-file.php";
require __DIR__ . "/vendor/autoload.php";

use SergioDaniloJr\Zipper\Zipper;

$zipper = new Zipper();

$fileExample = __DIR__ . "/assets/files/example-file.txt";

//This method don't return, obvly, a way!
$zipper->download($fileExample);
Loading

0 comments on commit 3b6504a

Please sign in to comment.