upgrading to timber v2
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
{
|
||||
"require": {
|
||||
"tightenco/collect": "^7.5",
|
||||
"twig/twig": "2.12.5",
|
||||
"gregwar/formidable": "^2.1",
|
||||
"rmccue/requests": "^1.7"
|
||||
"rmccue/requests": "^1.7",
|
||||
"timber/timber": "^2.3",
|
||||
"illuminate/collections": "^12.21",
|
||||
"upstatement/routes": "^0.9.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"agencearcange/wp-twig-dump": "^1.1"
|
||||
}
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"composer/installers": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "src/"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
901
composer.lock
generated
901
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
require_once(get_template_directory().'/app.php');
|
||||
namespace App;
|
||||
|
||||
use Timber\Timber;
|
||||
|
||||
//require_once(get_template_directory().'/app.php');
|
||||
|
||||
include(__DIR__ .'/vendor/autoload.php');
|
||||
|
||||
//~ use WeDevs\ORM\WP\Post as Post;
|
||||
//~ composer require jgrossi/corcel
|
||||
|
||||
@@ -11,30 +17,7 @@ function create_team_type() {
|
||||
/*dump($obj->build_cpt());*/
|
||||
register_post_type( $obj->slug, $obj->build_cpt() );
|
||||
}
|
||||
add_action( 'init', 'create_team_type' );
|
||||
|
||||
Routes::map('equipo/:slug', function($params){
|
||||
$query = '';
|
||||
Routes::load('team-member.php', $params, $query, 200);
|
||||
});
|
||||
|
||||
Routes::map('actualidad', function($params){
|
||||
$query = '';
|
||||
Routes::load('actualidad.php', $params, $query, 200);
|
||||
});
|
||||
//~ Routes::map('actualidad/page/:page', function($params){
|
||||
//~ $query = '';
|
||||
//~ $params = [
|
||||
//~ 'pg' => $params['page']
|
||||
//~ ];
|
||||
//~ $query = 'posts_per_page=3&paged='.intval($params['pg']);
|
||||
//~ Routes::load('actualidad.php', $params, $query, 200);
|
||||
//~ });
|
||||
|
||||
Routes::map('proyectos', function($params){
|
||||
$query = '';
|
||||
Routes::load('proyectos.php', $params, $query, 200);
|
||||
});
|
||||
//add_action( 'init', 'create_team_type' );
|
||||
|
||||
// templatetag para rellenar con contenido dinamico la plantilla en desarollo
|
||||
function frontpage_posts($numberposts=-1,$template_name='frontpage_post.twig') {
|
||||
@@ -85,55 +68,17 @@ function andaira_gallery($attr) {
|
||||
}
|
||||
// Fin galeria
|
||||
|
||||
class AndairaSite extends StarterSite{
|
||||
public $enable_ua = true;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||
$this->recaptcha_secret = '6Ldp7-cUAAAAALND-F6N211yRaam8jBF_W_jkzg_';
|
||||
$this->recaptcha_public = '6Ldp7-cUAAAAANJ68d2DomQJn-TbnUxfVPNHm95K';
|
||||
$this->CONTACT_FORM = dirname( __FILE__ ).'/templates/form_contact.html';
|
||||
}
|
||||
function add_to_context( $context ) {
|
||||
$context = parent::add_to_context($context);
|
||||
// Servicios
|
||||
$svs = array(
|
||||
'child_of' => 27,
|
||||
'parent ' => 27,
|
||||
'hierarchical' => 0,
|
||||
'sort_column' => 'menu_order',
|
||||
'sort_order' => 'asc',
|
||||
'post_type' => 'page',
|
||||
'post_status' => 'publish',
|
||||
);
|
||||
$servicios = get_pages( $svs );
|
||||
$context['servicios'] = new Timber\PostQuery($servicios);
|
||||
//return $context;
|
||||
|
||||
// Areas
|
||||
$areas = get_terms( [
|
||||
'taxonomy' => 'category',
|
||||
'parent' => 29,
|
||||
'hide_empty' => false,
|
||||
]
|
||||
);
|
||||
//dump($areas);
|
||||
$context['areas'] = $areas;
|
||||
|
||||
//Logotipos
|
||||
$context['logotipo_cabecera'] = get_field('logotipo_cabecera', 'option');
|
||||
|
||||
return $context;
|
||||
}
|
||||
}
|
||||
|
||||
// Paginacion
|
||||
$context['pagination'] = Timber::get_pagination();
|
||||
//$context['pagination'] = Timber::get_pagination();
|
||||
|
||||
// Galeria
|
||||
add_shortcode('gallery', 'andaira_gallery');
|
||||
|
||||
Timber::init();
|
||||
|
||||
$site = new AndairaSite();
|
||||
//~ $site->main_menu_id = 2;
|
||||
|
||||
if (defined('WP_CLI') && WP_CLI) {require_once dirname(__FILE__).'/scripts/commands.php';}
|
||||
?>
|
||||
|
||||
|
||||
4
page.php
4
page.php
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$context = Timber::get_context();
|
||||
$post = new TimberPost();
|
||||
$context = Timber::context();
|
||||
$post = Timber::get_post();
|
||||
$context['post'] = $post;
|
||||
$context['entries'] = Timber::get_posts('post_type = post');
|
||||
//var_dump( Timber::get_posts('post_type = post'));
|
||||
|
||||
67
src/AndairaSite.php
Normal file
67
src/AndairaSite.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Timber\Site;
|
||||
use Timber\Timber;
|
||||
use Twig\Environment;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
|
||||
\Routes::map('equipo/:slug', function($params){
|
||||
$query = '';
|
||||
\Routes::load('team-member.php', $params, $query, 200);
|
||||
});
|
||||
|
||||
\Routes::map('actualidad', function($params){
|
||||
$query = '';
|
||||
\Routes::load('actualidad.php', $params, $query, 200);
|
||||
});
|
||||
|
||||
\Routes::map('proyectos', function($params){
|
||||
$query = '';
|
||||
\Routes::load('proyectos.php', $params, $query, 200);
|
||||
});
|
||||
|
||||
class AndairaSite extends Site {
|
||||
public $enable_ua = true;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||
$this->recaptcha_secret = '6Ldp7-cUAAAAALND-F6N211yRaam8jBF_W_jkzg_';
|
||||
$this->recaptcha_public = '6Ldp7-cUAAAAANJ68d2DomQJn-TbnUxfVPNHm95K';
|
||||
$this->CONTACT_FORM = dirname( __FILE__ ).'/templates/form_contact.html';
|
||||
}
|
||||
function add_to_context( $context ) {
|
||||
$context = parent::add_to_context($context);
|
||||
// Servicios
|
||||
$svs = array(
|
||||
'child_of' => 27,
|
||||
'parent ' => 27,
|
||||
'hierarchical' => 0,
|
||||
'sort_column' => 'menu_order',
|
||||
'sort_order' => 'asc',
|
||||
'post_type' => 'page',
|
||||
'post_status' => 'publish',
|
||||
);
|
||||
$servicios = get_pages( $svs );
|
||||
$context['servicios'] = new Timber\PostQuery($servicios);
|
||||
//return $context;
|
||||
|
||||
// Areas
|
||||
$areas = get_terms( [
|
||||
'taxonomy' => 'category',
|
||||
'parent' => 29,
|
||||
'hide_empty' => false,
|
||||
]
|
||||
);
|
||||
//dump($areas);
|
||||
$context['areas'] = $areas;
|
||||
|
||||
//Logotipos
|
||||
$context['logotipo_cabecera'] = get_field('logotipo_cabecera', 'option');
|
||||
|
||||
return $context;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ Version: 1.0
|
||||
Description: Child Theme de Timber adpatado para este sitio web.
|
||||
Author: Freepress S. Coop. Mad. y Estudio Nexos
|
||||
Author URI: http://www.freepress.coop
|
||||
Template: TimberBase
|
||||
*/
|
||||
|
||||
body { font-family: 'Karla', sans-serif; font-size:16px; line-height:25px; }
|
||||
|
||||
25
vendor/agencearcange/wp-twig-dump/README.md
vendored
25
vendor/agencearcange/wp-twig-dump/README.md
vendored
@@ -1,25 +0,0 @@
|
||||
# Wordpress Twig dump()
|
||||
|
||||
This must use plugin allow `{{ dump() }}` for your WordPress development.
|
||||
|
||||
## Specifications
|
||||
|
||||
* Timber libray was needed
|
||||
* Autoload your must-use plugins with [bedrock-autoloader](https://github.com/roots/bedrock/blob/master/web/app/mu-plugins/bedrock-autoloader.php)
|
||||
|
||||
Tested with :
|
||||
|
||||
* Wordpress 4.5.* => 5.3.*
|
||||
* Wordpress single / multi website
|
||||
|
||||
### Installation
|
||||
|
||||
#### With composer
|
||||
|
||||
```
|
||||
composer require agencearcange/wp-twig-dump --dev
|
||||
```
|
||||
|
||||
#### Without composer
|
||||
|
||||
Just copy this plugin into your `plugin` / `muplugin` folder
|
||||
11
vendor/agencearcange/wp-twig-dump/composer.json
vendored
11
vendor/agencearcange/wp-twig-dump/composer.json
vendored
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "agencearcange/wp-twig-dump",
|
||||
"description": "Allow dump() in twig templates",
|
||||
"keywords": ["wordpress", "plugin", "timber", "twig"],
|
||||
"homepage": "https://github.com/agencearcange/arcange-wpdump",
|
||||
"type": "wordpress-muplugin",
|
||||
"license": "GPLv2",
|
||||
"require": {
|
||||
"hellonico/twig-dump-extension": "^1.0"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: WP Twig dump()
|
||||
* Description: Var Dumper if WP_DEBUG_DISPLAY == true For Timber Library
|
||||
* Version: 1.1
|
||||
*/
|
||||
|
||||
if (defined('WP_DEBUG_DISPLAY') && WP_DEBUG && function_exists('add_filter')) {
|
||||
add_filter('timber/loader/twig', function($twig) {
|
||||
$twig->addExtension(new HelloNico\Twig\DumpExtension());
|
||||
return $twig;
|
||||
});
|
||||
}
|
||||
20
vendor/altorouter/altorouter/.github/workflows/php-check-syntax.yml
vendored
Normal file
20
vendor/altorouter/altorouter/.github/workflows/php-check-syntax.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Check PHP syntax
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', 'highest']
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
|
||||
- name: checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- run: composer run check-syntax
|
||||
39
vendor/altorouter/altorouter/.github/workflows/php.yml
vendored
Normal file
39
vendor/altorouter/altorouter/.github/workflows/php.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: PHP
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: [ '7.3', 'highest' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||
run: composer install --no-progress
|
||||
|
||||
- name: Run test suite
|
||||
run: composer run-script test
|
||||
300
vendor/altorouter/altorouter/AltoRouter.php
vendored
Normal file
300
vendor/altorouter/altorouter/AltoRouter.php
vendored
Normal file
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
class AltoRouter
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array Array of all routes (incl. named routes).
|
||||
*/
|
||||
protected $routes = [];
|
||||
|
||||
/**
|
||||
* @var array Array of all named routes.
|
||||
*/
|
||||
protected $namedRoutes = [];
|
||||
|
||||
/**
|
||||
* @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
|
||||
*/
|
||||
protected $basePath = '';
|
||||
|
||||
/**
|
||||
* @var array Array of default match types (regex helpers)
|
||||
*/
|
||||
protected $matchTypes = [
|
||||
'i' => '[0-9]++',
|
||||
'a' => '[0-9A-Za-z]++',
|
||||
'h' => '[0-9A-Fa-f]++',
|
||||
'*' => '.+?',
|
||||
'**' => '.++',
|
||||
'' => '[^/\.]++'
|
||||
];
|
||||
|
||||
/**
|
||||
* Create router in one call from config.
|
||||
*
|
||||
* @param array $routes
|
||||
* @param string $basePath
|
||||
* @param array $matchTypes
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(array $routes = [], string $basePath = '', array $matchTypes = [])
|
||||
{
|
||||
$this->addRoutes($routes);
|
||||
$this->setBasePath($basePath);
|
||||
$this->addMatchTypes($matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all routes.
|
||||
* Useful if you want to process or display routes.
|
||||
* @return array All routes.
|
||||
*/
|
||||
public function getRoutes(): array
|
||||
{
|
||||
return $this->routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple routes at once from array in the following format:
|
||||
*
|
||||
* $routes = [
|
||||
* [$method, $route, $target, $name]
|
||||
* ];
|
||||
*
|
||||
* @param array $routes
|
||||
* @return void
|
||||
* @author Koen Punt
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addRoutes($routes)
|
||||
{
|
||||
if (!is_array($routes) && !$routes instanceof Traversable) {
|
||||
throw new RuntimeException('Routes should be an array or an instance of Traversable');
|
||||
}
|
||||
foreach ($routes as $route) {
|
||||
call_user_func_array([$this, 'map'], $route);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base path.
|
||||
* Useful if you are running your application from a subdirectory.
|
||||
* @param string $basePath
|
||||
*/
|
||||
public function setBasePath(string $basePath)
|
||||
{
|
||||
$this->basePath = $basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add named match types. It uses array_merge so keys can be overwritten.
|
||||
*
|
||||
* @param array $matchTypes The key is the name and the value is the regex.
|
||||
*/
|
||||
public function addMatchTypes(array $matchTypes)
|
||||
{
|
||||
$this->matchTypes = array_merge($this->matchTypes, $matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a route to a target
|
||||
*
|
||||
* @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
|
||||
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
|
||||
* @param mixed $target The target where this route should point to. Can be anything.
|
||||
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function map(string $method, string $route, $target, ?string $name = null)
|
||||
{
|
||||
|
||||
$this->routes[] = [$method, $route, $target, $name];
|
||||
|
||||
if ($name) {
|
||||
if (isset($this->namedRoutes[$name])) {
|
||||
throw new RuntimeException("Can not redeclare route '{$name}'");
|
||||
}
|
||||
$this->namedRoutes[$name] = $route;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reversed routing
|
||||
*
|
||||
* Generate the URL for a named route. Replace regexes with supplied parameters
|
||||
*
|
||||
* @param string $routeName The name of the route.
|
||||
* @param array $params Associative array of parameters to replace placeholders with.
|
||||
* @return string The URL of the route with named parameters in place.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function generate(string $routeName, array $params = []): string
|
||||
{
|
||||
|
||||
// Check if named route exists
|
||||
if (!isset($this->namedRoutes[$routeName])) {
|
||||
throw new RuntimeException("Route '{$routeName}' does not exist.");
|
||||
}
|
||||
|
||||
// Replace named parameters
|
||||
$route = $this->namedRoutes[$routeName];
|
||||
|
||||
// prepend base path to route url again
|
||||
$url = $this->basePath . $route;
|
||||
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $index => $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if ($pre) {
|
||||
$block = substr($block, 1);
|
||||
}
|
||||
|
||||
if (isset($params[$param])) {
|
||||
// Part is found, replace for param value
|
||||
$url = str_replace($block, $params[$param], $url);
|
||||
} elseif ($optional && $index !== 0) {
|
||||
// Only strip preceding slash if it's not at the base
|
||||
$url = str_replace($pre . $block, '', $url);
|
||||
} else {
|
||||
// Strip match block
|
||||
$url = str_replace($block, '', $url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Match a given Request Url against stored routes
|
||||
* @param string $requestUrl
|
||||
* @param string $requestMethod
|
||||
* @return array|boolean Array with route information on success, false on failure (no match).
|
||||
*/
|
||||
public function match(?string $requestUrl = null, ?string $requestMethod = null)
|
||||
{
|
||||
|
||||
$params = [];
|
||||
|
||||
// set Request Url if it isn't passed as parameter
|
||||
if ($requestUrl === null) {
|
||||
$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
|
||||
}
|
||||
|
||||
// strip base path from request url
|
||||
$requestUrl = substr($requestUrl, strlen($this->basePath));
|
||||
|
||||
// Strip query string (?a=b) from Request Url
|
||||
if (($strpos = strpos($requestUrl, '?')) !== false) {
|
||||
$requestUrl = substr($requestUrl, 0, $strpos);
|
||||
}
|
||||
|
||||
$lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';
|
||||
|
||||
// set Request Method if it isn't passed as a parameter
|
||||
if ($requestMethod === null) {
|
||||
$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
||||
}
|
||||
|
||||
foreach ($this->routes as $handler) {
|
||||
list($methods, $route, $target, $name) = $handler;
|
||||
|
||||
$method_match = (stripos($methods, $requestMethod) !== false);
|
||||
|
||||
// Method did not match, continue to next route.
|
||||
if (!$method_match) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($route === '*') {
|
||||
// * wildcard (matches all)
|
||||
$match = true;
|
||||
} elseif (isset($route[0]) && $route[0] === '@') {
|
||||
// @ regex delimiter
|
||||
$pattern = '`' . substr($route, 1) . '`u';
|
||||
$match = preg_match($pattern, $requestUrl, $params) === 1;
|
||||
} elseif (($position = strpos($route, '[')) === false) {
|
||||
// No params in url, do string comparison
|
||||
$match = strcmp($requestUrl, $route) === 0;
|
||||
} else {
|
||||
// Compare longest non-param string with url before moving on to regex
|
||||
// Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)
|
||||
if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$regex = $this->compileRoute($route);
|
||||
$match = preg_match($regex, $requestUrl, $params) === 1;
|
||||
}
|
||||
|
||||
if ($match) {
|
||||
if ($params) {
|
||||
foreach ($params as $key => $value) {
|
||||
if (is_numeric($key)) {
|
||||
unset($params[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'target' => $target,
|
||||
'params' => $params,
|
||||
'name' => $name
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile the regex for a given route (EXPENSIVE)
|
||||
* @param string $route
|
||||
* @return string
|
||||
*/
|
||||
protected function compileRoute(string $route): string
|
||||
{
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
$matchTypes = $this->matchTypes;
|
||||
foreach ($matches as $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if (isset($matchTypes[$type])) {
|
||||
$type = $matchTypes[$type];
|
||||
}
|
||||
if ($pre === '.') {
|
||||
$pre = '\.';
|
||||
}
|
||||
|
||||
$optional = $optional !== '' ? '?' : null;
|
||||
|
||||
//Older versions of PCRE require the 'P' in (?P<named>)
|
||||
$pattern = '(?:'
|
||||
. ($pre !== '' ? $pre : null)
|
||||
. '('
|
||||
. ($param !== '' ? "?P<$param>" : null)
|
||||
. $type
|
||||
. ')'
|
||||
. $optional
|
||||
. ')'
|
||||
. $optional;
|
||||
|
||||
$route = str_replace($block, $pattern, $route);
|
||||
}
|
||||
}
|
||||
return "`^$route$`u";
|
||||
}
|
||||
}
|
||||
9
vendor/altorouter/altorouter/LICENSE.md
vendored
Normal file
9
vendor/altorouter/altorouter/LICENSE.md
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
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.
|
||||
57
vendor/altorouter/altorouter/README.md
vendored
Normal file
57
vendor/altorouter/altorouter/README.md
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# AltoRouter  [](https://packagist.org/packages/altorouter/altorouter) [](https://packagist.org/packages/altorouter/altorouter)
|
||||
|
||||
AltoRouter is a small but powerful routing class, heavily inspired by [klein.php](https://github.com/chriso/klein.php/).
|
||||
|
||||
```php
|
||||
$router = new AltoRouter();
|
||||
|
||||
// map homepage
|
||||
$router->map('GET', '/', function() {
|
||||
require __DIR__ . '/views/home.php';
|
||||
});
|
||||
|
||||
// dynamic named route
|
||||
$router->map('GET|POST', '/users/[i:id]/', function($id) {
|
||||
$user = .....
|
||||
require __DIR__ . '/views/user/details.php';
|
||||
}, 'user-details');
|
||||
|
||||
// echo URL to user-details page for ID 5
|
||||
echo $router->generate('user-details', ['id' => 5]); // Output: "/users/5"
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* Can be used with all HTTP Methods
|
||||
* Dynamic routing with named route parameters
|
||||
* Reversed routing
|
||||
* Flexible regular expression routing (inspired by [Sinatra](http://www.sinatrarb.com/))
|
||||
* Custom regexes
|
||||
|
||||
## Getting started
|
||||
|
||||
You need PHP >= 7.3 to use AltoRouter, although we highly recommend you [use an officially supported PHP version](https://secure.php.net/supported-versions.php) that is not EOL.
|
||||
|
||||
- [Install AltoRouter](https://dannyvankooten.github.io/AltoRouter//usage/install.html)
|
||||
- [Rewrite all requests to AltoRouter](https://dannyvankooten.github.io/AltoRouter//usage/rewrite-requests.html)
|
||||
- [Map your routes](https://dannyvankooten.github.io/AltoRouter//usage/mapping-routes.html)
|
||||
- [Match requests](https://dannyvankooten.github.io/AltoRouter//usage/matching-requests.html)
|
||||
- [Process the request your preferred way](https://dannyvankooten.github.io/AltoRouter//usage/processing-requests.html)
|
||||
|
||||
## Contributors
|
||||
- [Danny van Kooten](https://github.com/dannyvankooten)
|
||||
- [Koen Punt](https://github.com/koenpunt)
|
||||
- [John Long](https://github.com/adduc)
|
||||
- [Niahoo Osef](https://github.com/niahoo)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
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.
|
||||
36
vendor/altorouter/altorouter/composer.json
vendored
Normal file
36
vendor/altorouter/altorouter/composer.json
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"description": "A lightning fast router for PHP",
|
||||
"keywords": ["router", "routing", "lightweight"],
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "9.6.*",
|
||||
"squizlabs/php_codesniffer": "3.6.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["AltoRouter.php"]
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit",
|
||||
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
|
||||
}
|
||||
}
|
||||
10
vendor/altorouter/altorouter/phpcs.xml
vendored
Normal file
10
vendor/altorouter/altorouter/phpcs.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="rules">
|
||||
<description>rules</description>
|
||||
<rule ref="PSR2"/>
|
||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
||||
<file>tests</file>
|
||||
<file>AltoRouter.php</file>
|
||||
<file>examples/</file>
|
||||
<arg name="colors"/>
|
||||
</ruleset>
|
||||
18
vendor/autoload.php
vendored
18
vendor/autoload.php
vendored
@@ -2,6 +2,24 @@
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInite360deab1e3925e3deb6282d6a5a1f68::getLoader();
|
||||
|
||||
1
vendor/bin/var-dump-server
vendored
1
vendor/bin/var-dump-server
vendored
@@ -1 +0,0 @@
|
||||
../symfony/var-dumper/Resources/bin/var-dump-server
|
||||
204
vendor/composer/ClassLoader.php
vendored
204
vendor/composer/ClassLoader.php
vendored
@@ -37,57 +37,126 @@ namespace Composer\Autoload;
|
||||
*
|
||||
* @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/
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
@@ -102,22 +171,25 @@ class ClassLoader
|
||||
* 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
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,19 +198,19 @@ class ClassLoader
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -147,25 +219,28 @@ class ClassLoader
|
||||
* 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
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
@@ -175,18 +250,18 @@ class ClassLoader
|
||||
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;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -195,8 +270,10 @@ class ClassLoader
|
||||
* 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
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
@@ -211,10 +288,12 @@ class ClassLoader
|
||||
* 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
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
@@ -234,6 +313,8 @@ class ClassLoader
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
@@ -256,6 +337,8 @@ class ClassLoader
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
@@ -276,6 +359,8 @@ class ClassLoader
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
@@ -296,33 +381,55 @@ class ClassLoader
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,6 +474,21 @@ class ClassLoader
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
@@ -432,14 +554,26 @@ class ClassLoader
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
359
vendor/composer/InstalledVersions.php
vendored
Normal file
359
vendor/composer/InstalledVersions.php
vendored
Normal file
@@ -0,0 +1,359 @@
|
||||
<?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;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
4
vendor/composer/autoload_classmap.php
vendored
4
vendor/composer/autoload_classmap.php
vendored
@@ -2,8 +2,10 @@
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'AltoRouter' => $vendorDir . '/altorouter/altorouter/AltoRouter.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
);
|
||||
|
||||
14
vendor/composer/autoload_files.php
vendored
14
vendor/composer/autoload_files.php
vendored
@@ -2,13 +2,17 @@
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php',
|
||||
'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => $vendorDir . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => $vendorDir . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => $vendorDir . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => $vendorDir . '/twig/twig/src/Resources/string_loader.php',
|
||||
'23f09fe3194f8c2f70923f90d6702129' => $vendorDir . '/illuminate/collections/functions.php',
|
||||
'60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php',
|
||||
);
|
||||
|
||||
4
vendor/composer/autoload_namespaces.php
vendored
4
vendor/composer/autoload_namespaces.php
vendored
@@ -2,11 +2,11 @@
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
||||
'Routes' => array($vendorDir . '/upstatement/routes'),
|
||||
'Requests' => array($vendorDir . '/rmccue/requests/library'),
|
||||
'Gregwar\\Formidable' => array($vendorDir . '/gregwar/formidable'),
|
||||
'Gregwar\\Cache' => array($vendorDir . '/gregwar/cache'),
|
||||
|
||||
12
vendor/composer/autoload_psr4.php
vendored
12
vendor/composer/autoload_psr4.php
vendored
@@ -2,15 +2,19 @@
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Twig\\' => array($vendorDir . '/twig/twig/src'),
|
||||
'Tightenco\\Collect\\' => array($vendorDir . '/tightenco/collect/src/Collect'),
|
||||
'Timber\\' => array($vendorDir . '/timber/timber/src'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
|
||||
'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),
|
||||
'HelloNico\\Twig\\' => array($vendorDir . '/hellonico/twig-dump-extension/src'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Illuminate\\Support\\' => array($vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/macroable'),
|
||||
'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
'App\\' => array($baseDir . '/src'),
|
||||
);
|
||||
|
||||
53
vendor/composer/autoload_real.php
vendored
53
vendor/composer/autoload_real.php
vendored
@@ -22,52 +22,29 @@ class ComposerAutoloaderInite360deab1e3925e3deb6282d6a5a1f68
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInite360deab1e3925e3deb6282d6a5a1f68', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite360deab1e3925e3deb6282d6a5a1f68', '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\ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::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);
|
||||
}
|
||||
}
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequiree360deab1e3925e3deb6282d6a5a1f68($fileIdentifier, $file);
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequiree360deab1e3925e3deb6282d6a5a1f68($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
||||
|
||||
84
vendor/composer/autoload_static.php
vendored
84
vendor/composer/autoload_static.php
vendored
@@ -7,29 +7,46 @@ namespace Composer\Autoload;
|
||||
class ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'fe62ba7e10580d903cc46d808b5961a4' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/helpers.php',
|
||||
'caf31cc6ec7cf2241cb6f12c226c3846' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/alias.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => __DIR__ . '/..' . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => __DIR__ . '/..' . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => __DIR__ . '/..' . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => __DIR__ . '/..' . '/twig/twig/src/Resources/string_loader.php',
|
||||
'23f09fe3194f8c2f70923f90d6702129' => __DIR__ . '/..' . '/illuminate/collections/functions.php',
|
||||
'60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'T' =>
|
||||
array (
|
||||
'Twig\\' => 5,
|
||||
'Tightenco\\Collect\\' => 18,
|
||||
'Timber\\' => 7,
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||
'Symfony\\Component\\VarDumper\\' => 28,
|
||||
'Symfony\\Component\\PropertyAccess\\' => 33,
|
||||
),
|
||||
'H' =>
|
||||
'P' =>
|
||||
array (
|
||||
'HelloNico\\Twig\\' => 15,
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
'Psr\\Container\\' => 14,
|
||||
),
|
||||
'I' =>
|
||||
array (
|
||||
'Illuminate\\Support\\' => 19,
|
||||
'Illuminate\\Contracts\\' => 21,
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Composer\\Installers\\' => 20,
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
'App\\' => 4,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -38,9 +55,9 @@ class ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/src',
|
||||
),
|
||||
'Tightenco\\Collect\\' =>
|
||||
'Timber\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/tightenco/collect/src/Collect',
|
||||
0 => __DIR__ . '/..' . '/timber/timber/src',
|
||||
),
|
||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
||||
array (
|
||||
@@ -50,30 +67,45 @@ class ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||
),
|
||||
'Symfony\\Component\\VarDumper\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/var-dumper',
|
||||
),
|
||||
'Symfony\\Component\\PropertyAccess\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/property-access',
|
||||
),
|
||||
'HelloNico\\Twig\\' =>
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/hellonico/twig-dump-extension/src',
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Psr\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||
),
|
||||
'Illuminate\\Support\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/illuminate/collections',
|
||||
1 => __DIR__ . '/..' . '/illuminate/conditionable',
|
||||
2 => __DIR__ . '/..' . '/illuminate/macroable',
|
||||
),
|
||||
'Illuminate\\Contracts\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/illuminate/contracts',
|
||||
),
|
||||
'Composer\\Installers\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
||||
),
|
||||
'App\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'T' =>
|
||||
array (
|
||||
'Twig_' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/twig/twig/lib',
|
||||
),
|
||||
),
|
||||
'R' =>
|
||||
array (
|
||||
'Routes' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/upstatement/routes',
|
||||
),
|
||||
'Requests' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rmccue/requests/library',
|
||||
@@ -92,12 +124,18 @@ class ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'AltoRouter' => __DIR__ . '/..' . '/altorouter/altorouter/AltoRouter.php',
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInite360deab1e3925e3deb6282d6a5a1f68::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
||||
1888
vendor/composer/installed.json
vendored
1888
vendor/composer/installed.json
vendored
File diff suppressed because it is too large
Load Diff
185
vendor/composer/installed.php
vendored
Normal file
185
vendor/composer/installed.php
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => '__root__',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => 'f4f413ec23c013281b14540789f7c4d74aff121d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => true,
|
||||
),
|
||||
'versions' => array(
|
||||
'__root__' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => 'f4f413ec23c013281b14540789f7c4d74aff121d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'altorouter/altorouter' => array(
|
||||
'pretty_version' => '2.0.3',
|
||||
'version' => '2.0.3.0',
|
||||
'reference' => '9931b976423f7334c94f7b5b348be8ab1da3415d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../altorouter/altorouter',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'composer/installers' => array(
|
||||
'pretty_version' => 'v2.3.0',
|
||||
'version' => '2.3.0.0',
|
||||
'reference' => '12fb2dfe5e16183de69e784a7b84046c43d97e8e',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/./installers',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'gregwar/cache' => array(
|
||||
'pretty_version' => 'v1.0.12',
|
||||
'version' => '1.0.12.0',
|
||||
'reference' => '305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../gregwar/cache/Gregwar/Cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'gregwar/formidable' => array(
|
||||
'pretty_version' => '2.1.0',
|
||||
'version' => '2.1.0.0',
|
||||
'reference' => 'b1a63d96b5f52b1e8d5b094ee5b861f880469998',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../gregwar/formidable/Gregwar/Formidable',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'illuminate/collections' => array(
|
||||
'pretty_version' => 'v12.21.0',
|
||||
'version' => '12.21.0.0',
|
||||
'reference' => 'a048b4fbbef4742ff2eee843971bb8278239c610',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../illuminate/collections',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'illuminate/conditionable' => array(
|
||||
'pretty_version' => 'v12.21.0',
|
||||
'version' => '12.21.0.0',
|
||||
'reference' => 'ec677967c1f2faf90b8428919124d2184a4c9b49',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../illuminate/conditionable',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'illuminate/contracts' => array(
|
||||
'pretty_version' => 'v12.21.0',
|
||||
'version' => '12.21.0.0',
|
||||
'reference' => 'c2eef857b808810f5cb187de58e23d25c1d443d9',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../illuminate/contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'illuminate/macroable' => array(
|
||||
'pretty_version' => 'v12.21.0',
|
||||
'version' => '12.21.0.0',
|
||||
'reference' => 'e862e5648ee34004fa56046b746f490dfa86c613',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../illuminate/macroable',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/container' => array(
|
||||
'pretty_version' => '2.0.2',
|
||||
'version' => '2.0.2.0',
|
||||
'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/container',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'psr/simple-cache' => array(
|
||||
'pretty_version' => '3.0.0',
|
||||
'version' => '3.0.0.0',
|
||||
'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../psr/simple-cache',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rmccue/requests' => array(
|
||||
'pretty_version' => 'v1.7.0',
|
||||
'version' => '1.7.0.0',
|
||||
'reference' => '87932f52ffad70504d93f04f15690cf16a089546',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rmccue/requests',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/deprecation-contracts' => array(
|
||||
'pretty_version' => 'v3.6.0',
|
||||
'version' => '3.6.0.0',
|
||||
'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-ctype' => array(
|
||||
'pretty_version' => 'v1.15.0',
|
||||
'version' => '1.15.0.0',
|
||||
'reference' => '4719fa9c18b0464d399f1a63bf624b42b6fa8d14',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/polyfill-mbstring' => array(
|
||||
'pretty_version' => 'v1.32.0',
|
||||
'version' => '1.32.0.0',
|
||||
'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/property-access' => array(
|
||||
'pretty_version' => 'v2.8.52',
|
||||
'version' => '2.8.52.0',
|
||||
'reference' => 'c8f10191183be9bb0d5a1b8364d3891f1bde07b6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/property-access',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'timber/timber' => array(
|
||||
'pretty_version' => 'v2.3.2',
|
||||
'version' => '2.3.2.0',
|
||||
'reference' => '08ce601167a03ed7a4fa7da740481c17ed650ef0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../timber/timber',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'twig/twig' => array(
|
||||
'pretty_version' => 'v3.21.1',
|
||||
'version' => '3.21.1.0',
|
||||
'reference' => '285123877d4dd97dd7c11842ac5fb7e86e60d81d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../twig/twig',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'upstatement/routes' => array(
|
||||
'pretty_version' => '0.9.2',
|
||||
'version' => '0.9.2.0',
|
||||
'reference' => '196a4dbc06231e5f6eb760130b8aa42d47e3c22f',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../upstatement/routes',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
65
vendor/composer/installers/.github/workflows/continuous-integration.yml
vendored
Normal file
65
vendor/composer/installers/.github/workflows/continuous-integration.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: "Continuous Integration"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "CI"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
- "8.1"
|
||||
dependencies: [locked]
|
||||
include:
|
||||
- php-version: "7.2"
|
||||
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 }}"
|
||||
tools: composer:snapshot
|
||||
|
||||
- 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: "composer update ${{ env.COMPOSER_FLAGS }}"
|
||||
|
||||
- name: "Run tests"
|
||||
run: "vendor/bin/simple-phpunit --verbose"
|
||||
33
vendor/composer/installers/.github/workflows/lint.yml
vendored
Normal file
33
vendor/composer/installers/.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: "PHP Lint"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "Lint"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.2"
|
||||
- "latest"
|
||||
|
||||
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"
|
||||
52
vendor/composer/installers/.github/workflows/phpstan.yml
vendored
Normal file
52
vendor/composer/installers/.github/workflows/phpstan.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: "PHPStan"
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_VERSION: ""
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "PHPStan"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "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: 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
|
||||
run: |
|
||||
composer require --dev phpunit/phpunit:^8.5.18 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
|
||||
vendor/bin/phpstan analyse
|
||||
19
vendor/composer/installers/LICENSE
vendored
Normal file
19
vendor/composer/installers/LICENSE
vendored
Normal file
@@ -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.
|
||||
117
vendor/composer/installers/composer.json
vendored
Normal file
117
vendor/composer/installers/composer.json
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
{
|
||||
"name": "composer/installers",
|
||||
"type": "composer-plugin",
|
||||
"license": "MIT",
|
||||
"description": "A multi-framework Composer library installer",
|
||||
"keywords": [
|
||||
"installer",
|
||||
"AGL",
|
||||
"AnnotateCms",
|
||||
"Attogram",
|
||||
"Bitrix",
|
||||
"CakePHP",
|
||||
"Chef",
|
||||
"Cockpit",
|
||||
"CodeIgniter",
|
||||
"concrete5",
|
||||
"ConcreteCMS",
|
||||
"Croogo",
|
||||
"DokuWiki",
|
||||
"Dolibarr",
|
||||
"Drupal",
|
||||
"Elgg",
|
||||
"Eliasis",
|
||||
"ExpressionEngine",
|
||||
"eZ Platform",
|
||||
"FuelPHP",
|
||||
"Grav",
|
||||
"Hurad",
|
||||
"ImageCMS",
|
||||
"iTop",
|
||||
"Kanboard",
|
||||
"Known",
|
||||
"Kohana",
|
||||
"Lan Management System",
|
||||
"Laravel",
|
||||
"Lavalite",
|
||||
"Lithium",
|
||||
"Magento",
|
||||
"majima",
|
||||
"Mako",
|
||||
"MantisBT",
|
||||
"Matomo",
|
||||
"Mautic",
|
||||
"Maya",
|
||||
"MODX",
|
||||
"MODX Evo",
|
||||
"MediaWiki",
|
||||
"Miaoxing",
|
||||
"OXID",
|
||||
"osclass",
|
||||
"MODULEWork",
|
||||
"Moodle",
|
||||
"Pantheon",
|
||||
"Piwik",
|
||||
"pxcms",
|
||||
"phpBB",
|
||||
"Plentymarkets",
|
||||
"PPI",
|
||||
"Puppet",
|
||||
"Porto",
|
||||
"ProcessWire",
|
||||
"RadPHP",
|
||||
"ReIndex",
|
||||
"Roundcube",
|
||||
"shopware",
|
||||
"SilverStripe",
|
||||
"SMF",
|
||||
"Starbug",
|
||||
"SyDES",
|
||||
"Sylius",
|
||||
"TastyIgniter",
|
||||
"Thelia",
|
||||
"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" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Composer\\Installers\\Test\\": "tests/Composer/Installers/Test" }
|
||||
},
|
||||
"extra": {
|
||||
"class": "Composer\\Installers\\Plugin",
|
||||
"branch-alias": {
|
||||
"dev-main": "2.x-dev"
|
||||
},
|
||||
"plugin-modifies-install-path": true
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0",
|
||||
"composer-plugin-api": "^1.0 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "^1.10.27 || ^2.7",
|
||||
"composer/semver": "^1.7.2 || ^3.4.0",
|
||||
"symfony/phpunit-bridge": "^7.1.1",
|
||||
"phpstan/phpstan": "^1.11",
|
||||
"symfony/process": "^5 || ^6 || ^7",
|
||||
"phpstan/phpstan-phpunit": "^1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "@php vendor/bin/simple-phpunit",
|
||||
"phpstan": "@php vendor/bin/phpstan analyse"
|
||||
}
|
||||
}
|
||||
29
vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
29
vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AglInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'More/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$name = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
|
||||
return strtoupper($matches[1]);
|
||||
}, $vars['name']);
|
||||
|
||||
if (null === $name) {
|
||||
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
|
||||
}
|
||||
|
||||
$vars['name'] = $name;
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
23
vendor/composer/installers/src/Composer/Installers/AkauntingInstaller.php
vendored
Normal file
23
vendor/composer/installers/src/Composer/Installers/AkauntingInstaller.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AkauntingInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AnnotateCmsInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'addons/modules/{$name}/',
|
||||
'component' => 'addons/components/{$name}/',
|
||||
'service' => 'addons/services/{$name}/',
|
||||
);
|
||||
}
|
||||
58
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
58
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AsgardInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
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(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'asgard-module') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'asgard-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectPluginVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectThemeVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AttogramInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
137
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
137
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Composer;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
abstract class BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array();
|
||||
/** @var Composer */
|
||||
protected $composer;
|
||||
/** @var PackageInterface */
|
||||
protected $package;
|
||||
/** @var IOInterface */
|
||||
protected $io;
|
||||
|
||||
/**
|
||||
* Initializes base installer.
|
||||
*/
|
||||
public function __construct(PackageInterface $package, Composer $composer, IOInterface $io)
|
||||
{
|
||||
$this->composer = $composer;
|
||||
$this->package = $package;
|
||||
$this->io = $io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the install path based on package type.
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
|
||||
{
|
||||
$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'];
|
||||
}
|
||||
|
||||
$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($frameworkType);
|
||||
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<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the installer's locations
|
||||
*
|
||||
* @return array<string, string> map of package types => install path
|
||||
*/
|
||||
public function getLocations(string $frameworkType)
|
||||
{
|
||||
return $this->locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace vars in a path
|
||||
*
|
||||
* @param array<string, string> $vars
|
||||
*/
|
||||
protected function templatePath(string $path, array $vars = array()): string
|
||||
{
|
||||
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<string, string[]|string> $paths
|
||||
* @return string|false
|
||||
*/
|
||||
protected function mapCustomInstallPaths(array $paths, string $name, string $type, ?string $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;
|
||||
}
|
||||
|
||||
protected function pregReplace(string $pattern, string $replacement, string $subject): string
|
||||
{
|
||||
$result = preg_replace($pattern, $replacement, $subject);
|
||||
if (null === $result) {
|
||||
throw new \RuntimeException('Failed to run preg_replace with '.$pattern.': '.preg_last_error());
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
123
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
123
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
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 string[] Storage for informations about duplicates at all the time of installation packages.
|
||||
*/
|
||||
private static $checkedDuplicates = array();
|
||||
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
/** @phpstan-ignore-next-line */
|
||||
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(string $path, array $vars = array()): string
|
||||
{
|
||||
$templatePath = parent::templatePath($path, $vars);
|
||||
$this->checkDuplicates($templatePath, $vars);
|
||||
|
||||
return $templatePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicates search packages.
|
||||
*
|
||||
* @param array<string, string> $vars
|
||||
*/
|
||||
protected function checkDuplicates(string $path, array $vars = array()): void
|
||||
{
|
||||
$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->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;
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BonefishInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/{$vendor}/{$name}/'
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/BotbleInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/BotbleInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BotbleInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'platform/plugins/{$name}/',
|
||||
'theme' => 'platform/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
67
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
67
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
use Composer\Semver\Constraint\Constraint;
|
||||
|
||||
class CakePHPInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'Plugin/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($this->matchesCakeVersion('>=', '3.0.0')) {
|
||||
return $vars;
|
||||
}
|
||||
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower($this->pregReplace('/(?<=\\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(string $frameworkType): array
|
||||
{
|
||||
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
|
||||
*
|
||||
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $matcher
|
||||
*/
|
||||
protected function matchesCakeVersion(string $matcher, string $version): bool
|
||||
{
|
||||
$repositoryManager = $this->composer->getRepositoryManager();
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (!$repositoryManager) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$repos = $repositoryManager->getLocalRepository();
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (!$repos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
|
||||
}
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ChefInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'cookbook' => 'Chef/{$vendor}/{$name}/',
|
||||
'role' => 'Chef/roles/{$name}/',
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CiviCrmInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'ext' => 'ext/{$name}/'
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ClanCatsFrameworkInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'ship' => 'CCF/orbit/{$name}/',
|
||||
'theme' => 'CCF/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
36
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
36
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CockpitInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'cockpit/modules/addons/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format module name.
|
||||
*
|
||||
* Strip `module-` prefix from package name.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] == 'cockpit-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function inflectModuleVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = ucfirst($this->pregReplace('/cockpit-/i', '', $vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CodeIgniterInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
'third-party' => 'application/third_party/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
);
|
||||
}
|
||||
15
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
15
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class Concrete5Installer extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'core' => 'concrete/',
|
||||
'block' => 'application/blocks/{$name}/',
|
||||
'package' => 'packages/{$name}/',
|
||||
'theme' => 'application/themes/{$name}/',
|
||||
'update' => 'updates/{$name}/',
|
||||
);
|
||||
}
|
||||
15
vendor/composer/installers/src/Composer/Installers/ConcreteCMSInstaller.php
vendored
Normal file
15
vendor/composer/installers/src/Composer/Installers/ConcreteCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ConcreteCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'core' => 'concrete/',
|
||||
'block' => 'application/blocks/{$name}/',
|
||||
'package' => 'packages/{$name}/',
|
||||
'theme' => 'application/themes/{$name}/',
|
||||
'update' => 'updates/{$name}/',
|
||||
);
|
||||
}
|
||||
23
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
23
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CroogoInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'Plugin/{$name}/',
|
||||
'theme' => 'View/Themed/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DecibelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array */
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'app' => 'app/{$name}/',
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/DframeInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/DframeInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DframeInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$vendor}/{$name}/',
|
||||
);
|
||||
}
|
||||
57
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
57
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DokuWikiInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'lib/plugins/{$name}/',
|
||||
'template' => 'lib/tpl/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type dokuwiki-plugin, cut off a trailing '-plugin',
|
||||
* or leading dokuwiki_ if present.
|
||||
*
|
||||
* For package type dokuwiki-template, cut off a trailing '-template' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'dokuwiki-plugin') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'dokuwiki-template') {
|
||||
return $this->inflectTemplateVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectPluginVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-plugin$/', '', $vars['name']);
|
||||
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectTemplateVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-template$/', '', $vars['name']);
|
||||
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
18
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
18
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class DolibarrInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
* @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*/
|
||||
class DolibarrInstaller extends BaseInstaller
|
||||
{
|
||||
//TODO: Add support for scripts and themes
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'htdocs/custom/{$name}/',
|
||||
);
|
||||
}
|
||||
25
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
25
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DrupalInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'core' => 'core/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'profile' => 'profiles/{$name}/',
|
||||
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
|
||||
'drush' => 'drush/{$name}/',
|
||||
'custom-theme' => 'themes/custom/{$name}/',
|
||||
'custom-module' => 'modules/custom/{$name}/',
|
||||
'custom-profile' => 'profiles/custom/{$name}/',
|
||||
'drupal-multisite' => 'sites/{$name}/',
|
||||
'console' => 'console/{$name}/',
|
||||
'console-language' => 'console/language/{$name}/',
|
||||
'config' => 'config/sync/',
|
||||
'recipe' => 'recipes/{$name}',
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ElggInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'mod/{$name}/',
|
||||
);
|
||||
}
|
||||
14
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php
vendored
Normal file
14
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EliasisInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
);
|
||||
}
|
||||
31
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
31
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class ExpressionEngineInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
private $ee2Locations = array(
|
||||
'addon' => 'system/expressionengine/third_party/{$name}/',
|
||||
'theme' => 'themes/third_party/{$name}/',
|
||||
);
|
||||
|
||||
/** @var array<string, string> */
|
||||
private $ee3Locations = array(
|
||||
'addon' => 'system/user/addons/{$name}/',
|
||||
'theme' => 'themes/user/{$name}/',
|
||||
);
|
||||
|
||||
public function getLocations(string $frameworkType): array
|
||||
{
|
||||
if ($frameworkType === 'ee2') {
|
||||
$this->locations = $this->ee2Locations;
|
||||
} else {
|
||||
$this->locations = $this->ee3Locations;
|
||||
}
|
||||
|
||||
return $this->locations;
|
||||
}
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class EzPlatformInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'meta-assets' => 'web/assets/ezplatform/',
|
||||
'assets' => 'web/assets/ezplatform/{$name}/',
|
||||
);
|
||||
}
|
||||
58
vendor/composer/installers/src/Composer/Installers/ForkCMSInstaller.php
vendored
Normal file
58
vendor/composer/installers/src/Composer/Installers/ForkCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ForkCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = [
|
||||
'module' => 'src/Modules/{$name}/',
|
||||
'theme' => 'src/Themes/{$name}/'
|
||||
];
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type fork-cms-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type fork-cms-theme, cut off a trailing '-theme' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'fork-cms-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'fork-cms-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectModuleVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^fork-cms-|-module|ForkCMS|ForkCms|Forkcms|forkcms|Module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make module name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectThemeVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^fork-cms-|-theme|ForkCMS|ForkCms|Forkcms|forkcms|Theme$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make theme name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'fuel/app/modules/{$name}/',
|
||||
'package' => 'fuel/packages/{$name}/',
|
||||
'theme' => 'fuel/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelphpInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
);
|
||||
}
|
||||
29
vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
29
vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class GravInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'user/plugins/{$name}/',
|
||||
'theme' => 'user/themes/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$restrictedWords = implode('|', array_keys($this->locations));
|
||||
|
||||
$vars['name'] = strtolower($vars['name']);
|
||||
$vars['name'] = $this->pregReplace(
|
||||
'/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
|
||||
'$1',
|
||||
$vars['name']
|
||||
);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
27
vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
27
vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class HuradInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$nameParts = explode('/', $vars['name']);
|
||||
foreach ($nameParts as &$value) {
|
||||
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
||||
$value = str_replace(array('-', '_'), ' ', $value);
|
||||
$value = str_replace(' ', '', ucwords($value));
|
||||
}
|
||||
$vars['name'] = implode('/', $nameParts);
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ImageCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'template' => 'templates/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
288
vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
288
vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Installer\BinaryInstaller;
|
||||
use Composer\Installer\LibraryInstaller;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Repository\InstalledRepositoryInterface;
|
||||
use Composer\Util\Filesystem;
|
||||
use React\Promise\PromiseInterface;
|
||||
|
||||
class Installer extends LibraryInstaller
|
||||
{
|
||||
/**
|
||||
* Package types to installer class map
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $supportedTypes = array(
|
||||
'akaunting' => 'AkauntingInstaller',
|
||||
'asgard' => 'AsgardInstaller',
|
||||
'attogram' => 'AttogramInstaller',
|
||||
'agl' => 'AglInstaller',
|
||||
'annotatecms' => 'AnnotateCmsInstaller',
|
||||
'bitrix' => 'BitrixInstaller',
|
||||
'botble' => 'BotbleInstaller',
|
||||
'bonefish' => 'BonefishInstaller',
|
||||
'cakephp' => 'CakePHPInstaller',
|
||||
'chef' => 'ChefInstaller',
|
||||
'civicrm' => 'CiviCrmInstaller',
|
||||
'ccframework' => 'ClanCatsFrameworkInstaller',
|
||||
'cockpit' => 'CockpitInstaller',
|
||||
'codeigniter' => 'CodeIgniterInstaller',
|
||||
'concrete5' => 'Concrete5Installer',
|
||||
'concretecms' => 'ConcreteCMSInstaller',
|
||||
'croogo' => 'CroogoInstaller',
|
||||
'dframe' => 'DframeInstaller',
|
||||
'dokuwiki' => 'DokuWikiInstaller',
|
||||
'dolibarr' => 'DolibarrInstaller',
|
||||
'decibel' => 'DecibelInstaller',
|
||||
'drupal' => 'DrupalInstaller',
|
||||
'elgg' => 'ElggInstaller',
|
||||
'eliasis' => 'EliasisInstaller',
|
||||
'ee3' => 'ExpressionEngineInstaller',
|
||||
'ee2' => 'ExpressionEngineInstaller',
|
||||
'ezplatform' => 'EzPlatformInstaller',
|
||||
'fork' => 'ForkCMSInstaller',
|
||||
'fuel' => 'FuelInstaller',
|
||||
'fuelphp' => 'FuelphpInstaller',
|
||||
'grav' => 'GravInstaller',
|
||||
'hurad' => 'HuradInstaller',
|
||||
'tastyigniter' => 'TastyIgniterInstaller',
|
||||
'imagecms' => 'ImageCMSInstaller',
|
||||
'itop' => 'ItopInstaller',
|
||||
'kanboard' => 'KanboardInstaller',
|
||||
'known' => 'KnownInstaller',
|
||||
'kodicms' => 'KodiCMSInstaller',
|
||||
'kohana' => 'KohanaInstaller',
|
||||
'lms' => 'LanManagementSystemInstaller',
|
||||
'laravel' => 'LaravelInstaller',
|
||||
'lavalite' => 'LavaLiteInstaller',
|
||||
'lithium' => 'LithiumInstaller',
|
||||
'magento' => 'MagentoInstaller',
|
||||
'majima' => 'MajimaInstaller',
|
||||
'mantisbt' => 'MantisBTInstaller',
|
||||
'mako' => 'MakoInstaller',
|
||||
'matomo' => 'MatomoInstaller',
|
||||
'maya' => 'MayaInstaller',
|
||||
'mautic' => 'MauticInstaller',
|
||||
'mediawiki' => 'MediaWikiInstaller',
|
||||
'miaoxing' => 'MiaoxingInstaller',
|
||||
'microweber' => 'MicroweberInstaller',
|
||||
'modulework' => 'MODULEWorkInstaller',
|
||||
'modx' => 'ModxInstaller',
|
||||
'modxevo' => 'MODXEvoInstaller',
|
||||
'moodle' => 'MoodleInstaller',
|
||||
'october' => 'OctoberInstaller',
|
||||
'ontowiki' => 'OntoWikiInstaller',
|
||||
'oxid' => 'OxidInstaller',
|
||||
'osclass' => 'OsclassInstaller',
|
||||
'pxcms' => 'PxcmsInstaller',
|
||||
'phpbb' => 'PhpBBInstaller',
|
||||
'piwik' => 'PiwikInstaller',
|
||||
'plentymarkets'=> 'PlentymarketsInstaller',
|
||||
'ppi' => 'PPIInstaller',
|
||||
'puppet' => 'PuppetInstaller',
|
||||
'radphp' => 'RadPHPInstaller',
|
||||
'phifty' => 'PhiftyInstaller',
|
||||
'porto' => 'PortoInstaller',
|
||||
'processwire' => 'ProcessWireInstaller',
|
||||
'quicksilver' => 'PantheonInstaller',
|
||||
'redaxo' => 'RedaxoInstaller',
|
||||
'redaxo5' => 'Redaxo5Installer',
|
||||
'reindex' => 'ReIndexInstaller',
|
||||
'roundcube' => 'RoundcubeInstaller',
|
||||
'shopware' => 'ShopwareInstaller',
|
||||
'sitedirect' => 'SiteDirectInstaller',
|
||||
'silverstripe' => 'SilverStripeInstaller',
|
||||
'smf' => 'SMFInstaller',
|
||||
'starbug' => 'StarbugInstaller',
|
||||
'sydes' => 'SyDESInstaller',
|
||||
'sylius' => 'SyliusInstaller',
|
||||
'tao' => 'TaoInstaller',
|
||||
'thelia' => 'TheliaInstaller',
|
||||
'tusk' => 'TuskInstaller',
|
||||
'userfrosting' => 'UserFrostingInstaller',
|
||||
'vanilla' => 'VanillaInstaller',
|
||||
'whmcs' => 'WHMCSInstaller',
|
||||
'winter' => 'WinterInstaller',
|
||||
'wolfcms' => 'WolfCMSInstaller',
|
||||
'wordpress' => 'WordPressInstaller',
|
||||
'yawik' => 'YawikInstaller',
|
||||
'zend' => 'ZendInstaller',
|
||||
'zikula' => 'ZikulaInstaller',
|
||||
'prestashop' => 'PrestashopInstaller'
|
||||
);
|
||||
|
||||
/**
|
||||
* Disables installers specified in main composer extra installer-disable
|
||||
* list
|
||||
*/
|
||||
public function __construct(
|
||||
IOInterface $io,
|
||||
Composer $composer,
|
||||
string $type = 'library',
|
||||
?Filesystem $filesystem = null,
|
||||
?BinaryInstaller $binaryInstaller = null
|
||||
) {
|
||||
parent::__construct($io, $composer, $type, $filesystem, $binaryInstaller);
|
||||
$this->removeDisabledInstallers();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getInstallPath(PackageInterface $package)
|
||||
{
|
||||
$type = $package->getType();
|
||||
$frameworkType = $this->findFrameworkType($type);
|
||||
|
||||
if ($frameworkType === false) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Sorry the package type of this package is not yet supported.'
|
||||
);
|
||||
}
|
||||
|
||||
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
|
||||
/**
|
||||
* @var BaseInstaller
|
||||
*/
|
||||
$installer = new $class($package, $this->composer, $this->getIO());
|
||||
|
||||
$path = $installer->getInstallPath($package, $frameworkType);
|
||||
if (!$this->filesystem->isAbsolutePath($path)) {
|
||||
$path = getcwd() . '/' . $path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
$installPath = $this->getPackageBasePath($package);
|
||||
$io = $this->io;
|
||||
$outputStatus = function () use ($io, $installPath) {
|
||||
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
|
||||
};
|
||||
|
||||
$promise = parent::uninstall($repo, $package);
|
||||
|
||||
// Composer v2 might return a promise here
|
||||
if ($promise instanceof PromiseInterface) {
|
||||
return $promise->then($outputStatus);
|
||||
}
|
||||
|
||||
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
|
||||
$outputStatus();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param string $packageType
|
||||
*/
|
||||
public function supports($packageType)
|
||||
{
|
||||
$frameworkType = $this->findFrameworkType($packageType);
|
||||
|
||||
if ($frameworkType === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$locationPattern = $this->getLocationPattern($frameworkType);
|
||||
|
||||
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a supported framework type if it exists and returns it
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
protected function findFrameworkType(string $type)
|
||||
{
|
||||
krsort($this->supportedTypes);
|
||||
|
||||
foreach ($this->supportedTypes as $key => $val) {
|
||||
if ($key === substr($type, 0, strlen($key))) {
|
||||
return substr($type, 0, strlen($key));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the second part of the regular expression to check for support of a
|
||||
* package type
|
||||
*/
|
||||
protected function getLocationPattern(string $frameworkType): string
|
||||
{
|
||||
$pattern = null;
|
||||
if (!empty($this->supportedTypes[$frameworkType])) {
|
||||
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
|
||||
/** @var BaseInstaller $framework */
|
||||
$framework = new $frameworkClass(new Package('dummy/pkg', '1.0.0.0', '1.0.0'), $this->composer, $this->getIO());
|
||||
$locations = array_keys($framework->getLocations($frameworkType));
|
||||
if ($locations) {
|
||||
$pattern = '(' . implode('|', $locations) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
return $pattern ?: '(\w+)';
|
||||
}
|
||||
|
||||
private function getIO(): IOInterface
|
||||
{
|
||||
return $this->io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for installers set to be disabled in composer's extra config and
|
||||
* remove them from the list of supported installers.
|
||||
*
|
||||
* Globals:
|
||||
* - true, "all", and "*" - disable all installers.
|
||||
* - false - enable all installers (useful with
|
||||
* wikimedia/composer-merge-plugin or similar)
|
||||
*/
|
||||
protected function removeDisabledInstallers(): void
|
||||
{
|
||||
$extra = $this->composer->getPackage()->getExtra();
|
||||
|
||||
if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
|
||||
// No installers are disabled
|
||||
return;
|
||||
}
|
||||
|
||||
// Get installers to disable
|
||||
$disable = $extra['installer-disable'];
|
||||
|
||||
// Ensure $disabled is an array
|
||||
if (!is_array($disable)) {
|
||||
$disable = array($disable);
|
||||
}
|
||||
|
||||
// Check which installers should be disabled
|
||||
$all = array(true, "all", "*");
|
||||
$intersect = array_intersect($all, $disable);
|
||||
if (!empty($intersect)) {
|
||||
// Disable all installers
|
||||
$this->supportedTypes = array();
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable specified installers
|
||||
foreach ($disable as $key => $installer) {
|
||||
if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
|
||||
unset($this->supportedTypes[$installer]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ItopInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'extension' => 'extensions/{$name}/',
|
||||
);
|
||||
}
|
||||
20
vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php
vendored
Normal file
20
vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
*
|
||||
* Installer for kanboard plugins
|
||||
*
|
||||
* kanboard.net
|
||||
*
|
||||
* Class KanboardInstaller
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class KanboardInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/KnownInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/KnownInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KnownInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'IdnoPlugins/{$name}/',
|
||||
'theme' => 'Themes/{$name}/',
|
||||
'console' => 'ConsolePlugins/{$name}/',
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KodiCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'cms/plugins/{$name}/',
|
||||
'media' => 'cms/media/vendor/{$name}/'
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KohanaInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
27
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php
vendored
Normal file
27
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LanManagementSystemInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
'document-template' => 'documents/templates/{$name}/',
|
||||
'userpanel-module' => 'userpanel/modules/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LaravelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LavaLiteInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'package' => 'packages/{$vendor}/{$name}/',
|
||||
'theme' => 'public/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LithiumInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
'source' => 'libraries/_source/{$name}/',
|
||||
);
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MODULEWorkInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
18
vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
18
vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX Evolution specifics when installing packages.
|
||||
*/
|
||||
class MODXEvoInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'snippet' => 'assets/snippets/{$name}/',
|
||||
'plugin' => 'assets/plugins/{$name}/',
|
||||
'module' => 'assets/modules/{$name}/',
|
||||
'template' => 'assets/templates/{$name}/',
|
||||
'lib' => 'assets/lib/{$name}/'
|
||||
);
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MagentoInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'theme' => 'app/design/frontend/{$name}/',
|
||||
'skin' => 'skin/frontend/default/{$name}/',
|
||||
'library' => 'lib/{$name}/',
|
||||
);
|
||||
}
|
||||
46
vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
vendored
Normal file
46
vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin/theme installer for majima
|
||||
* @author David Neustadt
|
||||
*/
|
||||
class MajimaInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Transforms the names
|
||||
*
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
return $this->correctPluginName($vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change hyphenated names to camelcase
|
||||
*
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private function correctPluginName(array $vars): array
|
||||
{
|
||||
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
|
||||
return strtoupper($matches[0][1]);
|
||||
}, $vars['name']);
|
||||
|
||||
if (null === $camelCasedName) {
|
||||
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
|
||||
}
|
||||
|
||||
$vars['name'] = ucfirst($camelCasedName);
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MakoInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'package' => 'app/packages/{$name}/',
|
||||
);
|
||||
}
|
||||
25
vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php
vendored
Normal file
25
vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
|
||||
class MantisBTInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
28
vendor/composer/installers/src/Composer/Installers/MatomoInstaller.php
vendored
Normal file
28
vendor/composer/installers/src/Composer/Installers/MatomoInstaller.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class MatomoInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class MatomoInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
43
vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
43
vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class MauticInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'core' => 'app/',
|
||||
);
|
||||
|
||||
private function getDirectoryName(): string
|
||||
{
|
||||
$extra = $this->package->getExtra();
|
||||
if (!empty($extra['install-directory-name'])) {
|
||||
return $extra['install-directory-name'];
|
||||
}
|
||||
|
||||
return $this->toCamelCase($this->package->getPrettyName());
|
||||
}
|
||||
|
||||
private function toCamelCase(string $packageName): string
|
||||
{
|
||||
return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format package name of mautic-plugins to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
|
||||
$directoryName = $this->getDirectoryName();
|
||||
$vars['name'] = $directoryName;
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
38
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php
vendored
Normal file
38
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MayaInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type maya-module, cut off a trailing '-module' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'maya-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectModuleVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
58
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
58
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MediaWikiInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'core' => 'core/',
|
||||
'extension' => 'extensions/{$name}/',
|
||||
'skin' => 'skins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
|
||||
* to CamelCase keeping existing uppercase chars.
|
||||
*
|
||||
* For package type mediawiki-skin, cut off a trailing '-skin' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'mediawiki-extension') {
|
||||
return $this->inflectExtensionVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'mediawiki-skin') {
|
||||
return $this->inflectSkinVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectExtensionVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-extension$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace('-', ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectSkinVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/-skin$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MiaoxingInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
145
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
145
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MicroweberInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'userfiles/modules/{$install_item_dir}/',
|
||||
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
|
||||
'template' => 'userfiles/templates/{$install_item_dir}/',
|
||||
'element' => 'userfiles/elements/{$install_item_dir}/',
|
||||
'vendor' => 'vendor/{$install_item_dir}/',
|
||||
'components' => 'components/{$install_item_dir}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type microweber-module, cut off a trailing '-module' if present
|
||||
*
|
||||
* For package type microweber-template, cut off a trailing '-template' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($this->package->getTargetDir() !== null && $this->package->getTargetDir() !== '') {
|
||||
$vars['install_item_dir'] = $this->package->getTargetDir();
|
||||
} else {
|
||||
$vars['install_item_dir'] = $vars['name'];
|
||||
if ($vars['type'] === 'microweber-template') {
|
||||
return $this->inflectTemplateVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-templates') {
|
||||
return $this->inflectTemplatesVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-core') {
|
||||
return $this->inflectCoreVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-adapter') {
|
||||
return $this->inflectCoreVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-modules') {
|
||||
return $this->inflectModulesVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-skin') {
|
||||
return $this->inflectSkinVars($vars);
|
||||
}
|
||||
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
|
||||
return $this->inflectElementVars($vars);
|
||||
}
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectTemplateVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-template$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/template-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectTemplatesVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-templates$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/templates-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectCoreVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-providers$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-provider$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-adapter$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectModuleVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-module$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/module-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectModulesVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-modules$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/modules-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectSkinVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-skin$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/skin-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectElementVars(array $vars): array
|
||||
{
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-elements$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/elements-$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/-element$/', '', $vars['install_item_dir']);
|
||||
$vars['install_item_dir'] = $this->pregReplace('/element-$/', '', $vars['install_item_dir']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
14
vendor/composer/installers/src/Composer/Installers/ModxInstaller.php
vendored
Normal file
14
vendor/composer/installers/src/Composer/Installers/ModxInstaller.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX specifics when installing packages.
|
||||
*/
|
||||
class ModxInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'extra' => 'core/packages/{$name}/'
|
||||
);
|
||||
}
|
||||
73
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
73
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MoodleInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'mod' => 'mod/{$name}/',
|
||||
'admin_report' => 'admin/report/{$name}/',
|
||||
'atto' => 'lib/editor/atto/plugins/{$name}/',
|
||||
'tool' => 'admin/tool/{$name}/',
|
||||
'assignment' => 'mod/assignment/type/{$name}/',
|
||||
'assignsubmission' => 'mod/assign/submission/{$name}/',
|
||||
'assignfeedback' => 'mod/assign/feedback/{$name}/',
|
||||
'antivirus' => 'lib/antivirus/{$name}/',
|
||||
'auth' => 'auth/{$name}/',
|
||||
'availability' => 'availability/condition/{$name}/',
|
||||
'block' => 'blocks/{$name}/',
|
||||
'booktool' => 'mod/book/tool/{$name}/',
|
||||
'cachestore' => 'cache/stores/{$name}/',
|
||||
'cachelock' => 'cache/locks/{$name}/',
|
||||
'calendartype' => 'calendar/type/{$name}/',
|
||||
'communication' => 'communication/provider/{$name}/',
|
||||
'customfield' => 'customfield/field/{$name}/',
|
||||
'fileconverter' => 'files/converter/{$name}/',
|
||||
'format' => 'course/format/{$name}/',
|
||||
'coursereport' => 'course/report/{$name}/',
|
||||
'contenttype' => 'contentbank/contenttype/{$name}/',
|
||||
'customcertelement' => 'mod/customcert/element/{$name}/',
|
||||
'datafield' => 'mod/data/field/{$name}/',
|
||||
'dataformat' => 'dataformat/{$name}/',
|
||||
'datapreset' => 'mod/data/preset/{$name}/',
|
||||
'editor' => 'lib/editor/{$name}/',
|
||||
'enrol' => 'enrol/{$name}/',
|
||||
'filter' => 'filter/{$name}/',
|
||||
'forumreport' => 'mod/forum/report/{$name}/',
|
||||
'gradeexport' => 'grade/export/{$name}/',
|
||||
'gradeimport' => 'grade/import/{$name}/',
|
||||
'gradereport' => 'grade/report/{$name}/',
|
||||
'gradingform' => 'grade/grading/form/{$name}/',
|
||||
'h5plib' => 'h5p/h5plib/{$name}/',
|
||||
'local' => 'local/{$name}/',
|
||||
'logstore' => 'admin/tool/log/store/{$name}/',
|
||||
'ltisource' => 'mod/lti/source/{$name}/',
|
||||
'ltiservice' => 'mod/lti/service/{$name}/',
|
||||
'media' => 'media/player/{$name}/',
|
||||
'message' => 'message/output/{$name}/',
|
||||
'mlbackend' => 'lib/mlbackend/{$name}/',
|
||||
'mnetservice' => 'mnet/service/{$name}/',
|
||||
'paygw' => 'payment/gateway/{$name}/',
|
||||
'plagiarism' => 'plagiarism/{$name}/',
|
||||
'portfolio' => 'portfolio/{$name}/',
|
||||
'qbank' => 'question/bank/{$name}/',
|
||||
'qbehaviour' => 'question/behaviour/{$name}/',
|
||||
'qformat' => 'question/format/{$name}/',
|
||||
'qtype' => 'question/type/{$name}/',
|
||||
'quizaccess' => 'mod/quiz/accessrule/{$name}/',
|
||||
'quiz' => 'mod/quiz/report/{$name}/',
|
||||
'report' => 'report/{$name}/',
|
||||
'repository' => 'repository/{$name}/',
|
||||
'scormreport' => 'mod/scorm/report/{$name}/',
|
||||
'search' => 'search/engine/{$name}/',
|
||||
'theme' => 'theme/{$name}/',
|
||||
'tiny' => 'lib/editor/tiny/plugins/{$name}/',
|
||||
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
|
||||
'profilefield' => 'user/profile/field/{$name}/',
|
||||
'webservice' => 'webservice/{$name}/',
|
||||
'workshopallocation' => 'mod/workshop/allocation/{$name}/',
|
||||
'workshopeval' => 'mod/workshop/eval/{$name}/',
|
||||
'workshopform' => 'mod/workshop/form/{$name}/'
|
||||
);
|
||||
}
|
||||
57
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
57
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OctoberInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'plugin' => 'plugins/{$vendor}/{$name}/',
|
||||
'theme' => 'themes/{$vendor}-{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type october-plugin, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type october-theme, cut off a trailing '-theme' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'october-plugin') {
|
||||
return $this->inflectPluginVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'october-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectPluginVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^oc-|-plugin$/', '', $vars['name']);
|
||||
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectThemeVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^oc-|-theme$/', '', $vars['name']);
|
||||
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
26
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php
vendored
Normal file
26
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OntoWikiInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'extension' => 'extensions/{$name}/',
|
||||
'theme' => 'extensions/themes/{$name}/',
|
||||
'translation' => 'extensions/translations/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to lower case and remove ".ontowiki" suffix
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($vars['name']);
|
||||
$vars['name'] = $this->pregReplace('/.ontowiki$/', '', $vars['name']);
|
||||
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
|
||||
$vars['name'] = $this->pregReplace('/-translation$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
14
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php
vendored
Normal file
14
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OsclassInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'oc-content/plugins/{$name}/',
|
||||
'theme' => 'oc-content/themes/{$name}/',
|
||||
'language' => 'oc-content/languages/{$name}/',
|
||||
);
|
||||
}
|
||||
49
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
49
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class OxidInstaller extends BaseInstaller
|
||||
{
|
||||
const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
|
||||
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'application/views/{$name}/',
|
||||
'out' => 'out/{$name}/',
|
||||
);
|
||||
|
||||
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
|
||||
{
|
||||
$installPath = parent::getInstallPath($package, $frameworkType);
|
||||
$type = $this->package->getType();
|
||||
if ($type === 'oxid-module') {
|
||||
$this->prepareVendorDirectory($installPath);
|
||||
}
|
||||
return $installPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure there is a vendormetadata.php file inside
|
||||
* the vendor folder if there is a vendor folder.
|
||||
*/
|
||||
protected function prepareVendorDirectory(string $installPath): void
|
||||
{
|
||||
$matches = '';
|
||||
$hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
|
||||
if (!$hasVendorDirectory) {
|
||||
return;
|
||||
}
|
||||
|
||||
$vendorDirectory = $matches['vendor'];
|
||||
$vendorPath = getcwd() . '/modules/' . $vendorDirectory;
|
||||
if (!file_exists($vendorPath)) {
|
||||
mkdir($vendorPath, 0755, true);
|
||||
}
|
||||
|
||||
$vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
|
||||
touch($vendorMetaDataPath);
|
||||
}
|
||||
}
|
||||
11
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
11
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PPIInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
12
vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php
vendored
Normal file
12
vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PantheonInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'script' => 'web/private/scripts/quicksilver/{$name}',
|
||||
'module' => 'web/private/scripts/quicksilver/{$name}',
|
||||
);
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhiftyInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'bundle' => 'bundles/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'framework' => 'frameworks/{$name}/',
|
||||
);
|
||||
}
|
||||
13
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
13
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhpBBInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$vendor}/{$name}/',
|
||||
'language' => 'language/{$name}/',
|
||||
'style' => 'styles/{$name}/',
|
||||
);
|
||||
}
|
||||
28
vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
28
vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class PiwikInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class PiwikInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Format package name to CamelCase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
28
vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
28
vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PlentymarketsInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => '{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Remove hyphen, "plugin" and format to camelcase
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
$nameBits = explode("-", $vars['name']);
|
||||
foreach ($nameBits as $key => $name) {
|
||||
$nameBits[$key] = ucfirst($name);
|
||||
if (strcasecmp($name, "Plugin") == 0) {
|
||||
unset($nameBits[$key]);
|
||||
}
|
||||
}
|
||||
$vars['name'] = implode('', $nameBits);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user