Skip to content

Commit 2d08ffe

Browse files
Initial commit
0 parents  commit 2d08ffe

14 files changed

Lines changed: 538 additions & 0 deletions

File tree

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.yml]
18+
indent_size = 2

.gitattributes

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text eol=lf
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.c text
7+
*.h text
8+
9+
# Declare files that will always have CRLF line endings on checkout.
10+
*.sln text eol=crlf
11+
12+
# Denote all files that are truly binary and should not be modified.
13+
*.png binary
14+
*.jpg binary
15+
*.otf binary
16+
*.eot binary
17+
*.svg binary
18+
*.ttf binary
19+
*.woff binary
20+
*.woff2 binary
21+
22+
*.css linguist-vendored
23+
*.scss linguist-vendored
24+
*.js linguist-vendored
25+
CHANGELOG.md export-ignore

.github/workflows/php.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Validate composer.json and composer.lock
18+
run: composer validate
19+
20+
- name: Cache Composer packages
21+
id: composer-cache
22+
uses: actions/cache@v2
23+
with:
24+
path: vendor
25+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-php-
28+
29+
- name: Install dependencies
30+
if: steps.composer-cache.outputs.cache-hit != 'true'
31+
run: composer install --prefer-dist --no-progress --no-suggest
32+
33+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
34+
# Docs: https://getcomposer.org/doc/articles/scripts.md
35+
36+
# - name: Run test suite
37+
# run: composer run-script test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
composer.phar
3+
composer.lock
4+
.DS_Store

.styleci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
preset: psr2
2+
3+
enabled:
4+
- concat_with_spaces

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
sudo: false
2+
language: php
3+
4+
5+
php:
6+
# Versions of PHP you want your project run with.
7+
- 5.6
8+
- 7.0
9+
- 7.1
10+
- 7.2
11+
- 7.3
12+
- nightly
13+
14+
env:
15+
global:
16+
- setup=basic
17+
18+
matrix:
19+
fast_finish: true
20+
allow_failures:
21+
- php: nightly
22+
include:
23+
- php: 5.6
24+
env: setup=lowest
25+
- php: 5.6
26+
env: setup=stable
27+
28+
29+
before_install:
30+
- travis_retry composer self-update
31+
- travis_retry composer install --prefer-source --no-interaction
32+
- composer clear-cache
33+
34+
install:
35+
- if [[ $setup = 'basic' ]]; then travis_retry composer update --no-interaction --prefer-dist --no-suggest; fi
36+
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
37+
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi
38+
39+
script:
40+
41+
42+
after_script:
43+

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Spinzar
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Version management package for Laravel.
2+
[![Release](https://img.shields.io/github/v/release/spinzar/version?label=release)](https://github.com/spinzar/version/releases)
3+
![Downloads](https://img.shields.io/github/downloads/spinzar/version/total?label=downloads)
4+
[![Tests](https://img.shields.io/github/workflow/status/spinzar/version/Tests?label=tests)](https://github.com/spinzar/version/actions)
5+
[![License](https://img.shields.io/github/license/spinzar/version?label=license)](LICENSE.txt)
6+
7+
8+
9+
A [SemVer](http://semver.org) compatible version management package for softwares built on Laravel.
10+
11+
## Getting Started
12+
13+
### 1. Install
14+
15+
Run the following command:
16+
17+
```bash
18+
composer require spinzar/version
19+
```
20+
21+
### 2. Register (for Laravel < 5.5)
22+
23+
Register the service provider in `config/app.php`
24+
25+
```php
26+
Spinzar\Version\Provider::class,
27+
```
28+
29+
Add alias if you want to use the facade.
30+
31+
```php
32+
'Version' => Spinzar\Version\Facade::class,
33+
```
34+
35+
### 3. Publish
36+
37+
Publish config file.
38+
39+
```bash
40+
php artisan vendor:publish --tag=version
41+
```
42+
43+
44+
### 4. Configure
45+
46+
You can change the version information of your app from `config/version.php` file
47+
48+
## Usage
49+
50+
### version($method = null)
51+
52+
You can either enter the method like `version('short')` or leave it empty so you could firstly get the instance then call the methods like `version()->short()`
53+
54+
## Changelog
55+
56+
Please see [Releases](../../releases) for more information what has changed recently.
57+
58+
## Contributing
59+
60+
Pull requests are more than welcome. You must follow the PSR coding standards.
61+
62+
## Security
63+
64+
If you discover any security related issues, please email security@spinzar.co instead of using the issue tracker.
65+
66+
## Credits
67+
68+
- [Nassim Nasibullah](https://github.com/spinzar)
69+
- [All Contributors](../../contributors)
70+
71+
## License
72+
73+
The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

composer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "spinzar/version",
3+
"description": "Version management package for Laravel.",
4+
"keywords": [
5+
"laravel",
6+
"version"
7+
],
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "Nassim Nasibullah",
12+
"email": "info@spinzar.co",
13+
"homepage": "https://spinzar.co",
14+
"role": "Developer"
15+
}
16+
],
17+
"require": {
18+
"php": "^5.6.0|^7.0|^7.1|^7.2|^7.3|^7.4",
19+
"laravel/framework": "5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"Spinzar\\Version\\": "./src"
24+
},
25+
"files": [
26+
"src/helpers.php"
27+
]
28+
},
29+
"extra": {
30+
"laravel": {
31+
"providers": [
32+
"Spinzar\\Version\\Provider"
33+
],
34+
"aliases": {
35+
"Version": "Spinzar\\Version\\Facade"
36+
}
37+
}
38+
}
39+
}

src/Config/version.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
5+
'name' => 'Spinzar',
6+
7+
'code' => 'argon',
8+
9+
'major' => '1',
10+
11+
'minor' => '0',
12+
13+
'patch' => '0',
14+
15+
'build' => '',
16+
17+
'status' => 'Stable',
18+
19+
'date' => '02-November-2020',
20+
21+
'time' => '21:00',
22+
23+
'zone' => 'GMT +9',
24+
25+
];

0 commit comments

Comments
 (0)