Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
4
vendor/mehedi-iitdu/core-component-repository/.styleci.yml
vendored
Normal file
4
vendor/mehedi-iitdu/core-component-repository/.styleci.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
preset: laravel
|
||||
|
||||
disabled:
|
||||
- single_class_element_per_statement
|
||||
7
vendor/mehedi-iitdu/core-component-repository/CHANGELOG.md
vendored
Normal file
7
vendor/mehedi-iitdu/core-component-repository/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to `core-component-repository` will be documented in this file
|
||||
|
||||
## 1.0.0 - 201X-XX-XX
|
||||
|
||||
- initial release
|
||||
55
vendor/mehedi-iitdu/core-component-repository/CONTRIBUTING.md
vendored
Normal file
55
vendor/mehedi-iitdu/core-component-repository/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# Contributing
|
||||
|
||||
Contributions are **welcome** and will be fully **credited**.
|
||||
|
||||
Please read and understand the contribution guide before creating an issue or pull request.
|
||||
|
||||
## Etiquette
|
||||
|
||||
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
|
||||
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
|
||||
extremely unfair for them to suffer abuse or anger for their hard work.
|
||||
|
||||
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
|
||||
world that developers are civilized and selfless people.
|
||||
|
||||
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
|
||||
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
|
||||
|
||||
## Viability
|
||||
|
||||
When requesting or submitting new features, first consider whether it might be useful to others. Open
|
||||
source projects are used by many developers, who may have entirely different needs to your own. Think about
|
||||
whether or not your feature is likely to be used by other users of the project.
|
||||
|
||||
## Procedure
|
||||
|
||||
Before filing an issue:
|
||||
|
||||
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
|
||||
- Check to make sure your feature suggestion isn't already present within the project.
|
||||
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
|
||||
- Check the pull requests tab to ensure that the feature isn't already in progress.
|
||||
|
||||
Before submitting a pull request:
|
||||
|
||||
- Check the codebase to ensure that your feature doesn't already exist.
|
||||
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
|
||||
|
||||
## Requirements
|
||||
|
||||
If the project maintainer has any additional requirements, you will find them listed here.
|
||||
|
||||
- **[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](https://pear.php.net/package/PHP_CodeSniffer).
|
||||
|
||||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
|
||||
|
||||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
||||
|
||||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
|
||||
|
||||
- **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](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
|
||||
|
||||
**Happy coding**!
|
||||
21
vendor/mehedi-iitdu/core-component-repository/LICENSE.md
vendored
Normal file
21
vendor/mehedi-iitdu/core-component-repository/LICENSE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Mehedi Hasan
|
||||
|
||||
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.
|
||||
53
vendor/mehedi-iitdu/core-component-repository/README.md
vendored
Normal file
53
vendor/mehedi-iitdu/core-component-repository/README.md
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Very short description of the package
|
||||
|
||||
[](https://packagist.org/packages/mehedi-iitdu/core-component-repository)
|
||||
[](https://travis-ci.org/mehedi-iitdu/core-component-repository)
|
||||
[](https://scrutinizer-ci.com/g/mehedi-iitdu/core-component-repository)
|
||||
[](https://packagist.org/packages/mehedi-iitdu/core-component-repository)
|
||||
|
||||
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
|
||||
|
||||
## Installation
|
||||
|
||||
You can install the package via composer:
|
||||
|
||||
```bash
|
||||
composer require mehedi-iitdu/core-component-repository
|
||||
```
|
||||
|
||||
## Usage
|
||||
Add this line under providers array in config/app.php
|
||||
``` php
|
||||
MehediIitdu\CoreComponentRepository\CoreComponentRepositoryServiceProvider::class
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
``` bash
|
||||
composer test
|
||||
```
|
||||
|
||||
### Changelog
|
||||
|
||||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
|
||||
|
||||
### Security
|
||||
|
||||
If you discover any security related issues, please email bsse0607@iit.du.ac.bd instead of using the issue tracker.
|
||||
|
||||
## Credits
|
||||
|
||||
- [Mehedi Hasan](https://github.com/mehedi-iitdu)
|
||||
- [All Contributors](../../contributors)
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
||||
|
||||
## Laravel Package Boilerplate
|
||||
|
||||
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).
|
||||
57
vendor/mehedi-iitdu/core-component-repository/composer.json
vendored
Normal file
57
vendor/mehedi-iitdu/core-component-repository/composer.json
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "mehedi-iitdu/core-component-repository",
|
||||
"description": "My awesome package",
|
||||
"keywords": [
|
||||
"mehedi-iitdu",
|
||||
"core-component-repository"
|
||||
],
|
||||
"homepage": "https://github.com/mehedi-iitdu/core-component-repository",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mehedi Hasan",
|
||||
"email": "bsse0607@iit.du.ac.bd",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"illuminate/support": "*"
|
||||
},
|
||||
"require-dev":{
|
||||
"phpunit/phpunit" : "*",
|
||||
"scrutinizer/ocular": "~1.1",
|
||||
"satooshi/php-coveralls": "^0.7.0",
|
||||
"mockery/mockery": ">=0.7.2",
|
||||
"phpspec/phpspec": "~2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"MehediIitdu\\CoreComponentRepository\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"MehediIitdu\\CoreComponentRepository\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit",
|
||||
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
|
||||
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"MehediIitdu\\CoreComponentRepository\\CoreComponentRepositoryServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"CoreComponentRepository": "MehediIitdu\\CoreComponentRepository\\CoreComponentRepositoryFacade"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
vendor/mehedi-iitdu/core-component-repository/config/config.php
vendored
Normal file
8
vendor/mehedi-iitdu/core-component-repository/config/config.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* You can place your custom package configuration in here.
|
||||
*/
|
||||
return [
|
||||
|
||||
];
|
||||
82
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepository.php
vendored
Normal file
82
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepository.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace MehediIitdu\CoreComponentRepository;
|
||||
use App\Models\Addon;
|
||||
use Cache;
|
||||
|
||||
class CoreComponentRepository
|
||||
{
|
||||
public static function instantiateShopRepository() {
|
||||
$data['url'] = $_SERVER['SERVER_NAME'];
|
||||
$request_data_json = json_encode($data);
|
||||
$gate = "https://activation.activeitzone.com/check_activation";
|
||||
$rn = self::serializeObjectResponse($gate, $request_data_json);
|
||||
self::finalizeRepository($rn);
|
||||
}
|
||||
|
||||
protected static function serializeObjectResponse($zn, $request_data_json) {
|
||||
$header = array(
|
||||
'Content-Type:application/json'
|
||||
);
|
||||
$stream = curl_init();
|
||||
|
||||
curl_setopt($stream, CURLOPT_URL, $zn);
|
||||
curl_setopt($stream, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt($stream, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($stream, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($stream, CURLOPT_POSTFIELDS, $request_data_json);
|
||||
curl_setopt($stream, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($stream, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||
|
||||
$rn = curl_exec($stream);
|
||||
curl_close($stream);
|
||||
return $rn;
|
||||
}
|
||||
|
||||
protected static function finalizeRepository($rn) {
|
||||
if($rn == "bad" && env('DEMO_MODE') != 'On') {
|
||||
return redirect('https://activeitzone.com/activation/')->send();
|
||||
}
|
||||
}
|
||||
|
||||
public static function initializeCache() {
|
||||
foreach(Addon::all() as $addon){
|
||||
if ($addon->purchase_code == null) {
|
||||
self::finalizeCache($addon);
|
||||
}
|
||||
$item_name = get_setting('item_name') ?? 'ecommerce';
|
||||
|
||||
if(Cache::get($addon->unique_identifier.'-purchased', 'no') == 'no'){
|
||||
try {
|
||||
$gate = "https://activeitzone.com/activation/addon_check/".$addon->unique_identifier."/".$addon->purchase_code."/".$item_name;
|
||||
|
||||
$stream = curl_init();
|
||||
curl_setopt($stream, CURLOPT_URL, $gate);
|
||||
curl_setopt($stream, CURLOPT_HEADER, 0);
|
||||
curl_setopt($stream, CURLOPT_RETURNTRANSFER, 1);
|
||||
$rn = curl_exec($stream);
|
||||
curl_close($stream);
|
||||
|
||||
if($rn == 'no') {
|
||||
self::finalizeCache($addon);
|
||||
}
|
||||
else{
|
||||
Cache::rememberForever($addon->unique_identifier.'-purchased', function () {
|
||||
return 'yes';
|
||||
});
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function finalizeCache($addon){
|
||||
$addon->activated = 0;
|
||||
$addon->save();
|
||||
|
||||
flash('Please reinstall '.$addon->name.' using valid purchase code')->warning();
|
||||
return redirect()->route('addons.index')->send();
|
||||
}
|
||||
}
|
||||
21
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepositoryFacade.php
vendored
Normal file
21
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepositoryFacade.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace MehediIitdu\CoreComponentRepository;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @see \MehediIitdu\CoreComponentRepository\Skeleton\SkeletonClass
|
||||
*/
|
||||
class CoreComponentRepositoryFacade extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'core-component-repository';
|
||||
}
|
||||
}
|
||||
60
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepositoryServiceProvider.php
vendored
Normal file
60
vendor/mehedi-iitdu/core-component-repository/src/CoreComponentRepositoryServiceProvider.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace MehediIitdu\CoreComponentRepository;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class CoreComponentRepositoryServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
/*
|
||||
* Optional methods to load your package assets
|
||||
*/
|
||||
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'core-component-repository');
|
||||
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'core-component-repository');
|
||||
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
|
||||
// $this->loadRoutesFrom(__DIR__.'/routes/web.php');
|
||||
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->publishes([
|
||||
__DIR__.'/../config/config.php' => config_path('core-component-repository.php'),
|
||||
], 'config');
|
||||
|
||||
// Publishing the views.
|
||||
/*$this->publishes([
|
||||
__DIR__.'/../resources/views' => resource_path('views/vendor/core-component-repository'),
|
||||
], 'views');*/
|
||||
|
||||
// Publishing assets.
|
||||
/*$this->publishes([
|
||||
__DIR__.'/../resources/assets' => public_path('vendor/core-component-repository'),
|
||||
], 'assets');*/
|
||||
|
||||
// Publishing the translation files.
|
||||
/*$this->publishes([
|
||||
__DIR__.'/../resources/lang' => resource_path('lang/vendor/core-component-repository'),
|
||||
], 'lang');*/
|
||||
|
||||
// Registering package commands.
|
||||
// $this->commands([]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// Automatically apply the package configuration
|
||||
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'core-component-repository');
|
||||
|
||||
// Register the main class to use with the facade
|
||||
$this->app->singleton('core-component-repository', function () {
|
||||
return new CoreComponentRepository;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user