reklama
This commit is contained in:
parent
3f58ba0dfc
commit
ac002c1ac1
|
|
@ -1,5 +1,4 @@
|
|||
# Composer ignores
|
||||
/vendor
|
||||
composer.phar
|
||||
composer.lock
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'driver' => 'file',
|
||||
'driver' => 'cookie',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ use Form;
|
|||
use Log;
|
||||
use App;
|
||||
use Twig;
|
||||
use ReCaptcha\ReCaptcha;
|
||||
|
||||
|
||||
class SmallContactForm extends ComponentBase
|
||||
{
|
||||
|
|
@ -310,6 +312,7 @@ class SmallContactForm extends ComponentBase
|
|||
|
||||
if( !empty($this->post['_form_created']) ) {
|
||||
|
||||
try {
|
||||
$delay = ( Settings::getTranslated('antispam_delay') ? intval(Settings::getTranslated('antispam_delay')) : intval(e(trans('janvince.smallcontactform::lang.settings.antispam.antispam_delay_placeholder'))) );
|
||||
|
||||
if(!$delay) {
|
||||
|
|
@ -318,25 +321,44 @@ class SmallContactForm extends ComponentBase
|
|||
|
||||
$formCreatedTime = strtr(Input::get('_form_created'), 'jihgfedcba', '0123456789');
|
||||
|
||||
$this->post['_form_created'] = intval($formCreatedTime + $delay);
|
||||
$this->post['_form_created'] = intval($formCreatedTime) + $delay;
|
||||
|
||||
$this->validationRules['_form_created'] = 'numeric|max:' . time();
|
||||
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
Log::error($e->getMessage());
|
||||
$errors[] = e(trans('janvince.smallcontactform::lang.settings.antispam.antispam_delay_error_msg_placeholder'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// reCaptcha validation if enabled
|
||||
if( Settings::getTranslated('add_google_recaptcha') ) {
|
||||
|
||||
if(Settings::getTranslated('add_google_recaptcha'))
|
||||
{
|
||||
try {
|
||||
$response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".Settings::get('google_recaptcha_secret_key')."&response=".post('g-recaptcha-response')."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
|
||||
} catch(\Exception $e) {
|
||||
/**
|
||||
* Text if allow_url_fopen is disabled
|
||||
*/
|
||||
if (!ini_get('allow_url_fopen'))
|
||||
{
|
||||
$recaptcha = new ReCaptcha(Settings::get('google_recaptcha_secret_key'), new \ReCaptcha\RequestMethod\SocketPost());
|
||||
}
|
||||
else {
|
||||
// allow_url_fopen = On
|
||||
$recaptcha = new ReCaptcha(Settings::get('google_recaptcha_secret_key'));
|
||||
}
|
||||
|
||||
$response = $recaptcha->setExpectedHostname($_SERVER['SERVER_NAME'])->verify(post('g-recaptcha-response'), $_SERVER['REMOTE_ADDR']);
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
Log::error($e->getMessage());
|
||||
$errors[] = e(trans('janvince.smallcontactform::lang.settings.antispam.google_recaptcha_error_msg_placeholder'));
|
||||
}
|
||||
|
||||
if(empty($response['success'])) {
|
||||
if(!$response->isSuccess()) {
|
||||
$errors[] = ( Settings::getTranslated('google_recaptcha_error_msg') ? Settings::getTranslated('google_recaptcha_error_msg') : e(trans('janvince.smallcontactform::lang.settings.antispam.google_recaptcha_error_msg_placeholder')));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,3 +233,12 @@
|
|||
- Removed uploads array from default fields sent to autoreply template
|
||||
1.51.2:
|
||||
- Fixed uploads field in email messages
|
||||
1.51.3:
|
||||
- Changed size of database column url (thanks zlobec)
|
||||
- scf_tables_05.php
|
||||
1.51.4:
|
||||
- Fixed passive antispam delay validation
|
||||
1.52.0:
|
||||
- Changed reCaptcha validation to work with allow_url_fopen disabled
|
||||
1.52.1:
|
||||
- Fixed project git files
|
||||
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit09b213e01e94cc60dfc52fd1d9c7122e::getLoader();
|
||||
return ComposerAutoloaderInit27d394c7526e9a74451bd4dc314fca57::getLoader();
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'ReCaptcha\\' => array($vendorDir . '/google/recaptcha/src/ReCaptcha'),
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit09b213e01e94cc60dfc52fd1d9c7122e
|
||||
class ComposerAutoloaderInit27d394c7526e9a74451bd4dc314fca57
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
|
@ -19,15 +19,15 @@ class ComposerAutoloaderInit09b213e01e94cc60dfc52fd1d9c7122e
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit09b213e01e94cc60dfc52fd1d9c7122e', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit27d394c7526e9a74451bd4dc314fca57', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit09b213e01e94cc60dfc52fd1d9c7122e', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit27d394c7526e9a74451bd4dc314fca57', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit27d394c7526e9a74451bd4dc314fca57::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,13 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e
|
||||
class ComposerStaticInit27d394c7526e9a74451bd4dc314fca57
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'R' =>
|
||||
array (
|
||||
'ReCaptcha\\' => 10,
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Composer\\Installers\\' => 20,
|
||||
|
|
@ -14,6 +18,10 @@ class ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e
|
|||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'ReCaptcha\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha',
|
||||
),
|
||||
'Composer\\Installers\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
||||
|
|
@ -23,8 +31,8 @@ class ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit09b213e01e94cc60dfc52fd1d9c7122e::$prefixDirsPsr4;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit27d394c7526e9a74451bd4dc314fca57::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit27d394c7526e9a74451bd4dc314fca57::$prefixDirsPsr4;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,5 +131,54 @@
|
|||
"zend",
|
||||
"zikula"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "google/recaptcha",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/google/recaptcha.git",
|
||||
"reference": "f911286ad361c9fba1b422c07f040852c0c193a3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/google/recaptcha/zipball/f911286ad361c9fba1b422c07f040852c0c193a3",
|
||||
"reference": "f911286ad361c9fba1b422c07f040852c0c193a3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.2.20|^2.15",
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11"
|
||||
},
|
||||
"time": "2020-10-01T15:14:41+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ReCaptcha\\": "src/ReCaptcha"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.",
|
||||
"homepage": "https://www.google.com/recaptcha/",
|
||||
"keywords": [
|
||||
"Abuse",
|
||||
"captcha",
|
||||
"recaptcha",
|
||||
"spam"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Categories extends ComponentBase
|
|||
*/
|
||||
protected function loadCategories()
|
||||
{
|
||||
$categories = BlogCategory::with('posts_count')->getNested();
|
||||
$categories = BlogCategory::where('status',1)->with('posts_count')->getNested();
|
||||
if (!$this->property('displayEmpty')) {
|
||||
$iterator = function ($categories) use (&$iterator) {
|
||||
return $categories->reject(function ($category) use (&$iterator) {
|
||||
|
|
|
|||
|
|
@ -60,11 +60,12 @@ class Post extends ComponentBase
|
|||
Event::listen('translate.localePicker.translateParams', function ($page, $params, $oldLocale, $newLocale) {
|
||||
$newParams = $params;
|
||||
|
||||
if (isset($params['slug'])) {
|
||||
$records = BlogPost::transWhere('slug', $params['slug'], $oldLocale)->first();
|
||||
if (isset($params['id'])) {
|
||||
$records = BlogPost::where('locale',$newLocale)->where('id_'.$oldLocale,$params['id'])->first();
|
||||
if ($records) {
|
||||
$records->translateContext($newLocale);
|
||||
// $records->translateContext($newLocale);
|
||||
$newParams['slug'] = $records['slug'];
|
||||
$newParams['id'] = $records['id'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class Posts extends ComponentBase
|
|||
'page' => $this->property('pageNumber'),
|
||||
'sort' => $this->property('sortOrder'),
|
||||
'perPage' => $this->property('postsPerPage'),
|
||||
'search' => trim(input('search')),
|
||||
'search' => trim(input('q')),
|
||||
'category' => $category,
|
||||
'date' => input('date'),
|
||||
'published' => $isPublished,
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class Category extends Model
|
|||
'items' => []
|
||||
];
|
||||
|
||||
$categories = self::orderBy('name')->get();
|
||||
$categories = self::where('status',1)->orderBy('nest_left')->get();
|
||||
foreach ($categories as $category) {
|
||||
$categoryItem = [
|
||||
'title' => $category->name,
|
||||
|
|
|
|||
|
|
@ -91,6 +91,13 @@ class Post extends Model
|
|||
'RainLab\Blog\Models\Category',
|
||||
'table' => 'rainlab_blog_posts_categories',
|
||||
'order' => 'name'
|
||||
],
|
||||
|
||||
'active_categories' => [
|
||||
'RainLab\Blog\Models\Category',
|
||||
'table' => 'rainlab_blog_posts_categories',
|
||||
'conditions' => 'status = 1',
|
||||
'order' => 'name'
|
||||
]
|
||||
];
|
||||
|
||||
|
|
@ -221,6 +228,7 @@ class Post extends Model
|
|||
->where('published', true)
|
||||
->whereNotNull('published_at')
|
||||
->where('published_at', '<', Carbon::now())
|
||||
->where('locale',App::getLocale())
|
||||
;
|
||||
}
|
||||
|
||||
|
|
@ -417,6 +425,19 @@ class Post extends Model
|
|||
return Html::limit($content, 280);
|
||||
}
|
||||
|
||||
public function getTranslatedPostAttribute(){
|
||||
if($this->locale === 'en')
|
||||
return $this->id_ru;
|
||||
return $this->id_en;
|
||||
}
|
||||
|
||||
public function setTranslatedPostAttribute($value){
|
||||
|
||||
if($this->attributes['locale'] === 'en')
|
||||
$this->attributes['id_ru'] = $value;
|
||||
else
|
||||
$this->attributes['id_en'] = $value;
|
||||
}
|
||||
//
|
||||
// Next / Previous
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
# ===================================
|
||||
# Field Definitions
|
||||
# ===================================
|
||||
|
||||
fields:
|
||||
|
||||
name:
|
||||
label: rainlab.blog::lang.category.name
|
||||
placeholder: rainlab.blog::lang.category.name_placeholder
|
||||
label: 'rainlab.blog::lang.category.name'
|
||||
placeholder: 'rainlab.blog::lang.category.name_placeholder'
|
||||
span: left
|
||||
|
||||
type: text
|
||||
slug:
|
||||
label: rainlab.blog::lang.category.slug
|
||||
label: 'rainlab.blog::lang.category.slug'
|
||||
span: right
|
||||
placeholder: rainlab.blog::lang.category.slug_placeholder
|
||||
placeholder: 'rainlab.blog::lang.category.slug_placeholder'
|
||||
preset: name
|
||||
|
||||
type: text
|
||||
description:
|
||||
label: 'rainlab.blog::lang.category.description'
|
||||
size: large
|
||||
oc.commentPosition: ''
|
||||
span: full
|
||||
type: textarea
|
||||
status:
|
||||
label: Status
|
||||
span: right
|
||||
type: checkbox
|
||||
comment: 'Active, disabled (disabled category does not appear on menu)'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@ columns:
|
|||
select: name
|
||||
searchable: true
|
||||
sortable: false
|
||||
locale:
|
||||
label: Language
|
||||
|
||||
views:
|
||||
label: Views
|
||||
created_at:
|
||||
label: rainlab.blog::lang.post.created
|
||||
type: date
|
||||
|
|
|
|||
|
|
@ -35,15 +35,20 @@ secondaryTabs:
|
|||
locale:
|
||||
tab: rainlab.blog::lang.post.tab_categories
|
||||
label: Language of Post
|
||||
span: storm
|
||||
cssClass: col-md-12
|
||||
span: left
|
||||
type: dropdown
|
||||
default: ru
|
||||
options:
|
||||
ru: Russian
|
||||
en: English
|
||||
|
||||
categories:
|
||||
translated_post:
|
||||
label: Translated Post id
|
||||
type: number
|
||||
tab: rainlab.blog::lang.post.tab_categories
|
||||
span: right
|
||||
|
||||
active_categories:
|
||||
tab: rainlab.blog::lang.post.tab_categories
|
||||
type: relation
|
||||
commentAbove: rainlab.blog::lang.post.categories_comment
|
||||
|
|
|
|||
|
|
@ -1,62 +1,71 @@
|
|||
1.0.1:
|
||||
- Initialize plugin.
|
||||
- 'Initialize plugin.'
|
||||
- create_posts_table.php
|
||||
- create_categories_table.php
|
||||
- seed_all_tables.php
|
||||
1.0.2: Added the processed HTML content column to the posts table.
|
||||
1.0.3: Category component has been merged with Posts component.
|
||||
1.0.4: Improvements to the Posts list management UI.
|
||||
1.0.5: Removes the Author column from blog post list.
|
||||
1.0.6: Featured images now appear in the Post component.
|
||||
1.0.7: Added support for the Static Pages menus.
|
||||
1.0.8: Added total posts to category list.
|
||||
1.0.9: Added support for the Sitemap plugin.
|
||||
1.0.10: Added permission to prevent users from seeing posts they did not create.
|
||||
1.0.11: Deprecate "idParam" component property in favour of "slug" property.
|
||||
1.0.12: Fixes issue where images cannot be uploaded caused by latest Markdown library.
|
||||
1.0.13: Fixes problem with providing pages to Sitemap and Pages plugins.
|
||||
1.0.14: Add support for CSRF protection feature added to core.
|
||||
1.1.0: Replaced the Post editor with the new core Markdown editor.
|
||||
1.1.1: Posts can now be imported and exported.
|
||||
1.1.2: Posts are no longer visible if the published date has not passed.
|
||||
1.1.3: Added a New Post shortcut button to the blog menu.
|
||||
1.0.2: 'Added the processed HTML content column to the posts table.'
|
||||
1.0.3: 'Category component has been merged with Posts component.'
|
||||
1.0.4: 'Improvements to the Posts list management UI.'
|
||||
1.0.5: 'Removes the Author column from blog post list.'
|
||||
1.0.6: 'Featured images now appear in the Post component.'
|
||||
1.0.7: 'Added support for the Static Pages menus.'
|
||||
1.0.8: 'Added total posts to category list.'
|
||||
1.0.9: 'Added support for the Sitemap plugin.'
|
||||
1.0.10: 'Added permission to prevent users from seeing posts they did not create.'
|
||||
1.0.11: 'Deprecate "idParam" component property in favour of "slug" property.'
|
||||
1.0.12: 'Fixes issue where images cannot be uploaded caused by latest Markdown library.'
|
||||
1.0.13: 'Fixes problem with providing pages to Sitemap and Pages plugins.'
|
||||
1.0.14: 'Add support for CSRF protection feature added to core.'
|
||||
1.1.0: 'Replaced the Post editor with the new core Markdown editor.'
|
||||
1.1.1: 'Posts can now be imported and exported.'
|
||||
1.1.2: 'Posts are no longer visible if the published date has not passed.'
|
||||
1.1.3: 'Added a New Post shortcut button to the blog menu.'
|
||||
1.2.0:
|
||||
- Categories now support nesting.
|
||||
- 'Categories now support nesting.'
|
||||
- categories_add_nested_fields.php
|
||||
1.2.1: Post slugs now must be unique.
|
||||
1.2.2: Fixes issue on new installs.
|
||||
1.2.3: Minor user interface update.
|
||||
1.2.1: 'Post slugs now must be unique.'
|
||||
1.2.2: 'Fixes issue on new installs.'
|
||||
1.2.3: 'Minor user interface update.'
|
||||
1.2.4:
|
||||
- Database maintenance. Updated all timestamp columns to be nullable.
|
||||
- 'Database maintenance. Updated all timestamp columns to be nullable.'
|
||||
- update_timestamp_nullable.php
|
||||
1.2.5: Added translation support for blog posts.
|
||||
1.2.6: The published field can now supply a time with the date.
|
||||
1.2.7: Introduced a new RSS feed component.
|
||||
1.2.8: Fixes issue with translated `content_html` attribute on blog posts.
|
||||
1.2.9: Added translation support for blog categories.
|
||||
1.2.10: Added translation support for post slugs.
|
||||
1.2.11: Fixes bug where excerpt is not translated.
|
||||
1.2.12: Description field added to category form.
|
||||
1.2.13: Improved support for Static Pages menus, added a blog post and all blog posts.
|
||||
1.2.14: Added post exception property to the post list component, useful for showing related posts.
|
||||
1.2.15: Back-end navigation sort order updated.
|
||||
1.2.16: Added `nextPost` and `previousPost` to the blog post component.
|
||||
1.2.17: Improved the next and previous logic to sort by the published date.
|
||||
1.2.18: Minor change to internals.
|
||||
1.2.19: Improved support for Build 420+
|
||||
1.2.5: 'Added translation support for blog posts.'
|
||||
1.2.6: 'The published field can now supply a time with the date.'
|
||||
1.2.7: 'Introduced a new RSS feed component.'
|
||||
1.2.8: 'Fixes issue with translated `content_html` attribute on blog posts.'
|
||||
1.2.9: 'Added translation support for blog categories.'
|
||||
1.2.10: 'Added translation support for post slugs.'
|
||||
1.2.11: 'Fixes bug where excerpt is not translated.'
|
||||
1.2.12: 'Description field added to category form.'
|
||||
1.2.13: 'Improved support for Static Pages menus, added a blog post and all blog posts.'
|
||||
1.2.14: 'Added post exception property to the post list component, useful for showing related posts.'
|
||||
1.2.15: 'Back-end navigation sort order updated.'
|
||||
1.2.16: 'Added `nextPost` and `previousPost` to the blog post component.'
|
||||
1.2.17: 'Improved the next and previous logic to sort by the published date.'
|
||||
1.2.18: 'Minor change to internals.'
|
||||
1.2.19: 'Improved support for Build 420+'
|
||||
1.3.0:
|
||||
- Added metadata column for plugins to store data in
|
||||
- 'Added metadata column for plugins to store data in'
|
||||
- posts_add_metadata.php
|
||||
1.3.1: Fixed metadata column not being jsonable
|
||||
1.3.2: Allow custom slug name for components, add 404 handling for missing blog posts, allow exporting of blog images.
|
||||
1.3.3: Fixed 'excluded categories' filter from being run when value is empty.
|
||||
1.3.4: Allow post author to be specified. Improved translations.
|
||||
1.3.5: Fixed missing user info from breaking initial seeder in migrations. Fixed a PostgreSQL issue with blog exports.
|
||||
1.3.6: Improved French translations.
|
||||
1.4.0: Stability improvements. Rollback custom slug names for components
|
||||
1.4.1: Fixes potential security issue with unsafe Markdown. Allow blog bylines to be translated.
|
||||
1.4.2: Fix 404 redirects for missing blog posts. Assign current category to the listed posts when using the Posts component on a page with the category parameter available.
|
||||
1.4.3: Fixes incompatibility with locale switching when plugin is used in conjunction with the Translate plugin. Fixes undefined category error.
|
||||
1.3.1: 'Fixed metadata column not being jsonable'
|
||||
1.3.2: 'Allow custom slug name for components, add 404 handling for missing blog posts, allow exporting of blog images.'
|
||||
1.3.3: 'Fixed ''excluded categories'' filter from being run when value is empty.'
|
||||
1.3.4: 'Allow post author to be specified. Improved translations.'
|
||||
1.3.5: 'Fixed missing user info from breaking initial seeder in migrations. Fixed a PostgreSQL issue with blog exports.'
|
||||
1.3.6: 'Improved French translations.'
|
||||
1.4.0: 'Stability improvements. Rollback custom slug names for components'
|
||||
1.4.1: 'Fixes potential security issue with unsafe Markdown. Allow blog bylines to be translated.'
|
||||
1.4.2: 'Fix 404 redirects for missing blog posts. Assign current category to the listed posts when using the Posts component on a page with the category parameter available.'
|
||||
1.4.3: 'Fixes incompatibility with locale switching when plugin is used in conjunction with the Translate plugin. Fixes undefined category error.'
|
||||
1.5.0:
|
||||
- Added featured_image column for for choosing from media finder
|
||||
- 'Added featured_image column for for choosing from media finder'
|
||||
- posts_add_featured_image.php
|
||||
1.5.1:
|
||||
- 'Updated table rainlab_blog_categories'
|
||||
- builder_table_update_rainlab_blog_categories.php
|
||||
1.5.2:
|
||||
- 'Updated table rainlab_blog_categories'
|
||||
- builder_table_update_rainlab_blog_categories_2.php
|
||||
1.5.3:
|
||||
- 'Updated table rainlab_blog_categories'
|
||||
- builder_table_update_rainlab_blog_categories_3.php
|
||||
|
|
|
|||
|
|
@ -170,7 +170,10 @@ class Menu extends Meta
|
|||
* If the item type is not URL, use the API to request the item type's provider to
|
||||
* return the item URL, subitems and determine whether the item is active.
|
||||
*/
|
||||
|
||||
|
||||
$apiResult = Event::fire('pages.menuitem.resolveItem', [$item->type, $item, $currentUrl, $this->theme]);
|
||||
|
||||
if (is_array($apiResult)) {
|
||||
foreach ($apiResult as $itemInfo) {
|
||||
if (!is_array($itemInfo)) {
|
||||
|
|
|
|||
|
|
@ -14,4 +14,21 @@ class Plugin extends PluginBase
|
|||
public function registerSettings()
|
||||
{
|
||||
}
|
||||
public function registerPermissions()
|
||||
{
|
||||
return [
|
||||
'tps.reklama.statistics' => [
|
||||
'tab' => 'Reklama',
|
||||
'label' => 'statistika',
|
||||
'order' => 100,
|
||||
'roles' => ['developer']
|
||||
],
|
||||
'tps.reklama.adverts' => [
|
||||
'tab' => 'Reklama',
|
||||
'label' => 'reklamalar',
|
||||
'order' => 200,
|
||||
'roles' => ['developer']
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
<?php namespace Tps\Reklama\Components;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Cms\Classes\ComponentBase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Pheanstalk\Exception;
|
||||
use Tps\Reklama\Models\Group;
|
||||
use Tps\Reklama\Models\Statistika;
|
||||
|
||||
class Advertisement extends ComponentBase
|
||||
{
|
||||
|
|
@ -58,9 +63,50 @@ class Advertisement extends ComponentBase
|
|||
];
|
||||
}
|
||||
|
||||
public function onRun(){
|
||||
$this->group = Group::where('code',$this->property('code'))
|
||||
->with('adds')
|
||||
public function onDisplay(){
|
||||
$type = $this->property('type');
|
||||
$this->page['group'] = $group = Group::where('code',$this->property('code'))
|
||||
->with(['adds' => function ($query) use ($type){
|
||||
if($type === 'single_random')
|
||||
$query->inRandomOrder()->limit(1);
|
||||
else
|
||||
$query->orderBy('order');
|
||||
}])
|
||||
->first();
|
||||
|
||||
if ($group && $group->adds){
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
foreach ($group->adds as $adv){
|
||||
if($adv->enable_stats){
|
||||
$statistika = Statistika::firstOrCreate(['item_id' => $adv->id,'date' => Carbon::today()]);
|
||||
$statistika->increment('view');
|
||||
}
|
||||
}
|
||||
DB::commit();
|
||||
}catch (Exception $ex){
|
||||
DB::rollback();
|
||||
}
|
||||
return [
|
||||
'#'.$this->alias => $this->renderPartial('@'.$this->property('type')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function onRedirect(){
|
||||
$data = post();
|
||||
|
||||
if($data && $data['id']){
|
||||
$statistika = Statistika::firstOrCreate(['item_id' => $data['id'],'date' => Carbon::today()]);
|
||||
$statistika->increment('click');
|
||||
}
|
||||
|
||||
if($data['url']){
|
||||
$this->page['url'] = $data['url'];
|
||||
return [
|
||||
'@#'.$this->alias => $this->renderPartial('@redirect'),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1,7 @@
|
|||
{% partial __SELF__ ~ "::"~ __SELF__.property('type') %}
|
||||
|
||||
<div id="{{__SELF__}}"></div>
|
||||
{% put scripts %}
|
||||
<script>
|
||||
$.request('{{__SELF__}}::onDisplay')
|
||||
</script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<script>
|
||||
window.open('{{url}}', '_blank');
|
||||
</script>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{% set reklama = group.adds.first %}
|
||||
<a
|
||||
{% if reklama.enable_stats and reklama.url !="#" %}
|
||||
data-request="{{__SELF__}}::onRedirect"
|
||||
data-request-data = '[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
|
||||
{% endif %}
|
||||
>
|
||||
<img src="{{reklama.media|media}}" alt="{{reklama.title}}">
|
||||
</a>
|
||||
|
|
@ -6,10 +6,63 @@
|
|||
<span></span>
|
||||
</button>
|
||||
<div class="partnerSlider__inner">
|
||||
{% for reklama in __SELF__.group.adds %}
|
||||
<a href="{{reklama.url|default('#')}}" class="partnerSlider__item">
|
||||
{% for reklama in group.adds %}
|
||||
<a class="partnerSlider__item"
|
||||
{% if reklama.enable_stats and reklama.url !="#" %}
|
||||
data-request="{{__SELF__}}::onRedirect"
|
||||
data-request-data = '[{id:{{reklama.id}}},{url:"{{reklama.url}}"}]'
|
||||
{% endif %}
|
||||
>
|
||||
<img src="{{reklama.media|media}}" alt="{{reklama.title}}">
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// parner slider start
|
||||
// ================================================
|
||||
$(".partnerSlider__inner").slick({
|
||||
dots: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 5,
|
||||
arrows: true,
|
||||
prevArrow: $(".p1"),
|
||||
nextArrow: $(".n1"),
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1400,
|
||||
settings: {
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 2,
|
||||
infinite: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 1023,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 768,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 540,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
// parner slider end
|
||||
// ================================================
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Tps\Reklama\Controllers;
|
||||
use Backend\Classes\Controller;
|
||||
use Backend\Facades\BackendMenu;
|
||||
|
||||
class StatisticsController extends Controller
|
||||
{
|
||||
public $requiredPermissions = ['tps.reklama.statistics'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
BackendMenu::setContext('Tps.Reklama', 'main-menu-item', 'side-menu-item3');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->prepareLog();
|
||||
$this->prepareGraphs();
|
||||
|
||||
$this->pageTitle = 'indikator.news::lang.menu.statistics';
|
||||
|
||||
$this->addCss('/plugins/indikator/news/assets/css/statistics.css');
|
||||
}
|
||||
|
||||
protected function prepareLog(){
|
||||
|
||||
}
|
||||
|
||||
protected function prepareGraphs(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@ modelClass: Tps\Reklama\Models\Group
|
|||
form: $/tps/reklama/models/group/fields.yaml
|
||||
defaultRedirect: tps/reklama/groupscontroller
|
||||
create:
|
||||
redirect: 'tps/reklama/groups/update/:id'
|
||||
redirect: 'tps/reklama/groupscontroller/update/:id'
|
||||
redirectClose: tps/reklama/groupscontroller
|
||||
update:
|
||||
redirect: tps/reklama/groups
|
||||
redirect: tps/reklama/groupscontroller
|
||||
redirectClose: tps/reklama/groupscontroller
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
title: GroupsController
|
||||
modelClass: Tps\Reklama\Models\Group
|
||||
list: $/tps/reklama/models/group/columns.yaml
|
||||
recordUrl: 'tps/reklama/groups/update/:id'
|
||||
recordUrl: 'tps/reklama/groupscontroller/update/:id'
|
||||
noRecordsMessage: 'backend::lang.list.no_records'
|
||||
recordsPerPage: 20
|
||||
showSetup: true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,520 @@
|
|||
|
||||
<div class="control-breadcrumb">
|
||||
<ul>
|
||||
<li><?= e(trans('indikator.news::lang.menu.statistics')) ?></li>
|
||||
<li>
|
||||
<span class="text-info"><strong><?= Indikator\News\Models\Posts::count() ?></strong> <?= e(trans_choice('indikator.news::lang.stat.posts', Indikator\News\Models\Posts::count())) ?></span>
|
||||
<?php if ($view > 0): ?>
|
||||
|
|
||||
<span class="text-danger"><strong><?= number_format($view, 0, '.', ' ') ?></strong> <?= e(trans('indikator.news::lang.stat.view')) ?></span>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="scoreboard statboard">
|
||||
<?php if ($posts): ?>
|
||||
<div class="row statbox">
|
||||
<div class="col-md-12">
|
||||
<h4><?= e(trans('indikator.news::lang.menu.posts')) ?></h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<strong><?= $now ?></strong>
|
||||
<div id="thisYear" style="height: 220px; opacity: 0;"></div>
|
||||
<br>
|
||||
<?php if ($lastYear[0] > 0): ?>
|
||||
<strong><?= ($now - 1) ?></strong>
|
||||
<div id="lastYear" style="height: 220px; opacity: 0;"></div>
|
||||
<br>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if ($view > 0): ?>
|
||||
<div class="col-md-6">
|
||||
<strong><?= e(trans('indikator.news::lang.stat.top')) ?></strong>
|
||||
<div class="clearfix"></div><br>
|
||||
<?= $top ?>
|
||||
<br>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<?php if (isset($longest)): ?>
|
||||
<div class="col-md-6">
|
||||
<strong><?= e(trans('indikator.news::lang.stat.longest')) ?></strong>
|
||||
<div class="clearfix"></div><br>
|
||||
<?= $longest ?>
|
||||
<br>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if (isset($shortest)): ?>
|
||||
<div class="col-md-6">
|
||||
<strong><?= e(trans('indikator.news::lang.stat.shortest')) ?></strong>
|
||||
<div class="clearfix"></div><br>
|
||||
<?= $shortest ?>
|
||||
<br>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<div class="col-md-6">
|
||||
<?php if (isset($longest)): ?>
|
||||
<strong><?= e(trans('indikator.news::lang.stat.longest')) ?></strong>
|
||||
<div class="clearfix"></div><br>
|
||||
<?= $longest ?>
|
||||
<br>
|
||||
<?php endif ?>
|
||||
<?php if (isset($shortest)): ?>
|
||||
<strong><?= e(trans('indikator.news::lang.stat.shortest')) ?></strong>
|
||||
<div class="clearfix"></div><br>
|
||||
<?= $shortest ?>
|
||||
<br>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if ($mails): ?>
|
||||
<div class="row statbox">
|
||||
<div class="col-md-12">
|
||||
<h4><?= e(trans('indikator.news::lang.menu.logs')) ?></h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<strong><?= e(trans('indikator.news::lang.stat.log.events')) ?></strong>
|
||||
<div id="log-this-year"></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<strong><?= e(trans('indikator.news::lang.stat.log.summary')) ?></strong>
|
||||
<div id="log-overall"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.8/raphael.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// Variables
|
||||
var date = new Date();
|
||||
var year = date.getFullYear();
|
||||
var lang = $('html').attr('lang');
|
||||
|
||||
// Translates
|
||||
if (lang == 'hu') {
|
||||
var trans = {
|
||||
all: 'Összesen',
|
||||
jan: 'január',
|
||||
feb: 'február',
|
||||
mar: 'március',
|
||||
apr: 'április',
|
||||
may: 'május',
|
||||
jun: 'június',
|
||||
jul: 'július',
|
||||
aug: 'augusztus',
|
||||
sep: 'szeptember',
|
||||
oct: 'október',
|
||||
nov: 'november',
|
||||
dec: 'december'
|
||||
};
|
||||
}
|
||||
else if (lang == 'de') {
|
||||
var trans = {
|
||||
all: 'Alle',
|
||||
jan: 'Januar',
|
||||
feb: 'Februar',
|
||||
mar: 'März',
|
||||
apr: 'April',
|
||||
may: 'Mai',
|
||||
jun: 'Juni',
|
||||
jul: 'Juli',
|
||||
aug: 'August',
|
||||
sep: 'September',
|
||||
oct: 'Oktober',
|
||||
nov: 'November',
|
||||
dec: 'Dezember'
|
||||
};
|
||||
}
|
||||
else if (lang == 'ru') {
|
||||
var trans = {
|
||||
all: 'Всего',
|
||||
jan: 'Январь',
|
||||
feb: 'Февраль',
|
||||
mar: 'Март',
|
||||
apr: 'Апрель',
|
||||
may: 'Май',
|
||||
jun: 'Июнь',
|
||||
jul: 'Июль',
|
||||
aug: 'Август',
|
||||
sep: 'Сентябрь',
|
||||
oct: 'Октябрь',
|
||||
nov: 'Ноябрь',
|
||||
dec: 'Декабрь'
|
||||
};
|
||||
}
|
||||
else if (lang == 'pl') {
|
||||
var trans = {
|
||||
all: 'Wszystko',
|
||||
jan: 'styczeń',
|
||||
feb: 'luty',
|
||||
mar: 'marzec',
|
||||
apr: 'kwiecień',
|
||||
may: 'maj',
|
||||
jun: 'czerwiec',
|
||||
jul: 'lipiec',
|
||||
aug: 'sierpień',
|
||||
sep: 'wrzesień',
|
||||
oct: 'październik',
|
||||
nov: 'listopad',
|
||||
dec: 'grudzień'
|
||||
};
|
||||
}
|
||||
else if (lang == 'pt-br') {
|
||||
var trans = {
|
||||
all: 'Todos',
|
||||
jan: 'Janeiro',
|
||||
feb: 'Fevereiro',
|
||||
mar: 'Março',
|
||||
apr: 'Abril',
|
||||
may: 'Maio',
|
||||
jun: 'Junho',
|
||||
jul: 'Julho',
|
||||
aug: 'Agosto',
|
||||
sep: 'Setembro',
|
||||
oct: 'Outubro',
|
||||
nov: 'Novembro',
|
||||
dec: 'Dezembro'
|
||||
};
|
||||
}
|
||||
else {
|
||||
var trans = {
|
||||
all: 'All',
|
||||
jan: 'January',
|
||||
feb: 'February',
|
||||
mar: 'March',
|
||||
apr: 'April',
|
||||
may: 'May',
|
||||
jun: 'June',
|
||||
jul: 'July',
|
||||
aug: 'August',
|
||||
sep: 'September',
|
||||
oct: 'October',
|
||||
nov: 'November',
|
||||
dec: 'December'
|
||||
};
|
||||
}
|
||||
|
||||
// This year
|
||||
if ($('#thisYear').length == 1) {
|
||||
new Morris.Line({
|
||||
element: 'thisYear',
|
||||
data: [
|
||||
{ year: year + '-01', 'all': <?= $thisYear[1] ?> },
|
||||
{ year: year + '-02', 'all': <?= $thisYear[2] ?> },
|
||||
{ year: year + '-03', 'all': <?= $thisYear[3] ?> },
|
||||
{ year: year + '-04', 'all': <?= $thisYear[4] ?> },
|
||||
{ year: year + '-05', 'all': <?= $thisYear[5] ?> },
|
||||
{ year: year + '-06', 'all': <?= $thisYear[6] ?> },
|
||||
{ year: year + '-07', 'all': <?= $thisYear[7] ?> },
|
||||
{ year: year + '-08', 'all': <?= $thisYear[8] ?> },
|
||||
{ year: year + '-09', 'all': <?= $thisYear[9] ?> },
|
||||
{ year: year + '-10', 'all': <?= $thisYear[10] ?> },
|
||||
{ year: year + '-11', 'all': <?= $thisYear[11] ?> },
|
||||
{ year: year + '-12', 'all': <?= $thisYear[12] ?> }
|
||||
],
|
||||
xkey: 'year',
|
||||
ykeys: ['all'],
|
||||
labels: [trans.all],
|
||||
lineColors: ['#31708f'],
|
||||
hideHover: 'auto',
|
||||
xLabelFormat: function(x) {
|
||||
var IndexToMonth = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
|
||||
return IndexToMonth[x.getMonth()];
|
||||
},
|
||||
dateFormat: function(d) {
|
||||
var IndexToMonth = [trans.jan, trans.feb, trans.mar, trans.apr, trans.may, trans.jun, trans.jul, trans.aug, trans.sep, trans.oct, trans.nov, trans.dec];
|
||||
return month = IndexToMonth[new Date(d).getMonth()];
|
||||
},
|
||||
resize: true,
|
||||
gridIntegers: true,
|
||||
ymin: 0
|
||||
});
|
||||
|
||||
$('#thisYear').fadeTo(1200, 1);
|
||||
}
|
||||
|
||||
// Last year
|
||||
if ($('#lastYear').length == 1) {
|
||||
new Morris.Line({
|
||||
element: 'lastYear',
|
||||
data: [
|
||||
{ year: (year - 1) + '-01', 'all': <?= $lastYear[1] ?> },
|
||||
{ year: (year - 1) + '-02', 'all': <?= $lastYear[2] ?> },
|
||||
{ year: (year - 1) + '-03', 'all': <?= $lastYear[3] ?> },
|
||||
{ year: (year - 1) + '-04', 'all': <?= $lastYear[4] ?> },
|
||||
{ year: (year - 1) + '-05', 'all': <?= $lastYear[5] ?> },
|
||||
{ year: (year - 1) + '-06', 'all': <?= $lastYear[6] ?> },
|
||||
{ year: (year - 1) + '-07', 'all': <?= $lastYear[7] ?> },
|
||||
{ year: (year - 1) + '-08', 'all': <?= $lastYear[8] ?> },
|
||||
{ year: (year - 1) + '-09', 'all': <?= $lastYear[9] ?> },
|
||||
{ year: (year - 1) + '-10', 'all': <?= $lastYear[10] ?> },
|
||||
{ year: (year - 1) + '-11', 'all': <?= $lastYear[11] ?> },
|
||||
{ year: (year - 1) + '-12', 'all': <?= $lastYear[12] ?> }
|
||||
],
|
||||
xkey: 'year',
|
||||
ykeys: ['all'],
|
||||
labels: [trans.all],
|
||||
lineColors: ['#31708f'],
|
||||
hideHover: 'auto',
|
||||
xLabelFormat: function(x) {
|
||||
var IndexToMonth = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
|
||||
return IndexToMonth[x.getMonth()];
|
||||
},
|
||||
dateFormat: function(d) {
|
||||
var IndexToMonth = [trans.jan, trans.feb, trans.mar, trans.apr, trans.may, trans.jun, trans.jul, trans.aug, trans.sep, trans.oct, trans.nov, trans.dec];
|
||||
return month = IndexToMonth[new Date(d).getMonth()];
|
||||
},
|
||||
resize: true,
|
||||
gridIntegers: true,
|
||||
ymin: 0
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$('#lastYear').fadeTo(1200, 1);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
// This year logs
|
||||
if ($('#log-this-year').length == 1) {
|
||||
new Morris.Line({
|
||||
element: 'log-this-year',
|
||||
data: [
|
||||
<?php
|
||||
foreach ($logResults as $year => $logYear) {
|
||||
foreach ($logYear as $month => $logMonth) {
|
||||
$print = "{ year: '".$year."-".$month."'";
|
||||
foreach ($logMonth as $entry => $value) {
|
||||
$print .= ", '".$entry."' : ".$value;
|
||||
}
|
||||
echo $print."},";
|
||||
}
|
||||
}
|
||||
?>
|
||||
],
|
||||
xkey: 'year',
|
||||
ykeys: ['<?php echo implode("','",$logResultsFields); ?>'],
|
||||
labels: ['<?php echo implode("','",$logResultsFieldsTrans); ?>'],
|
||||
pointSize: 2,
|
||||
hideHover: 'auto',
|
||||
xLabelFormat: function(x) {
|
||||
var IndexToMonth = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
|
||||
return IndexToMonth[x.getMonth()];
|
||||
},
|
||||
dateFormat: function(d) {
|
||||
var IndexToMonth = [trans.jan, trans.feb, trans.mar, trans.apr, trans.may, trans.jun, trans.jul, trans.aug, trans.sep, trans.oct, trans.nov, trans.dec];
|
||||
return month = IndexToMonth[new Date(d).getMonth()];
|
||||
},
|
||||
resize: true,
|
||||
gridIntegers: true,
|
||||
ymin: 0
|
||||
});
|
||||
|
||||
$('#log-this-year').fadeTo(1200, 1);
|
||||
}
|
||||
|
||||
// Overall logs
|
||||
if ($('#log-overall').length == 1) {
|
||||
new Morris.Line({
|
||||
element: 'log-overall',
|
||||
data: [
|
||||
<?php
|
||||
$sum = [];
|
||||
foreach ($logResultsFields as $field) {
|
||||
$sum[$field] = 0;
|
||||
}
|
||||
foreach ($logResults as $year => $logYear) {
|
||||
foreach($logYear as $month => $logMonth) {
|
||||
$print = "{ year: '".$year."-".$month."'";
|
||||
foreach ($logMonth as $entry => $value) {
|
||||
$sum[$entry] += $value;
|
||||
$print .= ", '".$entry."' : ".$sum[$entry];
|
||||
}
|
||||
echo $print."},";
|
||||
}
|
||||
}
|
||||
?>
|
||||
],
|
||||
xkey: 'year',
|
||||
ykeys: ['<?php echo implode("','",$logResultsFields); ?>'],
|
||||
labels: ['<?php echo implode("','",$logResultsFieldsTrans); ?>'],
|
||||
pointSize: 2,
|
||||
hideHover: 'auto',
|
||||
xLabelFormat: function(x) {
|
||||
var IndexToMonth = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
|
||||
return IndexToMonth[x.getMonth()];
|
||||
},
|
||||
dateFormat: function(d) {
|
||||
var IndexToMonth = [trans.jan, trans.feb, trans.mar, trans.apr, trans.may, trans.jun, trans.jul, trans.aug, trans.sep, trans.oct, trans.nov, trans.dec];
|
||||
return month = IndexToMonth[new Date(d).getMonth()];
|
||||
},
|
||||
resize: true,
|
||||
gridIntegers: true,
|
||||
ymin: 0
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$('#log-overall').fadeTo(1200, 1);
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
|
||||
// Graph
|
||||
(function() {
|
||||
var $, MyMorris;
|
||||
MyMorris = window.MyMorris = {};
|
||||
$ = jQuery;
|
||||
MyMorris = Object.create(Morris);
|
||||
MyMorris.Grid.prototype.gridDefaults['gridIntegers'] = false;
|
||||
MyMorris.Grid.prototype.setData = function (data, redraw) {
|
||||
var e, idx, index, maxGoal, minGoal, ret, row, step, total, y, ykey, ymax, ymin, yval, _ref;
|
||||
if (redraw == null) {
|
||||
redraw = true;
|
||||
}
|
||||
this.options.data = data;
|
||||
if ((data == null) || data.length === 0) {
|
||||
this.data = [];
|
||||
this.raphael.clear();
|
||||
if (this.hover != null) {
|
||||
this.hover.hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
ymax = this.cumulative ? 0 : null;
|
||||
ymin = this.cumulative ? 0 : null;
|
||||
if (this.options.goals.length > 0) {
|
||||
minGoal = Math.min.apply(Math, this.options.goals);
|
||||
maxGoal = Math.max.apply(Math, this.options.goals);
|
||||
ymin = ymin != null ? Math.min(ymin, minGoal) : minGoal;
|
||||
ymax = ymax != null ? Math.max(ymax, maxGoal) : maxGoal;
|
||||
}
|
||||
this.data = (function () {
|
||||
var _i, _len, _results;
|
||||
_results = [];
|
||||
for (index = _i = 0, _len = data.length; _i < _len; index = ++_i) {
|
||||
row = data[index];
|
||||
ret = {
|
||||
src: row
|
||||
};
|
||||
ret.label = row[this.options.xkey];
|
||||
if (this.options.parseTime) {
|
||||
ret.x = Morris.parseDate(ret.label);
|
||||
if (this.options.dateFormat) {
|
||||
ret.label = this.options.dateFormat(ret.x);
|
||||
} else if (typeof ret.label === 'number') {
|
||||
ret.label = new Date(ret.label).toString();
|
||||
}
|
||||
} else {
|
||||
ret.x = index;
|
||||
if (this.options.xLabelFormat) {
|
||||
ret.label = this.options.xLabelFormat(ret);
|
||||
}
|
||||
}
|
||||
total = 0;
|
||||
ret.y = (function () {
|
||||
var _j, _len1, _ref, _results1;
|
||||
_ref = this.options.ykeys;
|
||||
_results1 = [];
|
||||
for (idx = _j = 0, _len1 = _ref.length; _j < _len1; idx = ++_j) {
|
||||
ykey = _ref[idx];
|
||||
yval = row[ykey];
|
||||
if (typeof yval === 'string') {
|
||||
yval = parseFloat(yval);
|
||||
}
|
||||
if ((yval != null) && typeof yval !== 'number') {
|
||||
yval = null;
|
||||
}
|
||||
if (yval != null) {
|
||||
if (this.cumulative) {
|
||||
total += yval;
|
||||
} else {
|
||||
if (ymax != null) {
|
||||
ymax = Math.max(yval, ymax);
|
||||
ymin = Math.min(yval, ymin);
|
||||
} else {
|
||||
ymax = ymin = yval;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.cumulative && (total != null)) {
|
||||
ymax = Math.max(total, ymax);
|
||||
ymin = Math.min(total, ymin);
|
||||
}
|
||||
_results1.push(yval);
|
||||
}
|
||||
return _results1;
|
||||
}).call(this);
|
||||
_results.push(ret);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (this.options.parseTime) {
|
||||
this.data = this.data.sort(function (a, b) {
|
||||
return (a.x > b.x) - (b.x > a.x);
|
||||
});
|
||||
}
|
||||
this.xmin = this.data[0].x;
|
||||
this.xmax = this.data[this.data.length - 1].x;
|
||||
this.events = [];
|
||||
if (this.options.events.length > 0) {
|
||||
if (this.options.parseTime) {
|
||||
this.events = (function () {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.options.events;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
e = _ref[_i];
|
||||
_results.push(Morris.parseDate(e));
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
} else {
|
||||
this.events = this.options.events;
|
||||
}
|
||||
this.xmax = Math.max(this.xmax, Math.max.apply(Math, this.events));
|
||||
this.xmin = Math.min(this.xmin, Math.min.apply(Math, this.events));
|
||||
}
|
||||
if (this.xmin === this.xmax) {
|
||||
this.xmin -= 1;
|
||||
this.xmax += 1;
|
||||
}
|
||||
this.ymin = this.yboundary('min', ymin);
|
||||
this.ymax = this.yboundary('max', ymax);
|
||||
if (this.ymin === this.ymax) {
|
||||
if (ymin) {
|
||||
this.ymin -= 1;
|
||||
}
|
||||
this.ymax += 1;
|
||||
}
|
||||
if (((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'y') || this.options.grid === true) {
|
||||
if (this.options.ymax === this.gridDefaults.ymax && this.options.ymin === this.gridDefaults.ymin) {
|
||||
this.grid = this.autoGridLines(this.ymin, this.ymax, this.options.numLines);
|
||||
this.ymin = Math.min(this.ymin, this.grid[0]);
|
||||
this.ymax = Math.max(this.ymax, this.grid[this.grid.length - 1]);
|
||||
} else {
|
||||
step = (this.ymax - this.ymin) / (this.options.numLines - 1);
|
||||
if (this.options.gridIntegers) {
|
||||
step = Math.max(1, Math.round(step));
|
||||
}
|
||||
this.grid = (function () {
|
||||
var _i, _ref1, _ref2, _results;
|
||||
_results = [];
|
||||
for (y = _i = _ref1 = this.ymin, _ref2 = this.ymax; step > 0 ? _i <= _ref2 : _i >= _ref2; y = _i += step) {
|
||||
_results.push(y);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
}
|
||||
}
|
||||
this.dirty = true;
|
||||
if (redraw) {
|
||||
return this.redraw();
|
||||
}
|
||||
};
|
||||
}).call(this);
|
||||
</script>
|
||||
|
|
@ -35,6 +35,14 @@ class Reklama extends Model
|
|||
],
|
||||
];
|
||||
|
||||
public $hasMany = [
|
||||
'stats' => [
|
||||
'Tps\Reklama\Models\Statistika',
|
||||
'table' => 'tps_reklama_statistika',
|
||||
'key' => 'item_id'
|
||||
]
|
||||
];
|
||||
|
||||
public function scopeUnExpiered($query){
|
||||
return $query->where('active',1)
|
||||
->where(function ($q) {
|
||||
|
|
@ -44,7 +52,19 @@ class Reklama extends Model
|
|||
->where(function ($q) {
|
||||
$q->where('start_date', '<', Carbon::now(config('app.timezone')))
|
||||
->orWhereNull('start_date');
|
||||
})
|
||||
->orderBy('order');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public function getViewsAttribute(){
|
||||
if($this->enable_stats)
|
||||
return $this->stats->sum('view');
|
||||
return '-';
|
||||
}
|
||||
|
||||
public function getClicksAttribute(){
|
||||
if($this->enable_stats)
|
||||
return $this->stats->sum('click');
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?php namespace Tps\Reklama\Models;
|
||||
|
||||
use Model;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class Statistika extends Model
|
||||
{
|
||||
use \October\Rain\Database\Traits\Validation;
|
||||
|
||||
/*
|
||||
* Disable timestamps by default.
|
||||
* Remove this line if timestamps are defined in the database table.
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
public $table = 'tps_reklama_statistika';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [
|
||||
];
|
||||
}
|
||||
|
|
@ -16,3 +16,12 @@ columns:
|
|||
type: text
|
||||
relation: group
|
||||
valueFrom: name
|
||||
sortable: false
|
||||
views:
|
||||
label: views
|
||||
type: text
|
||||
sortable: false
|
||||
clicks:
|
||||
label: clicks
|
||||
type: text
|
||||
sortable: false
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ fields:
|
|||
order:
|
||||
label: 'Sort order'
|
||||
span: auto
|
||||
default: '0'
|
||||
type: number
|
||||
comment: 'Sorts in ascending order'
|
||||
start_date:
|
||||
|
|
@ -49,5 +50,12 @@ fields:
|
|||
active:
|
||||
label: Status
|
||||
span: auto
|
||||
default: 1
|
||||
type: switch
|
||||
comment: 'Enable, disable status'
|
||||
display:
|
||||
label: 'Display time'
|
||||
span: auto
|
||||
default: '10'
|
||||
type: number
|
||||
comment: 'How many seconds should item be displayed'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ navigation:
|
|||
icon: icon-star
|
||||
side-menu-item3:
|
||||
label: Statistics
|
||||
url: tps/reklama/groupscontroller
|
||||
url: tps/reklama/statisticscontroller
|
||||
icon: icon-line-chart
|
||||
permissions:
|
||||
reklama:
|
||||
|
|
|
|||
|
|
@ -18,3 +18,9 @@
|
|||
1.0.7:
|
||||
- 'Updated table tps_reklama_item'
|
||||
- builder_table_update_tps_reklama_item_2.php
|
||||
1.0.8:
|
||||
- 'Updated table tps_reklama_item'
|
||||
- builder_table_update_tps_reklama_item_3.php
|
||||
1.0.9:
|
||||
- 'Updated table tps_reklama_statistika'
|
||||
- builder_table_update_tps_reklama_statistika_2.php
|
||||
|
|
|
|||
|
|
@ -54,10 +54,15 @@ class Views extends ComponentBase
|
|||
->where('post_id', $post->getKey());
|
||||
|
||||
if ($obj->count() > 0) {
|
||||
$out = $obj->first()->views;
|
||||
$obj = $obj->first();
|
||||
$out = $obj->views;
|
||||
}
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function onIncrement(){
|
||||
$this->page['view'] = $this->getViews();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,3 +29,18 @@ INSERT INTO orient.rainlab_blog_posts_categories (post_id,category_id)
|
|||
SELECT rb.id, bt.id FROM orient_wordpress.`iatm_orient_2_term_relationships` rl
|
||||
Inner JOIN orient.rainlab_blog_categories bt on bt.id = rl.term_taxonomy_id
|
||||
INNER JOIN orient.rainlab_blog_posts rb on rl.object_id = rb.id_en
|
||||
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 9 where term_taxonomy_id = 2;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 5 where term_taxonomy_id = 3;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 8 where term_taxonomy_id = 5;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 10 where term_taxonomy_id = 6;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 11 where term_taxonomy_id = 7;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 13 where term_taxonomy_id = 10;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 6 where term_taxonomy_id = 23;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 7 where term_taxonomy_id = 26;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 14 where term_taxonomy_id = 29;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 12 where term_taxonomy_id = 41;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 793 where term_taxonomy_id = 41;
|
||||
update iatm_orient_term_relationships SET term_taxonomy_id = 621 where term_taxonomy_id = 696;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
DELETE from orient_wordpress.arient_ru_posts where post_type not in ('post','attachment');
|
||||
DELETE from orient_wordpress.arient_ru_posts where post_status in ('draft','auto-draft');
|
||||
|
||||
ALTER TABLE `rainlab_blog_posts` CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, CHANGE `slug` `slug` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;
|
||||
|
||||
INSERT INTO orient.rainlab_blog_posts (user_id,title,slug,excerpt,content_html,published_at,published,created_at,updated_at,locale,id_en)
|
||||
SELECT post_author,post_title,post_name,post_excerpt,post_content,post_date,1,post_date,post_modified,'en',id from orient_wordpress.arient_2_posts;
|
||||
|
||||
INSERT INTO orient.rainlab_blog_posts (user_id,title,slug,excerpt,content,content_html,published_at,published,created_at,updated_at,locale,id_en)
|
||||
SELECT post_author,post_title,post_name,post_excerpt,post_content,post_content,post_date,1,post_date,post_modified,'ru',id
|
||||
from orient_wordpress.arient_ru_posts where post_type='post' and post_status='publish';
|
||||
|
||||
UPDATE rainlab_blog_posts SET powerseo_title = title, powerseo_description = excerpt, powerseo_robot_index = 'index', powerseo_robot_follow = 'nofollow';
|
||||
|
||||
//////// angliski postlarda 2019dan ashakdaky materiallar pozulan
|
||||
|
|
@ -10,10 +17,17 @@ Delete FROM arient_2_posts_temp WHERE post_date <'2019-01-01'
|
|||
|
||||
////////////////////////////////insert featured images
|
||||
UPDATE rainlab_blog_posts rb
|
||||
inner join iatm_2_postmeta ip on rb.id_en = ip.post_id and ip.meta_key='-thumbnail_id'
|
||||
inner join iatm_2_postmeta ip on rb.id_en = ip.post_id and ip.meta_key='_thumbnail_id'
|
||||
inner join arient_2_posts_temp wp on wp.ID = ip.meta_value
|
||||
set rb.featerd_image = wp.guid
|
||||
|
||||
ALTER TABLE `rainlab_blog_posts` CHANGE `featured_image` `featured_image` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;
|
||||
|
||||
UPDATE rainlab_blog_posts rb
|
||||
inner join orient_wordpress.iatm_orient_postmeta ip on rb.id_ru = ip.post_id and ip.meta_key='_thumbnail_id'
|
||||
inner join orient_wordpress.arient_ru_posts wp on wp.ID = ip.meta_value
|
||||
set rb.featured_image = REPLACE(wp.guid,'https://orient.tm/en/wp-content/','')
|
||||
|
||||
////////////// replace image address
|
||||
UPDATE rainlab_blog_posts set featured_image = REPLACE(featured_image,'https://orient.tm/en/wp-content/','') where featured_image !=''
|
||||
|
||||
|
|
@ -22,6 +36,7 @@ INSERT INTO orient.vdomah_blogviews_views (views,post_id)
|
|||
select pp.pageviews,rb.id FROM orient_wordpress.iatm_orient_2_popularpostsdata pp
|
||||
INNER join orient.rainlab_blog_posts rb on rb.id_en = pp.postid
|
||||
|
||||
INSERT INTO orient.pollozen_mostvisited_visits (post_id,date,visits)
|
||||
select rb.id, pp.view_date , pp.pageviews FROM orient_wordpress.iatm_orient_2_popularpostssummary pp
|
||||
INNER join orient.rainlab_blog_posts rb on rb.id_en = pp.postid
|
||||
INSERT INTO orient.vdomah_blogviews_views (views,post_id)
|
||||
select pp.pageviews,rb.id FROM orient_wordpress.iatm_orient_popularpostsdata pp
|
||||
INNER join orient.rainlab_blog_posts rb on rb.id_ru = pp.postid AND rb.locale = 'ru'
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
line-height: $h5-height;
|
||||
font-weight: 400;
|
||||
color: $text-color-white;
|
||||
a(color:$text-color-white;)
|
||||
}
|
||||
&__social {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
font-size: $p-size;
|
||||
line-height: $p-height;
|
||||
margin-bottom: 30px;
|
||||
a(color:blue;)
|
||||
}
|
||||
&-row {
|
||||
display: flex;
|
||||
|
|
@ -77,7 +78,7 @@
|
|||
&-social {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&-link {
|
||||
svg {
|
||||
margin-right: 20px;
|
||||
fill: $main-color;
|
||||
}
|
||||
|
|
@ -90,3 +91,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="440" height="500" viewBox="0 0 440 500">
|
||||
<rect id="Реклама_1_" data-name="Реклама (1)" width="440" height="500" fill="#b4b4b4"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 199 B |
|
|
@ -40,51 +40,7 @@ $("a[data-slide]").click(function (e) {
|
|||
var slideno = $(this).data("slide");
|
||||
$(".slider__inner").slick("slickGoTo", slideno - 1);
|
||||
});
|
||||
// parner slider start
|
||||
// ================================================
|
||||
$(".partnerSlider__inner").slick({
|
||||
dots: false,
|
||||
infinite: true,
|
||||
speed: 300,
|
||||
slidesToShow: 5,
|
||||
arrows: true,
|
||||
prevArrow: $(".p1"),
|
||||
nextArrow: $(".n1"),
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1400,
|
||||
settings: {
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 2,
|
||||
infinite: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 1023,
|
||||
settings: {
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 768,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 540,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
// parner slider end
|
||||
// ================================================
|
||||
|
||||
// lazyload start
|
||||
// =============================================
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@ en:
|
|||
site.name: 'Orient'
|
||||
site.slogan: 'Oriented on making people closer'
|
||||
partner_news: 'PARTNERS NEWS'
|
||||
media_partners: 'MEDIA PARTNERS'
|
||||
nav.home: 'Home'
|
||||
nav.city: 'Ashgabat'
|
||||
page.latest_news: 'Latest news'
|
||||
page.tags: 'TAGS'
|
||||
page.archive: 'Archive'
|
||||
page.calendar: 'NEWS CALENDAR'
|
||||
page.more: 'More'
|
||||
page.search: 'Search'
|
||||
|
|
@ -21,9 +23,11 @@ ru:
|
|||
site.name: 'Ориент'
|
||||
site.slogan: 'Наш ориентир то, что сближает людей'
|
||||
partner_news: 'НОВОСТИ КОЛЛЕГ'
|
||||
media_partners: 'МЕДИА ПАРТНЕРЫ'
|
||||
nav.home: 'Главная'
|
||||
nav.city: 'Ашхабад'
|
||||
page.tags: 'ТЭГИ'
|
||||
page.archive: 'Архив'
|
||||
page.calendar: 'КАЛЕНДАРЬ НОВОСТЕЙ'
|
||||
page.latest_news: 'Последние новости'
|
||||
page.more: 'Посмотреть всё'
|
||||
|
|
|
|||
|
|
@ -18,13 +18,10 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: Рубрики
|
||||
nesting: null
|
||||
type: header
|
||||
url: null
|
||||
type: all-blog-categories
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: null
|
||||
cmsPage: category
|
||||
replace: 1
|
||||
viewBag:
|
||||
locale:
|
||||
en:
|
||||
|
|
@ -35,8 +32,12 @@ items:
|
|||
isExternal: '0'
|
||||
-
|
||||
title: 'Static Pages(About and Contact)'
|
||||
nesting: null
|
||||
type: all-static-pages
|
||||
url: null
|
||||
code: ''
|
||||
reference: null
|
||||
cmsPage: null
|
||||
replace: 1
|
||||
viewBag:
|
||||
locale:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ postPage = "post"
|
|||
<div class="main__content">
|
||||
<div class="heading">
|
||||
<div class="heading__title">
|
||||
Arhiw
|
||||
{{'page.archive'|_}}
|
||||
</div>
|
||||
{% for item in blogPosts.posts %}
|
||||
{% partial 'post_list_item' post = item %}
|
||||
|
|
@ -35,3 +35,6 @@ postPage = "post"
|
|||
{% partial 'calendar' %}
|
||||
{% partial 'tags' %}
|
||||
</div>
|
||||
{% put scripts %}
|
||||
<script src="{{['assets/js/lazy.js','assets/js/main.js']|theme}}"></script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -35,3 +35,6 @@ postPage = "post"
|
|||
{% partial 'calendar' %}
|
||||
{% partial 'tags' %}
|
||||
</div>
|
||||
{% put scripts %}
|
||||
<script src="{{['assets/js/lazy.js','assets/js/main.js']|theme}}"></script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,24 @@ categoryPage = "category"
|
|||
[adverts media_partners]
|
||||
code = "media"
|
||||
type = "slider"
|
||||
|
||||
[adverts samsung]
|
||||
type = "single"
|
||||
code = "samsung"
|
||||
==
|
||||
{% partial 'slider' %}
|
||||
|
||||
|
||||
<!--{% component 'reklama' %}-->
|
||||
|
||||
<!-- banner start -->
|
||||
<section class="banner">
|
||||
<div class="auto__container">
|
||||
<div class="banner__inner">
|
||||
{% component 'samsung' %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- banner end -->
|
||||
|
||||
<!-- event start
|
||||
================================================ -->
|
||||
|
|
@ -56,7 +68,7 @@ type = "slider"
|
|||
</div>
|
||||
</div>
|
||||
<div class="main__banner">
|
||||
<img src="images/example.svg" alt="">
|
||||
<img src="{{'assets/images/example.svg'|theme}}" alt="">
|
||||
</div>
|
||||
<div class="main__body">
|
||||
<div class="main__body-row">
|
||||
|
|
@ -65,7 +77,7 @@ type = "slider"
|
|||
</div>
|
||||
</div>
|
||||
<div class="main__banner">
|
||||
<img src="images/example.svg" alt="">
|
||||
<img src="{{'assets/images/example.svg'|theme}}" alt="">
|
||||
</div>
|
||||
{% partial 'index/partner_news'%}
|
||||
</div>
|
||||
|
|
@ -95,7 +107,7 @@ type = "slider"
|
|||
<div class="partner__inner">
|
||||
|
||||
<div class="partner__title">
|
||||
МЕДИА ПАРТНЕРЫ
|
||||
{{'media_partners'|_}}
|
||||
</div>
|
||||
|
||||
{% component 'media_partners' %}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@ slug = "{{ :slug }}"
|
|||
</svg>
|
||||
<span>{{post.published_at|date('H:i')}}</span>
|
||||
</time>
|
||||
<div class="card__header-view" id="view">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="eye" transform="translate(-0.5 -3.5)">
|
||||
<path id="Path_6489" data-name="Path 6489" d="M1,11S4.636,4,11,4s10,7,10,7-3.636,7-10,7S1,11,1,11Z" fill="none" stroke="" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"></path>
|
||||
<ellipse id="Ellipse_12" data-name="Ellipse 12" cx="4.859" cy="4.791" rx="4.859" ry="4.791" transform="translate(6.141 6.209)" fill="none" stroke="" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"></ellipse>
|
||||
</g>
|
||||
</svg>
|
||||
{% partial 'view' %}
|
||||
</div>
|
||||
<h1 class="news__title">
|
||||
{{post.title}}
|
||||
</h1>
|
||||
|
|
@ -50,3 +59,12 @@ slug = "{{ :slug }}"
|
|||
<div class="news__sidebar">
|
||||
{% partial 'latest_news'%}
|
||||
</div>
|
||||
|
||||
{% put scripts %}
|
||||
<script>
|
||||
$.request('views::onIncrement', {
|
||||
update: {view:'@#view'},
|
||||
|
||||
})
|
||||
</script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
title = "rss"
|
||||
url = "/rss/:category?"
|
||||
is_hidden = 0
|
||||
robot_index = "index"
|
||||
robot_follow = "follow"
|
||||
|
||||
[blogRssFeed]
|
||||
categoryFilter = "{{ :category }}"
|
||||
sortOrder = "published_at desc"
|
||||
postsPerPage = 20
|
||||
blogPage = "category"
|
||||
postPage = "post"
|
||||
|
||||
[viewBag]
|
||||
localeUrl[en] = "/rss/:category?"
|
||||
==
|
||||
|
|
@ -1,7 +1,38 @@
|
|||
title = "Поиск"
|
||||
url = "/search"
|
||||
layout = "cms"
|
||||
is_hidden = 0
|
||||
robot_index = "index"
|
||||
robot_follow = "follow"
|
||||
|
||||
[viewBag]
|
||||
localeTitle[en] = "Search"
|
||||
|
||||
[blogPosts]
|
||||
pageNumber = "{{ :page }}"
|
||||
postsPerPage = 10
|
||||
noPostsMessage = "No posts found"
|
||||
sortOrder = "published_at desc"
|
||||
categoryPage = "blog/category"
|
||||
postPage = "blog/post"
|
||||
==
|
||||
<div class="main__content">
|
||||
<div class="heading">
|
||||
<div class="heading__title">
|
||||
{{'page.search'}}
|
||||
</div>
|
||||
{% for item in blogPosts.posts %}
|
||||
{% partial 'post_list_item' post = item %}
|
||||
{% else %}
|
||||
<p>No posts found</p>
|
||||
{% endfor %}
|
||||
{% partial 'pagination' items = blogPosts.posts %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="main__sidebar">
|
||||
{% partial 'calendar' %}
|
||||
{% partial 'tags' %}
|
||||
</div>
|
||||
{% put scripts %}
|
||||
<script src="{{['assets/js/lazy.js','assets/js/main.js']|theme}}"></script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -72,3 +72,6 @@ categoryPage = "category"
|
|||
{% partial 'calendar' %}
|
||||
{% partial 'tags' %}
|
||||
</div>
|
||||
{% put scripts %}
|
||||
<script src="{{['assets/js/lazy.js','assets/js/main.js']|theme}}"></script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,9 @@ code = "top-menu"
|
|||
{{'site.slogan'|_}}
|
||||
</div>
|
||||
<div class="header__search-input">
|
||||
<input type="text" placeholder="{{'page.search'|_}}">
|
||||
<a href="#" class="header__search-btn">
|
||||
<form action="{{ 'search' | page }}" method="get">
|
||||
<input type="searh" name="q" placeholder="{{'page.search'|_}}">
|
||||
<button class="header__search-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20.414" height="20.414"
|
||||
viewBox="0 0 20.414 20.414">
|
||||
<g id="Иконка_Поиск_" data-name="Иконка (Поиск)" transform="translate(1 1)">
|
||||
|
|
@ -29,7 +30,9 @@ code = "top-menu"
|
|||
stroke-linecap="round" stroke-linejoin="round" stroke-width="2" />
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<button class="hamBtn" id="menuBtn">
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
{{'page.more'|_}}
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{'assets/images/news/1.png'|theme}}" class="primary progressive replace">
|
||||
<a href="{{posts.first.featured_image|media}}" class="primary progressive replace">
|
||||
<img class="preview" src="{{'assets/images/lazy/1.jpg'|theme}}" alt="{{posts.first.title}}">
|
||||
</a>
|
||||
<div class="main__body-card">
|
||||
|
|
@ -27,7 +27,6 @@
|
|||
<span>{{posts.first.published_at|date('H:i')}}</span>
|
||||
</time> </span>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{'post'|page({id:posts.first.id,slug:posts.first.slug})}}" class="card__link">
|
||||
{{posts.first.title}}
|
||||
</a>
|
||||
|
|
@ -35,5 +34,5 @@
|
|||
|
||||
{% partial 'index/category_post_item' post = posts.1 %}
|
||||
{% partial 'index/category_post_item' post = posts.last %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ maxItems = 6
|
|||
<span>{{news.published_at|date('H:i')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{news.link}}" class="card__link">
|
||||
<a href="{{news.link}}" class="card__link" target="_blank">
|
||||
{{news.title}}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="event__body">
|
||||
<div class="event__body-row">
|
||||
<div class="event__body-image">
|
||||
<a href="{{'assets/images/news/1.png'|theme}}" class="primary progressive replace">
|
||||
<a href="{{firstPost.featured_image|media}}" class="primary progressive replace">
|
||||
<img class="preview" src="{{'assets/images/lazy/1.jpg'|theme}}" alt="{{firstPost.title}}">
|
||||
</a>
|
||||
<div class="event__body-card">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ exceptPost = "{{ :id }}"
|
|||
{% for post in posts %}
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<time class="news__date">
|
||||
<time class="card__header-date">
|
||||
<span>{{post.published_at|date('d.m.Y')}}</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4">
|
||||
<path id="Polygon_1" data-name="Polygon 1" d="M2,0,4,2,2,4,0,2Z" fill="#a2a2a2" />
|
||||
|
|
@ -37,7 +37,7 @@ exceptPost = "{{ :id }}"
|
|||
</div>
|
||||
</div>
|
||||
<a href="{{postPage|page({slug:post.slug,id:post.id})}}" class="card__link">
|
||||
<h6>{{post.title}}</h6>
|
||||
{{post.title}}
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<div class="partner">
|
||||
<div class="auto__container">
|
||||
<div class="partner__inner">
|
||||
|
||||
<div class="partner__title">
|
||||
МЕДИА ПАРТНЕРЫ
|
||||
</div>
|
||||
<div class="partnerSlider">
|
||||
<button class="p1">
|
||||
<span></span>
|
||||
</button>
|
||||
<button class="n1">
|
||||
<span></span>
|
||||
</button>
|
||||
<div class="partnerSlider__inner">
|
||||
<a href="" class="partnerSlider__item">
|
||||
<img src="images/partners/1.png" alt="">
|
||||
</a>
|
||||
<a href="#" class="partnerSlider__item">
|
||||
<img src="images/partners/2.png" alt="">
|
||||
</a>
|
||||
<a href="#" class="partnerSlider__item">
|
||||
<img src="images/partners/3.png" alt="">
|
||||
</a>
|
||||
<a href="#" class="partnerSlider__item">
|
||||
<img src="images/partners/4.png" alt="">
|
||||
</a>
|
||||
<a href="#" class="partnerSlider__item">
|
||||
<img src="images/partners/5.png" alt="">
|
||||
</a>
|
||||
<a href="#" class="partnerSlider__item">
|
||||
<img src="images/partners/1.png" alt="">
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
<div class="heading__row">
|
||||
<a href="{{'assets/images/news/1.png'|theme}}" class="heading__image primary progressive replace">
|
||||
<picture>
|
||||
|
||||
<img class="preview" src="{{post.featured_image|media}}" alt="">
|
||||
</picture>
|
||||
<a href="{{post.featured_image|media}}" class="heading__image primary progressive replace">
|
||||
<!-- <picture>-->
|
||||
<!-- <source media="min-width:650px" srcset="{{post.featured_image|media}}">-->
|
||||
<!-- <img class="preview" src="{{post.featured_image|media}}" alt="">-->
|
||||
<!-- </picture>-->
|
||||
<img class="preview" src="{{'assets/images/lazy/1.jpg'|theme}}" alt="">
|
||||
</a>
|
||||
<div class="heading__content">
|
||||
<div class="heading__content-header">
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<span>{{view}}</span>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitce290a037d2cbd6fc6b8d537449d0ac2::getLoader();
|
||||
|
|
@ -0,0 +1 @@
|
|||
../nesbot/carbon/bin/carbon
|
||||
|
|
@ -0,0 +1 @@
|
|||
../league/commonmark/bin/commonmark
|
||||
|
|
@ -0,0 +1 @@
|
|||
../doctrine/dbal/bin/doctrine-dbal
|
||||
|
|
@ -0,0 +1 @@
|
|||
../wikimedia/less.php/bin/lessc
|
||||
|
|
@ -0,0 +1 @@
|
|||
../php-parallel-lint/php-parallel-lint/parallel-lint
|
||||
|
|
@ -0,0 +1 @@
|
|||
../nikic/php-parser/bin/php-parse
|
||||
|
|
@ -0,0 +1 @@
|
|||
../squizlabs/php_codesniffer/bin/phpcbf
|
||||
|
|
@ -0,0 +1 @@
|
|||
../squizlabs/php_codesniffer/bin/phpcs
|
||||
|
|
@ -0,0 +1 @@
|
|||
../phpunit/phpunit/phpunit
|
||||
|
|
@ -0,0 +1 @@
|
|||
../scssphp/scssphp/bin/pscss
|
||||
|
|
@ -0,0 +1 @@
|
|||
../psy/psysh/bin/psysh
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
$dir = __DIR__.'/..';
|
||||
|
||||
if (!file_exists($dir.'/autoload.php')) {
|
||||
$dir = __DIR__.'/../vendor';
|
||||
}
|
||||
|
||||
if (!file_exists($dir.'/autoload.php')) {
|
||||
$dir = __DIR__.'/../../..';
|
||||
}
|
||||
|
||||
if (!file_exists($dir.'/autoload.php')) {
|
||||
echo 'Autoload not found.';
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$composerInstalled = false;
|
||||
|
||||
if (!file_exists($dir.'/composer/composer')) {
|
||||
$composerInstalled = true;
|
||||
shell_exec('composer require --dev composer/composer');
|
||||
}
|
||||
|
||||
include $dir.'/autoload.php';
|
||||
|
||||
Carbon\Upgrade::upgrade();
|
||||
|
||||
if ($composerInstalled) {
|
||||
shell_exec('composer remove --dev composer/composer');
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
|
@ -0,0 +1 @@
|
|||
../symfony/var-dumper/Resources/bin/var-dump-server
|
||||
|
|
@ -0,0 +1,445 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
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.
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
||||
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
||||
'DivisionByZeroError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
||||
'Error' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
||||
'JSMin' => $vendorDir . '/linkorb/jsmin-php/src/jsmin-1.1.1.php',
|
||||
'JSMinException' => $vendorDir . '/linkorb/jsmin-php/src/jsmin-1.1.1.php',
|
||||
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||
'ParseError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
||||
'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
||||
'TypeError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
||||
);
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||
'801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
|
||||
'ce89ac35a6c330c55f4710717db9ff78' => $vendorDir . '/kriswallsmith/assetic/src/functions.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'9ab6c0b43d4b818d98f088285310c9d9' => $vendorDir . '/october/rain/src/Support/helpers.php',
|
||||
'97af4f586841c1bd9dd1f8710561ecaa' => $vendorDir . '/october/rain/src/Html/helpers.php',
|
||||
'cd649ce7b2ed09f1b036b9e7e82de46e' => $vendorDir . '/october/rain/src/Parse/Assetic/Less/lessc.inc.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
|
||||
'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
|
||||
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||
);
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'),
|
||||
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
||||
'ParsedownExtra' => array($vendorDir . '/erusev/parsedown-extra'),
|
||||
'Parsedown' => array($vendorDir . '/erusev/parsedown'),
|
||||
'Less' => array($vendorDir . '/october/rain/src/Parse/Assetic/Less/lib'),
|
||||
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
|
||||
'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
|
||||
'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
|
||||
);
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'XdgBaseDir\\' => array($vendorDir . '/dnoegel/php-xdg-base-dir/src'),
|
||||
'Wikimedia\\Composer\\' => array($vendorDir . '/wikimedia/composer-merge-plugin/src'),
|
||||
'Twig\\' => array($vendorDir . '/twig/twig/src'),
|
||||
'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),
|
||||
'System\\' => array($baseDir . '/modules/system'),
|
||||
'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'),
|
||||
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
|
||||
'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'),
|
||||
'Symfony\\Polyfill\\Php56\\' => array($vendorDir . '/symfony/polyfill-php56'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
||||
'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'),
|
||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
|
||||
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
|
||||
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
|
||||
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
|
||||
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
|
||||
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
|
||||
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
|
||||
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
|
||||
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
|
||||
'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
|
||||
'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
|
||||
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
|
||||
'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'),
|
||||
'Psy\\' => array($vendorDir . '/psy/psysh/src'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
|
||||
'October\\Rain\\' => array($vendorDir . '/october/rain/src'),
|
||||
'October\\Demo\\' => array($baseDir . '/plugins/october/demo'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
|
||||
'League\\Csv\\' => array($vendorDir . '/league/csv/src'),
|
||||
'Leafo\\ScssPhp\\' => array($vendorDir . '/leafo/scssphp/src'),
|
||||
'Laravel\\Tinker\\' => array($vendorDir . '/laravel/tinker/src'),
|
||||
'Jenssegers\\Date\\' => array($vendorDir . '/jenssegers/date/src'),
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'),
|
||||
'JakubOnderka\\PhpConsoleColor\\' => array($vendorDir . '/jakub-onderka/php-console-color/src'),
|
||||
'Illuminate\\' => array($vendorDir . '/laravel/framework/src/Illuminate'),
|
||||
'Egulias\\EmailValidator\\' => array($vendorDir . '/egulias/email-validator/src'),
|
||||
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
|
||||
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'),
|
||||
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
|
||||
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
|
||||
'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'),
|
||||
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib/Doctrine/Common'),
|
||||
'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'),
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
'Cms\\' => array($baseDir . '/modules/cms'),
|
||||
'Backend\\' => array($baseDir . '/modules/backend'),
|
||||
'' => array($vendorDir . '/nesbot/carbon/src'),
|
||||
);
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitce290a037d2cbd6fc6b8d537449d0ac2
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitce290a037d2cbd6fc6b8d537449d0ac2', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitce290a037d2cbd6fc6b8d537449d0ac2', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirece290a037d2cbd6fc6b8d537449d0ac2($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirece290a037d2cbd6fc6b8d537449d0ac2($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,432 @@
|
|||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||
'801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php',
|
||||
'ce89ac35a6c330c55f4710717db9ff78' => __DIR__ . '/..' . '/kriswallsmith/assetic/src/functions.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'9ab6c0b43d4b818d98f088285310c9d9' => __DIR__ . '/..' . '/october/rain/src/Support/helpers.php',
|
||||
'97af4f586841c1bd9dd1f8710561ecaa' => __DIR__ . '/..' . '/october/rain/src/Html/helpers.php',
|
||||
'cd649ce7b2ed09f1b036b9e7e82de46e' => __DIR__ . '/..' . '/october/rain/src/Parse/Assetic/Less/lessc.inc.php',
|
||||
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php',
|
||||
'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
|
||||
'58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'X' =>
|
||||
array (
|
||||
'XdgBaseDir\\' => 11,
|
||||
),
|
||||
'W' =>
|
||||
array (
|
||||
'Wikimedia\\Composer\\' => 19,
|
||||
),
|
||||
'T' =>
|
||||
array (
|
||||
'Twig\\' => 5,
|
||||
'TijsVerkoyen\\CssToInlineStyles\\' => 31,
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'System\\' => 7,
|
||||
'Symfony\\Polyfill\\Util\\' => 22,
|
||||
'Symfony\\Polyfill\\Php72\\' => 23,
|
||||
'Symfony\\Polyfill\\Php70\\' => 23,
|
||||
'Symfony\\Polyfill\\Php56\\' => 23,
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
|
||||
'Symfony\\Polyfill\\Iconv\\' => 23,
|
||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||
'Symfony\\Component\\Yaml\\' => 23,
|
||||
'Symfony\\Component\\VarDumper\\' => 28,
|
||||
'Symfony\\Component\\Translation\\' => 30,
|
||||
'Symfony\\Component\\Routing\\' => 26,
|
||||
'Symfony\\Component\\Process\\' => 26,
|
||||
'Symfony\\Component\\HttpKernel\\' => 29,
|
||||
'Symfony\\Component\\HttpFoundation\\' => 33,
|
||||
'Symfony\\Component\\Finder\\' => 25,
|
||||
'Symfony\\Component\\EventDispatcher\\' => 34,
|
||||
'Symfony\\Component\\Debug\\' => 24,
|
||||
'Symfony\\Component\\CssSelector\\' => 30,
|
||||
'Symfony\\Component\\Console\\' => 26,
|
||||
),
|
||||
'R' =>
|
||||
array (
|
||||
'Ramsey\\Uuid\\' => 12,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psy\\' => 4,
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Container\\' => 14,
|
||||
'PhpParser\\' => 10,
|
||||
),
|
||||
'O' =>
|
||||
array (
|
||||
'October\\Rain\\' => 13,
|
||||
'October\\Demo\\' => 13,
|
||||
),
|
||||
'M' =>
|
||||
array (
|
||||
'Monolog\\' => 8,
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
'League\\Flysystem\\' => 17,
|
||||
'League\\Csv\\' => 11,
|
||||
'Leafo\\ScssPhp\\' => 14,
|
||||
'Laravel\\Tinker\\' => 15,
|
||||
),
|
||||
'J' =>
|
||||
array (
|
||||
'Jenssegers\\Date\\' => 16,
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' => 35,
|
||||
'JakubOnderka\\PhpConsoleColor\\' => 29,
|
||||
),
|
||||
'I' =>
|
||||
array (
|
||||
'Illuminate\\' => 11,
|
||||
),
|
||||
'E' =>
|
||||
array (
|
||||
'Egulias\\EmailValidator\\' => 23,
|
||||
),
|
||||
'D' =>
|
||||
array (
|
||||
'Dotenv\\' => 7,
|
||||
'Doctrine\\Common\\Lexer\\' => 22,
|
||||
'Doctrine\\Common\\Inflector\\' => 26,
|
||||
'Doctrine\\Common\\Cache\\' => 22,
|
||||
'Doctrine\\Common\\Annotations\\' => 28,
|
||||
'Doctrine\\Common\\' => 16,
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Cron\\' => 5,
|
||||
'Composer\\Installers\\' => 20,
|
||||
'Cms\\' => 4,
|
||||
),
|
||||
'B' =>
|
||||
array (
|
||||
'Backend\\' => 8,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'XdgBaseDir\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/dnoegel/php-xdg-base-dir/src',
|
||||
),
|
||||
'Wikimedia\\Composer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/wikimedia/composer-merge-plugin/src',
|
||||
),
|
||||
'Twig\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/src',
|
||||
),
|
||||
'TijsVerkoyen\\CssToInlineStyles\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/tijsverkoyen/css-to-inline-styles/src',
|
||||
),
|
||||
'System\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/modules/system',
|
||||
),
|
||||
'Symfony\\Polyfill\\Util\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-util',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php72\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php70\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php70',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php56\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php56',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
|
||||
),
|
||||
'Symfony\\Polyfill\\Intl\\Idn\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
||||
),
|
||||
'Symfony\\Polyfill\\Iconv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-iconv',
|
||||
),
|
||||
'Symfony\\Polyfill\\Ctype\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
),
|
||||
'Symfony\\Component\\Yaml\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/yaml',
|
||||
),
|
||||
'Symfony\\Component\\VarDumper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-dumper',
|
||||
),
|
||||
'Symfony\\Component\\Translation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/translation',
|
||||
),
|
||||
'Symfony\\Component\\Routing\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/routing',
|
||||
),
|
||||
'Symfony\\Component\\Process\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/process',
|
||||
),
|
||||
'Symfony\\Component\\HttpKernel\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-kernel',
|
||||
),
|
||||
'Symfony\\Component\\HttpFoundation\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/http-foundation',
|
||||
),
|
||||
'Symfony\\Component\\Finder\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/finder',
|
||||
),
|
||||
'Symfony\\Component\\EventDispatcher\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/event-dispatcher',
|
||||
),
|
||||
'Symfony\\Component\\Debug\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/debug',
|
||||
),
|
||||
'Symfony\\Component\\CssSelector\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/css-selector',
|
||||
),
|
||||
'Symfony\\Component\\Console\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/console',
|
||||
),
|
||||
'Ramsey\\Uuid\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/ramsey/uuid/src',
|
||||
),
|
||||
'Psy\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psy/psysh/src',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'PhpParser\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser',
|
||||
),
|
||||
'October\\Rain\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/october/rain/src',
|
||||
),
|
||||
'October\\Demo\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/plugins/october/demo',
|
||||
),
|
||||
'Monolog\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
|
||||
),
|
||||
'League\\Flysystem\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/league/flysystem/src',
|
||||
),
|
||||
'League\\Csv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/league/csv/src',
|
||||
),
|
||||
'Leafo\\ScssPhp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/leafo/scssphp/src',
|
||||
),
|
||||
'Laravel\\Tinker\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/tinker/src',
|
||||
),
|
||||
'Jenssegers\\Date\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jenssegers/date/src',
|
||||
),
|
||||
'JakubOnderka\\PhpConsoleHighlighter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src',
|
||||
),
|
||||
'JakubOnderka\\PhpConsoleColor\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src',
|
||||
),
|
||||
'Illuminate\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate',
|
||||
),
|
||||
'Egulias\\EmailValidator\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/egulias/email-validator/src',
|
||||
),
|
||||
'Dotenv\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
|
||||
),
|
||||
'Doctrine\\Common\\Lexer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer',
|
||||
),
|
||||
'Doctrine\\Common\\Inflector\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector',
|
||||
),
|
||||
'Doctrine\\Common\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache',
|
||||
),
|
||||
'Doctrine\\Common\\Annotations\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations',
|
||||
),
|
||||
'Doctrine\\Common\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common',
|
||||
),
|
||||
'Cron\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron',
|
||||
),
|
||||
'Composer\\Installers\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
||||
),
|
||||
'Cms\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/modules/cms',
|
||||
),
|
||||
'Backend\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/modules/backend',
|
||||
),
|
||||
);
|
||||
|
||||
public static $fallbackDirsPsr4 = array (
|
||||
0 => __DIR__ . '/..' . '/nesbot/carbon/src',
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'U' =>
|
||||
array (
|
||||
'UpdateHelper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/kylekatarnls/update-helper/src',
|
||||
),
|
||||
),
|
||||
'T' =>
|
||||
array (
|
||||
'Twig_' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/lib',
|
||||
),
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'ParsedownExtra' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/erusev/parsedown-extra',
|
||||
),
|
||||
'Parsedown' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/erusev/parsedown',
|
||||
),
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
'Less' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/october/rain/src/Parse/Assetic/Less/lib',
|
||||
),
|
||||
),
|
||||
'D' =>
|
||||
array (
|
||||
'Doctrine\\DBAL\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/dbal/lib',
|
||||
),
|
||||
'Doctrine\\Common\\Collections\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/doctrine/collections/lib',
|
||||
),
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
'Assetic' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/kriswallsmith/assetic/src',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
||||
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
||||
'DivisionByZeroError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
||||
'Error' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
||||
'JSMin' => __DIR__ . '/..' . '/linkorb/jsmin-php/src/jsmin-1.1.1.php',
|
||||
'JSMinException' => __DIR__ . '/..' . '/linkorb/jsmin-php/src/jsmin-1.1.1.php',
|
||||
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||
'ParseError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
||||
'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
||||
'TypeError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$prefixDirsPsr4;
|
||||
$loader->fallbackDirsPsr4 = ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$fallbackDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInitce290a037d2cbd6fc6b8d537449d0ac2::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,70 @@
|
|||
name: "Continuous Integration"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "CI"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "5.3"
|
||||
- "5.4"
|
||||
- "5.5"
|
||||
- "5.6"
|
||||
- "7.0"
|
||||
- "7.1"
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
- "8.1"
|
||||
dependencies: [locked]
|
||||
include:
|
||||
- php-version: "5.3"
|
||||
dependencies: lowest
|
||||
- php-version: "8.1"
|
||||
dependencies: lowest
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composercache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composercache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: "Handle lowest dependencies update"
|
||||
if: "contains(matrix.dependencies, 'lowest')"
|
||||
run: "echo \"COMPOSER_FLAGS=$COMPOSER_FLAGS --prefer-lowest\" >> $GITHUB_ENV"
|
||||
|
||||
- name: "Install latest dependencies"
|
||||
run: |
|
||||
# Remove PHPStan as it requires a newer PHP
|
||||
composer remove phpstan/phpstan phpstan/phpstan-phpunit --dev --no-update
|
||||
composer update ${{ env.COMPOSER_FLAGS }}
|
||||
|
||||
- name: "Run tests"
|
||||
run: "vendor/bin/simple-phpunit --verbose"
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
name: "PHP Lint"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "Lint"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "5.3"
|
||||
- "8.0"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
|
||||
- name: "Lint PHP files"
|
||||
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
name: "PHPStan"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_VERSION: ""
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "PHPStan"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
# pinned to 7.4 because we need PHPUnit 7.5 which does not support PHP 8
|
||||
- "7.4"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composercache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composercache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: "Install latest dependencies"
|
||||
run: "composer update ${{ env.COMPOSER_FLAGS }}"
|
||||
|
||||
- name: Run PHPStan
|
||||
# Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
|
||||
run: |
|
||||
composer require --dev phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
|
||||
vendor/bin/phpstan analyse
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2012 Kyle Robinson Young
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
{
|
||||
"name": "composer/installers",
|
||||
"type": "composer-plugin",
|
||||
"license": "MIT",
|
||||
"description": "A multi-framework Composer library installer",
|
||||
"keywords": [
|
||||
"installer",
|
||||
"Aimeos",
|
||||
"AGL",
|
||||
"AnnotateCms",
|
||||
"Attogram",
|
||||
"Bitrix",
|
||||
"CakePHP",
|
||||
"Chef",
|
||||
"Cockpit",
|
||||
"CodeIgniter",
|
||||
"concrete5",
|
||||
"Craft",
|
||||
"Croogo",
|
||||
"DokuWiki",
|
||||
"Dolibarr",
|
||||
"Drupal",
|
||||
"Elgg",
|
||||
"Eliasis",
|
||||
"ExpressionEngine",
|
||||
"eZ Platform",
|
||||
"FuelPHP",
|
||||
"Grav",
|
||||
"Hurad",
|
||||
"ImageCMS",
|
||||
"iTop",
|
||||
"Joomla",
|
||||
"Kanboard",
|
||||
"Known",
|
||||
"Kohana",
|
||||
"Lan Management System",
|
||||
"Laravel",
|
||||
"Lavalite",
|
||||
"Lithium",
|
||||
"Magento",
|
||||
"majima",
|
||||
"Mako",
|
||||
"MantisBT",
|
||||
"Mautic",
|
||||
"Maya",
|
||||
"MODX",
|
||||
"MODX Evo",
|
||||
"MediaWiki",
|
||||
"OXID",
|
||||
"osclass",
|
||||
"MODULEWork",
|
||||
"Moodle",
|
||||
"Piwik",
|
||||
"pxcms",
|
||||
"phpBB",
|
||||
"Plentymarkets",
|
||||
"PPI",
|
||||
"Puppet",
|
||||
"Porto",
|
||||
"RadPHP",
|
||||
"ReIndex",
|
||||
"Roundcube",
|
||||
"shopware",
|
||||
"SilverStripe",
|
||||
"SMF",
|
||||
"SyDES",
|
||||
"Sylius",
|
||||
"symfony",
|
||||
"Thelia",
|
||||
"TYPO3",
|
||||
"WHMCS",
|
||||
"WolfCMS",
|
||||
"WordPress",
|
||||
"YAWIK",
|
||||
"Zend",
|
||||
"Zikula"
|
||||
],
|
||||
"homepage": "https://composer.github.io/installers/",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Kyle Robinson Young",
|
||||
"email": "kyle@dontkry.com",
|
||||
"homepage": "https://github.com/shama"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
|
||||
},
|
||||
"extra": {
|
||||
"class": "Composer\\Installers\\Plugin",
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"replace": {
|
||||
"shama/baton": "*",
|
||||
"roundcube/plugin-installer": "*"
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^1.0 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "1.6.* || 2.0.*@dev",
|
||||
"composer/semver": "1.0.* || 2.0.*@dev",
|
||||
"phpunit/phpunit": "^4.8.36",
|
||||
"sebastian/comparator": "^1.2.4",
|
||||
"symfony/process": "^2.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "phpunit"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
parameters:
|
||||
level: 5
|
||||
paths:
|
||||
- src
|
||||
- tests
|
||||
excludes_analyse:
|
||||
- tests/Composer/Installers/Test/PolyfillTestCase.php
|
||||
|
||||
includes:
|
||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AglInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'More/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
|
||||
return strtoupper($matches[1]);
|
||||
}, $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AimeosInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$name}/',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AnnotateCmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'addons/modules/{$name}/',
|
||||
'component' => 'addons/components/{$name}/',
|
||||
'service' => 'addons/services/{$name}/',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AsgardInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'Modules/{$name}/',
|
||||
'theme' => 'Themes/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type asgard-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type asgard-theme, cut off a trailing '-theme' if present.
|
||||
*
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($vars['type'] === 'asgard-module') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'asgard-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectPluginVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AttogramInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Composer;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
abstract class BaseInstaller
|
||||
{
|
||||
protected $locations = array();
|
||||
protected $composer;
|
||||
protected $package;
|
||||
protected $io;
|
||||
|
||||
/**
|
||||
* Initializes base installer.
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param Composer $composer
|
||||
* @param IOInterface $io
|
||||
*/
|
||||
public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
|
||||
{
|
||||
$this->composer = $composer;
|
||||
$this->package = $package;
|
||||
$this->io = $io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the install path based on package type.
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param string $frameworkType
|
||||
* @return string
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
||||
{
|
||||
$type = $this->package->getType();
|
||||
|
||||
$prettyName = $this->package->getPrettyName();
|
||||
if (strpos($prettyName, '/') !== false) {
|
||||
list($vendor, $name) = explode('/', $prettyName);
|
||||
} else {
|
||||
$vendor = '';
|
||||
$name = $prettyName;
|
||||
}
|
||||
|
||||
$availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
|
||||
|
||||
$extra = $package->getExtra();
|
||||
if (!empty($extra['installer-name'])) {
|
||||
$availableVars['name'] = $extra['installer-name'];
|
||||
}
|
||||
|
||||
if ($this->composer->getPackage()) {
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
if (!empty($extra['installer-paths'])) {
|
||||
$customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
|
||||
if ($customPath !== false) {
|
||||
return $this->templatePath($customPath, $availableVars);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$packageType = substr($type, strlen($frameworkType) + 1);
|
||||
$locations = $this->getLocations();
|
||||
if (!isset($locations[$packageType])) {
|
||||
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
|
||||
}
|
||||
|
||||
return $this->templatePath($locations[$packageType], $availableVars);
|
||||
}
|
||||
|
||||
/**
|
||||
* For an installer to override to modify the vars per installer.
|
||||
*
|
||||
* @param array $vars
|
||||
* @return array
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the installer's locations
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getLocations()
|
||||
{
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace vars in a path
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $vars
|
||||
* @return string
|
||||
*/
|
||||
protected function templatePath($path, array $vars = array())
|
||||
{
|
||||
if (strpos($path, '{') !== false) {
|
||||
extract($vars);
|
||||
preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
|
||||
if (!empty($matches[1])) {
|
||||
foreach ($matches[1] as $var) {
|
||||
$path = str_replace('{$' . $var . '}', $$var, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search through a passed paths array for a custom install path.
|
||||
*
|
||||
* @param array $paths
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
* @param string $vendor = NULL
|
||||
* @return string
|
||||
*/
|
||||
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
|
||||
{
|
||||
foreach ($paths as $path => $names) {
|
||||
$names = (array) $names;
|
||||
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Util\Filesystem;
|
||||
|
||||
/**
|
||||
* Installer for Bitrix Framework. Supported types of extensions:
|
||||
* - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
|
||||
* - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
|
||||
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
|
||||
*
|
||||
* You can set custom path to directory with Bitrix kernel in `composer.json`:
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "extra": {
|
||||
* "bitrix-dir": "s1/bitrix"
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @author Nik Samokhvalov <nik@samokhvalov.info>
|
||||
* @author Denis Kulichkin <onexhovia@gmail.com>
|
||||
*/
|
||||
class BitrixInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
||||
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
|
||||
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
|
||||
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Storage for informations about duplicates at all the time of installation packages.
|
||||
*/
|
||||
private static $checkedDuplicates = array();
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($this->composer->getPackage()) {
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
|
||||
if (isset($extra['bitrix-dir'])) {
|
||||
$vars['bitrix_dir'] = $extra['bitrix-dir'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($vars['bitrix_dir'])) {
|
||||
$vars['bitrix_dir'] = 'bitrix';
|
||||
}
|
||||
|
||||
return parent::inflectPackageVars($vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function templatePath($path, array $vars = array())
|
||||
{
|
||||
$templatePath = parent::templatePath($path, $vars);
|
||||
$this->checkDuplicates($templatePath, $vars);
|
||||
|
||||
return $templatePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicates search packages.
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $vars
|
||||
*/
|
||||
protected function checkDuplicates($path, array $vars = array())
|
||||
{
|
||||
$packageType = substr($vars['type'], strlen('bitrix') + 1);
|
||||
$localDir = explode('/', $vars['bitrix_dir']);
|
||||
array_pop($localDir);
|
||||
$localDir[] = 'local';
|
||||
$localDir = implode('/', $localDir);
|
||||
|
||||
$oldPath = str_replace(
|
||||
array('{$bitrix_dir}', '{$name}'),
|
||||
array($localDir, $vars['name']),
|
||||
$this->locations[$packageType]
|
||||
);
|
||||
|
||||
if (in_array($oldPath, static::$checkedDuplicates)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
|
||||
|
||||
$this->io->writeError(' <error>Duplication of packages:</error>');
|
||||
$this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
|
||||
|
||||
while (true) {
|
||||
switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
|
||||
case 'y':
|
||||
$fs = new Filesystem();
|
||||
$fs->removeDirectory($oldPath);
|
||||
break 2;
|
||||
|
||||
case 'n':
|
||||
break 2;
|
||||
|
||||
case '?':
|
||||
default:
|
||||
$this->io->writeError(array(
|
||||
' y - delete package ' . $oldPath . ' and to continue with the installation',
|
||||
' n - don\'t delete and to continue with the installation',
|
||||
));
|
||||
$this->io->writeError(' ? - print help');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static::$checkedDuplicates[] = $oldPath;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BonefishInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/{$vendor}/{$name}/'
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
|
||||
class CakePHPInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'Plugin/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars($vars)
|
||||
{
|
||||
if ($this->matchesCakeVersion('>=', '3.0.0')) {
|
||||
return $vars;
|
||||
}
|
||||
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
||||
$value = str_replace(array('-', '_'), ' ', $value);
|
||||
$value = str_replace(' ', '', ucwords($value));
|
||||
}
|
||||
$vars['name'] = implode('/', $nameParts);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the default plugin location when cakephp >= 3.0
|
||||
*/
|
||||
public function getLocations()
|
||||
{
|
||||
if ($this->matchesCakeVersion('>=', '3.0.0')) {
|
||||
$this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
|
||||
}
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if CakePHP version matches against a version
|
||||
*
|
||||
* @param string $matcher
|
||||
* @param string $version
|
||||
* @return bool
|
||||
*/
|
||||
protected function matchesCakeVersion($matcher, $version)
|
||||
{
|
||||
if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
|
||||
$multiClass = 'Composer\Semver\Constraint\MultiConstraint';
|
||||
$constraintClass = 'Composer\Semver\Constraint\Constraint';
|
||||
} else {
|
||||
$multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
|
||||
$constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
|
||||
}
|
||||
|
||||
$repositoryManager = $this->composer->getRepositoryManager();
|
||||
if (! $repositoryManager) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$repos = $repositoryManager->getLocalRepository();
|
||||
if (!$repos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $repos->findPackage('cakephp/cakephp', new $constraintClass($matcher, $version)) !== null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ChefInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'cookbook' => 'Chef/{$vendor}/{$name}/',
|
||||
'role' => 'Chef/roles/{$name}/',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CiviCrmInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ext' => 'ext/{$name}/'
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue