session key
diff --git a/app/vendor/adodb/adodb-php/tests/benchmark.php b/app/vendor/adodb/adodb-php/tests/benchmark.php
deleted file mode 100644
index 5ba5e8bcb..000000000
--- a/app/vendor/adodb/adodb-php/tests/benchmark.php
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
- ADODB Benchmarks
-
-
-
-ADODB Version: $ADODB_version Host: $db->host Database: $db->database";
-
- // perform query once to cache results so we are only testing throughput
- $rs = $db->Execute($sql);
- if (!$rs){
- print "Error in recordset";
- return;
- }
- $arr = $rs->GetArray();
- //$db->debug = true;
- global $ADODB_COUNTRECS;
- $ADODB_COUNTRECS = false;
- $start = microtime();
- for ($i=0; $i < $max; $i++) {
- $rs = $db->Execute($sql);
- $arr = $rs->GetArray();
- // print $arr[0][1];
- }
- $end = microtime();
- $start = explode(' ',$start);
- $end = explode(' ',$end);
-
- //print_r($start);
- //print_r($end);
-
- // print_r($arr);
- $total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
- printf ("
seconds = %8.2f for %d iterations each with %d records
",$total,$max, sizeof($arr));
- flush();
-
-
- //$db->Close();
-}
-include("testdatabases.inc.php");
-
-?>
-
-
-
-
diff --git a/app/vendor/adodb/adodb-php/tests/client.php b/app/vendor/adodb/adodb-php/tests/client.php
deleted file mode 100644
index 5b30065a0..000000000
--- a/app/vendor/adodb/adodb-php/tests/client.php
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-';
- var_dump(parse_url('odbc_mssql://userserver/'));
- die();
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
- function send2server($url,$sql)
- {
- $url .= '?sql='.urlencode($sql);
- print "$url
";
- $rs = csv2rs($url,$err);
- if ($err) print $err;
- return $rs;
- }
-
- function print_pre($s)
- {
- print "";print_r($s);print "
";
- }
-
-
-$serverURL = 'http://localhost/php/phplens/adodb/server.php';
-$testhttp = false;
-
-$sql1 = "insertz into products (productname) values ('testprod 1')";
-$sql2 = "insert into products (productname) values ('testprod 1')";
-$sql3 = "insert into products (productname) values ('testprod 2')";
-$sql4 = "delete from products where productid>80";
-$sql5 = 'select * from products';
-
-if ($testhttp) {
- print "Client Driver Tests";
- print "
Test Error
";
- $rs = send2server($serverURL,$sql1);
- print_pre($rs);
- print "
";
-
- print "Test Insert
";
-
- $rs = send2server($serverURL,$sql2);
- print_pre($rs);
- print "
";
-
- print "Test Insert2
";
-
- $rs = send2server($serverURL,$sql3);
- print_pre($rs);
- print "
";
-
- print "Test Delete
";
-
- $rs = send2server($serverURL,$sql4);
- print_pre($rs);
- print "
";
-
-
- print "Test Select
";
- $rs = send2server($serverURL,$sql5);
- if ($rs) rs2html($rs);
-
- print "
";
-}
-
-
-print "CLIENT Driver Tests
";
-$conn = ADONewConnection('csv');
-$conn->Connect($serverURL);
-$conn->debug = true;
-
-print "Bad SQL
";
-
-$rs = $conn->Execute($sql1);
-
-print "Insert SQL 1
";
-$rs = $conn->Execute($sql2);
-
-print "Insert SQL 2
";
-$rs = $conn->Execute($sql3);
-
-print "Select SQL
";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-print "Delete SQL
";
-$rs = $conn->Execute($sql4);
-
-print "Select SQL
";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-
-/* EXPECTED RESULTS FOR HTTP TEST:
-
-Test Insert
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 81
-)
-
-
---------------------------------------------------------------------------------
-
-Test Insert2
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 82
-)
-
-
---------------------------------------------------------------------------------
-
-Test Delete
-http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => delete from products where productid>80
- [affectedrows] => 2
- [insertid] => 0
-)
-
-[more stuff deleted]
- .
- .
- .
-*/
diff --git a/app/vendor/adodb/adodb-php/tests/pdo.php b/app/vendor/adodb/adodb-php/tests/pdo.php
deleted file mode 100644
index 31ca59697..000000000
--- a/app/vendor/adodb/adodb-php/tests/pdo.php
+++ /dev/null
@@ -1,92 +0,0 @@
-";
-try {
- echo "New Connection\n";
-
-
- $dsn = 'pdo_mysql://root:@localhost/northwind?persist';
-
- if (!empty($dsn)) {
- $DB = NewADOConnection($dsn) || die("CONNECT FAILED");
- $connstr = $dsn;
- } else {
-
- $DB = NewADOConnection('pdo');
-
- echo "Connect\n";
-
- $u = ''; $p = '';
- /*
- $connstr = 'odbc:nwind';
-
- $connstr = 'oci:';
- $u = 'scott';
- $p = 'natsoft';
-
-
- $connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
- */
-
- $connstr = "mysql:dbname=northwind";
- $u = 'root';
-
- $connstr = "pgsql:dbname=test";
- $u = 'tester';
- $p = 'test';
-
- $DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- }
-
- echo "connection string=$connstr\n Execute\n";
-
- //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rs = $DB->Execute("select * from ADOXYZ where id<3");
- if ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
-
-
- //print_r(get_class_methods($DB->_stmt));
-
- if (!$rs) die("NO RS");
-
- echo "Meta\n";
- for ($i=0; $i < $rs->NumCols(); $i++) {
- var_dump($rs->FetchField($i));
- echo "
";
- }
-
- echo "FETCH\n";
- $cnt = 0;
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- if ($cnt++ > 1000) break;
- }
-
- echo "
--------------------------------------------------------
\n\n\n";
-
- $stmt = $DB->PrepareStmt("select * from ADOXYZ");
-
- $rs = $stmt->Execute();
- $cols = $stmt->NumCols(); // execute required
-
- echo "COLS = $cols";
- for($i=1;$i<=$cols;$i++) {
- $v = $stmt->_stmt->getColumnMeta($i);
- var_dump($v);
- }
-
- echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
- while ($arr = $rs->FetchRow()) {
- adodb_pr($arr);
- }
- die("DONE\n");
-
-} catch (exception $e) {
- echo "";
- echo $e;
- echo "
";
-}
diff --git a/app/vendor/adodb/adodb-php/tests/test-active-record.php b/app/vendor/adodb/adodb-php/tests/test-active-record.php
deleted file mode 100644
index 59471620c..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-active-record.php
+++ /dev/null
@@ -1,140 +0,0 @@
-= 5) {
- include('../adodb-exceptions.inc.php');
- echo "Exceptions included
";
- }
- }
-
- $db = NewADOConnection('mysql://root@localhost/northwind?persist');
- $db->debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- class Person extends ADOdb_Active_Record{ function ret($v) {return $v;} }
- $person = new Person();
- ADOdb_Active_Record::$_quoteNames = '111';
-
- echo "Output of getAttributeNames: ";
- var_dump($person->getAttributeNames());
-
- /**
- * Outputs the following:
- * array(4) {
- * [0]=>
- * string(2) "id"
- * [1]=>
- * string(9) "name_first"
- * [2]=>
- * string(8) "name_last"
- * [3]=>
- * string(13) "favorite_color"
- * }
- */
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->save(); // this save() will fail on INSERT as favorite_color is a must fill...
-
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->favorite_color = 'blue';
- $person->save(); // this save will perform an INSERT successfully
-
- echo "
The Insert ID generated:"; print_r($person->id);
-
- $person->favorite_color = 'red';
- $person->save(); // this save() will perform an UPDATE
-
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- // load record where id=2 into a new ADOdb_Active_Record
- $person2 = new Person();
- $person2->Load('id=2');
-
- $activeArr = $db->GetActiveRecordsClass($class = "Person",$table = "Persons","id=".$db->Param(0),array(2));
- $person2 = $activeArr[0];
- echo "
Name (should be John): ",$person->name_first, "
Class (should be Person): ",get_class($person2),"
";
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'JAMIE','Lim')");
-
- $newperson2 = new Person();
- $person2->HasMany('children','person_id');
- $person2->Load('id=2');
- $person2->name_last='green';
- $c = $person2->children;
- $person2->save();
-
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie
";
- }
-
- class Child extends ADOdb_Active_Record{};
- $ch = new Child('children',array('id'));
- $ch->BelongsTo('person','person_id','id');
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child
";
-
- $p = $ch->person;
- if ($p->name_first != 'John') echo "Error loading belongsTo
";
- else echo "OK loading BelongTo
";
-
- $p->hasMany('children','person_id');
- $p->LoadRelations('children', " Name_first like 'J%' order by id",1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations
";
- else echo "error LoadRelations
";
-
- $db->Execute("CREATE TEMPORARY TABLE `persons2` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $p = new adodb_active_record('persons2');
- $p->name_first = 'James';
-
- $p->name_last = 'James';
-
- $p->HasMany('children','person_id');
- $p->children;
- var_dump($p);
- $p->Save();
diff --git a/app/vendor/adodb/adodb-php/tests/test-active-recs2.php b/app/vendor/adodb/adodb-php/tests/test-active-recs2.php
deleted file mode 100644
index f5898fcda..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-active-recs2.php
+++ /dev/null
@@ -1,76 +0,0 @@
-Connect("localhost","tester","test","test");
-} else
- $db = NewADOConnection('oci8://scott:natsoft@/');
-
-
-$arr = $db->ServerInfo();
-echo "
$db->dataProvider: {$arr['description']}
";
-
-$arr = $db->GetActiveRecords('products',' productid<10');
-adodb_pr($arr);
-
-ADOdb_Active_Record::SetDatabaseAdapter($db);
-if (!$db) die('failed');
-
-
-
-
-$rec = new ADODB_Active_Record('photos');
-
-$rec = new ADODB_Active_Record('products');
-
-
-adodb_pr($rec->getAttributeNames());
-
-echo "
";
-
-
-$rec->load('productid=2');
-adodb_pr($rec);
-
-$db->debug=1;
-
-
-$rec->productname = 'Changie Chan'.rand();
-
-$rec->insert();
-$rec->update();
-
-$rec->productname = 'Changie Chan 99';
-$rec->replace();
-
-
-$rec2 = new ADODB_Active_Record('products');
-$rec->load('productid=3');
-$rec->save();
-
-$rec = new ADODB_Active_record('products');
-$rec->productname = 'John ActiveRec';
-$rec->notes = 22;
-#$rec->productid=0;
-$rec->discontinued=1;
-$rec->Save();
-$rec->supplierid=33;
-$rec->Save();
-$rec->discontinued=0;
-$rec->Save();
-$rec->Delete();
-
-echo "Affected Rows after delete=".$db->Affected_Rows()."
";
diff --git a/app/vendor/adodb/adodb-php/tests/test-active-relations.php b/app/vendor/adodb/adodb-php/tests/test-active-relations.php
deleted file mode 100644
index 7a98d479f..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-active-relations.php
+++ /dev/null
@@ -1,85 +0,0 @@
-debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- ADODB_Active_Record::TableHasMany('persons', 'children','person_id');
- class person extends ADOdb_Active_Record{}
-
- $person = new person();
-# $person->HasMany('children','person_id'); ## this is affects all other instances of Person
-
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person2 = new person();
- $person2->Load('id=1');
-
- $c = $person2->children;
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie
";
- }
-
- class child extends ADOdb_Active_Record{};
- ADODB_Active_Record::TableBelongsTo('children','person','person_id','id');
- $ch = new Child('children',array('id'));
-
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child
";
-
- $p = $ch->person;
- if (!$p || $p->name_first != 'John') echo "Error loading belongsTo
";
- else echo "OK loading BelongTo
";
-
- if ($p) {
- #$p->HasMany('children','person_id'); ## this is affects all other instances of Person
- $p->LoadRelations('children', 'order by id',1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations
";
- else {
- var_dump($p->children);
- echo "error LoadRelations
";
- }
-
- unset($p->children);
- $p->LoadRelations('children', " name_first like 'J%' order by id",1,2);
- }
- if ($p)
- foreach($p->children as $c) {
- echo " Saving $c->name_first
";
- $c->name_first .= ' K.';
- $c->Save();
- }
diff --git a/app/vendor/adodb/adodb-php/tests/test-active-relationsx.php b/app/vendor/adodb/adodb-php/tests/test-active-relationsx.php
deleted file mode 100644
index 0f28f728c..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-active-relationsx.php
+++ /dev/null
@@ -1,418 +0,0 @@
-\n", $txt);
- echo $txt;
- }
-
- include_once('../adodb.inc.php');
- include_once('../adodb-active-recordx.inc.php');
-
-
- $db = NewADOConnection('mysql://root@localhost/test');
- $db->debug=0;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Preparing database using SQL queries (creating 'people', 'children')\n");
-
- $db->Execute("DROP TABLE `people`");
- $db->Execute("DROP TABLE `children`");
- $db->Execute("DROP TABLE `artists`");
- $db->Execute("DROP TABLE `songs`");
-
- $db->Execute("CREATE TABLE `people` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
- $db->Execute("CREATE TABLE `children` (
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- `id` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `artists` (
- `name` varchar(100) NOT NULL default '',
- `artistuniqueid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`artistuniqueid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `songs` (
- `name` varchar(100) NOT NULL default '',
- `artistid` int(10) NOT NULL,
- `recordid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`recordid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("insert into children (person_id,name_first,name_last,favorite_pet) values (1,'Jill','Lim','tortoise')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- $db->Execute("insert into artists (artistuniqueid, name) values(1,'Elvis Costello')");
- $db->Execute("insert into songs (recordid, name, artistid) values(1,'No Hiding Place', 1)");
- $db->Execute("insert into songs (recordid, name, artistid) values(2,'American Gangster Time', 1)");
-
- // This class _implicitely_ relies on the 'people' table (pluralized form of 'person')
- class Person extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->hasMany('children');
- }
- }
- // This class _implicitely_ relies on the 'children' table
- class Child extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table and shares its metadata with Child
- class Kid extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children');
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table but does not share its metadata
- class Rugrat extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children', false, false, array('new' => true));
- }
- }
-
- class Artist extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('artists', array('artistuniqueid'));
- $this->hasMany('songs', 'artistid');
- }
- }
- class Song extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('songs', array('recordid'));
- $this->belongsTo('artist', 'artistid');
- }
- }
-
- ar_echo("Inserting person in 'people' table ('John Lim, he likes lavender')\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person = new Person();
- $person->name_first = 'Lady';
- $person->name_last = 'Cat';
- $person->favorite_color = 'green';
- $person->save();
-
- $child = new Child();
- $child->name_first = 'Fluffy';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $child = new Child();
- $child->name_first = 'Sun';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $err_count = 0;
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1') [Lazy Method]\n");
- ar_echo("person is loaded but its children will be loaded on-demand later on\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1');
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Children:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("person is loaded, and so are its children\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("person and its children are loaded using a single query\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // When I specifically ask for a join, I have to specify which table id I am looking up
- // otherwise the SQL parser will wonder which table's id that would be.
- $people = $person->Find('people.id=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Load('people.id=1') [Join Method]\n");
- ar_echo("Load() always uses the join method since it returns only one row\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // Under the hood, Load(), since it returns only one row, always perform a join
- // Therefore we need to clarify which id we are talking about.
- $person->Load('people.id=1');
- ar_echo((ar_assert(found($person, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Load('children.id=1') [Join Method]\n");
- ar_echo("We are now loading from the 'children' table, not from 'people'\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $child->Load('children.id=1');
- ar_echo((ar_assert(found($child, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($child, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $children = $child->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($children, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($children, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Where we see that kid shares relationships with child because they are stored\n");
- ar_echo("in the common table's metadata structure.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("Of course, lazy loading also retrieve medata information...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading People:\n\n");
- foreach($kids as $akid)
- {
- if($akid->person);
- }
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("In rugrat's constructor it is specified that\nit must forget any existing relation\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($rugrats, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($rugrats, "'favorite_color' => 'lavender'"))) ? "[OK] No relation found\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Note how only rugrat forgot its relations - kid is fine.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] I did not forget relation: person\n" : "[!!] I should not have forgotten relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- $arugrat = $rugrats[0];
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n-- Loading relations:\n\n");
- $arugrat->belongsTo('person');
- $arugrat->LoadRelations('person', 'order by id', 0, 2);
- ar_echo((ar_assert(found($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'JAMIE'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('1=1') [Lazy Method]\n");
- ar_echo("And now for our finale...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('1=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($people, "'name_first' => 'Fluffy'"))) ? "[OK] No Fluffy yet\n" : "[!!] Found Fluffy relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Everybody:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Lady'"))) ? "[OK] Found Cat Lady\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Fluffy'"))) ? "[OK] Found Fluffy\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Sun'"))) ? "[OK] Found Sun\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Load('artistuniqueid=1') [Join Method]\n");
- ar_echo("Yes, we are dabbling in the musical field now..\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artist->Load('artistuniqueid=1');
- ar_echo((ar_assert(found($artist, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artist, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Load('recordid=1') [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $song->Load('recordid=1');
- ar_echo((ar_assert(found($song, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_WORK_AR) [Work Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($artists, "'name' => 'No Hiding Place'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($artists as $anartist)
- {
- foreach($anartist->songs as $asong)
- {
- if($asong->name);
- }
- }
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($songs, "'name' => 'Elvis Costello'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($songs as $asong)
- {
- if($asong->artist);
- }
- ar_echo((ar_assert(found($songs, "'name' => 'Elvis Costello'"))) ? "[OK] Found relation: artist\n" : "[!!] Missing relation: artist\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Test suite complete. " . (($err_count > 0) ? "$err_count errors found.\n" : "Success.\n"));
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
diff --git a/app/vendor/adodb/adodb-php/tests/test-datadict.php b/app/vendor/adodb/adodb-php/tests/test-datadict.php
deleted file mode 100644
index 9c7422aa3..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-datadict.php
+++ /dev/null
@@ -1,251 +0,0 @@
-$dbType";
- $db = NewADOConnection($dbType);
- $dict = NewDataDictionary($db);
-
- if (!$dict) continue;
- $dict->debug = 1;
-
- $opts = array('REPLACE','mysql' => 'ENGINE=INNODB', 'oci8' => 'TABLESPACE USERS');
-
-/* $flds = array(
- array('id', 'I',
- 'AUTO','KEY'),
-
- array('name' => 'firstname', 'type' => 'varchar','size' => 30,
- 'DEFAULT'=>'Joan'),
-
- array('lastname','varchar',28,
- 'DEFAULT'=>'Chen','key'),
-
- array('averylonglongfieldname','X',1024,
- 'NOTNULL','default' => 'test'),
-
- array('price','N','7.2',
- 'NOTNULL','default' => '0.00'),
-
- array('MYDATE', 'D',
- 'DEFDATE'),
- array('TS','T',
- 'DEFTIMESTAMP')
- );*/
-
- $flds = "
-ID I AUTO KEY,
-FIRSTNAME VARCHAR(30) DEFAULT 'Joan' INDEX idx_name,
-LASTNAME VARCHAR(28) DEFAULT 'Chen' key INDEX idx_name INDEX idx_lastname,
-averylonglongfieldname X(1024) DEFAULT 'test',
-price N(7.2) DEFAULT '0.00',
-MYDATE D DEFDATE INDEX idx_date,
-BIGFELLOW X NOTNULL,
-TS_SECS T DEFTIMESTAMP,
-TS_SUBSEC TS DEFTIMESTAMP
-";
-
-
- $sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
- $dict->SetSchema('KUTU');
-
- $sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
- $sqla = array_merge($sqla,$sqli);
-
- $sqli = $dict->CreateIndexSQL('idx','testtable','price,firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
- $sqla = array_merge($sqla,$sqli);
- $sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
- $sqla = array_merge($sqla,$sqli);
-
- $addflds = array(array('height', 'F'),array('weight','F'));
- $sqli = $dict->AddColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
- $addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
- $sqli = $dict->AlterColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
-
-
- printsqla($dbType,$sqla);
-
- if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
- if ($dbType == 'mysqlt') {
- $db->Connect('localhost', "root", "", "test");
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
- if ($dbType == 'postgres') {
- if (@$db->Connect('localhost', "tester", "test", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
- if ($dbType == 'odbc_mssql') {
- $dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
- if (@$db->Connect($dsn, "sa", "natsoft", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
-
-
- adodb_pr($dict->databaseType);
- printsqla($dbType, $dict->DropColumnSQL('table',array('my col','`col2_with_Quotes`','A_col3','col3(10)')));
- printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
-
-}
-
-function printsqla($dbType,$sqla)
-{
- print "
";
- //print_r($dict->MetaTables());
- foreach($sqla as $s) {
- $s = htmlspecialchars($s);
- print "$s;\n";
- if ($dbType == 'oci8') print "/\n";
- }
- print "
";
-}
-
-/***
-
-Generated SQL:
-
-mysql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INTEGER NOT NULL AUTO_INCREMENT,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) NOT NULL DEFAULT 'Chen',
-averylonglongfieldname LONGTEXT NOT NULL,
-price NUMERIC(7,2) NOT NULL DEFAULT 0.00,
-MYDATE DATE DEFAULT CURDATE(),
- PRIMARY KEY (id, lastname)
-)TYPE=ISAM;
-CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height DOUBLE;
-ALTER TABLE KUTU.testtable ADD weight DOUBLE;
-ALTER TABLE KUTU.testtable MODIFY COLUMN height DOUBLE NOT NULL;
-ALTER TABLE KUTU.testtable MODIFY COLUMN weight DOUBLE NOT NULL;
-
-
---------------------------------------------------------------------------------
-
-oci8
-
-CREATE USER KUTU IDENTIFIED BY tiger;
-/
-GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
-/
-DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
-/
-CREATE TABLE KUTU.testtable (
-id NUMBER(16) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname CLOB NOT NULL,
-price NUMBER(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT TRUNC(SYSDATE),
- PRIMARY KEY (id, lastname)
-)TABLESPACE USERS;
-/
-DROP SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE OR REPLACE TRIGGER KUTU.TRIG_SEQ_testtable BEFORE insert ON KUTU.testtable
- FOR EACH ROW
- BEGIN
- select KUTU.SEQ_testtable.nextval into :new.id from dual;
- END;
-/
-CREATE BITMAP INDEX idx ON KUTU.testtable (firstname,lastname);
-/
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-/
-ALTER TABLE testtable ADD (
- height NUMBER,
- weight NUMBER);
-/
-ALTER TABLE testtable MODIFY(
- height NUMBER NOT NULL,
- weight NUMBER NOT NULL);
-/
-
-
---------------------------------------------------------------------------------
-
-postgres
-AlterColumnSQL not supported for PostgreSQL
-
-
-CREATE DATABASE KUTU LOCATION='/u01/postdata';
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id SERIAL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT CURRENT_DATE,
- PRIMARY KEY (id, lastname)
-);
-CREATE INDEX idx ON KUTU.testtable USING HASH (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height FLOAT8;
-ALTER TABLE KUTU.testtable ADD weight FLOAT8;
-
-
---------------------------------------------------------------------------------
-
-odbc_mssql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INT IDENTITY(1,1) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATETIME DEFAULT GetDate(),
- PRIMARY KEY (id, lastname)
-);
-CREATE CLUSTERED INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD
- height REAL,
- weight REAL;
-ALTER TABLE KUTU.testtable ALTER COLUMN height REAL NOT NULL;
-ALTER TABLE KUTU.testtable ALTER COLUMN weight REAL NOT NULL;
-
-
---------------------------------------------------------------------------------
-*/
-
-
-echo "Test XML Schema
";
-$ff = file('xmlschema.xml');
-echo "";
-foreach($ff as $xml) echo htmlspecialchars($xml);
-echo "
";
-include_once('test-xmlschema.php');
diff --git a/app/vendor/adodb/adodb-php/tests/test-perf.php b/app/vendor/adodb/adodb-php/tests/test-perf.php
deleted file mode 100644
index 62465bef6..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-perf.php
+++ /dev/null
@@ -1,48 +0,0 @@
- $v) {
- if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
- }
-}
-
-if (isset($_SESSION['_db'])) {
- $_db = $_SESSION['_db'];
- $_GET[$_db] = 1;
- $$_db = 1;
-}
-
-echo "Performance Monitoring
";
-include_once('testdatabases.inc.php');
-
-
-function testdb($db)
-{
- if (!$db) return;
- echo "";print_r($db->ServerInfo()); echo " user=".$db->user."";
-
- $perf = NewPerfMonitor($db);
-
- # unit tests
- if (0) {
- //$DB->debug=1;
- echo "Data Cache Size=".$perf->DBParameter('data cache size').'';
- echo $perf->HealthCheck();
- echo($perf->SuspiciousSQL());
- echo($perf->ExpensiveSQL());
- echo($perf->InvalidSQL());
- echo $perf->Tables();
-
- echo "
";
- echo $perf->HealthCheckCLI();
- $perf->Poll(3);
- die();
- }
-
- if ($perf) $perf->UI(3);
-}
diff --git a/app/vendor/adodb/adodb-php/tests/test-pgblob.php b/app/vendor/adodb/adodb-php/tests/test-pgblob.php
deleted file mode 100644
index 3add99e64..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-pgblob.php
+++ /dev/null
@@ -1,86 +0,0 @@
-Param(false);
- $x = (rand() % 10) + 1;
- $db->debug= ($i==1);
- $id = $db->GetOne($sql,
- array('Z%','Z%',$x));
- if($id != $offset+$x) {
- print "Error at $x";
- break;
- }
- }
-}
-
-include_once('../adodb.inc.php');
-$db = NewADOConnection('postgres7');
-$db->PConnect('localhost','tester','test','test') || die("failed connection");
-
-$enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
-$val = rawurldecode($enc);
-
-$MAX = 1000;
-
-adodb_pr($db->ServerInfo());
-
-echo "
Testing PREPARE/EXECUTE PLAN
";
-
-
-$db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, with plan=',getmicrotime() - $t,'
';
-
-
-$db->_bindInputArray = false;
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, no plan=',getmicrotime() - $t,'
';
-
-
-
-echo "Testing UPDATEBLOB
";
-$db->debug=1;
-
-### TEST BEGINS
-
-$db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
-$db->UpdateBlob('photos','photo',$val,'id=9999');
-$v = $db->GetOne('select photo from photos where id=9999');
-
-
-### CLEANUP
-
-$db->Execute("delete from photos where id=9999");
-
-### VALIDATION
-
-if ($v !== $val) echo "*** ERROR: Inserted value does not match downloaded val";
-else echo "*** OK: Passed";
-
-echo "";
-echo "INSERTED: ", $enc;
-echo "
";
-echo"RETURNED: ", rawurlencode($v);
-echo "
";
-echo "INSERTED: ", $val;
-echo "
";
-echo "RETURNED: ", $v;
diff --git a/app/vendor/adodb/adodb-php/tests/test-php5.php b/app/vendor/adodb/adodb-php/tests/test-php5.php
deleted file mode 100644
index a8f1ffe5c..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-php5.php
+++ /dev/null
@@ -1,116 +0,0 @@
-PHP ".PHP_VERSION."\n";
-try {
-
-$dbt = 'oci8po';
-
-try {
-switch($dbt) {
-case 'oci8po':
- $db = NewADOConnection("oci8po");
-
- $db->Connect('localhost','scott','natsoft','sherkhan');
- break;
-default:
-case 'mysql':
- $db = NewADOConnection("mysql");
- $db->Connect('localhost','root','','northwind');
- break;
-
-case 'mysqli':
- $db = NewADOConnection("mysqli://root:@localhost/northwind");
- //$db->Connect('localhost','root','','test');
- break;
-}
-} catch (exception $e){
- echo "Connect Failed";
- adodb_pr($e);
- die();
-}
-
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz where ?Prepare("select * from adoxyz where ?ErrorMsg(),"\n";
-$rs = $db->Execute($stmt,array(10,20));
-
-echo "
Foreach Iterator Test (rand=".rand().")
";
-$i = 0;
-foreach($rs as $v) {
- $i += 1;
- echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields,true);
- if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
- else echo "passed
";
- flush();
-}
-
-$rs = new ADORecordSet_empty();
-foreach($rs as $v) {
- echo "empty ";var_dump($v);
-}
-
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-else echo "Count $i is correct
";
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- echo "
adodb_backtrace:
\n";
- $e = adodb_backtrace($e->gettrace());
-}
-
-$rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
-echo "Result=\n",$rs,"";
-
-echo "Active Record
";
-
- include_once("../adodb-active-record.inc.php");
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-try {
- class City extends ADOdb_Active_Record{};
- $a = new City();
-
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-try {
-
- $a = new City();
-
- echo "Successfully created City()
";
- #var_dump($a->GetPrimaryKeys());
- $a->city = 'Kuala Lumpur';
- $a->Save();
- $a->Update();
- #$a->SetPrimaryKeys(array('city'));
- $a->country = "M'sia";
- $a->save();
- $a->Delete();
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-//include_once("test-active-record.php");
diff --git a/app/vendor/adodb/adodb-php/tests/test-xmlschema.php b/app/vendor/adodb/adodb-php/tests/test-xmlschema.php
deleted file mode 100644
index c56cfec8e..000000000
--- a/app/vendor/adodb/adodb-php/tests/test-xmlschema.php
+++ /dev/null
@@ -1,53 +0,0 @@
-Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1');
-
-// To create a schema object and build the query array.
-$schema = new adoSchema( $db );
-
-// To upgrade an existing schema object, use the following
-// To upgrade an existing database to the provided schema,
-// uncomment the following line:
-#$schema->upgradeSchema();
-
-print "SQL to build xmlschema.xml:\n
";
-// Build the SQL array
-$sql = $schema->ParseSchema( "xmlschema.xml" );
-
-var_dump( $sql );
-print "
\n";
-
-// Execute the SQL on the database
-//$result = $schema->ExecuteSchema( $sql );
-
-// Finally, clean up after the XML parser
-// (PHP won't do this for you!)
-//$schema->Destroy();
-
-
-
-print "SQL to build xmlschema-mssql.xml:\n";
-
-$db2 = ADONewConnection('mssql');
-$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
-
-$db2->Execute("drop table simple_table");
-
-$schema = new adoSchema( $db2 );
-$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
-
-print_r( $sql );
-print "\n";
-
-$db2->debug=1;
-
-foreach ($sql as $s)
-$db2->Execute($s);
diff --git a/app/vendor/adodb/adodb-php/tests/test.php b/app/vendor/adodb/adodb-php/tests/test.php
deleted file mode 100644
index 50e74ad4c..000000000
--- a/app/vendor/adodb/adodb-php/tests/test.php
+++ /dev/null
@@ -1,1781 +0,0 @@
-$msg
";
- flush();
-}
-
-function CheckWS($conn)
-{
-global $ADODB_EXTENSION;
-
- include_once('../session/adodb-session.php');
- if (defined('CHECKWSFAIL')){ echo " TESTING $conn ";flush();}
- $saved = $ADODB_EXTENSION;
- $db = ADONewConnection($conn);
- $ADODB_EXTENSION = $saved;
- if (headers_sent()) {
- print "White space detected in adodb-$conn.inc.php or include file...
";
- //die();
- }
-}
-
-function do_strtolower(&$arr)
-{
- foreach($arr as $k => $v) {
- if (is_object($v)) $arr[$k] = adodb_pr($v,true);
- else $arr[$k] = strtolower($v);
- }
-}
-
-
-function CountExecs($db, $sql, $inputarray)
-{
-global $EXECS; $EXECS++;
-}
-
-function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
-{
-global $CACHED; $CACHED++;
-}
-
-// the table creation code is specific to the database, so we allow the user
-// to define their own table creation stuff
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE,$ADODB_COUNTRECS;
-
- //adodb_pr($db);
-
-?>
-Close();
- if ($rs2) $rs2->Close();
- if ($rs) $rs->Close();
- $db->Close();
-
- if ($db->transCnt != 0) Err("Error in transCnt=$db->transCnt (should be 0)");
-
-
- printf("Total queries=%d; total cached=%d
",$EXECS+$CACHED, $CACHED);
- flush();
-}
-
-function adodb_test_err($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
-{
-global $TESTERRS,$ERRNO;
-
- $ERRNO = $errno;
- $TESTERRS += 1;
- print "** $dbms ($fn): errno=$errno errmsg=$errmsg ($p1,$p2)
";
-}
-
-//--------------------------------------------------------------------------------------
-
-
-@set_time_limit(240); // increase timeout
-
-include("../tohtml.inc.php");
-include("../adodb.inc.php");
-include("../rsfilter.inc.php");
-
-/* White Space Check */
-
-if (isset($_SERVER['argv'][1])) {
- //print_r($_SERVER['argv']);
- $_GET[$_SERVER['argv'][1]] = 1;
-}
-
-if (@$_SERVER['COMPUTERNAME'] == 'TIGRESS') {
- CheckWS('mysqlt');
- CheckWS('postgres');
- CheckWS('oci8po');
-
- CheckWS('firebird');
- CheckWS('sybase');
- if (!ini_get('safe_mode')) CheckWS('informix');
-
- CheckWS('ado_mssql');
- CheckWS('ado_access');
- CheckWS('mssql');
-
- CheckWS('vfp');
- CheckWS('sqlanywhere');
- CheckWS('db2');
- CheckWS('access');
- CheckWS('odbc_mssql');
- CheckWS('firebird15');
- //
- CheckWS('oracle');
- CheckWS('proxy');
- CheckWS('fbsql');
- print "White Space Check complete";
-}
-if (sizeof($_GET) == 0) $testmysql = true;
-
-
-foreach($_GET as $k=>$v) {
- // XSS protection (see Github issue #274) - only set variables for
- // expected get parameters used in testdatabases.inc.php
- if(preg_match('/^(test|no)\w+$/', $k)) {
- $$k = $v;
- }
-}
-
-?>
-
-
ADODB Testing
-
-ADODB Test
-
-This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO).
-There is also support for Sybase, PostgreSQL.
-For the latest version of ADODB, visit adodb.sourceforge.net.
-
-Test GetInsertSQL/GetUpdateSQL
- Sessions
- Paging
- Perf Monitor
-vers=",ADOConnection::Version();
-
-
-
-?>
-
ADODB Database Library (c) 2000-2014 John Lim. All rights reserved. Released under BSD and LGPL, PHP .
-
-
diff --git a/app/vendor/adodb/adodb-php/tests/test2.php b/app/vendor/adodb/adodb-php/tests/test2.php
deleted file mode 100644
index eb3b02582..000000000
--- a/app/vendor/adodb/adodb-php/tests/test2.php
+++ /dev/null
@@ -1,25 +0,0 @@
-debug=1;
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
-
- echo "PHP ",PHP_VERSION,"
";
-
- $db->Connect($myDSN) || die('fail');
-
- print_r($db->ServerInfo());
-
- try {
- $rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx");
- print_r($rs->fields);
- } catch(exception $e) {
- print_r($e);
- echo " Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y');
- }
diff --git a/app/vendor/adodb/adodb-php/tests/test3.php b/app/vendor/adodb/adodb-php/tests/test3.php
deleted file mode 100644
index 78c7c775a..000000000
--- a/app/vendor/adodb/adodb-php/tests/test3.php
+++ /dev/null
@@ -1,44 +0,0 @@
-Connect('','scott','natsoft');
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz");
-$rs = $db->Execute("select * from adoxyz order by id");
-
-$i = 0;
-foreach($rs as $k => $v) {
- $i += 1;
- echo $k; adodb_pr($v);
- flush();
-}
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-
-
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- $e = adodb_backtrace($e->trace);
-}
diff --git a/app/vendor/adodb/adodb-php/tests/test4.php b/app/vendor/adodb/adodb-php/tests/test4.php
deleted file mode 100644
index 7a5d821ca..000000000
--- a/app/vendor/adodb/adodb-php/tests/test4.php
+++ /dev/null
@@ -1,144 +0,0 @@
-PConnect("", "sa", "natsoft", "northwind"); // connect to MySQL, testdb
-
-$conn = ADONewConnection("mysql"); // create a connection
-$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
-
-
-#$conn = ADONewConnection('oci8po');
-#$conn->Connect('','scott','natsoft');
-
-if (PHP_VERSION >= 5) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $conn = ADONewConnection('pdo');
- $conn->Connect($connstr, $u, $p);
-}
-//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
-
-$conn->debug=1;
-$conn->Execute("delete from adoxyz where lastname like 'Smi%'");
-
-$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
-$record = array(); // Initialize an array to hold the record data to insert
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 751;
-$record["firstname"] = 'Jann';
-$record["lastname"] = "Smitts";
-$record["created"] = time();
-
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 752;
-// Set the values for the fields in the record
-$record["firstname"] = 'anull';
-$record["lastname"] = "Smith\$@//";
-$record["created"] = time();
-
-if (isset($_GET['f'])) $ADODB_FORCE_TYPE = $_GET['f'];
-
-//$record["id"] = -1;
-
-// Pass the empty recordset and the array containing the data to insert
-// into the GetInsertSQL function. The function will process the data and return
-// a fully formatted insert sql statement.
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-
-
-$insertSQL2 = $conn->GetInsertSQL($table='ADOXYZ', $record);
-if ($insertSQL != $insertSQL2) echo "
Walt's new stuff failed: $insertSQL2
";
-//==========================
-// This code tests an update
-
-$sql = "
-SELECT *
-FROM ADOXYZ WHERE lastname=".$conn->Param('var'). " ORDER BY 1";
-// Select a record to update
-
-$varr = array('var'=>$record['lastname'].'');
-$rs = $conn->Execute($sql,$varr); // Execute the query and get the existing record to update
-if (!$rs || $rs->EOF) print "No record found!
";
-
-$record = array(); // Initialize an array to hold the record data to update
-
-
-// Set the values for the fields in the record
-$record["firstName"] = "Caroline".rand();
-//$record["lasTname"] = ""; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = '';
-// Pass the single record recordset and the array containing the data to update
-// into the GetUpdateSQL function. The function will process the data and return
-// a fully formatted update sql statement.
-// If the data has not changed, no recordset is returned
-
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error1 : Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$record["firstName"] = "Caroline".rand();
-$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error 2: Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-
-$record["firstName"] = "Carol-new-".rand();
-$record["lasTname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-
-$conn->AutoExecute('ADOXYZ',$record,'UPDATE', "lastname like 'Sm%'");
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-}
-
-
-testsql();
diff --git a/app/vendor/adodb/adodb-php/tests/test5.php b/app/vendor/adodb/adodb-php/tests/test5.php
deleted file mode 100644
index e46bbc1df..000000000
--- a/app/vendor/adodb/adodb-php/tests/test5.php
+++ /dev/null
@@ -1,48 +0,0 @@
-debug=1;
- $conn->PConnect("localhost","root","","xphplens");
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
-
-if (0) {
- $conn = ADONewConnection("oci8"); // create a connection
- $conn->debug=1;
- $conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID();
-}
-
-if (0) {
- $conn = ADONewConnection("ibase"); // create a connection
- $conn->debug=1;
- $conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
-
-if (0) {
- $conn = ADONewConnection('postgres');
- $conn->debug=1;
- @$conn->PConnect("susetikus","tester","test","test");
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
diff --git a/app/vendor/adodb/adodb-php/tests/test_rs_array.php b/app/vendor/adodb/adodb-php/tests/test_rs_array.php
deleted file mode 100644
index 547b20ad6..000000000
--- a/app/vendor/adodb/adodb-php/tests/test_rs_array.php
+++ /dev/null
@@ -1,46 +0,0 @@
-InitArray($array,$typearr);
-
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
1 Seek
";
-$rs->Move(1);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
2 Seek
";
-$rs->Move(2);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
3 Seek
";
-$rs->Move(3);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-
-
-die();
diff --git a/app/vendor/adodb/adodb-php/tests/testcache.php b/app/vendor/adodb/adodb-php/tests/testcache.php
deleted file mode 100644
index 87f6d51a1..000000000
--- a/app/vendor/adodb/adodb-php/tests/testcache.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-PConnect('nwind');
-} else {
- $db = ADONewConnection('mysql');
- $db->PConnect('mangrove','root','','xphplens');
-}
-if (isset($cache)) $rs = $db->CacheExecute(120,'select * from products');
-else $rs = $db->Execute('select * from products');
-
-$arr = $rs->GetArray();
-print sizeof($arr);
diff --git a/app/vendor/adodb/adodb-php/tests/testdatabases.inc.php b/app/vendor/adodb/adodb-php/tests/testdatabases.inc.php
deleted file mode 100644
index f9f000a64..000000000
--- a/app/vendor/adodb/adodb-php/tests/testdatabases.inc.php
+++ /dev/null
@@ -1,478 +0,0 @@
-
-
-
-
-
-
-FETCH MODE IS NOT ADODB_FETCH_DEFAULT";
-
-if (isset($nocountrecs)) $ADODB_COUNTRECS = false;
-
-// cannot test databases below, but we include them anyway to check
-// if they parse ok...
-
-if (sizeof($_GET) || !isset($_SERVER['HTTP_HOST'])) {
- echo "
";
- ADOLoadCode2("sybase");
- ADOLoadCode2("postgres");
- ADOLoadCode2("postgres7");
- ADOLoadCode2("firebird");
- ADOLoadCode2("borland_ibase");
- ADOLoadCode2("informix");
- ADOLoadCode2('mysqli');
- if (defined('ODBC_BINMODE_RETURN')) {
- ADOLoadCode2("sqlanywhere");
- ADOLoadCode2("access");
- }
- ADOLoadCode2("mysql");
- ADOLoadCode2("oci8");
-}
-
-function ADOLoadCode2($d)
-{
- ADOLoadCode($d);
- $c = ADONewConnection($d);
- echo "Loaded $d ",($c ? 'ok' : 'extension not installed'),"
";
-}
-
-flush();
-
-// dregad 2014-04-15 added serial field to avoid error with lastval()
-$pg_test_table = "create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date, ser serial)";
-$pg_hostname = 'localhost';
-$pg_user = 'tester';
-$pg_password = 'test';
-$pg_database = 'northwind';
-$pg_errmsg = "ERROR: PostgreSQL requires a database called '$pg_database' "
- . "on server '$pg_hostname', user '$pg_user', password '$pg_password'.
";
-
-if (!empty($testpostgres)) {
- //ADOLoadCode("postgres");
-
- $db = ADONewConnection('postgres');
- print "Connecting $db->databaseType...
";
- if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
- testdb($db, $pg_test_table);
- } else {
- print $pg_errmsg . $db->ErrorMsg();
- }
-}
-
-if (!empty($testpostgres9)) {
- //ADOLoadCode("postgres");
-
- $db = ADONewConnection('postgres9');
- print "Connecting $db->databaseType...
";
- if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
- testdb($db, $pg_test_table);
- } else {
- print $pg_errmsg . $db->ErrorMsg();
- }
-}
-
-if (!empty($testpgodbc)) {
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
-
- if ($db->PConnect('Postgresql')) {
- $db->hasTransactions = true;
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- } else print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.
".$db->ErrorMsg();
-}
-
-if (!empty($testibase)) {
- //$_GET['nolog'] = true;
- $db = ADONewConnection('firebird');
- print "Connecting $db->databaseType...
";
- if ($db->PConnect("localhost:d:\\firebird\\151\\examples\\EMPLOYEE.fdb", "sysdba", "masterkey", ""))
- testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),price numeric(12,2),created date)");
- else print "ERROR: Interbase test requires a database called employee.gdb".'
'.$db->ErrorMsg();
-
-}
-
-
-if (!empty($testsqlite)) {
- $path =urlencode('d:\inetpub\adodb\sqlite.db');
- $dsn = "sqlite://$path/";
- $db = ADONewConnection($dsn);
- //echo $dsn;
-
- //$db = ADONewConnection('sqlite');
-
-
- if ($db && $db->PConnect("d:\\inetpub\\adodb\\sqlite.db", "", "", "")) {
- print "Connecting $db->databaseType...
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else
- print "ERROR: SQLite";
-
-}
-
-if (!empty($testpdopgsql)) {
- $connstr = "pgsql:dbname=test";
- $u = 'tester';$p='test';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomysql)) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomssql)) {
- $connstr = "mssql:dbname=northwind";
- $u = 'sa';$p='natsoft';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdosqlite)) {
- $connstr = "sqlite:d:/inetpub/adodb/sqlite-pdo.db3";
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoaccess)) {
- $connstr = 'odbc:nwind';
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoora)) {
- $connstr = 'oci:';
- $u = 'scott';$p='natsoft';
- $db = ADONewConnection('pdo');
- #$db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-// REQUIRES ODBC DSN CALLED nwind
-if (!empty($testaccess)) {
- $db = ADONewConnection('access');
- print "Connecting $db->databaseType...
";
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $dsn = "nwind";
- $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$access;Uid=Admin;Pwd=;";
-
- //$dsn = 'Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' . $access . ';';
- if ($db->PConnect($dsn, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
-
-}
-
-if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
-
- $db = ADONewConnection("ado_access");
- print "Connecting $db->databaseType...
";
-
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
- //. 'USER ID=;PASSWORD=;';
- $_GET['nolog'] = 1;
- if ($db->PConnect($myDSN, "", "", "")) {
- print "ADO version=".$db->_connectionID->version."
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: Access test requires a Access database $access".'
'.$db->ErrorMsg();
-
-}
-
-if (!empty($testvfp)) { // ODBC
- $db = ADONewConnection('vfp');
- print "Connecting $db->databaseType...
";flush();
-
- if ( $db->PConnect("vfp-adoxyz")) {
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
- echo "
";
- $db = ADONewConnection('odbtp');
-
- if ( $db->PConnect('localhost','DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=d:\inetpub\adodb;EXCLUSIVE=NO;')) {
- print "Connecting $db->databaseType...
";flush();
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro odbtp requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysql)) { // MYSQL
-
-
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- $user = 'root'; $password = ''; $database = 'northwind';
- $db = ADONewConnection("mysqlt://$user:$password@$server/$database?persist");
- print "Connecting $db->databaseType...
";
-
- if (true || $db->PConnect($server, "root", "", "northwind")) {
- //$db->Execute("DROP TABLE ADOXYZ") || die('fail drop');
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) Type=InnoDB");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqli)) { // MYSQL
-
- $db = ADONewConnection('mysqli');
- print "Connecting $db->databaseType...
";
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect($server, "root", "", "northwind")) {
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqlodbc)) { // MYSQL
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect('mysql', "root", ""))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-if (!empty($testproxy)){
- $db = ADONewConnection('proxy');
- print "Connecting $db->databaseType...
";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-
- if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode('oci805');
-ADOLoadCode("oci8po");
-
-if (!empty($testoracle)) {
- $dsn = "oci8";//://scott:natsoft@kk2?persist";
- $db = ADONewConnection($dsn );//'oci8');
-
- //$db->debug=1;
- print "Connecting $db->databaseType...
";
- if ($db->Connect('mobydick', "scott", "natsoft",'SID=mobydick'))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else
- print "ERROR: Oracle test requires an Oracle server setup with scott/natsoft".'
'.$db->ErrorMsg();
-
-}
-ADOLoadCode("oracle"); // no longer supported
-if (false && !empty($testoracle)) {
-
- $db = ADONewConnection();
- print "Connecting $db->databaseType...
";
- if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'
'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode("odbc_db2"); // no longer supported
-if (!empty($testdb2)) {
- if (PHP_VERSION>=5.1) {
- $db = ADONewConnection("db2");
- print "Connecting $db->databaseType...
";
-
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect('localhost','natsoft','guest','test')) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'
'.$db->ErrorMsg();
- } else {
- $db = ADONewConnection("odbc_db2");
- print "Connecting $db->databaseType...
";
-
- $dsn = "db2test";
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect($dsn)) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'
'.$db->ErrorMsg();
- }
-echo "
";
-flush();
- $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-
- $db = ADONewConnection('odbtp');
- if ($db->Connect('127.0.0.1',$dsn)) {
-
- $db->debug=1;
- $arr = $db->GetArray( "||SQLProcedures" ); adodb_pr($arr);
- $arr = $db->GetArray( "||SQLProcedureColumns|||GET_ROUTINE_SAR" );adodb_pr($arr);
-
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else echo ("ERROR Connection");
- echo $db->ErrorMsg();
-}
-
-
-$server = 'localhost';
-
-
-
-ADOLoadCode("mssqlpo");
-if (false && !empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
- $db = ADONewConnection("mssqlpo");
- //$db->debug=1;
- print "Connecting $db->databaseType...
";
-
- $ok = $db->Connect('','sa','natsoft','northwind');
- echo $db->ErrorMsg();
- if ($ok /*or $db->PConnect("mangrove", "sa", "natsoft", "ai")*/) {
- AutoDetect_MSSQL_Date_Order($db);
- // $db->Execute('drop table adoxyz');
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='$server', userid='adodb', password='natsoft', database='ai'".'
'.$db->ErrorMsg();
-
-}
-
-
-ADOLoadCode('odbc_mssql');
-if (!empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection();
-
- print "Connecting $db->databaseType...
";
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;";
- $dsn = 'condor';
- if ($db->PConnect($dsn, "sa", "natsoft", "")) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-ADOLoadCode("ado_mssql");
-if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
-
- $db = ADONewConnection("ado_mssql");
- //$db->debug=1;
- print "Connecting DSN-less $db->databaseType...
";
-
- $myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
- . "SERVER=$server;DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No";
-
-
- if ($db->PConnect($myDSN, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- else print "ERROR: MSSQL test 2 requires MS SQL 7";
-
-}
-
-if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
-
- $db = ADONewConnection("ado_mssql");
- print "Connecting DSN-less OLEDB Provider $db->databaseType...
";
- //$db->debug=1;
- $myDSN="SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes";
- if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
-
-}
-
-
-if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection('odbtp');
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;uid=adodb;pwd=natsoft";
-
- if ($db->PConnect('localhost',$dsn, "", "")) {
- print "Connecting $db->databaseType...
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-
-print "Tests Completed
";
diff --git a/app/vendor/adodb/adodb-php/tests/testgenid.php b/app/vendor/adodb/adodb-php/tests/testgenid.php
deleted file mode 100644
index 3310734a5..000000000
--- a/app/vendor/adodb/adodb-php/tests/testgenid.php
+++ /dev/null
@@ -1,35 +0,0 @@
-Execute("drop table $table");
- //$db->debug=true;
-
- $ctr = 5000;
- $lastnum = 0;
-
- while (--$ctr >= 0) {
- $num = $db->GenID($table);
- if ($num === false) {
- print "GenID returned false";
- break;
- }
- if ($lastnum + 1 == $num) print " $num ";
- else {
- print " $num ";
- flush();
- }
- $lastnum = $num;
- }
-}
diff --git a/app/vendor/adodb/adodb-php/tests/testmssql.php b/app/vendor/adodb/adodb-php/tests/testmssql.php
deleted file mode 100644
index 733f0d455..000000000
--- a/app/vendor/adodb/adodb-php/tests/testmssql.php
+++ /dev/null
@@ -1,77 +0,0 @@
-Connect('127.0.0.1','adodb','natsoft','northwind') or die('Fail');
-
-$conn->debug =1;
-$query = 'select * from products';
-$conn->SetFetchMode(ADODB_FETCH_ASSOC);
-$rs = $conn->Execute($query);
-echo "";
-while( !$rs->EOF ) {
- $output[] = $rs->fields;
- var_dump($rs->fields);
- $rs->MoveNext();
- print "";
-}
-die();
-
-
-$p = $conn->Prepare('insert into products (productname,unitprice,dcreated) values (?,?,?)');
-echo "
";
-print_r($p);
-
-$conn->debug=1;
-$conn->Execute($p,array('John'.rand(),33.3,$conn->DBDate(time())));
-
-$p = $conn->Prepare('select * from products where productname like ?');
-$arr = $conn->getarray($p,array('V%'));
-print_r($arr);
-die();
-
-//$conn = ADONewConnection("mssql");
-//$conn->Connect('mangrove','sa','natsoft','ai');
-
-//$conn->Connect('mangrove','sa','natsoft','ai');
-$conn->debug=1;
-$conn->Execute('delete from blobtest');
-
-$conn->Execute('insert into blobtest (id) values(1)');
-$conn->UpdateBlobFile('blobtest','b1','../cute_icons_for_site/adodb.gif','id=1');
-$rs = $conn->Execute('select b1 from blobtest where id=1');
-
-$output = "c:\\temp\\test_out-".date('H-i-s').".gif";
-print "Saving file $output, size=".strlen($rs->fields[0])."";
-$fd = fopen($output, "wb");
-fwrite($fd, $rs->fields[0]);
-fclose($fd);
-
-print " View Image";
-//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
-//rs2html($rs);
diff --git a/app/vendor/adodb/adodb-php/tests/testoci8.php b/app/vendor/adodb/adodb-php/tests/testoci8.php
deleted file mode 100644
index 5eadc22ed..000000000
--- a/app/vendor/adodb/adodb-php/tests/testoci8.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-PConnect('','scott','natsoft');
- if (!empty($testblob)) {
- $varHoldingBlob = 'ABC DEF GEF John TEST';
- $num = time()%10240;
- // create table atable (id integer, ablob blob);
- $db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
- $db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
-
- $rs = $db->Execute('select * from atable');
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
- $stmt = $db->Prepare('select * from adoxyz where id=?');
- for ($i = 1; $i <= 10; $i++) {
- $rs = $db->Execute(
- $stmt,
- array($i));
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
-}
-if (1) {
- $db = ADONewConnection('oci8');
- $db->PConnect('','scott','natsoft');
- $db->debug = true;
- $db->Execute("delete from emp where ename='John'");
- print $db->Affected_Rows().'
';
- $stmt = $db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- $rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
- // prepare not quite ready for prime time
- //$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
- if (!$rs) die("Empty RS");
-
- $db->setfetchmode(ADODB_FETCH_NUM);
-
- $vv = 'A%';
- $stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
- $db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
- $db->OutParameter($stmt, $vv, 'tt');
- $rs = $db->Execute($stmt);
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- }
- echo " val = $vv";
-
-}
-
-if (0) {
- $db = ADONewConnection('odbc_oracle');
- if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
- $db->debug = true;
- $rs = $db->Execute(
- 'select * from adoxyz where firstname=? and trim(lastname)=?',
- array('first'=>'Caroline','last'=>'Miranda'));
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
-}
diff --git a/app/vendor/adodb/adodb-php/tests/testoci8cursor.php b/app/vendor/adodb/adodb-php/tests/testoci8cursor.php
deleted file mode 100644
index 1f7b381e5..000000000
--- a/app/vendor/adodb/adodb-php/tests/testoci8cursor.php
+++ /dev/null
@@ -1,110 +0,0 @@
-PConnect('','scott','natsoft');
- $db->debug = 99;
-
-
-/*
-*/
-
- define('MYNUM',5);
-
-
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS,'A%'); END;");
-
- if ($rs && !$rs->EOF) {
- print "Test 1 RowCount: ".$rs->RecordCount()."";
- } else {
- print "Error in using Cursor Variables 1
";
- }
-
- print "
Testing Stored Procedures for oci8
";
-
- $stid = $db->PrepareSP('BEGIN adodb.myproc('.MYNUM.', :myov); END;');
- $db->OutParameter($stid, $myov, 'myov');
- $db->Execute($stid);
- if ($myov != MYNUM) print "Error with myproc
";
-
-
- $stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;",true);
- $a1 = 'Malaysia';
- //$a2 = ''; # a2 doesn't even need to be defined!
- $db->InParameter($stmt,$a1,'a1');
- $db->OutParameter($stmt,$a2,'a2');
- $rs = $db->Execute($stmt);
- if ($rs) {
- if ($a2 !== 'Cinta Hati Malaysia') print "Stored Procedure Error: a2 = $a2";
- else echo "OK: a2=$a2
";
- } else {
- print "Error in using Stored Procedure IN/Out Variables
";
- }
-
-
- $tname = 'A%';
-
- $stmt = $db->PrepareSP('select * from tab where tname like :tablename');
- $db->Parameter($stmt,$tname,'tablename');
- $rs = $db->Execute($stmt);
- rs2html($rs);
diff --git a/app/vendor/adodb/adodb-php/tests/testpaging.php b/app/vendor/adodb/adodb-php/tests/testpaging.php
deleted file mode 100644
index 947641bed..000000000
--- a/app/vendor/adodb/adodb-php/tests/testpaging.php
+++ /dev/null
@@ -1,87 +0,0 @@
-PConnect('localhost','tester','test','test');
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->PConnect("nwind", "", "", "");
-}
-
-if ($driver == 'ibase') {
- $db = NewADOConnection('ibase');
- $db->PConnect("localhost:e:\\firebird\\examples\\employee.gdb", "sysdba", "masterkey", "");
- $sql = 'select distinct firstname, lastname from adoxyz order by firstname';
-
-}
-if ($driver == 'mssql') {
- $db = NewADOConnection('mssql');
- $db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-}
-if ($driver == 'oci8') {
- $db = NewADOConnection('oci8');
- $db->Connect('','scott','natsoft');
-
-$sql = "select * from (select ID, firstname as \"First Name\", lastname as \"Last Name\" from adoxyz
- order by 1)";
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->Connect('nwind');
-}
-
-if (empty($driver) or $driver == 'mysql') {
- $db = NewADOConnection('mysql');
- $db->Connect('localhost','root','','test');
-}
-
-//$db->pageExecuteCountRows = false;
-
-$db->debug = true;
-
-if (0) {
-$rs = $db->Execute($sql);
-include_once('../toexport.inc.php');
-print "
";
-print rs2csv($rs); # return a string
-
-print '
';
-$rs->MoveFirst(); # note, some databases do not support MoveFirst
-print rs2tab($rs); # return a string
-
-print '
';
-$rs->MoveFirst();
-rs2tabout($rs); # send to stdout directly
-print "
";
-}
-
-$pager = new ADODB_Pager($db,$sql);
-$pager->showPageLinks = true;
-$pager->linksPerPage = 10;
-$pager->cache = 60;
-$pager->Render($rows=7);
diff --git a/app/vendor/adodb/adodb-php/tests/testpear.php b/app/vendor/adodb/adodb-php/tests/testpear.php
deleted file mode 100644
index a59f5f2c6..000000000
--- a/app/vendor/adodb/adodb-php/tests/testpear.php
+++ /dev/null
@@ -1,35 +0,0 @@
-setFetchMode(ADODB_FETCH_ASSOC);
-$rs = $db->Query('select firstname,lastname from adoxyz');
-$cnt = 0;
-while ($arr = $rs->FetchRow()) {
- print_r($arr);
- print "
";
- $cnt += 1;
-}
-
-if ($cnt != 50) print "Error in \$cnt = $cnt";
diff --git a/app/vendor/adodb/adodb-php/tests/testsessions.php b/app/vendor/adodb/adodb-php/tests/testsessions.php
deleted file mode 100644
index 79a66191c..000000000
--- a/app/vendor/adodb/adodb-php/tests/testsessions.php
+++ /dev/null
@@ -1,100 +0,0 @@
-Notify Expiring=$ref, sessionkey=$key";
-}
-
-//-------------------------------------------------------------------
-
-error_reporting(E_ALL);
-
-
-ob_start();
-include('../session/adodb-cryptsession2.php');
-
-
-$options['debug'] = 1;
-$db = 'postgres';
-
-#### CONNECTION
-switch($db) {
-case 'oci8':
- $options['table'] = 'adodb_sessions2';
- ADOdb_Session::config('oci8', 'mobydick', 'jdev', 'natsoft', 'mobydick',$options);
- break;
-
-case 'postgres':
- $options['table'] = 'sessions2';
- ADOdb_Session::config('postgres', 'localhost', 'postgres', 'natsoft', 'northwind',$options);
- break;
-
-case 'mysql':
-default:
- $options['table'] = 'sessions2';
- ADOdb_Session::config('mysql', 'localhost', 'root', '', 'xphplens_2',$options);
- break;
-
-
-}
-
-
-
-#### SETUP NOTIFICATION
- $USER = 'JLIM'.rand();
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
-
- adodb_session_create_table();
- session_start();
-
- adodb_session_regenerate_id();
-
-### SETUP SESSION VARIABLES
- if (empty($_SESSION['MONKEY'])) $_SESSION['MONKEY'] = array(1,'abc',44.41);
- else $_SESSION['MONKEY'][0] += 1;
- if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
-
-
-### START DISPLAY
- print "PHP ".PHP_VERSION."
";
- print "\$_SESSION['AVAR']={$_SESSION['AVAR']}
";
-
- print "
Cookies: ";
- print_r($_COOKIE);
-
- var_dump($_SESSION['MONKEY']);
-
-### RANDOMLY PERFORM Garbage Collection
-### In real-production environment, this is done for you
-### by php's session extension, which calls adodb_sess_gc()
-### automatically for you. See php.ini's
-### session.cookie_lifetime and session.gc_probability
-
- if (rand() % 5 == 0) {
-
- print "
Garbage Collection
";
- adodb_sess_gc(10);
-
- if (rand() % 2 == 0) {
- print "Random own session destroy
";
- session_destroy();
- }
- } else {
- $DB = ADODB_Session::_conn();
- $sessk = $DB->qstr('%AZ'.rand().time());
- $olddate = $DB->DBTimeStamp(time()-30*24*3600);
- $rr = $DB->qstr(rand());
- $DB->Execute("insert into {$options['table']} (sesskey,expiry,expireref,sessdata,created,modified) values ($sessk,$olddate, $rr,'',$olddate,$olddate)");
- }
diff --git a/app/vendor/adodb/adodb-php/tests/time.php b/app/vendor/adodb/adodb-php/tests/time.php
deleted file mode 100644
index 8261e1e92..000000000
--- a/app/vendor/adodb/adodb-php/tests/time.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
-" );
-echo( "Converted: $convertedDate" ); //why is string returned as one day (3 not 4) less for this example??
diff --git a/app/vendor/adodb/adodb-php/tests/tmssql.php b/app/vendor/adodb/adodb-php/tests/tmssql.php
deleted file mode 100644
index 0f81311aa..000000000
--- a/app/vendor/adodb/adodb-php/tests/tmssql.php
+++ /dev/null
@@ -1,79 +0,0 @@
-mssql";
- $db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
- mssql_select_db('northwind',$db);
-
- $rs = mssql_query('select getdate() as date',$db);
- $o = mssql_fetch_row($rs);
- print_r($o);
- mssql_free_result($rs);
-
- print "Delete
"; flush();
- $rs2 = mssql_query('delete from adoxyz',$db);
- $p = mssql_num_rows($rs2);
- mssql_free_result($rs2);
-
-}
-
-function tpear()
-{
-include_once('DB.php');
-
- print "PEAR
";
- $username = 'adodb';
- $password = 'natsoft';
- $hostname = 'JAGUAR\vsdotnet';
- $databasename = 'northwind';
-
- $dsn = "mssql://$username:$password@$hostname/$databasename";
- $conn = DB::connect($dsn);
- print "date=".$conn->GetOne('select getdate()')."
";
- @$conn->query('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->query('delete from tester');
- print "date=".$conn->GetOne('select getdate()')."
";
-}
-
-function tadodb()
-{
-include_once('../adodb.inc.php');
-
- print "ADOdb
";
- $conn = NewADOConnection('mssql');
- $conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-// $conn->debug=1;
- print "date=".$conn->GetOne('select getdate()')."
";
- $conn->Execute('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->Execute('delete from tester');
- print "date=".$conn->GetOne('select getdate()')."
";
-}
-
-
-$ACCEPTIP = '127.0.0.1';
-
-$remote = $_SERVER["REMOTE_ADDR"];
-
-if (!empty($ACCEPTIP))
- if ($remote != '127.0.0.1' && $remote != $ACCEPTIP)
- die("Unauthorised client: '$remote'");
-
-?>
-mssql
-pear
-adodb
-
-
-
-
-
-
-
-
-
-
-
-
-
-id
-
-
-id
-
-
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- INSERT into simple_table ( name, description ) values ( '12', 'Microsoft stuff' )
-
-
-
\ No newline at end of file
diff --git a/app/vendor/adodb/adodb-php/tests/xmlschema.xml b/app/vendor/adodb/adodb-php/tests/xmlschema.xml
deleted file mode 100644
index ea48ae2bb..000000000
--- a/app/vendor/adodb/adodb-php/tests/xmlschema.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- An integer row that's a primary key and autoincrements
-
-
-
-
- A 16 character varchar row that can't be null
-
-
-
- row1
- row2
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'Microsoft stuff' )
-
-
-
-
\ No newline at end of file
diff --git a/app/vendor/adodb/adodb-php/toexport.inc.php b/app/vendor/adodb/adodb-php/toexport.inc.php
index 94c394b8e..66bbf5424 100644
--- a/app/vendor/adodb/adodb-php/toexport.inc.php
+++ b/app/vendor/adodb/adodb-php/toexport.inc.php
@@ -1,14 +1,6 @@
name : 'Field'.($i++);
if ($escquote) $v = str_replace($quote,$escquotequote,$v);
diff --git a/app/vendor/adodb/adodb-php/tohtml.inc.php b/app/vendor/adodb/adodb-php/tohtml.inc.php
index d39ed2919..e92c8b44a 100644
--- a/app/vendor/adodb/adodb-php/tohtml.inc.php
+++ b/app/vendor/adodb/adodb-php/tohtml.inc.php
@@ -1,14 +1,29 @@
-*/
+/**
+ * RecordSet to HTML Table
+ *
+ * Convert a recordset to a html table. Multiple tables are generated
+ * if the number of rows is > $gSQLBlockRows. This is because
+ * web browsers normally require the whole table to be downloaded
+ * before it can be rendered, so we break the output into several
+ * smaller, faster rendering tables.
+ *
+ * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
+ *
+ * @package ADOdb
+ * @link https://adodb.org Project's web site and documentation
+ * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
+ *
+ * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
+ * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
+ * any later version. This means you can use it in proprietary products.
+ * See the LICENSE.md file distributed with this source code for details.
+ * @license BSD-3-Clause
+ * @license LGPL-2.1-or-later
+ *
+ * @copyright 2000-2013 John Lim
+ * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
+ */
// specific code for tohtml
GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
@@ -17,14 +32,6 @@
$gSQLMaxRows = 1000; // max no of rows to download
$gSQLBlockRows=20; // max no of rows per table block
-// RecordSet to HTML Table
-//------------------------------------------------------------
-// Convert a recordset to a html table. Multiple tables are generated
-// if the number of rows is > $gSQLBlockRows. This is because
-// web browsers normally require the whole table to be downloaded
-// before it can be rendered, so we break the output into several
-// smaller faster rendering tables.
-//
// $rs: the recordset
// $ztabhtml: the table tag attributes (optional)
// $zheaderarray: contains the replacement strings for the headers (optional)
diff --git a/app/vendor/adodb/adodb-php/xmlschema03.dtd b/app/vendor/adodb/adodb-php/xmlschema03.dtd
index 97850bc7f..351ea44b1 100644
--- a/app/vendor/adodb/adodb-php/xmlschema03.dtd
+++ b/app/vendor/adodb/adodb-php/xmlschema03.dtd
@@ -1,17 +1,22 @@
-
-
-
+
-
+
-
+
-
+
@@ -24,20 +29,25 @@
-
+
-
+
-
-
+
+
-
-
+
+
-]>
\ No newline at end of file
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml b/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml
new file mode 100644
index 000000000..90487262a
--- /dev/null
+++ b/app/vendor/ajgl/breakpoint-twig-extension/.github/workflows/tests.yaml
@@ -0,0 +1,47 @@
+name: tests
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ tests:
+ runs-on: ubuntu-latest
+ continue-on-error: ${{ matrix.allow_failure }}
+ strategy:
+ fail-fast: false
+ matrix:
+ php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
+ stability: ['prefer-lowest', 'prefer-stable']
+ allow_failure: [false]
+ include:
+ - php: '8.0'
+ stability: 'dev'
+ allow_failure: true
+
+ name: ${{ matrix.php }}-${{ matrix.stability }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Cache dependencies
+ uses: actions/cache@v1
+ with:
+ path: ~/.composer/cache/files
+ key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+ coverage: none
+
+ - name: Install dependencies
+ run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
+
+ - name: Check coding standard
+ run: composer lint
+
+ - name: Execute tests
+ run: composer test || ${{ matrix.allow_failure }}
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.php_cs b/app/vendor/ajgl/breakpoint-twig-extension/.php_cs
deleted file mode 100644
index 881163ac1..000000000
--- a/app/vendor/ajgl/breakpoint-twig-extension/.php_cs
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-EOF;
-
-Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
-
-return Symfony\CS\Config\Config::create()
- ->setUsingCache(true)
- // use default SYMFONY_LEVEL and extra fixers:
- ->fixers(array(
- '-psr0',
- 'header_comment',
- 'newline_after_open_tag',
- 'ordered_use',
- 'phpdoc_order',
- 'strict',
- 'strict_param',
- ))
- ->finder(
- Symfony\CS\Finder\DefaultFinder::create()
- ->in(__DIR__.'/src')
- ->in(__DIR__.'/tests')
- )
-;
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist b/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist
new file mode 100644
index 000000000..65878857b
--- /dev/null
+++ b/app/vendor/ajgl/breakpoint-twig-extension/.php_cs.dist
@@ -0,0 +1,36 @@
+
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+EOF;
+
+return \PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
+ ->setRules(
+ [
+ '@Symfony' => true,
+ '@Symfony:risky' => true,
+ 'array_syntax' => array('syntax' => 'short'),
+ 'fully_qualified_strict_types' => true,
+ 'header_comment' => array('header' => $header),
+ 'native_function_invocation' => false,
+ 'ordered_imports' => [
+ 'imports_order' => ['class', 'const', 'function'],
+ ],
+ 'phpdoc_order' => true,
+ 'psr4' => true,
+ 'strict_comparison' => true,
+ 'strict_param' => true,
+ ]
+ )
+ ->setFinder(
+ \PhpCsFixer\Finder::create()
+ ->in(__DIR__.'/src')
+ ->in(__DIR__.'/tests')
+ )
+;
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml b/app/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml
deleted file mode 100644
index 8b19e9e4c..000000000
--- a/app/vendor/ajgl/breakpoint-twig-extension/.scrutinizer.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-# .scrutinizer.yml
-checks:
- php: true
-
-tools:
- external_code_coverage:
- timeout: 900
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/.travis.yml b/app/vendor/ajgl/breakpoint-twig-extension/.travis.yml
deleted file mode 100644
index f443d1321..000000000
--- a/app/vendor/ajgl/breakpoint-twig-extension/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-language: php
-
-matrix:
- fast_finish: true
- include:
- - php: 5.6
- env: COMPOSER_FLAGS="--prefer-lowest"
- - php: 5.6
- - php: 7.0
- - php: 7.1
- - php: hhvm
- - php: nightly
- allow_failures:
- - php: hhvm
- - php: nightly
-
-install:
- - composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
-script: vendor/bin/phpunit --coverage-clover=coverage.clover
-after_script:
- - wget https://scrutinizer-ci.com/ocular.phar
- - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md b/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md
index 58409ccb6..337f00c3d 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md
+++ b/app/vendor/ajgl/breakpoint-twig-extension/CHANGELOG.md
@@ -4,6 +4,32 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased][unreleased]
+
+## [0.3.5] - 2021-02-08
+
+### Added
+- Add support for Symfony 5
+- Add support for Twig 3.x
+
+
+## [0.3.4] - 2019-04-10
+
+### Fixed
+- Population of `$arguments` variable
+
+
+## [0.3.3] - 2019-03-18
+
+### Fixed
+- Population of `$arguments` variable
+- Usage of deprecated classes
+
+
+## [0.3.2] - 2018-12-10
+
+### Added
+- Add support for Symfony 4
+
## [0.3.1] - 2017-11-20
### Changed
@@ -12,24 +38,31 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Update requirements to allow twig 2.x
+
## [0.3.0] - 2016-03-31
### Added
- Add `$environment` and `$context` variables
- Allow to inspect function arguments
+
## [0.2.0] - 2016-03-10
### Added
- Add Symfony Bundle
+
## 0.1.0 - 2016-03-09
### Added
- Add `breakpoint` function
-[unreleased]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.1...master
+[unreleased]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.5...master
+[0.3.4]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.4...0.3.5
+[0.3.4]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.3...0.3.4
+[0.3.3]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.2...0.3.3
+[0.3.2]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/ajgarlag/AjglBreakpointTwigExtension/compare/0.1.0...0.2.0
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/README.md b/app/vendor/ajgl/breakpoint-twig-extension/README.md
index 104d35241..18b2e7789 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/README.md
+++ b/app/vendor/ajgl/breakpoint-twig-extension/README.md
@@ -3,17 +3,14 @@ AjglBreakpointTwigExtension
The AjglBreakpointTwigExtension component allows you set breakpoints in twig templates.
-[](https://travis-ci.org/ajgarlag/AjglBreakpointTwigExtension)
+[](https://github.com/ajgarlag/AjglBreakpointTwigExtension/actions)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
[](https://packagist.org/packages/ajgl/breakpoint-twig-extension)
-[](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/?branch=master)
-[](https://scrutinizer-ci.com/g/ajgarlag/AjglBreakpointTwigExtension/?branch=master)
[](https://insight.sensiolabs.com/projects/e0f1276d-6ded-4a20-9b3f-1a7c77a92015)
-[](https://styleci.io/repos/53512207)
This component requires the [Xdebug] PHP extension to be installed.
@@ -73,7 +70,12 @@ Symfony Bundle
--------------
If you want to use this extension in your Symfony application, you can enable the
-Symfony Bundle included in this package:
+Symfony Bundle included in this package.
+
+The bundle will register the twig extension automatically. So, once enabled, you
+can insert the `breakpoint` twig function in your templates.
+
+### Symfony 2/3
```php
// app/AppKernel.php
@@ -82,9 +84,16 @@ if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
}
```
-This bundle will register the twig extension automatically. So, once enabled, you
-can insert the `breakpoint` twig function in your templates.
+### Symfony 4/5
+```php
+// config/bundles.php
+//...
+return [
+ //...
+ Ajgl\Twig\Extension\SymfonyBundle\AjglBreakpointTwigExtensionBundle::class => ['dev' => true]
+];
+```
License
-------
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/composer.json b/app/vendor/ajgl/breakpoint-twig-extension/composer.json
index a6741b043..cf466f2e2 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/composer.json
+++ b/app/vendor/ajgl/breakpoint-twig-extension/composer.json
@@ -20,18 +20,33 @@
},
"require": {
"php": ">=5.6",
- "twig/twig": "^1.14|^2.0"
+ "twig/twig": "^1.34|^2.0|^3.0"
},
"require-dev": {
- "symfony/framework-bundle": "^2.7|^3.2",
- "symfony/twig-bundle": "^2.7|^3.2",
- "phpunit/phpunit": "^5"
+ "friendsofphp/php-cs-fixer": "^2.18",
+ "symfony/framework-bundle": "^2.7|^3.4|^4.4|^5.2",
+ "symfony/phpunit-bridge": "^4.4|^5.2",
+ "symfony/twig-bundle": "^2.7|^3.4|^4.4|^5.2"
},
"suggest": {
"ext-xdebug": "The Xdebug extension is required for the breakpoint to work",
"symfony/framework-bundle": "The framework bundle to integrate the extension into Symfony",
"symfony/twig-bundle": "The twig bundle to integrate the extension into Symfony"
},
+ "scripts": {
+ "fix-cs": [
+ "vendor/bin/php-cs-fixer fix --ansi"
+ ],
+ "lint": [
+ "vendor/bin/php-cs-fixer fix --dry-run --ansi"
+ ],
+ "test": [
+ "vendor/bin/simple-phpunit --colors=always"
+ ]
+ },
+ "config": {
+ "sort-packages": true
+ },
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php b/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php
index ed9df17df..f839d6835 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php
+++ b/app/vendor/ajgl/breakpoint-twig-extension/src/BreakpointExtension.php
@@ -11,13 +11,14 @@
namespace Ajgl\Twig\Extension;
-use Twig_Environment;
-use Twig_Extension;
+use Twig\Environment;
+use Twig\Extension\AbstractExtension;
+use Twig\TwigFunction;
/**
* @author Antonio J. García Lagar
*/
-class BreakpointExtension extends Twig_Extension
+class BreakpointExtension extends AbstractExtension
{
public function getName()
{
@@ -26,21 +27,22 @@ public function getName()
public function getFunctions()
{
- return array(
- new \Twig_SimpleFunction('breakpoint', array($this, 'setBreakpoint'), array('needs_environment' => true, 'needs_context' => true)),
- );
+ return [
+ new TwigFunction('breakpoint', [$this, 'setBreakpoint'], ['needs_environment' => true, 'needs_context' => true]),
+ ];
}
/**
- * If XDebug is detected, makes the debugger break.
+ * If Xdebug is detected, makes the debugger break.
*
- * @param Twig_Environment $environment the environment instance
- * @param mixed $context variables from the Twig template
+ * @param Environment $environment the environment instance
+ * @param mixed $context variables from the Twig template
*/
- public function setBreakpoint(Twig_Environment $environment, $context)
+ public function setBreakpoint(Environment $environment, $context)
{
if (function_exists('xdebug_break')) {
- $arguments = array_slice(func_get_args(), 2);
+ $arguments = func_get_args();
+ $arguments = array_slice($arguments, 2);
xdebug_break();
}
}
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php b/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php
index 62bf7a2b5..b4316ab35 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php
+++ b/app/vendor/ajgl/breakpoint-twig-extension/tests/BreakpointExtensionTest.php
@@ -12,18 +12,23 @@
namespace Ajgl\Twig\Extension\Tests;
use Ajgl\Twig\Extension\BreakpointExtension;
+use PHPUnit\Framework\TestCase;
+use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
+use Twig\TwigFunction;
/**
* @author Antonio J. García Lagar
*/
-class BreakpointExtensionTest extends \PHPUnit_Framework_TestCase
+class BreakpointExtensionTest extends TestCase
{
+ use SetUpTearDownTrait;
+
/**
* @var BreakpointExtension
*/
protected $extension;
- protected function setUp()
+ protected function doSetUp()
{
$this->extension = new BreakpointExtension();
}
@@ -38,7 +43,7 @@ public function testGetFunctions()
$functions = $this->extension->getFunctions();
$this->assertCount(1, $functions);
$function = reset($functions);
- $this->assertInstanceOf('Twig_SimpleFunction', $function);
+ $this->assertInstanceOf(TwigFunction::class, $function);
$callable = $function->getCallable();
$this->assertTrue(is_array($callable));
$this->assertCount(2, $callable);
diff --git a/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php b/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php
index 3b3aa9fbe..f3eebbf80 100644
--- a/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php
+++ b/app/vendor/ajgl/breakpoint-twig-extension/tests/SymfonyBundle/DependencyInjection/AjglBreakpointTwigExtensionExtensionTest.php
@@ -12,13 +12,17 @@
namespace Ajgl\Twig\Extension\Tests\SymfonyBundle\DependencyInjection;
use Ajgl\Twig\Extension\SymfonyBundle\DependencyInjection\AjglBreakpointTwigExtensionExtension;
+use PHPUnit\Framework\TestCase;
+use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* @author Antonio J. García Lagar
*/
-class AjglBreakpointTwigExtensionExtensionTest extends \PHPUnit_Framework_TestCase
+class AjglBreakpointTwigExtensionExtensionTest extends TestCase
{
+ use SetUpTearDownTrait;
+
/**
* @var ContainerBuilder
*/
@@ -29,7 +33,7 @@ class AjglBreakpointTwigExtensionExtensionTest extends \PHPUnit_Framework_TestCa
*/
protected $extension;
- protected function setUp()
+ protected function doSetUp()
{
$this->container = new ContainerBuilder();
$this->extension = new AjglBreakpointTwigExtensionExtension();
@@ -37,7 +41,7 @@ protected function setUp()
public function testTwigExtensionsDefinition()
{
- $this->extension->load(array(), $this->container);
+ $this->extension->load([], $this->container);
$this->assertTrue($this->container->hasDefinition('ajgl_twig_extension.breakpoint'));
$definition = $this->container->getDefinition('ajgl_twig_extension.breakpoint');
$this->assertSame(
diff --git a/app/vendor/asm89/twig-cache-extension/.travis.yml b/app/vendor/asm89/twig-cache-extension/.travis.yml
index c9fed9788..c13804168 100644
--- a/app/vendor/asm89/twig-cache-extension/.travis.yml
+++ b/app/vendor/asm89/twig-cache-extension/.travis.yml
@@ -1,36 +1,44 @@
language: php
-cache:
- directories:
- - vendor
- - $HOME/.composer/cache
-
-env:
- - TWIG_VERSION="^1.0"
- - TWIG_VERSION="^2.0"
-
-php:
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - 7.0
- - 7.1
- - hhvm
-
matrix:
- exclude:
- - php: 5.3
- env: TWIG_VERSION="^2.0"
- - php: 5.4
- env: TWIG_VERSION="^2.0"
- - php: 5.5
- env: TWIG_VERSION="^2.0"
- - php: 5.6
- env: TWIG_VERSION="^2.0"
- - php: hhvm
- env: TWIG_VERSION="^2.0"
+ include:
+ - php: 5.6
+ dist: xenial
+ env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest" TWIG_VERSION="^1.0"'
+ - php: 5.6
+ dist: xenial
+ env: TWIG_VERSION="^1.0"
+ - php: 7.0
+ dist: xenial
+ env: TWIG_VERSION="^1.0"
+ - php: 7.1
+ dist: bionic
+ env: TWIG_VERSION="^1.0"
+ - php: 7.2
+ dist: bionic
+ env: TWIG_VERSION="^1.0"
+ - php: 7.3
+ dist: bionic
+ env: TWIG_VERSION="^1.0"
+ - php: 7.4
+ dist: bionic
+ env: TWIG_VERSION="^1.0"
+ - php: 7.0
+ dist: xenial
+ env: TWIG_VERSION="^2.0"
+ - php: 7.1
+ dist: bionic
+ env: TWIG_VERSION="^2.0"
+ - php: 7.2
+ dist: bionic
+ env: TWIG_VERSION="^2.0"
+ - php: 7.3
+ dist: bionic
+ env: TWIG_VERSION="^2.0"
+ - php: 7.4
+ dist: bionic
+ env: TWIG_VERSION="^2.0"
install: composer require twig/twig:${TWIG_VERSION}
-script: phpunit
+script: composer test
diff --git a/app/vendor/asm89/twig-cache-extension/composer.json b/app/vendor/asm89/twig-cache-extension/composer.json
index 34db8cd46..176befbf1 100644
--- a/app/vendor/asm89/twig-cache-extension/composer.json
+++ b/app/vendor/asm89/twig-cache-extension/composer.json
@@ -16,8 +16,12 @@
"twig/twig": "^1.0|^2.0"
},
"require-dev": {
+ "phpunit/phpunit": "^5.0 || ^4.8.10",
"doctrine/cache": "~1.0"
},
+ "scripts": {
+ "test": "phpunit"
+ },
"suggest": {
"psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter."
},
@@ -33,7 +37,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.3-dev"
+ "dev-master": "1.4-dev"
}
}
}
diff --git a/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php
index 3a7ace884..b7c653b3d 100644
--- a/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php
+++ b/app/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php
@@ -42,7 +42,7 @@ public function getCacheStrategy()
public function getName()
{
if (version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) {
- return get_class($this);
+ return __CLASS__;
}
return 'asm89_cache';
}
diff --git a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php
index 4642ec058..bea9851ab 100644
--- a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php
+++ b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php
@@ -41,6 +41,6 @@ public function testSave()
public function createCacheMock()
{
- return $this->getMock('Doctrine\Common\Cache\Cache');
+ return $this->createMock('Doctrine\Common\Cache\Cache');
}
}
diff --git a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php
index 5084d219d..d74ecdee9 100644
--- a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php
+++ b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php
@@ -70,11 +70,11 @@ public function getLifetimes()
public function createKeyGeneratorMock()
{
- return $this->getMock('Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface');
+ return $this->createMock('Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface');
}
public function createCacheProviderMock()
{
- return $this->getMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
+ return $this->createMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
}
}
diff --git a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php
index 3a68a09f5..480a0b1a5 100644
--- a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php
+++ b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php
@@ -75,6 +75,6 @@ public function getStrategies()
public function createCacheStrategyMock()
{
- return $this->getMock('Asm89\Twig\CacheExtension\CacheStrategyInterface');
+ return $this->createMock('Asm89\Twig\CacheExtension\CacheStrategyInterface');
}
}
diff --git a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php
index 48905e424..10d1a8688 100644
--- a/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php
+++ b/app/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php
@@ -63,6 +63,6 @@ public function getInvalidLifetimeValues()
public function createCacheProviderMock()
{
- return $this->getMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
+ return $this->createMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
}
}
diff --git a/app/vendor/bin/var-dump-server b/app/vendor/bin/var-dump-server
new file mode 120000
index 000000000..6bd4e93db
--- /dev/null
+++ b/app/vendor/bin/var-dump-server
@@ -0,0 +1 @@
+../symfony/var-dumper/Resources/bin/var-dump-server
\ No newline at end of file
diff --git a/app/vendor/cakephp/bake/Dockerfile b/app/vendor/cakephp/bake/Dockerfile
new file mode 100644
index 000000000..296613920
--- /dev/null
+++ b/app/vendor/cakephp/bake/Dockerfile
@@ -0,0 +1,24 @@
+# Basic docker based environment
+# Necessary to trick dokku into building the documentation
+# using dockerfile instead of herokuish
+FROM ubuntu:17.04
+
+# Add basic tools
+RUN apt-get update && \
+ apt-get install -y build-essential \
+ software-properties-common \
+ curl \
+ git \
+ libxml2 \
+ libffi-dev \
+ libssl-dev
+
+RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \
+ apt-get update && \
+ apt-get install -y php7.2-cli php7.2-mbstring php7.2-xml php7.2-zip php7.2-intl php7.2-opcache php7.2-sqlite
+
+WORKDIR /code
+
+VOLUME ["/code"]
+
+CMD [ '/bin/bash' ]
diff --git a/app/vendor/cakephp/bake/LICENSE.txt b/app/vendor/cakephp/bake/LICENSE.txt
index 5849d31d4..0a0a98c8e 100644
--- a/app/vendor/cakephp/bake/LICENSE.txt
+++ b/app/vendor/cakephp/bake/LICENSE.txt
@@ -1,7 +1,7 @@
The MIT License
CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org)
-Copyright (c) 2005-2018, Cake Software Foundation, Inc.
+Copyright (c) 2005-present, Cake Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/app/vendor/cakephp/bake/README.md b/app/vendor/cakephp/bake/README.md
index 7c6344e5e..621d2a8d8 100644
--- a/app/vendor/cakephp/bake/README.md
+++ b/app/vendor/cakephp/bake/README.md
@@ -19,7 +19,7 @@ composer require --dev cakephp/bake
## Documentation
-You can find the documentation for bake [on the cookbook](http://book.cakephp.org/3.0/en/bake.html).
+You can find the documentation for bake [on its own cookbook](https://book.cakephp.org/bake/1.x/en/index.html).
## Testing
diff --git a/app/vendor/cakephp/bake/composer.json b/app/vendor/cakephp/bake/composer.json
index 05ef8a9f5..677841f9c 100644
--- a/app/vendor/cakephp/bake/composer.json
+++ b/app/vendor/cakephp/bake/composer.json
@@ -13,15 +13,15 @@
],
"support": {
"issues": "https://github.com/cakephp/bake/issues",
- "forum": "http://stackoverflow.com/tags/cakephp",
+ "forum": "https://stackoverflow.com/tags/cakephp",
"irc": "irc://irc.freenode.org/cakephp",
"source": "https://github.com/cakephp/bake"
},
"require": {
"php": ">=5.6.0",
- "cakephp/cakephp": "^3.6.0",
+ "cakephp/cakephp": "^3.8.0",
"cakephp/plugin-installer": "^1.0",
- "wyrihaximus/twig-view": "^4.3.4"
+ "wyrihaximus/twig-view": "^4.3.7"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^3.0",
@@ -29,16 +29,28 @@
},
"autoload": {
"psr-4": {
- "Bake\\": "src"
+ "Bake\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
- "BakeTest\\": "tests/test_app/Plugin/BakeTest/src",
- "Pastry\\PastryTest\\": "tests/test_app/Plugin/PastryTest/src",
- "Bake\\Test\\": "tests",
- "Bake\\Test\\App\\": "tests/test_app/App",
- "Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
+ "BakeTest\\": "tests/test_app/Plugin/BakeTest/src/",
+ "Pastry\\PastryTest\\": "tests/test_app/Plugin/PastryTest/src/",
+ "Bake\\Test\\": "tests/",
+ "Bake\\Test\\App\\": "tests/test_app/App/",
+ "Cake\\Test\\": "./vendor/cakephp/cakephp/tests/"
}
+ },
+ "scripts": {
+ "check": [
+ "@test",
+ "@cs-check"
+ ],
+ "cs-check": "phpcs --parallel=16 -p src/ tests/",
+ "cs-fix": "phpcbf --parallel=16 -p src/ tests/",
+ "phpstan": "phpstan analyse src/",
+ "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
+ "test": "phpunit",
+ "test-coverage": "phpunit --coverage-clover=clover.xml"
}
}
diff --git a/app/vendor/cakephp/bake/docs.Dockerfile b/app/vendor/cakephp/bake/docs.Dockerfile
new file mode 100644
index 000000000..adb6e9447
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs.Dockerfile
@@ -0,0 +1,18 @@
+# Generate the HTML output.
+FROM markstory/cakephp-docs-builder as builder
+
+# Copy entire repo in with .git so we can build all versions in one image.
+COPY docs /data/src
+
+RUN cd /data/docs-builder \
+ && make website LANGS="en es fr ja pt ru" SOURCE=/data/src DEST=/data/website/
+
+# Build a small nginx container with just the static site in it.
+FROM nginx:1.15-alpine
+
+COPY --from=builder /data/website /data/website
+COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf
+
+# Copy docs into place.
+RUN cp -R /data/website/html/* /usr/share/nginx/html \
+ && rm -rf /data/website
diff --git a/app/vendor/psy/psysh/test/fixtures/default/.config/psysh/psysh_history b/app/vendor/cakephp/bake/docs/config/__init__.py
similarity index 100%
rename from app/vendor/psy/psysh/test/fixtures/default/.config/psysh/psysh_history
rename to app/vendor/cakephp/bake/docs/config/__init__.py
diff --git a/app/vendor/cakephp/bake/docs/config/all.py b/app/vendor/cakephp/bake/docs/config/all.py
new file mode 100644
index 000000000..b74fcbe0b
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/config/all.py
@@ -0,0 +1,49 @@
+# Global configuration information used across all the
+# translations of documentation.
+#
+# Import the base theme configuration
+from cakephpsphinx.config.all import *
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+
+# The full version, including alpha/beta/rc tags.
+release = '1.x'
+
+# The search index version.
+search_version = 'bake-1'
+
+# The marketing display name for the book.
+version_name = ''
+
+# Project name shown in the black header bar
+project = 'CakePHP Bake'
+
+# Other versions that display in the version picker menu.
+version_list = [
+ {'name': '1.x', 'number': '/bake/1.x', 'title': '1.x', 'current': True},
+ # {'name': '2.x', 'number': '/bake/2.x', 'title': '2.x'},
+]
+
+# Languages available.
+languages = ['en', 'es', 'fr', 'ja', 'pt', 'ru']
+
+# The GitHub branch name for this version of the docs
+# for edit links to point at.
+branch = 'master'
+
+# Current version being built
+version = '1.x'
+
+# Language in use for this directory.
+language = 'en'
+
+show_root_link = True
+
+repository = 'cakephp/bake'
+
+source_path = 'docs/'
+
+hide_page_contents = ('search', '404', 'contents')
diff --git a/app/vendor/cakephp/bake/docs/en/conf.py b/app/vendor/cakephp/bake/docs/en/conf.py
new file mode 100644
index 000000000..f638bda22
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/en/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'en'
diff --git a/app/vendor/cakephp/bake/docs/en/contents.rst b/app/vendor/cakephp/bake/docs/en/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/en/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/en/development.rst b/app/vendor/cakephp/bake/docs/en/development.rst
new file mode 100644
index 000000000..68eebdbd4
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/en/development.rst
@@ -0,0 +1,304 @@
+Extending Bake
+##############
+
+Bake features an extensible architecture that allows your application or plugins
+to modify or add-to the base functionality. Bake makes use of a dedicated
+view class which uses the `Twig `_ template engine.
+
+Bake Events
+===========
+
+As a view class, ``BakeView`` emits the same events as any other view class,
+plus one extra initialize event. However, whereas standard view classes use the
+event prefix "View.", ``BakeView`` uses the event prefix "Bake.".
+
+The initialize event can be used to make changes which apply to all baked
+output, for example to add another helper to the bake view class this event can
+be used::
+
+ on('Bake.initialize', function (Event $event) {
+ $view = $event->getSubject();
+
+ // In my bake templates, allow the use of the MySpecial helper
+ $view->loadHelper('MySpecial', ['some' => 'config']);
+
+ // And add an $author variable so it's always available
+ $view->set('author', 'Andy');
+
+ });
+
+If you want to modify bake from within another plugin, putting your plugin's
+bake events in the plugin ``config/bootstrap.php`` file is a good idea.
+
+Bake events can be handy for making small changes to existing templates.
+For example, to change the variable names used when baking controller/template
+files one can use a function listening for ``Bake.beforeRender`` to modify the
+variables used in the bake templates::
+
+ on('Bake.beforeRender', function (Event $event) {
+ $view = $event->getSubject();
+
+ // Use $rows for the main data variable in indexes
+ if ($view->get('pluralName')) {
+ $view->set('pluralName', 'rows');
+ }
+ if ($view->get('pluralVar')) {
+ $view->set('pluralVar', 'rows');
+ }
+
+ // Use $theOne for the main data variable in view/edit
+ if ($view->get('singularName')) {
+ $view->set('singularName', 'theOne');
+ }
+ if ($view->get('singularVar')) {
+ $view->set('singularVar', 'theOne');
+ }
+
+ });
+
+You may also scope the ``Bake.beforeRender`` and ``Bake.afterRender`` events to
+a specific generated file. For instance, if you want to add specific actions to
+your UsersController when generating from a **Controller/controller.twig** file,
+you can use the following event::
+
+ on(
+ 'Bake.beforeRender.Controller.controller',
+ function (Event $event) {
+ $view = $event->getSubject();
+ if ($view->viewVars['name'] == 'Users') {
+ // add the login and logout actions to the Users controller
+ $view->set('actions', [
+ 'login',
+ 'logout',
+ 'index',
+ 'view',
+ 'add',
+ 'edit',
+ 'delete'
+ ]);
+ }
+ }
+ );
+
+By scoping event listeners to specific bake templates, you can simplify your
+bake related event logic and provide callbacks that are easier to test.
+
+Bake Template Syntax
+====================
+
+Bake template files use the `Twig `__ template syntax.
+
+One way to see/understand how bake templates works, especially when attempting
+to modify bake template files, is to bake a class and compare the template used
+with the pre-processed template file which is left in the application's
+**tmp/bake** folder.
+
+So, for example, when baking a shell like so:
+
+.. code-block:: bash
+
+ bin/cake bake shell Foo
+
+The template used (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**)
+looks like this::
+
+ `` A Bake template php close tag
+ * ``<%=`` A Bake template php short-echo tag
+ * ``<%-`` A Bake template php open tag, stripping any leading whitespace
+ before the tag
+ * ``-%>`` A Bake template php close tag, stripping trailing whitespace after
+ the tag
+
+.. _creating-a-bake-theme:
+
+Creating a Bake Theme
+=====================
+
+If you wish to modify the output produced by the "bake" command, you can
+create your own bake 'theme' which allows you to replace some or all of the
+templates that bake uses. The best way to do this is:
+
+#. Bake a new plugin. The name of the plugin is the bake 'theme' name
+#. Create a new directory **plugins/[name]/src/Template/Bake/Template/**.
+#. Copy any templates you want to override from
+ **vendor/cakephp/bake/src/Template/Bake/Template** to matching files in your
+ plugin.
+#. When running bake use the ``--theme`` option to specify the bake-theme you
+ want to use. To avoid having to specify this option in each call, you can also
+ set your custom theme to be used as default theme::
+
+ Test->classSuffixes[$this->name()])) {
+ $this->Test->classSuffixes[$this->name()] = 'Foo';
+ }
+
+ $name = ucfirst($this->name());
+ if (!isset($this->Test->classTypes[$name])) {
+ $this->Test->classTypes[$name] = 'Foo';
+ }
+
+ return parent::bakeTest($className);
+ }
+
+* The **class suffix** will be appened to the name provided in your ``bake``
+ call. In the previous example, it would create a ``ExampleFooTest.php`` file.
+* The **class type** will be the sub-namespace used that will lead to your
+ file (relative to the app or the plugin you are baking into). In the previous
+ example, it would create your test with the namespace ``App\Test\TestCase\Foo``
+ .
+
+.. meta::
+ :title lang=en: Extending Bake
+ :keywords lang=en: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags
+
diff --git a/app/vendor/cakephp/bake/docs/en/index.rst b/app/vendor/cakephp/bake/docs/en/index.rst
new file mode 100644
index 000000000..1020e904f
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/en/index.rst
@@ -0,0 +1,28 @@
+Bake Console
+############
+
+CakePHP's bake console is another effort to get you up and running in CakePHP
+– fast. The bake console can create any of CakePHP's basic ingredients: models,
+behaviors, views, helpers, controllers, components, test cases, fixtures and plugins.
+And we aren't just talking skeleton classes: Bake can create a fully functional
+application in just a few minutes. In fact, Bake is a natural step to take once
+an application has been scaffolded.
+
+Installation
+============
+
+Before trying to use or extend bake, make sure it is installed in your
+application. Bake is provided as a plugin that you can install with Composer::
+
+ composer require --dev cakephp/bake:~1.0
+
+The above will install bake as a development dependency. This means that it will
+not be installed when you do production deployments.
+
+When using the Twig templates make sure you are loading the
+``WyriHaximus/TwigView`` plugin with its bootstrap. You can also omit it
+completely which then makes Bake plugin load this plugin on demand.
+
+.. meta::
+ :title lang=en: Bake Console
+ :keywords lang=en: command line interface,development,bake view, bake template syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/en/usage.rst b/app/vendor/cakephp/bake/docs/en/usage.rst
new file mode 100644
index 000000000..956efe0cc
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/en/usage.rst
@@ -0,0 +1,133 @@
+Code Generation with Bake
+#########################
+
+The cake console is run using the PHP CLI (command line interface).
+If you have problems running the script, ensure that:
+
+#. You have the PHP CLI installed and that it has the proper modules enabled
+ (eg: MySQL, intl).
+#. Users also might have issues if the database host is 'localhost' and should
+ try '127.0.0.1' instead, as localhost can cause issues with PHP CLI.
+#. Depending on how your computer is configured, you may have to set execute
+ rights on the cake bash script to call it using ``bin/cake bake``.
+
+Before running bake you should make sure you have at least one database
+connection configured.
+
+When run with no arguments ``bin/cake bake`` will output a list of available
+tasks.
+
+For windows system try with ``bin\cake bake``.
+
+You should see something like::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The following commands can be used to generate skeleton code for your application.
+
+ Available bake commands:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_diff
+ - migration_snapshot
+ - model
+ - plugin
+ - seed
+ - shell
+ - shell_helper
+ - task
+ - template
+ - test
+
+ By using `cake bake [name]` you can invoke a specific bake task.
+
+You can get more information on what each task does, and what options are
+available using the ``--help`` option::
+
+ $ bin/cake bake --help
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The Bake script generates controllers, models and template files for
+ your application. If run with no command line arguments, Bake guides the
+ user through the class creation process. You can customize the
+ generation process by telling Bake where different parts of your
+ application are using command line arguments.
+
+ Usage:
+ cake bake.bake [subcommand] [options]
+
+ Subcommands:
+
+ all Bake a complete MVC skeleton.
+ behavior Bake a behavior class file.
+ cell Bake a cell class file.
+ component Bake a component class file.
+ controller Bake a controller skeleton.
+ fixture Generate fixtures for use with the test suite. You
+ can use `bake fixture all` to bake all fixtures.
+ form Bake a form class file.
+ helper Bake a helper class file.
+ mailer Bake a mailer class file.
+ migration Bake migration class.
+ migration_diff Bake migration class.
+ migration_snapshot Bake migration snapshot class.
+ model Bake table and entity classes.
+ plugin Create the directory structure, AppController class
+ and testing setup for a new plugin. Can create
+ plugins in any of your bootstrapped plugin paths.
+ seed Bake seed class.
+ shell Bake a shell class file.
+ shell_helper Bake a shell_helper class file.
+ task Bake a task class file.
+ template Bake views for a controller, using built-in or
+ custom templates.
+ test Bake test case skeletons for classes.
+
+ To see help on a subcommand use `cake bake.bake [subcommand] --help`
+
+ Options:
+
+ --connection, -c Database connection to use in conjunction with `bake
+ all`. (default: default)
+ --everything Bake a complete MVC skeleton, using all the available
+ tables. Usage: "bake all --everything"
+ --force, -f Force overwriting existing files without prompting.
+ --help, -h Display this help.
+ --plugin, -p Plugin to bake into.
+ --prefix Prefix to bake controllers and templates into.
+ --quiet, -q Enable quiet output.
+ --tablePrefix Table prefix to be used in models.
+ --theme, -t The theme to use when baking code. (choices:
+ Bake|Migrations)
+ --verbose, -v Enable verbose output.
+
+Bake Themes
+===========
+
+The theme option is common to all bake commands, and allows changing the bake
+template files used when baking. To create your own templates, see the
+:ref:`bake theme creation documentation `.
+
+.. meta::
+ :title lang=en: Code Generation with Bake
+ :keywords lang=en: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql
diff --git a/app/vendor/cakephp/bake/docs/es/conf.py b/app/vendor/cakephp/bake/docs/es/conf.py
new file mode 100644
index 000000000..4691ece6a
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/es/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'es'
diff --git a/app/vendor/cakephp/bake/docs/es/contents.rst b/app/vendor/cakephp/bake/docs/es/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/es/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/es/development.rst b/app/vendor/cakephp/bake/docs/es/development.rst
new file mode 100644
index 000000000..7f717d051
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/es/development.rst
@@ -0,0 +1,17 @@
+Extending Bake
+##############
+
+.. note::
+ La documentación no es compatible actualmente con el idioma español en esta página.
+
+ Por favor, siéntase libre de enviarnos un pull request en
+ `Github `_ o utilizar el botón **Improve this Doc** para proponer directamente los cambios.
+
+ Usted puede hacer referencia a la versión en Inglés en el menú de selección superior
+ para obtener información sobre el tema de esta página.
+
+.. _creating-a-bake-theme:
+
+.. meta::
+ :title lang=es: Extending Bake
+ :keywords lang=es: command line interface,development,bake view, bake template syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/es/index.rst b/app/vendor/cakephp/bake/docs/es/index.rst
new file mode 100644
index 000000000..80f1fa654
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/es/index.rst
@@ -0,0 +1,31 @@
+Consola bake
+############
+
+La consola bake de CakePHP es otro esfuerzo para preparar y ejecutar CakePHP rápidamente.
+
+La consola bake puede crear cualquiera de los ingredientes básicos de CakePHP:
+modelos, behaviours, vistas, helpers, controladores, componentes, casos de
+prueba, fixtures y plugins.
+
+Y no hablamos sólo de esqueletos de clases: Bake puede crear una aplicación
+totalmente funcional en solo un par de minutos.
+
+De hecho, Bake es un paso natural a dar una vez ha sido creado el esqueleto de
+la aplicación.
+
+Instalación
+===========
+
+Antes de intentar utilizar o extender bake asegúrate de que está instalado en tu
+aplicación.
+
+Bake está incluido como un plugin que puedes instalar con Composer::
+
+ composer require --dev cakephp/bake:~1.0
+
+La instrucción anterior instalará bake como una dependencia de desarrollo. Esto
+significa que no será instalado cuando hagas despliegues en producción.
+
+.. meta::
+ :title lang=es: Consola Bake
+ :keywords lang=es: interfaz de línea de comando,desarrollo,bake vista, bake sintaxis plantilla,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/es/usage.rst b/app/vendor/cakephp/bake/docs/es/usage.rst
new file mode 100644
index 000000000..dad6ffd95
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/es/usage.rst
@@ -0,0 +1,115 @@
+Crear código con Bake
+#####################
+
+La consola de CAKE se ejecuta usando PHP CLI (command line interface).
+Si tiene problemas para ejecutar el script, asegurese de:
+
+#. Tener instalado el PHP CLI y que estén los módulos correspondientes
+ habilitados (ej: MySQL y intl).
+#. Si el host de base de datos es 'localhost', intente realizar la conexión con
+ el ip '127.0.0.1'. En algunos casos PHP CLI tiene problemas al referenciar
+ por nombre de host (localhost).
+#. Dependiendo de como esté configurado su equipo, la ejecución del comando
+ CAKE BAKE (cake bash script) puede requerir permisos de ejecución al
+ lanzar ``bin/cake bake``.
+
+Antes de comenzar la ejecución, asegúrese de disponer al menos de una conexión
+a una base de datos configurada.
+
+Para comenzar con la ejecución del comando debe abrir la consola de windows
+y ejecutar "Cake Bake"
+
+#. Ir a Inicio (Start) > Ejecutar (Run)
+#. Escribir "cmd" y presionar 'Enter'
+#. Navegar hasta llegar a la carpeta de instalación de cake
+#. Acceder a la carpeta 'bin'
+#. Escribir 'Cake bake' lo cual deberá devolver un listado con todas las
+ tareas/actividades disponibles.
+
+El resultado debería ser algo similar a lo siguiente::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.1.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP: 5.5.8
+ ---------------------------------------------------------------
+ The following commands can be used to generate skeleton code for your application.
+
+ Available bake commands:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_snapshot
+ - model
+ - plugin
+ - shell
+ - shell-helper
+ - template
+ - test
+
+ By using 'cake bake [name]' you can invoke a specific bake task.
+
+Puede obtener más información sobre lo que realiza cada una de las actividades
+y sus opciones usando el parametro '--help' option::
+
+ $ bin/cake bake controller --help
+
+ Welcome to CakePHP v3.1.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ ---------------------------------------------------------------
+ Bake a controller skeleton.
+
+ Usage:
+ cake bake controller [subcommand] [options] []
+
+ Subcommands:
+
+ all Bake all controllers with CRUD methods.
+
+ To see help on a subcommand use `cake bake controller [subcommand] --help`
+
+ Options:
+
+ --help, -h Display this help.
+ --verbose, -v Enable verbose output.
+ --quiet, -q Enable quiet output.
+ --plugin, -p Plugin to bake into.
+ --force, -f Force overwriting existing files without prompting.
+ --connection, -c The datasource connection to get data from.
+ (default: default)
+ --theme, -t The theme to use when baking code.
+ --components The comma separated list of components to use.
+ --helpers The comma separated list of helpers to use.
+ --prefix The namespace/routing prefix to use.
+ --no-test Do not generate a test skeleton.
+ --no-actions Do not generate basic CRUD action methods.
+
+ Arguments:
+
+ name Name of the controller to bake. Can use Plugin.name to bake
+ controllers into plugins. (optional)
+
+Temas Bake / Templates
+======================
+
+La opción ``theme`` es genérica para todos los comandos bake y permite cambiar los
+templates de bake utilizados para generar los archivos finales. Para crear sus
+propios templates, ver :ref:`bake theme creation documentation
+`.
+
+.. meta::
+ :title lang=es: Crear código con Bake
+ :keywords lang=es: interfaz de línea de comando, aplicación funcional, base de datos, configuración de base de datos, bash script, ingredientes básicos, proyecto, modelo, path, crear código, generación de código, scaffolding, usuarios windows, archivo de configuración, pocos minutos, configurar, iew, shell, modelos, running, mysql
diff --git a/app/vendor/cakephp/bake/docs/fr/conf.py b/app/vendor/cakephp/bake/docs/fr/conf.py
new file mode 100644
index 000000000..b02032efa
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/fr/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'fr'
diff --git a/app/vendor/cakephp/bake/docs/fr/contents.rst b/app/vendor/cakephp/bake/docs/fr/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/fr/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/fr/development.rst b/app/vendor/cakephp/bake/docs/fr/development.rst
new file mode 100644
index 000000000..61de705da
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/fr/development.rst
@@ -0,0 +1,351 @@
+Etendre Bake
+############
+
+Bake dispose d'une architecture extensible qui permet à votre application ou
+à vos plugins de modifier ou ajouter la fonctionnalité de base. Bake utilise une
+classe de vue dédiée qui n'utilise pas la syntaxe PHP standard.
+
+Events de Bake
+==============
+
+Comme une classe de vue, ``BakeView`` envoie les mêmes events que toute autre
+classe de vue, ainsi qu'un event initialize supplémentaire. Cependant,
+alors que les classes de vue standard utilisent le préfixe d'event
+"View.", ``BakeView`` utilise le préfixe d'event "Bake.".
+
+L'event initialize peut être utilisé pour faire des changements qui
+s'appliquent à toutes les sorties fabriquées avec bake, par exemple pour ajouter
+un autre helper à la classe de vue bake, cet event peut être utilisé::
+
+ on('Bake.initialize', function (Event $event) {
+ $view = $event->getSubject();
+
+ // Dans mes templates de bake, permet l'utilisation du helper MySpecial
+ $view->loadHelper('MySpecial', ['some' => 'config']);
+
+ // Et ajoute une variable $author pour qu'elle soit toujours disponible
+ $view->set('author', 'Andy');
+
+ });
+
+Si vous souhaitez modifier bake à partir d'un autre plugin, mettre les events
+de bake de votre plugin dans le fichier ``config/bootstrap.php`` du plugin est
+une bonne idée.
+
+Les events de bake peuvent être pratiques pour faire de petits changements dans
+les templates existants. Par exemple, pour changer les noms de variables
+utilisés lors de la création avec bake de fichiers de controller/template, on
+pourra utiliser une fonction qui écoute ``Bake.beforeRender`` pour modifier les
+variables utilisées dans les templates de bake::
+
+ on('Bake.beforeRender', function (Event $event) {
+ $view = $event->getSubject();
+
+ // Utilise $rows pour les principales variables de données dans les indexes
+ if ($view->get('pluralName')) {
+ $view->set('pluralName', 'rows');
+ }
+ if ($view->get('pluralVar')) {
+ $view->set('pluralVar', 'rows');
+ }
+
+ // Utilise $theOne pour les principales variable de données dans les view/edit
+ if ($view->get('singularName')) {
+ $view->set('singularName', 'theOne');
+ }
+ if ($view->get('singularVar')) {
+ $view->set('singularVar', 'theOne');
+ }
+
+ });
+
+Vous pouvez aussi scoper les events ``Bake.beforeRender`` et
+``Bake.afterRender`` dans un fichier généré spécifique. Par exemple, si vous
+souhaitez ajouter des actions spécifiques à votre UsersController quand vous le
+générez à partir d'un fichier **Controller/controller.ctp**, vous pouvez
+utiliser l'event suivant::
+
+ on(
+ 'Bake.beforeRender.Controller.controller',
+ function (Event $event) {
+ $view = $event->subject;
+ if ($view->viewVars['name'] == 'Users') {
+ // ajouter les actions login et logout au controller Users
+ $view->viewVars['actions'] = [
+ 'login',
+ 'logout',
+ 'index',
+ 'view',
+ 'add',
+ 'edit',
+ 'delete'
+ ];
+ }
+ }
+ );
+
+En scopant les écouteurs d'event vers des templates de bake spécifiques, vous
+pouvez simplifier votre logique d'event liée à bake et fournir des callbacks
+qui sont plus faciles à tester.
+
+Syntaxe de Template de Bake
+===========================
+
+Les fichiers de template de Bake utilisent les balises erb-style (``<% %>``)
+pour indiquer la logique des templates, et traitent le reste, y compris les
+balises php, comme du texte.
+
+.. note::
+
+ Les fichiers de template de Bake n'utilisent pas, et sont insensibles aux
+ ``asp_tags`` de la configuration de php ini.
+
+``BakeView`` intègre les balises suivantes:
+
+ * ``<%`` Une balise php ouverte de template de Bake
+ * ``%>`` Une balise php fermante de template de Bake
+ * ``<%=`` Une balise php de short-echo de template de Bake
+ * ``<%-`` Une balise php ouverte de template de Bake, enlevant tout espace
+ en tête avant la balise
+ * ``-%>`` Une balise php fermante de template de Bake, enlevant les espaces
+ à a fin après la balise
+
+Une façon de voir/comprendre la façon dont les templates de Bake fonctionne,
+spécialement quand on essaie de modifier les fichiers de template de bake, est
+de créer avec bake une classe et de comparer le template utilisé avec le
+template déjà présent dans le dossier **tmp/bake** de votre application.
+
+Ainsi, par exemple, pour créer avec bake un shell comme ceci:
+
+.. code-block:: bash
+
+ bin/cake bake shell Foo
+
+Le template utilisé
+(**vendor/cakephp/cakephp/src/Template/Bake/Shell/shell.ctp**)
+ressemble à ceci::
+
+ \Shell;
+
+ use Cake\Console\Shell;
+
+ /**
+ * <%= $name %> shell command.
+ */
+ class <%= $name %>Shell extends Shell
+ {
+
+ /**
+ * main() method.
+ *
+ * @return bool|int Success or error code.
+ */
+ public function main()
+ {
+ }
+
+ }
+
+Le fichier template déjà présent (pre-processed)
+(**tmp/bake/Bake-Shell-shell-ctp.php**), qui est le fichier réellement
+rendu, ressemble à ceci::
+
+ \Shell;
+
+ use Cake\Console\Shell;
+
+ /**
+ * = $name ?> shell command.
+ */
+ class = $name ?>Shell extends Shell
+ {
+
+ /**
+ * main() method.
+ *
+ * @return bool|int Success or error code.
+ */
+ public function main()
+ {
+ }
+
+ }
+
+Et la classe résultante construite avec bake (**src/Shell/FooShell.php**)
+ressemble à ceci::
+
+ \Foo;
+
+ /**
+ * <%= $name %> foo
+ */
+ class <%= $name %>Foo
+ {
+ // Add code.
+ }
+
+Vous devriez maintenant voir votre nouvelle tâche dans l'affichage de
+``bin/cake bake``. Vous pouvez lancer votre nouvelle tâche en exécutant
+``bin/cake bake foo Example``.
+Cela va générer une nouvelle classe ``ExampleFoo`` dans
+**src/Foo/ExampleFoo.php** que votre application va
+pouvoir utiliser.
+
+Si vous souhaitez que votre appel à ``bake`` crée également un fichier de test
+pour la classe ``ExampleFoo``, vous devrez surcharger la méthode ``bakeTest()``
+dans la classe ``FooTask`` pour y définir le suffixe et le namespace de la
+classe de votre nom de commande personnalisée::
+
+ public function bakeTest($className)
+ {
+ if (!isset($this->Test->classSuffixes[$this->name()])) {
+ $this->Test->classSuffixes[$this->name()] = 'Foo';
+ }
+
+ $name = ucfirst($this->name());
+ if (!isset($this->Test->classTypes[$name])) {
+ $this->Test->classTypes[$name] = 'Foo';
+ }
+
+ return parent::bakeTest($className);
+ }
+
+* Le **suffixe de classe** sera ajouté après le nom passé à ``bake``. Dans le
+ cadre de l'exemple ci-dessus, cela créerait un fichier ``ExampleFooTest.php``.
+* Le **type de classe** sera le sous-namespace utilisé pour atteindre votre
+ fichier (relatif à l'application ou au plugin dans lequel vous faites le
+ ``bake``). Dans le cadre de l'exemple ci-dessus, cela créerait le test avec le
+ namespace ``App\Test\TestCase\Foo``.
+
+.. meta::
+ :title lang=fr: Etendre Bake
+ :keywords lang=fr: interface ligne de commande,development,bake view, bake template syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/fr/index.rst b/app/vendor/cakephp/bake/docs/fr/index.rst
new file mode 100644
index 000000000..c086cac49
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/fr/index.rst
@@ -0,0 +1,26 @@
+Console Bake
+############
+
+La console Bake de CakePHP est un autre outil permettant de réaliser son
+application rapidement. La console Bake peut créer chacun des ingrédients
+basiques de CakePHP : models, behaviors, views, helpers, controllers,
+components, cas de tests, fixtures et plugins. Et nous ne parlons pas
+seulement des squelettes de classes : Bake peut créer une application
+fonctionnelle complète en seulement quelques minutes. En réalité, Bake est une
+étape naturelle à suivre une fois qu'une application a été prototypée.
+
+Installation
+============
+
+Avant d'essayer d'utiliser ou d'étendre bake, assurez-vous qu'il est installé
+dans votre application. Bake est disponible en tant que plugin que vous pouvez
+installer avec Composer::
+
+ composer require --dev cakephp/bake:~1.0
+
+Ceci va installer bake en tant que dépendance de développement. Cela signifie
+qu'il ne sera pas installé lors d'un déploiement en production.
+
+.. meta::
+ :title lang=fr: Console Bake
+ :keywords lang=fr: interface ligne de commande,development,bake view, bake template syntaxe,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/fr/usage.rst b/app/vendor/cakephp/bake/docs/fr/usage.rst
new file mode 100644
index 000000000..56e891a19
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/fr/usage.rst
@@ -0,0 +1,108 @@
+Génération de Code avec Bake
+############################
+
+Suivant la configuration de votre installation, vous devrez peut être donner
+les droits d'exécution au script bash cake ou l'appeler avec la commande
+``./bin/cake bake``.
+La console cake est exécutée en utilisant le CLI PHP
+(Interface de Ligne de Commande). Si vous avez des problèmes en exécutant ce
+script, vérifiez que :
+
+#. le CLI PHP est installé et qu'il a les bons modules activés (ex: MySQL, intl).
+#. Certains utilisateurs peuvent aussi rencontrer des problèmes si la base de
+ données host est 'localhost' et devront essayer '127.0.0.1' à la place.
+#. Selon la configuration de votre ordinateur, vous devrez peut-être permettre
+ l'exécution du script bash pour permettre de lancer ``bin/cake bake``.
+
+Avant de lancer bake, vous devrez vous assurer qu'au moins une connection à une
+base de données est configurée.
+
+Si vous exécutez la commande sans argument, ``bin/cake bake`` affichera la liste
+des tâches disponibles. Vous devriez voir quelque chose comme ceci::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.x.x Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ ---------------------------------------------------------------
+ Les commandes suivantes avec lesquelles vous pouvez générer un squelette de
+ code pour votre application.
+
+ Les commandes disponibles de bake:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_snapshot
+ - model
+ - plugin
+ - shell
+ - shell-helper
+ - template
+ - test
+
+ En utilisant `cake bake [name]` vous pouvez faire appel à une tâche
+ spécifique de bake.
+
+Vous pouvez obtenir plus d'informations sur ce que chaque tâche fait et les
+options disponibles en utilisant l'option ``--help``::
+
+ $ bin/cake bake controller --help
+
+ Welcome to CakePHP v3.x.x Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ ---------------------------------------------------------------
+ Bake a controller skeleton.
+
+ Usage:
+ cake bake controller [subcommand] [options] []
+
+ Subcommands:
+
+ all Bake all controllers with CRUD methods.
+
+ To see help on a subcommand use `cake bake controller [subcommand] --help`
+
+ Options:
+
+ --help, -h Display this help.
+ --verbose, -v Enable verbose output.
+ --quiet, -q Enable quiet output.
+ --plugin, -p Plugin to bake into.
+ --force, -f Force overwriting existing files without prompting.
+ --connection, -c The datasource connection to get data from.
+ (default: default)
+ --theme, -t The theme to use when baking code.
+ --components The comma separated list of components to use.
+ --helpers The comma separated list of helpers to use.
+ --prefix The namespace/routing prefix to use.
+ --no-test Do not generate a test skeleton.
+ --no-actions Do not generate basic CRUD action methods.
+
+ Arguments:
+
+ name Name of the controller to bake. Can use Plugin.name to bake
+ controllers into plugins. (optional)
+
+Themes de Bake
+==============
+
+L'option theme est commune à toutes les commandes de bake, et permet de changer
+les fichiers de template utilisés lors de la création avec bake. Pour créer vos
+propres templates, référez-vous :ref:`à la documentation sur la création de
+theme bake `.
+
+.. meta::
+ :title lang=fr: Génération de Code avec Bake
+ :keywords lang=fr: interface ligne de commande,application fonctionnelle,base de données,configuration base de données,bash script,ingredients basiques,project,model,path path,génération de code,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql
diff --git a/app/vendor/cakephp/bake/docs/ja/conf.py b/app/vendor/cakephp/bake/docs/ja/conf.py
new file mode 100644
index 000000000..5871da648
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ja/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'ja'
diff --git a/app/vendor/cakephp/bake/docs/ja/contents.rst b/app/vendor/cakephp/bake/docs/ja/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ja/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/ja/development.rst b/app/vendor/cakephp/bake/docs/ja/development.rst
new file mode 100644
index 000000000..75ffc5436
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ja/development.rst
@@ -0,0 +1,301 @@
+Bake の拡張
+###########
+
+Bake は、アプリケーションやプラグインが基本機能に対して変更または追加を可能にする
+拡張可能なアーキテクチャーを備えています。Bake は、 `Twig `_
+テンプレートエンジンを使用したビュークラスを利用します。
+
+Bake イベント
+=============
+
+``BakeView`` は、ビュークラスとして、他のビュークラスと同様のイベントに加え、
+1つの特別な初期化 (initialize) イベントを発します。しかし、一方で標準ビュークラスは、
+イベントのプレフィックス "View." を使用しますが、 ``BakeView`` は、
+イベントのプレフィックス "Bake." を使用しています。
+
+初期化イベントは、すべての bake の出力に対して変更を加えるために使用できます。
+例えば、bake ビュークラスに他のヘルパーを追加するためにこのイベントは使用されます。 ::
+
+ on('Bake.initialize', function (Event $event) {
+ $view = $event->getSubject();
+
+ // bake テンプレートの中で MySpecial ヘルパーの使用を可能にします
+ $view->loadHelper('MySpecial', ['some' => 'config']);
+
+ // そして、$author 変数を利用可能にするために追加
+ $view->set('author', 'Andy');
+
+ });
+
+別のプラグインの中から bake を変更したい場合は、プラグインの ``config/bootstrap.php``
+ファイルでプラグインの Bake イベントを置くことは良いアイデアです。
+
+Bake イベントは、既存のテンプレートに小さな変更を行うための便利なことができます。
+例えば、コントローラーやテンプレートファイルを bake する際に使用される変数名を
+変更するために、bake テンプレートで使用される変数を変更するために
+``Bake.beforeRender`` で呼び出される関数を使用することができます。 ::
+
+ on('Bake.beforeRender', function (Event $event) {
+ $view = $event->getSubject();
+
+ // indexes の中のメインデータ変数に $rows を使用
+ if ($view->get('pluralName')) {
+ $view->set('pluralName', 'rows');
+ }
+ if ($view->get('pluralVar')) {
+ $view->set('pluralVar', 'rows');
+ }
+
+ // view と edit の中のメインデータ変数に $theOne を使用
+ if ($view->get('singularName')) {
+ $view->set('singularName', 'theOne');
+ }
+ if ($view->get('singularVar')) {
+ $view->set('singularVar', 'theOne');
+ }
+
+ });
+
+特定の生成されたファイルへの ``Bake.beforeRender`` と ``Bake.afterRender``
+イベントを指定することもあるでしょう。例えば、
+**Controller/controller.twig** ファイルから生成する際、 UsersController
+に特定のアクションを追加したい場合、以下のイベントを使用することができます。 ::
+
+ on(
+ 'Bake.beforeRender.Controller.controller',
+ function (Event $event) {
+ $view = $event->getSubject();
+ if ($view->viewVars['name'] == 'Users') {
+ // Users コントローラーに login と logout を追加
+ $view->viewVars['actions'] = [
+ 'login',
+ 'logout',
+ 'index',
+ 'view',
+ 'add',
+ 'edit',
+ 'delete'
+ ];
+ }
+ }
+ );
+
+特定の bake テンプレートのためのイベントリスナーを指定することによって、
+bake 関連のイベント・ロジックを簡素化し、テストするのが容易であるコールバックを
+提供することができます。
+
+Bake テンプレート構文
+=====================
+
+Bake テンプレートファイルは、 `Twig `__
+テンプレート構文を使用します。
+
+bake テンプレートがどのように動作するかを確認/理解する一つの方法は、
+bake テンプレートファイルを変更しようとする場合は特に、クラスを bake して、
+アプリケーションの **tmp/bake** フォルダー内に残っている前処理されたテンプレートファイルを
+使ったテンプレートと比較することです。
+
+だから、例えば、以下のようにシェルを bake した場合:
+
+.. code-block:: bash
+
+ bin/cake bake shell Foo
+
+(**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**) を使用した
+テンプレートは、以下のようになります。 ::
+
+ `` Bake テンプレートの PHP 終了タグ
+ * ``<%=`` Bake テンプレートの PHP ショートエコータグ
+ * ``<%-`` Bake テンプレートの PHP 開始タグ、タグの前に、先頭の空白を除去
+ * ``-%>`` Bake テンプレートの PHP 終了タグ、タグの後に末尾の空白を除去
+
+.. _creating-a-bake-theme:
+
+Bake テーマの作成
+=================
+
+"bake" コマンドによって生成された出力を変更したい場合、bake が使用するテンプレートの
+一部または全部を置き換えることができる、独自の bake の「テーマ」を作成することができます。
+これを行うための最善の方法は、次のとおりです。
+
+#. 新しいプラグインを bake します。プラグインの名前は bake の「テーマ」名になります。
+#. 新しいディレクトリー **plugins/[name]/src/Template/Bake/Template/** を作成します。
+#. **vendor/cakephp/bake/src/Template/Bake/Template** から上書きしたい
+ テンプレートをあなたのプラグインの中の適切なファイルにコピーしてください。
+#. bake を実行するときに、必要であれば、 bake のテーマを指定するための ``--theme``
+ オプションを使用してください。各呼び出しでこのオプションを指定しなくても済むように、
+ カスタムテーマをデフォルトテーマとして使用するように設定することもできます。 ::
+
+ Test->classSuffixes[$this->name()])) {
+ $this->Test->classSuffixes[$this->name()] = 'Foo';
+ }
+
+ $name = ucfirst($this->name());
+ if (!isset($this->Test->classTypes[$name])) {
+ $this->Test->classTypes[$name] = 'Foo';
+ }
+
+ return parent::bakeTest($className);
+ }
+
+* **class suffix** は ``bake`` 呼び出しで与えられた名前に追加します。前の例では、
+ ``ExampleFooTest.php`` ファイルを作成します。
+* **class type** は、(あなたが bake するアプリやプラグインに関連する)
+ あなたのファイルを導くために使用されるサブ名前空間です。
+ 前の例では、名前空間 ``App\Test\TestCase\Foo`` でテストを作成します。
+
+.. meta::
+ :title lang=ja: Bake の拡張
+ :keywords lang=ja: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/ja/index.rst b/app/vendor/cakephp/bake/docs/ja/index.rst
new file mode 100644
index 000000000..a37f45b36
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ja/index.rst
@@ -0,0 +1,28 @@
+Bake コンソール
+################
+
+CakePHP の bake コンソールは、迅速に CakePHP を動作させるまでを支援します。
+bake コンソールは、CakePHP の基本的な素材(モデル、ビヘイビアー、ビュー、ヘルパー、
+コントローラー、コンポーネント、テストケース、フィクスチャー、プラグイン)を作成できます。
+その為のスケルトンクラスについては、ここでは省略しますが、
+bake は数分で完全に機能するアプリケーションを作成できます。
+要するに、bake は足場の組まれたアプリケーションをいっぺんに手に入れるためにうってつけの方法です。
+
+インストール手順
+=================
+
+bake を使用したり拡張する前に、アプリケーションに bake をインストールしておいてください。
+bake は Composer を使ってインストールするプラグインとして提供されています。 ::
+
+ composer require --dev cakephp/bake:~1.0
+
+上記のコマンドは、bake を開発環境で使用するパッケージとしてインストールします。
+この入れ方の場合、本番環境としてデプロイする際には、 bake はインストールされません。
+
+Twig テンプレートを使用する場合、 ``WyriHaximus/TwigView`` プラグインをブートストラップとともに
+読み込んでいることを確認してください。それを完全に省略して、
+Bake プラグインにこのプラグインを読み込ませることもできます。
+
+.. meta::
+ :title lang=ja: Bakeコンソール
+ :keywords lang=ja: コマンドライン,CLI,development,bake view, bake template syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/ja/usage.rst b/app/vendor/cakephp/bake/docs/ja/usage.rst
new file mode 100644
index 000000000..d9470e6c3
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ja/usage.rst
@@ -0,0 +1,102 @@
+Bake でコード生成
+##################
+
+cake コンソールは、 PHP CLI (command line interface) で実行します。
+もしスクリプトの実行に問題があるなら、以下を満たしてください。
+
+#. PHP CLI がインストールされているか適切なモジュールが有効か確認してください (例:MySQL, intl)。
+#. データベースのホストが 'localhost' で問題があるなら、代わりに '127.0.0.1' を使って下さい。
+ PHP CLI でこの問題がおこる可能性があります。
+#. 使っているコンピューターの設定に応じて、 ``bin/cake bake`` で使用する cake bash スクリプトの
+ 実行権限を設定する必要があります。
+
+bake を実行する前にデータベースとの接続を確認しましょう。
+
+``bin/cake bake`` を引数無しで実行すると可能なタスクを表示できます。
+
+Windows システムの場合、 ``bin\cake bake`` を試してみてください。
+
+それは以下のように表示されます。 ::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.1.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP: 5.5.8
+ ---------------------------------------------------------------
+ The following commands can be used to generate skeleton code for your application.
+
+ Available bake commands:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_snapshot
+ - model
+ - plugin
+ - shell
+ - shell-helper
+ - template
+ - test
+
+ By using `cake bake [name]` you can invoke a specific bake task.
+
+より詳しい各コマンドの情報を得るには、 ``--help`` オプションをつけ実行してください。 ::
+
+ $ bin/cake bake controller --help
+
+ Welcome to CakePHP v3.1.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ ---------------------------------------------------------------
+ Bake a controller skeleton.
+
+ Usage:
+ cake bake controller [subcommand] [options] []
+
+ Subcommands:
+
+ all Bake all controllers with CRUD methods.
+
+ To see help on a subcommand use `cake bake controller [subcommand] --help`
+
+ Options:
+
+ --help, -h Display this help.
+ --verbose, -v Enable verbose output.
+ --quiet, -q Enable quiet output.
+ --plugin, -p Plugin to bake into.
+ --force, -f Force overwriting existing files without prompting.
+ --connection, -c The datasource connection to get data from.
+ (default: default)
+ --theme, -t The theme to use when baking code.
+ --components The comma separated list of components to use.
+ --helpers The comma separated list of helpers to use.
+ --prefix The namespace/routing prefix to use.
+ --no-test Do not generate a test skeleton.
+ --no-actions Do not generate basic CRUD action methods.
+
+ Arguments:
+
+ name Name of the controller to bake. Can use Plugin.name to bake
+ controllers into plugins. (optional)
+
+Bake テーマオプション
+=====================
+
+テーマオプションは全 bake コマンドで一般的です。また、bake テンプレートファイルを変更することができます。
+テーマを作るには、 :ref:`Bake テーマ作成ドキュメント ` をご覧ください。
+
+.. meta::
+ :title lang=ja: Code Generation with Bake
+ :keywords lang=ja: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql
diff --git a/app/vendor/cakephp/bake/docs/pt/conf.py b/app/vendor/cakephp/bake/docs/pt/conf.py
new file mode 100644
index 000000000..9e22cb017
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/pt/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'pt'
diff --git a/app/vendor/cakephp/bake/docs/pt/contents.rst b/app/vendor/cakephp/bake/docs/pt/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/pt/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/pt/development.rst b/app/vendor/cakephp/bake/docs/pt/development.rst
new file mode 100644
index 000000000..eeab55e00
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/pt/development.rst
@@ -0,0 +1,280 @@
+Extendendo o Bake
+#################
+
+Bake fornece uma extenssiva arquitetura que permite a sua aplicação ou plugin ser modificado ou adicionar funcionalidades as bases. Bake faz uso de uma classe view dedicada que usa o `Twig `_ engine de templates.
+
+Eventos do Bake
+===============
+
+Como uma class view , ``BakeView`` emite o mesmo evento como qualquer outra classe view,
+mais uma extra que inicializa eventos. No entanto, onde classe view padrão usa o prefixo "View.", ``BakeView`` usa o prefixo "Bake.".
+
+O inicializador de eventos pode ser usado para fazer mudanças quando aplicadoa toda a saida do bake
+, por exemplo ao adicionar outro helper ao bake view class este evebti oide ser usado::
+
+ on('Bake.initialize', function (Event $event) {
+ $view = $event->getSubject();
+
+ // No meu bake de templates, permite uso de MuSpecial helper
+ $view->loadHelper('MySpecial', ['some' => 'config']);
+
+ // E adicionar uma variável $author então este estará sempre disponível
+ $view->set('author', 'Andy');
+
+ });
+
+Se você quer modificar o seu bake apartir de outro pugin, coloque o bake do seu plugin dentro do arquivo do seu próprio plugin ``config/bootstrap.php`` será uma boa ideia.
+
+Os eventos do Bake podem ser úteis para fazer pequenas alterações nos modelos existentes.
+Por exemplo, para alterar os nomes das variáveis usados quando o controlador / modelo de baking
+arquivos podem usar uma função ouvindo ``Bake.beforeRender`` para modificar as variaveis usadas no bake templates::
+
+ on('Bake.beforeRender', function (Event $event) {
+ $view = $event->getSubject();
+
+ // Use $ rows para a variável de dados principal em índices
+ if ($view->get('pluralName')) {
+ $view->set('pluralName', 'rows');
+ }
+ if ($view->get('pluralVar')) {
+ $view->set('pluralVar', 'rows');
+ }
+
+ // Use $ theOne para a variável de dados principal em exibição / edição
+ if ($view->get('singularName')) {
+ $view->set('singularName', 'theOne');
+ }
+ if ($view->get('singularVar')) {
+ $view->set('singularVar', 'theOne');
+ }
+
+ });
+
+Você também pode abranger o ``Bake.beforeRender`` e ``Bake.afterRender`` eventos para um arquivo gerado específico. Por exemplo, se você quiser adicionar ações específicas para seu UsersController ao gerar a partir de um arquivo **Controller/controller.twig**,
+você pode usar o seguinte evento::
+
+ on(
+ 'Bake.beforeRender.Controller.controller',
+ function (Event $event) {
+ $view = $event->getSubject();
+ if ($view->viewVars['name'] == 'Users') {
+ // adicionar ações de login e logout ao Users controller
+ $view->viewVars['actions'] = [
+ 'login',
+ 'logout',
+ 'index',
+ 'view',
+ 'add',
+ 'edit',
+ 'delete'
+ ];
+ }
+ }
+ );
+
+Ao adicionar eventos que escutam o seu bake de templates, você pode simplesmente relacionar a sua logica de eventos com o bake e fornecer callbacks que são facilmente testáveis.
+
+Sintaxe de Templates do Bake
+============================
+
+Bake arquivos de template usa a sintaxe `Twig `__ de templates .
+
+Uma forma de ver/entender como o bake de templates funciona, especialmente quando tentamos modificar os arquivos de templates, é executar o bake de uma classe que compara o template usado com o template pré processado deixado anteriormente pela aplicação
+
+**tmp/bake** folder.
+
+Então, por exemplo, quando baking a shell é como?
+
+.. code-block:: bash
+
+ bin/cake bake shell Foo
+
+O template usado (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**)
+parece com algo assim::
+
+ `` Um template bake php fecha a tag
+ * ``<%=`` Um template bake php short-echo tag
+ * ``<%-`` Um template bake php abre a tag, revirando qualquer espaço em branco antes da tag
+ * ``-%>`` Um template bake php fecha a tag, revirando qualqualquer espaço em branco após a tag
+
+.. _creating-a-bake-theme:
+
+Criando um Tema Bake
+=====================
+
+Se você deseja modificar a saída produzida com o comando bake, você pode criar o seu próprio tema para o bake, aos quais permitirá a você subsituir algum ou todos os tempaltes que o bake usa. o mmelhor jeito de fazer isto é:
+
+#. Bake um novo plugin. O nome do plugin é o bake 'nome do tema'
+#. Crie uma nova pasta em **plugins/[name]/src/Template/Bake/Template/**.
+#. Copie qualquer template que você queira para sobrescrer de
+ **vendor/cakephp/bake/src/Template/Bake/Template** que feche com os arquivos no seu plugin.
+#. Quando executando o bake use a opção ``--theme`` para especificar qual o tema que o bake deve usar
+ . Para evitar problemas com esta opção, em cada chamada, você tambem pode definir o seu template customizado para ser usado como o template padrão::
+
+ Test->classSuffixes[$this->name()])) {
+ $this->Test->classSuffixes[$this->name()] = 'Foo';
+ }
+
+ $name = ucfirst($this->name());
+ if (!isset($this->Test->classTypes[$name])) {
+ $this->Test->classTypes[$name] = 'Foo';
+ }
+
+ return parent::bakeTest($className);
+ }
+
+* A **class suffix** vai se indexado ao mesmo nome providenciado por você na sua chamada de ``bake``
+ . No exemplo anterior, isto criaria o arquivo ``ExampleFooTest.php`` .
+* O **class type** vai ser o sub namespace usado para o seu arquivo (relativo ao aplicativo ou plugin que vocês está baking). No exemplo anterior, isto poderia criar o seu teste com o namespace ``App\Test\TestCase\Foo``
+
+.. meta::
+ :title lang=en: Extending Bake
+ :keywords lang=en: command line interface,development,bake view, bake template syntax,twig,erb tags,percent tags
+
diff --git a/app/vendor/cakephp/bake/docs/pt/index.rst b/app/vendor/cakephp/bake/docs/pt/index.rst
new file mode 100644
index 000000000..f4ebdf005
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/pt/index.rst
@@ -0,0 +1,25 @@
+Bake Console
+############
+
+O bake console do CakePHP é outro empenho para você ter o CakePHP configurado
+e funcionando rápido. O bake console pode criar qualquer ingrediente básico do
+CakePHP: models, behaviors, views, helpers, components, test cases, fixtures e
+plugins. E nós não estamos apenas falando de classes esqueleto: O Bake pode
+criar uma aplicação totalmente funcional em questão de minutos. De fato, o Bake
+é um passo natural a se dar uma vez que a aplicação tem seu alicerce construído.
+
+Instalação
+==========
+
+Antes de tentar usar ou extender o bake, tenha certeza que ele está instalado em
+sua aplicação. O bake é distribuído como um plugin que você pode instalar com o
+Composer::
+
+ composer require --dev cakephp/bake:~1.0
+
+Isto irá instalar o bake como uma dependência de desenvolvimento, sendo assim,
+não instalado quando em um ambiente de produção.
+
+.. meta::
+ :title lang=pt: Bake Console
+ :keywords lang=pt: cli,linha de comando,command line,dev,desenvolvimento,bake view, bake syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/pt/usage.rst b/app/vendor/cakephp/bake/docs/pt/usage.rst
new file mode 100644
index 000000000..79d03231a
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/pt/usage.rst
@@ -0,0 +1,130 @@
+Geração de código com bake
+##########################
+
+O console do cake é executado usando a CLI do PHP (interface da linha de comando).
+Se você tiver problemas para executar o script, assegure-se de que:
+
+#. Você instalou a CLI do PHP e possui os módulos apropriados habilitados (por
+ exemplo: MySQL, intl).
+#. Os usuários também podem ter problemas se o host do banco de dados for
+ 'localhost' e deve tentar '127.0.0.1', em vez disso, como localhost pode
+ causar problemas com CLI PHP.
+#. Dependendo de como o seu computador está configurado, você pode ter que
+ definir direitos de execução no script cake bash para chamá-lo usando
+ ``bin/cake bake``.
+
+Antes de executar o Bake você deve certificar-se de ter pelo menos um banco de dados
+conexão configurada.
+
+Quando executado sem argumentos ``bin/cake bake`` irá exibir uma lista de
+tarefas. Você deve ver algo como::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The following commands can be used to generate skeleton code for your application.
+
+ Available bake commands:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_diff
+ - migration_snapshot
+ - model
+ - plugin
+ - seed
+ - shell
+ - shell_helper
+ - task
+ - template
+ - test
+
+ By using `cake bake [name]` you can invoke a specific bake task.
+
+Você pode obter mais informações sobre o que cada tarefa faz e quais são as opções
+disponível usando o ``--help`` option::
+
+ $ bin/cake bake --help
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The Bake script generates controllers, models and template files for
+ your application. If run with no command line arguments, Bake guides the
+ user through the class creation process. You can customize the
+ generation process by telling Bake where different parts of your
+ application are using command line arguments.
+
+ Usage:
+ cake bake.bake [subcommand] [options]
+
+ Subcommands:
+
+ all Bake a complete MVC skeleton.
+ behavior Bake a behavior class file.
+ cell Bake a cell class file.
+ component Bake a component class file.
+ controller Bake a controller skeleton.
+ fixture Generate fixtures for use with the test suite. You
+ can use `bake fixture all` to bake all fixtures.
+ form Bake a form class file.
+ helper Bake a helper class file.
+ mailer Bake a mailer class file.
+ migration Bake migration class.
+ migration_diff Bake migration class.
+ migration_snapshot Bake migration snapshot class.
+ model Bake table and entity classes.
+ plugin Create the directory structure, AppController class
+ and testing setup for a new plugin. Can create
+ plugins in any of your bootstrapped plugin paths.
+ seed Bake seed class.
+ shell Bake a shell class file.
+ shell_helper Bake a shell_helper class file.
+ task Bake a task class file.
+ template Bake views for a controller, using built-in or
+ custom templates.
+ test Bake test case skeletons for classes.
+
+ To see help on a subcommand use `cake bake.bake [subcommand] --help`
+
+ Options:
+
+ --connection, -c Database connection to use in conjunction with `bake
+ all`. (default: default)
+ --everything Bake a complete MVC skeleton, using all the available
+ tables. Usage: "bake all --everything"
+ --force, -f Force overwriting existing files without prompting.
+ --help, -h Display this help.
+ --plugin, -p Plugin to bake into.
+ --prefix Prefix to bake controllers and templates into.
+ --quiet, -q Enable quiet output.
+ --tablePrefix Table prefix to be used in models.
+ --theme, -t The theme to use when baking code. (choices:
+ Bake|Migrations)
+ --verbose, -v Enable verbose output.
+
+Temas para o Bake
+=================
+
+A opção de tema é comum a todos os comandos do bake, e permite mudar os arquivos de modelo usados no bake. Para criar seus próprios modelos, veja a
+:ref:`documentação de criação de themes para o bake `.
+
+.. meta::
+ :title lang=pt: Geração de código com bake
+ :keywords lang=pt: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql
diff --git a/app/vendor/cakephp/bake/docs/ru/conf.py b/app/vendor/cakephp/bake/docs/ru/conf.py
new file mode 100644
index 000000000..f8a170ee5
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ru/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'ru'
diff --git a/app/vendor/cakephp/bake/docs/ru/contents.rst b/app/vendor/cakephp/bake/docs/ru/contents.rst
new file mode 100644
index 000000000..08c3e957c
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ru/contents.rst
@@ -0,0 +1,7 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP Bake
+
+ /index
+ /usage
+ /development
diff --git a/app/vendor/cakephp/bake/docs/ru/development.rst b/app/vendor/cakephp/bake/docs/ru/development.rst
new file mode 100644
index 000000000..5b7de8ec8
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ru/development.rst
@@ -0,0 +1,293 @@
+Расширение возможностей Bake
+############################
+
+Bake имеет расширяемую архитектуру, которая позволяет вашему приложению или плагинам
+измененять или добавления его базовую функциональность. Bake использует специальный
+класс, который использует механизм шаблонизатора `Twig `_.
+
+События Bake
+============
+
+В качестве класса представления ``BakeView`` генерирует те же события, что и любой другой класс представления,
+плюс одно дополнительное событие инициализации. Однако, в то время как классы стандартного представления используют
+префикс события "View.", ``BakeView`` использует префикс события "Bake.".
+
+Событие initialize можно использовать для внесения изменений, которые применяются ко всем 'испеченным'
+выводам, например, чтобы добавить другого помощника в класс вида bake, это событие может
+использовать следующее::
+
+ on('Bake.initialize', function (Event $event) {
+ $view = $event->getSubject();
+
+ // В моих шаблонах bake, разрешить использование MySpecial helper
+ $view->loadHelper('MySpecial', ['some' => 'config']);
+
+ // И добавьте переменную $author, чтобы она всегда была доступна
+ $view->set('author', 'Andy');
+
+ });
+
+Если вы хотите изменить выпечку из другого плагина, хорошей идеей будет - поместить
+события своего плагина в файл ``config/bootstrap.php``.
+
+События Bake могут быть полезны для внесения небольших изменений в существующие шаблоны.
+Например, чтобы изменить имена переменных, используемых для выпечки файлов контроллеров/шаблонов,
+можно использовать прослушивающую функцию ``Bake.beforeRender``::
+
+ on('Bake.beforeRender', function (Event $event) {
+ $view = $event->getSubject();
+
+ // Использовать $rows для основной переменной данных для индекса (index)
+ if ($view->get('pluralName')) {
+ $view->set('pluralName', 'rows');
+ }
+ if ($view->get('pluralVar')) {
+ $view->set('pluralVar', 'rows');
+ }
+
+ // Используйте $theOne для основной переменной данных для просмотра/редактирования (view/edit)
+ if ($view->get('singularName')) {
+ $view->set('singularName', 'theOne');
+ }
+ if ($view->get('singularVar')) {
+ $view->set('singularVar', 'theOne');
+ }
+
+ });
+
+Вы также можете использовать события ``Bake.beforeRender`` и ``Bake.afterRender`` для
+генерирования специфичного файла. Например, если вы хотите добавить определенные действия для
+вашего UserController при генерации из файла **Controller/controller.twig**,
+вы можете использовать следующее событие::
+
+ on(
+ 'Bake.beforeRender.Controller.controller',
+ function (Event $event) {
+ $view = $event->getSubject();
+ if ($view->viewVars['name'] == 'Users') {
+ // добавим действия входа и выхода из системы в контроллер пользователей
+ $view->viewVars['actions'] = [
+ 'login',
+ 'logout',
+ 'index',
+ 'view',
+ 'add',
+ 'edit',
+ 'delete'
+ ];
+ }
+ }
+ );
+
+При просмотре прослушивателей событий для конкретных шаблонов выпечки вы можете упростить
+выпечку связанной логики событий и обеспечить обратные вызовы, которые легче тестировать.
+
+Синтаксис шаблона выпечки
+=========================
+
+Файлы шаблонов Bake используют синтаксис шаблонизатора `Twig `__.
+
+Один из способов увидеть/понять, как работают шаблоны выпечки, особенно при попытке
+изменить файлы шаблонов выпечки, это - испечь класс и сравнить используемый шаблон
+с предварительно обработанным файлом шаблона, который остаётся в приложении в папке
+**tmp/bake**.
+
+Так, например, при выпечке такой оболочки:
+
+.. code-block:: bash
+
+ bin/cake bake shell Foo
+
+Используемый шаблон (**vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig**)
+будет выглядеть так::
+
+ `` Bake шаблон закрывающего тега php
+ * ``<%=`` Bake шаблон php короткого php тега echo
+ * ``<%-`` Bake шаблон php открытия тега, удаляющего любые введённые пробелы перед тегом
+ * ``-%>`` Bake шаблон php закрытия тега, любые введённые пробелы после тега
+
+.. _creating-a-bake-theme:
+
+Создание темы Bake
+==================
+
+Если вы хотите изменить результат, полученный командой "bake", вы можете
+создать свою собственную тему('theme') для "bake", которая позволит вам заменить некоторые или все
+шаблоны, которые испекает bake. Лучше всего сделать это так:
+
+#. Выпечь новый плагин. Имя плагина - это название темы 'bake'
+#. Создать новую диреткорию **plugins/[name]/src/Template/Bake/Template/**.
+#. Скопируйте любые шаблоны, которые вы хотите переопределить
+ **vendor/cakephp/bake/src/Template/Bake/Template** для сопоставления файлов с вашим плагином.
+#. При запуске выпечки используйте параметр ``--theme``, чтобы указать тему выпечки которую вы
+ хотите использовать. Чтобы избежать необходимости указывать этот параметр в каждом вызове, вы также можете
+ настроить свою тему в качестве темы по умолчанию::
+
+ Test->classSuffixes[$this->name()])) {
+ $this->Test->classSuffixes[$this->name()] = 'Foo';
+ }
+
+ $name = ucfirst($this->name());
+ if (!isset($this->Test->classTypes[$name])) {
+ $this->Test->classTypes[$name] = 'Foo';
+ }
+
+ return parent::bakeTest($className);
+ }
+
+* **Суффикс класса** будет добавлен к имени, указанному в вашем вызове ``bake``.
+ В предыдущем примере он создал бы файл ``ExampleFooTest.php``.
+
+* **Тип файла** будет использовать пространство под-пространство имён(sub-namespace), которое приведёт к файлу (относительно приложения или подключаемого модуля). В предыдущем примере, он создаст ваш тест с пространством имен ``App\Test\TestCase\Foo``.
+
+.. meta::
+ :title lang=ru: Расширение возможностей Bake
+ :keywords lang=ru: интерфейс командной строки, разработка, выпечка, синтаксис шаблона выпечки, твинг, метки erb, процентные теги
diff --git a/app/vendor/cakephp/bake/docs/ru/index.rst b/app/vendor/cakephp/bake/docs/ru/index.rst
new file mode 100644
index 000000000..0b9c1bc80
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ru/index.rst
@@ -0,0 +1,24 @@
+Консоль Bake
+############
+
+Bake консоль CakePHP - это еще один инструмент для быстрой разработки на фреймворке CakePHP.
+Консоль Bake может создать любой из базовых компонентов или все сразу: models,
+behaviors, views, helpers, controllers, components, test cases, fixtures и plugins.
+Речь идет не только о каркасе приложения: Bake консоль создает полностью функционирующее приложение всего за пару минут.
+
+Bake это естественный шаг для статической генерации кода.
+
+Установка
+=========
+
+Перед тем, как использовать Bake, убедитесь, что он установлен в вашем приложении.
+Bake это отдельный плагин и вы можете установить его с помощью Composer::
+
+ composer require --dev cakephp/bake:~1.0
+
+Команда выше установит Bake в зависимости от разработки.
+Это значит, что Bake не будет установлен, когда вы делаете деплой на продакшн сервер.
+
+.. meta::
+ :title lang=ru: Консоль Bake
+ :keywords lang=ru: интерфейс командной строки,разработка,bake view, bake template syntax,erb tags,asp tags,percent tags
diff --git a/app/vendor/cakephp/bake/docs/ru/usage.rst b/app/vendor/cakephp/bake/docs/ru/usage.rst
new file mode 100644
index 000000000..8cfd72b85
--- /dev/null
+++ b/app/vendor/cakephp/bake/docs/ru/usage.rst
@@ -0,0 +1,131 @@
+Генерация кода с помощью Bake
+#############################
+
+Консоль cake запускается с использованием PHP CLI (интерфейса командной строки).
+Если у вас возникли проблемы с запуском скрипта, убедитесь, что:
+
+#. У вас установлен PHP CLI и что у него есть соответствующие включённые модули
+ (например: MySQL, intl).
+#. У пользователей также могут быть проблемы, если хост базы данных является
+ 'localhost' вмеcто этого можно попробовать '127.0.0.1', поскольку localhost
+ может вызвать проблемы с PHP CLI.
+#. В зависимости от того, как настроен ваш компьютер, вам может потребоваться
+ установить права выполнения на скрипт bash, чтобы вызвать его, используя
+ ``bin/cake bake``.
+
+Перед запуском bake вы должны убедиться, что у вас есть хотя бы одна база данных и
+соединение настроено.
+
+При запуске без аргументов ``bin/cake bake`` выводит список доступных
+заданий. Вы должны увидеть что-то вроде::
+
+ $ bin/cake bake
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The following commands can be used to generate skeleton code for your application.
+
+ Available bake commands:
+
+ - all
+ - behavior
+ - cell
+ - component
+ - controller
+ - fixture
+ - form
+ - helper
+ - mailer
+ - migration
+ - migration_diff
+ - migration_snapshot
+ - model
+ - plugin
+ - seed
+ - shell
+ - shell_helper
+ - task
+ - template
+ - test
+
+ By using `cake bake [name]` you can invoke a specific bake task.
+
+Вы можете получить больше дополнительной информации о том, что делает каждая задача, и какие параметры
+доступны, если используете ключ ``--help``::
+
+ $ bin/cake bake --help
+
+ Welcome to CakePHP v3.4.6 Console
+ ---------------------------------------------------------------
+ App : src
+ Path: /var/www/cakephp.dev/src/
+ PHP : 5.6.20
+ ---------------------------------------------------------------
+ The Bake script generates controllers, models and template files for
+ your application. If run with no command line arguments, Bake guides the
+ user through the class creation process. You can customize the
+ generation process by telling Bake where different parts of your
+ application are using command line arguments.
+
+ Usage:
+ cake bake.bake [subcommand] [options]
+
+ Subcommands:
+
+ all Bake a complete MVC skeleton.
+ behavior Bake a behavior class file.
+ cell Bake a cell class file.
+ component Bake a component class file.
+ controller Bake a controller skeleton.
+ fixture Generate fixtures for use with the test suite. You
+ can use `bake fixture all` to bake all fixtures.
+ form Bake a form class file.
+ helper Bake a helper class file.
+ mailer Bake a mailer class file.
+ migration Bake migration class.
+ migration_diff Bake migration class.
+ migration_snapshot Bake migration snapshot class.
+ model Bake table and entity classes.
+ plugin Create the directory structure, AppController class
+ and testing setup for a new plugin. Can create
+ plugins in any of your bootstrapped plugin paths.
+ seed Bake seed class.
+ shell Bake a shell class file.
+ shell_helper Bake a shell_helper class file.
+ task Bake a task class file.
+ template Bake views for a controller, using built-in or
+ custom templates.
+ test Bake test case skeletons for classes.
+
+ To see help on a subcommand use `cake bake.bake [subcommand] --help`
+
+ Options:
+
+ --connection, -c Database connection to use in conjunction with `bake
+ all`. (default: default)
+ --everything Bake a complete MVC skeleton, using all the available
+ tables. Usage: "bake all --everything"
+ --force, -f Force overwriting existing files without prompting.
+ --help, -h Display this help.
+ --plugin, -p Plugin to bake into.
+ --prefix Prefix to bake controllers and templates into.
+ --quiet, -q Enable quiet output.
+ --tablePrefix Table prefix to be used in models.
+ --theme, -t The theme to use when baking code. (choices:
+ Bake|Migrations)
+ --verbose, -v Enable verbose output.
+
+Темы Bake
+=========
+
+Параметр темы является общим для всех команд bake, так же bake позволяет изменять
+файлы шаблонов, используемые при 'выпечке'. Чтобы создать свои собственные шаблоны см.
+:ref:`документация по созданию темы`.
+
+.. meta::
+ :title lang=ru: Генерация кода с помощью Bake
+ :keywords lang=en: command line interface,functional application,database,database configuration,bash script,basic ingredients,project,model,path path,code generation,scaffolding,windows users,configuration file,few minutes,config,iew,shell,models,running,mysql
diff --git a/app/vendor/cakephp/bake/phpcs.xml.dist b/app/vendor/cakephp/bake/phpcs.xml.dist
new file mode 100644
index 000000000..9e40ece74
--- /dev/null
+++ b/app/vendor/cakephp/bake/phpcs.xml.dist
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+ 0
+
+
diff --git a/app/vendor/cakephp/bake/phpstan.neon b/app/vendor/cakephp/bake/phpstan.neon
index e4f5c4fbf..68b9999e4 100644
--- a/app/vendor/cakephp/bake/phpstan.neon
+++ b/app/vendor/cakephp/bake/phpstan.neon
@@ -1,6 +1,7 @@
parameters:
+ level: 5
autoload_files:
- tests/bootstrap.php
ignoreErrors:
- '#Call to an undefined method Cake\\Database\\Type::getDateTimeClassName\(\)#'
- - '#Constant TESTS not found#'
+ - '#Parameter \#1 \$size of method .+CollectionInterface::take\(\) expects int, array given.#'
diff --git a/app/vendor/cakephp/bake/src/Shell/BakeShell.php b/app/vendor/cakephp/bake/src/Shell/BakeShell.php
index 3e42472ae..5e666d936 100644
--- a/app/vendor/cakephp/bake/src/Shell/BakeShell.php
+++ b/app/vendor/cakephp/bake/src/Shell/BakeShell.php
@@ -57,7 +57,7 @@ public function startup()
Configure::write('debug', true);
Cache::disable();
// Loading WyriHaximus/TwigView Plugin through the Plugin::load() for backward compatibility.
- if (!Plugin::loaded('WyriHaximus/TwigView')) {
+ if (!Plugin::isLoaded('WyriHaximus/TwigView')) {
Plugin::load('WyriHaximus/TwigView', ['bootstrap' => true]);
}
@@ -136,7 +136,7 @@ public function main()
* - Shell/Task for each loaded plugin
* - App/Shell/Task/
*
- * @return void
+ * @return bool
*/
public function loadTasks()
{
@@ -153,7 +153,8 @@ public function loadTasks()
$tasks = $this->_findTasks($tasks, APP, Configure::read('App.namespace'));
$this->tasks = array_values($tasks);
- parent::loadTasks();
+
+ return parent::loadTasks();
}
/**
@@ -239,6 +240,14 @@ protected function _findTaskClasses($files)
*/
public function all($name = null)
{
+ if (
+ $this->param('connection') && $this->param('everything') &&
+ $this->param('connection') !== 'default'
+ ) {
+ $this->warn('Can only bake everything on default connection');
+
+ return false;
+ }
$this->out('Bake All');
$this->hr();
@@ -301,10 +310,10 @@ public function getOptionParser()
'default' => false,
'boolean' => true,
])->addOption('prefix', [
- 'help' => 'Prefix to bake controllers and templates into.'
+ 'help' => 'Prefix to bake controllers and templates into.',
])->addOption('tablePrefix', [
'help' => 'Table prefix to be used in models.',
- 'default' => null
+ 'default' => null,
]);
$parser = $this->_setCommonOptions($parser);
@@ -314,7 +323,7 @@ public function getOptionParser()
$this->{$task}->interactive = $this->interactive;
$parser->addSubcommand(Inflector::underscore($task), [
'help' => $taskParser->getDescription(),
- 'parser' => $taskParser
+ 'parser' => $taskParser,
]);
}
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php b/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php
index 57bfacdd4..83c7e2485 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/BakeTask.php
@@ -23,7 +23,6 @@
/**
* Base class for Bake Tasks.
- *
*/
class BakeTask extends Shell
{
@@ -126,7 +125,7 @@ public function getPath()
* Base execute method parses some parameters and sets some properties on the bake tasks.
* call when overriding execute()
*
- * @return void
+ * @return bool|int|null|void
*/
public function main()
{
@@ -156,7 +155,7 @@ public function callProcess($command)
$descriptorSpec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
- 2 => ['pipe', 'w']
+ 2 => ['pipe', 'w'],
];
$this->_io->verbose('Running ' . $command);
$process = proc_open(
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php b/app/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php
index b2e319e3c..a510fa001 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/BakeTemplateTask.php
@@ -36,7 +36,7 @@ class BakeTemplateTask extends Shell
/**
* BakeView instance
*
- * @var \Bake\View\BakeView
+ * @var \Bake\View\BakeView|null
*/
public $View;
@@ -57,9 +57,9 @@ public function getView()
$viewOptions = [
'helpers' => [
'Bake.Bake',
- 'Bake.DocBlock'
+ 'Bake.DocBlock',
],
- 'theme' => $theme
+ 'theme' => $theme,
];
$view = new BakeView(new Request(), new Response(), null, $viewOptions);
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/CellTask.php b/app/vendor/cakephp/bake/src/Shell/Task/CellTask.php
index 685a79e49..f7135a826 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/CellTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/CellTask.php
@@ -117,7 +117,7 @@ public function getOptionParser()
$parser = parent::getOptionParser();
$parser
->addOption('prefix', [
- 'help' => 'The namespace prefix to use.'
+ 'help' => 'The namespace prefix to use.',
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/ControllerTask.php b/app/vendor/cakephp/bake/src/Shell/Task/ControllerTask.php
index 107f632c9..b44880ad8 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/ControllerTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/ControllerTask.php
@@ -35,7 +35,7 @@ class ControllerTask extends BakeTask
public $tasks = [
'Bake.Model',
'Bake.BakeTemplate',
- 'Bake.Test'
+ 'Bake.Test',
];
/**
@@ -125,7 +125,7 @@ public function bake($controllerName)
$modelObj = TableRegistry::getTableLocator()->get($plugin . $currentModelName);
} else {
$modelObj = TableRegistry::getTableLocator()->get($plugin . $currentModelName, [
- 'connectionName' => $this->connection
+ 'connectionName' => $this->connection,
]);
}
@@ -142,7 +142,6 @@ public function bake($controllerName)
$data = compact(
'actions',
- 'admin',
'components',
'currentModelName',
'defaultModel',
@@ -200,12 +199,12 @@ public function bakeController($controllerName, array $data)
* Assembles and writes a unit test file
*
* @param string $className Controller class name
- * @return string|bool Baked test
+ * @return string|false Baked test
*/
public function bakeTest($className)
{
if (!empty($this->params['no-test'])) {
- return null;
+ return false;
}
$this->Test->plugin = $this->plugin;
$this->Test->connection = $this->connection;
@@ -270,24 +269,24 @@ public function getOptionParser()
'Bake a controller skeleton.'
)->addArgument('name', [
'help' => 'Name of the controller to bake (without the `Controller` suffix). ' .
- 'You can use Plugin.name to bake controllers into plugins.'
+ 'You can use Plugin.name to bake controllers into plugins.',
])->addOption('components', [
- 'help' => 'The comma separated list of components to use.'
+ 'help' => 'The comma separated list of components to use.',
])->addOption('helpers', [
- 'help' => 'The comma separated list of helpers to use.'
+ 'help' => 'The comma separated list of helpers to use.',
])->addOption('prefix', [
- 'help' => 'The namespace/routing prefix to use.'
+ 'help' => 'The namespace/routing prefix to use.',
])->addOption('actions', [
'help' => 'The comma separated list of actions to generate. ' .
- 'You can include custom methods provided by your template set here.'
+ 'You can include custom methods provided by your template set here.',
])->addOption('no-test', [
'boolean' => true,
- 'help' => 'Do not generate a test skeleton.'
+ 'help' => 'Do not generate a test skeleton.',
])->addOption('no-actions', [
'boolean' => true,
- 'help' => 'Do not generate basic CRUD action methods.'
+ 'help' => 'Do not generate basic CRUD action methods.',
])->addSubcommand('all', [
- 'help' => 'Bake all controllers with CRUD methods.'
+ 'help' => 'Bake all controllers with CRUD methods.',
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php b/app/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php
index 492e44bc4..5b54e6d54 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php
@@ -39,7 +39,7 @@ class FixtureTask extends BakeTask
*/
public $tasks = [
'Bake.Model',
- 'Bake.BakeTemplate'
+ 'Bake.BakeTemplate',
];
/**
@@ -71,27 +71,27 @@ public function getOptionParser()
'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.'
)->addArgument('name', [
'help' => 'Name of the fixture to bake (without the `Fixture` suffix). ' .
- 'You can use Plugin.name to bake plugin fixtures.'
+ 'You can use Plugin.name to bake plugin fixtures.',
])->addOption('table', [
'help' => 'The table name if it does not follow conventions.',
])->addOption('count', [
'help' => 'When using generated data, the number of records to include in the fixture(s).',
'short' => 'n',
- 'default' => 1
+ 'default' => 1,
])->addOption('schema', [
'help' => 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.',
'short' => 's',
- 'boolean' => true
+ 'boolean' => true,
])->addOption('records', [
'help' => 'Generate a fixture with records from the non-test database.' .
' Used with --count and --conditions to limit which records are added to the fixture.',
'short' => 'r',
- 'boolean' => true
+ 'boolean' => true,
])->addOption('conditions', [
'help' => 'The SQL snippet to use when importing records.',
'default' => '1=1',
])->addSubcommand('all', [
- 'help' => 'Bake all fixture files for tables in the chosen connection.'
+ 'help' => 'Bake all fixture files for tables in the chosen connection.',
]);
return $parser;
@@ -213,7 +213,7 @@ public function readSchema($name, $table)
} else {
$model = TableRegistry::getTableLocator()->get($name, [
'table' => $table,
- 'connection' => $connection
+ 'connection' => $connection,
]);
}
@@ -236,7 +236,7 @@ public function generateFixtureFile($model, array $otherVars)
'records' => null,
'import' => null,
'fields' => null,
- 'namespace' => Configure::read('App.namespace')
+ 'namespace' => Configure::read('App.namespace'),
];
if ($this->plugin) {
$defaults['namespace'] = $this->_pluginNamespace($this->plugin);
@@ -366,7 +366,7 @@ protected function _generateRecords(TableSchema $table, $recordCount = 1)
} else {
$insert = "Lorem ipsum dolor sit amet";
if (!empty($fieldInfo['length'])) {
- $insert = substr($insert, 0, (int)$fieldInfo['length'] - 2);
+ $insert = substr($insert, 0, (int)$fieldInfo['length'] > 2 ? (int)$fieldInfo['length'] - 2 : (int)$fieldInfo['length']);
}
}
break;
@@ -429,7 +429,7 @@ protected function _makeRecordString($records)
}
$out .= " [\n";
$out .= implode(",\n", $values);
- $out .= "\n ],\n";
+ $out .= ",\n ],\n";
}
$out .= " ]";
@@ -453,7 +453,7 @@ protected function _getRecordsFromTable($modelName, $useTable = null)
} else {
$model = TableRegistry::getTableLocator()->get($modelName, [
'table' => $useTable,
- 'connection' => ConnectionManager::get($this->connection)
+ 'connection' => ConnectionManager::get($this->connection),
]);
}
$records = $model->find('all')
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/ModelTask.php b/app/vendor/cakephp/bake/src/Shell/Task/ModelTask.php
index 3a6cad4a1..299cd0f4f 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/ModelTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/ModelTask.php
@@ -47,7 +47,7 @@ class ModelTask extends BakeTask
public $tasks = [
'Bake.Fixture',
'Bake.BakeTemplate',
- 'Bake.Test'
+ 'Bake.Test',
];
/**
@@ -193,7 +193,7 @@ public function getTableObject($className, $table)
return TableRegistry::getTableLocator()->get($className, [
'name' => $className,
'table' => $this->tablePrefix . $table,
- 'connection' => ConnectionManager::get($this->connection)
+ 'connection' => ConnectionManager::get($this->connection),
]);
}
@@ -215,7 +215,7 @@ public function getAssociations(Table $table)
$associations = [
'belongsTo' => [],
'hasMany' => [],
- 'belongsToMany' => []
+ 'belongsToMany' => [],
];
$primary = $table->getPrimaryKey();
@@ -291,7 +291,7 @@ public function getAssociationInfo(Table $table)
if ($tableClass === 'Cake\ORM\Table') {
$namespace = $appNamespace;
- $className = $association->className();
+ $className = $association->getClassName();
if (strlen($className)) {
list($plugin, $className) = pluginSplit($className);
if ($plugin !== null) {
@@ -306,7 +306,7 @@ public function getAssociationInfo(Table $table)
}
$info[$association->getName()] = [
- 'targetFqn' => '\\' . $tableClass
+ 'targetFqn' => '\\' . $tableClass,
];
}
@@ -333,7 +333,7 @@ public function findBelongsTo($model, array $associations)
$assoc = [
'alias' => 'Parent' . $model->getAlias(),
'className' => $className,
- 'foreignKey' => $fieldName
+ 'foreignKey' => $fieldName,
];
} else {
$tmpModelName = $this->_modelNameFromKey($fieldName);
@@ -345,7 +345,7 @@ public function findBelongsTo($model, array $associations)
}
$assoc = [
'alias' => $tmpModelName,
- 'foreignKey' => $fieldName
+ 'foreignKey' => $fieldName,
];
if ($schema->getColumn($fieldName)['null'] === false) {
$assoc['joinType'] = 'INNER';
@@ -429,14 +429,14 @@ public function findHasMany($model, array $associations)
if (!in_array($fieldName, $primaryKey) && $fieldName === $foreignKey) {
$assoc = [
'alias' => $otherModel->getAlias(),
- 'foreignKey' => $fieldName
+ 'foreignKey' => $fieldName,
];
} elseif ($otherTableName === $tableName && $fieldName === 'parent_id') {
$className = ($this->plugin) ? $this->plugin . '.' . $model->getAlias() : $model->getAlias();
$assoc = [
'alias' => 'Child' . $model->getAlias(),
'className' => $className,
- 'foreignKey' => $fieldName
+ 'foreignKey' => $fieldName,
];
}
if ($assoc && $this->plugin && empty($assoc['className'])) {
@@ -481,9 +481,9 @@ public function findBelongsToMany($model, array $associations)
'alias' => $habtmName,
'foreignKey' => $foreignKey,
'targetForeignKey' => $this->_modelKey($habtmName),
- 'joinTable' => $otherTableName
+ 'joinTable' => $otherTableName,
];
- if ($assoc && $this->plugin) {
+ if ($this->plugin) {
$assoc['className'] = $this->plugin . '.' . $assoc['alias'];
}
$associations['belongsToMany'][] = $assoc;
@@ -556,9 +556,12 @@ public function getEntityPropertySchema(Table $model)
$schema = $model->getSchema();
foreach ($schema->columns() as $column) {
+ $columnSchema = $schema->getColumn($column);
+
$properties[$column] = [
'kind' => 'column',
- 'type' => $schema->getColumnType($column)
+ 'type' => $columnSchema['type'],
+ 'null' => $columnSchema['null'],
];
}
@@ -581,7 +584,7 @@ public function getEntityPropertySchema(Table $model)
$properties[$association->getProperty()] = [
'kind' => 'association',
'association' => $association,
- 'type' => $entityClass
+ 'type' => $entityClass,
];
}
@@ -717,14 +720,14 @@ public function fieldValidation($schema, $fieldName, array $metaData, $primaryKe
$rules['numeric'] = [];
if ($metaData['unsigned']) {
$rules['greaterThanOrEqual'] = [
- 0
+ 0,
];
}
} elseif ($metaData['type'] === 'decimal') {
$rules['decimal'] = [];
if ($metaData['unsigned']) {
$rules['greaterThanOrEqual'] = [
- 0
+ 0,
];
}
} elseif ($metaData['type'] === 'boolean') {
@@ -746,20 +749,34 @@ public function fieldValidation($schema, $fieldName, array $metaData, $primaryKe
}
}
- if (in_array($fieldName, $primaryKey)) {
- $rules['allowEmpty'] = ["'create'"];
- } elseif ($metaData['null'] === true) {
- $rules['allowEmpty'] = [];
- } else {
- $rules['requirePresence'] = ["'create'"];
- $rules['notEmpty'] = [];
- }
-
$validation = [];
foreach ($rules as $rule => $args) {
$validation[$rule] = [
'rule' => $rule,
- 'args' => $args
+ 'args' => $args,
+ ];
+ }
+
+ if (in_array($fieldName, $primaryKey)) {
+ $validation['allowEmpty'] = [
+ 'rule' => $this->getEmptyMethod($fieldName, $metaData),
+ 'args' => ['null', "'create'"],
+ ];
+ } elseif ($metaData['null'] === true) {
+ $validation['allowEmpty'] = [
+ 'rule' => $this->getEmptyMethod($fieldName, $metaData),
+ 'args' => [],
+ ];
+ } else {
+ if ($metaData['default'] === null || $metaData['default'] === false) {
+ $validation['requirePresence'] = [
+ 'rule' => 'requirePresence',
+ 'args' => ["'create'"],
+ ];
+ }
+ $validation['notEmpty'] = [
+ 'rule' => $this->getEmptyMethod($fieldName, $metaData, 'not'),
+ 'args' => [],
];
}
@@ -778,6 +795,35 @@ public function fieldValidation($schema, $fieldName, array $metaData, $primaryKe
return $validation;
}
+ /**
+ * Get the specific allow empty method for field based on metadata.
+ *
+ * @param string $fieldName Field name.
+ * @param array $metaData Field meta data.
+ * @param string $prefix Method name prefix.
+ * @return string
+ */
+ protected function getEmptyMethod($fieldName, array $metaData, $prefix = 'allow')
+ {
+ switch ($metaData['type']) {
+ case 'date':
+ return $prefix . 'EmptyDate';
+
+ case 'time':
+ return $prefix . 'EmptyTime';
+
+ case 'datetime':
+ case 'timestamp':
+ return $prefix . 'EmptyDateTime';
+ }
+
+ if (preg_match('/file|image/', $fieldName)) {
+ return $prefix . 'EmptyFile';
+ }
+
+ return $prefix . 'EmptyString';
+ }
+
/**
* Generate default rules checker.
*
@@ -842,7 +888,8 @@ public function getBehaviors($model)
$behaviors['Timestamp'] = [];
}
- if (in_array('lft', $fields) && $schema->getColumnType('lft') === 'integer' &&
+ if (
+ in_array('lft', $fields) && $schema->getColumnType('lft') === 'integer' &&
in_array('rght', $fields) && $schema->getColumnType('rght') === 'integer' &&
in_array('parent_id', $fields)
) {
@@ -914,7 +961,7 @@ public function bakeEntity($model, array $data = [])
'namespace' => $namespace,
'plugin' => $this->plugin,
'pluginPath' => $pluginPath,
- 'primaryKey' => []
+ 'primaryKey' => [],
];
$this->BakeTemplate->set($data);
@@ -1086,47 +1133,47 @@ public function getOptionParser()
'Bake table and entity classes.'
)->addArgument('name', [
'help' => 'Name of the model to bake (without the Table suffix). ' .
- 'You can use Plugin.name to bake plugin models.'
+ 'You can use Plugin.name to bake plugin models.',
])->addSubcommand('all', [
- 'help' => 'Bake all model files with associations and validation.'
+ 'help' => 'Bake all model files with associations and validation.',
])->addOption('table', [
- 'help' => 'The table name to use if you have non-conventional table names.'
+ 'help' => 'The table name to use if you have non-conventional table names.',
])->addOption('no-entity', [
'boolean' => true,
- 'help' => 'Disable generating an entity class.'
+ 'help' => 'Disable generating an entity class.',
])->addOption('no-table', [
'boolean' => true,
- 'help' => 'Disable generating a table class.'
+ 'help' => 'Disable generating a table class.',
])->addOption('no-validation', [
'boolean' => true,
- 'help' => 'Disable generating validation rules.'
+ 'help' => 'Disable generating validation rules.',
])->addOption('no-rules', [
'boolean' => true,
- 'help' => 'Disable generating a rules checker.'
+ 'help' => 'Disable generating a rules checker.',
])->addOption('no-associations', [
'boolean' => true,
- 'help' => 'Disable generating associations.'
+ 'help' => 'Disable generating associations.',
])->addOption('no-fields', [
'boolean' => true,
- 'help' => 'Disable generating accessible fields in the entity.'
+ 'help' => 'Disable generating accessible fields in the entity.',
])->addOption('fields', [
- 'help' => 'A comma separated list of fields to make accessible.'
+ 'help' => 'A comma separated list of fields to make accessible.',
])->addOption('no-hidden', [
'boolean' => true,
- 'help' => 'Disable generating hidden fields in the entity.'
+ 'help' => 'Disable generating hidden fields in the entity.',
])->addOption('hidden', [
- 'help' => 'A comma separated list of fields to hide.'
+ 'help' => 'A comma separated list of fields to hide.',
])->addOption('primary-key', [
'help' => 'The primary key if you would like to manually set one.' .
- ' Can be a comma separated list if you are using a composite primary key.'
+ ' Can be a comma separated list if you are using a composite primary key.',
])->addOption('display-field', [
- 'help' => 'The displayField if you would like to choose one.'
+ 'help' => 'The displayField if you would like to choose one.',
])->addOption('no-test', [
'boolean' => true,
- 'help' => 'Do not generate a test case skeleton.'
+ 'help' => 'Do not generate a test case skeleton.',
])->addOption('no-fixture', [
'boolean' => true,
- 'help' => 'Do not generate a test fixture skeleton.'
+ 'help' => 'Do not generate a test fixture skeleton.',
])->setEpilog(
'Omitting all arguments and options will list the table names you can generate models for'
);
@@ -1157,12 +1204,12 @@ public function bakeFixture($className, $useTable = null)
* Assembles and writes a unit test file
*
* @param string $className Model class name
- * @return string|bool
+ * @return string|false
*/
public function bakeTest($className)
{
if (!empty($this->params['no-test'])) {
- return null;
+ return false;
}
$this->Test->plugin = $this->plugin;
$this->Test->interactive = $this->interactive;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/PluginTask.php b/app/vendor/cakephp/bake/src/Shell/Task/PluginTask.php
index 8cde50354..a80fc11f6 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/PluginTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/PluginTask.php
@@ -28,20 +28,13 @@
*/
class PluginTask extends BakeTask
{
- /**
- * Path to the bootstrap file. Changed in tests.
- *
- * @var string
- */
- public $bootstrap = null;
-
/**
* Tasks this task uses.
*
* @var array
*/
public $tasks = [
- 'Bake.BakeTemplate'
+ 'Bake.BakeTemplate',
];
/**
@@ -59,7 +52,6 @@ class PluginTask extends BakeTask
public function initialize()
{
$this->path = current(App::path('Plugin'));
- $this->bootstrap = ROOT . DS . 'config' . DS . 'bootstrap.php';
}
/**
@@ -117,8 +109,8 @@ public function bake($plugin)
$this->_generateFiles($plugin, $this->path);
- $hasAutoloader = $this->_modifyAutoloader($plugin, $this->path);
- $this->_modifyBootstrap($plugin, $hasAutoloader);
+ $this->_modifyAutoloader($plugin, $this->path);
+ $this->_modifyApplication($plugin);
$this->hr();
$this->out(sprintf('Created: %s in %s', $plugin, $this->path . $plugin), 2);
@@ -130,32 +122,22 @@ public function bake($plugin)
}
/**
- * Update the app's bootstrap.php file.
+ * Modify the application class
*
* @param string $plugin Name of plugin
- * @param bool $hasAutoloader Whether or not there is an autoloader configured for
* the plugin
* @return void
*/
- protected function _modifyBootstrap($plugin, $hasAutoloader)
+ protected function _modifyApplication($plugin)
{
- $bootstrap = new File($this->bootstrap, false);
- if (!$bootstrap->exists()) {
- $this->err('Could not update application bootstrap.php file, as it could not be found.');
+ $application = new File(ROOT . DS . 'src' . DS . 'Application.php', false);
+ if (!$application->exists()) {
+ $this->err('Could not update application Application.php file, as it could not be found.');
return;
}
- $contents = $bootstrap->read();
- if (!preg_match("@\n\s*Plugin::loadAll@", $contents)) {
- $autoload = $hasAutoloader ? null : "'autoload' => true, ";
- $bootstrap->append(sprintf(
- "\nPlugin::load('%s', [%s'bootstrap' => false, 'routes' => true]);\n",
- $plugin,
- $autoload
- ));
- $this->out('');
- $this->out(sprintf('%s modified', $this->bootstrap));
- }
+
+ $this->dispatchShell('plugin', 'load', $plugin);
}
/**
@@ -334,8 +316,8 @@ public function findPath(array $pathOptions)
$this->out($i + 1 . '. ' . $option);
}
$prompt = 'Choose a plugin path from the paths above.';
- $choice = $this->in($prompt, null, 1);
- if ((int)$choice > 0 && (int)$choice <= $max) {
+ $choice = (int)$this->in($prompt, null, '1');
+ if ($choice > 0 && $choice <= $max) {
$valid = true;
}
}
@@ -354,10 +336,10 @@ public function getOptionParser()
'Create the directory structure, AppController class and testing setup for a new plugin. ' .
'Can create plugins in any of your bootstrapped plugin paths.'
)->addArgument('name', [
- 'help' => 'CamelCased name of the plugin to create.'
+ 'help' => 'CamelCased name of the plugin to create.',
])->addOption('composer', [
'default' => ROOT . DS . 'composer.phar',
- 'help' => 'The path to the composer executable.'
+ 'help' => 'The path to the composer executable.',
])->removeOption('plugin');
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php b/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php
index edd6009d6..c13b2cd41 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php
@@ -32,7 +32,7 @@ abstract class SimpleBakeTask extends BakeTask
*/
public $tasks = [
'Bake.BakeTemplate',
- 'Bake.Test'
+ 'Bake.Test',
];
/**
@@ -144,10 +144,10 @@ public function getOptionParser()
'Name of the %s to bake. Can use Plugin.name to bake %s files into plugins.',
$name,
$name
- )
+ ),
])->addOption('no-test', [
'boolean' => true,
- 'help' => 'Do not generate a test skeleton.'
+ 'help' => 'Do not generate a test skeleton.',
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php b/app/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php
index f89d042e9..3bb28b426 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php
@@ -38,7 +38,7 @@ class TemplateTask extends BakeTask
*/
public $tasks = [
'Bake.Model',
- 'Bake.BakeTemplate'
+ 'Bake.BakeTemplate',
];
/**
@@ -279,7 +279,7 @@ protected function _loadController()
$modelObject = TableRegistry::getTableLocator()->get($this->modelName);
} else {
$modelObject = TableRegistry::getTableLocator()->get($this->modelName, [
- 'connectionName' => $this->connection
+ 'connectionName' => $this->connection,
]);
}
@@ -398,20 +398,20 @@ public function getOptionParser()
$parser->setDescription(
'Bake views for a controller, using built-in or custom templates. '
)->addArgument('controller', [
- 'help' => 'Name of the controller views to bake. You can use Plugin.name as a shortcut for plugin baking.'
+ 'help' => 'Name of the controller views to bake. You can use Plugin.name as a shortcut for plugin baking.',
])->addArgument('action', [
- 'help' => "Will bake a single action's file. core templates are (index, add, edit, view)"
+ 'help' => "Will bake a single action's file. core templates are (index, add, edit, view)",
])->addArgument('alias', [
- 'help' => 'Will bake the template in but create the filename after .'
+ 'help' => 'Will bake the template in but create the filename after .',
])->addOption('controller', [
- 'help' => 'The controller name if you have a controller that does not follow conventions.'
+ 'help' => 'The controller name if you have a controller that does not follow conventions.',
])->addOption('prefix', [
'help' => 'The routing prefix to generate views for.',
])->addOption('index-columns', [
'help' => 'Limit for the number of index columns',
- 'default' => 0
+ 'default' => 0,
])->addSubcommand('all', [
- 'help' => '[optional] Bake all CRUD action views for all controllers. Requires models and controllers to exist.'
+ 'help' => '[optional] Bake all CRUD action views for all controllers. Requires models and controllers to exist.',
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Shell/Task/TestTask.php b/app/vendor/cakephp/bake/src/Shell/Task/TestTask.php
index a84c75f18..e6dacdc5d 100644
--- a/app/vendor/cakephp/bake/src/Shell/Task/TestTask.php
+++ b/app/vendor/cakephp/bake/src/Shell/Task/TestTask.php
@@ -217,7 +217,7 @@ protected function _getClassOptions($namespace)
*
* @param string $type Type of object to bake test case for ie. Model, Controller
* @param string $className the 'cake name' for the class ie. Posts for the PostsController
- * @return string|bool
+ * @return string|false
*/
public function bake($type, $className)
{
@@ -323,7 +323,7 @@ public function buildTestSubject($type, $class)
$instance = TableRegistry::getTableLocator()->get($name);
} else {
$instance = TableRegistry::getTableLocator()->get($name, [
- 'connectionName' => $this->connection
+ 'connectionName' => $this->connection,
]);
}
} elseif ($type === 'Controller') {
@@ -487,7 +487,7 @@ protected function _processController($subject)
protected function _addFixture($name)
{
if ($this->plugin) {
- $prefix = 'plugin.' . Inflector::underscore($this->plugin) . '.';
+ $prefix = 'plugin.' . $this->plugin . '.';
} else {
$prefix = 'app.';
}
@@ -582,12 +582,12 @@ public function generateProperties($type, $subject, $fullClassName)
$properties[] = [
'description' => 'Request mock',
'type' => '\Cake\Http\ServerRequest|\PHPUnit_Framework_MockObject_MockObject',
- 'name' => 'request'
+ 'name' => 'request',
];
$properties[] = [
'description' => 'Response mock',
'type' => '\Cake\Http\Response|\PHPUnit_Framework_MockObject_MockObject',
- 'name' => 'response'
+ 'name' => 'response',
];
break;
@@ -596,7 +596,7 @@ public function generateProperties($type, $subject, $fullClassName)
$properties[] = [
'description' => 'ConsoleIo mock',
'type' => '\Cake\Console\ConsoleIo|\PHPUnit_Framework_MockObject_MockObject',
- 'name' => 'io'
+ 'name' => 'io',
];
break;
@@ -604,12 +604,12 @@ public function generateProperties($type, $subject, $fullClassName)
$properties[] = [
'description' => 'ConsoleOutput stub',
'type' => '\Cake\TestSuite\Stub\ConsoleOutput',
- 'name' => 'stub'
+ 'name' => 'stub',
];
$properties[] = [
'description' => 'ConsoleIo mock',
'type' => '\Cake\Console\ConsoleIo',
- 'name' => 'io'
+ 'name' => 'io',
];
break;
}
@@ -618,7 +618,7 @@ public function generateProperties($type, $subject, $fullClassName)
$properties[] = [
'description' => 'Test subject',
'type' => '\\' . $fullClassName,
- 'name' => $subject
+ 'name' => $subject,
];
}
@@ -710,19 +710,19 @@ public function getOptionParser()
' controller, model, helper, component or behavior.',
'choices' => $types,
])->addArgument('name', [
- 'help' => 'An existing class to bake tests for.'
+ 'help' => 'An existing class to bake tests for.',
])->addOption('fixtures', [
- 'help' => 'A comma separated list of fixture names you want to include.'
+ 'help' => 'A comma separated list of fixture names you want to include.',
])->addOption('no-fixture', [
'boolean' => true,
'default' => false,
- 'help' => 'Select if you want to bake without fixture.'
+ 'help' => 'Select if you want to bake without fixture.',
])->addOption('prefix', [
'default' => false,
- 'help' => 'Use when baking tests for prefixed controllers.'
+ 'help' => 'Use when baking tests for prefixed controllers.',
])->addOption('all', [
'boolean' => true,
- 'help' => 'Bake all classes of the given type'
+ 'help' => 'Bake all classes of the given type',
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Command/command.twig b/app/vendor/cakephp/bake/src/Template/Bake/Command/command.twig
index a0e4ccf49..f41ab6562 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Command/command.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Command/command.twig
@@ -26,7 +26,6 @@ use Cake\Console\ConsoleOptionParser;
*/
class {{ name }}Command extends Command
{
-
/**
* Hook method for defining this command's option parser.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Controller/component.twig b/app/vendor/cakephp/bake/src/Template/Bake/Controller/component.twig
index 65ba0b97f..dce0e9d68 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Controller/component.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Controller/component.twig
@@ -24,7 +24,6 @@ use Cake\Controller\ComponentRegistry;
*/
class {{ name }}Component extends Component
{
-
/**
* Default configuration.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Controller/controller.twig b/app/vendor/cakephp/bake/src/Template/Bake/Controller/controller.twig
index 9558878aa..47097329f 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Controller/controller.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Controller/controller.twig
@@ -44,14 +44,21 @@ class {{ name }}Controller extends AppController
{% set helpers = Bake.arrayProperty('helpers', helpers, {'indent': false})|raw %}
{% if helpers|trim %}
{{- helpers|raw }}
-{% endif %}
+{% if components %}
+{% endif %}
+{% endif %}
{%- set components = Bake.arrayProperty('components', components, {'indent': false})|raw %}
{% if components|trim %}
{{- components|raw }}
-{% endif %}
+{% if actions %}
+{% endif %}
+{% endif %}
{%- for action in actions %}
+{% if loop.index > 1 %}
+
+{% endif %}
{%- element 'Controller/' ~ action %}
{% endfor %}
}
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig
index 1c67f5e20..dc7c0f67d 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/add.twig
@@ -14,7 +14,6 @@
*/
#}
{% set compact = ["'#{singularName}'"] %}
-
/**
* Add method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig
index 2fbbf6db1..69c0cfc58 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/delete.twig
@@ -13,7 +13,6 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
#}
-
/**
* Delete method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig
index d06cb9c77..82e9be313 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/edit.twig
@@ -16,18 +16,17 @@
{% set belongsTo = Bake.aliasExtractor(modelObj, 'BelongsTo') %}
{% set belongsToMany = Bake.aliasExtractor(modelObj, 'belongsToMany') %}
{% set compact = ["'#{singularName}'"] %}
-
/**
* Edit method
*
* @param string|null $id {{ singularHumanName }} id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
- * @throws \Cake\Network\Exception\NotFoundException When record not found.
+ * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
${{ singularName }} = $this->{{ currentModelName }}->get($id, [
- 'contain' => [{{ Bake.stringifyList(belongsToMany, {'indent': false})|raw }}]
+ 'contain' => [{{ Bake.stringifyList(belongsToMany, {'indent': false})|raw }}],
]);
if ($this->request->is(['patch', 'post', 'put'])) {
${{ singularName }} = $this->{{ currentModelName }}->patchEntity(${{ singularName }}, $this->request->getData());
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig
index 181e830b4..9f98e0d9d 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/index.twig
@@ -13,18 +13,17 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
#}
-
/**
* Index method
*
- * @return \Cake\Http\Response|void
+ * @return \Cake\Http\Response|null
*/
public function index()
{
{% set belongsTo = Bake.aliasExtractor(modelObj, 'BelongsTo') %}
{% if belongsTo %}
$this->paginate = [
- 'contain' => [{{ Bake.stringifyList(belongsTo, {'indent': false})|raw }}]
+ 'contain' => [{{ Bake.stringifyList(belongsTo, {'indent': false})|raw }}],
];
{% endif %}
${{ pluralName }} = $this->paginate($this->{{ currentModelName }});
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig
index ee473edad..97836e0a6 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/login.twig
@@ -13,7 +13,6 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
#}
-
/**
* Login method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig
index facbd2fe6..4a6475740 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/logout.twig
@@ -13,7 +13,6 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
#}
-
/**
* Logout method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig
index 7091ba4a1..94e2cf0ae 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/Controller/view.twig
@@ -17,18 +17,17 @@
{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'BelongsToMany')) %}
{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'HasOne')) %}
{% set allAssociations = allAssociations|merge(Bake.aliasExtractor(modelObj, 'HasMany')) %}
-
/**
* View method
*
* @param string|null $id {{ singularHumanName }} id.
- * @return \Cake\Http\Response|void
+ * @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
${{ singularName }} = $this->{{ currentModelName }}->get($id, [
- 'contain' => [{{ Bake.stringifyList(allAssociations, {'indent': false})|raw }}]
+ 'contain' => [{{ Bake.stringifyList(allAssociations, {'indent': false})|raw }}],
]);
$this->set('{{ singularName }}', ${{ singularName }});
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig b/app/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig
index d177d81a6..ff5bd9fe1 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Element/array_property.twig
@@ -1,4 +1,3 @@
-
/**
* {{ name|humanize }}
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Form/form.twig b/app/vendor/cakephp/bake/src/Template/Bake/Form/form.twig
index 835c42c6e..32bd7d513 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Form/form.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Form/form.twig
@@ -48,7 +48,7 @@ class {{ name }}Form extends Form
}
/**
- * Defines what to execute once the From is being processed
+ * Defines what to execute once the Form is processed
*
* @param array $data Form data.
* @return bool
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Mailer/mailer.twig b/app/vendor/cakephp/bake/src/Template/Bake/Mailer/mailer.twig
index 621e9d6fe..75652dd5e 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Mailer/mailer.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Mailer/mailer.twig
@@ -23,11 +23,10 @@ use Cake\Mailer\Mailer;
*/
class {{ name }}Mailer extends Mailer
{
-
/**
* Mailer's name.
*
* @var string
*/
- static public $name = '{{ name }}';
+ public static $name = '{{ name }}';
}
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Middleware/middleware.twig b/app/vendor/cakephp/bake/src/Template/Bake/Middleware/middleware.twig
index d7e80c6a3..17b858b77 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Middleware/middleware.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Middleware/middleware.twig
@@ -24,7 +24,6 @@ use Psr\Http\Message\ServerRequestInterface;
*/
class {{ name }}Middleware
{
-
/**
* Invoke method.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Model/behavior.twig b/app/vendor/cakephp/bake/src/Template/Bake/Model/behavior.twig
index 3f42750ca..211b56064 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Model/behavior.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Model/behavior.twig
@@ -24,7 +24,6 @@ use Cake\ORM\Table;
*/
class {{ name }}Behavior extends Behavior
{
-
/**
* Default configuration.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Model/entity.twig b/app/vendor/cakephp/bake/src/Template/Bake/Model/entity.twig
index e09794a3d..9618d8c94 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Model/entity.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Model/entity.twig
@@ -32,7 +32,6 @@ use Cake\ORM\Entity;
class {{ name }} extends Entity
{
{% if accessible %}
-
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
@@ -44,9 +43,10 @@ class {{ name }} extends Entity
*/
protected $_accessible = [{{ Bake.stringifyList(accessible, {'quotes': false})|raw }}];
{% endif %}
+{% if accessible and hidden %}
+{% endif %}
{%- if hidden %}
-
/**
* Fields that are excluded from JSON versions of the entity.
*
@@ -54,8 +54,4 @@ class {{ name }} extends Entity
*/
protected $_hidden = [{{ Bake.stringifyList(hidden)|raw }}];
{% endif %}
-
-{%- if not accessible and not hidden %}
-
-{% endif %}
}
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Model/table.twig b/app/vendor/cakephp/bake/src/Template/Bake/Model/table.twig
index 94ad17cb9..34c7950f0 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Model/table.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Model/table.twig
@@ -23,7 +23,6 @@ namespace {{ namespace }}\Model\Table;
{{ DocBlock.classDescription(name, 'Model', annotations)|raw }}
class {{ name }}Table extends Table
{
-
/**
* Initialize method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig
index bc959c533..2bcbfb6a9 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/.gitignore.twig
@@ -1,3 +1,4 @@
/composer.lock
/phpunit.xml
/vendor
+config/Migrations/schema-dump-default.lock
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig
index 8ede8ffc0..0763927b5 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/README.md.twig
@@ -17,7 +17,7 @@
## Installation
-You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
+You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).
The recommended way to install composer packages is:
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig
index cc31f7e37..2653e666e 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/phpunit.xml.dist.twig
@@ -18,7 +18,6 @@
colors="true"
processIsolation="false"
stopOnFailure="false"
- syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>
@@ -35,9 +34,9 @@
-
+
-
+
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig
index d06ea6823..2f82948ae 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/src/Controller/AppController.php.twig
@@ -21,5 +21,4 @@ use {{ baseNamespace }}\Controller\AppController as BaseController;
class AppController extends BaseController
{
-
}
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/tests/bootstrap.php.twig b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/tests/bootstrap.php.twig
index 32ca2be72..c8c3108f7 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Plugin/tests/bootstrap.php.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Plugin/tests/bootstrap.php.twig
@@ -39,9 +39,17 @@ unset($findRoot);
chdir($root);
+require_once $root . '/vendor/autoload.php';
+
+/**
+ * Define fallback values for required constants and configuration.
+ * To customize constants and configuration remove this require
+ * and define the data required by your plugin here.
+ */
+require_once $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';
+
if (file_exists($root . '/config/bootstrap.php')) {
require $root . '/config/bootstrap.php';
return;
}
-require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Shell/helper.twig b/app/vendor/cakephp/bake/src/Template/Bake/Shell/helper.twig
index a9284d560..7488d671b 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Shell/helper.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Shell/helper.twig
@@ -23,7 +23,6 @@ use Cake\Console\Helper;
*/
class {{ name }}Helper extends Helper
{
-
/**
* Output method.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig b/app/vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig
index c0c16b8e9..dbd438304 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Shell/shell.twig
@@ -23,7 +23,6 @@ use Cake\Console\Shell;
*/
class {{ name }}Shell extends Shell
{
-
/**
* Manage the available sub-commands along with their arguments and help
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig b/app/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig
index 7000f5ddd..5c7b7fce6 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/Shell/task.twig
@@ -22,7 +22,6 @@ use Cake\Console\Shell;
*/
class {{ name }}Task extends Shell
{
-
/**
* Manage the available sub-commands along with their arguments and help
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/View/cell.twig b/app/vendor/cakephp/bake/src/Template/Bake/View/cell.twig
index 741767341..403ffe3e3 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/View/cell.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/View/cell.twig
@@ -23,7 +23,6 @@ use Cake\View\Cell;
*/
class {{ name }}Cell extends Cell
{
-
/**
* List of valid options that can be passed into this
* cell's constructor.
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/View/helper.twig b/app/vendor/cakephp/bake/src/Template/Bake/View/helper.twig
index cddf60aac..dac43f2b8 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/View/helper.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/View/helper.twig
@@ -24,7 +24,6 @@ use Cake\View\View;
*/
class {{ name }}Helper extends Helper
{
-
/**
* Default configuration.
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/tests/fixture.twig b/app/vendor/cakephp/bake/src/Template/Bake/tests/fixture.twig
index 73061dadf..63e5b4012 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/tests/fixture.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/tests/fixture.twig
@@ -24,12 +24,10 @@ use Cake\TestSuite\Fixture\TestFixture;
/**
* {{ name }}Fixture
- *
*/
class {{ name }}Fixture extends TestFixture
{
{% if table %}
-
/**
* Table name
*
@@ -39,17 +37,16 @@ class {{ name }}Fixture extends TestFixture
{% endif %}
{%- if import %}
-
/**
* Import
*
* @var array
*/
public $import = {{ import|raw }};
+
{% endif %}
{%- if schema %}
-
/**
* Fields
*
@@ -61,7 +58,6 @@ class {{ name }}Fixture extends TestFixture
{% endif %}
{%- if records %}
-
/**
* Init method
*
diff --git a/app/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig b/app/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig
index d652502df..3f50cd40b 100644
--- a/app/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig
+++ b/app/vendor/cakephp/bake/src/Template/Bake/tests/test_case.twig
@@ -19,13 +19,14 @@
{% set isShell = type|lower == 'shell' %}
{% set isCommand = type|lower == 'command' %}
{% if isController %}
- {%- set superClassName = 'IntegrationTestCase' %}
+ {%- set traitName = 'IntegrationTestTrait' %}
{% elseif isShell or isCommand %}
- {%- set superClassName = 'ConsoleIntegrationTestCase' %}
-{% else %}
- {%- set superClassName = 'TestCase' %}
+ {%- set traitName = 'ConsoleIntegrationTestTrait' %}
+{% endif %}
+{%- set uses = uses|merge(["Cake\\TestSuite\\TestCase"]) %}
+{% if traitName %}
+ {%- set uses = uses|merge(["Cake\\TestSuite\\#{traitName}"]) %}
{% endif %}
-{%- set uses = uses|merge(["Cake\\TestSuite\\#{superClassName}"]) %}
{%- set uses = uses|sort %}
1 %}
+{% endif %}
/**
* {{ propertyInfo.description }}
*
* @var {{ propertyInfo.type }}
*/
public ${{ propertyInfo.name }}{% if propertyInfo.value is defined and propertyInfo.value %} = {{ propertyInfo.value }}{% endif %};
+{% if loop.last and (fixtures or construction or methods) %}
+
+{% endif %}
{% endfor %}
{% endif %}
{%- if fixtures %}
-
/**
* Fixtures
*
* @var array
*/
public $fixtures = [{{ Bake.stringifyList(fixtures|values)|raw }}];
+{% if construction or methods %}
+
+{% endif %}
{% endif %}
{%- if construction %}
-
/**
* setUp method
*
@@ -97,11 +114,16 @@ class {{ className }}Test extends {{ superClassName }}
parent::tearDown();
}
+{% if methods %}
+
+{% endif %}
{% endif %}
{% endif %}
{%- for method in methods %}
+{% if loop.index > 1 %}
+{% endif %}
/**
* Test {{ method }} method
*
@@ -114,7 +136,9 @@ class {{ className }}Test extends {{ superClassName }}
{% endfor %}
{%- if not methods %}
+{%- if traitName or properties or fixtures or construction or methods %}
+{% endif %}
/**
* Test initial setup
*
diff --git a/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php b/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php
index 739d5ad15..ab0c56e6c 100644
--- a/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php
+++ b/app/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php
@@ -19,7 +19,6 @@
trait CommonOptionsTrait
{
-
/**
* Set common options used by all bake tasks.
*
@@ -38,20 +37,20 @@ protected function _setCommonOptions($parser)
$parser->addOption('plugin', [
'short' => 'p',
- 'help' => 'Plugin to bake into.'
+ 'help' => 'Plugin to bake into.',
])->addOption('force', [
'short' => 'f',
'boolean' => true,
- 'help' => 'Force overwriting existing files without prompting.'
+ 'help' => 'Force overwriting existing files without prompting.',
])->addOption('connection', [
'short' => 'c',
'default' => 'default',
- 'help' => 'The datasource connection to get data from.'
+ 'help' => 'The datasource connection to get data from.',
])->addOption('theme', [
'short' => 't',
'help' => 'The theme to use when baking code.',
'default' => Configure::read('Bake.theme'),
- 'choices' => $bakeThemes
+ 'choices' => $bakeThemes,
]);
return $parser;
diff --git a/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php b/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php
index 058ab1222..573ecacdb 100644
--- a/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php
+++ b/app/vendor/cakephp/bake/src/Utility/Model/AssociationFilter.php
@@ -20,11 +20,9 @@
/**
* Utility class to filter Model Table associations
- *
*/
class AssociationFilter
{
-
/**
* Detect existing belongsToMany associations and cleanup the hasMany aliases based on existing
* belongsToMany associations provided
diff --git a/app/vendor/cakephp/bake/src/View/BakeView.php b/app/vendor/cakephp/bake/src/View/BakeView.php
index 61cc096a3..aebf5592c 100644
--- a/app/vendor/cakephp/bake/src/View/BakeView.php
+++ b/app/vendor/cakephp/bake/src/View/BakeView.php
@@ -51,7 +51,7 @@ class BakeView extends TwigView
protected $_defaultConfig = [
'phpTagReplacements' => [
'' => "' => "CakePHPBakeCloseTag>"
+ '?>' => "CakePHPBakeCloseTag>",
],
'replacements' => [
'/\n[ \t]+<%-( |$)/' => "\n<% ",
@@ -59,8 +59,8 @@ class BakeView extends TwigView
'/<%=(.*)\%>\n(.)/' => "<%=$1%>\n\n$2",
'<%=' => '=',
'<%' => '' => '?>'
- ]
+ '%>' => '?>',
+ ],
];
/**
@@ -142,10 +142,10 @@ public function render($view = null, $layout = null)
$this->_currentType = static::TYPE_TEMPLATE;
$this->dispatchEvent('View.beforeRender', [$viewFileName]);
- $this->dispatchEvent('View.beforeRender.' . $templateEventName, [$viewFileName]);
+ $this->dispatchEvent('View.beforeRender' . $templateEventName, [$viewFileName]);
$this->Blocks->set('content', $this->_render($viewFileName));
$this->dispatchEvent('View.afterRender', [$viewFileName]);
- $this->dispatchEvent('View.afterRender.' . $templateEventName, [$viewFileName]);
+ $this->dispatchEvent('View.afterRender' . $templateEventName, [$viewFileName]);
if ($layout === null) {
$layout = $this->layout;
diff --git a/app/vendor/cakephp/bake/src/View/Helper/BakeHelper.php b/app/vendor/cakephp/bake/src/View/Helper/BakeHelper.php
index 191f797ce..74e028bf1 100644
--- a/app/vendor/cakephp/bake/src/View/Helper/BakeHelper.php
+++ b/app/vendor/cakephp/bake/src/View/Helper/BakeHelper.php
@@ -47,7 +47,7 @@ public function arrayProperty($name, array $value = [], array $options = [])
}
$options += [
'name' => $name,
- 'value' => $value
+ 'value' => $value,
];
return $this->_View->element('array_property', $options);
@@ -62,12 +62,13 @@ public function arrayProperty($name, array $value = [], array $options = [])
*/
public function stringifyList(array $list, array $options = [])
{
- $options += [
+ $defaults = [
'indent' => 2,
'tab' => ' ',
- 'trailingComma' => false,
- 'quotes' => true
+ 'trailingComma' => (!isset($options['indent']) || $options['indent']) ? true : false,
+ 'quotes' => true,
];
+ $options += $defaults;
if (!$list) {
return '';
@@ -179,7 +180,7 @@ public function classInfo($class, $type, $suffix)
'plugin' => $plugin,
'class' => $name . $suffix,
'name' => $name,
- 'fullName' => $class
+ 'fullName' => $class,
];
}
@@ -246,14 +247,16 @@ public function getViewFieldsData($fields, $schema, $associations)
if (isset($associationFields[$field])) {
return 'string';
}
- if (in_array($type, [
+ if (
+ in_array($type, [
'decimal',
'biginteger',
'integer',
'float',
'smallinteger',
'tinyinteger',
- ])) {
+ ])
+ ) {
return 'number';
}
if (in_array($type, ['date', 'time', 'datetime', 'timestamp'])) {
@@ -338,30 +341,6 @@ public function getValidationMethods($field, $rules)
$rule['provider']
);
}
-
- if (isset($rule['allowEmpty'])) {
- if (is_string($rule['allowEmpty'])) {
- $validationMethods[] = sprintf(
- "->allowEmpty('%s', '%s')",
- $field,
- $rule['allowEmpty']
- );
- } elseif ($rule['allowEmpty']) {
- $validationMethods[] = sprintf(
- "->allowEmpty('%s')",
- $field
- );
- } else {
- $validationMethods[] = sprintf(
- "->requirePresence('%s', 'create')",
- $field
- );
- $validationMethods[] = sprintf(
- "->notEmpty('%s')",
- $field
- );
- }
- }
}
return $validationMethods;
diff --git a/app/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php b/app/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php
index de919a8ac..2de3a167a 100644
--- a/app/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php
+++ b/app/vendor/cakephp/bake/src/View/Helper/DocBlockHelper.php
@@ -13,6 +13,9 @@
*/
class DocBlockHelper extends Helper
{
+ /**
+ * @var bool Whether to add a blank line between different class annotations
+ */
protected $_annotationSpacing = true;
/**
@@ -29,14 +32,18 @@ public function classDescription($className, $classType, array $annotations)
$lines = [];
if ($className && $classType) {
$lines[] = "{$className} {$classType}";
- $lines[] = "";
+ }
+
+ if ($annotations && $lines) {
+ $lines[] = '';
}
$previous = false;
- foreach ($annotations as $ann) {
- if (strlen($ann) > 1 && $ann[0] === '@' && strpos($ann, ' ') > 0) {
- $type = substr($ann, 0, strpos($ann, ' '));
- if ($this->_annotationSpacing &&
+ foreach ($annotations as $annotation) {
+ if (strlen($annotation) > 1 && $annotation[0] === '@' && strpos($annotation, ' ') > 0) {
+ $type = substr($annotation, 0, strpos($annotation, ' '));
+ if (
+ $this->_annotationSpacing &&
$previous !== false &&
$previous !== $type
) {
@@ -44,7 +51,7 @@ public function classDescription($className, $classType, array $annotations)
}
$previous = $type;
}
- $lines[] = $ann;
+ $lines[] = $annotation;
}
$lines = array_merge(["/**"], (new Collection($lines))->map(function ($line) {
@@ -63,8 +70,10 @@ public function classDescription($className, $classType, array $annotations)
*/
public function associatedEntityTypeToHintType($type, Association $association)
{
- if ($association->type() === Association::MANY_TO_MANY ||
- $association->type() === Association::ONE_TO_MANY
+ $annotationType = $association->type();
+ if (
+ $annotationType === Association::MANY_TO_MANY ||
+ $annotationType === Association::ONE_TO_MANY
) {
return $type . '[]';
}
@@ -98,7 +107,12 @@ public function buildEntityPropertyHintTypeMap(array $propertySchema)
$properties = [];
foreach ($propertySchema as $property => $info) {
if ($info['kind'] === 'column') {
- $properties[$property] = $this->columnTypeToHintType($info['type']);
+ $type = $this->columnTypeToHintType($info['type']);
+ if (!empty($info['null'])) {
+ $type .= '|null';
+ }
+
+ $properties[$property] = $type;
}
}
@@ -236,14 +250,14 @@ public function buildTableAnnotations($associations, $associationInfo, $behavior
foreach ($assocs as $assoc) {
$typeStr = Inflector::camelize($type);
$tableFqn = $associationInfo[$assoc['alias']]['targetFqn'];
- $annotations[] = "@property {$tableFqn}|\Cake\ORM\Association\\{$typeStr} \${$assoc['alias']}";
+ $annotations[] = "@property {$tableFqn}&\Cake\ORM\Association\\{$typeStr} \${$assoc['alias']}";
}
}
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} get(\$primaryKey, \$options = [])";
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} newEntity(\$data = null, array \$options = [])";
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}[] newEntities(array \$data, array \$options = [])";
- $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}|bool save(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])";
- $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}|bool saveOrFail(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])";
+ $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}|false save(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])";
+ $annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} saveOrFail(\\Cake\\Datasource\\EntityInterface \$entity, \$options = [])";
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} patchEntity(\\Cake\\Datasource\\EntityInterface \$entity, array \$data, array \$options = [])";
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity}[] patchEntities(\$entities, array \$data, array \$options = [])";
$annotations[] = "@method \\{$namespace}\\Model\\Entity\\{$entity} findOrCreate(\$search, callable \$callback = null, \$options = [])";
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php
index 00ad9210f..f2ab05cdd 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesBakeTagsFixture.php
@@ -18,7 +18,6 @@
/**
* Short description for class.
- *
*/
class BakeArticlesBakeTagsFixture extends TestFixture
{
@@ -30,7 +29,7 @@ class BakeArticlesBakeTagsFixture extends TestFixture
public $fields = [
'bake_article_id' => ['type' => 'integer', 'null' => false],
'bake_tag_id' => ['type' => 'integer', 'null' => false],
- '_constraints' => ['UNIQUE_TAG' => ['type' => 'unique', 'columns' => ['bake_article_id', 'bake_tag_id']]]
+ '_constraints' => ['UNIQUE_TAG' => ['type' => 'unique', 'columns' => ['bake_article_id', 'bake_tag_id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php
index b3d351cd6..dd758ae81 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeArticlesFixture.php
@@ -18,7 +18,6 @@
/**
* BakeArticleFixture
- *
*/
class BakeArticlesFixture extends TestFixture
{
@@ -34,10 +33,10 @@ class BakeArticlesFixture extends TestFixture
'body' => 'text',
'rating' => ['type' => 'float', 'unsigned' => true, 'default' => 0.0, 'null' => false],
'score' => ['type' => 'decimal', 'unsigned' => true, 'default' => 0.0, 'null' => false],
- 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false],
+ 'published' => ['type' => 'boolean', 'length' => 1, 'default' => false, 'null' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php
index 730b2f41a..5ec27b45c 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeCarFixture.php
@@ -18,11 +18,9 @@
/**
* BakeCarFixture
- *
*/
class BakeCarFixture extends TestFixture
{
-
/**
* @var string
*/
@@ -41,7 +39,7 @@ class BakeCarFixture extends TestFixture
'published' => ['type' => 'boolean', 'length' => 1, 'default' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php
index d5d7119af..69a663d27 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeCommentsFixture.php
@@ -18,7 +18,6 @@
/**
* BakeCommentFixture fixture for testing bake
- *
*/
class BakeCommentsFixture extends TestFixture
{
@@ -33,9 +32,9 @@ class BakeCommentsFixture extends TestFixture
'bake_user_id' => ['type' => 'integer', 'null' => false],
'comment' => 'text',
'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
- 'created' => 'datetime',
- 'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['otherid']]]
+ 'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
+ 'updated' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['otherid']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php
index 6dd33d6ee..5f3209277 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeTagsFixture.php
@@ -18,7 +18,6 @@
/**
* Short description for class.
- *
*/
class BakeTagsFixture extends TestFixture
{
@@ -32,7 +31,7 @@ class BakeTagsFixture extends TestFixture
'tag' => ['type' => 'string', 'null' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php
index ea68492e7..ef293f24c 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateAuthorsFixture.php
@@ -22,7 +22,6 @@
*/
class BakeTemplateAuthorsFixture extends TestFixture
{
-
/**
* Avoid overriding core.authors
* @var string
@@ -44,7 +43,7 @@ class BakeTemplateAuthorsFixture extends TestFixture
'account_balance' => ['type' => 'decimal', 'null' => true, 'precision' => 2, 'length' => 12],
'created' => 'datetime',
'modified' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php
index 0633e9b40..84ae5080b 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateProfilesFixture.php
@@ -24,7 +24,6 @@
*/
class BakeTemplateProfilesFixture extends TestFixture
{
-
/**
* @var string
*/
@@ -40,7 +39,7 @@ class BakeTemplateProfilesFixture extends TestFixture
'author_id' => ['type' => 'integer', 'null' => false],
'nick' => ['type' => 'string', 'null' => false],
'avatar' => ['type' => 'string', 'default' => null],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php
index 8b486b94e..2a4f5be81 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BakeTemplateRolesFixture.php
@@ -34,7 +34,7 @@ class BakeTemplateRolesFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php
index f0ead760b..092815298 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/BinaryTestsFixture.php
@@ -21,7 +21,6 @@
*/
class BinaryTestsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -29,8 +28,9 @@ class BinaryTestsFixture extends TestFixture
*/
public $fields = [
'id' => ['type' => 'integer'],
+ 'byte' => ['type' => 'binary', 'length' => 1],
'data' => ['type' => 'binary', 'length' => 300],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php
index ff56bafea..5c95b2b3a 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/CategoriesFixture.php
@@ -18,11 +18,9 @@
/**
* CategoriesFixture
- *
*/
class CategoriesFixture extends TestFixture
{
-
/**
* Fields
*
@@ -53,7 +51,7 @@ class CategoriesFixture extends TestFixture
[
'created' => '2015-12-30 18:11:36',
'modified' => '2015-12-30 18:11:36',
- 'name' => 'Lorem ipsum dolor sit amet'
+ 'name' => 'Lorem ipsum dolor sit amet',
],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php
index ce781ec65..beace82fb 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/CategoriesProductsFixture.php
@@ -18,11 +18,9 @@
/**
* CategoriesProductsFixture
- *
*/
class CategoriesProductsFixture extends TestFixture
{
-
/**
* Fields
*
@@ -50,7 +48,7 @@ class CategoriesProductsFixture extends TestFixture
public $records = [
[
'category_id' => 1,
- 'product_id' => 1
+ 'product_id' => 1,
],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php
index 9f12e24ff..21ff25181 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/CategoryThreadsFixture.php
@@ -21,7 +21,6 @@
*/
class CategoryThreadsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -35,7 +34,7 @@ class CategoryThreadsFixture extends TestFixture
'rght' => ['type' => 'integer', 'unsigned' => true],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -50,6 +49,6 @@ class CategoryThreadsFixture extends TestFixture
['parent_id' => 3, 'name' => 'Category 1.1.2', 'lft' => 4, 'rght' => 7, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'],
['parent_id' => 4, 'name' => 'Category 1.1.1.1', 'lft' => 5, 'rght' => 6, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'],
['parent_id' => 5, 'name' => 'Category 2', 'lft' => 10, 'rght' => 13, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'],
- ['parent_id' => 6, 'name' => 'Category 2.1', 'lft' => 11, 'rght' => 12, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31']
+ ['parent_id' => 6, 'name' => 'Category 2.1', 'lft' => 11, 'rght' => 12, 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php
index 62883c221..620315650 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/DatatypesFixture.php
@@ -21,7 +21,6 @@
*/
class DatatypesFixture extends TestFixture
{
-
/**
* Fields property
*
@@ -36,7 +35,7 @@ class DatatypesFixture extends TestFixture
'tiny_int' => ['type' => 'tinyinteger'],
'bool' => ['type' => 'boolean', 'null' => false, 'default' => false],
'uuid' => ['type' => 'uuid'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php
index 6d0b08841..976fbe0a1 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/InvitationsFixture.php
@@ -18,7 +18,6 @@
/**
* InvitationsFixture
- *
*/
class InvitationsFixture extends TestFixture
{
@@ -50,7 +49,7 @@ class InvitationsFixture extends TestFixture
'update' => 'noAction',
'delete' => 'noAction',
],
- ]
+ ],
];
/**
@@ -63,6 +62,6 @@ class InvitationsFixture extends TestFixture
'sender_id' => 1,
'receiver_id' => 1,
'body' => 'Try it out!',
- ]
+ ],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php b/app/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php
index 6070da77e..cd5ffd27a 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/NumberTreesFixture.php
@@ -23,7 +23,6 @@
*/
class NumberTreesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -36,7 +35,7 @@ class NumberTreesFixture extends TestFixture
'lft' => ['type' => 'integer', 'unsigned' => true],
'rght' => ['type' => 'integer', 'unsigned' => true],
'depth' => ['type' => 'integer', 'unsigned' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php
index 068c9ad5f..aa2cda105 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/OldProductsFixture.php
@@ -18,11 +18,9 @@
/**
* OldProductsFixture
- *
*/
class OldProductsFixture extends TestFixture
{
-
/**
* Fields
*
@@ -53,7 +51,7 @@ class OldProductsFixture extends TestFixture
[
'created' => '2015-12-30 18:11:36',
'modified' => '2015-12-30 18:11:36',
- 'name' => 'Lorem ipsum dolor sit amet'
+ 'name' => 'Lorem ipsum dolor sit amet',
],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php
index 6f480dc26..f2f9b6834 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/ProductVersionsFixture.php
@@ -18,11 +18,9 @@
/**
* ProductVersionsFixture
- *
*/
class ProductVersionsFixture extends TestFixture
{
-
/**
* Fields
*
@@ -51,7 +49,7 @@ class ProductVersionsFixture extends TestFixture
public $records = [
[
'product_id' => 1,
- 'version' => '2015-12-30 18:11:37'
+ 'version' => '2015-12-30 18:11:37',
],
];
}
diff --git a/app/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php b/app/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php
index 2076f2119..c701431b9 100644
--- a/app/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php
+++ b/app/vendor/cakephp/bake/tests/Fixture/ProductsFixture.php
@@ -18,11 +18,9 @@
/**
* ProductsFixture
- *
*/
class ProductsFixture extends TestFixture
{
-
/**
* Fields
*
@@ -53,7 +51,7 @@ class ProductsFixture extends TestFixture
[
'created' => '2015-12-30 18:11:37',
'modified' => '2015-12-30 18:11:37',
- 'name' => 'Lorem ipsum dolor sit amet'
+ 'name' => 'Lorem ipsum dolor sit amet',
],
];
}
diff --git a/app/vendor/cakephp/bake/tests/bootstrap.php b/app/vendor/cakephp/bake/tests/bootstrap.php
index 1d9640033..9c29d1c35 100644
--- a/app/vendor/cakephp/bake/tests/bootstrap.php
+++ b/app/vendor/cakephp/bake/tests/bootstrap.php
@@ -56,8 +56,4 @@
}
ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]);
-Plugin::load('Bake', [
- 'path' => dirname(dirname(__FILE__)) . DS,
-]);
-
-class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
+Plugin::getCollection()->add(new \Bake\Plugin());
diff --git a/app/vendor/cakephp/cakephp-codesniffer/.editorconfig b/app/vendor/cakephp/cakephp-codesniffer/.editorconfig
index 706190175..e43d09569 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/.editorconfig
+++ b/app/vendor/cakephp/cakephp-codesniffer/.editorconfig
@@ -14,5 +14,4 @@ trim_trailing_whitespace = true
end_of_line = crlf
[*.yml]
-indent_style = space
indent_size = 2
diff --git a/app/vendor/cakephp/cakephp-codesniffer/.gitignore b/app/vendor/cakephp/cakephp-codesniffer/.gitignore
index a14dfb32d..217b42f4c 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/.gitignore
+++ b/app/vendor/cakephp/cakephp-codesniffer/.gitignore
@@ -3,3 +3,4 @@
tags
composer.lock
vendor/
+/.idea/
diff --git a/app/vendor/cakephp/cakephp-codesniffer/.travis.yml b/app/vendor/cakephp/cakephp-codesniffer/.travis.yml
index c591d1461..4d2d14b6c 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/.travis.yml
+++ b/app/vendor/cakephp/cakephp-codesniffer/.travis.yml
@@ -1,29 +1,24 @@
language: php
php:
- - 7.1
- - 7.0
- - 5.4
- - 5.5
- 5.6
- 7.0
- 7.1
- 7.2
-
-sudo: false
+ - 7.3
+ - 7.4snapshot
matrix:
fast_finish: true
include:
- - php: 7.1
+ - php: 7.2
env: PHPCS=1
- allow_failures:
- - php: hhvm
+before_install:
+ - if [[ $TRAVIS_PHP_VERSION != "7.4snapshot" ]]; then phpenv config-rm xdebug.ini; fi
before_script:
- - composer self-update
- composer install --prefer-source
script:
@@ -34,5 +29,9 @@ script:
after_success:
- if [[ $PHPCS != 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then bash <(curl -s https://codecov.io/bash); fi
+cache:
+ directories:
+ - $HOME/.composer/cache
+
notifications:
email: false
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php
index 528019c18..799d737c7 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/DocBlockAlignmentSniff.php
@@ -50,7 +50,7 @@ public function process(File $phpcsFile, $stackPtr)
if ($fix === true) {
// Collect tokens to change indentation of
$tokensToIndent = [
- $stackPtr => $codeIndentation
+ $stackPtr => $codeIndentation,
];
$commentOpenLine = $tokens[$stackPtr]['line'];
$commentCloseLine = $tokens[$commentClose]['line'];
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php
index c1749faf9..d6fe498e9 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php
@@ -62,8 +62,8 @@ protected function isInheritDoc(File $phpcsFile, $stackPtr)
$end = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $start);
$content = $phpcsFile->getTokensAsString($start, ($end - $start));
- return preg_match('/{@inheritDoc}/i', $content) === 1;
- } // end isInheritDoc()
+ return preg_match('/{@inheritDoc}|@inheritDoc/i', $content) === 1;
+ }
/**
* Process the return comment of this function comment.
@@ -119,7 +119,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart)
$phpcsFile->addWarning($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn');
return;
- }//end if
+ }
$content = $tokens[($return + 2)]['content'];
if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) {
@@ -172,8 +172,10 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart)
continue;
}
- if ($tokens[$returnToken]['code'] === T_RETURN
+ if (
+ $tokens[$returnToken]['code'] === T_RETURN
|| $tokens[$returnToken]['code'] === T_YIELD
+ || $tokens[$returnToken]['code'] === T_YIELD_FROM
) {
break;
}
@@ -195,7 +197,7 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart)
// If return type is not void, there needs to be a return statement
// somewhere in the function that returns something.
if (!in_array('mixed', $typeNames, true) && !in_array('void', $typeNames, true)) {
- $returnToken = $phpcsFile->findNext([T_RETURN, T_YIELD], $stackPtr, $endToken);
+ $returnToken = $phpcsFile->findNext([T_RETURN, T_YIELD, T_YIELD_FROM], $stackPtr, $endToken);
if ($returnToken === false) {
$error = 'Function return type is not void, but function has no return statement';
$phpcsFile->addWarning($error, $return, 'InvalidNoReturn');
@@ -206,9 +208,8 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart)
$phpcsFile->addWarning($error, $returnToken, 'InvalidReturnNotVoid');
}
}
- }//end if
- }//end processReturn()
-
+ }
+ }
/**
* Process any throw tags that this function comment has.
@@ -258,7 +259,7 @@ protected function processThrows(File $phpcsFile, $stackPtr, $commentStart)
}
// Starts with a capital letter and ends with a fullstop.
- $firstChar = $comment{0};
+ $firstChar = $comment[0];
if (strtoupper($firstChar) !== $firstChar) {
$error = '@throws tag comment must start with a capital letter';
$phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNotCapital');
@@ -269,10 +270,9 @@ protected function processThrows(File $phpcsFile, $stackPtr, $commentStart)
$error = '@throws tag comment must end with a full stop';
$phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNoFullStop');
}
- }//end if
- }//end foreach
- }//end processThrows()
-
+ }
+ }
+ }
/**
* Process the function parameter comments.
@@ -354,18 +354,18 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
$error = 'Missing parameter comment';
$phpcsFile->addError($error, $tag, 'MissingParamComment');
$commentLines[] = ['comment' => ''];
- }//end if
+ }
} else {
$error = 'Missing parameter name';
$phpcsFile->addError($error, $tag, 'MissingParamName');
- }//end if
+ }
} else {
$error = 'Missing parameter type';
$phpcsFile->addError($error, $tag, 'MissingParamType');
- }//end if
+ }
$params[] = compact('tag', 'type', 'var', 'comment', 'commentLines', 'typeSpace', 'varSpace');
- }//end foreach
+ }
$realParams = $phpcsFile->getMethodParameters($stackPtr);
$foundParams = [];
@@ -399,11 +399,13 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
$content .= str_repeat(' ', $param['typeSpace']);
$content .= $param['var'];
$content .= str_repeat(' ', $param['varSpace']);
- $content .= $param['commentLines'][0]['comment'];
+ if (isset($param['commentLines'][0])) {
+ $content .= $param['commentLines'][0]['comment'];
+ }
$phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
}
}
- }//end foreach
+ }
if ($param['var'] === '') {
continue;
@@ -441,14 +443,14 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
// We must have an extra parameter comment.
$error = 'Superfluous parameter comment';
$phpcsFile->addError($error, $param['tag'], 'ExtraParamComment');
- }//end if
+ }
if ($param['comment'] === '') {
continue;
}
// Param comments must start with a capital letter and end with the full stop.
- $firstChar = $param['comment']{0};
+ $firstChar = $param['comment'][0];
if (preg_match('|\p{Lu}|u', $firstChar) === 0) {
$error = 'Parameter comment must start with a capital letter';
$phpcsFile->addWarning($error, $param['tag'], 'ParamCommentNotCapital');
@@ -459,7 +461,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
$error = 'Parameter comment must end with a full stop';
$phpcsFile->addWarning($error, $param['tag'], 'ParamCommentFullStop');
}
- }//end foreach
+ }
$realNames = [];
foreach ($realParams as $realParam) {
@@ -473,5 +475,5 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
$data = [$neededParam];
$phpcsFile->addWarning($error, $commentStart, 'MissingParamTag', $data);
}
- }//end processParams()
-}//end class
+ }
+}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
index 7fe7e31cc..bebba1c67 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php
@@ -42,7 +42,8 @@ public function process(File $phpcsFile, $stackPtr)
$prevLineTokens = [];
while ($current >= 0 && $tokens[$current]['line'] >= $previousLine) {
- if ($tokens[$current]['line'] == $previousLine
+ if (
+ $tokens[$current]['line'] == $previousLine
&& $tokens[$current]['type'] !== 'T_WHITESPACE'
&& $tokens[$current]['type'] !== 'T_COMMENT'
&& $tokens[$current]['type'] !== 'T_DOC_COMMENT_OPEN_TAG'
@@ -56,7 +57,8 @@ public function process(File $phpcsFile, $stackPtr)
$current--;
}
- if (isset($prevLineTokens[0])
+ if (
+ isset($prevLineTokens[0])
&& ($prevLineTokens[0] === 'T_OPEN_CURLY_BRACKET'
|| $prevLineTokens[0] === 'T_COLON'
|| $prevLineTokens[0] === 'T_OPEN_TAG')
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php
index 5e3020a9c..5e7693460 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/Formatting/UseInAlphabeticalOrderSniff.php
@@ -18,6 +18,7 @@
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
+use PHP_CodeSniffer\Util\Tokens;
/**
* Ensures all the use are in alphabetical order.
@@ -104,6 +105,16 @@ protected function _checkUseToken($phpcsFile, $stackPtr)
$tokens = $phpcsFile->getTokens();
+ $scope = 'use';
+ $useType = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
+ if ($useType !== false && $tokens[$useType]['code'] === T_STRING) {
+ $useContent = strtolower($tokens[$useType]['content']);
+ if ($useContent === 'function' || $useContent === 'const') {
+ $scope .= ' ' . $useContent;
+ $stackPtr = $useType + 1;
+ }
+ }
+
$content = '';
$end = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET], $stackPtr);
$useTokens = array_slice($tokens, $stackPtr, $end - $stackPtr, true);
@@ -116,9 +127,8 @@ protected function _checkUseToken($phpcsFile, $stackPtr)
// Check for class scoping on use. Traits should be
// ordered independently.
- $scope = 0;
if (!empty($token['conditions'])) {
- $scope = key($token['conditions']);
+ $scope .= key($token['conditions']);
}
$this->_uses[$scope][$content] = $stackPtr;
}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php
new file mode 100644
index 000000000..93c3998c9
--- /dev/null
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/PHP/CommaAfterArrayItemSniff.php
@@ -0,0 +1,73 @@
+= 70300;
+
+ /**
+ * @inheritDoc
+ */
+ public function register()
+ {
+ return [
+ T_OPEN_SHORT_ARRAY,
+ ];
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function process(File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+ $arrayToken = $tokens[$stackPtr];
+ $closeParenthesisPointer = $arrayToken['bracket_closer'];
+ $openParenthesisToken = $tokens[$arrayToken['bracket_opener']];
+ $closeParenthesisToken = $tokens[$closeParenthesisPointer];
+ if ($openParenthesisToken['line'] === $closeParenthesisToken['line']) {
+ return;
+ }
+
+ $previousToCloseParenthesisPointer = $phpcsFile->findPrevious(Tokens::$emptyTokens, $closeParenthesisPointer - 1, 0, true);
+ $previousToCloseParenthesisToken = $tokens[$previousToCloseParenthesisPointer];
+ if (
+ $previousToCloseParenthesisPointer === $arrayToken['bracket_opener']
+ || $previousToCloseParenthesisToken['code'] === T_COMMA
+ || $closeParenthesisToken['line'] === $previousToCloseParenthesisToken['line']
+ ) {
+ return;
+ }
+ if (!$this->enableAfterHeredoc && in_array($previousToCloseParenthesisToken['code'], [T_END_HEREDOC, T_END_NOWDOC], true)) {
+ return;
+ }
+ $fix = $phpcsFile->addFixableError(
+ 'Multi-line arrays must have a trailing comma after the last element.',
+ $previousToCloseParenthesisPointer,
+ 'MissingTrailingComma'
+ );
+ if (!$fix) {
+ return;
+ }
+
+ $phpcsFile->fixer->beginChangeset();
+ $phpcsFile->fixer->addContent($previousToCloseParenthesisPointer, ',');
+ $phpcsFile->fixer->endChangeset();
+ }
+}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php
index c2eaf78d7..667feed8a 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/EmptyLinesSniff.php
@@ -43,14 +43,17 @@ public function register()
public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if ($tokens[$stackPtr]['content'] === $phpcsFile->eolChar
- && isset($tokens[($stackPtr + 1)]) === true
- && $tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar
- && isset($tokens[($stackPtr + 2)]) === true
- && $tokens[($stackPtr + 2)]['content'] === $phpcsFile->eolChar
+ // If the current and next two tokens are newlines
+ // We can remove the next token (the first newline)
+ if (
+ $tokens[$stackPtr]['content'] === $phpcsFile->eolChar
+ && isset($tokens[$stackPtr + 1])
+ && $tokens[$stackPtr + 1]['content'] === $phpcsFile->eolChar
+ && isset($tokens[$stackPtr + 2])
+ && $tokens[$stackPtr + 2]['content'] === $phpcsFile->eolChar
) {
$error = 'Found more than a single empty line between content';
- $fix = $phpcsFile->addFixableError($error, ($stackPtr + 3), 'EmptyLines');
+ $fix = $phpcsFile->addFixableError($error, $stackPtr + 2, 'EmptyLines');
if ($fix) {
$phpcsFile->fixer->replaceToken($stackPtr + 2, '');
}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php
index f1901b029..75498ab7e 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/FunctionSpacingSniff.php
@@ -1,28 +1,29 @@
getTokens();
-
- /*
- Check the number of blank lines
- after the function.
- */
- if (isset($tokens[$stackPtr]['scope_closer']) === false) {
- // Must be an interface method, so the closer is the semi-colon.
- $closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr);
- } else {
- $closer = $tokens[$stackPtr]['scope_closer'];
+ $tokens = $phpCsFile->getTokens();
+
+ $level = $tokens[$stackPointer]['level'];
+ if ($level < 1) {
+ return;
}
- // There needs to be 1 blank lines after the closer.
- $nextLineToken = null;
- for ($i = $closer; $i < $phpcsFile->numTokens; $i++) {
- if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) === false) {
- continue;
- } else {
- $nextLineToken = ($i + 1);
- break;
+ $openingBraceIndex = $phpCsFile->findNext(T_OPEN_CURLY_BRACKET, $stackPointer + 1);
+ // Fix interface methods
+ if (!$openingBraceIndex) {
+ $openingParenthesisIndex = $phpCsFile->findNext(T_OPEN_PARENTHESIS, $stackPointer + 1);
+ $closingParenthesisIndex = $tokens[$openingParenthesisIndex]['parenthesis_closer'];
+
+ $semicolonIndex = $phpCsFile->findNext(T_SEMICOLON, $closingParenthesisIndex + 1);
+
+ $nextContentIndex = $phpCsFile->findNext(T_WHITESPACE, $semicolonIndex + 1, null, true);
+
+ // Do not mess with the end of the class
+ if ($tokens[$nextContentIndex]['type'] === 'T_CLOSE_CURLY_BRACKET') {
+ return;
}
- }
- if ($nextLineToken === null) {
- // Never found the next line, which means
- // there are 0 blank lines after the function.
- $foundLines = 0;
- } else {
- $nextContent = $phpcsFile->findNext([T_WHITESPACE], ($nextLineToken + 1), null, true);
- if ($nextContent === false) {
- // We are at the end of the file. That is acceptable as well.
- $foundLines = 1;
- } else {
- $foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']);
+ if ($tokens[$nextContentIndex]['line'] - $tokens[$semicolonIndex]['line'] <= 1) {
+ $fix = $phpCsFile->addFixableError('Every function/method needs a newline afterwards', $closingParenthesisIndex, 'Abstract');
+ if ($fix) {
+ $phpCsFile->fixer->addNewline($semicolonIndex);
+ }
}
+
+ return;
}
- /*
- Check the number of blank lines
- before the function.
- */
-
- $prevLineToken = null;
- for ($i = $stackPtr; $i > 0; $i--) {
- if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) === false) {
- continue;
- } else {
- $prevLineToken = $i;
- break;
+ $closingBraceIndex = $tokens[$openingBraceIndex]['scope_closer'];
+
+ // Ignore closures
+ $nextIndex = $phpCsFile->findNext(Tokens::$emptyTokens, $closingBraceIndex + 1, null, true);
+ if (in_array($tokens[$nextIndex]['content'], [';', ',', ')'])) {
+ return;
+ }
+
+ $nextContentIndex = $phpCsFile->findNext(T_WHITESPACE, $closingBraceIndex + 1, null, true);
+
+ // Do not mess with the end of the class
+ if ($tokens[$nextContentIndex]['type'] === 'T_CLOSE_CURLY_BRACKET') {
+ return;
+ }
+
+ $this->assertNewLineAtTheEnd($phpCsFile, $closingBraceIndex, $nextContentIndex);
+ $this->assertNewLineAtTheBeginning($phpCsFile, $stackPointer);
+ }
+
+ /**
+ * @param \PHP_CodeSniffer\Files\File $phpCsFile File
+ * @param int $closingBraceIndex Index
+ * @param int|null $nextContentIndex Index
+ *
+ * @return void
+ */
+ protected function assertNewLineAtTheEnd(File $phpCsFile, $closingBraceIndex, $nextContentIndex)
+ {
+ $tokens = $phpCsFile->getTokens();
+
+ if (!$nextContentIndex || $tokens[$nextContentIndex]['line'] - $tokens[$closingBraceIndex]['line'] <= 1) {
+ $fix = $phpCsFile->addFixableError('Every function/method needs a newline afterwards', $closingBraceIndex, 'Concrete');
+ if ($fix) {
+ $phpCsFile->fixer->addNewline($closingBraceIndex);
}
}
+ }
- if ($prevLineToken === null) {
- // Never found the previous line, which means
- // there are 0 blank lines before the function.
- $foundLines = 0;
- } else {
- $prevContent = $phpcsFile->findPrevious([T_WHITESPACE, T_DOC_COMMENT], $prevLineToken, null, true);
-
- // Before we throw an error, check that we are not throwing an error
- // for another function. We don't want to error for no blank lines after
- // the previous function and no blank lines before this one as well.
- $currentLine = $tokens[$stackPtr]['line'];
- $prevLine = ($tokens[$prevContent]['line'] - 1);
- $i = ($stackPtr - 1);
- $foundLines = 0;
- while ($currentLine !== $prevLine && $currentLine > 1 && $i > 0) {
- if (isset($tokens[$i]['scope_condition']) === true) {
- $scopeCondition = $tokens[$i]['scope_condition'];
- if ($tokens[$scopeCondition]['code'] === T_FUNCTION) {
- // Found a previous function.
- return;
- }
- } elseif ($tokens[$i]['code'] === T_FUNCTION) {
- // Found another interface function.
- return;
- }
+ /**
+ * Asserts newline at the beginning, including the doc block.
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpCsFile File
+ * @param int $stackPointer Stack pointer
+ *
+ * @return void
+ */
+ protected function assertNewLineAtTheBeginning(File $phpCsFile, $stackPointer)
+ {
+ $tokens = $phpCsFile->getTokens();
- $currentLine = $tokens[$i]['line'];
- if ($currentLine === $prevLine) {
- break;
- }
+ $line = $tokens[$stackPointer]['line'];
+ $firstTokenInLineIndex = $stackPointer;
+ while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) {
+ $firstTokenInLineIndex--;
+ }
- if ($tokens[($i - 1)]['line'] < $currentLine && $tokens[($i + 1)]['line'] > $currentLine) {
- // This token is on a line by itself. If it is whitespace, the line is empty.
- if ($tokens[$i]['code'] === T_WHITESPACE) {
- $foundLines++;
- }
- }
- $i--;
+ $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true);
+ if ($tokens[$prevContentIndex]['type'] === 'T_DOC_COMMENT_CLOSE_TAG') {
+ $firstTokenInLineIndex = $tokens[$prevContentIndex]['comment_opener'];
+ while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) {
+ $firstTokenInLineIndex--;
}
}
+
+ $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true);
+
+ // Do not mess with the start of the class
+ if ($tokens[$prevContentIndex]['type'] === 'T_OPEN_CURLY_BRACKET') {
+ return;
+ }
+
+ if ($tokens[$prevContentIndex]['line'] < $tokens[$firstTokenInLineIndex]['line'] - 1) {
+ return;
+ }
+
+ $fix = $phpCsFile->addFixableError('Every function/method needs a newline before', $firstTokenInLineIndex, 'Concrete');
+ if ($fix) {
+ $phpCsFile->fixer->addNewline($prevContentIndex);
+ }
}
}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php
index 1aca4e799..8a332c7e5 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Sniffs/WhiteSpace/OperatorSpacingSniff.php
@@ -58,7 +58,8 @@ public function process(File $phpcsFile, $stackPtr)
// Skip default values in function declarations.
// and declare statements
- if ($tokens[$stackPtr]['code'] === T_EQUAL
+ if (
+ $tokens[$stackPtr]['code'] === T_EQUAL
|| $tokens[$stackPtr]['code'] === T_MINUS
) {
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
@@ -66,7 +67,8 @@ public function process(File $phpcsFile, $stackPtr)
$bracket = array_pop($parenthesis);
if (isset($tokens[$bracket]['parenthesis_owner']) === true) {
$function = $tokens[$bracket]['parenthesis_owner'];
- if ($tokens[$function]['code'] === T_FUNCTION ||
+ if (
+ $tokens[$function]['code'] === T_FUNCTION ||
$tokens[$function]['code'] === T_DECLARE
) {
return;
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.php b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.php
index 4f214245e..4182292d3 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.php
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Commenting/DocBlockAlignmentUnitTest.php
@@ -18,7 +18,7 @@ public function getErrorList($testFile = '')
7 => 1,
14 => 1,
21 => 1,
- 30 => 1
+ 30 => 1,
];
default:
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.3.inc b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.3.inc
new file mode 100644
index 000000000..01ff37c03
--- /dev/null
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/Tests/Formatting/UseInAlphabeticalOrderUnitTest.3.inc
@@ -0,0 +1,13 @@
+ 1,
- 22 => 1,
+ 8 => 1,
+ 21 => 1,
+ 42 => 1,
43 => 1,
+ 47 => 1,
+ 48 => 1,
+ 49 => 1,
];
}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml
index ad0a87c64..02573fc58 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml
+++ b/app/vendor/cakephp/cakephp-codesniffer/CakePHP/ruleset.xml
@@ -1,152 +1,181 @@
- CakePHP coding standard
-
- \.git
- */Config/*.ini.php
- /*/tmp/
-
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- */config/*
- */tests/*
-
-
- */tests/*
-
-
- */tests/*
-
-
- */CakePHP/*
- */tests/*
-
-
- */tests/*
-
-
- */tests/*
-
-
- */src/*
- */tests/*
-
-
- */src/*
- */tests/*
-
-
- */src/*
- */tests/*
-
-
-
+ CakePHP coding standard
+
+ \.git
+ */Config/*.ini.php
+ /*/tmp/
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ */config/*
+ */tests/*
+
+
+ */tests/*
+
+
+ */tests/*
+
+
+ */CakePHP/*
+ */tests/*
+
+
+ */tests/*
+
+
+ */tests/*
+
+
+ */src/*
+ */tests/*
+
+
+ */src/*
+ */tests/*
+
+
+ */src/*
+ */tests/*
+
+
+
diff --git a/app/vendor/cakephp/cakephp-codesniffer/LICENSE.txt b/app/vendor/cakephp/cakephp-codesniffer/LICENSE.txt
index 5849d31d4..0a0a98c8e 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/LICENSE.txt
+++ b/app/vendor/cakephp/cakephp-codesniffer/LICENSE.txt
@@ -1,7 +1,7 @@
The MIT License
CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org)
-Copyright (c) 2005-2018, Cake Software Foundation, Inc.
+Copyright (c) 2005-present, Cake Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/app/vendor/cakephp/cakephp-codesniffer/README.md b/app/vendor/cakephp/cakephp-codesniffer/README.md
index 7de3b6a92..5ef17389e 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/README.md
+++ b/app/vendor/cakephp/cakephp-codesniffer/README.md
@@ -12,6 +12,15 @@ and checks code against the coding standards used in CakePHP.
PSR2 standard. If you want to check against the historical CakePHP coding
standard use any of the `1.x` releases.
+## Which version should I use?
+
+| Sniffer version | CakePHP version | PHP min |
+| -------- | ------- | ------- |
+| 1.x | 2.x | PHP 5.4 |
+| 2.x | 3.x | PHP 5.5 |
+| 3.x | 3.x | PHP 5.6 |
+| 4.x | 4.x | PHP 7.1 |
+
## Installation
You should install this codesniffer with composer:
@@ -24,13 +33,29 @@ you do not overwrite any existing `installed_paths` value.
## Usage
+:warning: Warning when these sniffs are installed with composer, ensure that
+you have configured the CodeSniffer `installed_paths` setting.
+
Depending on how you installed the code sniffer changes how you run it. If you have
installed phpcs, and this package with PEAR, you can do the following:
- vendor/bin/phpcs --standard=CakePHP /path/to/code
+ vendor/bin/phpcs --colors -p -s --standard=CakePHP /path/to/code
-:warning: Warning when these sniffs are installed with composer, ensure that
-you have configured the CodeSniffer `installed_paths` setting.
+You can also copy the `phpcs.xml.dist` file to your project's root folder as `phpcs.xml`.
+This file will import the CakePHP Coding Standard. From there you can edit it to
+include/exclude as needed. With this file in place, you can run:
+
+ vendor/bin/phpcs --colors -p -s /path/to/code
+
+If you are using Composer to manage your CakePHP project, you can also add the below to your composer.json file:
+
+```json
+{
+ "scripts": {
+ "cs-check": "vendor/bin/phpcs --colors -p -s --extensions=ctp,php ./src ./tests"
+ }
+}
+```
## Running Tests
diff --git a/app/vendor/cakephp/cakephp-codesniffer/composer.json b/app/vendor/cakephp/cakephp-codesniffer/composer.json
index ca4706569..551c0c632 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/composer.json
+++ b/app/vendor/cakephp/cakephp-codesniffer/composer.json
@@ -3,7 +3,7 @@
"description": "CakePHP CodeSniffer Standards",
"type": "phpcodesniffer-standard",
"keywords": ["framework", "codesniffer"],
- "homepage": "http://cakephp.org",
+ "homepage": "https://cakephp.org",
"license": "MIT",
"authors": [
{
@@ -13,12 +13,12 @@
],
"support": {
"issues": "https://github.com/cakephp/cakephp-codesniffer/issues",
- "forum": "http://stackoverflow.com/tags/cakephp",
+ "forum": "https://stackoverflow.com/tags/cakephp",
"irc": "irc://irc.freenode.org/cakephp",
"source": "https://github.com/cakephp/cakephp-codesniffer"
},
"require": {
- "php": ">=5.4",
+ "php": ">=5.6",
"squizlabs/php_codesniffer": "^3.0.0"
},
"require-dev": {
@@ -26,7 +26,7 @@
},
"autoload": {
"psr-4": {
- "CakePHP\\": "CakePHP"
+ "CakePHP\\": "CakePHP/"
}
},
"scripts": {
@@ -48,7 +48,8 @@
"phpunit --coverage-clover=clover.xml",
"@reset-ruleset"
],
- "cs-check": "phpcs --colors -p --extensions=php --standard=CakePHP ./CakePHP",
- "cs-fix": "phpcbf --colors --extensions=php --standard=CakePHP ./CakePHP"
+ "cs-check": "vendor/bin/phpcs --colors -p -s --extensions=php CakePHP/",
+ "cs-fix": "vendor/bin/phpcbf --colors -p --extensions=php CakePHP/",
+ "explain": "vendor/bin/phpcs -e"
}
}
diff --git a/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml b/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml
new file mode 100644
index 000000000..ae84391fd
--- /dev/null
+++ b/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml
@@ -0,0 +1,6 @@
+
+
+ CakePHP coding standard
+
+
+
diff --git a/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist b/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist
new file mode 100644
index 000000000..f3b4f08f2
--- /dev/null
+++ b/app/vendor/cakephp/cakephp-codesniffer/phpcs.xml.dist
@@ -0,0 +1,6 @@
+
+
+ App Coding Standard
+
+
+
diff --git a/app/vendor/cakephp/cakephp-codesniffer/phpunit.xml b/app/vendor/cakephp/cakephp-codesniffer/phpunit.xml
index 087d813fc..de25c2672 100644
--- a/app/vendor/cakephp/cakephp-codesniffer/phpunit.xml
+++ b/app/vendor/cakephp/cakephp-codesniffer/phpunit.xml
@@ -1,8 +1,8 @@
-
- ./vendor/squizlabs/php_codesniffer/tests/AllTests.php
+
+ vendor/squizlabs/php_codesniffer/tests/AllTests.php
diff --git a/app/vendor/cakephp/cakephp/README.md b/app/vendor/cakephp/cakephp/README.md
index 53a03fcfc..cd73d56da 100644
--- a/app/vendor/cakephp/cakephp/README.md
+++ b/app/vendor/cakephp/cakephp/README.md
@@ -7,9 +7,7 @@
-
-
-
+
@@ -76,7 +74,7 @@ tests for CakePHP by doing the following:
## Contributing
* [CONTRIBUTING.md](.github/CONTRIBUTING.md) - Quick pointers for contributing to the CakePHP project.
-* [CookBook "Contributing" Section](https://book.cakephp.org/3.0/en/contributing.html) - Details about contributing to the project.
+* [CookBook "Contributing" Section](https://book.cakephp.org/3/en/contributing.html) - Details about contributing to the project.
# Security
diff --git a/app/vendor/cakephp/cakephp/VERSION.txt b/app/vendor/cakephp/cakephp/VERSION.txt
index 496abbcbe..449eae3d1 100644
--- a/app/vendor/cakephp/cakephp/VERSION.txt
+++ b/app/vendor/cakephp/cakephp/VERSION.txt
@@ -16,4 +16,4 @@
// @license https://opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
-3.8.3
+3.10.0
diff --git a/app/vendor/cakephp/cakephp/composer.json b/app/vendor/cakephp/cakephp/composer.json
index 47e15a564..00ddd6faa 100644
--- a/app/vendor/cakephp/cakephp/composer.json
+++ b/app/vendor/cakephp/cakephp/composer.json
@@ -28,24 +28,27 @@
"source": "https://github.com/cakephp/cakephp"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"ext-intl": "*",
"ext-mbstring": "*",
"cakephp/chronos": "^1.0.1",
"aura/intl": "^3.0.0",
+ "laminas/laminas-diactoros": "^1.4.0",
"psr/log": "^1.0.0",
"psr/simple-cache": "^1.0.0",
- "zendframework/zend-diactoros": "^1.4.0"
+ "paragonie/random_compat": "^1.4|^2.0|9.99.99"
},
"suggest": {
"ext-openssl": "To use Security::encrypt() or have secure CSRF token generation.",
"ext-curl": "To enable more efficient network calls in Http\\Client.",
- "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()"
+ "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()",
+ "paragonie/csp-builder": "CSP builder, to use the CSP Middleware"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^3.0",
"cakephp/chronos": "^1.2.1",
- "phpunit/phpunit": "^5.7.14|^6.0"
+ "phpunit/phpunit": "^5.7.14|^6.0",
+ "paragonie/csp-builder": "^1.4|^2.3"
},
"autoload": {
"psr-4": {
@@ -98,6 +101,8 @@
"cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
"cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
"test": "phpunit",
- "test-coverage": "phpunit --coverage-clover=clover.xml"
+ "test-coverage": "phpunit --coverage-clover=clover.xml",
+ "phpstan": "phpstan analyse -c phpstan.neon -l 2 src/",
+ "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 --no-update && composer update && mv composer.backup composer.json"
}
}
diff --git a/app/vendor/cakephp/cakephp/config/bootstrap.php b/app/vendor/cakephp/cakephp/config/bootstrap.php
index c683c0df2..47b2d402d 100644
--- a/app/vendor/cakephp/cakephp/config/bootstrap.php
+++ b/app/vendor/cakephp/cakephp/config/bootstrap.php
@@ -12,9 +12,13 @@
* @since 0.2.9
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
use Cake\Routing\Router;
-define('TIME_START', microtime(true));
+/**
+ * @var float
+ */
+define('TIME_START', (float)microtime(true));
require CAKE . 'basics.php';
diff --git a/app/vendor/cakephp/cakephp/config/config.php b/app/vendor/cakephp/cakephp/config/config.php
index a7b77b1ad..3a55e79aa 100644
--- a/app/vendor/cakephp/cakephp/config/config.php
+++ b/app/vendor/cakephp/cakephp/config/config.php
@@ -16,5 +16,5 @@
*/
$versionFile = file(CORE_PATH . 'VERSION.txt');
return [
- 'Cake.version' => trim(array_pop($versionFile))
+ 'Cake.version' => trim(array_pop($versionFile)),
];
diff --git a/app/vendor/cakephp/cakephp/src/Auth/AbstractPasswordHasher.php b/app/vendor/cakephp/cakephp/src/Auth/AbstractPasswordHasher.php
index 3aef37caf..1b1b1922a 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/AbstractPasswordHasher.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/AbstractPasswordHasher.php
@@ -21,7 +21,6 @@
*/
abstract class AbstractPasswordHasher
{
-
use InstanceConfigTrait;
/**
@@ -46,9 +45,8 @@ public function __construct(array $config = [])
/**
* Generates password hash.
*
- * @param string|array $password Plain text password to hash or array of data
- * required to generate password hash.
- * @return string Password hash
+ * @param string $password Plain text password to hash.
+ * @return string|false Either the password hash string or false
*/
abstract public function hash($password);
@@ -56,7 +54,7 @@ abstract public function hash($password);
* Check hash. Generate hash from user provided password string or data array
* and check against existing hash.
*
- * @param string|array $password Plain text password to hash or data array.
+ * @param string $password Plain text password to hash.
* @param string $hashedPassword Existing hashed password.
* @return bool True if hashes match else false.
*/
diff --git a/app/vendor/cakephp/cakephp/src/Auth/BaseAuthenticate.php b/app/vendor/cakephp/cakephp/src/Auth/BaseAuthenticate.php
index ec2a9ad6c..cbf4f01d5 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/BaseAuthenticate.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/BaseAuthenticate.php
@@ -48,13 +48,13 @@ abstract class BaseAuthenticate implements EventListenerInterface
protected $_defaultConfig = [
'fields' => [
'username' => 'username',
- 'password' => 'password'
+ 'password' => 'password',
],
'userModel' => 'Users',
'scope' => [],
'finder' => 'all',
'contain' => null,
- 'passwordHasher' => 'Default'
+ 'passwordHasher' => 'Default',
];
/**
@@ -67,7 +67,7 @@ abstract class BaseAuthenticate implements EventListenerInterface
/**
* Password hasher instance.
*
- * @var \Cake\Auth\AbstractPasswordHasher
+ * @var \Cake\Auth\AbstractPasswordHasher|null
*/
protected $_passwordHasher;
@@ -107,13 +107,13 @@ public function __construct(ComponentRegistry $registry, array $config = [])
* @param string $username The username/identifier.
* @param string|null $password The password, if not provided password checking is skipped
* and result of find is returned.
- * @return bool|array Either false on failure, or an array of user data.
+ * @return array|false Either false on failure, or an array of user data.
*/
protected function _findUser($username, $password = null)
{
$result = $this->_query($username)->first();
- if (empty($result)) {
+ if ($result === null) {
// Waste time hashing the password, to prevent
// timing side-channels. However, don't hash
// null passwords as authentication systems
@@ -131,6 +131,16 @@ protected function _findUser($username, $password = null)
if ($password !== null) {
$hasher = $this->passwordHasher();
$hashedPassword = $result->get($passwordField);
+
+ if ($hashedPassword === null || $hashedPassword === '') {
+ // Waste time hashing the password, to prevent
+ // timing side-channels to distinguish whether
+ // user has password or not.
+ $hasher->hash($password);
+
+ return false;
+ }
+
if (!$hasher->check($password, $hashedPassword)) {
return false;
}
@@ -160,7 +170,7 @@ protected function _query($username)
$table = $this->getTableLocator()->get($config['userModel']);
$options = [
- 'conditions' => [$table->aliasField($config['fields']['username']) => $username]
+ 'conditions' => [$table->aliasField($config['fields']['username']) => $username],
];
if (!empty($config['scope'])) {
@@ -192,7 +202,7 @@ protected function _query($username)
*/
public function passwordHasher()
{
- if ($this->_passwordHasher) {
+ if ($this->_passwordHasher !== null) {
return $this->_passwordHasher;
}
@@ -243,7 +253,7 @@ public function getUser(ServerRequest $request)
*
* @param \Cake\Http\ServerRequest $request A request object.
* @param \Cake\Http\Response $response A response object.
- * @return void
+ * @return \Cake\Http\Response|null|void
*/
public function unauthenticated(ServerRequest $request, Response $response)
{
diff --git a/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php b/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php
index f512e0942..06eb590f6 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/BasicAuthenticate.php
@@ -47,11 +47,10 @@
* valid credentials are not provided, required authentication headers will be sent
* by this authentication provider which triggers the login dialog in the browser/client.
*
- * @see https://book.cakephp.org/3.0/en/controllers/components/authentication.html
+ * @see https://book.cakephp.org/3/en/controllers/components/authentication.html
*/
class BasicAuthenticate extends BaseAuthenticate
{
-
/**
* Authenticate a user using HTTP auth. Will use the configured User model and attempt a
* login using HTTP auth.
@@ -93,23 +92,24 @@ public function getUser(ServerRequest $request)
*/
public function unauthenticated(ServerRequest $request, Response $response)
{
- $Exception = new UnauthorizedException();
- $Exception->responseHeader($this->loginHeaders($request));
- throw $Exception;
+ $unauthorizedException = new UnauthorizedException();
+ $unauthorizedException->responseHeader($this->loginHeaders($request));
+
+ throw $unauthorizedException;
}
/**
* Generate the login headers
*
* @param \Cake\Http\ServerRequest $request Request object.
- * @return array Headers for logging in.
+ * @return string[] Headers for logging in.
*/
public function loginHeaders(ServerRequest $request)
{
$realm = $this->getConfig('realm') ?: $request->getEnv('SERVER_NAME');
return [
- 'WWW-Authenticate' => sprintf('Basic realm="%s"', $realm)
+ 'WWW-Authenticate' => sprintf('Basic realm="%s"', $realm),
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Auth/ControllerAuthorize.php b/app/vendor/cakephp/cakephp/src/Auth/ControllerAuthorize.php
index fc69fab68..ee50651aa 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/ControllerAuthorize.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/ControllerAuthorize.php
@@ -41,7 +41,6 @@
*/
class ControllerAuthorize extends BaseAuthorize
{
-
/**
* Controller for the request.
*
diff --git a/app/vendor/cakephp/cakephp/src/Auth/DefaultPasswordHasher.php b/app/vendor/cakephp/cakephp/src/Auth/DefaultPasswordHasher.php
index dc9420cdd..f0fda8b4d 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/DefaultPasswordHasher.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/DefaultPasswordHasher.php
@@ -19,7 +19,6 @@
*/
class DefaultPasswordHasher extends AbstractPasswordHasher
{
-
/**
* Default config for this object.
*
@@ -34,15 +33,15 @@ class DefaultPasswordHasher extends AbstractPasswordHasher
*/
protected $_defaultConfig = [
'hashType' => PASSWORD_DEFAULT,
- 'hashOptions' => []
+ 'hashOptions' => [],
];
/**
* Generates password hash.
*
* @param string $password Plain text password to hash.
- * @return bool|string Password hash or false on failure
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#hashing-passwords
+ * @return string|false Password hash or false on failure
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#hashing-passwords
*/
public function hash($password)
{
diff --git a/app/vendor/cakephp/cakephp/src/Auth/DigestAuthenticate.php b/app/vendor/cakephp/cakephp/src/Auth/DigestAuthenticate.php
index 546315b10..dad4eef59 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/DigestAuthenticate.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/DigestAuthenticate.php
@@ -61,11 +61,10 @@
* `User.password` would store the password hash for use with other methods like
* Basic or Form.
*
- * @see https://book.cakephp.org/3.0/en/controllers/components/authentication.html
+ * @see https://book.cakephp.org/3/en/controllers/components/authentication.html
*/
class DigestAuthenticate extends BasicAuthenticate
{
-
/**
* Constructor
*
@@ -213,7 +212,7 @@ public static function password($username, $password, $realm)
* Generate the login headers
*
* @param \Cake\Http\ServerRequest $request Request object.
- * @return array Headers for logging in.
+ * @return string[] Headers for logging in.
*/
public function loginHeaders(ServerRequest $request)
{
@@ -223,7 +222,7 @@ public function loginHeaders(ServerRequest $request)
'realm' => $realm,
'qop' => $this->_config['qop'],
'nonce' => $this->generateNonce(),
- 'opaque' => $this->_config['opaque'] ?: md5($realm)
+ 'opaque' => $this->_config['opaque'] ?: md5($realm),
];
$digest = $this->_getDigest($request);
@@ -242,7 +241,7 @@ public function loginHeaders(ServerRequest $request)
}
return [
- 'WWW-Authenticate' => 'Digest ' . implode(',', $opts)
+ 'WWW-Authenticate' => 'Digest ' . implode(',', $opts),
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Auth/FallbackPasswordHasher.php b/app/vendor/cakephp/cakephp/src/Auth/FallbackPasswordHasher.php
index 7f7e7cd1b..79ef1119e 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/FallbackPasswordHasher.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/FallbackPasswordHasher.php
@@ -21,20 +21,19 @@
*/
class FallbackPasswordHasher extends AbstractPasswordHasher
{
-
/**
* Default config for this object.
*
* @var array
*/
protected $_defaultConfig = [
- 'hashers' => []
+ 'hashers' => [],
];
/**
* Holds the list of password hasher objects that will be used
*
- * @var array
+ * @var \Cake\Auth\AbstractPasswordHasher[]
*/
protected $_hashers = [];
@@ -62,7 +61,7 @@ public function __construct(array $config = [])
* Uses the first password hasher in the list to generate the hash
*
* @param string $password Plain text password to hash.
- * @return string Password hash
+ * @return string|false Password hash or false
*/
public function hash($password)
{
diff --git a/app/vendor/cakephp/cakephp/src/Auth/FormAuthenticate.php b/app/vendor/cakephp/cakephp/src/Auth/FormAuthenticate.php
index a16decd77..268234b25 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/FormAuthenticate.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/FormAuthenticate.php
@@ -1,6 +1,5 @@
'Auth.User',
- 'redirect' => 'Auth.redirect'
+ 'redirect' => 'Auth.redirect',
];
/**
diff --git a/app/vendor/cakephp/cakephp/src/Auth/Storage/StorageInterface.php b/app/vendor/cakephp/cakephp/src/Auth/Storage/StorageInterface.php
index 53c3ebe9e..7895d3e02 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/Storage/StorageInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/Storage/StorageInterface.php
@@ -17,6 +17,8 @@
/**
* Describes the methods that any class representing an Auth data storage should
* comply with.
+ *
+ * @mixin \Cake\Core\InstanceConfigTrait
*/
interface StorageInterface
{
diff --git a/app/vendor/cakephp/cakephp/src/Auth/WeakPasswordHasher.php b/app/vendor/cakephp/cakephp/src/Auth/WeakPasswordHasher.php
index a1b54705e..657c95b83 100644
--- a/app/vendor/cakephp/cakephp/src/Auth/WeakPasswordHasher.php
+++ b/app/vendor/cakephp/cakephp/src/Auth/WeakPasswordHasher.php
@@ -25,14 +25,13 @@
*/
class WeakPasswordHasher extends AbstractPasswordHasher
{
-
/**
* Default config for this object.
*
* @var array
*/
protected $_defaultConfig = [
- 'hashType' => null
+ 'hashType' => null,
];
/**
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Cache.php b/app/vendor/cakephp/cakephp/src/Cache/Cache.php
index c4a89e060..c9a326a75 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Cache.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Cache.php
@@ -65,14 +65,13 @@
*/
class Cache
{
-
use StaticConfigTrait;
/**
* An array mapping url schemes to fully qualified caching engine
* class names.
*
- * @var array
+ * @var string[]
*/
protected static $_dsnClassMap = [
'array' => 'Cake\Cache\Engine\ArrayEngine',
diff --git a/app/vendor/cakephp/cakephp/src/Cache/CacheEngine.php b/app/vendor/cakephp/cakephp/src/Cache/CacheEngine.php
index e1bdc75a0..9d378af5f 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/CacheEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/CacheEngine.php
@@ -147,7 +147,7 @@ public function readMany($keys)
*
* @param string $key Identifier for the data
* @param int $offset How much to add
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
abstract public function increment($key, $offset = 1);
@@ -156,7 +156,7 @@ abstract public function increment($key, $offset = 1);
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
abstract public function decrement($key, $offset = 1);
@@ -231,7 +231,7 @@ public function clearGroup($group)
* and returns the `group value` for each of them, this is
* the token representing each group in the cache key
*
- * @return array
+ * @return string[]
*/
public function groups()
{
@@ -242,7 +242,7 @@ public function groups()
* Generates a safe key for use with cache engine storage engines.
*
* @param string $key the key passed over
- * @return bool|string string key or false
+ * @return string|false string key or false
*/
public function key($key)
{
@@ -264,7 +264,7 @@ public function key($key)
* Generates a safe key, taking account of the configured key prefix
*
* @param string $key the key passed over
- * @return mixed string $key or false
+ * @return string Key
* @throws \InvalidArgumentException If key's value is empty
*/
protected function _key($key)
diff --git a/app/vendor/cakephp/cakephp/src/Cache/CacheEngineInterface.php b/app/vendor/cakephp/cakephp/src/Cache/CacheEngineInterface.php
index 0b8cac694..b1d4aaa43 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/CacheEngineInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/CacheEngineInterface.php
@@ -40,7 +40,7 @@ public function add($key, $value);
*
* @param string $key Identifier for the data
* @param int $offset How much to add
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1);
@@ -49,7 +49,7 @@ public function increment($key, $offset = 1);
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function decrement($key, $offset = 1);
diff --git a/app/vendor/cakephp/cakephp/src/Cache/CacheRegistry.php b/app/vendor/cakephp/cakephp/src/Cache/CacheRegistry.php
index 706632f11..0ff82dbc8 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/CacheRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/CacheRegistry.php
@@ -23,10 +23,11 @@
* An object registry for cache engines.
*
* Used by Cake\Cache\Cache to load and manage cache engines.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\Cache\CacheEngine>
*/
class CacheRegistry extends ObjectRegistry
{
-
/**
* Resolve a cache engine classname.
*
@@ -50,7 +51,7 @@ protected function _resolveClassName($class)
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the cache is missing in.
+ * @param string|null $plugin The plugin the cache is missing in.
* @return void
* @throws \BadMethodCallException
*/
@@ -94,7 +95,7 @@ protected function _create($class, $alias, $config)
}
$config = $instance->getConfig();
- if ($config['probability'] && time() % $config['probability'] === 0) {
+ if (!empty($config['probability']) && time() % $config['probability'] === 0) {
$instance->gc();
}
@@ -105,10 +106,12 @@ protected function _create($class, $alias, $config)
* Remove a single adapter from the registry.
*
* @param string $name The adapter name.
- * @return void
+ * @return $this
*/
public function unload($name)
{
unset($this->_loaded[$name]);
+
+ return $this;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/ApcuEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/ApcuEngine.php
index c9f4f1de7..c23c68d9b 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/ApcuEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/ApcuEngine.php
@@ -14,7 +14,7 @@
*/
namespace Cake\Cache\Engine;
-use APCuIterator;
+use APCUIterator;
use Cake\Cache\CacheEngine;
/**
@@ -22,7 +22,6 @@
*/
class ApcuEngine extends CacheEngine
{
-
/**
* Contains the compiled group names
* (prefixed with the global configuration prefix)
@@ -84,7 +83,7 @@ public function read($key)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
* @link https://secure.php.net/manual/en/function.apcu-inc.php
*/
public function increment($key, $offset = 1)
@@ -99,7 +98,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
* @link https://secure.php.net/manual/en/function.apcu-dec.php
*/
public function decrement($key, $offset = 1)
@@ -137,8 +136,8 @@ public function clear($check)
if ($check) {
return true;
}
- if (class_exists('APCuIterator', false)) {
- $iterator = new APCuIterator(
+ if (class_exists(APCUIterator::class, false)) {
+ $iterator = new APCUIterator(
'/^' . preg_quote($this->_config['prefix'], '/') . '/',
APC_ITER_NONE
);
@@ -179,7 +178,7 @@ public function add($key, $value)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
* @link https://secure.php.net/manual/en/function.apcu-fetch.php
* @link https://secure.php.net/manual/en/function.apcu-store.php
*/
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/ArrayEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/ArrayEngine.php
index 3329f443f..0712ff62a 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/ArrayEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/ArrayEngine.php
@@ -84,7 +84,7 @@ public function read($key)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1)
{
@@ -102,7 +102,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
*/
public function decrement($key, $offset = 1)
{
@@ -147,7 +147,7 @@ public function clear($check)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
*/
public function groups()
{
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php
index 108b7ce78..3f03aa013 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php
@@ -33,7 +33,6 @@
*/
class FileEngine extends CacheEngine
{
-
/**
* Instance of SplFileObject class
*
@@ -68,7 +67,7 @@ class FileEngine extends CacheEngine
'path' => null,
'prefix' => 'cake_',
'probability' => 100,
- 'serialize' => true
+ 'serialize' => true,
];
/**
@@ -278,18 +277,33 @@ public function clear($check)
RecursiveIteratorIterator::SELF_FIRST
);
$cleared = [];
- foreach ($contents as $path) {
- if ($path->isFile()) {
+ /** @var \SplFileInfo $fileInfo */
+ foreach ($contents as $fileInfo) {
+ if ($fileInfo->isFile()) {
+ unset($fileInfo);
+ continue;
+ }
+
+ $realPath = $fileInfo->getRealPath();
+ if (!$realPath) {
+ unset($fileInfo);
continue;
}
- $path = $path->getRealPath() . DIRECTORY_SEPARATOR;
+ $path = $realPath . DIRECTORY_SEPARATOR;
if (!in_array($path, $cleared, true)) {
$this->_clearDirectory($path, $now, $threshold);
$cleared[] = $path;
}
+
+ // possible inner iterators need to be unset too in order for locks on parents to be released
+ unset($fileInfo);
}
+ // unsetting iterators helps releasing possible locks in certain environments,
+ // which could otherwise make `rmdir()` fail
+ unset($directory, $contents);
+
return true;
}
@@ -395,7 +409,8 @@ protected function _setKey($key, $createKey = false)
if (!$createKey && !$path->isFile()) {
return false;
}
- if (empty($this->_File) ||
+ if (
+ empty($this->_File) ||
$this->_File->getBasename() !== $key ||
$this->_File->valid() === false
) {
@@ -515,6 +530,10 @@ function (SplFileInfo $current) use ($group, $prefix) {
@unlink($path);
}
+ // unsetting iterators helps releasing possible locks in certain environments,
+ // which could otherwise make `rmdir()` fail
+ unset($directoryIterator, $contents, $filtered);
+
return true;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/MemcachedEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/MemcachedEngine.php
index 3943e13a1..6b143c9f5 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/MemcachedEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/MemcachedEngine.php
@@ -29,7 +29,6 @@
*/
class MemcachedEngine extends CacheEngine
{
-
/**
* memcached wrapper.
*
@@ -111,7 +110,7 @@ public function init(array $config = [])
$this->_serializers = [
'igbinary' => Memcached::SERIALIZER_IGBINARY,
'json' => Memcached::SERIALIZER_JSON,
- 'php' => Memcached::SERIALIZER_PHP
+ 'php' => Memcached::SERIALIZER_PHP,
];
if (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
$this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;
@@ -146,7 +145,25 @@ public function init(array $config = [])
}
$this->_setOptions();
- if (count($this->_Memcached->getServerList())) {
+ $serverList = $this->_Memcached->getServerList();
+ if (count($serverList)) {
+ if ($this->_config['persistent'] !== false) {
+ $actualServers = [];
+ foreach ($serverList as $server) {
+ $actualServers[] = $server['host'] . ':' . $server['port'];
+ }
+ unset($server);
+ sort($actualServers);
+ $configuredServers = $this->_config['servers'];
+ sort($configuredServers);
+ if ($actualServers !== $configuredServers) {
+ $message = "Invalid cache configuration. Multiple persistent cache configurations are detected" .
+ " with different 'servers' values. 'servers' values for persistent cache configurations" .
+ " must be the same when using the same persistence id.";
+ throw new InvalidArgumentException($message);
+ }
+ }
+
return true;
}
@@ -205,7 +222,8 @@ protected function _setOptions()
);
}
- if ($serializer !== 'php' &&
+ if (
+ $serializer !== 'php' &&
!constant('Memcached::HAVE_' . strtoupper($serializer))
) {
throw new InvalidArgumentException(
@@ -219,7 +237,8 @@ protected function _setOptions()
);
// Check for Amazon ElastiCache instance
- if (defined('Memcached::OPT_CLIENT_MODE') &&
+ if (
+ defined('Memcached::OPT_CLIENT_MODE') &&
defined('Memcached::DYNAMIC_CLIENT_MODE')
) {
$this->_Memcached->setOption(
@@ -281,7 +300,7 @@ protected function _parseServerString($server)
* Read an option value from the memcached connection.
*
* @param string $name The option name to read.
- * @return string|int|null|bool
+ * @return string|int|bool|null
*/
public function getOption($name)
{
@@ -292,20 +311,16 @@ public function getOption($name)
* Write data for key into cache. When using memcached as your cache engine
* remember that the Memcached pecl extension does not support cache expiry
* times greater than 30 days in the future. Any duration greater than 30 days
- * will be treated as never expiring.
+ * will be treated as real Unix time value rather than an offset from current time.
*
* @param string $key Identifier for the data
* @param mixed $value Data to be cached
* @return bool True if the data was successfully cached, false on failure
- * @see https://secure.php.net/manual/en/memcache.set.php
+ * @see https://www.php.net/manual/en/memcached.set.php
*/
public function write($key, $value)
{
$duration = $this->_config['duration'];
- if ($duration > 30 * DAY) {
- $duration = 0;
- }
-
$key = $this->_key($key);
return $this->_Memcached->set($key, $value, $duration);
@@ -378,7 +393,7 @@ public function readMany($keys)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1)
{
@@ -392,7 +407,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
*/
public function decrement($key, $offset = 1)
{
@@ -475,10 +490,6 @@ public function clear($check)
public function add($key, $value)
{
$duration = $this->_config['duration'];
- if ($duration > 30 * DAY) {
- $duration = 0;
- }
-
$key = $this->_key($key);
return $this->_Memcached->add($key, $value, $duration);
@@ -489,7 +500,7 @@ public function add($key, $value)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
*/
public function groups()
{
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/NullEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/NullEngine.php
index fee563583..4f6e5e6b4 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/NullEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/NullEngine.php
@@ -23,7 +23,6 @@
*/
class NullEngine extends CacheEngine
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/RedisEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/RedisEngine.php
index 245db502b..0591b8c40 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/RedisEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/RedisEngine.php
@@ -24,7 +24,6 @@
*/
class RedisEngine extends CacheEngine
{
-
/**
* Redis wrapper.
*
@@ -169,7 +168,7 @@ public function read($key)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1)
{
@@ -189,7 +188,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
*/
public function decrement($key, $offset = 1)
{
@@ -258,7 +257,7 @@ public function clear($check)
* @param string $key Identifier for the data.
* @param mixed $value Data to be cached.
* @return bool True if the data was successfully cached, false on failure.
- * @link https://github.com/phpredis/phpredis#setnx
+ * @link https://github.com/phpredis/phpredis#set
*/
public function add($key, $value)
{
@@ -269,9 +268,8 @@ public function add($key, $value)
$value = serialize($value);
}
- // setNx() doesn't have an expiry option, so follow up with an expiry
- if ($this->_Redis->setNx($key, $value)) {
- return $this->_Redis->expire($key, $duration);
+ if ($this->_Redis->set($key, $value, ['nx', 'ex' => $duration])) {
+ return true;
}
return false;
@@ -282,7 +280,7 @@ public function add($key, $value)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
*/
public function groups()
{
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/WincacheEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/WincacheEngine.php
index de3206754..51105bbda 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/WincacheEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/WincacheEngine.php
@@ -23,7 +23,6 @@
*/
class WincacheEngine extends CacheEngine
{
-
/**
* Contains the compiled group names
* (prefixed with the global configuration prefix)
@@ -85,7 +84,7 @@ public function read($key)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1)
{
@@ -99,7 +98,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
*/
public function decrement($key, $offset = 1)
{
@@ -151,7 +150,7 @@ public function clear($check)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
*/
public function groups()
{
diff --git a/app/vendor/cakephp/cakephp/src/Cache/Engine/XcacheEngine.php b/app/vendor/cakephp/cakephp/src/Cache/Engine/XcacheEngine.php
index 9e1097f31..349907263 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/Engine/XcacheEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/Engine/XcacheEngine.php
@@ -24,7 +24,6 @@
*/
class XcacheEngine extends CacheEngine
{
-
/**
* The default config used unless overridden by runtime configuration
*
@@ -46,7 +45,7 @@ class XcacheEngine extends CacheEngine
'prefix' => null,
'probability' => 100,
'PHP_AUTH_USER' => 'user',
- 'PHP_AUTH_PW' => 'password'
+ 'PHP_AUTH_PW' => 'password',
];
/**
@@ -125,7 +124,7 @@ public function read($key)
*
* @param string $key Identifier for the data
* @param int $offset How much to increment
- * @return bool|int New incremented value, false otherwise
+ * @return int|false New incremented value, false otherwise
*/
public function increment($key, $offset = 1)
{
@@ -140,7 +139,7 @@ public function increment($key, $offset = 1)
*
* @param string $key Identifier for the data
* @param int $offset How much to subtract
- * @return bool|int New decremented value, false otherwise
+ * @return int|false New decremented value, false otherwise
*/
public function decrement($key, $offset = 1)
{
@@ -187,7 +186,7 @@ public function clear($check)
* If the group initial value was not found, then it initializes
* the group accordingly.
*
- * @return array
+ * @return string[]
*/
public function groups()
{
diff --git a/app/vendor/cakephp/cakephp/src/Cache/README.md b/app/vendor/cakephp/cakephp/src/Cache/README.md
index befe20fe4..14b3905ee 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/README.md
+++ b/app/vendor/cakephp/cakephp/src/Cache/README.md
@@ -39,7 +39,7 @@ $object = new FileEngine($config);
Cache::config('other', $object);
```
-You can now read a write from the cache:
+You can now read and write from the cache:
```php
$data = Cache::remember('my_cache_key', function () {
@@ -52,6 +52,6 @@ the callback will be executed and the returned data will be cached for future ca
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/caching.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/caching.html)
diff --git a/app/vendor/cakephp/cakephp/src/Cache/SimpleCacheEngine.php b/app/vendor/cakephp/cakephp/src/Cache/SimpleCacheEngine.php
index 2654f5be1..80da227c4 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/SimpleCacheEngine.php
+++ b/app/vendor/cakephp/cakephp/src/Cache/SimpleCacheEngine.php
@@ -100,7 +100,7 @@ public function get($key, $default = null)
*
* @param string $key The key of the item to store.
* @param mixed $value The value of the item to store, must be serializable.
- * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
+ * @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
* the driver supports TTL then the library may set a default value
* for it or let the driver take care of that.
* @return bool True on success and false on failure.
@@ -176,7 +176,7 @@ public function getMultiple($keys, $default = null)
* Persists a set of key => value pairs in the cache, with an optional TTL.
*
* @param iterable $values A list of key => value pairs for a multiple-set operation.
- * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
+ * @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
* the driver supports TTL then the library may set a default value
* for it or let the driver take care of that.
* @return bool True on success and false on failure.
diff --git a/app/vendor/cakephp/cakephp/src/Cache/composer.json b/app/vendor/cakephp/cakephp/src/Cache/composer.json
index 276030307..c417e3638 100644
--- a/app/vendor/cakephp/cakephp/src/Cache/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Cache/composer.json
@@ -22,7 +22,7 @@
"source": "https://github.com/cakephp/cache"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"psr/simple-cache": "^1.0.0",
"cakephp/core": "^3.6.0"
},
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Collection.php b/app/vendor/cakephp/cakephp/src/Collection/Collection.php
index 07aa11f7a..35d3384aa 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Collection.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Collection.php
@@ -26,7 +26,6 @@
*/
class Collection extends IteratorIterator implements CollectionInterface, Serializable
{
-
use CollectionTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php b/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php
index 1d4019246..3007de752 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/CollectionInterface.php
@@ -26,7 +26,6 @@
*/
interface CollectionInterface extends Iterator, JsonSerializable
{
-
/**
* Executes the passed callable for each of the elements in this collection
* and passes both the value and key for them on each step.
@@ -42,7 +41,7 @@ interface CollectionInterface extends Iterator, JsonSerializable
*
* @param callable $c callable function that will receive each of the elements
* in this collection
- * @return \Cake\Collection\CollectionInterface
+ * @return $this
*/
public function each(callable $c);
@@ -256,7 +255,7 @@ public function extract($matcher);
* @param callable|string $callback the callback or column name to use for sorting
* @param int $type the type of comparison to perform, either SORT_STRING
* SORT_NUMERIC or SORT_NATURAL
- * @see \Cake\Collection\CollectionIterface::sortBy()
+ * @see \Cake\Collection\CollectionInterface::sortBy()
* @return mixed The value of the top element in the collection
*/
public function max($callback, $type = \SORT_NUMERIC);
@@ -762,7 +761,8 @@ public function toArray($preserveKeys = true);
public function toList();
/**
- * Convert a result set into JSON.
+ * Returns the data that can be converted to JSON. This returns the same data
+ * as `toArray()` which contains only unique keys.
*
* Part of JsonSerializable interface.
*
@@ -1113,13 +1113,12 @@ public function transpose();
* Calling this method at the same time that you are iterating this collections, for example in
* a foreach, will result in undefined behavior. Avoid doing this.
*
- *
* @return int
*/
public function count();
/**
- * Returns the number of unique keys in this iterator. This is, the number of
+ * Returns the number of unique keys in this iterator. This is the same as the number of
* elements the collection will contain after calling `toArray()`
*
* This method comes with a number of caveats. Please refer to `CollectionInterface::count()`
diff --git a/app/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php b/app/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php
index fac870082..40cbea86b 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php
@@ -39,7 +39,6 @@
*/
trait CollectionTrait
{
-
use ExtractTrait;
/**
@@ -332,7 +331,7 @@ public function sumOf($matcher = null)
*/
public function shuffle()
{
- $elements = $this->toArray();
+ $elements = $this->toList();
shuffle($elements);
return $this->newCollection($elements);
@@ -570,7 +569,7 @@ public function combine($keyPath, $valuePath, $groupPath = null)
$options = [
'keyPath' => $this->_propertyExtractor($keyPath),
'valuePath' => $this->_propertyExtractor($valuePath),
- 'groupPath' => $groupPath ? $this->_propertyExtractor($groupPath) : null
+ 'groupPath' => $groupPath ? $this->_propertyExtractor($groupPath) : null,
];
$mapper = function ($value, $key, $mapReduce) use ($options) {
@@ -741,7 +740,7 @@ public function listNested($dir = 'desc', $nestingKey = 'children')
$modes = [
'desc' => TreeIterator::SELF_FIRST,
'asc' => TreeIterator::CHILD_FIRST,
- 'leaves' => TreeIterator::LEAVES_ONLY
+ 'leaves' => TreeIterator::LEAVES_ONLY,
];
return new TreeIterator(
diff --git a/app/vendor/cakephp/cakephp/src/Collection/ExtractTrait.php b/app/vendor/cakephp/cakephp/src/Collection/ExtractTrait.php
index 840135354..5a7db8af5 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/ExtractTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/ExtractTrait.php
@@ -22,7 +22,6 @@
*/
trait ExtractTrait
{
-
/**
* Returns a callable that can be used to extract a property or column from
* an array or object based on a dot separated path.
@@ -71,8 +70,10 @@ protected function _extract($data, $path)
continue;
}
- if ($collectionTransform &&
- !($data instanceof Traversable || is_array($data))) {
+ if (
+ $collectionTransform &&
+ !($data instanceof Traversable || is_array($data))
+ ) {
return null;
}
@@ -122,7 +123,7 @@ protected function _simpleExtract($data, $path)
* @param array $conditions A key-value list of conditions to match where the
* key is the property path to get from the current item and the value is the
* value to be compared the item with.
- * @return callable
+ * @return \Closure
*/
protected function _createMatcherFilter(array $conditions)
{
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/BufferedIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/BufferedIterator.php
index cc7adf0c5..f75c89a98 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/BufferedIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/BufferedIterator.php
@@ -25,7 +25,6 @@
*/
class BufferedIterator extends Collection implements Countable, Serializable
{
-
/**
* The in-memory cache containing results from previous iterators
*
@@ -140,7 +139,7 @@ public function valid()
$this->_key = parent::key();
$this->_buffer->push([
'key' => $this->_key,
- 'value' => $this->_current
+ 'value' => $this->_current,
]);
}
@@ -158,6 +157,10 @@ public function next()
{
$this->_index++;
+ // Don't move inner iterator if we have more buffer
+ if ($this->_buffer->offsetExists($this->_index)) {
+ return;
+ }
if (!$this->_finished) {
parent::next();
}
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ExtractIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ExtractIterator.php
index 2ffe139b7..76ee05cf4 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ExtractIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ExtractIterator.php
@@ -24,7 +24,6 @@
*/
class ExtractIterator extends Collection
{
-
/**
* A callable responsible for extracting a single value for each
* item in the collection.
@@ -98,6 +97,7 @@ public function unwrap()
$callback = $this->_extractor;
$res = [];
+ /** @var \ArrayObject $iterator */
foreach ($iterator->getArrayCopy() as $k => $v) {
$res[$k] = $callback($v);
}
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/FilterIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/FilterIterator.php
index 2ff534ca4..88c3fe046 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/FilterIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/FilterIterator.php
@@ -27,7 +27,6 @@
*/
class FilterIterator extends Collection
{
-
/**
* The callback used to filter the elements in this collection
*
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/InsertIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/InsertIterator.php
index 89411169d..716d5e8c9 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/InsertIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/InsertIterator.php
@@ -24,7 +24,6 @@
*/
class InsertIterator extends Collection
{
-
/**
* The collection from which to extract the values to be inserted
*
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/MapReduce.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/MapReduce.php
index c8b6090b2..c2d54fb6f 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/MapReduce.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/MapReduce.php
@@ -26,7 +26,6 @@
*/
class MapReduce implements IteratorAggregate
{
-
/**
* Holds the shuffled results that were emitted from the map
* phase
@@ -183,6 +182,7 @@ protected function _execute()
throw new LogicException('No reducer function was provided');
}
+ /** @var callable $reducer */
$reducer = $this->_reducer;
foreach ($this->_intermediate as $key => $list) {
$reducer($list, $key, $this);
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/NestIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/NestIterator.php
index ac9e6cb3b..97cfd4188 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/NestIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/NestIterator.php
@@ -24,7 +24,6 @@
*/
class NestIterator extends Collection implements RecursiveIterator
{
-
/**
* The name of the property that contains the nested items for each element
*
@@ -48,7 +47,7 @@ public function __construct($items, $nestKey)
/**
* Returns a traversable containing the children for the current item
*
- * @return \Traversable
+ * @return \RecursiveIterator
*/
public function getChildren()
{
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/NoChildrenIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/NoChildrenIterator.php
index aaf1fe6ac..6ac011227 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/NoChildrenIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/NoChildrenIterator.php
@@ -24,7 +24,6 @@
*/
class NoChildrenIterator extends Collection implements RecursiveIterator
{
-
/**
* Returns false as there are no children iterators in this collection
*
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ReplaceIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ReplaceIterator.php
index ad9840c07..6e5c68d19 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ReplaceIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ReplaceIterator.php
@@ -24,7 +24,6 @@
*/
class ReplaceIterator extends Collection
{
-
/**
* The callback function to be used to transform values
*
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/SortIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/SortIterator.php
index d9945d35c..163beab7d 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/SortIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/SortIterator.php
@@ -39,7 +39,6 @@
*/
class SortIterator extends Collection
{
-
/**
* Wraps this iterator around the passed items so when iterated they are returned
* in order.
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/StoppableIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/StoppableIterator.php
index 7d1882c6c..ef286a77a 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/StoppableIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/StoppableIterator.php
@@ -28,7 +28,6 @@
*/
class StoppableIterator extends Collection
{
-
/**
* The condition to evaluate for each item of the collection
*
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreeIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreeIterator.php
index f4d22516f..7d7e1446b 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreeIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreeIterator.php
@@ -24,7 +24,6 @@
*/
class TreeIterator extends RecursiveIteratorIterator
{
-
use CollectionTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php
index fa72d0eab..2405e0a9c 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php
@@ -23,7 +23,6 @@
*/
class TreePrinter extends RecursiveIteratorIterator
{
-
use CollectionTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/UnfoldIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/UnfoldIterator.php
index 06a2ca6a6..ccad467d5 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/UnfoldIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/UnfoldIterator.php
@@ -26,7 +26,6 @@
*/
class UnfoldIterator extends IteratorIterator implements RecursiveIterator
{
-
/**
* A function that is passed each element in this iterator and
* must return an array or Traversable object.
diff --git a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ZipIterator.php b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ZipIterator.php
index 9c4adac0a..d638b55b9 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/Iterator/ZipIterator.php
+++ b/app/vendor/cakephp/cakephp/src/Collection/Iterator/ZipIterator.php
@@ -44,13 +44,12 @@
*/
class ZipIterator extends MultipleIterator implements CollectionInterface, Serializable
{
-
use CollectionTrait;
/**
* The function to use for zipping items together
*
- * @var callable
+ * @var callable|null
*/
protected $_callback;
@@ -87,7 +86,7 @@ public function __construct(array $sets, $callable = null)
* Returns the value resulting out of zipping all the elements for all the
* iterators with the same positional index.
*
- * @return mixed
+ * @return array|false
*/
public function current()
{
diff --git a/app/vendor/cakephp/cakephp/src/Collection/README.md b/app/vendor/cakephp/cakephp/src/Collection/README.md
index 986391317..5c9a03c16 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/README.md
+++ b/app/vendor/cakephp/cakephp/src/Collection/README.md
@@ -28,4 +28,4 @@ you have in your application as well.
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/collections.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/collections.html)
diff --git a/app/vendor/cakephp/cakephp/src/Collection/composer.json b/app/vendor/cakephp/cakephp/src/Collection/composer.json
index 47a24c47f..f638264ea 100644
--- a/app/vendor/cakephp/cakephp/src/Collection/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Collection/composer.json
@@ -23,7 +23,7 @@
"source": "https://github.com/cakephp/collection"
},
"require": {
- "php": ">=5.6.0"
+ "php": ">=5.6.0,<8.0.0"
},
"autoload": {
"psr-4": {
diff --git a/app/vendor/cakephp/cakephp/src/Command/HelpCommand.php b/app/vendor/cakephp/cakephp/src/Command/HelpCommand.php
index d4d7fbbf9..ff7850864 100644
--- a/app/vendor/cakephp/cakephp/src/Command/HelpCommand.php
+++ b/app/vendor/cakephp/cakephp/src/Command/HelpCommand.php
@@ -134,7 +134,6 @@ protected function asText($io, $commands)
/**
* @param string[] $names Names
- *
* @return string|null
*/
protected function findPrefixedName(array $names)
@@ -201,7 +200,7 @@ protected function buildOptionParser(ConsoleOptionParser $parser)
'Get the list of available commands for this application.'
)->addOption('xml', [
'help' => 'Get the listing as XML.',
- 'boolean' => true
+ 'boolean' => true,
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Console/Command.php b/app/vendor/cakephp/cakephp/src/Console/Command.php
index 0cd80bc9f..80fe20e0a 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Command.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Command.php
@@ -19,6 +19,7 @@
use Cake\Datasource\ModelAwareTrait;
use Cake\Log\LogTrait;
use Cake\ORM\Locator\LocatorAwareTrait;
+use Cake\Utility\Inflector;
use InvalidArgumentException;
use RuntimeException;
@@ -102,6 +103,25 @@ public function getName()
return $this->name;
}
+ /**
+ * Get the command name.
+ *
+ * Returns the command name based on class name.
+ * For e.g. for a command with class name `UpdateTableCommand` the default
+ * name returned would be `'update_table'`.
+ *
+ * @return string
+ */
+ public static function defaultName()
+ {
+ $pos = strrpos(static::class, '\\');
+ /** @psalm-suppress PossiblyFalseOperand */
+ $name = substr(static::class, $pos + 1, -7);
+ $name = Inflector::underscore($name);
+
+ return $name;
+ }
+
/**
* Get the option parser.
*
@@ -231,7 +251,7 @@ protected function setOutputLevel(Arguments $args, ConsoleIo $io)
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
- * @return null|int The exit code or null for success
+ * @return int|null The exit code or null for success
*/
public function execute(Arguments $args, ConsoleIo $io)
{
diff --git a/app/vendor/cakephp/cakephp/src/Console/CommandCollection.php b/app/vendor/cakephp/cakephp/src/Console/CommandCollection.php
index c7e45def4..55dbf2d7e 100644
--- a/app/vendor/cakephp/cakephp/src/Console/CommandCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Console/CommandCollection.php
@@ -62,7 +62,7 @@ public function add($name, $command)
if (!is_subclass_of($command, Shell::class) && !is_subclass_of($command, Command::class)) {
$class = is_string($command) ? $command : get_class($command);
throw new InvalidArgumentException(
- "Cannot use '$class' for command '$name' it is not a subclass of Cake\Console\Shell or Cake\Console\Command."
+ "Cannot use '$class' for command '$name'. It is not a subclass of Cake\Console\Shell or Cake\Console\Command."
);
}
if (!preg_match('/^[^\s]+(?:(?: [^\s]+){1,2})?$/ui', $name)) {
diff --git a/app/vendor/cakephp/cakephp/src/Console/CommandCollectionAwareInterface.php b/app/vendor/cakephp/cakephp/src/Console/CommandCollectionAwareInterface.php
index 89a2ade6e..885b77c50 100644
--- a/app/vendor/cakephp/cakephp/src/Console/CommandCollectionAwareInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Console/CommandCollectionAwareInterface.php
@@ -17,7 +17,6 @@
/**
* An interface for shells that take a CommandCollection
* during initialization.
- *
*/
interface CommandCollectionAwareInterface
{
diff --git a/app/vendor/cakephp/cakephp/src/Console/CommandFactory.php b/app/vendor/cakephp/cakephp/src/Console/CommandFactory.php
index 37ca0ccb7..1ae0645e2 100644
--- a/app/vendor/cakephp/cakephp/src/Console/CommandFactory.php
+++ b/app/vendor/cakephp/cakephp/src/Console/CommandFactory.php
@@ -22,7 +22,6 @@
*/
class CommandFactory implements CommandFactoryInterface
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Console/CommandRunner.php b/app/vendor/cakephp/cakephp/src/Console/CommandRunner.php
index e0ee1022e..fda74cf73 100644
--- a/app/vendor/cakephp/cakephp/src/Console/CommandRunner.php
+++ b/app/vendor/cakephp/cakephp/src/Console/CommandRunner.php
@@ -123,7 +123,7 @@ public function setAliases(array $aliases)
* - Run the requested command.
*
* @param array $argv The arguments from the CLI environment.
- * @param \Cake\Console\ConsoleIo $io The ConsoleIo instance. Used primarily for testing.
+ * @param \Cake\Console\ConsoleIo|null $io The ConsoleIo instance. Used primarily for testing.
* @return int The exit code of the command.
* @throws \RuntimeException
*/
@@ -327,9 +327,8 @@ protected function longestCommandName($commands, $argv)
*
* @param \Cake\Console\CommandCollection $commands The command collection to check.
* @param \Cake\Console\ConsoleIo $io ConsoleIo object for errors.
- * @param string $name The name
- * @return string The resolved class name
- * @throws \RuntimeException
+ * @param string|null $name The name from the CLI args.
+ * @return string The resolved name.
*/
protected function resolveName($commands, $io, $name)
{
@@ -359,7 +358,7 @@ protected function resolveName($commands, $io, $name)
* @param \Cake\Console\Command $command The command to run.
* @param array $argv The CLI arguments to invoke.
* @param \Cake\Console\ConsoleIo $io The console io
- * @return int Exit code
+ * @return int|null Exit code
*/
protected function runCommand(Command $command, array $argv, ConsoleIo $io)
{
@@ -375,7 +374,7 @@ protected function runCommand(Command $command, array $argv, ConsoleIo $io)
*
* @param \Cake\Console\Shell $shell The shell to run.
* @param array $argv The CLI arguments to invoke.
- * @return int Exit code
+ * @return int|bool|null Exit code
*/
protected function runShell(Shell $shell, array $argv)
{
@@ -384,7 +383,9 @@ protected function runShell(Shell $shell, array $argv)
return $shell->runCommand($argv, true);
} catch (StopException $e) {
- return $e->getCode();
+ $code = $e->getCode();
+
+ return $code === null ? $code : (int)$code;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/CommandScanner.php b/app/vendor/cakephp/cakephp/src/Console/CommandScanner.php
index a19cd8606..7c13b2ec3 100644
--- a/app/vendor/cakephp/cakephp/src/Console/CommandScanner.php
+++ b/app/vendor/cakephp/cakephp/src/Console/CommandScanner.php
@@ -135,11 +135,14 @@ protected function scanDir($path, $namespace, $prefix, array $hide)
continue;
}
+ if (is_subclass_of($class, Command::class)) {
+ $name = $class::defaultName();
+ }
$shells[] = [
'file' => $path . $file,
'fullName' => $prefix . $name,
'name' => $name,
- 'class' => $class
+ 'class' => $class,
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleErrorHandler.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleErrorHandler.php
index 798cffa2c..2dc820e51 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleErrorHandler.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleErrorHandler.php
@@ -25,7 +25,6 @@
*/
class ConsoleErrorHandler extends BaseErrorHandler
{
-
/**
* Standard error stream.
*
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInput.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInput.php
index 7f3b2bbab..a71b5fafd 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInput.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInput.php
@@ -19,7 +19,6 @@
*/
class ConsoleInput
{
-
/**
* Input value.
*
@@ -52,7 +51,7 @@ public function __construct($handle = 'php://stdin')
/**
* Read a value from the stream
*
- * @return mixed The value of the stream
+ * @return string|false The value of the stream
*/
public function read()
{
@@ -81,6 +80,6 @@ public function dataAvailable($timeout = 0)
$errorFds = null;
$readyFds = stream_select($readFds, $writeFds, $errorFds, $timeout);
- return ($readyFds > 0);
+ return $readyFds > 0;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php
index bc0314dfd..6296dc9be 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php
@@ -25,7 +25,6 @@
*/
class ConsoleInputArgument
{
-
/**
* Name of the argument.
*
@@ -50,7 +49,7 @@ class ConsoleInputArgument
/**
* An array of valid choices for this argument.
*
- * @var array
+ * @var string[]
*/
protected $_choices;
@@ -60,7 +59,7 @@ class ConsoleInputArgument
* @param string|array $name The long name of the option, or an array with all the properties.
* @param string $help The help text for this option
* @param bool $required Whether this argument is required. Missing required args will trigger exceptions
- * @param array $choices Valid choices for this option.
+ * @param string[] $choices Valid choices for this option.
*/
public function __construct($name, $help = '', $required = false, $choices = [])
{
@@ -153,7 +152,7 @@ public function isRequired()
* Check that $value is a valid choice for this argument.
*
* @param string $value The choice to validate.
- * @return bool
+ * @return true
* @throws \Cake\Console\Exception\ConsoleException
*/
public function validChoice($value)
@@ -161,7 +160,7 @@ public function validChoice($value)
if (empty($this->_choices)) {
return true;
}
- if (!in_array($value, $this->_choices)) {
+ if (!in_array($value, $this->_choices, true)) {
throw new ConsoleException(
sprintf(
'"%s" is not a valid value for %s. Please use one of "%s"',
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputOption.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputOption.php
index 0a6af94f4..a8ad455f7 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputOption.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputOption.php
@@ -25,7 +25,6 @@
*/
class ConsoleInputOption
{
-
/**
* Name of the option
*
@@ -57,7 +56,7 @@ class ConsoleInputOption
/**
* Default value for the option
*
- * @var mixed
+ * @var string|bool
*/
protected $_default;
@@ -71,7 +70,7 @@ class ConsoleInputOption
/**
* An array of choices for the option.
*
- * @var array
+ * @var string[]
*/
protected $_choices;
@@ -82,7 +81,7 @@ class ConsoleInputOption
* @param string $short The short alias for this option
* @param string $help The help text for this option
* @param bool $boolean Whether this option is a boolean option. Boolean options don't consume extra tokens
- * @param string $default The default value for this option.
+ * @param string|bool $default The default value for this option.
* @param string[] $choices Valid choices for this option.
* @param bool $multiple Whether this option can accept multiple value definition.
* @throws \Cake\Console\Exception\ConsoleException
@@ -184,7 +183,7 @@ public function usage()
/**
* Get the default value for this option
*
- * @return mixed
+ * @return string|bool
*/
public function defaultValue()
{
@@ -214,8 +213,8 @@ public function acceptsMultiple()
/**
* Check that a value is a valid choice for this option.
*
- * @param string $value The choice to validate.
- * @return bool
+ * @param string|bool $value The choice to validate.
+ * @return true
* @throws \Cake\Console\Exception\ConsoleException
*/
public function validChoice($value)
@@ -223,7 +222,7 @@ public function validChoice($value)
if (empty($this->_choices)) {
return true;
}
- if (!in_array($value, $this->_choices)) {
+ if (!in_array($value, $this->_choices, true)) {
throw new ConsoleException(
sprintf(
'"%s" is not a valid value for --%s. Please use one of "%s"',
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php
index 1330098c3..078072e80 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleInputSubcommand.php
@@ -26,7 +26,6 @@
*/
class ConsoleInputSubcommand
{
-
/**
* Name of the subcommand
*
@@ -112,7 +111,7 @@ public function help($width = 0)
/**
* Get the usage value for this option
*
- * @return \Cake\Console\ConsoleOptionParser|bool Either false or a ConsoleOptionParser
+ * @return \Cake\Console\ConsoleOptionParser|false Either false or a ConsoleOptionParser
*/
public function parser()
{
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php
index 77ecf33eb..88a184444 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleIo.php
@@ -29,7 +29,6 @@
*/
class ConsoleIo
{
-
/**
* The output stream
*
@@ -121,7 +120,7 @@ public function __construct(ConsoleOutput $out = null, ConsoleOutput $err = null
/**
* Get/set the current output level.
*
- * @param null|int $level The current output level.
+ * @param int|null $level The current output level.
* @return int The current output level.
*/
public function level($level = null)
@@ -136,7 +135,7 @@ public function level($level = null)
/**
* Output at the verbose level.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stdout.
*/
@@ -148,7 +147,7 @@ public function verbose($message, $newlines = 1)
/**
* Output at all levels.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stdout.
*/
@@ -168,7 +167,7 @@ public function quiet($message, $newlines = 1)
* present in most shells. Using ConsoleIo::QUIET for a message means it will always display.
* While using ConsoleIo::VERBOSE means it will only display when verbose output is toggled.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
@@ -187,14 +186,18 @@ public function out($message = '', $newlines = 1, $level = self::NORMAL)
/**
* Convenience method for out() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#ConsoleIo::out
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#ConsoleIo::out
*/
public function info($message = null, $newlines = 1, $level = self::NORMAL)
{
+ if ($message === null) {
+ deprecationWarning('ConsoleIo::info() in 4.x will not allow null anymore.');
+ }
+
$messageType = 'info';
$message = $this->wrapMessageWithType($messageType, $message);
@@ -204,13 +207,17 @@ public function info($message = null, $newlines = 1, $level = self::NORMAL)
/**
* Convenience method for err() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stderr.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#ConsoleIo::err
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#ConsoleIo::err
*/
public function warning($message = null, $newlines = 1)
{
+ if ($message === null) {
+ deprecationWarning('ConsoleIo::warning() in 4.x will not allow null anymore.');
+ }
+
$messageType = 'warning';
$message = $this->wrapMessageWithType($messageType, $message);
@@ -220,13 +227,17 @@ public function warning($message = null, $newlines = 1)
/**
* Convenience method for err() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stderr.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#ConsoleIo::err
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#ConsoleIo::err
*/
public function error($message = null, $newlines = 1)
{
+ if ($message === null) {
+ deprecationWarning('ConsoleIo::error() in 4.x will not allow null anymore.');
+ }
+
$messageType = 'error';
$message = $this->wrapMessageWithType($messageType, $message);
@@ -236,20 +247,39 @@ public function error($message = null, $newlines = 1)
/**
* Convenience method for out() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#ConsoleIo::out
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#ConsoleIo::out
*/
public function success($message = null, $newlines = 1, $level = self::NORMAL)
{
+ if ($message === null) {
+ deprecationWarning('ConsoleIo::success() in 4.x will not allow null anymore.');
+ }
+
$messageType = 'success';
$message = $this->wrapMessageWithType($messageType, $message);
return $this->out($message, $newlines, $level);
}
+ /**
+ * Halts the the current process with a StopException.
+ *
+ * @param string $message Error message.
+ * @param int $code Error code.
+ * @return void
+ * @throws \Cake\Console\Exception\StopException
+ */
+ public function abort($message, $code = Command::CODE_ERROR)
+ {
+ $this->error($message);
+
+ throw new StopException($message, $code);
+ }
+
/**
* Wraps a message with a given message type, e.g.
*
@@ -314,7 +344,7 @@ public function overwrite($message, $newlines = 1, $size = null)
* Outputs a single or multiple error messages to stderr. If no parameters
* are passed outputs just a newline.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stderr.
*/
@@ -392,7 +422,7 @@ public function outputAs($mode)
* @param string|null $style The style to get or create.
* @param array|false|null $definition The array definition of the style to change or create a style
* or false to remove a style.
- * @return array|null|true If you are getting styles, the style or null will be returned. If you are creating/modifying
+ * @return array|true|null If you are getting styles, the style or null will be returned. If you are creating/modifying
* styles true will be returned.
* @see \Cake\Console\ConsoleOutput::styles()
*/
@@ -492,7 +522,7 @@ public function setLoggers($enable)
if ($enable !== static::QUIET) {
$stdout = new ConsoleLog([
'types' => $outLevels,
- 'stream' => $this->_out
+ 'stream' => $this->_out,
]);
Log::setConfig('stdout', ['engine' => $stdout]);
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php
index b9bd90799..ef541a243 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleOptionParser.php
@@ -72,7 +72,6 @@
*/
class ConsoleOptionParser
{
-
/**
* Description text - displays before options when help is generated
*
@@ -163,18 +162,18 @@ public function __construct($command = null, $defaultOptions = true)
$this->addOption('help', [
'short' => 'h',
'help' => 'Display this help.',
- 'boolean' => true
+ 'boolean' => true,
]);
if ($defaultOptions) {
$this->addOption('verbose', [
'short' => 'v',
'help' => 'Enable verbose output.',
- 'boolean' => true
+ 'boolean' => true,
])->addOption('quiet', [
'short' => 'q',
'help' => 'Enable quiet output.',
- 'boolean' => true
+ 'boolean' => true,
]);
}
}
@@ -249,7 +248,7 @@ public function toArray()
'options' => $this->_options,
'subcommands' => $this->_subcommands,
'description' => $this->_description,
- 'epilog' => $this->_epilog
+ 'epilog' => $this->_epilog,
];
return $result;
@@ -485,7 +484,7 @@ public function addOption($name, array $options = [])
'help' => '',
'default' => null,
'boolean' => false,
- 'choices' => []
+ 'choices' => [],
];
$options += $defaults;
$option = new ConsoleInputOption($options);
@@ -542,7 +541,7 @@ public function addArgument($name, array $params = [])
'help' => '',
'index' => count($this->_args),
'required' => false,
- 'choices' => []
+ 'choices' => [],
];
$options = $params + $defaults;
$index = $options['index'];
@@ -630,7 +629,7 @@ public function addSubcommand($name, array $options = [])
$defaults = [
'name' => $name,
'help' => '',
- 'parser' => null
+ 'parser' => null,
];
$options += $defaults;
@@ -877,7 +876,7 @@ protected function getCommandError($command)
$this->rootName,
$rootCommand
),
- ''
+ '',
];
if ($bestGuess !== null) {
@@ -906,7 +905,7 @@ protected function getOptionError($option)
$bestGuess = $this->findClosestItem($option, $availableOptions);
$out = [
sprintf('Unknown option `%s`.', $option),
- ''
+ '',
];
if ($bestGuess !== null) {
diff --git a/app/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php b/app/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php
index f2d09cd34..0ba419066 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ConsoleOutput.php
@@ -45,7 +45,6 @@
*/
class ConsoleOutput
{
-
/**
* Raw output constant - no modification of output text.
*
@@ -82,8 +81,9 @@ class ConsoleOutput
protected $_output;
/**
- * The current output type. Manipulated with ConsoleOutput::outputAs();
+ * The current output type.
*
+ * @see setOutputAs() For manipulation.
* @var int
*/
protected $_outputAs = self::COLOR;
@@ -101,7 +101,7 @@ class ConsoleOutput
'blue' => 34,
'magenta' => 35,
'cyan' => 36,
- 'white' => 37
+ 'white' => 37,
];
/**
@@ -117,7 +117,7 @@ class ConsoleOutput
'blue' => 44,
'magenta' => 45,
'cyan' => 46,
- 'white' => 47
+ 'white' => 47,
];
/**
@@ -149,7 +149,7 @@ class ConsoleOutput
'success' => ['text' => 'green'],
'comment' => ['text' => 'blue'],
'question' => ['text' => 'magenta'],
- 'notice' => ['text' => 'cyan']
+ 'notice' => ['text' => 'cyan'],
];
/**
@@ -164,7 +164,8 @@ public function __construct($stream = 'php://stdout')
{
$this->_output = fopen($stream, 'wb');
- if ((DIRECTORY_SEPARATOR === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') ||
+ if (
+ (DIRECTORY_SEPARATOR === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') ||
(function_exists('posix_isatty') && !posix_isatty($this->_output))
) {
$this->_outputAs = self::PLAIN;
@@ -175,7 +176,7 @@ public function __construct($stream = 'php://stdout')
* Outputs a single or multiple messages to stdout or stderr. If no parameters
* are passed, outputs just a newline.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to output.
*/
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/ConsoleException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/ConsoleException.php
index 4af7906bb..008c297d3 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/ConsoleException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/ConsoleException.php
@@ -7,7 +7,7 @@
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link https://book.cakephp.org/3.0/en/development/errors.html#error-exception-configuration
+ * @link https://book.cakephp.org/3/en/development/errors.html#error-exception-configuration
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingHelperException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingHelperException.php
index e2530a8c5..221ff749f 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingHelperException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingHelperException.php
@@ -17,5 +17,8 @@
*/
class MissingHelperException extends ConsoleException
{
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Helper class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellException.php
index be628ec81..86724422b 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellException.php
@@ -17,6 +17,8 @@
*/
class MissingShellException extends ConsoleException
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Shell class for "%s" could not be found. If you are trying to use a plugin shell, that was loaded via $this->addPlugin(), you may need to update bin/cake.php to match https://github.com/cakephp/app/tree/master/bin/cake.php';
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellMethodException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellMethodException.php
index 50ebeb322..09198a654 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellMethodException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingShellMethodException.php
@@ -17,6 +17,8 @@
*/
class MissingShellMethodException extends ConsoleException
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = "Unknown command %1\$s %2\$s.\nFor usage try `cake %1\$s --help`";
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingTaskException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingTaskException.php
index 8dc49b7f7..4938fb5a5 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/MissingTaskException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/MissingTaskException.php
@@ -17,5 +17,8 @@
*/
class MissingTaskException extends ConsoleException
{
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Task class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/Exception/StopException.php b/app/vendor/cakephp/cakephp/src/Console/Exception/StopException.php
index 884ccf0cc..7ee61c7e3 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Exception/StopException.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Exception/StopException.php
@@ -7,7 +7,7 @@
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link https://book.cakephp.org/3.0/en/development/errors.html#error-exception-configuration
+ * @link https://book.cakephp.org/3/en/development/errors.html#error-exception-configuration
* @since 3.2.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
diff --git a/app/vendor/cakephp/cakephp/src/Console/HelpFormatter.php b/app/vendor/cakephp/cakephp/src/Console/HelpFormatter.php
index faeff5eea..7d7021c7b 100644
--- a/app/vendor/cakephp/cakephp/src/Console/HelpFormatter.php
+++ b/app/vendor/cakephp/cakephp/src/Console/HelpFormatter.php
@@ -29,7 +29,6 @@
*/
class HelpFormatter
{
-
/**
* The maximum number of arguments shown when generating usage.
*
@@ -111,7 +110,7 @@ public function text($width = 72)
$out[] = Text::wrapBlock($command->help($max), [
'width' => $width,
'indent' => str_repeat(' ', $max),
- 'indentAt' => 1
+ 'indentAt' => 1,
]);
}
$out[] = '';
@@ -128,7 +127,7 @@ public function text($width = 72)
$out[] = Text::wrapBlock($option->help($max), [
'width' => $width,
'indent' => str_repeat(' ', $max),
- 'indentAt' => 1
+ 'indentAt' => 1,
]);
}
$out[] = '';
@@ -143,7 +142,7 @@ public function text($width = 72)
$out[] = Text::wrapBlock($argument->help($max), [
'width' => $width,
'indent' => str_repeat(' ', $max),
- 'indentAt' => 1
+ 'indentAt' => 1,
]);
}
$out[] = '';
diff --git a/app/vendor/cakephp/cakephp/src/Console/HelperRegistry.php b/app/vendor/cakephp/cakephp/src/Console/HelperRegistry.php
index c832d8ab7..e20ed683d 100644
--- a/app/vendor/cakephp/cakephp/src/Console/HelperRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Console/HelperRegistry.php
@@ -21,10 +21,11 @@
/**
* Registry for Helpers. Provides features
* for lazily loading helpers.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\Console\Helper>
*/
class HelperRegistry extends ObjectRegistry
{
-
/**
* Shell to use to set params to tasks.
*
@@ -71,7 +72,7 @@ protected function _resolveClassName($class)
* and Cake\Core\ObjectRegistry::unload()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the helper is missing in.
+ * @param string|null $plugin The plugin the helper is missing in.
* @return void
* @throws \Cake\Console\Exception\MissingHelperException
*/
@@ -79,7 +80,7 @@ protected function _throwMissingClassError($class, $plugin)
{
throw new MissingHelperException([
'class' => $class,
- 'plugin' => $plugin
+ 'plugin' => $plugin,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/Console/Shell.php b/app/vendor/cakephp/cakephp/src/Console/Shell.php
index df8024bde..d910d09e0 100644
--- a/app/vendor/cakephp/cakephp/src/Console/Shell.php
+++ b/app/vendor/cakephp/cakephp/src/Console/Shell.php
@@ -38,7 +38,6 @@
*/
class Shell
{
-
use LocatorAwareTrait;
use LogTrait;
use MergeVariablesTrait;
@@ -133,7 +132,7 @@ class Shell
* Contains tasks to load and instantiate
*
* @var array|bool
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::$tasks
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::$tasks
*/
public $tasks = [];
@@ -177,7 +176,7 @@ class Shell
*
* @param \Cake\Console\ConsoleIo|null $io An io instance.
* @param \Cake\ORM\Locator\LocatorInterface|null $locator Table locator instance.
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell
*/
public function __construct(ConsoleIo $io = null, LocatorInterface $locator = null)
{
@@ -261,7 +260,7 @@ public function io(ConsoleIo $io = null)
* allows configuration of tasks prior to shell execution
*
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Cake\Console\ConsoleOptionParser::initialize
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Cake\Console\ConsoleOptionParser::initialize
*/
public function initialize()
{
@@ -276,7 +275,7 @@ public function initialize()
* or otherwise modify the pre-command flow.
*
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Cake\Console\ConsoleOptionParser::startup
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Cake\Console\ConsoleOptionParser::startup
*/
public function startup()
{
@@ -336,7 +335,7 @@ protected function _validateTasks()
*
* @param string $task The task name to check.
* @return bool Success
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#shell-tasks
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#shell-tasks
*/
public function hasTask($task)
{
@@ -348,7 +347,7 @@ public function hasTask($task)
*
* @param string $name The method name to check.
* @return bool
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#shell-tasks
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#shell-tasks
*/
public function hasMethod($name)
{
@@ -404,7 +403,7 @@ public function hasMethod($name)
* ]);`
*
* @return int The cli command exit code. 0 is success.
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#invoking-other-shells-from-your-shell
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#invoking-other-shells-from-your-shell
*/
public function dispatchShell()
{
@@ -478,7 +477,7 @@ public function parseDispatchArguments($args)
* Built-in extra parameter is :
* - `requested` : if used, will prevent the Shell welcome message to be displayed
* @return int|bool|null
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#the-cakephp-console
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#the-cakephp-console
*/
public function runCommand($argv, $autoMethod = false, $extra = [])
{
@@ -587,7 +586,7 @@ protected function _displayHelp($command)
* By overriding this method you can configure the ConsoleOptionParser before returning it.
*
* @return \Cake\Console\ConsoleOptionParser
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#configuring-options-and-generating-help
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#configuring-options-and-generating-help
*/
public function getOptionParser()
{
@@ -640,7 +639,7 @@ public function param($name)
* @param string|array|null $options Array or string of options.
* @param string|null $default Default input value.
* @return string|null Either the default value, or the user-provided input.
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::in
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::in
*/
public function in($prompt, $options = null, $default = null)
{
@@ -668,7 +667,7 @@ public function in($prompt, $options = null, $default = null)
* @param int|array $options Array of options to use, or an integer to wrap the text to.
* @return string Wrapped / indented text
* @see \Cake\Utility\Text::wrap()
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::wrapText
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::wrapText
*/
public function wrapText($text, $options = [])
{
@@ -678,7 +677,7 @@ public function wrapText($text, $options = [])
/**
* Output at the verbose level.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stdout.
*/
@@ -690,7 +689,7 @@ public function verbose($message, $newlines = 1)
/**
* Output at all levels.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stdout.
*/
@@ -710,11 +709,11 @@ public function quiet($message, $newlines = 1)
* present in most shells. Using Shell::QUIET for a message means it will always display.
* While using Shell::VERBOSE means it will only display when verbose output is toggled.
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::out
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::out
*/
public function out($message = null, $newlines = 1, $level = Shell::NORMAL)
{
@@ -725,7 +724,7 @@ public function out($message = null, $newlines = 1, $level = Shell::NORMAL)
* Outputs a single or multiple error messages to stderr. If no parameters
* are passed outputs just a newline.
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stderr.
*/
@@ -737,11 +736,11 @@ public function err($message = null, $newlines = 1)
/**
* Convenience method for out() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::out
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#Shell::out
*/
public function info($message = null, $newlines = 1, $level = Shell::NORMAL)
{
@@ -751,10 +750,10 @@ public function info($message = null, $newlines = 1, $level = Shell::NORMAL)
/**
* Convenience method for err() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool The number of bytes returned from writing to stderr.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::err
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#Shell::err
*/
public function warn($message = null, $newlines = 1)
{
@@ -764,11 +763,11 @@ public function warn($message = null, $newlines = 1)
/**
* Convenience method for out() that wraps message between tag
*
- * @param string|array|null $message A string or an array of strings to output
+ * @param string|string[]|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
* @return int|bool The number of bytes returned from writing to stdout.
- * @see https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::out
+ * @see https://book.cakephp.org/3/en/console-and-shells.html#Shell::out
*/
public function success($message = null, $newlines = 1, $level = Shell::NORMAL)
{
@@ -805,7 +804,7 @@ protected function wrapMessageWithType($messageType, $message)
*
* @param int $multiplier Number of times the linefeed sequence should be repeated
* @return string
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::nl
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::nl
*/
public function nl($multiplier = 1)
{
@@ -818,7 +817,7 @@ public function nl($multiplier = 1)
* @param int $newlines Number of newlines to pre- and append
* @param int $width Width of the line, defaults to 63
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::hr
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::hr
*/
public function hr($newlines = 0, $width = 63)
{
@@ -827,13 +826,13 @@ public function hr($newlines = 0, $width = 63)
/**
* Displays a formatted error message
- * and exits the application with status code 1
+ * and exits the application with an error code.
*
* @param string $message The error message
* @param int $exitCode The exit code for the shell task.
* @throws \Cake\Console\Exception\StopException
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#styling-output
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#styling-output
*/
public function abort($message, $exitCode = self::CODE_ERROR)
{
@@ -850,7 +849,7 @@ public function abort($message, $exitCode = self::CODE_ERROR)
* @param int $exitCode The exit code for the shell task.
* @throws \Cake\Console\Exception\StopException
* @return int Error code
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#styling-output
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#styling-output
* @deprecated 3.2.0 Use Shell::abort() instead.
*/
public function error($title, $message = null, $exitCode = self::CODE_ERROR)
@@ -871,7 +870,7 @@ public function error($title, $message = null, $exitCode = self::CODE_ERROR)
* Clear the console
*
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#console-output
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#console-output
*/
public function clear()
{
@@ -892,7 +891,7 @@ public function clear()
* @param string $path Where to put the file.
* @param string $contents Content to put in the file.
* @return bool Success
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#creating-files
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#creating-files
*/
public function createFile($path, $contents)
{
@@ -953,7 +952,7 @@ public function createFile($path, $contents)
*
* @param string $file Absolute file path
* @return string short path
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::shortPath
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#Shell::shortPath
*/
public function shortPath($file)
{
diff --git a/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php b/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php
index 03399ca56..851407fd3 100644
--- a/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php
+++ b/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php
@@ -31,7 +31,6 @@
*/
class ShellDispatcher
{
-
/**
* Contains arguments parsed from the command line.
*
@@ -354,7 +353,7 @@ protected function _handleAlias($shell)
* Check if a shell class exists for the given name.
*
* @param string $shell The shell name to look for.
- * @return string|bool Either the classname or false.
+ * @return string|false Either the classname or false.
*/
protected function _shellExists($shell)
{
diff --git a/app/vendor/cakephp/cakephp/src/Console/TaskRegistry.php b/app/vendor/cakephp/cakephp/src/Console/TaskRegistry.php
index 1655d989a..e19230268 100644
--- a/app/vendor/cakephp/cakephp/src/Console/TaskRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Console/TaskRegistry.php
@@ -21,10 +21,11 @@
/**
* Registry for Tasks. Provides features
* for lazily loading tasks.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\Console\Shell>
*/
class TaskRegistry extends ObjectRegistry
{
-
/**
* Shell to use to set params to tasks.
*
@@ -62,7 +63,7 @@ protected function _resolveClassName($class)
* and Cake\Core\ObjectRegistry::unload()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the task is missing in.
+ * @param string|null $plugin The plugin the task is missing in.
* @return void
* @throws \Cake\Console\Exception\MissingTaskException
*/
@@ -70,7 +71,7 @@ protected function _throwMissingClassError($class, $plugin)
{
throw new MissingTaskException([
'class' => $class,
- 'plugin' => $plugin
+ 'plugin' => $plugin,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component.php b/app/vendor/cakephp/cakephp/src/Controller/Component.php
index 726e1b64a..a6f1064db 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component.php
@@ -53,7 +53,7 @@
* While the controller is not an explicit argument for the callback methods it
* is the subject of each event and can be fetched using Event::getSubject().
*
- * @link https://book.cakephp.org/3.0/en/controllers/components.html
+ * @link https://book.cakephp.org/3/en/controllers/components.html
* @see \Cake\Controller\Controller::$components
*/
class Component implements EventListenerInterface
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php
index 9420bdd38..3264b505b 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php
@@ -34,16 +34,17 @@
*
* @property \Cake\Controller\Component\RequestHandlerComponent $RequestHandler
* @property \Cake\Controller\Component\FlashComponent $Flash
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html
*/
class AuthComponent extends Component
{
-
use EventDispatcherTrait;
/**
* The query string key used for remembering the referrered page when getting
* redirected to login.
+ *
+ * @var string
*/
const QUERY_STRING_REDIRECT = 'redirect';
@@ -165,7 +166,7 @@ class AuthComponent extends Component
'authError' => null,
'unauthorizedRedirect' => true,
'storage' => 'Session',
- 'checkAuthIn' => 'Controller.startup'
+ 'checkAuthIn' => 'Controller.startup',
];
/**
@@ -321,7 +322,8 @@ public function authCheck(Event $event)
return $result;
}
- if ($isLoginAction ||
+ if (
+ $isLoginAction ||
empty($this->_config['authorize']) ||
$this->isAuthorized($this->user())
) {
@@ -489,15 +491,15 @@ protected function _setDefaults()
'flash' => [
'element' => 'error',
'key' => 'flash',
- 'params' => ['class' => 'error']
+ 'params' => ['class' => 'error'],
],
'loginAction' => [
'controller' => 'Users',
'action' => 'login',
- 'plugin' => null
+ 'plugin' => null,
],
'logoutRedirect' => $this->_config['loginAction'],
- 'authError' => __d('cake', 'You are not authorized to access that location.')
+ 'authError' => __d('cake', 'You are not authorized to access that location.'),
];
$config = $this->getConfig();
@@ -618,7 +620,7 @@ public function getAuthorize($alias)
*
* @param string|string[]|null $actions Controller action name or array of actions
* @return void
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#making-actions-public
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#making-actions-public
*/
public function allow($actions = null)
{
@@ -649,7 +651,7 @@ public function allow($actions = null)
* @param string|string[]|null $actions Controller action name or array of actions
* @return void
* @see \Cake\Controller\Component\AuthComponent::allow()
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#making-actions-require-authorization
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#making-actions-require-authorization
*/
public function deny($actions = null)
{
@@ -675,7 +677,7 @@ public function deny($actions = null)
*
* @param array|\ArrayAccess $user User data.
* @return void
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#identifying-users-and-logging-them-in
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#identifying-users-and-logging-them-in
*/
public function setUser($user)
{
@@ -689,7 +691,7 @@ public function setUser($user)
* which the authenticate classes can listen for and perform custom logout logic.
*
* @return string Normalized config `logoutRedirect`
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#logging-users-out
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#logging-users-out
*/
public function logout()
{
@@ -709,7 +711,7 @@ public function logout()
*
* @param string|null $key Field to retrieve. Leave null to get entire User record.
* @return mixed|null Either User record or null if no user is logged in, or retrieved field if key is specified.
- * @link https://book.cakephp.org/3.0/en/controllers/components/authentication.html#accessing-the-logged-in-user
+ * @link https://book.cakephp.org/3/en/controllers/components/authentication.html#accessing-the-logged-in-user
*/
public function user($key = null)
{
@@ -811,7 +813,7 @@ public function redirectUrl($url = null)
* Triggers `Auth.afterIdentify` event which the authenticate classes can listen
* to.
*
- * @return array|bool User record data, or false, if the user could not be identified.
+ * @return array|false User record data, or false, if the user could not be identified.
*/
public function identify()
{
@@ -960,7 +962,6 @@ public function __set($name, $value)
* Getter for authenticate objects. Will return a particular authenticate object.
*
* @param string $alias Alias for the authenticate object
- *
* @return \Cake\Auth\BaseAuthenticate|null
*/
public function getAuthenticate($alias)
@@ -975,7 +976,7 @@ public function getAuthenticate($alias)
/**
* Set a flash message. Uses the Flash component with values from `flash` config.
*
- * @param string $message The message to set.
+ * @param string|false $message The message to set. False to skip.
* @return void
*/
public function flash($message)
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/CookieComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/CookieComponent.php
index 795350c9e..d45c3ceec 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/CookieComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/CookieComponent.php
@@ -32,7 +32,7 @@
* - Store non-scalar data.
* - Use hash compatible syntax to read/write/delete values.
*
- * @link https://book.cakephp.org/3.0/en/controllers/components/cookie.html
+ * @link https://book.cakephp.org/3/en/controllers/components/cookie.html
* @deprecated 3.5.0 Use Cake\Http\Middleware\EncryptedCookieMiddleware and Cake\Http\Cookie\Cookie methods instead.
*/
class CookieComponent extends Component
@@ -154,7 +154,7 @@ public function initialize(array $config)
* ```
*
* @param string $keyname The top level keyname to configure.
- * @param null|string|array $option Either the option name to set, or an array of options to set,
+ * @param array|string|null $option Either the option name to set, or an array of options to set,
* or null to read config options for a given key.
* @param string|null $value Either the value to set, or empty when $option is an array.
* @return array|null
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/CsrfComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/CsrfComponent.php
index 5301b4da9..abd6ca58d 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/CsrfComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/CsrfComponent.php
@@ -41,7 +41,6 @@
*/
class CsrfComponent extends Component
{
-
/**
* Default config for the CSRF handling.
*
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php
index 62bf7bd5f..013713215 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php
@@ -30,7 +30,6 @@
*/
class FlashComponent extends Component
{
-
/**
* The Session object instance
*
@@ -49,7 +48,7 @@ class FlashComponent extends Component
'element' => 'default',
'params' => [],
'clear' => false,
- 'duplicate' => true
+ 'duplicate' => true,
];
/**
@@ -125,7 +124,7 @@ public function set($message, array $options = [])
'message' => $message,
'key' => $options['key'],
'element' => $options['element'],
- 'params' => $options['params']
+ 'params' => $options['params'],
];
$this->getSession()->write('Flash.' . $options['key'], $messages);
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php
index e8b769f06..d70af2fe4 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/PaginatorComponent.php
@@ -29,12 +29,11 @@
*
* You configure pagination when calling paginate(). See that method for more details.
*
- * @link https://book.cakephp.org/3.0/en/controllers/components/pagination.html
+ * @link https://book.cakephp.org/3/en/controllers/components/pagination.html
* @mixin \Cake\Datasource\Paginator
*/
class PaginatorComponent extends Component
{
-
/**
* Default pagination settings.
*
@@ -54,7 +53,7 @@ class PaginatorComponent extends Component
'page' => 1,
'limit' => 20,
'maxLimit' => 100,
- 'whitelist' => ['limit', 'sort', 'page', 'direction']
+ 'whitelist' => ['limit', 'sort', 'page', 'direction'],
];
/**
@@ -241,7 +240,7 @@ public function mergeOptions($alias, $settings)
* Set paginator instance.
*
* @param \Cake\Datasource\Paginator $paginator Paginator instance.
- * @return self
+ * @return $this
*/
public function setPaginator(Paginator $paginator)
{
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php
index 85482689a..1467dfa0c 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/RequestHandlerComponent.php
@@ -36,11 +36,10 @@
* and the like. These units have no use for AJAX requests, and this Component can tell how Cake
* should respond to the different needs of a handheld computer and a desktop machine.
*
- * @link https://book.cakephp.org/3.0/en/controllers/components/request-handling.html
+ * @link https://book.cakephp.org/3/en/controllers/components/request-handling.html
*/
class RequestHandlerComponent extends Component
{
-
/**
* @var bool
* @deprecated 3.4.0 Unused. Will be removed in 4.0.0
@@ -58,7 +57,7 @@ class RequestHandlerComponent extends Component
public $ext;
/**
- * The template to use when rendering the given content type.
+ * The template type to use when rendering the given content type.
*
* @var string|null
*/
@@ -83,7 +82,7 @@ class RequestHandlerComponent extends Component
'checkHttpCache' => true,
'viewClassMap' => [],
'inputTypeMap' => [],
- 'enableBeforeRedirect' => true
+ 'enableBeforeRedirect' => true,
];
/**
@@ -107,12 +106,12 @@ public function __construct(ComponentRegistry $registry, array $config = [])
'viewClassMap' => [
'json' => 'Json',
'xml' => 'Xml',
- 'ajax' => 'Ajax'
+ 'ajax' => 'Ajax',
],
'inputTypeMap' => [
'json' => ['json_decode', true],
'xml' => [[$this, 'convertXml']],
- ]
+ ],
];
parent::__construct($registry, $config);
}
@@ -288,14 +287,14 @@ public function beforeRedirect(Event $event, $url, Response $response)
}
/** @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
- $response->body($controller->requestAction($url, [
+ $response = $response->withStringBody($controller->requestAction($url, [
'return',
'bare' => false,
'environment' => [
- 'REQUEST_METHOD' => 'GET'
+ 'REQUEST_METHOD' => 'GET',
],
'query' => $query,
- 'cookies' => $request->getCookieParams()
+ 'cookies' => $request->getCookieParams(),
]));
return $response->withStatus(200);
@@ -343,7 +342,8 @@ public function beforeRender(Event $event)
$response = $response->withCharset(Configure::read('App.encoding'));
}
- if ($this->_config['checkHttpCache'] &&
+ if (
+ $this->_config['checkHttpCache'] &&
$response->checkNotModified($request)
) {
$controller->setResponse($response);
@@ -498,7 +498,8 @@ public function requestedWith($type = null)
$request = $controller->getRequest();
$response = $controller->getResponse();
- if (!$request->is('post') &&
+ if (
+ !$request->is('post') &&
!$request->is('put') &&
!$request->is('patch') &&
!$request->is('delete')
@@ -724,7 +725,7 @@ public function responseType()
* Maps a content type alias back to its mime-type(s)
*
* @param string|array $alias String alias to convert back into a content type. Or an array of aliases to map.
- * @return string|null|array Null on an undefined alias. String value of the mapped alias type. If an
+ * @return string|array|null Null on an undefined alias. String value of the mapped alias type. If an
* alias maps to more than one content type, the first one will be returned. If an array is provided
* for $alias, an array of mapped types will be returned.
*/
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php b/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php
index d59efb3a6..ed5d6e485 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Component/SecurityComponent.php
@@ -35,13 +35,14 @@
* - Requiring that SSL be used.
* - Limiting cross controller communication.
*
- * @link https://book.cakephp.org/3.0/en/controllers/components/security.html
+ * @link https://book.cakephp.org/3/en/controllers/components/security.html
*/
class SecurityComponent extends Component
{
-
/**
* Default message used for exceptions thrown
+ *
+ * @var string
*/
const DEFAULT_EXCEPTION_MESSAGE = 'The request has been black-holed';
@@ -75,7 +76,7 @@ class SecurityComponent extends Component
'allowedActions' => [],
'unlockedFields' => [],
'unlockedActions' => [],
- 'validatePost' => true
+ 'validatePost' => true,
];
/**
@@ -116,7 +117,8 @@ public function startup(Event $event)
throw new AuthSecurityException(sprintf('Action %s is defined as the blackhole callback.', $this->_action));
}
- if (!in_array($this->_action, (array)$this->_config['unlockedActions']) &&
+ if (
+ !in_array($this->_action, (array)$this->_config['unlockedActions']) &&
$hasData &&
$isNotRequestAction &&
$this->_config['validatePost']
@@ -183,7 +185,7 @@ public function requireAuth($actions)
* @param \Cake\Controller\Exception\SecurityException|null $exception Additional debug info describing the cause
* @return mixed If specified, controller blackHoleCallback's response, or no return otherwise
* @see \Cake\Controller\Component\SecurityComponent::$blackHoleCallback
- * @link https://book.cakephp.org/3.0/en/controllers/components/security.html#handling-blackhole-callbacks
+ * @link https://book.cakephp.org/3/en/controllers/components/security.html#handling-blackhole-callbacks
* @throws \Cake\Http\Exception\BadRequestException
*/
public function blackHole(Controller $controller, $error = '', SecurityException $exception = null)
@@ -237,7 +239,8 @@ protected function _requireMethod($method, $actions = [])
*/
protected function _secureRequired(Controller $controller)
{
- if (is_array($this->_config['requireSecure']) &&
+ if (
+ is_array($this->_config['requireSecure']) &&
!empty($this->_config['requireSecure'])
) {
$requireSecure = $this->_config['requireSecure'];
@@ -264,7 +267,8 @@ protected function _secureRequired(Controller $controller)
protected function _authRequired(Controller $controller)
{
$request = $controller->getRequest();
- if (is_array($this->_config['requireAuth']) &&
+ if (
+ is_array($this->_config['requireAuth']) &&
!empty($this->_config['requireAuth']) &&
$request->getData()
) {
@@ -279,8 +283,10 @@ protected function _authRequired(Controller $controller)
if ($this->session->check('_Token')) {
$tData = $this->session->read('_Token');
- if (!empty($tData['allowedControllers']) &&
- !in_array($request->getParam('controller'), $tData['allowedControllers'])) {
+ if (
+ !empty($tData['allowedControllers']) &&
+ !in_array($request->getParam('controller'), $tData['allowedControllers'])
+ ) {
throw new AuthSecurityException(
sprintf(
'Controller \'%s\' was not found in allowed controllers: \'%s\'.',
@@ -289,7 +295,8 @@ protected function _authRequired(Controller $controller)
)
);
}
- if (!empty($tData['allowedActions']) &&
+ if (
+ !empty($tData['allowedActions']) &&
!in_array($request->getParam('action'), $tData['allowedActions'])
) {
throw new AuthSecurityException(
@@ -353,6 +360,9 @@ protected function _validToken(Controller $controller)
if (!isset($check['_Token']['fields'])) {
throw new AuthSecurityException(sprintf($message, '_Token.fields'));
}
+ if (!is_string($check['_Token']['fields'])) {
+ throw new AuthSecurityException("'_Token.fields' was invalid.");
+ }
if (!isset($check['_Token']['unlocked'])) {
throw new AuthSecurityException(sprintf($message, '_Token.unlocked'));
}
@@ -393,7 +403,7 @@ protected function _hashParts(Controller $controller)
Router::url($request->getRequestTarget()),
serialize($fieldList),
$unlocked,
- $session->id()
+ $session->id(),
];
}
@@ -587,7 +597,7 @@ public function generateToken(ServerRequest $request)
$this->session->write('_Token', $token);
return $request->withParam('_Token', [
- 'unlockedFields' => $token['unlockedFields']
+ 'unlockedFields' => $token['unlockedFields'],
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php b/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php
index f395c8c22..05a915531 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php
@@ -24,16 +24,17 @@
* ComponentRegistry is a registry for loaded components
*
* Handles loading, constructing and binding events for component class objects.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\Controller\Component>
*/
class ComponentRegistry extends ObjectRegistry implements EventDispatcherInterface
{
-
use EventDispatcherTrait;
/**
* The controller that this collection was initialized with.
*
- * @var \Cake\Controller\Controller
+ * @var \Cake\Controller\Controller|null
*/
protected $_Controller;
@@ -52,7 +53,7 @@ public function __construct(Controller $controller = null)
/**
* Get the controller associated with the collection.
*
- * @return \Cake\Controller\Controller Controller instance
+ * @return \Cake\Controller\Controller|null Controller instance or null if not set.
*/
public function getController()
{
@@ -63,12 +64,14 @@ public function getController()
* Set the controller associated with the collection.
*
* @param \Cake\Controller\Controller $controller Controller instance.
- * @return void
+ * @return $this
*/
public function setController(Controller $controller)
{
$this->_Controller = $controller;
$this->setEventManager($controller->getEventManager());
+
+ return $this;
}
/**
@@ -91,7 +94,7 @@ protected function _resolveClassName($class)
* and Cake\Core\ObjectRegistry::unload()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the component is missing in.
+ * @param string|null $plugin The plugin the component is missing in.
* @return void
* @throws \Cake\Controller\Exception\MissingComponentException
*/
@@ -99,7 +102,7 @@ protected function _throwMissingClassError($class, $plugin)
{
throw new MissingComponentException([
'class' => $class . 'Component',
- 'plugin' => $plugin
+ 'plugin' => $plugin,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Controller.php b/app/vendor/cakephp/cakephp/src/Controller/Controller.php
index df07d6bac..f40114984 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Controller.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Controller.php
@@ -82,11 +82,10 @@
* @property \Cake\Controller\Component\RequestHandlerComponent $RequestHandler
* @property \Cake\Controller\Component\SecurityComponent $Security
* @method bool isAuthorized($user)
- * @link https://book.cakephp.org/3.0/en/controllers.html
+ * @link https://book.cakephp.org/3/en/controllers.html
*/
class Controller implements EventListenerInterface, EventDispatcherInterface
{
-
use EventDispatcherTrait;
use LocatorAwareTrait;
use LogTrait;
@@ -114,8 +113,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
* ```
*
* @var array
- * @link https://book.cakephp.org/3.0/en/controllers.html#configuring-helpers-to-load
- *
+ * @link https://book.cakephp.org/3/en/controllers.html#configuring-helpers-to-load
* @deprecated 3.0.0 You should configure helpers in your AppView::initialize() method.
*/
public $helpers = [];
@@ -128,7 +126,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
* Deprecated 3.6.0: The property will become protected in 4.0.0. Use getRequest()/setRequest instead.
*
* @var \Cake\Http\ServerRequest
- * @link https://book.cakephp.org/3.0/en/controllers/request-response.html#request
+ * @link https://book.cakephp.org/3/en/controllers/request-response.html#request
*/
public $request;
@@ -138,7 +136,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
* Deprecated 3.6.0: The property will become protected in 4.0.0. Use getResponse()/setResponse instead.
* @var \Cake\Http\Response
- * @link https://book.cakephp.org/3.0/en/controllers/request-response.html#response
+ * @link https://book.cakephp.org/3/en/controllers/request-response.html#response
*/
public $response;
@@ -147,7 +145,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
*
* @var string
*/
- protected $_responseClass = 'Cake\Http\Response';
+ protected $_responseClass = Response::class;
/**
* Settings for pagination.
@@ -185,8 +183,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
* ```
*
* @var array
- * @link https://book.cakephp.org/3.0/en/controllers/components.html
- *
+ * @link https://book.cakephp.org/3/en/controllers/components.html
* @deprecated 3.0.0 You should configure components in your Controller::initialize() method.
*/
public $components = [];
@@ -208,7 +205,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
* @deprecated 3.7.0 Use ViewBuilder::setOptions() or any one of it's setter methods instead.
*/
protected $_validViewOptions = [
- 'passedArgs'
+ 'passedArgs',
];
/**
@@ -295,7 +292,6 @@ public function initialize()
* If called with the first parameter, it will be set as the controller $this->_components property
*
* @param \Cake\Controller\ComponentRegistry|null $components Component registry.
- *
* @return \Cake\Controller\ComponentRegistry
*/
public function components($components = null)
@@ -402,7 +398,7 @@ public function __set($name, $value)
{
$deprecated = [
'name' => 'setName',
- 'plugin' => 'setPlugin'
+ 'plugin' => 'setPlugin',
];
if (isset($deprecated[$name])) {
$method = $deprecated[$name];
@@ -604,7 +600,7 @@ public function invokeAction()
'plugin' => $request->getParam('plugin'),
]);
}
- /* @var callable $callable */
+ /** @var callable $callable */
$callable = [$this, $request->getParam('action')];
$result = $callable(...array_values($request->getParam('pass')));
@@ -708,11 +704,10 @@ public function shutdownProcess()
/**
* Redirects to given $url, after turning off $this->autoRender.
*
- * @param string|array $url A string or array-based URL pointing to another location within the app,
- * or an absolute URL
- * @param int $status HTTP status code (eg: 301)
+ * @param string|array|\Psr\Http\Message\UriInterface $url A string, array-based URL or UriInterface instance.
+ * @param int $status HTTP status code. Defaults to `302`.
* @return \Cake\Http\Response|null
- * @link https://book.cakephp.org/3.0/en/controllers.html#Controller::redirect
+ * @link https://book.cakephp.org/3/en/controllers.html#Controller::redirect
*/
public function redirect($url, $status = 302)
{
@@ -766,7 +761,7 @@ public function setAction($action, ...$args)
* @param string|null $view View to use for rendering
* @param string|null $layout Layout to use
* @return \Cake\Http\Response A response object containing the rendered view.
- * @link https://book.cakephp.org/3.0/en/controllers.html#rendering-a-view
+ * @link https://book.cakephp.org/3/en/controllers.html#rendering-a-view
*/
public function render($view = null, $layout = null)
{
@@ -862,7 +857,7 @@ public function referer($default = null, $local = false)
* (e.g: Table instance, 'TableName' or a Query object)
* @param array $settings The settings/configuration used for pagination.
* @return \Cake\ORM\ResultSet|\Cake\Datasource\ResultSetInterface Query results
- * @link https://book.cakephp.org/3.0/en/controllers.html#paginating-a-model
+ * @link https://book.cakephp.org/3/en/controllers.html#paginating-a-model
* @throws \RuntimeException When no compatible table object can be found.
*/
public function paginate($object = null, array $settings = [])
@@ -923,7 +918,7 @@ public function isAction($action)
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Http\Response|null
- * @link https://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
+ * @link https://book.cakephp.org/3/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeFilter(Event $event)
{
@@ -936,7 +931,7 @@ public function beforeFilter(Event $event)
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Http\Response|null
- * @link https://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
+ * @link https://book.cakephp.org/3/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeRender(Event $event)
{
@@ -957,7 +952,7 @@ public function beforeRender(Event $event)
* or an absolute URL
* @param \Cake\Http\Response $response The response object.
* @return \Cake\Http\Response|null
- * @link https://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
+ * @link https://book.cakephp.org/3/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeRedirect(Event $event, $url, Response $response)
{
@@ -969,7 +964,7 @@ public function beforeRedirect(Event $event, $url, Response $response)
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Http\Response|null
- * @link https://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
+ * @link https://book.cakephp.org/3/en/controllers.html#request-life-cycle-callbacks
*/
public function afterFilter(Event $event)
{
diff --git a/app/vendor/cakephp/cakephp/src/Controller/ErrorController.php b/app/vendor/cakephp/cakephp/src/Controller/ErrorController.php
index 51b52957a..dfd19a78d 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/ErrorController.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/ErrorController.php
@@ -23,7 +23,6 @@
*/
class ErrorController extends Controller
{
-
/**
* Initialization hook method.
*
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Exception/AuthSecurityException.php b/app/vendor/cakephp/cakephp/src/Controller/Exception/AuthSecurityException.php
index f902d5443..6db3791cc 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Exception/AuthSecurityException.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Exception/AuthSecurityException.php
@@ -19,6 +19,7 @@ class AuthSecurityException extends SecurityException
{
/**
* Security Exception type
+ *
* @var string
*/
protected $_type = 'auth';
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingActionException.php b/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingActionException.php
index c6653539b..fbc0b87de 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingActionException.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingActionException.php
@@ -20,7 +20,6 @@
*/
class MissingActionException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingComponentException.php b/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingComponentException.php
index 574e70731..b67da8340 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingComponentException.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Exception/MissingComponentException.php
@@ -19,6 +19,8 @@
*/
class MissingComponentException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Component class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Controller/Exception/SecurityException.php b/app/vendor/cakephp/cakephp/src/Controller/Exception/SecurityException.php
index efcd18aea..98a230176 100644
--- a/app/vendor/cakephp/cakephp/src/Controller/Exception/SecurityException.php
+++ b/app/vendor/cakephp/cakephp/src/Controller/Exception/SecurityException.php
@@ -21,6 +21,7 @@ class SecurityException extends BadRequestException
{
/**
* Security Exception type
+ *
* @var string
*/
protected $_type = 'secure';
@@ -28,7 +29,7 @@ class SecurityException extends BadRequestException
/**
* Reason for request blackhole
*
- * @var string
+ * @var string|null
*/
protected $_reason;
@@ -57,17 +58,19 @@ public function setMessage($message)
* Set Reason
*
* @param string|null $reason Reason details
- * @return void
+ * @return $this
*/
public function setReason($reason = null)
{
$this->_reason = $reason;
+
+ return $this;
}
/**
* Get Reason
*
- * @return string
+ * @return string|null
*/
public function getReason()
{
diff --git a/app/vendor/cakephp/cakephp/src/Core/App.php b/app/vendor/cakephp/cakephp/src/Core/App.php
index b18d09c9c..14fdc1d6f 100644
--- a/app/vendor/cakephp/cakephp/src/Core/App.php
+++ b/app/vendor/cakephp/cakephp/src/Core/App.php
@@ -36,11 +36,10 @@
* Plugins can be located with App as well. Using Plugin::path('DebugKit') for example, will
* give you the full path to the DebugKit plugin.
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/app.html
+ * @link https://book.cakephp.org/3/en/core-libraries/app.html
*/
class App
{
-
/**
* Return the class name namespaced. This method checks if the class is defined on the
* application/plugin, otherwise try to load from the CakePHP core
@@ -48,7 +47,7 @@ class App
* @param string $class Class name
* @param string $type Type of class
* @param string $suffix Class name suffix
- * @return false|string False if the class is not found or namespaced class name
+ * @return string|false False if the class is not found or namespaced class name
*/
public static function className($class, $type = '', $suffix = '')
{
@@ -129,7 +128,7 @@ public static function shortName($class, $type, $suffix = '')
$nonPluginNamespaces = [
'Cake',
- str_replace('\\', '/', Configure::read('App.namespace'))
+ str_replace('\\', '/', Configure::read('App.namespace')),
];
if (in_array($pluginName, $nonPluginNamespaces)) {
return $name;
@@ -172,8 +171,8 @@ protected static function _classExistsInBase($name, $namespace)
*
* @param string $type type of path
* @param string|null $plugin name of plugin
- * @return array
- * @link https://book.cakephp.org/3.0/en/core-libraries/app.html#finding-paths-to-namespaces
+ * @return string[]
+ * @link https://book.cakephp.org/3/en/core-libraries/app.html#finding-paths-to-namespaces
*/
public static function path($type, $plugin = null)
{
@@ -205,7 +204,7 @@ public static function path($type, $plugin = null)
* Will return the full path to the cache engines package.
*
* @param string $type Package type.
- * @return array Full path to package
+ * @return string[] Full path to package
*/
public static function core($type)
{
diff --git a/app/vendor/cakephp/cakephp/src/Core/BasePlugin.php b/app/vendor/cakephp/cakephp/src/Core/BasePlugin.php
index 6d78a3fd3..5170ed6c4 100644
--- a/app/vendor/cakephp/cakephp/src/Core/BasePlugin.php
+++ b/app/vendor/cakephp/cakephp/src/Core/BasePlugin.php
@@ -24,7 +24,6 @@
*/
class BasePlugin implements PluginInterface
{
-
/**
* Do bootstrapping or not
*
diff --git a/app/vendor/cakephp/cakephp/src/Core/ClassLoader.php b/app/vendor/cakephp/cakephp/src/Core/ClassLoader.php
index 2f5bdefc7..ecd898048 100644
--- a/app/vendor/cakephp/cakephp/src/Core/ClassLoader.php
+++ b/app/vendor/cakephp/cakephp/src/Core/ClassLoader.php
@@ -18,7 +18,6 @@
*/
class ClassLoader
{
-
/**
* An associative array where the key is a namespace prefix and the value
* is an array of base directories for classes in that namespace.
@@ -97,7 +96,7 @@ public function loadClass($class)
*
* @param string $prefix The namespace prefix.
* @param string $relativeClass The relative class name.
- * @return mixed Boolean false if no mapped file can be loaded, or the
+ * @return string|false Boolean false if no mapped file can be loaded, or the
* name of the mapped file that was loaded.
*/
protected function _loadMappedFile($prefix, $relativeClass)
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure.php b/app/vendor/cakephp/cakephp/src/Core/Configure.php
index ae3dbf481..7a9179b3e 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure.php
@@ -28,18 +28,17 @@
* as methods for loading additional configuration files or storing runtime configuration
* for future use.
*
- * @link https://book.cakephp.org/3.0/en/development/configuration.html
+ * @link https://book.cakephp.org/3/en/development/configuration.html
*/
class Configure
{
-
/**
* Array of values currently stored in Configure.
*
* @var array
*/
protected static $_values = [
- 'debug' => false
+ 'debug' => false,
];
/**
@@ -79,7 +78,7 @@ class Configure
* Alternatively can be an array containing key(s) and value(s).
* @param mixed $value Value to set for var
* @return bool True if write was successful
- * @link https://book.cakephp.org/3.0/en/development/configuration.html#writing-configuration-data
+ * @link https://book.cakephp.org/3/en/development/configuration.html#writing-configuration-data
*/
public static function write($config, $value = null)
{
@@ -116,7 +115,7 @@ public static function write($config, $value = null)
* @param string|null $var Variable to obtain. Use '.' to access array elements.
* @param mixed $default The return value when the configure does not exist
* @return mixed Value stored in configure, or null.
- * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-configuration-data
+ * @link https://book.cakephp.org/3/en/development/configuration.html#reading-configuration-data
*/
public static function read($var = null, $default = null)
{
@@ -159,7 +158,7 @@ public static function check($var)
* @param string $var Variable to obtain. Use '.' to access array elements.
* @return mixed Value stored in configure.
* @throws \RuntimeException if the requested configuration is not set.
- * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-configuration-data
+ * @link https://book.cakephp.org/3/en/development/configuration.html#reading-configuration-data
*/
public static function readOrFail($var)
{
@@ -181,7 +180,7 @@ public static function readOrFail($var)
*
* @param string $var the var to be deleted
* @return void
- * @link https://book.cakephp.org/3.0/en/development/configuration.html#deleting-configuration-data
+ * @link https://book.cakephp.org/3/en/development/configuration.html#deleting-configuration-data
*/
public static function delete($var)
{
@@ -332,7 +331,7 @@ public static function drop($name)
* @param string $config Name of the configured engine to use to read the resource identified by $key.
* @param bool $merge if config files should be merged instead of simply overridden
* @return bool False if file not found, true if load successful.
- * @link https://book.cakephp.org/3.0/en/development/configuration.html#reading-and-writing-configuration-files
+ * @link https://book.cakephp.org/3/en/development/configuration.html#reading-and-writing-configuration-files
*/
public static function load($key, $config = 'default', $merge = true)
{
@@ -440,6 +439,7 @@ public static function version()
* @param string $cacheConfig The cache configuration to save into. Defaults to 'default'
* @param array|null $data Either an array of data to store, or leave empty to store all values.
* @return bool Success
+ * @throws \RuntimeException
*/
public static function store($name, $cacheConfig = 'default', $data = null)
{
@@ -460,6 +460,7 @@ public static function store($name, $cacheConfig = 'default', $data = null)
* @param string $name Name of the stored config file to load.
* @param string $cacheConfig Name of the Cache configuration to read from.
* @return bool Success.
+ * @throws \RuntimeException
*/
public static function restore($name, $cacheConfig = 'default')
{
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure/ConfigEngineInterface.php b/app/vendor/cakephp/cakephp/src/Core/Configure/ConfigEngineInterface.php
index 188c0b9ad..56d70c329 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure/ConfigEngineInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure/ConfigEngineInterface.php
@@ -19,7 +19,6 @@
*/
interface ConfigEngineInterface
{
-
/**
* Read a configuration file/storage key
*
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/IniConfig.php b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/IniConfig.php
index 66379c91d..4d9ee7ac8 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/IniConfig.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/IniConfig.php
@@ -53,7 +53,6 @@
*/
class IniConfig implements ConfigEngineInterface
{
-
use FileConfigTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/JsonConfig.php b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/JsonConfig.php
index b45434793..3ae134ab0 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/JsonConfig.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/JsonConfig.php
@@ -38,7 +38,6 @@
*/
class JsonConfig implements ConfigEngineInterface
{
-
use FileConfigTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/PhpConfig.php b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/PhpConfig.php
index 2cc5eab7a..b1cc8b47b 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/PhpConfig.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure/Engine/PhpConfig.php
@@ -30,7 +30,7 @@
* ```
* 0,
+ * 'debug' => false,
* 'Security' => [
* 'salt' => 'its-secret'
* ],
@@ -40,11 +40,10 @@
* ];
* ```
*
- * @see Cake\Core\Configure::load() for how to load custom configuration files.
+ * @see \Cake\Core\Configure::load() for how to load custom configuration files.
*/
class PhpConfig implements ConfigEngineInterface
{
-
use FileConfigTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Core/Configure/FileConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/Configure/FileConfigTrait.php
index b7ddeee42..5fafbe0a0 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Configure/FileConfigTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Configure/FileConfigTrait.php
@@ -22,7 +22,6 @@
*/
trait FileConfigTrait
{
-
/**
* The path this engine finds files on.
*
diff --git a/app/vendor/cakephp/cakephp/src/Core/ConventionsTrait.php b/app/vendor/cakephp/cakephp/src/Core/ConventionsTrait.php
index 2ca06f0a9..80a873788 100644
--- a/app/vendor/cakephp/cakephp/src/Core/ConventionsTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Core/ConventionsTrait.php
@@ -21,7 +21,6 @@
*/
trait ConventionsTrait
{
-
/**
* Creates a fixture name
*
diff --git a/app/vendor/cakephp/cakephp/src/Core/Exception/Exception.php b/app/vendor/cakephp/cakephp/src/Core/Exception/Exception.php
index 6553991a7..a7ecfff0a 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Exception/Exception.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Exception/Exception.php
@@ -16,10 +16,11 @@
/**
* Base class that all CakePHP Exceptions extend.
+ *
+ * @method int getCode()
*/
class Exception extends RuntimeException
{
-
/**
* Array of attributes that are passed in from the constructor, and
* made available in the view when a development error is displayed.
@@ -53,7 +54,7 @@ class Exception extends RuntimeException
* Constructor.
*
* Allows you to create exceptions that are treated as framework errors and disabled
- * when debug = 0.
+ * when debug mode is off.
*
* @param string|array $message Either the string of the error message, or an array of attributes
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
@@ -92,7 +93,7 @@ public function getAttributes()
* - an associative array of "header name" => "header value"
* - an array of string headers is also accepted (deprecated)
* @param string|null $value The header value.
- * @return array
+ * @return array|null
*/
public function responseHeader($header = null, $value = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/Core/Exception/MissingPluginException.php b/app/vendor/cakephp/cakephp/src/Core/Exception/MissingPluginException.php
index bb865ac03..636f853a5 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Exception/MissingPluginException.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Exception/MissingPluginException.php
@@ -17,6 +17,8 @@
*/
class MissingPluginException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Plugin %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php
index dd1acc889..9df2ee26e 100644
--- a/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Core/InstanceConfigTrait.php
@@ -16,6 +16,7 @@
use Cake\Core\Exception\Exception;
use Cake\Utility\Hash;
+use InvalidArgumentException;
/**
* A trait for reading and writing instance config
@@ -24,7 +25,6 @@
*/
trait InstanceConfigTrait
{
-
/**
* Runtime config
*
@@ -110,8 +110,8 @@ public function setConfig($key, $value = null, $merge = true)
* ```
*
* @param string|null $key The key to get or null for the whole config.
- * @param mixed $default The return value when the key does not exist.
- * @return mixed Configuration data at the named key or null if the key does not exist.
+ * @param mixed|null $default The return value when the key does not exist.
+ * @return mixed|null Configuration data at the named key or null if the key does not exist.
*/
public function getConfig($key = null, $default = null)
{
@@ -187,6 +187,29 @@ public function config($key = null, $value = null, $merge = true)
return $this->getConfig($key);
}
+ /**
+ * Returns the config for this specific key.
+ *
+ * The config value for this key must exist, it can never be null.
+ *
+ * @param string|null $key The key to get.
+ * @return mixed Configuration data at the named key
+ * @throws \InvalidArgumentException
+ */
+ public function getConfigOrFail($key)
+ {
+ if (!isset($key)) {
+ throw new InvalidArgumentException('$key must not be null.');
+ }
+
+ $config = $this->getConfig($key);
+ if ($config === null) {
+ throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key));
+ }
+
+ return $config;
+ }
+
/**
* Merge provided config with existing config. Unlike `config()` which does
* a recursive merge for nested keys, this method does a simple merge.
diff --git a/app/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php b/app/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php
index 1a85a0abe..dda5d9a45 100644
--- a/app/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php
@@ -39,7 +39,6 @@
*/
abstract class ObjectRegistry implements Countable, IteratorAggregate
{
-
/**
* Map of loaded objects.
*
@@ -156,7 +155,7 @@ protected function _checkDuplicate($name, $config)
* Should resolve the classname for a given object type.
*
* @param string $class The class to resolve.
- * @return string|bool The resolved name or false for failure.
+ * @return string|false The resolved name or false for failure.
*/
abstract protected function _resolveClassName($class);
@@ -164,7 +163,7 @@ abstract protected function _resolveClassName($class);
* Throw an exception when the requested object name is missing.
*
* @param string $class The class that is missing.
- * @param string $plugin The plugin $class is missing from.
+ * @param string|null $plugin The plugin $class is missing from.
* @return void
* @throws \Exception
*/
diff --git a/app/vendor/cakephp/cakephp/src/Core/Plugin.php b/app/vendor/cakephp/cakephp/src/Core/Plugin.php
index 2068d37bb..576835306 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Plugin.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Plugin.php
@@ -22,11 +22,10 @@
*
* It also can retrieve plugin paths and load their bootstrap and routes files.
*
- * @link https://book.cakephp.org/3.0/en/plugins.html
+ * @link https://book.cakephp.org/3/en/plugins.html
*/
class Plugin
{
-
/**
* Holds a list of all loaded plugins and their configuration
*
@@ -134,7 +133,7 @@ public static function load($plugin, array $config = [])
'console' => true,
'classBase' => 'src',
'ignoreMissing' => false,
- 'name' => $plugin
+ 'name' => $plugin,
];
if (!isset($config['path'])) {
@@ -247,7 +246,7 @@ public static function path($name)
* Returns the filesystem path for plugin's folder containing class folders.
*
* @param string $name name of the plugin in CamelCase format.
- * @return string Path to the plugin folder container class folders.
+ * @return string Path to the plugin folder containing class files.
* @throws \Cake\Core\Exception\MissingPluginException If plugin has not been loaded.
*/
public static function classPath($name)
@@ -261,7 +260,7 @@ public static function classPath($name)
* Returns the filesystem path for plugin's folder containing config files.
*
* @param string $name name of the plugin in CamelCase format.
- * @return string Path to the plugin folder container config files.
+ * @return string Path to the plugin folder containing config files.
* @throws \Cake\Core\Exception\MissingPluginException If plugin has not been loaded.
*/
public static function configPath($name)
@@ -303,7 +302,7 @@ public static function bootstrap($name)
* Loads the routes file for a plugin, or all plugins configured to load their respective routes file.
*
* If you need fine grained control over how routes are loaded for plugins, you
- * can use {@see Cake\Routing\RouteBuilder::loadPlugin()}
+ * can use {@see \Cake\Routing\RouteBuilder::loadPlugin()}
*
* @param string|null $name name of the plugin, if null will operate on all
* plugins having enabled the loading of routes files.
@@ -315,7 +314,7 @@ public static function routes($name = null)
{
deprecationWarning(
'You no longer need to call `Plugin::routes()` after upgrading to use Http\Server. ' .
- 'See https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' .
+ 'See https://book.cakephp.org/3/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' .
'for upgrade information.'
);
if ($name === null) {
diff --git a/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php b/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php
index 351dee105..03a3e8174 100644
--- a/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php
@@ -44,7 +44,7 @@ class PluginCollection implements Iterator, Countable
/**
* Names of plugins
*
- * @var array
+ * @var string[]
*/
protected $names = [];
diff --git a/app/vendor/cakephp/cakephp/src/Core/PluginInterface.php b/app/vendor/cakephp/cakephp/src/Core/PluginInterface.php
index 3f4bd214f..8b3c260da 100644
--- a/app/vendor/cakephp/cakephp/src/Core/PluginInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Core/PluginInterface.php
@@ -19,6 +19,8 @@ interface PluginInterface
{
/**
* List of valid hooks.
+ *
+ * @var string[]
*/
const VALID_HOOKS = ['routes', 'bootstrap', 'console', 'middleware'];
diff --git a/app/vendor/cakephp/cakephp/src/Core/README.md b/app/vendor/cakephp/cakephp/src/Core/README.md
index ca10e4f62..c9984d9f7 100644
--- a/app/vendor/cakephp/cakephp/src/Core/README.md
+++ b/app/vendor/cakephp/cakephp/src/Core/README.md
@@ -26,7 +26,7 @@ Configure::load('app', 'default', false);
Configure::load('other_config', 'default');
```
-And Write the configuration back into files:
+And write the configuration back into files:
```php
Configure::dump('my_config', 'default');
@@ -34,4 +34,4 @@ Configure::dump('my_config', 'default');
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/development/configuration.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/development/configuration.html)
diff --git a/app/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php b/app/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php
index 572f87f87..e41431374 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php
@@ -24,7 +24,6 @@
*/
class CommandRetry
{
-
/**
* The strategy to follow should the executed action fail.
*
diff --git a/app/vendor/cakephp/cakephp/src/Core/Retry/RetryStrategyInterface.php b/app/vendor/cakephp/cakephp/src/Core/Retry/RetryStrategyInterface.php
index 2e0f95380..107d888d0 100644
--- a/app/vendor/cakephp/cakephp/src/Core/Retry/RetryStrategyInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Core/Retry/RetryStrategyInterface.php
@@ -25,7 +25,7 @@ interface RetryStrategyInterface
/**
* Returns true if the action can be retried, false otherwise.
*
- * @param Exception $exception The exception that caused the action to fail
+ * @param \Exception $exception The exception that caused the action to fail
* @param int $retryCount The number of times the action has been already called
* @return bool Whether or not it is OK to retry the action
*/
diff --git a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php
index e06f61450..addc2d3c0 100644
--- a/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Core/StaticConfigTrait.php
@@ -24,10 +24,11 @@
* configuration data registered and manipulated.
*
* Implementing objects are expected to declare a static `$_dsnClassMap` property.
+ *
+ * @property \Cake\Core\ObjectRegistry $_registry
*/
trait StaticConfigTrait
{
-
/**
* Configuration sets.
*
@@ -67,7 +68,7 @@ trait StaticConfigTrait
* ```
*
* @param string|array $key The name of the configuration, or an array of multiple configs.
- * @param array $config An array of name => configuration data for adapter.
+ * @param array|object|null $config An array of name => configuration data for adapter.
* @throws \BadMethodCallException When trying to modify an existing config.
* @throws \LogicException When trying to store an invalid structured config array.
* @return void
@@ -110,7 +111,7 @@ public static function setConfig($key, $config = null)
* Reads existing configuration.
*
* @param string $key The name of the configuration.
- * @return mixed Configuration data at the named key or null if the key does not exist.
+ * @return mixed|null Configuration data at the named key or null if the key does not exist.
*/
public static function getConfig($key)
{
@@ -177,6 +178,27 @@ public static function config($key, $config = null)
return static::getConfig($key);
}
+ /**
+ * Reads existing configuration for a specific key.
+ *
+ * The config value for this key must exist, it can never be null.
+ *
+ * @param string|null $key The name of the configuration.
+ * @return mixed Configuration data at the named key.
+ * @throws \InvalidArgumentException If value does not exist.
+ */
+ public static function getConfigOrFail($key)
+ {
+ if (!isset($key)) {
+ throw new InvalidArgumentException('$key must not be null.');
+ }
+ if (!isset(static::$_config[$key])) {
+ throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key));
+ }
+
+ return static::$_config[$key];
+ }
+
/**
* Drops a constructed adapter.
*
@@ -340,7 +362,7 @@ public static function parseDsn($dsn)
/**
* Updates the DSN class map for this class.
*
- * @param array $map Additions/edits to the class map to apply.
+ * @param string[] $map Additions/edits to the class map to apply.
* @return void
*/
public static function setDsnClassMap(array $map)
@@ -351,7 +373,7 @@ public static function setDsnClassMap(array $map)
/**
* Returns the DSN class map for this class.
*
- * @return array
+ * @return string[]
*/
public static function getDsnClassMap()
{
@@ -362,8 +384,8 @@ public static function getDsnClassMap()
* Returns or updates the DSN class map for this class.
*
* @deprecated 3.4.0 Use setDsnClassMap()/getDsnClassMap() instead.
- * @param array|null $map Additions/edits to the class map to apply.
- * @return array
+ * @param string[]|null $map Additions/edits to the class map to apply.
+ * @return string[]
*/
public static function dsnClassMap(array $map = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/Core/composer.json b/app/vendor/cakephp/cakephp/src/Core/composer.json
index 0ee9afc93..815c276e7 100644
--- a/app/vendor/cakephp/cakephp/src/Core/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Core/composer.json
@@ -22,7 +22,7 @@
"source": "https://github.com/cakephp/core"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/utility": "^3.6.0"
},
"suggest": {
diff --git a/app/vendor/cakephp/cakephp/src/Core/functions.php b/app/vendor/cakephp/cakephp/src/Core/functions.php
index 87573649f..a33a47dea 100644
--- a/app/vendor/cakephp/cakephp/src/Core/functions.php
+++ b/app/vendor/cakephp/cakephp/src/Core/functions.php
@@ -33,7 +33,7 @@
* @param string|null $charset Character set to use when escaping. Defaults to config value in `mb_internal_encoding()`
* or 'UTF-8'.
* @return mixed Wrapped text.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#h
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#h
*/
function h($text, $double = true, $charset = null)
{
@@ -91,7 +91,7 @@ function h($text, $double = true, $charset = null)
* @param bool $dotAppend Set to true if you want the plugin to have a '.' appended to it.
* @param string|null $plugin Optional default plugin to use if no plugin is found. Defaults to null.
* @return array Array with 2 indexes. 0 => plugin name, 1 => class name.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pluginSplit
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pluginSplit
*/
function pluginSplit($name, $dotAppend = false, $plugin = null)
{
@@ -135,13 +135,13 @@ function namespaceSplit($class)
* print_r() convenience function.
*
* In terminals this will act similar to using print_r() directly, when not run on cli
- * print_r() will also wrap tags around the output of given variable. Similar to debug().
+ * print_r() will also wrap `` tags around the output of given variable. Similar to debug().
*
* This function returns the same variable that was passed.
*
* @param mixed $var Variable to print out.
* @return mixed the same $var that was passed to this function
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pr
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pr
* @see debug()
*/
function pr($var)
@@ -163,14 +163,14 @@ function pr($var)
* json pretty print convenience function.
*
* In terminals this will act similar to using json_encode() with JSON_PRETTY_PRINT directly, when not run on cli
- * will also wrap tags around the output of given variable. Similar to pr().
+ * will also wrap `` tags around the output of given variable. Similar to pr().
*
* This function returns the same variable that was passed.
*
* @param mixed $var Variable to print out.
* @return mixed the same $var that was passed to this function
* @see pr()
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pj
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#pj
*/
function pj($var)
{
@@ -179,7 +179,7 @@ function pj($var)
}
$template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '%s
' : "\n%s\n\n";
- printf($template, trim(json_encode($var, JSON_PRETTY_PRINT)));
+ printf($template, trim(json_encode($var, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)));
return $var;
}
@@ -194,9 +194,9 @@ function pj($var)
* environment information.
*
* @param string $key Environment variable name.
- * @param string|null $default Specify a default value in case the environment variable is not defined.
+ * @param string|bool|null $default Specify a default value in case the environment variable is not defined.
* @return string|bool|null Environment variable setting.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#env
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#env
*/
function env($key, $default = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Connection.php b/app/vendor/cakephp/cakephp/src/Database/Connection.php
index 313ca5e71..cd06f05d5 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Connection.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Connection.php
@@ -29,13 +29,13 @@
use Cake\Datasource\ConnectionInterface;
use Cake\Log\Log;
use Exception;
+use Throwable;
/**
* Represents a connection with a database server.
*/
class Connection implements ConnectionInterface
{
-
use TypeConverterTrait;
/**
@@ -107,7 +107,15 @@ class Connection implements ConnectionInterface
/**
* Constructor.
*
- * @param array $config configuration for connecting to database
+ * ### Available options:
+ * - `driver` Sort name or FCQN for driver.
+ * - `log` Boolean indicating whether to use query logging.
+ * - `name` Connection name.
+ * - `cacheMetaData` Boolean indicating whether metadata (datasource schemas) should be cached.
+ * If set to a string it will be used as the name of cache config to use.
+ * - `cacheKeyPrefix` Custom prefix to use when generation cache keys. Defaults to connection name.
+ *
+ * @param array $config Configuration array.
*/
public function __construct($config)
{
@@ -576,13 +584,8 @@ public function rollback($toBeginning = null)
/**
* Enables/disables the usage of savepoints, enables only if driver the allows it.
*
- * If you are trying to enable this feature, make sure you check the return value of this
- * function to verify it was enabled successfully.
- *
- * ### Example:
- *
- * `$connection->enableSavePoints(true)` Returns true if drivers supports save points, false otherwise
- * `$connection->enableSavePoints(false)` Disables usage of savepoints and returns false
+ * If you are trying to enable this feature, make sure you check
+ * `isSavePointsEnabled()` to verify that savepoints were enabled successfully.
*
* @param bool $enable Whether or not save points should be used.
* @return $this
@@ -654,7 +657,7 @@ public function useSavePoints($enable = null)
/**
* Creates a new save point for nested transactions.
*
- * @param string $name The save point name.
+ * @param string|int $name The save point name.
* @return void
*/
public function createSavePoint($name)
@@ -665,7 +668,7 @@ public function createSavePoint($name)
/**
* Releases a save point by its name.
*
- * @param string $name The save point name.
+ * @param string|int $name The save point name.
* @return void
*/
public function releaseSavePoint($name)
@@ -676,7 +679,7 @@ public function releaseSavePoint($name)
/**
* Rollback a save point by its name.
*
- * @param string $name The save point name.
+ * @param string|int $name The save point name.
* @return void
*/
public function rollbackSavepoint($name)
@@ -730,12 +733,15 @@ public function supportsDynamicConstraints()
* });
* ```
*/
- public function transactional(callable $callback)
+ public function transactional(callable $transaction)
{
$this->begin();
try {
- $result = $callback($this);
+ $result = $transaction($this);
+ } catch (Throwable $e) {
+ $this->rollback(false);
+ throw $e;
} catch (Exception $e) {
$this->rollback(false);
throw $e;
@@ -778,13 +784,13 @@ protected function wasNestedTransactionRolledback()
* });
* ```
*/
- public function disableConstraints(callable $callback)
+ public function disableConstraints(callable $operation)
{
- return $this->getDisconnectRetry()->run(function () use ($callback) {
+ return $this->getDisconnectRetry()->run(function () use ($operation) {
$this->disableForeignKeys();
try {
- $result = $callback($this);
+ $result = $operation($this);
} catch (Exception $e) {
$this->enableForeignKeys();
throw $e;
@@ -995,7 +1001,7 @@ public function __debugInfo()
'username' => '*****',
'host' => '*****',
'database' => '*****',
- 'port' => '*****'
+ 'port' => '*****',
];
$replace = array_intersect_key($secrets, $this->_config);
$config = $replace + $this->_config;
@@ -1007,7 +1013,7 @@ public function __debugInfo()
'transactionStarted' => $this->_transactionStarted,
'useSavePoints' => $this->_useSavePoints,
'logQueries' => $this->_logQueries,
- 'logger' => $this->_logger
+ 'logger' => $this->_logger,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php b/app/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php
index a6966903f..d7be5468a 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php
@@ -25,7 +25,6 @@
*/
trait MysqlDialectTrait
{
-
use SqlDialectTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Database/Dialect/PostgresDialectTrait.php b/app/vendor/cakephp/cakephp/src/Database/Dialect/PostgresDialectTrait.php
index 8e5cb7edb..89d874fb9 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Dialect/PostgresDialectTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Dialect/PostgresDialectTrait.php
@@ -26,7 +26,6 @@
*/
trait PostgresDialectTrait
{
-
use SqlDialectTrait;
/**
@@ -88,7 +87,7 @@ protected function _expressionTranslators()
$namespace = 'Cake\Database\Expression';
return [
- $namespace . '\FunctionExpression' => '_transformFunctionExpression'
+ $namespace . '\FunctionExpression' => '_transformFunctionExpression',
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Dialect/SqliteDialectTrait.php b/app/vendor/cakephp/cakephp/src/Database/Dialect/SqliteDialectTrait.php
index 173ed362c..c129c4893 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Dialect/SqliteDialectTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Dialect/SqliteDialectTrait.php
@@ -26,7 +26,6 @@
*/
trait SqliteDialectTrait
{
-
use SqlDialectTrait;
use TupleComparisonTranslatorTrait;
@@ -63,7 +62,7 @@ trait SqliteDialectTrait
'minute' => 'M',
'second' => 'S',
'week' => 'W',
- 'year' => 'Y'
+ 'year' => 'Y',
];
/**
@@ -78,7 +77,7 @@ protected function _expressionTranslators()
return [
$namespace . '\FunctionExpression' => '_transformFunctionExpression',
- $namespace . '\TupleComparison' => '_transformTupleComparison'
+ $namespace . '\TupleComparison' => '_transformTupleComparison',
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Dialect/SqlserverDialectTrait.php b/app/vendor/cakephp/cakephp/src/Database/Dialect/SqlserverDialectTrait.php
index a58161c08..54300fa39 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Dialect/SqlserverDialectTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Dialect/SqlserverDialectTrait.php
@@ -17,12 +17,12 @@
use Cake\Database\ExpressionInterface;
use Cake\Database\Expression\FunctionExpression;
use Cake\Database\Expression\OrderByExpression;
+use Cake\Database\Expression\OrderClauseExpression;
use Cake\Database\Expression\UnaryExpression;
use Cake\Database\Query;
use Cake\Database\Schema\SqlserverSchema;
use Cake\Database\SqlDialectTrait;
use Cake\Database\SqlserverCompiler;
-use Cake\Database\ValueBinder;
use PDO;
/**
@@ -33,7 +33,6 @@
*/
trait SqlserverDialectTrait
{
-
use SqlDialectTrait;
use TupleComparisonTranslatorTrait;
@@ -116,12 +115,14 @@ protected function _pagingSubquery($original, $limit, $offset)
->clause('order')
->iterateParts(function ($direction, $orderBy) use ($select, $order) {
$key = $orderBy;
- if (isset($select[$orderBy]) &&
+ if (
+ isset($select[$orderBy]) &&
$select[$orderBy] instanceof ExpressionInterface
) {
- $key = $select[$orderBy]->sql(new ValueBinder());
+ $order->add(new OrderClauseExpression($select[$orderBy], $direction));
+ } else {
+ $order->add([$key => $direction]);
}
- $order->add([$key => $direction]);
// Leave original order clause unchanged.
return $orderBy;
@@ -132,7 +133,7 @@ protected function _pagingSubquery($original, $limit, $offset)
$query = clone $original;
$query->select([
- '_cake_page_rownum_' => new UnaryExpression('ROW_NUMBER() OVER', $order)
+ '_cake_page_rownum_' => new UnaryExpression('ROW_NUMBER() OVER', $order),
])->limit(null)
->offset(null)
->order([], true);
@@ -190,7 +191,7 @@ protected function _transformDistinct($original)
->setConjunction(' ');
return [
- '_cake_distinct_pivot_' => $over
+ '_cake_distinct_pivot_' => $over,
];
})
->limit(null)
@@ -227,7 +228,7 @@ protected function _expressionTranslators()
return [
$namespace . '\FunctionExpression' => '_transformFunctionExpression',
- $namespace . '\TupleComparison' => '_transformTupleComparison'
+ $namespace . '\TupleComparison' => '_transformTupleComparison',
];
}
@@ -380,7 +381,7 @@ public function newCompiler()
*/
public function disableForeignKeySQL()
{
- return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
+ return 'EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"';
}
/**
@@ -388,6 +389,6 @@ public function disableForeignKeySQL()
*/
public function enableForeignKeySQL()
{
- return 'EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
+ return 'EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"';
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Dialect/TupleComparisonTranslatorTrait.php b/app/vendor/cakephp/cakephp/src/Database/Dialect/TupleComparisonTranslatorTrait.php
index 6c383a0ca..39c3013de 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Dialect/TupleComparisonTranslatorTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Dialect/TupleComparisonTranslatorTrait.php
@@ -26,7 +26,6 @@
*/
trait TupleComparisonTranslatorTrait
{
-
/**
* Receives a TupleExpression and changes it so that it conforms to this
* SQL dialect.
@@ -70,6 +69,13 @@ protected function _transformTupleComparison(TupleComparison $expression, $query
return;
}
+ $type = $expression->getType();
+ if ($type) {
+ $typeMap = array_combine($fields, $type);
+ } else {
+ $typeMap = [];
+ }
+
$surrogate = $query->getConnection()
->newQuery()
->select($true);
@@ -86,7 +92,7 @@ protected function _transformTupleComparison(TupleComparison $expression, $query
}
$conditions['OR'][] = $item;
}
- $surrogate->where($conditions);
+ $surrogate->where($conditions, $typeMap);
$expression->setField($true);
$expression->setValue($surrogate);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver.php b/app/vendor/cakephp/cakephp/src/Database/Driver.php
index 73dab9ac3..a7c517b06 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver.php
@@ -15,6 +15,7 @@
namespace Cake\Database;
use Cake\Database\Query;
+use Cake\Database\Schema\TableSchema;
use Cake\Database\Statement\PDOStatement;
use InvalidArgumentException;
use PDO;
@@ -302,7 +303,8 @@ public function schemaValue($value)
if (is_float($value)) {
return str_replace(',', '.', (string)$value);
}
- if ((is_int($value) || $value === '0') || (
+ if (
+ (is_int($value) || $value === '0') || (
is_numeric($value) && strpos($value, ',') === false &&
$value[0] !== '0' && strpos($value, 'e') === false)
) {
@@ -426,6 +428,23 @@ public function newCompiler()
return new QueryCompiler();
}
+ /**
+ * Constructs new TableSchema.
+ *
+ * @param string $table The table name.
+ * @param array $columns The list of columns for the schema.
+ * @return \Cake\Database\Schema\TableSchemaInterface
+ */
+ public function newTableSchema($table, array $columns = [])
+ {
+ $className = TableSchema::class;
+ if (isset($this->_config['tableSchema'])) {
+ $className = $this->_config['tableSchema'];
+ }
+
+ return new $className($table, $columns);
+ }
+
/**
* Destructor
*/
@@ -443,7 +462,7 @@ public function __destruct()
public function __debugInfo()
{
return [
- 'connected' => $this->_connection !== null
+ 'connected' => $this->_connection !== null,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php b/app/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php
index c821a4925..154079b4d 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php
@@ -25,7 +25,6 @@
*/
class Mysql extends Driver
{
-
use MysqlDialectTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php b/app/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php
index 388bd70f2..033dd71cb 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php
@@ -26,7 +26,6 @@
*/
trait PDODriverTrait
{
-
/**
* Instance of PDO.
*
@@ -59,7 +58,7 @@ protected function _connect($dsn, array $config)
* If first argument is passed, it will set internal connection object or
* result to the value passed
*
- * @param null|\PDO $connection The PDO connection instance.
+ * @param \PDO|null $connection The PDO connection instance.
* @return \PDO connection object used internally
*/
public function connection($connection = null)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver/Postgres.php b/app/vendor/cakephp/cakephp/src/Database/Driver/Postgres.php
index 393672ab9..52786bbdd 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver/Postgres.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver/Postgres.php
@@ -23,7 +23,6 @@
*/
class Postgres extends Driver
{
-
use PostgresDialectTrait;
/**
@@ -59,7 +58,7 @@ public function connect()
$config['flags'] += [
PDO::ATTR_PERSISTENT => $config['persistent'],
PDO::ATTR_EMULATE_PREPARES => false,
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
];
if (empty($config['unix_socket'])) {
$dsn = "pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}";
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlite.php b/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlite.php
index e53078757..48367ba4a 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlite.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlite.php
@@ -26,7 +26,6 @@
*/
class Sqlite extends Driver
{
-
use SqliteDialectTrait;
/**
@@ -61,7 +60,7 @@ public function connect()
$config['flags'] += [
PDO::ATTR_PERSISTENT => $config['persistent'],
PDO::ATTR_EMULATE_PREPARES => false,
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
];
$databaseExists = file_exists($config['database']);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlserver.php b/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlserver.php
index cb04ef7ad..f9f40d65d 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlserver.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Driver/Sqlserver.php
@@ -25,7 +25,6 @@
*/
class Sqlserver extends Driver
{
-
use SqlserverDialectTrait;
/**
@@ -75,8 +74,7 @@ public function connect()
}
$config['flags'] += [
- PDO::ATTR_EMULATE_PREPARES => false,
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
];
if (!empty($config['encoding'])) {
diff --git a/app/vendor/cakephp/cakephp/src/Database/DriverInterface.php b/app/vendor/cakephp/cakephp/src/Database/DriverInterface.php
index 9316df18f..476a0593a 100644
--- a/app/vendor/cakephp/cakephp/src/Database/DriverInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/DriverInterface.php
@@ -20,6 +20,7 @@
* Interface for database driver.
*
* @method $this disableAutoQuoting()
+ * @method \Cake\Database\Schema\TableSchemaInterface newTableSchema()
*/
interface DriverInterface
{
@@ -91,7 +92,7 @@ public function rollbackTransaction();
/**
* Get the SQL for releasing a save point.
*
- * @param string $name The table name.
+ * @param string|int $name The table name.
* @return string
*/
public function releaseSavePointSQL($name);
@@ -99,7 +100,7 @@ public function releaseSavePointSQL($name);
/**
* Get the SQL for creating a save point.
*
- * @param string $name The table name.
+ * @param string|int $name The table name.
* @return string
*/
public function savePointSQL($name);
@@ -107,7 +108,7 @@ public function savePointSQL($name);
/**
* Get the SQL for rollingback a save point.
*
- * @param string $name The table name.
+ * @param string|int $name The table name.
* @return string
*/
public function rollbackSavePointSQL($name);
@@ -130,7 +131,7 @@ public function enableForeignKeySQL();
* Returns whether the driver supports adding or dropping constraints
* to already created tables.
*
- * @return bool true if driver supports dynamic constraints.
+ * @return bool True if driver supports dynamic constraints.
*/
public function supportsDynamicConstraints();
@@ -145,7 +146,7 @@ public function supportsSavePoints();
* Returns a value in a safe representation to be used in a query string
*
* @param mixed $value The value to quote.
- * @param string $type Type to be used for determining kind of quoting to perform.
+ * @param int $type Type to be used for determining kind of quoting to perform.
* @return string
*/
public function quote($value, $type);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception.php b/app/vendor/cakephp/cakephp/src/Database/Exception.php
index c61d87d75..a89c3eac9 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Exception.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Exception.php
@@ -21,5 +21,4 @@
*/
class Exception extends CakeException
{
-
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingConnectionException.php b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingConnectionException.php
index 063830561..0a71dd0a7 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingConnectionException.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingConnectionException.php
@@ -21,7 +21,6 @@
*/
class MissingConnectionException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingDriverException.php b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingDriverException.php
index bca5eb086..f97e7c464 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingDriverException.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingDriverException.php
@@ -21,7 +21,6 @@
*/
class MissingDriverException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingExtensionException.php b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingExtensionException.php
index 729c0a0de..9c6002aba 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Exception/MissingExtensionException.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Exception/MissingExtensionException.php
@@ -21,7 +21,6 @@
*/
class MissingExtensionException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/Exception/NestedTransactionRollbackException.php b/app/vendor/cakephp/cakephp/src/Database/Exception/NestedTransactionRollbackException.php
index f8915b51f..99053b609 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Exception/NestedTransactionRollbackException.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Exception/NestedTransactionRollbackException.php
@@ -21,7 +21,6 @@
*/
class NestedTransactionRollbackException extends Exception
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/BetweenExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/BetweenExpression.php
index b9e91f37c..f8cf3ebf3 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/BetweenExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/BetweenExpression.php
@@ -23,7 +23,6 @@
*/
class BetweenExpression implements ExpressionInterface, FieldInterface
{
-
use ExpressionTypeCasterTrait;
use FieldTrait;
@@ -79,7 +78,7 @@ public function sql(ValueBinder $generator)
{
$parts = [
'from' => $this->_from,
- 'to' => $this->_to
+ 'to' => $this->_to,
];
$field = $this->_field;
@@ -100,13 +99,12 @@ public function sql(ValueBinder $generator)
/**
* {@inheritDoc}
- *
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
foreach ([$this->_field, $this->_from, $this->_to] as $part) {
if ($part instanceof ExpressionInterface) {
- $callable($part);
+ $visitor($part);
}
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php
index b826c183e..8e36d2b6f 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/CaseExpression.php
@@ -23,7 +23,6 @@
*/
class CaseExpression implements ExpressionInterface
{
-
use ExpressionTypeCasterTrait;
/**
@@ -80,7 +79,6 @@ public function __construct($conditions = [], $values = [], $types = [])
* @param array|\Cake\Database\ExpressionInterface $conditions Must be a ExpressionInterface instance, or an array of ExpressionInterface instances.
* @param array|\Cake\Database\ExpressionInterface $values associative array of values of each condition
* @param array $types associative array of types to be associated with the values
- *
* @return $this
*/
public function add($conditions = [], $values = [], $types = [])
@@ -107,7 +105,6 @@ public function add($conditions = [], $values = [], $types = [])
* @param array|\Cake\Database\ExpressionInterface $conditions Must be a ExpressionInterface instance, or an array of ExpressionInterface instances.
* @param array|\Cake\Database\ExpressionInterface $values associative array of values of each condition
* @param array $types associative array of types to be associated with the values
- *
* @return void
*/
protected function _addExpressions($conditions, $values, $types)
@@ -161,7 +158,6 @@ protected function _addExpressions($conditions, $values, $types)
*
* @param \Cake\Database\ExpressionInterface|string|array|null $value Value to set
* @param string|null $type Type of value
- *
* @return void
*/
public function elseValue($value = null, $type = null)
@@ -187,7 +183,6 @@ public function elseValue($value = null, $type = null)
*
* @param array|string|\Cake\Database\ExpressionInterface $part The part to compile
* @param \Cake\Database\ValueBinder $generator Sql generator
- *
* @return string
*/
protected function _compile($part, ValueBinder $generator)
@@ -207,7 +202,6 @@ protected function _compile($part, ValueBinder $generator)
* Converts the Node into a SQL string fragment.
*
* @param \Cake\Database\ValueBinder $generator Placeholder generator object
- *
* @return string
*/
public function sql(ValueBinder $generator)
@@ -229,7 +223,6 @@ public function sql(ValueBinder $generator)
/**
* {@inheritDoc}
- *
*/
public function traverse(callable $visitor)
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/Comparison.php b/app/vendor/cakephp/cakephp/src/Database/Expression/Comparison.php
index 751fc6b65..de0ad76c3 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/Comparison.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/Comparison.php
@@ -26,7 +26,6 @@
*/
class Comparison implements ExpressionInterface, FieldInterface
{
-
use ExpressionTypeCasterTrait;
use FieldTrait;
@@ -71,7 +70,7 @@ class Comparison implements ExpressionInterface, FieldInterface
*
* @param string|\Cake\Database\ExpressionInterface $field the field name to compare to a value
* @param mixed $value The value to be used in comparison
- * @param string $type the type name used to cast the value
+ * @param string|null $type the type name used to cast the value
* @param string $operator the operator used for comparing field and value
*/
public function __construct($field, $value, $type, $operator)
@@ -165,23 +164,22 @@ public function sql(ValueBinder $generator)
/**
* {@inheritDoc}
- *
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
if ($this->_field instanceof ExpressionInterface) {
- $callable($this->_field);
- $this->_field->traverse($callable);
+ $visitor($this->_field);
+ $this->_field->traverse($visitor);
}
if ($this->_value instanceof ExpressionInterface) {
- $callable($this->_value);
- $this->_value->traverse($callable);
+ $visitor($this->_value);
+ $this->_value->traverse($visitor);
}
foreach ($this->_valueExpressions as $v) {
- $callable($v);
- $v->traverse($callable);
+ $visitor($v);
+ $v->traverse($visitor);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/FieldInterface.php b/app/vendor/cakephp/cakephp/src/Database/Expression/FieldInterface.php
index 36f753d14..35b2a588a 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/FieldInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/FieldInterface.php
@@ -20,7 +20,6 @@
*/
interface FieldInterface
{
-
/**
* Sets the field name
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/FieldTrait.php b/app/vendor/cakephp/cakephp/src/Database/Expression/FieldTrait.php
index 42c842b0b..e418a0f18 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/FieldTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/FieldTrait.php
@@ -19,7 +19,6 @@
*/
trait FieldTrait
{
-
/**
* The field name or expression to be used in the left hand side of the operator
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/FunctionExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/FunctionExpression.php
index e569a369e..7cbe43954 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/FunctionExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/FunctionExpression.php
@@ -29,7 +29,6 @@
*/
class FunctionExpression extends QueryExpression implements TypedResultInterface
{
-
use ExpressionTypeCasterTrait;
use TypedResultTrait;
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/IdentifierExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/IdentifierExpression.php
index 8aa9a209c..52fde3349 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/IdentifierExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/IdentifierExpression.php
@@ -27,7 +27,6 @@
*/
class IdentifierExpression implements ExpressionInterface
{
-
/**
* Holds the identifier string
*
@@ -78,13 +77,9 @@ public function sql(ValueBinder $generator)
}
/**
- * This method is a no-op, this is a leaf type of expression,
- * hence there is nothing to traverse
- *
- * @param callable $callable The callable to traverse with.
- * @return void
+ * @inheritDoc
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/OrderByExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/OrderByExpression.php
index 41a01cce9..98f16a76e 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/OrderByExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/OrderByExpression.php
@@ -22,7 +22,6 @@
*/
class OrderByExpression extends QueryExpression
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/OrderClauseExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/OrderClauseExpression.php
index 11f04de03..8fc1c2c5b 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/OrderClauseExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/OrderClauseExpression.php
@@ -15,6 +15,7 @@
namespace Cake\Database\Expression;
use Cake\Database\ExpressionInterface;
+use Cake\Database\Query;
use Cake\Database\ValueBinder;
/**
@@ -49,7 +50,9 @@ public function __construct($field, $direction)
public function sql(ValueBinder $generator)
{
$field = $this->_field;
- if ($field instanceof ExpressionInterface) {
+ if ($field instanceof Query) {
+ $field = sprintf('(%s)', $field->sql($generator));
+ } elseif ($field instanceof ExpressionInterface) {
$field = $field->sql($generator);
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php
index 1ac6bdb9a..4ea417799 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/QueryExpression.php
@@ -31,7 +31,6 @@
*/
class QueryExpression implements ExpressionInterface, Countable
{
-
use TypeMapTrait;
/**
@@ -573,15 +572,15 @@ public function sql(ValueBinder $generator)
*
* Callback function receives as only argument an instance of ExpressionInterface
*
- * @param callable $callable The callable to apply to all sub-expressions.
+ * @param callable $visitor The callable to apply to all sub-expressions.
* @return void
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
foreach ($this->_conditions as $c) {
if ($c instanceof ExpressionInterface) {
- $callable($c);
- $c->traverse($callable);
+ $visitor($c);
+ $c->traverse($visitor);
}
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/TupleComparison.php b/app/vendor/cakephp/cakephp/src/Database/Expression/TupleComparison.php
index 40ea6648f..101d8a680 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/TupleComparison.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/TupleComparison.php
@@ -23,6 +23,12 @@
*/
class TupleComparison extends Comparison
{
+ /**
+ * The type to be used for casting the value to a database representation
+ *
+ * @var array
+ */
+ protected $_type;
/**
* Constructor
@@ -39,6 +45,16 @@ public function __construct($fields, $values, $types = [], $conjunction = '=')
$this->_type = (array)$types;
}
+ /**
+ * Returns the type to be used for casting the value to a database representation
+ *
+ * @return array
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
/**
* Convert the expression into a SQL fragment.
*
@@ -97,7 +113,7 @@ protected function _stringifyValues($generator)
if ($isMulti) {
$bound = [];
foreach ($value as $k => $val) {
- $valType = $multiType ? $type[$k] : $type;
+ $valType = $multiType && isset($type[$k]) ? $type[$k] : $type;
$bound[] = $this->_bindValue($generator, $val, $valType);
}
@@ -135,19 +151,19 @@ protected function _bindValue($generator, $value, $type)
*
* Callback function receives as its only argument an instance of an ExpressionInterface
*
- * @param callable $callable The callable to apply to sub-expressions
+ * @param callable $visitor The callable to apply to sub-expressions
* @return void
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
foreach ($this->getField() as $field) {
- $this->_traverseValue($field, $callable);
+ $this->_traverseValue($field, $visitor);
}
$value = $this->getValue();
if ($value instanceof ExpressionInterface) {
- $callable($value);
- $value->traverse($callable);
+ $visitor($value);
+ $value->traverse($visitor);
return;
}
@@ -155,10 +171,10 @@ public function traverse(callable $callable)
foreach ($value as $i => $val) {
if ($this->isMulti()) {
foreach ($val as $v) {
- $this->_traverseValue($v, $callable);
+ $this->_traverseValue($v, $visitor);
}
} else {
- $this->_traverseValue($val, $callable);
+ $this->_traverseValue($val, $visitor);
}
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/UnaryExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/UnaryExpression.php
index f58fd675c..554e9a527 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/UnaryExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/UnaryExpression.php
@@ -22,16 +22,17 @@
*/
class UnaryExpression implements ExpressionInterface
{
-
/**
* Indicates that the operation is in pre-order
*
+ * @var int
*/
const PREFIX = 0;
/**
* Indicates that the operation is in post-order
*
+ * @var int
*/
const POSTFIX = 1;
@@ -92,13 +93,12 @@ public function sql(ValueBinder $generator)
/**
* {@inheritDoc}
- *
*/
- public function traverse(callable $callable)
+ public function traverse(callable $visitor)
{
if ($this->_value instanceof ExpressionInterface) {
- $callable($this->_value);
- $this->_value->traverse($callable);
+ $visitor($this->_value);
+ $this->_value->traverse($visitor);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Expression/ValuesExpression.php b/app/vendor/cakephp/cakephp/src/Database/Expression/ValuesExpression.php
index 261e512d5..389caa438 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Expression/ValuesExpression.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Expression/ValuesExpression.php
@@ -29,7 +29,6 @@
*/
class ValuesExpression implements ExpressionInterface
{
-
use ExpressionTypeCasterTrait;
use TypeMapTrait;
@@ -84,7 +83,8 @@ public function __construct(array $columns, $typeMap)
*/
public function add($data)
{
- if ((count($this->_values) && $data instanceof Query) ||
+ if (
+ (count($this->_values) && $data instanceof Query) ||
($this->_query && is_array($data))
) {
throw new Exception(
@@ -376,7 +376,7 @@ protected function _processExpressions()
foreach ($this->_values as $row => $values) {
foreach ($types as $col => $type) {
- /* @var \Cake\Database\Type\ExpressionTypeInterface $type */
+ /** @var \Cake\Database\Type\ExpressionTypeInterface $type */
$this->_values[$row][$col] = $type->toExpression($values[$col]);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/ExpressionInterface.php b/app/vendor/cakephp/cakephp/src/Database/ExpressionInterface.php
index 57b6667db..1091fcaa3 100644
--- a/app/vendor/cakephp/cakephp/src/Database/ExpressionInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/ExpressionInterface.php
@@ -19,7 +19,6 @@
*/
interface ExpressionInterface
{
-
/**
* Converts the Node into a SQL string fragment.
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/FieldTypeConverter.php b/app/vendor/cakephp/cakephp/src/Database/FieldTypeConverter.php
index d1209adb5..fa453d0df 100644
--- a/app/vendor/cakephp/cakephp/src/Database/FieldTypeConverter.php
+++ b/app/vendor/cakephp/cakephp/src/Database/FieldTypeConverter.php
@@ -24,7 +24,6 @@
*/
class FieldTypeConverter
{
-
/**
* An array containing the name of the fields and the Type objects
* each should use when converting them.
diff --git a/app/vendor/cakephp/cakephp/src/Database/FunctionsBuilder.php b/app/vendor/cakephp/cakephp/src/Database/FunctionsBuilder.php
index 22a3b71e1..09fe941df 100644
--- a/app/vendor/cakephp/cakephp/src/Database/FunctionsBuilder.php
+++ b/app/vendor/cakephp/cakephp/src/Database/FunctionsBuilder.php
@@ -23,7 +23,6 @@
*/
class FunctionsBuilder
{
-
/**
* Returns a new instance of a FunctionExpression. This is used for generating
* arbitrary function calls in the final SQL string.
@@ -44,7 +43,7 @@ protected function _build($name, $params = [], $types = [], $return = 'string')
* argument.
*
* @param string $name name of the function to build
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @param string $return The return type for the function
* @return \Cake\Database\Expression\FunctionExpression
@@ -73,7 +72,7 @@ public function rand()
/**
* Returns a FunctionExpression representing a call to SQL SUM function.
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -90,7 +89,7 @@ public function sum($expression, $types = [])
/**
* Returns a FunctionExpression representing a call to SQL AVG function.
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -102,7 +101,7 @@ public function avg($expression, $types = [])
/**
* Returns a FunctionExpression representing a call to SQL MAX function.
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -114,7 +113,7 @@ public function max($expression, $types = [])
/**
* Returns a FunctionExpression representing a call to SQL MIN function.
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -126,7 +125,7 @@ public function min($expression, $types = [])
/**
* Returns a FunctionExpression representing a call to SQL COUNT function.
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -159,6 +158,30 @@ public function coalesce($args, $types = [])
return $this->_build('COALESCE', $args, $types, current($types) ?: 'string');
}
+ /**
+ * Returns a FunctionExpression representing a call to SQL CAST function.
+ *
+ * @param string|\Cake\Database\ExpressionInterface $field Field or expression to cast.
+ * @param string $type The target data type
+ * @return \Cake\Database\Expression\FunctionExpression
+ */
+ public function cast($field, $type = '')
+ {
+ if (is_array($field)) {
+ deprecationWarning(
+ 'Build cast function by FunctionsBuilder::cast(array $args) is deprecated. ' .
+ 'Use FunctionsBuilder::cast($field, string $type) instead.'
+ );
+
+ return $this->_build('CAST', $field);
+ }
+
+ $expression = $this->_literalArgumentFunction('CAST', $field);
+ $expression->setConjunction(' AS')->add([$type => 'literal']);
+
+ return $expression;
+ }
+
/**
* Returns a FunctionExpression representing the difference in days between
* two dates.
@@ -176,20 +199,20 @@ public function dateDiff($args, $types = [])
* Returns the specified date part from the SQL expression.
*
* @param string $part Part of the date to return.
- * @param string $expression Expression to obtain the date part from.
+ * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
public function datePart($part, $expression, $types = [])
{
- return $this->extract($part, $expression);
+ return $this->extract($part, $expression, $types);
}
/**
* Returns the specified date part from the SQL expression.
*
* @param string $part Part of the date to return.
- * @param string $expression Expression to obtain the date part from.
+ * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -204,8 +227,8 @@ public function extract($part, $expression, $types = [])
/**
* Add the time unit to the date expression
*
- * @param string $expression Expression to obtain the date part from.
- * @param string $value Value to be added. Use negative to subtract.
+ * @param string|\Cake\Database\ExpressionInterface $expression Expression to obtain the date part from.
+ * @param string|int $value Value to be added. Use negative to subtract.
* @param string $unit Unit of the value e.g. hour or day.
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
@@ -226,7 +249,7 @@ public function dateAdd($expression, $value, $unit, $types = [])
* Returns a FunctionExpression representing a call to SQL WEEKDAY function.
* 1 - Sunday, 2 - Monday, 3 - Tuesday...
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
@@ -239,7 +262,7 @@ public function dayOfWeek($expression, $types = [])
* Returns a FunctionExpression representing a call to SQL WEEKDAY function.
* 1 - Sunday, 2 - Monday, 3 - Tuesday...
*
- * @param mixed $expression the function argument
+ * @param string|\Cake\Database\ExpressionInterface $expression the function argument
* @param array $types list of types to bind to the arguments
* @return \Cake\Database\Expression\FunctionExpression
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/IdentifierQuoter.php b/app/vendor/cakephp/cakephp/src/Database/IdentifierQuoter.php
index f5866e85c..e82695b22 100644
--- a/app/vendor/cakephp/cakephp/src/Database/IdentifierQuoter.php
+++ b/app/vendor/cakephp/cakephp/src/Database/IdentifierQuoter.php
@@ -25,7 +25,6 @@
*/
class IdentifierQuoter
{
-
/**
* The driver instance used to do the identifier quoting
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Log/LoggedQuery.php b/app/vendor/cakephp/cakephp/src/Database/Log/LoggedQuery.php
index 90c1b100d..b66328dd4 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Log/LoggedQuery.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Log/LoggedQuery.php
@@ -22,7 +22,6 @@
*/
class LoggedQuery
{
-
/**
* Query string that was executed
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php b/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php
index 2fd2dcd99..d38c0a622 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Log/LoggingStatement.php
@@ -24,7 +24,6 @@
*/
class LoggingStatement extends StatementDecorator
{
-
/**
* Logger instance responsible for actually doing the logging task
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Log/QueryLogger.php b/app/vendor/cakephp/cakephp/src/Database/Log/QueryLogger.php
index c80669e93..198f2300b 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Log/QueryLogger.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Log/QueryLogger.php
@@ -24,7 +24,6 @@
*/
class QueryLogger
{
-
/**
* Writes a LoggedQuery into a log
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Query.php b/app/vendor/cakephp/cakephp/src/Database/Query.php
index de223a765..3a7945d38 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Query.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Query.php
@@ -33,7 +33,6 @@
*/
class Query implements ExpressionInterface, IteratorAggregate
{
-
use TypeMapTrait;
/**
@@ -73,7 +72,7 @@ class Query implements ExpressionInterface, IteratorAggregate
'limit' => null,
'offset' => null,
'union' => [],
- 'epilog' => null
+ 'epilog' => null,
];
/**
@@ -676,7 +675,7 @@ public function removeJoin($name)
*
* See `join()` for further details on conditions and types.
*
- * @param string|string[] $table The table to join with
+ * @param string|string[]|\Cake\Database\ExpressionInterface[] $table The table to join with
* @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
* to use for joining.
* @param array $types a list of types associated to the conditions used for converting
@@ -696,7 +695,7 @@ public function leftJoin($table, $conditions = [], $types = [])
* The arguments of this method are identical to the `leftJoin()` shorthand, please refer
* to that methods description for further details.
*
- * @param string|array $table The table to join with
+ * @param string|string[]|\Cake\Database\ExpressionInterface[] $table The table to join with
* @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
* to use for joining.
* @param array $types a list of types associated to the conditions used for converting
@@ -716,7 +715,7 @@ public function rightJoin($table, $conditions = [], $types = [])
* The arguments of this method are identical to the `leftJoin()` shorthand, please refer
* to that methods description for further details.
*
- * @param string|string[] $table The table to join with
+ * @param string|string[]|\Cake\Database\ExpressionInterface[] $table The table to join with
* @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
* to use for joining.
* @param array $types a list of types associated to the conditions used for converting
@@ -731,7 +730,7 @@ public function innerJoin($table, $conditions = [], $types = [])
/**
* Returns an array that can be passed to the join method describing a single join clause
*
- * @param string|string[] $table The table to join with
+ * @param string|string[]|\Cake\Database\ExpressionInterface[] $table The table to join with
* @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
* to use for joining.
* @param string $type the join type to use
@@ -750,8 +749,8 @@ protected function _makeJoin($table, $conditions, $type)
$alias => [
'table' => $table,
'conditions' => $conditions,
- 'type' => $type
- ]
+ 'type' => $type,
+ ],
];
}
@@ -840,8 +839,8 @@ protected function _makeJoin($table, $conditions, $type)
* $query
* ->where(['title !=' => 'Hello World'])
* ->where(function ($exp, $query) {
- * $or = $exp->or_(['id' => 1]);
- * $and = $exp->and_(['id >' => 2, 'id <' => 10]);
+ * $or = $exp->or(['id' => 1]);
+ * $and = $exp->and(['id >' => 2, 'id <' => 10]);
* return $or->add($and);
* });
* ```
@@ -1026,7 +1025,7 @@ public function whereNotInList($field, array $values, array $options = [])
* ->where(['title' => 'Foo'])
* ->andWhere(function ($exp, $query) {
* return $exp
- * ->or_(['author_id' => 1])
+ * ->or(['author_id' => 1])
* ->add(['author_id' => 2]);
* });
* ```
@@ -1089,7 +1088,7 @@ public function andWhere($conditions, $types = [])
* ->where(['title' => 'Foo'])
* ->orWhere(function ($exp, $query) {
* return $exp
- * ->or_(['author_id' => 1])
+ * ->or(['author_id' => 1])
* ->add(['author_id' => 2]);
* });
* ```
@@ -1141,7 +1140,9 @@ public function orWhere($conditions, $types = [])
* `ORDER BY title DESC, author_id ASC`
*
* ```
- * $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
+ * $query
+ * ->order(['title' => $query->newExpr('DESC NULLS FIRST')])
+ * ->order('author_id');
* ```
*
* Will generate:
@@ -1203,7 +1204,7 @@ public function order($fields, $overwrite = false)
* Order fields are not suitable for use with user supplied data as they are
* not sanitized by the query builder.
*
- * @param string|\Cake\Database\Expression\QueryExpression $field The field to order on.
+ * @param string|\Cake\Database\Expression\QueryExpression|callable $field The field to order on.
* @param bool $overwrite Whether or not to reset the order clauses.
* @return $this
*/
@@ -1219,6 +1220,11 @@ public function orderAsc($field, $overwrite = false)
if (!$this->_parts['order']) {
$this->_parts['order'] = new OrderByExpression();
}
+
+ if ($this->_parts['order']->isCallable($field)) {
+ $field = $field($this->newExpr(), $this);
+ }
+
$this->_parts['order']->add(new OrderClauseExpression($field, 'ASC'));
return $this;
@@ -1233,7 +1239,7 @@ public function orderAsc($field, $overwrite = false)
* Order fields are not suitable for use with user supplied data as they are
* not sanitized by the query builder.
*
- * @param string|\Cake\Database\Expression\QueryExpression $field The field to order on.
+ * @param string|\Cake\Database\Expression\QueryExpression|callable $field The field to order on.
* @param bool $overwrite Whether or not to reset the order clauses.
* @return $this
*/
@@ -1249,6 +1255,11 @@ public function orderDesc($field, $overwrite = false)
if (!$this->_parts['order']) {
$this->_parts['order'] = new OrderByExpression();
}
+
+ if ($this->_parts['order']->isCallable($field)) {
+ $field = $field($this->newExpr(), $this);
+ }
+
$this->_parts['order']->add(new OrderClauseExpression($field, 'DESC'));
return $this;
@@ -1415,7 +1426,7 @@ public function page($num, $limit = null)
* $query->limit($query->newExpr()->add(['1 + 1'])); // LIMIT (1 + 1)
* ```
*
- * @param int|\Cake\Database\ExpressionInterface $num number of records to be returned
+ * @param int|\Cake\Database\ExpressionInterface|null $num number of records to be returned
* @return $this
*/
public function limit($num)
@@ -1444,7 +1455,7 @@ public function limit($num)
* $query->offset($query->newExpr()->add(['1 + 1'])); // OFFSET (1 + 1)
* ```
*
- * @param int|\Cake\Database\ExpressionInterface $num number of records to be skipped
+ * @param int|\Cake\Database\ExpressionInterface|null $num number of records to be skipped
* @return $this
*/
public function offset($num)
@@ -1489,7 +1500,7 @@ public function union($query, $overwrite = false)
}
$this->_parts['union'][] = [
'all' => false,
- 'query' => $query
+ 'query' => $query,
];
$this->_dirty();
@@ -1524,7 +1535,7 @@ public function unionAll($query, $overwrite = false)
}
$this->_parts['union'][] = [
'all' => true,
- 'query' => $query
+ 'query' => $query,
];
$this->_dirty();
@@ -1584,7 +1595,7 @@ public function into($table)
* ### Example
*
* ```
- * $query->newExp()->lte('count', $query->identifier('total'));
+ * $query->newExpr()->lte('count', $query->identifier('total'));
* ```
*
* @param string $identifier The identifier for an expression
@@ -1686,7 +1697,7 @@ public function update($table)
* @param mixed $value The value to update $key to. Can be null if $key is an
* array or QueryExpression. When $key is an array, this parameter will be
* used as $types instead.
- * @param array $types The column types to treat data as.
+ * @param array|string $types The column types to treat data as.
* @return $this
*/
public function set($key, $value = null, $types = [])
@@ -1751,7 +1762,7 @@ public function delete($table = null)
*
* Epliog content is raw SQL and not suitable for use with user supplied data.
*
- * @param string|\Cake\Database\Expression\QueryExpression|null $expression The expression to be appended
+ * @param string|\Cake\Database\ExpressionInterface|null $expression The expression to be appended
* @return $this
*/
public function epilog($expression = null)
@@ -2003,7 +2014,7 @@ public function getValueBinder()
* associate values to those placeholders so that they can be passed correctly
* to the statement object.
*
- * @param \Cake\Database\ValueBinder|bool $binder The binder or false to disable binding.
+ * @param \Cake\Database\ValueBinder|false $binder The binder or false to disable binding.
* @return $this
*/
public function setValueBinder($binder)
@@ -2229,7 +2240,7 @@ protected function _decorateStatement($statement)
* Helper function used to build conditions by composing QueryExpression objects.
*
* @param string $part Name of the query part to append the new part to
- * @param string|null|array|\Cake\Database\ExpressionInterface|callable $append Expression or builder function to append.
+ * @param string|array|\Cake\Database\ExpressionInterface|callable|null $append Expression or builder function to append.
* @param string $conjunction type of conjunction to be used to operate part
* @param array $types associative array of type names used to bind values to query
* @return void
@@ -2345,7 +2356,7 @@ public function __debugInfo()
'params' => $params,
'defaultTypes' => $this->getDefaultTypes(),
'decorators' => count($this->_resultDecorators),
- 'executed' => $this->_iterator ? true : false
+ 'executed' => $this->_iterator ? true : false,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/QueryCompiler.php b/app/vendor/cakephp/cakephp/src/Database/QueryCompiler.php
index 79f5c6791..d28ecefd7 100644
--- a/app/vendor/cakephp/cakephp/src/Database/QueryCompiler.php
+++ b/app/vendor/cakephp/cakephp/src/Database/QueryCompiler.php
@@ -23,7 +23,6 @@
*/
class QueryCompiler
{
-
/**
* List of sprintf templates that will be used for compiling the SQL for
* this query. There are some clauses that can be built as just as the
@@ -39,7 +38,7 @@ class QueryCompiler
'order' => ' %s',
'limit' => ' LIMIT %s',
'offset' => ' OFFSET %s',
- 'epilog' => ' %s'
+ 'epilog' => ' %s',
];
/**
@@ -49,7 +48,7 @@ class QueryCompiler
*/
protected $_selectParts = [
'select', 'from', 'join', 'where', 'group', 'having', 'order', 'limit',
- 'offset', 'union', 'epilog'
+ 'offset', 'union', 'epilog',
];
/**
@@ -125,7 +124,8 @@ public function compile(Query $query, ValueBinder $generator)
protected function _sqlCompiler(&$sql, $query, $generator)
{
return function ($parts, $name) use (&$sql, $query, $generator) {
- if (!isset($parts) ||
+ if (
+ !isset($parts) ||
((is_array($parts) || $parts instanceof \Countable) && !count($parts))
) {
return;
diff --git a/app/vendor/cakephp/cakephp/src/Database/README.md b/app/vendor/cakephp/cakephp/src/Database/README.md
index c545e318d..e0add0b26 100644
--- a/app/vendor/cakephp/cakephp/src/Database/README.md
+++ b/app/vendor/cakephp/cakephp/src/Database/README.md
@@ -270,7 +270,7 @@ Combining expressions is also possible:
```php
$query->where(function ($exp) {
- $orConditions = $exp->or_(['author_id' => 2])
+ $orConditions = $exp->or(['author_id' => 2])
->eq('author_id', 5);
return $exp
->not($orConditions)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php
index 281c2208e..24098011b 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php
@@ -24,7 +24,6 @@
*/
abstract class BaseSchema
{
-
/**
* The driver instance being used.
*
@@ -216,10 +215,10 @@ public function convertOptionsDescription(TableSchema $schema, $row)
* Generate the SQL to create a table.
*
* @param \Cake\Database\Schema\TableSchema $schema Table instance.
- * @param array $columns The columns to go inside the table.
- * @param array $constraints The constraints for the table.
- * @param array $indexes The indexes for the table.
- * @return array SQL statements to create a table.
+ * @param string[] $columns The columns to go inside the table.
+ * @param string[] $constraints The constraints for the table.
+ * @param string[] $indexes The indexes for the table.
+ * @return string[] SQL statements to create a table.
*/
abstract public function createTableSql(TableSchema $schema, $columns, $constraints, $indexes);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php b/app/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php
index 8ec484f02..1137167ea 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php
@@ -22,7 +22,6 @@
*/
class CachedCollection extends Collection
{
-
/**
* The name of the cache config key to use for caching table metadata,
* of false if disabled.
@@ -45,7 +44,6 @@ public function __construct(ConnectionInterface $connection, $cacheKey = true)
/**
* {@inheritDoc}
- *
*/
public function describe($name, array $options = [])
{
@@ -77,7 +75,13 @@ public function describe($name, array $options = [])
*/
public function cacheKey($name)
{
- return $this->_connection->configName() . '_' . $name;
+ $cachePrefix = $this->_connection->configName();
+ $config = $this->_connection->config();
+ if (isset($config['cacheKeyPrefix'])) {
+ $cachePrefix = $config['cacheKeyPrefix'];
+ }
+
+ return $cachePrefix . '_' . $name;
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/Collection.php b/app/vendor/cakephp/cakephp/src/Database/Schema/Collection.php
index 0222e3c3d..65bccaf04 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/Collection.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/Collection.php
@@ -26,7 +26,6 @@
*/
class Collection
{
-
/**
* Connection object
*
@@ -55,7 +54,7 @@ public function __construct(Connection $connection)
/**
* Get the list of tables available in the current connection.
*
- * @return array The list of tables in the connected database/schema.
+ * @return string[] The list of tables in the connected database/schema.
*/
public function listTables()
{
@@ -94,7 +93,7 @@ public function describe($name, array $options = [])
if (strpos($name, '.')) {
list($config['schema'], $name) = explode('.', $name);
}
- $table = new TableSchema($name);
+ $table = $this->_connection->getDriver()->newTableSchema($name);
$this->_reflect('Column', $name, $config, $table);
if (count($table->columns()) === 0) {
@@ -114,7 +113,7 @@ public function describe($name, array $options = [])
* @param string $stage The stage name.
* @param string $name The table name.
* @param array $config The config data.
- * @param \Cake\Database\Schema\TableSchema $schema The table instance
+ * @param \Cake\Database\Schema\TableSchemaInterface $schema The table schema instance.
* @return void
* @throws \Cake\Database\Exception on query failure.
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/MysqlSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/MysqlSchema.php
index ce1d95960..bee0d9eaa 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/MysqlSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/MysqlSchema.php
@@ -90,7 +90,7 @@ protected function _convertColumn($column)
$col = strtolower($matches[1]);
$length = $precision = null;
- if (isset($matches[2])) {
+ if (isset($matches[2]) && strlen($matches[2])) {
$length = $matches[2];
if (strpos($matches[2], ',') !== false) {
list($length, $precision) = explode(',', $length);
@@ -123,7 +123,7 @@ protected function _convertColumn($column)
return ['type' => TableSchema::TYPE_UUID, 'length' => null];
}
if ($col === 'char') {
- return ['type' => TableSchema::TYPE_STRING, 'fixed' => true, 'length' => $length];
+ return ['type' => TableSchema::TYPE_STRING, 'length' => $length, 'fixed' => true];
}
if (strpos($col, 'char') !== false) {
return ['type' => TableSchema::TYPE_STRING, 'length' => $length];
@@ -148,7 +148,7 @@ protected function _convertColumn($column)
'type' => TableSchema::TYPE_FLOAT,
'length' => $length,
'precision' => $precision,
- 'unsigned' => $unsigned
+ 'unsigned' => $unsigned,
];
}
if (strpos($col, 'decimal') !== false) {
@@ -156,7 +156,7 @@ protected function _convertColumn($column)
'type' => TableSchema::TYPE_DECIMAL,
'length' => $length,
'precision' => $precision,
- 'unsigned' => $unsigned
+ 'unsigned' => $unsigned,
];
}
@@ -230,13 +230,13 @@ public function convertIndexDescription(TableSchema $schema, $row)
$schema->addIndex($name, [
'type' => $type,
'columns' => $columns,
- 'length' => $length
+ 'length' => $length,
]);
} else {
$schema->addConstraint($name, [
'type' => $type,
'columns' => $columns,
- 'length' => $length
+ 'length' => $length,
]);
}
}
@@ -326,7 +326,7 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_DATETIME => ' DATETIME',
TableSchema::TYPE_TIMESTAMP => ' TIMESTAMP',
TableSchema::TYPE_UUID => ' CHAR(36)',
- TableSchema::TYPE_JSON => $nativeJson ? ' JSON' : ' LONGTEXT'
+ TableSchema::TYPE_JSON => $nativeJson ? ' JSON' : ' LONGTEXT',
];
$specialMap = [
'string' => true,
@@ -382,17 +382,19 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_INTEGER,
TableSchema::TYPE_SMALLINTEGER,
TableSchema::TYPE_TINYINTEGER,
- TableSchema::TYPE_STRING
+ TableSchema::TYPE_STRING,
];
if (in_array($data['type'], $hasLength, true) && isset($data['length'])) {
$out .= '(' . (int)$data['length'] . ')';
}
$hasPrecision = [TableSchema::TYPE_FLOAT, TableSchema::TYPE_DECIMAL];
- if (in_array($data['type'], $hasPrecision, true) &&
- (isset($data['length']) || isset($data['precision']))
- ) {
- $out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
+ if (in_array($data['type'], $hasPrecision, true) && isset($data['length'])) {
+ if (isset($data['precision'])) {
+ $out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
+ } else {
+ $out .= '(' . (int)$data['length'] . ')';
+ }
}
$hasUnsigned = [
@@ -401,9 +403,10 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_INTEGER,
TableSchema::TYPE_BIGINTEGER,
TableSchema::TYPE_FLOAT,
- TableSchema::TYPE_DECIMAL
+ TableSchema::TYPE_DECIMAL,
];
- if (in_array($data['type'], $hasUnsigned, true) &&
+ if (
+ in_array($data['type'], $hasUnsigned, true) &&
isset($data['unsigned']) && $data['unsigned'] === true
) {
$out .= ' UNSIGNED';
@@ -425,7 +428,8 @@ public function columnSql(TableSchema $schema, $name)
!$schema->hasAutoincrement() &&
!isset($data['autoIncrement'])
);
- if (in_array($data['type'], [TableSchema::TYPE_INTEGER, TableSchema::TYPE_BIGINTEGER]) &&
+ if (
+ in_array($data['type'], [TableSchema::TYPE_INTEGER, TableSchema::TYPE_BIGINTEGER]) &&
($data['autoIncrement'] === true || $addAutoIncrement)
) {
$out .= ' AUTO_INCREMENT';
@@ -434,7 +438,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= ' NULL';
unset($data['default']);
}
- if (isset($data['default']) &&
+ if (
+ isset($data['default']) &&
in_array($data['type'], [TableSchema::TYPE_TIMESTAMP, TableSchema::TYPE_DATETIME]) &&
in_array(strtolower($data['default']), ['current_timestamp', 'current_timestamp()'])
) {
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchema.php
index 0d8ee340f..cb0da6dca 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/PostgresSchema.php
@@ -22,7 +22,6 @@
*/
class PostgresSchema extends BaseSchema
{
-
/**
* {@inheritDoc}
*/
@@ -116,7 +115,8 @@ protected function _convertColumn($column)
}
// money is 'string' as it includes arbitrary text content
// before the number value.
- if (strpos($col, 'char') !== false ||
+ if (
+ strpos($col, 'char') !== false ||
strpos($col, 'money') !== false
) {
return ['type' => TableSchema::TYPE_STRING, 'length' => $length];
@@ -130,7 +130,8 @@ protected function _convertColumn($column)
if ($col === 'real' || strpos($col, 'double') !== false) {
return ['type' => TableSchema::TYPE_FLOAT, 'length' => null];
}
- if (strpos($col, 'numeric') !== false ||
+ if (
+ strpos($col, 'numeric') !== false ||
strpos($col, 'decimal') !== false
) {
return ['type' => TableSchema::TYPE_DECIMAL, 'length' => null];
@@ -166,7 +167,7 @@ public function convertColumnDescription(TableSchema $schema, $row)
'default' => $this->_defaultValue($row['default']),
'null' => $row['null'] === 'YES',
'collate' => $row['collation_name'],
- 'comment' => $row['comment']
+ 'comment' => $row['comment'],
];
$field['length'] = $row['char_length'] ?: $field['length'];
@@ -258,7 +259,7 @@ public function convertIndexDescription(TableSchema $schema, $row)
if (!$index) {
$index = [
'type' => $type,
- 'columns' => []
+ 'columns' => [],
];
}
$index['columns'][] = $row['attname'];
@@ -280,7 +281,7 @@ protected function _convertConstraint($schema, $name, $type, $row)
if (!$constraint) {
$constraint = [
'type' => $type,
- 'columns' => []
+ 'columns' => [],
];
}
$constraint['columns'][] = $row['attname'];
@@ -367,7 +368,7 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_DATETIME => ' TIMESTAMP',
TableSchema::TYPE_TIMESTAMP => ' TIMESTAMP',
TableSchema::TYPE_UUID => ' UUID',
- TableSchema::TYPE_JSON => ' JSONB'
+ TableSchema::TYPE_JSON => ' JSONB',
];
if (isset($typeMap[$data['type']])) {
@@ -390,7 +391,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= ' BYTEA';
}
- if ($data['type'] === TableSchema::TYPE_STRING ||
+ if (
+ $data['type'] === TableSchema::TYPE_STRING ||
($data['type'] === TableSchema::TYPE_TEXT && $data['length'] === TableSchema::LENGTH_TINY)
) {
$isFixed = !empty($data['fixed']);
@@ -413,7 +415,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= '(' . (int)$data['precision'] . ')';
}
- if ($data['type'] === TableSchema::TYPE_DECIMAL &&
+ if (
+ $data['type'] === TableSchema::TYPE_DECIMAL &&
(isset($data['length']) || isset($data['precision']))
) {
$out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
@@ -423,7 +426,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= ' NOT NULL';
}
- if (isset($data['default']) &&
+ if (
+ isset($data['default']) &&
in_array($data['type'], [TableSchema::TYPE_TIMESTAMP, TableSchema::TYPE_DATETIME]) &&
strtolower($data['default']) === 'current_timestamp'
) {
@@ -580,7 +584,7 @@ public function truncateTableSql(TableSchema $schema)
$name = $this->_driver->quoteIdentifier($schema->name());
return [
- sprintf('TRUNCATE %s RESTART IDENTITY CASCADE', $name)
+ sprintf('TRUNCATE %s RESTART IDENTITY CASCADE', $name),
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlGeneratorInterface.php b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlGeneratorInterface.php
index f71111dfa..847f7d822 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlGeneratorInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlGeneratorInterface.php
@@ -21,7 +21,6 @@
*/
interface SqlGeneratorInterface
{
-
/**
* Generate the SQL to create the Table.
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php
index 3384df6f4..425707c27 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchema.php
@@ -22,7 +22,6 @@
*/
class SqliteSchema extends BaseSchema
{
-
/**
* Array containing the foreign keys constraints names
* Necessary for composite foreign keys to be handled
@@ -61,9 +60,14 @@ protected function _convertColumn($column)
}
$col = strtolower($matches[2]);
- $length = null;
+ $length = $precision = null;
if (isset($matches[3])) {
- $length = (int)$matches[3];
+ $length = $matches[3];
+ if (strpos($length, ',') !== false) {
+ list($length, $precision) = explode(',', $length);
+ }
+ $length = (int)$length;
+ $precision = (int)$precision;
}
if ($col === 'bigint') {
@@ -79,10 +83,10 @@ protected function _convertColumn($column)
return ['type' => TableSchema::TYPE_INTEGER, 'length' => $length, 'unsigned' => $unsigned];
}
if (strpos($col, 'decimal') !== false) {
- return ['type' => TableSchema::TYPE_DECIMAL, 'length' => null, 'unsigned' => $unsigned];
+ return ['type' => TableSchema::TYPE_DECIMAL, 'length' => $length, 'precision' => $precision, 'unsigned' => $unsigned];
}
if (in_array($col, ['float', 'real', 'double'])) {
- return ['type' => TableSchema::TYPE_FLOAT, 'length' => null, 'unsigned' => $unsigned];
+ return ['type' => TableSchema::TYPE_FLOAT, 'length' => $length, 'precision' => $precision, 'unsigned' => $unsigned];
}
if (strpos($col, 'boolean') !== false) {
@@ -120,7 +124,7 @@ public function listTablesSql($config)
return [
'SELECT name FROM sqlite_master WHERE type="table" ' .
'AND name != "sqlite_sequence" ORDER BY name',
- []
+ [],
];
}
@@ -164,7 +168,7 @@ public function convertColumnDescription(TableSchema $schema, $row)
if ($row['pk']) {
$constraint = (array)$schema->getConstraint('primary') + [
'type' => TableSchema::CONSTRAINT_PRIMARY,
- 'columns' => []
+ 'columns' => [],
];
$constraint['columns'] = array_merge($constraint['columns'], [$row['name']]);
$schema->addConstraint('primary', $constraint);
@@ -214,7 +218,6 @@ public function describeIndexSql($tableName, $config)
* additional queries are done here. Sqlite constraint names are not
* stable, and the names for constraints will not match those used to create
* the table. This is a limitation in Sqlite's metadata features.
- *
*/
public function convertIndexDescription(TableSchema $schema, $row)
{
@@ -232,12 +235,12 @@ public function convertIndexDescription(TableSchema $schema, $row)
if ($row['unique']) {
$schema->addConstraint($row['name'], [
'type' => TableSchema::CONSTRAINT_UNIQUE,
- 'columns' => $columns
+ 'columns' => $columns,
]);
} else {
$schema->addIndex($row['name'], [
'type' => TableSchema::INDEX_INDEX,
- 'columns' => $columns
+ 'columns' => $columns,
]);
}
}
@@ -300,7 +303,7 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_TIME => ' TIME',
TableSchema::TYPE_DATETIME => ' DATETIME',
TableSchema::TYPE_TIMESTAMP => ' TIMESTAMP',
- TableSchema::TYPE_JSON => ' TEXT'
+ TableSchema::TYPE_JSON => ' TEXT',
];
$out = $this->_driver->quoteIdentifier($name);
@@ -310,10 +313,11 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_INTEGER,
TableSchema::TYPE_BIGINTEGER,
TableSchema::TYPE_FLOAT,
- TableSchema::TYPE_DECIMAL
+ TableSchema::TYPE_DECIMAL,
];
- if (in_array($data['type'], $hasUnsigned, true) &&
+ if (
+ in_array($data['type'], $hasUnsigned, true) &&
isset($data['unsigned']) && $data['unsigned'] === true
) {
if ($data['type'] !== TableSchema::TYPE_INTEGER || [$name] !== (array)$schema->primaryKey()) {
@@ -329,7 +333,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= ' TEXT';
}
- if ($data['type'] === TableSchema::TYPE_STRING ||
+ if (
+ $data['type'] === TableSchema::TYPE_STRING ||
($data['type'] === TableSchema::TYPE_TEXT && $data['length'] === TableSchema::LENGTH_TINY)
) {
$out .= ' VARCHAR';
@@ -352,14 +357,16 @@ public function columnSql(TableSchema $schema, $name)
TableSchema::TYPE_SMALLINTEGER,
TableSchema::TYPE_INTEGER,
];
- if (in_array($data['type'], $integerTypes, true) &&
+ if (
+ in_array($data['type'], $integerTypes, true) &&
isset($data['length']) && [$name] !== (array)$schema->primaryKey()
) {
$out .= '(' . (int)$data['length'] . ')';
}
$hasPrecision = [TableSchema::TYPE_FLOAT, TableSchema::TYPE_DECIMAL];
- if (in_array($data['type'], $hasPrecision, true) &&
+ if (
+ in_array($data['type'], $hasPrecision, true) &&
(isset($data['length']) || isset($data['precision']))
) {
$out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
@@ -388,12 +395,12 @@ public function columnSql(TableSchema $schema, $name)
*
* Note integer primary keys will return ''. This is intentional as Sqlite requires
* that integer primary keys be defined in the column definition.
- *
*/
public function constraintSql(TableSchema $schema, $name)
{
$data = $schema->getConstraint($name);
- if ($data['type'] === TableSchema::CONSTRAINT_PRIMARY &&
+ if (
+ $data['type'] === TableSchema::CONSTRAINT_PRIMARY &&
count($data['columns']) === 1 &&
$schema->getColumn($data['columns'][0])['type'] === TableSchema::TYPE_INTEGER
) {
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchema.php
index 74bfc91e8..12f84d055 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchema.php
@@ -19,7 +19,9 @@
*/
class SqlserverSchema extends BaseSchema
{
-
+ /**
+ * @var string
+ */
const DEFAULT_SCHEMA_NAME = 'dbo';
/**
@@ -81,9 +83,9 @@ public function describeColumnSql($tableName, $config)
protected function _convertColumn($col, $length = null, $precision = null, $scale = null)
{
$col = strtolower($col);
- $length = (int)$length;
- $precision = (int)$precision;
- $scale = (int)$scale;
+ $length = $length !== null ? (int)$length : $length;
+ $precision = $precision !== null ? (int)$precision : $precision;
+ $scale = $scale !== null ? (int)$scale : $scale;
if (in_array($col, ['date', 'time'])) {
return ['type' => $col, 'length' => null];
@@ -107,7 +109,8 @@ protected function _convertColumn($col, $length = null, $precision = null, $scal
if ($col === 'bit') {
return ['type' => TableSchema::TYPE_BOOLEAN, 'length' => null];
}
- if (strpos($col, 'numeric') !== false ||
+ if (
+ strpos($col, 'numeric') !== false ||
strpos($col, 'money') !== false ||
strpos($col, 'decimal') !== false
) {
@@ -139,6 +142,11 @@ protected function _convertColumn($col, $length = null, $precision = null, $scal
}
if ($col === 'image' || strpos($col, 'binary') !== false) {
+ // -1 is the value for MAX which we treat as a 'long' binary
+ if ($length == -1) {
+ $length = TableSchema::LENGTH_LONG;
+ }
+
return ['type' => TableSchema::TYPE_BINARY, 'length' => $length];
}
@@ -253,14 +261,14 @@ public function convertIndexDescription(TableSchema $schema, $row)
if ($type === TableSchema::CONSTRAINT_PRIMARY || $type === TableSchema::CONSTRAINT_UNIQUE) {
$schema->addConstraint($name, [
'type' => $type,
- 'columns' => $columns
+ 'columns' => $columns,
]);
return;
}
$schema->addIndex($name, [
'type' => $type,
- 'columns' => $columns
+ 'columns' => $columns,
]);
}
@@ -309,7 +317,7 @@ protected function _foreignOnClause($on)
{
$parent = parent::_foreignOnClause($on);
- return $parent === 'RESTRICT' ? parent::_foreignOnClause(TableSchema::ACTION_SET_NULL) : $parent;
+ return $parent === 'RESTRICT' ? parent::_foreignOnClause(TableSchema::ACTION_NO_ACTION) : $parent;
}
/**
@@ -371,8 +379,10 @@ public function columnSql(TableSchema $schema, $name)
}
if ($data['type'] === TableSchema::TYPE_BINARY) {
- if (!isset($data['length'])
- || in_array($data['length'], [TableSchema::LENGTH_MEDIUM, TableSchema::LENGTH_LONG], true)) {
+ if (
+ !isset($data['length'])
+ || in_array($data['length'], [TableSchema::LENGTH_MEDIUM, TableSchema::LENGTH_LONG], true)
+ ) {
$data['length'] = 'MAX';
}
@@ -385,7 +395,8 @@ public function columnSql(TableSchema $schema, $name)
}
}
- if ($data['type'] === TableSchema::TYPE_STRING ||
+ if (
+ $data['type'] === TableSchema::TYPE_STRING ||
($data['type'] === TableSchema::TYPE_TEXT && $data['length'] === TableSchema::LENGTH_TINY)
) {
$type = ' NVARCHAR';
@@ -410,7 +421,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= '(' . (int)$data['precision'] . ')';
}
- if ($data['type'] === TableSchema::TYPE_DECIMAL &&
+ if (
+ $data['type'] === TableSchema::TYPE_DECIMAL &&
(isset($data['length']) || isset($data['precision']))
) {
$out .= '(' . (int)$data['length'] . ',' . (int)$data['precision'] . ')';
@@ -420,7 +432,8 @@ public function columnSql(TableSchema $schema, $name)
$out .= ' NOT NULL';
}
- if (isset($data['default']) &&
+ if (
+ isset($data['default']) &&
in_array($data['type'], [TableSchema::TYPE_TIMESTAMP, TableSchema::TYPE_DATETIME]) &&
strtolower($data['default']) === 'current_timestamp'
) {
@@ -561,7 +574,7 @@ public function truncateTableSql(TableSchema $schema)
{
$name = $this->_driver->quoteIdentifier($schema->name());
$queries = [
- sprintf('DELETE FROM %s', $name)
+ sprintf('DELETE FROM %s', $name),
];
// Restart identity sequences
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php
index b2cfdae0a..289ee046a 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchema.php
@@ -31,7 +31,6 @@
*/
class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
{
-
/**
* The name of the table
*
@@ -110,7 +109,7 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
public static $columnLengths = [
'tiny' => self::LENGTH_TINY,
'medium' => self::LENGTH_MEDIUM,
- 'long' => self::LENGTH_LONG
+ 'long' => self::LENGTH_LONG,
];
/**
@@ -488,6 +487,7 @@ public function defaultValues()
/**
* {@inheritDoc}
+ *
* @throws \Cake\Database\Exception
*/
public function addIndex($name, $attrs)
@@ -573,6 +573,7 @@ public function primaryKey()
/**
* {@inheritDoc}
+ *
* @throws \Cake\Database\Exception
*/
public function addConstraint($name, $attrs)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaAwareInterface.php b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaAwareInterface.php
index 7732b269b..e5f5ff806 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaAwareInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaAwareInterface.php
@@ -19,7 +19,6 @@
*/
interface TableSchemaAwareInterface
{
-
/**
* Get and set the schema for this fixture.
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaInterface.php b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaInterface.php
index 8bb2c701b..41104dad2 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Schema/TableSchemaInterface.php
@@ -21,7 +21,6 @@
*/
interface TableSchemaInterface extends SchemaInterface
{
-
/**
* Binary column type
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/SchemaCache.php b/app/vendor/cakephp/cakephp/src/Database/SchemaCache.php
index 5f6433fbf..b1d71a63e 100644
--- a/app/vendor/cakephp/cakephp/src/Database/SchemaCache.php
+++ b/app/vendor/cakephp/cakephp/src/Database/SchemaCache.php
@@ -16,6 +16,7 @@
use Cake\Cache\Cache;
use Cake\Database\Connection;
+use Cake\Log\Log;
use RuntimeException;
/**
@@ -25,10 +26,11 @@
* can prevent thundering herd effects on the metadata cache when new
* versions of your application are deployed, or when migrations
* requiring updated metadata are required.
+ *
+ * @link https://en.wikipedia.org/wiki/Thundering_herd_problem About the thundering herd problem
*/
class SchemaCache
{
-
/**
* Schema
*
@@ -103,6 +105,7 @@ public function getSchema(Connection $connection)
$config = $connection->config();
if (empty($config['cacheMetadata'])) {
+ Log::info(sprintf('Metadata cache was disabled in config for `%s`. Enabling to clear cache.', $connection->configName()));
$connection->cacheMetadata(true);
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/SqlDialectTrait.php b/app/vendor/cakephp/cakephp/src/Database/SqlDialectTrait.php
index 182818c02..c0eda4f9d 100644
--- a/app/vendor/cakephp/cakephp/src/Database/SqlDialectTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/SqlDialectTrait.php
@@ -15,13 +15,13 @@
namespace Cake\Database;
use Cake\Database\Expression\Comparison;
+use Cake\Database\Expression\IdentifierExpression;
/**
* Sql dialect trait
*/
trait SqlDialectTrait
{
-
/**
* Quotes a database identifier (a column name, table name, etc..) to
* be used safely in queries without the risk of using reserved words
@@ -222,20 +222,31 @@ protected function _removeAliasesFromConditions($query)
$conditions = $query->clause('where');
if ($conditions) {
- $conditions->traverse(function ($condition) {
- if (!($condition instanceof Comparison)) {
- return $condition;
- }
+ $conditions->traverse(function ($expression) {
+ if ($expression instanceof Comparison) {
+ $field = $expression->getField();
+ if (
+ is_string($field) &&
+ strpos($field, '.') !== false
+ ) {
+ list(, $unaliasedField) = explode('.', $field, 2);
+ $expression->setField($unaliasedField);
+ }
- $field = $condition->getField();
- if ($field instanceof ExpressionInterface || strpos($field, '.') === false) {
- return $condition;
+ return $expression;
}
- list(, $field) = explode('.', $field);
- $condition->setField($field);
+ if ($expression instanceof IdentifierExpression) {
+ $identifier = $expression->getIdentifier();
+ if (strpos($identifier, '.') !== false) {
+ list(, $unaliasedIdentifier) = explode('.', $identifier, 2);
+ $expression->setIdentifier($unaliasedIdentifier);
+ }
+
+ return $expression;
+ }
- return $condition;
+ return $expression;
});
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/SqliteCompiler.php b/app/vendor/cakephp/cakephp/src/Database/SqliteCompiler.php
index 5a9e54767..1c7fa949c 100644
--- a/app/vendor/cakephp/cakephp/src/Database/SqliteCompiler.php
+++ b/app/vendor/cakephp/cakephp/src/Database/SqliteCompiler.php
@@ -22,7 +22,6 @@
*/
class SqliteCompiler extends QueryCompiler
{
-
/**
* SQLite does not support ORDER BY in UNION queries.
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/SqlserverCompiler.php b/app/vendor/cakephp/cakephp/src/Database/SqlserverCompiler.php
index 2f8c83d97..c2e3ec988 100644
--- a/app/vendor/cakephp/cakephp/src/Database/SqlserverCompiler.php
+++ b/app/vendor/cakephp/cakephp/src/Database/SqlserverCompiler.php
@@ -22,7 +22,6 @@
*/
class SqlserverCompiler extends QueryCompiler
{
-
/**
* SQLserver does not support ORDER BY in UNION queries.
*
@@ -40,7 +39,7 @@ class SqlserverCompiler extends QueryCompiler
'having' => ' HAVING %s ',
'order' => ' %s',
'offset' => ' OFFSET %s ROWS',
- 'epilog' => ' %s'
+ 'epilog' => ' %s',
];
/**
@@ -48,7 +47,7 @@ class SqlserverCompiler extends QueryCompiler
*/
protected $_selectParts = [
'select', 'from', 'join', 'where', 'group', 'having', 'order', 'offset',
- 'limit', 'union', 'epilog'
+ 'limit', 'union', 'epilog',
];
/**
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/BufferResultsTrait.php b/app/vendor/cakephp/cakephp/src/Database/Statement/BufferResultsTrait.php
index 0ad4c795f..c0c8fc2ff 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/BufferResultsTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/BufferResultsTrait.php
@@ -21,7 +21,6 @@
*/
trait BufferResultsTrait
{
-
/**
* Whether or not to buffer results in php
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/BufferedStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/BufferedStatement.php
index 17b819fe3..55b054e6e 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/BufferedStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/BufferedStatement.php
@@ -147,7 +147,10 @@ public function execute($params = null)
}
/**
- * {@inheritDoc}
+ * Returns the value of the result at position.
+ *
+ * @param int $position The numeric position of the column to retrieve in the result
+ * @return mixed Returns the specific value of the column designated at $position
*/
public function fetchColumn($position)
{
@@ -189,7 +192,7 @@ public function lastInsertId($table = null, $column = null)
/**
* {@inheritDoc}
*
- * @param string $type The type to fetch.
+ * @param int|string $type The type to fetch.
* @return array|false
*/
public function fetch($type = self::FETCH_TYPE_NUM)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/CallbackStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/CallbackStatement.php
index b7035ff1e..714f05604 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/CallbackStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/CallbackStatement.php
@@ -22,7 +22,6 @@
*/
class CallbackStatement extends StatementDecorator
{
-
/**
* A callback function to be applied to results.
*
@@ -48,7 +47,7 @@ public function __construct($statement, $driver, $callback)
*
* The result will be processed by the callback when it is not `false`.
*
- * @param string $type Either 'num' or 'assoc' to indicate the result format you would like.
+ * @param string|int $type Either 'num' or 'assoc' to indicate the result format you would like.
* @return array|false
*/
public function fetch($type = parent::FETCH_TYPE_NUM)
@@ -64,7 +63,7 @@ public function fetch($type = parent::FETCH_TYPE_NUM)
*
* Each row in the result will be processed by the callback when it is not `false.
*
- * @param string $type Either 'num' or 'assoc' to indicate the result format you would like.
+ * @param string|int $type Either 'num' or 'assoc' to indicate the result format you would like.
* @return array
*/
public function fetchAll($type = parent::FETCH_TYPE_NUM)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php
index 0f751945b..dc3fcbbed 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php
@@ -23,12 +23,10 @@
*/
class MysqlStatement extends PDOStatement
{
-
use BufferResultsTrait;
/**
* {@inheritDoc}
- *
*/
public function execute($params = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php
index 4bf00f928..83e25ac16 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php
@@ -23,7 +23,6 @@
*/
class PDOStatement extends StatementDecorator
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/SqliteStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/SqliteStatement.php
index 08e0b558b..8b9da2e7f 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/SqliteStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/SqliteStatement.php
@@ -21,12 +21,10 @@
*/
class SqliteStatement extends StatementDecorator
{
-
use BufferResultsTrait;
/**
* {@inheritDoc}
- *
*/
public function execute($params = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Statement/SqlserverStatement.php b/app/vendor/cakephp/cakephp/src/Database/Statement/SqlserverStatement.php
index 5b1eb539d..c18694edc 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Statement/SqlserverStatement.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Statement/SqlserverStatement.php
@@ -23,12 +23,11 @@
*/
class SqlserverStatement extends PDOStatement
{
-
/**
+ * {@inheritDoc}
+ *
* The SQL Server PDO driver requires that binary parameters be bound with the SQLSRV_ENCODING_BINARY attribute.
* This overrides the PDOStatement::bindValue method in order to bind binary columns using the required attribute.
- *
- * {@inheritDoc}
*/
public function bindValue($column, $value, $type = 'string')
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type.php b/app/vendor/cakephp/cakephp/src/Database/Type.php
index 24df3f6f1..7bfbb4ba5 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type.php
@@ -23,7 +23,6 @@
*/
class Type implements TypeInterface
{
-
/**
* List of supported database types. A human readable
* identifier is used as key and a complete namespaced class name as value
@@ -63,7 +62,7 @@ class Type implements TypeInterface
'text' => ['callback' => [Type::class, 'strval']],
'boolean' => [
'callback' => [Type::class, 'boolval'],
- 'pdo' => PDO::PARAM_BOOL
+ 'pdo' => PDO::PARAM_BOOL,
],
];
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/BatchCastingInterface.php b/app/vendor/cakephp/cakephp/src/Database/Type/BatchCastingInterface.php
index fe1d614a2..36d938094 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/BatchCastingInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/BatchCastingInterface.php
@@ -22,7 +22,6 @@
*/
interface BatchCastingInterface
{
-
/**
* Returns an array of the values converted to the PHP representation of
* this type.
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/BinaryType.php b/app/vendor/cakephp/cakephp/src/Database/Type/BinaryType.php
index bd27ede8a..a0c5d3ac0 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/BinaryType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/BinaryType.php
@@ -69,7 +69,7 @@ public function toDatabase($value, Driver $driver)
/**
* Convert binary into resource handles
*
- * @param null|string|resource $value The value to convert.
+ * @param resource|string|null $value The value to convert.
* @param \Cake\Database\Driver $driver The driver instance to convert with.
* @return resource|null
* @throws \Cake\Core\Exception\Exception
@@ -79,7 +79,8 @@ public function toPHP($value, Driver $driver)
if ($value === null) {
return null;
}
- if (is_string($value)
+ if (
+ is_string($value)
&& $driver instanceof Sqlserver
&& version_compare(PHP_VERSION, '7.0', '<')
) {
@@ -113,7 +114,6 @@ public function toStatement($value, Driver $driver)
* that make sense for the rest of the ORM/Database layers.
*
* @param mixed $value The value to convert.
- *
* @return mixed Converted value.
*/
public function marshal($value)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/BinaryUuidType.php b/app/vendor/cakephp/cakephp/src/Database/Type/BinaryUuidType.php
index 8eba18fc5..b6a553352 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/BinaryUuidType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/BinaryUuidType.php
@@ -83,7 +83,7 @@ public function newId()
/**
* Convert binary uuid into resource handles
*
- * @param null|string|resource $value The value to convert.
+ * @param resource|string|null $value The value to convert.
* @param \Cake\Database\Driver $driver The driver instance to convert with.
* @return resource|string|null
* @throws \Cake\Core\Exception\Exception
@@ -122,7 +122,6 @@ public function toStatement($value, Driver $driver)
* that make sense for the rest of the ORM/Database layers.
*
* @param mixed $value The value to convert.
- *
* @return mixed Converted value.
*/
public function marshal($value)
@@ -133,9 +132,7 @@ public function marshal($value)
/**
* Converts a binary uuid to a string representation
*
- *
* @param mixed $binary The value to convert.
- *
* @return string Converted value.
*/
protected function convertBinaryUuidToString($binary)
@@ -154,9 +151,7 @@ protected function convertBinaryUuidToString($binary)
/**
* Converts a string uuid to a binary representation
*
- *
* @param string $string The value to convert.
- *
* @return string Converted value.
*/
protected function convertStringToBinaryUuid($string)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php b/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php
index 949fefa54..edff61180 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/DateTimeType.php
@@ -139,7 +139,8 @@ public function toDatabase($value, Driver $driver)
$format = (array)$this->_format;
- if ($this->dbTimezone !== null
+ if (
+ $this->dbTimezone !== null
&& $this->dbTimezone->getName() !== $value->getTimezone()->getName()
) {
if (!$value instanceof DateTimeImmutable) {
@@ -267,7 +268,8 @@ public function marshal($value)
$value += ['hour' => 0, 'minute' => 0, 'second' => 0];
$format = '';
- if (isset($value['year'], $value['month'], $value['day']) &&
+ if (
+ isset($value['year'], $value['month'], $value['day']) &&
(is_numeric($value['year']) && is_numeric($value['month']) && is_numeric($value['day']))
) {
$format .= sprintf('%d-%02d-%02d', $value['year'], $value['month'], $value['day']);
@@ -372,7 +374,7 @@ protected function _setClassName($class, $fallback)
$class = $fallback;
}
$this->_className = $class;
- $this->_datetimeInstance = new $this->_className;
+ $this->_datetimeInstance = new $this->_className();
}
/**
@@ -406,7 +408,7 @@ public function useMutable()
*/
protected function _parseValue($value)
{
- /* @var \Cake\I18n\Time $class */
+ /** @var \Cake\I18n\Time $class */
$class = $this->_className;
return $class::parseDateTime($value, $this->_localeFormat);
@@ -417,7 +419,6 @@ protected function _parseValue($value)
*
* @param mixed $value value to be converted to PDO statement
* @param \Cake\Database\Driver $driver object from which database preferences and configuration will be extracted
- *
* @return mixed
*/
public function toStatement($value, Driver $driver)
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/DateType.php b/app/vendor/cakephp/cakephp/src/Database/Type/DateType.php
index cf7f68d90..5aa30b042 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/DateType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/DateType.php
@@ -21,7 +21,6 @@
*/
class DateType extends DateTimeType
{
-
/**
* The class to use for representing date objects
*
@@ -93,7 +92,7 @@ public function marshal($value)
*/
protected function _parseValue($value)
{
- /* @var \Cake\I18n\Time $class */
+ /** @var \Cake\I18n\Time $class */
$class = $this->_className;
return $class::parseDate($value, $this->_localeFormat);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/DecimalType.php b/app/vendor/cakephp/cakephp/src/Database/Type/DecimalType.php
index 64acf40a4..15b377f0d 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/DecimalType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/DecimalType.php
@@ -178,7 +178,8 @@ public function useLocaleParser($enable = true)
return $this;
}
- if (static::$numberClass === 'Cake\I18n\Number' ||
+ if (
+ static::$numberClass === 'Cake\I18n\Number' ||
is_subclass_of(static::$numberClass, 'Cake\I18n\Number')
) {
$this->_useLocaleParser = $enable;
@@ -199,7 +200,7 @@ public function useLocaleParser($enable = true)
*/
protected function _parseValue($value)
{
- /* @var \Cake\I18n\Number $class */
+ /** @var \Cake\I18n\Number $class */
$class = static::$numberClass;
return $class::parseFloat($value);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeCasterTrait.php b/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeCasterTrait.php
index 51c624757..0976220a7 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeCasterTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeCasterTrait.php
@@ -19,11 +19,9 @@
/**
* Offers a method to convert values to ExpressionInterface objects
* if the type they should be converted to implements ExpressionTypeInterface
- *
*/
trait ExpressionTypeCasterTrait
{
-
/**
* Conditionally converts the passed value to an ExpressionInterface object
* if the type class implements the ExpressionTypeInterface. Otherwise,
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeInterface.php b/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeInterface.php
index d2f931e73..0210e3123 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/ExpressionTypeInterface.php
@@ -21,7 +21,6 @@
*/
interface ExpressionTypeInterface
{
-
/**
* Returns an ExpressionInterface object for the given value that can
* be used in queries.
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/FloatType.php b/app/vendor/cakephp/cakephp/src/Database/Type/FloatType.php
index bc3a70dd5..2cf1c1d54 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/FloatType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/FloatType.php
@@ -85,7 +85,7 @@ public function toDatabase($value, Driver $driver)
/**
* Convert float values to PHP integers
*
- * @param null|string|resource $value The value to convert.
+ * @param resource|string|null $value The value to convert.
* @param \Cake\Database\Driver $driver The driver instance to convert with.
* @return float|null
* @throws \Cake\Core\Exception\Exception
@@ -133,7 +133,7 @@ public function toStatement($value, Driver $driver)
* Marshals request data into PHP floats.
*
* @param mixed $value The value to convert.
- * @return float|null Converted value.
+ * @return float|string|null Converted value.
*/
public function marshal($value)
{
@@ -167,7 +167,8 @@ public function useLocaleParser($enable = true)
return $this;
}
- if (static::$numberClass === 'Cake\I18n\Number' ||
+ if (
+ static::$numberClass === 'Cake\I18n\Number' ||
is_subclass_of(static::$numberClass, 'Cake\I18n\Number')
) {
$this->_useLocaleParser = $enable;
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/JsonType.php b/app/vendor/cakephp/cakephp/src/Database/Type/JsonType.php
index f16c7fd75..ed9bb8046 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/JsonType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/JsonType.php
@@ -72,7 +72,7 @@ public function toDatabase($value, Driver $driver)
*
* @param mixed $value The value to convert.
* @param \Cake\Database\Driver $driver The driver instance to convert with.
- * @return string|null|array
+ * @return string|array|null
*/
public function toPHP($value, Driver $driver)
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/OptionalConvertInterface.php b/app/vendor/cakephp/cakephp/src/Database/Type/OptionalConvertInterface.php
index 8d6c03a78..d43fd606f 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/OptionalConvertInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/OptionalConvertInterface.php
@@ -20,7 +20,6 @@
*/
interface OptionalConvertInterface
{
-
/**
* Returns whether the cast to PHP is required to be invoked, since
* it is not a identity function.
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/StringType.php b/app/vendor/cakephp/cakephp/src/Database/Type/StringType.php
index e75b3d574..5d6f93e74 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/StringType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/StringType.php
@@ -27,7 +27,6 @@
*/
class StringType extends Type implements OptionalConvertInterface, TypeInterface
{
-
/**
* Convert string data into the database format.
*
@@ -104,7 +103,7 @@ public function marshal($value)
/**
* {@inheritDoc}
*
- * @return boolean False as database results are returned already as strings
+ * @return bool False as database results are returned already as strings
*/
public function requiresToPhpCast()
{
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/TimeType.php b/app/vendor/cakephp/cakephp/src/Database/Type/TimeType.php
index 582a4e287..ce018f059 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/TimeType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/TimeType.php
@@ -21,7 +21,6 @@
*/
class TimeType extends DateTimeType
{
-
/**
* Time format for DateTime object
*
@@ -34,7 +33,7 @@ class TimeType extends DateTimeType
*/
protected function _parseValue($value)
{
- /* @var \Cake\I18n\Time $class */
+ /** @var \Cake\I18n\Time $class */
$class = $this->_className;
return $class::parseTime($value, $this->_localeFormat);
diff --git a/app/vendor/cakephp/cakephp/src/Database/Type/UuidType.php b/app/vendor/cakephp/cakephp/src/Database/Type/UuidType.php
index ecfdb8593..492da50fc 100644
--- a/app/vendor/cakephp/cakephp/src/Database/Type/UuidType.php
+++ b/app/vendor/cakephp/cakephp/src/Database/Type/UuidType.php
@@ -22,7 +22,6 @@
*/
class UuidType extends StringType
{
-
/**
* Casts given value from a PHP type to one acceptable by database
*
@@ -32,7 +31,7 @@ class UuidType extends StringType
*/
public function toDatabase($value, Driver $driver)
{
- if ($value === null || $value === '') {
+ if ($value === null || $value === '' || $value === false) {
return null;
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypeConverterTrait.php b/app/vendor/cakephp/cakephp/src/Database/TypeConverterTrait.php
index c23ceb743..0b2132f14 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypeConverterTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypeConverterTrait.php
@@ -19,7 +19,6 @@
*/
trait TypeConverterTrait
{
-
/**
* Converts a give value to a suitable database value based on type
* and return relevant internal statement type
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypeInterface.php b/app/vendor/cakephp/cakephp/src/Database/TypeInterface.php
index d30153162..1068abdef 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypeInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypeInterface.php
@@ -20,7 +20,6 @@
*/
interface TypeInterface
{
-
/**
* Casts given value from a PHP type to one acceptable by a database.
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypeMap.php b/app/vendor/cakephp/cakephp/src/Database/TypeMap.php
index 8eea99fb7..4dacae686 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypeMap.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypeMap.php
@@ -19,7 +19,6 @@
*/
class TypeMap
{
-
/**
* Associative array with the default fields and the related types this query might contain.
*
@@ -28,7 +27,7 @@ class TypeMap
*
* @var string[]
*/
- protected $_defaults;
+ protected $_defaults = [];
/**
* Associative array with the fields and the related types that override defaults this query might contain
@@ -205,7 +204,7 @@ public function types(array $types = null)
* the column type will be looked for inside the default mapping. If neither exist,
* null will be returned.
*
- * @param string $column The type for a given column
+ * @param string|int $column The type for a given column
* @return string|null
*/
public function type($column)
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypeMapTrait.php b/app/vendor/cakephp/cakephp/src/Database/TypeMapTrait.php
index 2ed42e12c..c041af19c 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypeMapTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypeMapTrait.php
@@ -22,7 +22,6 @@
*/
trait TypeMapTrait
{
-
/**
* @var \Cake\Database\TypeMap
*/
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypedResultInterface.php b/app/vendor/cakephp/cakephp/src/Database/TypedResultInterface.php
index b77d46385..48e8de0ae 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypedResultInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypedResultInterface.php
@@ -22,7 +22,6 @@
*/
interface TypedResultInterface
{
-
/**
* Sets the type of the value this object will generate.
* If called without arguments, returns the current known type
diff --git a/app/vendor/cakephp/cakephp/src/Database/TypedResultTrait.php b/app/vendor/cakephp/cakephp/src/Database/TypedResultTrait.php
index 337798062..2c920999c 100644
--- a/app/vendor/cakephp/cakephp/src/Database/TypedResultTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Database/TypedResultTrait.php
@@ -19,7 +19,6 @@
*/
trait TypedResultTrait
{
-
/**
* The type name this expression will return when executed
*
diff --git a/app/vendor/cakephp/cakephp/src/Database/ValueBinder.php b/app/vendor/cakephp/cakephp/src/Database/ValueBinder.php
index a13838d46..c18edf7b5 100644
--- a/app/vendor/cakephp/cakephp/src/Database/ValueBinder.php
+++ b/app/vendor/cakephp/cakephp/src/Database/ValueBinder.php
@@ -21,7 +21,6 @@
*/
class ValueBinder
{
-
/**
* Array containing a list of bound values to the conditions on this
* object. Each array entry is another array structure containing the actual
@@ -51,7 +50,7 @@ class ValueBinder
public function bind($param, $value, $type = 'string')
{
$this->_bindings[$param] = compact('value', 'type') + [
- 'placeholder' => is_int($param) ? $param : substr($param, 1)
+ 'placeholder' => is_int($param) ? $param : substr($param, 1),
];
}
diff --git a/app/vendor/cakephp/cakephp/src/Database/composer.json b/app/vendor/cakephp/cakephp/src/Database/composer.json
index c19711558..839ffbfee 100644
--- a/app/vendor/cakephp/cakephp/src/Database/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Database/composer.json
@@ -24,7 +24,7 @@
"source": "https://github.com/cakephp/database"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/cache": "^3.6.0",
"cakephp/core": "^3.6.0",
"cakephp/datasource": "^3.6.0",
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionInterface.php
index c67af789e..e9eb3d3cf 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionInterface.php
@@ -18,6 +18,7 @@
* This interface defines the methods you can depend on in
* a connection.
*
+ * @method object getDriver() Gets the driver instance.
* @method object getLogger() Get the current logger instance
* @method $this setLogger($logger) Set the current logger.
* @method bool supportsDynamicConstraints()
@@ -25,6 +26,7 @@
* @method \Cake\Database\Query newQuery()
* @method \Cake\Database\StatementInterface prepare($sql)
* @method \Cake\Database\StatementInterface execute($query, $params = [], array $types = [])
+ * @method \Cake\Database\StatementInterface query(string $sql)
* @method $this enableQueryLogging($value)
* @method $this disableQueryLogging()
* @method $this disableSavePoints()
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php
index b9beb80f3..6ad676b31 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php
@@ -28,7 +28,6 @@
*/
class ConnectionManager
{
-
use StaticConfigTrait {
setConfig as protected _setConfig;
parseDsn as protected _parseDsn;
@@ -44,7 +43,7 @@ class ConnectionManager
/**
* An array mapping url schemes to fully qualified driver class names
*
- * @return array
+ * @var string[]
*/
protected static $_dsnClassMap = [
'mysql' => 'Cake\Database\Driver\Mysql',
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php
index ea9d434dd..a02b0c76a 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php
@@ -25,7 +25,6 @@
*/
class ConnectionRegistry extends ObjectRegistry
{
-
/**
* Resolve a datasource classname.
*
@@ -49,7 +48,7 @@ protected function _resolveClassName($class)
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the datasource is missing in.
+ * @param string|null $plugin The plugin the datasource is missing in.
* @return void
* @throws \Cake\Datasource\Exception\MissingDatasourceException
*/
@@ -93,10 +92,12 @@ protected function _create($class, $alias, $settings)
* Remove a single adapter from the registry.
*
* @param string $name The adapter name.
- * @return void
+ * @return $this
*/
public function unload($name)
{
unset($this->_loaded[$name]);
+
+ return $this;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php
index cb0e2052e..fb4074e88 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/EntityInterface.php
@@ -24,9 +24,10 @@
* In 4.x the following methods will officially be added to the interface:
*
* @method $this setHidden(array $properties, $merge = false)
- * @method array getHidden()
+ * @method string[] getHidden()
* @method $this setVirtual(array $properties, $merge = false)
- * @method array getVirtual()
+ * @method string[] getVirtual()
+ * @method string[] getDirty()
* @method $this setDirty($property, $isDirty = true)
* @method bool isDirty($property = null)
* @method bool hasErrors($includeNested = true)
@@ -41,12 +42,12 @@
* @method array extractOriginal(array $properties)
* @method array extractOriginalChanged(array $properties)
* @method array getVisible()
- *
+ * @method $this setNew($new)
* @property mixed $id Alias for commonly used primary key.
+ * @method bool[] getAccessible()
*/
interface EntityInterface extends ArrayAccess, JsonSerializable
{
-
/**
* Sets one or multiple properties to the specified value
*
@@ -91,7 +92,7 @@ public function unsetProperty($property);
* If the properties argument is null, the currently hidden properties
* will be returned. Otherwise the hidden properties will be set.
*
- * @param null|array $properties Either an array of properties to hide or null to get properties
+ * @param array|null $properties Either an array of properties to hide or null to get properties
* @return array|\Cake\Datasource\EntityInterface
*/
public function hiddenProperties($properties = null);
@@ -102,7 +103,7 @@ public function hiddenProperties($properties = null);
* If the properties argument is null, the currently virtual properties
* will be returned. Otherwise the virtual properties will be set.
*
- * @param null|array $properties Either an array of properties to treat as virtual or null to get properties
+ * @param array|null $properties Either an array of properties to treat as virtual or null to get properties
* @return array|\Cake\Datasource\EntityInterface
*/
public function virtualProperties($properties = null);
@@ -144,7 +145,7 @@ public function extract(array $properties, $onlyDirty = false);
*
* @deprecated 3.4.0 Use setDirty() and isDirty() instead.
* @param string|null $property the field to set or check status for
- * @param null|bool $isDirty true means the property was changed, false means
+ * @param bool|null $isDirty true means the property was changed, false means
* it was not changed and null will make the function return current state
* for that property
* @return bool whether the property was changed or not
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php
index 991f699cc..e8a756e8f 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/EntityTrait.php
@@ -26,7 +26,6 @@
*/
trait EntityTrait
{
-
/**
* Holds all properties and their values for this entity
*
@@ -45,7 +44,7 @@ trait EntityTrait
* List of property names that should **not** be included in JSON or Array
* representations of this Entity.
*
- * @var array
+ * @var string[]
*/
protected $_hidden = [];
@@ -54,7 +53,7 @@ trait EntityTrait
* representations of this Entity. If a field is present in both _hidden and _virtual
* the field will **not** be in the array/json versions of the entity.
*
- * @var array
+ * @var string[]
*/
protected $_virtual = [];
@@ -62,7 +61,6 @@ trait EntityTrait
* Holds the name of the class for the instance object
*
* @var string
- *
* @deprecated 3.2 This field is no longer being used
*/
protected $_className;
@@ -71,7 +69,7 @@ trait EntityTrait
* Holds a list of the properties that were modified or added after this object
* was originally created.
*
- * @var array
+ * @var bool[]
*/
protected $_dirty = [];
@@ -248,7 +246,8 @@ public function set($property, $value = null, array $options = [])
$this->setDirty($p, true);
- if (!array_key_exists($p, $this->_original) &&
+ if (
+ !array_key_exists($p, $this->_original) &&
array_key_exists($p, $this->_properties) &&
$this->_properties[$p] !== $value
) {
@@ -360,7 +359,7 @@ public function getOriginalValues()
* When checking multiple properties. All properties must not be null
* in order for true to be returned.
*
- * @param string|array $property The property or properties to check.
+ * @param string|string[] $property The property or properties to check.
* @return bool
*/
public function has($property)
@@ -392,9 +391,16 @@ public function has($property)
public function isEmpty($property)
{
$value = $this->get($property);
- if ($value === null
- || (is_array($value) && empty($value)
- || (is_string($value) && empty($value)))
+ if (
+ $value === null ||
+ (
+ is_array($value) &&
+ empty($value) ||
+ (
+ is_string($value) &&
+ $value === ''
+ )
+ )
) {
return true;
}
@@ -433,7 +439,7 @@ public function hasValue($property)
* $entity->unsetProperty(['name', 'last_name']);
* ```
*
- * @param string|array $property The property to unset.
+ * @param string|string[] $property The property to unset.
* @return $this
*/
public function unsetProperty($property)
@@ -453,8 +459,8 @@ public function unsetProperty($property)
* will be returned. Otherwise the hidden properties will be set.
*
* @deprecated 3.4.0 Use EntityTrait::setHidden() and EntityTrait::getHidden()
- * @param null|array $properties Either an array of properties to hide or null to get properties
- * @return array|$this
+ * @param string[]|null $properties Either an array of properties to hide or null to get properties
+ * @return string[]|$this
*/
public function hiddenProperties($properties = null)
{
@@ -473,7 +479,7 @@ public function hiddenProperties($properties = null)
/**
* Sets hidden properties.
*
- * @param array $properties An array of properties to hide from array exports.
+ * @param string[] $properties An array of properties to hide from array exports.
* @param bool $merge Merge the new properties with the existing. By default false.
* @return $this
*/
@@ -494,7 +500,7 @@ public function setHidden(array $properties, $merge = false)
/**
* Gets the hidden properties.
*
- * @return array
+ * @return string[]
*/
public function getHidden()
{
@@ -508,8 +514,8 @@ public function getHidden()
* will be returned. Otherwise the virtual properties will be set.
*
* @deprecated 3.4.0 Use EntityTrait::getVirtual() and EntityTrait::setVirtual()
- * @param null|array $properties Either an array of properties to treat as virtual or null to get properties
- * @return array|$this
+ * @param string[]|null $properties Either an array of properties to treat as virtual or null to get properties
+ * @return string[]|$this
*/
public function virtualProperties($properties = null)
{
@@ -527,7 +533,7 @@ public function virtualProperties($properties = null)
/**
* Sets the virtual properties on this entity.
*
- * @param array $properties An array of properties to treat as virtual.
+ * @param string[] $properties An array of properties to treat as virtual.
* @param bool $merge Merge the new properties with the existing. By default false.
* @return $this
*/
@@ -548,7 +554,7 @@ public function setVirtual(array $properties, $merge = false)
/**
* Gets the virtual properties on this entity.
*
- * @return array
+ * @return string[]
*/
public function getVirtual()
{
@@ -561,7 +567,7 @@ public function getVirtual()
* The list of visible properties is all standard properties
* plus virtual properties minus hidden properties.
*
- * @return array A list of properties that are 'visible' in all
+ * @return string[] A list of properties that are 'visible' in all
* representations.
*/
public function getVisible()
@@ -578,7 +584,7 @@ public function getVisible()
* The list of visible properties is all standard properties
* plus virtual properties minus hidden properties.
*
- * @return array A list of properties that are 'visible' in all
+ * @return string[] A list of properties that are 'visible' in all
* representations.
* @deprecated 3.8.0 Use getVisible() instead.
*/
@@ -728,7 +734,7 @@ protected static function _accessor($property, $type)
* Returns an array with the requested properties
* stored in this entity, indexed by property name
*
- * @param array $properties list of properties to be returned
+ * @param string[] $properties list of properties to be returned
* @param bool $onlyDirty Return the requested property only if it is dirty
* @return array
*/
@@ -751,7 +757,7 @@ public function extract(array $properties, $onlyDirty = false)
* Properties that are unchanged from their original value will be included in the
* return of this method.
*
- * @param array $properties List of properties to be returned
+ * @param string[] $properties List of properties to be returned
* @return array
*/
public function extractOriginal(array $properties)
@@ -771,7 +777,7 @@ public function extractOriginal(array $properties)
* This method will only return properties that have been modified since
* the entity was built. Unchanged properties will be omitted.
*
- * @param array $properties List of properties to be returned
+ * @param string[] $properties List of properties to be returned
* @return array
*/
public function extractOriginalChanged(array $properties)
@@ -797,7 +803,7 @@ public function extractOriginalChanged(array $properties)
*
* @deprecated 3.4.0 Use EntityTrait::setDirty() and EntityTrait::isDirty()
* @param string|null $property the field to set or check status for
- * @param null|bool $isDirty true means the property was changed, false means
+ * @param bool|null $isDirty true means the property was changed, false means
* it was not changed and null will make the function return current state
* for that property
* @return bool Whether the property was changed or not
@@ -884,32 +890,41 @@ public function clean()
}
/**
- * Returns whether or not this entity has already been persisted.
- * This method can return null in the case there is no prior information on
- * the status of this entity.
+ * Set the status of this entity.
*
- * If called with a boolean it will set the known status of this instance,
- * true means that the instance is not yet persisted in the database, false
- * that it already is.
+ * Using `true` means that the entity has not been persisted in the database,
+ * `false` that it already is.
*
- * @param bool|null $new true if it is known this instance was not yet persisted
- * @return bool Whether or not the entity has been persisted.
+ * @param bool $new Indicate whether or not this entity has been persisted.
+ * @return $this
*/
- public function isNew($new = null)
+ public function setNew($new)
{
- if ($new === null) {
- return $this->_new;
- }
-
- $new = (bool)$new;
-
if ($new) {
foreach ($this->_properties as $k => $p) {
$this->_dirty[$k] = true;
}
}
- return $this->_new = $new;
+ $this->_new = $new;
+
+ return $this;
+ }
+
+ /**
+ * Returns whether or not this entity has already been persisted.
+ *
+ * @param bool|null $new true if it is known this instance was not yet persisted.
+ * This will be deprecated in 4.0, use `setNew()` instead.
+ * @return bool Whether or not the entity has been persisted.
+ */
+ public function isNew($new = null)
+ {
+ if ($new !== null) {
+ $this->setNew($new);
+ }
+
+ return $this->_new;
}
/**
@@ -1125,7 +1140,8 @@ protected function _nestedErrors($field)
$val = isset($entity[$part]) ? $entity[$part] : false;
}
- if (is_array($val) ||
+ if (
+ is_array($val) ||
$val instanceof Traversable ||
$val instanceof EntityInterface
) {
@@ -1364,7 +1380,7 @@ public function accessible($property, $set = null)
* $entity->setAccess('*', false); // Mark all properties as protected
* ```
*
- * @param string|array $property single or list of properties to change its accessibility
+ * @param string|string[] $property single or list of properties to change its accessibility
* @param bool $set true marks the property as accessible, false will
* mark it as protected.
* @return $this
@@ -1387,6 +1403,17 @@ public function setAccess($property, $set)
return $this;
}
+ /**
+ * Returns the raw accessible configuration for this entity.
+ * The `*` wildcard refers to all fields.
+ *
+ * @return bool[]
+ */
+ public function getAccessible()
+ {
+ return $this->_accessible;
+ }
+
/**
* Checks if a property is accessible
*
@@ -1488,7 +1515,7 @@ public function __debugInfo()
'[hasErrors]' => $this->hasErrors(),
'[errors]' => $this->_errors,
'[invalid]' => $this->_invalid,
- '[repository]' => $this->_registryAlias
+ '[repository]' => $this->_registryAlias,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Exception/InvalidPrimaryKeyException.php b/app/vendor/cakephp/cakephp/src/Datasource/Exception/InvalidPrimaryKeyException.php
index 9a033a781..db51daa76 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Exception/InvalidPrimaryKeyException.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Exception/InvalidPrimaryKeyException.php
@@ -21,7 +21,6 @@
*/
class InvalidPrimaryKeyException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceConfigException.php b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceConfigException.php
index eebfaff70..f5af83bf7 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceConfigException.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceConfigException.php
@@ -19,6 +19,8 @@
*/
class MissingDatasourceConfigException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'The datasource configuration "%s" was not found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceException.php b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceException.php
index 66e0b2eea..1b1931ea8 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceException.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingDatasourceException.php
@@ -19,6 +19,8 @@
*/
class MissingDatasourceException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Datasource class %s could not be found. %s';
}
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingModelException.php b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingModelException.php
index bf6b50874..a156f8e4b 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingModelException.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Exception/MissingModelException.php
@@ -21,6 +21,8 @@
*/
class MissingModelException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Model class "%s" of type "%s" could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Exception/RecordNotFoundException.php b/app/vendor/cakephp/cakephp/src/Datasource/Exception/RecordNotFoundException.php
index 60e2dd1f1..89a080c63 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Exception/RecordNotFoundException.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Exception/RecordNotFoundException.php
@@ -21,7 +21,6 @@
*/
class RecordNotFoundException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php
index f9d4c8220..80e88cf1c 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/ModelAwareTrait.php
@@ -26,7 +26,6 @@
*/
trait ModelAwareTrait
{
-
/**
* This object's primary model class name. Should be a plural form.
* CakePHP will not inflect the name.
@@ -159,7 +158,6 @@ public function getModelType()
* Set the model type to be used by this class
*
* @param string $modelType The model type
- *
* @return $this
*/
public function setModelType($modelType)
@@ -174,7 +172,6 @@ public function setModelType($modelType)
*
* @deprecated 3.5.0 Use getModelType()/setModelType() instead.
* @param string|null $modelType The model type or null to retrieve the current
- *
* @return string|$this
*/
public function modelType($modelType = null)
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php b/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php
index aecae8057..29e926f77 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php
@@ -43,7 +43,7 @@ class Paginator implements PaginatorInterface
'page' => 1,
'limit' => 20,
'maxLimit' => 100,
- 'whitelist' => ['limit', 'sort', 'page', 'direction']
+ 'whitelist' => ['limit', 'sort', 'page', 'direction'],
];
/**
@@ -166,6 +166,68 @@ public function paginate($object, array $params = [], array $settings = [])
$object = $query->getRepository();
}
+ $data = $this->extractData($object, $params, $settings);
+ $query = $this->getQuery($object, $query, $data);
+
+ $cleanQuery = clone $query;
+ $results = $query->all();
+ $data['numResults'] = count($results);
+ $data['count'] = $this->getCount($cleanQuery, $data);
+
+ $pagingParams = $this->buildParams($data);
+ $alias = $object->getAlias();
+ $this->_pagingParams = [$alias => $pagingParams];
+ if ($pagingParams['requestedPage'] > $pagingParams['page']) {
+ throw new PageOutOfBoundsException([
+ 'requestedPage' => $pagingParams['requestedPage'],
+ 'pagingParams' => $this->_pagingParams,
+ ]);
+ }
+
+ return $results;
+ }
+
+ /**
+ * Get query for fetching paginated results.
+ *
+ * @param \Cake\Datasource\RepositoryInterface $object Repository instance.
+ * @param \Cake\Datasource\QueryInterface|null $query Query Instance.
+ * @param array $data Pagination data.
+ * @return \Cake\Datasource\QueryInterface
+ */
+ protected function getQuery(RepositoryInterface $object, QueryInterface $query = null, array $data)
+ {
+ if ($query === null) {
+ $query = $object->find($data['finder'], $data['options']);
+ } else {
+ $query->applyOptions($data['options']);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Get total count of records.
+ *
+ * @param \Cake\Datasource\QueryInterface $query Query instance.
+ * @param array $data Pagination data.
+ * @return int|null
+ */
+ protected function getCount(QueryInterface $query, array $data)
+ {
+ return $query->count();
+ }
+
+ /**
+ * Extract pagination data needed
+ *
+ * @param \Cake\Datasource\RepositoryInterface $object The repository object.
+ * @param array $params Request params
+ * @param array $settings The settings/configuration used for pagination.
+ * @return array Array with keys 'defaults', 'options' and 'finder'
+ */
+ protected function extractData(RepositoryInterface $object, array $params, array $settings)
+ {
$alias = $object->getAlias();
$defaults = $this->getDefaults($alias, $settings);
$options = $this->mergeOptions($params, $defaults);
@@ -176,69 +238,135 @@ public function paginate($object, array $params = [], array $settings = [])
$options['page'] = (int)$options['page'] < 1 ? 1 : (int)$options['page'];
list($finder, $options) = $this->_extractFinder($options);
- if (empty($query)) {
- $query = $object->find($finder, $options);
- } else {
- $query->applyOptions($options);
+ return compact('defaults', 'options', 'finder');
+ }
+
+ /**
+ * Build pagination params.
+ *
+ * @param array $data Paginator data containing keys 'options',
+ * 'count', 'defaults', 'finder', 'numResults'.
+ * @return array Paging params.
+ */
+ protected function buildParams(array $data)
+ {
+ $limit = $data['options']['limit'];
+
+ $paging = [
+ 'count' => $data['count'],
+ 'current' => $data['numResults'],
+ 'perPage' => $limit,
+ 'page' => $data['options']['page'],
+ 'requestedPage' => $data['options']['page'],
+ ];
+
+ $paging = $this->addPageCountParams($paging, $data);
+ $paging = $this->addStartEndParams($paging, $data);
+ $paging = $this->addPrevNextParams($paging, $data);
+ $paging = $this->addSortingParams($paging, $data);
+
+ $paging += [
+ 'limit' => $data['defaults']['limit'] != $limit ? $limit : null,
+ 'scope' => $data['options']['scope'],
+ 'finder' => $data['finder'],
+ ];
+
+ return $paging;
+ }
+
+ /**
+ * Add "page" and "pageCount" params.
+ *
+ * @param array $params Paging params.
+ * @param array $data Paginator data.
+ * @return array Updated params.
+ */
+ protected function addPageCountParams(array $params, array $data)
+ {
+ $page = $params['page'];
+ $pageCount = 0;
+
+ if ($params['count'] !== null) {
+ $pageCount = max((int)ceil($params['count'] / $params['perPage']), 1);
+ $page = min($page, $pageCount);
+ } elseif ($params['current'] === 0 && $params['requestedPage'] > 1) {
+ $page = 1;
}
- $cleanQuery = clone $query;
- $results = $query->all();
- $numResults = count($results);
- $count = $cleanQuery->count();
+ $params['page'] = $page;
+ $params['pageCount'] = $pageCount;
+
+ return $params;
+ }
+
+ /**
+ * Add "start" and "end" params.
+ *
+ * @param array $params Paging params.
+ * @param array $data Paginator data.
+ * @return array Updated params.
+ */
+ protected function addStartEndParams(array $params, array $data)
+ {
+ $start = $end = 0;
+
+ if ($params['current'] > 0) {
+ $start = (($params['page'] - 1) * $params['perPage']) + 1;
+ $end = $start + $params['current'] - 1;
+ }
+
+ $params['start'] = $start;
+ $params['end'] = $end;
+
+ return $params;
+ }
+
+ /**
+ * Add "prevPage" and "nextPage" params.
+ *
+ * @param array $params Paginator params.
+ * @param array $data Paging data.
+ * @return array Updated params.
+ */
+ protected function addPrevNextParams(array $params, array $data)
+ {
+ $params['prevPage'] = $params['page'] > 1;
+ if ($params['count'] === null) {
+ $params['nextPage'] = true;
+ } else {
+ $params['nextPage'] = $params['count'] > ($params['page'] * $params['perPage']);
+ }
- $page = $options['page'];
- $limit = $options['limit'];
- $pageCount = max((int)ceil($count / $limit), 1);
- $requestedPage = $page;
- $page = min($page, $pageCount);
+ return $params;
+ }
- $order = (array)$options['order'];
+ /**
+ * Add sorting / ordering params.
+ *
+ * @param array $params Paginator params.
+ * @param array $data Paging data.
+ * @return array Updated params.
+ */
+ protected function addSortingParams(array $params, array $data)
+ {
+ $defaults = $data['defaults'];
+ $order = (array)$data['options']['order'];
$sortDefault = $directionDefault = false;
+
if (!empty($defaults['order']) && count($defaults['order']) === 1) {
$sortDefault = key($defaults['order']);
$directionDefault = current($defaults['order']);
}
- $start = 0;
- if ($count >= 1) {
- $start = (($page - 1) * $limit) + 1;
- }
- $end = $start + $limit - 1;
- if ($count < $end) {
- $end = $count;
- }
-
- $paging = [
- 'finder' => $finder,
- 'page' => $page,
- 'current' => $numResults,
- 'count' => $count,
- 'perPage' => $limit,
- 'start' => $start,
- 'end' => $end,
- 'prevPage' => $page > 1,
- 'nextPage' => $count > ($page * $limit),
- 'pageCount' => $pageCount,
- 'sort' => $options['sort'],
- 'direction' => isset($options['sort']) ? current($order) : null,
- 'limit' => $defaults['limit'] != $limit ? $limit : null,
+ $params += [
+ 'sort' => $data['options']['sort'],
+ 'direction' => isset($data['options']['sort']) ? current($order) : null,
'sortDefault' => $sortDefault,
'directionDefault' => $directionDefault,
- 'scope' => $options['scope'],
'completeSort' => $order,
];
- $this->_pagingParams = [$alias => $paging];
-
- if ($requestedPage > $page) {
- throw new PageOutOfBoundsException([
- 'requestedPage' => $requestedPage,
- 'pagingParams' => $this->_pagingParams
- ]);
- }
-
- return $results;
+ return $params;
}
/**
@@ -394,7 +522,8 @@ public function validateSort(RepositoryInterface $object, array $options)
}
}
- if ($options['sort'] === null
+ if (
+ $options['sort'] === null
&& count($options['order']) === 1
&& !is_numeric(key($options['order']))
) {
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/QueryCacher.php b/app/vendor/cakephp/cakephp/src/Datasource/QueryCacher.php
index 6d3f65712..7c8826eda 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/QueryCacher.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/QueryCacher.php
@@ -28,7 +28,6 @@
*/
class QueryCacher
{
-
/**
* The key or function to generate a key.
*
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/QueryInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/QueryInterface.php
index 793258e5d..71d083911 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/QueryInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/QueryInterface.php
@@ -24,9 +24,19 @@
*/
interface QueryInterface
{
-
+ /**
+ * @var string
+ */
const JOIN_TYPE_INNER = 'INNER';
+
+ /**
+ * @var string
+ */
const JOIN_TYPE_LEFT = 'LEFT';
+
+ /**
+ * @var string
+ */
const JOIN_TYPE_RIGHT = 'RIGHT';
/**
@@ -208,7 +218,9 @@ public function offset($num);
* `ORDER BY title DESC, author_id ASC`
*
* ```
- * $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
+ * $query
+ * ->order(['title' => $query->newExpr('DESC NULLS FIRST')])
+ * ->order('author_id');
* ```
*
* Will generate:
@@ -347,8 +359,8 @@ public function repository(RepositoryInterface $repository = null);
* $query
* ->where(['title !=' => 'Hello World'])
* ->where(function ($exp, $query) {
- * $or = $exp->or_(['id' => 1]);
- * $and = $exp->and_(['id >' => 2, 'id <' => 10]);
+ * $or = $exp->or(['id' => 1]);
+ * $and = $exp->and(['id >' => 2, 'id <' => 10]);
* return $or->add($and);
* });
* ```
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php
index abb4fdd43..fd180d1b2 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php
@@ -24,7 +24,6 @@
*/
trait QueryTrait
{
-
/**
* Instance of a table object this query is bound to
*
@@ -87,6 +86,8 @@ trait QueryTrait
* When called with a Table argument, the default table object will be set
* and this query object will be returned for chaining.
*
+ * Deprecated: 3.6.0 Using Query::repository() as getter is deprecated. Use getRepository() instead.
+ *
* @param \Cake\Datasource\RepositoryInterface|null $table The default table object to use
* @return \Cake\Datasource\RepositoryInterface|$this
*/
@@ -179,7 +180,7 @@ public function getIterator()
* $query->cache(false);
* ```
*
- * @param false|string|\Closure $key Either the cache key or a function to generate the cache key.
+ * @param \Closure|string|false $key Either the cache key or a function to generate the cache key.
* When using a function, this query instance will be supplied as an argument.
* @param string|\Cake\Cache\CacheEngine $config Either the name of the cache config to use, or
* a cache config instance.
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/README.md b/app/vendor/cakephp/cakephp/src/Datasource/README.md
index 093a6c26f..9f756bca9 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/README.md
+++ b/app/vendor/cakephp/cakephp/src/Datasource/README.md
@@ -27,7 +27,7 @@ Additionally, this package provides a few traits and classes you can use in your
* `EntityTrait` - Contains the default implementation for the `EntityInterface`.
* `QueryTrait` - Exposes the methods for creating a query object capable of returning decoratable collections.
-* `ResultSetDecorator` - Decorates any traversable object so it complies with `ResultSetInterface`.
+* `ResultSetDecorator` - Decorates any traversable object, so it complies with `ResultSetInterface`.
## Connections
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/RepositoryInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/RepositoryInterface.php
index 171835df1..3405acbd8 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/RepositoryInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/RepositoryInterface.php
@@ -25,7 +25,6 @@
*/
interface RepositoryInterface
{
-
/**
* Returns the table alias or sets a new one
*
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/ResultSetDecorator.php b/app/vendor/cakephp/cakephp/src/Datasource/ResultSetDecorator.php
index 6d6f626c1..cf4da00d9 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/ResultSetDecorator.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/ResultSetDecorator.php
@@ -23,7 +23,6 @@
*/
class ResultSetDecorator extends Collection implements ResultSetInterface
{
-
/**
* Make this object countable.
*
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php
index 98c161dad..5cabda5da 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php
@@ -29,7 +29,6 @@
*/
trait RulesAwareTrait
{
-
/**
* The domain rules to be applied to entities saved by this table
*
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/SchemaInterface.php b/app/vendor/cakephp/cakephp/src/Datasource/SchemaInterface.php
index 69e5e3999..93ecf29b5 100644
--- a/app/vendor/cakephp/cakephp/src/Datasource/SchemaInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Datasource/SchemaInterface.php
@@ -19,7 +19,6 @@
*/
interface SchemaInterface
{
-
/**
* Get the name of the table.
*
diff --git a/app/vendor/cakephp/cakephp/src/Datasource/SimplePaginator.php b/app/vendor/cakephp/cakephp/src/Datasource/SimplePaginator.php
new file mode 100644
index 000000000..319ccee52
--- /dev/null
+++ b/app/vendor/cakephp/cakephp/src/Datasource/SimplePaginator.php
@@ -0,0 +1,38 @@
+=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0"
},
"suggest": {
diff --git a/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php b/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php
index 89e70959e..73002551c 100644
--- a/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php
+++ b/app/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php
@@ -29,7 +29,6 @@
*/
abstract class BaseErrorHandler
{
-
/**
* Options to use for the Error handling.
*
@@ -115,8 +114,8 @@ public function register()
* Set as the default error handler by CakePHP.
*
* Use config/error.php to customize or replace this error handler.
- * This function will use Debugger to display errors when debug > 0. And
- * will log errors to Log, when debug == 0.
+ * This function will use Debugger to display errors when debug mode is on. And
+ * will log errors to Log, when debug mode is off.
*
* You can use the 'errorLevel' option to set what type of errors will be handled.
* Stack traces for errors can be enabled with the 'trace' option.
@@ -149,10 +148,20 @@ public function handleError($code, $description, $file = null, $line = null, $co
$debug = Configure::read('debug');
if ($debug) {
+ // By default trim 3 frames off for the public and protected methods
+ // used by ErrorHandler instances.
+ $start = 3;
+
+ // Can be used by error handlers that wrap other error handlers
+ // to coerce the generated stack trace to the correct point.
+ if (isset($context['_trace_frame_offset'])) {
+ $start += $context['_trace_frame_offset'];
+ unset($context['_trace_frame_offset']);
+ }
$data += [
'context' => $context,
- 'start' => 3,
- 'path' => Debugger::trimPath($file)
+ 'start' => $start,
+ 'path' => Debugger::trimPath($file),
];
}
$this->_displayError($data, $debug);
@@ -283,7 +292,7 @@ protected function _logError($level, $data)
if (!empty($this->_options['trace'])) {
$trace = Debugger::trace([
'start' => 1,
- 'format' => 'log'
+ 'format' => 'log',
]);
$request = Router::getRequest();
diff --git a/app/vendor/cakephp/cakephp/src/Error/Debugger.php b/app/vendor/cakephp/cakephp/src/Error/Debugger.php
index 353cbef0c..aaaf28f87 100644
--- a/app/vendor/cakephp/cakephp/src/Error/Debugger.php
+++ b/app/vendor/cakephp/cakephp/src/Error/Debugger.php
@@ -29,7 +29,7 @@
*
* Debugger overrides PHP's default error handling to provide stack traces and enhanced logging
*
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#namespace-Cake\Error
+ * @link https://book.cakephp.org/3/en/development/debugging.html#namespace-Cake\Error
*/
class Debugger
{
@@ -41,7 +41,7 @@ class Debugger
* @var array
*/
protected $_defaultConfig = [
- 'outputMask' => []
+ 'outputMask' => [],
];
/**
@@ -67,7 +67,7 @@ class Debugger
protected $_templates = [
'log' => [
'trace' => '{:reference} - {:path}, line {:line}',
- 'error' => '{:error} ({:code}): {:description} in [{:file}, line {:line}]'
+ 'error' => '{:error} ({:code}): {:description} in [{:file}, line {:line}]',
],
'js' => [
'error' => '',
@@ -86,13 +86,13 @@ class Debugger
'txt' => [
'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}",
'code' => '',
- 'info' => ''
+ 'info' => '',
],
'base' => [
'traceLine' => '{:reference} - {:path}, line {:line}',
'trace' => "Trace:\n{:trace}\n",
'context' => "Context:\n{:context}\n",
- ]
+ ],
];
/**
@@ -104,7 +104,6 @@ class Debugger
/**
* Constructor.
- *
*/
public function __construct()
{
@@ -231,7 +230,7 @@ public static function setOutputMask(array $value, $merge = true)
* @param int $depth The depth to output to. Defaults to 3.
* @return void
* @see \Cake\Error\Debugger::exportVar()
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#outputting-values
+ * @link https://book.cakephp.org/3/en/development/debugging.html#outputting-values
*/
public static function dump($var, $depth = 3)
{
@@ -270,7 +269,7 @@ public static function log($var, $level = 'debug', $depth = 3)
*
* @param array $options Format for outputting stack trace.
* @return string|array Formatted stack trace.
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#generating-stack-traces
+ * @link https://book.cakephp.org/3/en/development/debugging.html#generating-stack-traces
*/
public static function trace(array $options = [])
{
@@ -292,7 +291,7 @@ public static function trace(array $options = [])
* @param array|\Exception $backtrace Trace as array or an exception object.
* @param array $options Format for outputting stack trace.
* @return string|array Formatted stack trace.
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#generating-stack-traces
+ * @link https://book.cakephp.org/3/en/development/debugging.html#generating-stack-traces
*/
public static function formatTrace($backtrace, $options = [])
{
@@ -306,7 +305,7 @@ public static function formatTrace($backtrace, $options = [])
'args' => false,
'start' => 0,
'scope' => null,
- 'exclude' => ['call_user_func_array', 'trigger_error']
+ 'exclude' => ['call_user_func_array', 'trigger_error'],
];
$options = Hash::merge($defaults, $options);
@@ -317,7 +316,7 @@ public static function formatTrace($backtrace, $options = [])
'line' => '??',
'file' => '[internal]',
'class' => null,
- 'function' => '[main]'
+ 'function' => '[main]',
];
for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {
@@ -409,7 +408,7 @@ public static function trimPath($path)
* @param int $context Number of lines of context to extract above and below $line.
* @return array Set of lines highlighted
* @see https://secure.php.net/highlight_string
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#getting-an-excerpt-from-a-file
+ * @link https://book.cakephp.org/3/en/development/debugging.html#getting-an-excerpt-from-a-file
*/
public static function excerpt($file, $line, $context = 2)
{
diff --git a/app/vendor/cakephp/cakephp/src/Error/ErrorHandler.php b/app/vendor/cakephp/cakephp/src/Error/ErrorHandler.php
index 633b35f05..18ef14c70 100644
--- a/app/vendor/cakephp/cakephp/src/Error/ErrorHandler.php
+++ b/app/vendor/cakephp/cakephp/src/Error/ErrorHandler.php
@@ -23,12 +23,12 @@
/**
* Error Handler provides basic error and exception handling for your application. It captures and
- * handles all unhandled exceptions and errors. Displays helpful framework errors when debug > 1.
+ * handles all unhandled exceptions and errors. Displays helpful framework errors when debug mode is on.
*
* ### Uncaught exceptions
*
- * When debug < 1 a CakeException will render 404 or 500 errors. If an uncaught exception is thrown
- * and it is a type that ErrorHandler does not know about it will be treated as a 500 error.
+ * When debug mode is off a ExceptionRenderer will render 404 or 500 errors. If an uncaught exception is thrown
+ * and it is a type that ExceptionRenderer does not know about it will be treated as a 500 error.
*
* ### Implementing application specific exception handling
*
@@ -164,7 +164,6 @@ protected function _clearOutput()
* The PHP5 part will be removed with 4.0.
*
* @param \Throwable|\Exception $exception Exception.
- *
* @return void
*/
protected function _logInternalError($exception)
@@ -172,9 +171,11 @@ protected function _logInternalError($exception)
// Disable trace for internal errors.
$this->_options['trace'] = false;
$message = sprintf(
- "[%s] %s\n%s", // Keeping same message format
+ "[%s] %s (%s:%s)\n%s", // Keeping same message format
get_class($exception),
$exception->getMessage(),
+ $exception->getFile(),
+ $exception->getLine(),
$exception->getTraceAsString()
);
trigger_error($message, E_USER_ERROR);
diff --git a/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php b/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php
index 1b4194640..7e8bd9095 100644
--- a/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php
+++ b/app/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php
@@ -35,7 +35,7 @@
* Exception Renderer.
*
* Captures and handles all unhandled exceptions. Displays helpful framework errors when debug is true.
- * When debug is false a CakeException will render 404 or 500 errors. If an uncaught exception is thrown
+ * When debug is false a ExceptionRenderer will render 404 or 500 errors. If an uncaught exception is thrown
* and it is a type that ExceptionHandler does not know about it will be treated as a 500 error.
*
* ### Implementing application specific exception rendering
@@ -50,7 +50,6 @@
*/
class ExceptionRenderer implements ExceptionRendererInterface
{
-
/**
* The exception being handled.
*
@@ -162,7 +161,7 @@ protected function _getController()
$class = App::className('Error', 'Controller', 'Controller');
}
- /* @var \Cake\Controller\Controller $controller */
+ /** @var \Cake\Controller\Controller $controller */
$controller = new $class($request, $response);
$controller->startupProcess();
$startup = true;
@@ -220,14 +219,14 @@ public function render()
'url' => h($url),
'error' => $unwrapped,
'code' => $code,
- '_serialize' => ['message', 'url', 'code']
+ '_serialize' => ['message', 'url', 'code'],
];
$isDebug = Configure::read('debug');
if ($isDebug) {
$viewVars['trace'] = Debugger::formatTrace($unwrapped->getTrace(), [
'format' => 'array',
- 'args' => false
+ 'args' => false,
]);
$viewVars['file'] = $exception->getFile() ?: 'null';
$viewVars['line'] = $exception->getLine() ?: 'null';
@@ -294,7 +293,8 @@ protected function _message(Exception $exception, $code)
$exception = $this->_unwrap($exception);
$message = $exception->getMessage();
- if (!Configure::read('debug') &&
+ if (
+ !Configure::read('debug') &&
!($exception instanceof HttpException)
) {
if ($code < 500) {
@@ -429,7 +429,7 @@ protected function _shutdown()
}
$args = [
'request' => $this->controller->request,
- 'response' => $this->controller->response
+ 'response' => $this->controller->response,
];
$result = $dispatcher->dispatchEvent('Dispatcher.afterDispatch', $args);
diff --git a/app/vendor/cakephp/cakephp/src/Error/FatalErrorException.php b/app/vendor/cakephp/cakephp/src/Error/FatalErrorException.php
index 4613e8e47..5253a9916 100644
--- a/app/vendor/cakephp/cakephp/src/Error/FatalErrorException.php
+++ b/app/vendor/cakephp/cakephp/src/Error/FatalErrorException.php
@@ -19,7 +19,6 @@
*/
class FatalErrorException extends Exception
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php b/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php
index e99342c5d..ab3f80b03 100644
--- a/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php
@@ -80,6 +80,10 @@ public function __construct($exceptionRenderer = null, array $config = [])
$config = $config ?: Configure::read('Error');
$this->setConfig($config);
+
+ if (PHP_VERSION_ID >= 70400 && Configure::read('debug')) {
+ ini_set('zend.exception_ignore_args', 0);
+ }
}
/**
@@ -130,7 +134,6 @@ public function handleException($exception, $request, $response)
/**
* @param \Psr\Http\Message\ResponseInterface $response The response
- *
* @return \Psr\Http\Message\ResponseInterface A response
*/
protected function handleInternalError($response)
@@ -230,10 +233,12 @@ protected function getMessage($request, $exception)
protected function getMessageForException($exception, $isPrevious = false)
{
$message = sprintf(
- '%s[%s] %s',
+ '%s[%s] %s (%s:%s)',
$isPrevious ? "\nCaused by: " : '',
get_class($exception),
- $exception->getMessage()
+ $exception->getMessage(),
+ $exception->getFile(),
+ $exception->getLine()
);
$debug = Configure::read('debug');
diff --git a/app/vendor/cakephp/cakephp/src/Error/PHP7ErrorException.php b/app/vendor/cakephp/cakephp/src/Error/PHP7ErrorException.php
index 165b32bc6..a8b853beb 100644
--- a/app/vendor/cakephp/cakephp/src/Error/PHP7ErrorException.php
+++ b/app/vendor/cakephp/cakephp/src/Error/PHP7ErrorException.php
@@ -21,7 +21,6 @@
*/
class PHP7ErrorException extends Exception
{
-
/**
* The wrapped error object
*
diff --git a/app/vendor/cakephp/cakephp/src/Event/Decorator/AbstractDecorator.php b/app/vendor/cakephp/cakephp/src/Event/Decorator/AbstractDecorator.php
index e0cb24108..762896f74 100644
--- a/app/vendor/cakephp/cakephp/src/Event/Decorator/AbstractDecorator.php
+++ b/app/vendor/cakephp/cakephp/src/Event/Decorator/AbstractDecorator.php
@@ -19,7 +19,6 @@
*/
abstract class AbstractDecorator
{
-
/**
* Callable
*
diff --git a/app/vendor/cakephp/cakephp/src/Event/Decorator/ConditionDecorator.php b/app/vendor/cakephp/cakephp/src/Event/Decorator/ConditionDecorator.php
index 7db1afb57..5784225f3 100644
--- a/app/vendor/cakephp/cakephp/src/Event/Decorator/ConditionDecorator.php
+++ b/app/vendor/cakephp/cakephp/src/Event/Decorator/ConditionDecorator.php
@@ -25,7 +25,6 @@
*/
class ConditionDecorator extends AbstractDecorator
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Event/Decorator/SubjectFilterDecorator.php b/app/vendor/cakephp/cakephp/src/Event/Decorator/SubjectFilterDecorator.php
index eb32f826c..b25b5c9a9 100644
--- a/app/vendor/cakephp/cakephp/src/Event/Decorator/SubjectFilterDecorator.php
+++ b/app/vendor/cakephp/cakephp/src/Event/Decorator/SubjectFilterDecorator.php
@@ -28,7 +28,6 @@
*/
class SubjectFilterDecorator extends AbstractDecorator
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Event/Event.php b/app/vendor/cakephp/cakephp/src/Event/Event.php
index 9c599a245..ae5c87287 100644
--- a/app/vendor/cakephp/cakephp/src/Event/Event.php
+++ b/app/vendor/cakephp/cakephp/src/Event/Event.php
@@ -19,7 +19,6 @@
*/
class Event implements EventInterface
{
-
/**
* Name of the event
*
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventDispatcherInterface.php b/app/vendor/cakephp/cakephp/src/Event/EventDispatcherInterface.php
index 9119ad1e1..6e424a5d0 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventDispatcherInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventDispatcherInterface.php
@@ -38,7 +38,6 @@ interface EventDispatcherInterface
* it can be read by listeners.
* @param object|null $subject The object that this event applies to
* ($this by default).
- *
* @return \Cake\Event\Event
*/
public function dispatchEvent($name, $data = null, $subject = null);
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php b/app/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php
index 08c403c06..28dfcef2b 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php
@@ -19,7 +19,6 @@
*/
trait EventDispatcherTrait
{
-
/**
* Instance of the Cake\Event\EventManager this object is using
* to dispatch inner events.
@@ -101,7 +100,6 @@ public function setEventManager(EventManager $eventManager)
* it can be read by listeners.
* @param object|null $subject The object that this event applies to
* ($this by default).
- *
* @return \Cake\Event\Event
*/
public function dispatchEvent($name, $data = null, $subject = null)
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventList.php b/app/vendor/cakephp/cakephp/src/Event/EventList.php
index 112329d40..0410c564f 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventList.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventList.php
@@ -22,7 +22,6 @@
*/
class EventList implements ArrayAccess, Countable
{
-
/**
* Events list
*
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventListenerInterface.php b/app/vendor/cakephp/cakephp/src/Event/EventListenerInterface.php
index b117237b6..9e4389399 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventListenerInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventListenerInterface.php
@@ -20,7 +20,6 @@
*/
interface EventListenerInterface
{
-
/**
* Returns a list of events this object is implementing. When the class is registered
* in an event manager, each individual method will be associated with the respective event.
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventManager.php b/app/vendor/cakephp/cakephp/src/Event/EventManager.php
index 2e5cd7d18..b452ecec0 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventManager.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventManager.php
@@ -24,7 +24,6 @@
*/
class EventManager implements EventManagerInterface
{
-
/**
* The default priority queue value for new, attached listeners
*
@@ -106,7 +105,6 @@ public static function instance($manager = null)
* @param array $options used to set the `priority` flag to the listener. In the future more options may be added.
* Priorities are treated as queues. Lower values are called before higher ones, and multiple attachments
* added to the same priority queue will be treated in the order of insertion.
- *
* @return void
* @throws \InvalidArgumentException When event key is missing or callable is not an
* instance of Cake\Event\EventListenerInterface.
@@ -141,7 +139,7 @@ public function on($eventKey = null, $options = [], $callable = null)
$argCount = func_num_args();
if ($argCount === 2) {
$this->_listeners[$eventKey][static::$defaultPriority][] = [
- 'callable' => $options
+ 'callable' => $options,
];
return $this;
@@ -149,7 +147,7 @@ public function on($eventKey = null, $options = [], $callable = null)
if ($argCount === 3) {
$priority = isset($options['priority']) ? $options['priority'] : static::$defaultPriority;
$this->_listeners[$eventKey][$priority][] = [
- 'callable' => $callable
+ 'callable' => $callable,
];
return $this;
@@ -343,10 +341,10 @@ public function dispatch($event)
* Calls a listener.
*
* @param callable $listener The listener to trigger.
- * @param \Cake\Event\Event $event Event instance.
+ * @param \Cake\Event\EventInterface $event Event instance.
* @return mixed The result of the $listener function.
*/
- protected function _callListener(callable $listener, Event $event)
+ protected function _callListener(callable $listener, EventInterface $event)
{
$data = $event->getData();
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventManagerInterface.php b/app/vendor/cakephp/cakephp/src/Event/EventManagerInterface.php
index a5979cd8c..236eedf11 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventManagerInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventManagerInterface.php
@@ -18,7 +18,6 @@
*/
interface EventManagerInterface
{
-
/**
* Adds a new listener to an event.
*
@@ -52,7 +51,6 @@ interface EventManagerInterface
* added to the same priority queue will be treated in the order of insertion.
*
* @param callable|null $callable The callable function you want invoked.
- *
* @return $this
* @throws \InvalidArgumentException When event key is missing or callable is not an
* instance of Cake\Event\EventListenerInterface.
diff --git a/app/vendor/cakephp/cakephp/src/Event/EventManagerTrait.php b/app/vendor/cakephp/cakephp/src/Event/EventManagerTrait.php
index efc0a5abe..4425af18c 100644
--- a/app/vendor/cakephp/cakephp/src/Event/EventManagerTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Event/EventManagerTrait.php
@@ -21,6 +21,5 @@
*/
trait EventManagerTrait
{
-
use EventDispatcherTrait;
}
diff --git a/app/vendor/cakephp/cakephp/src/Event/README.md b/app/vendor/cakephp/cakephp/src/Event/README.md
index 8ee7261a7..e77b63684 100644
--- a/app/vendor/cakephp/cakephp/src/Event/README.md
+++ b/app/vendor/cakephp/cakephp/src/Event/README.md
@@ -48,4 +48,4 @@ in separate objects that focus on those concerns.
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/events.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/events.html)
diff --git a/app/vendor/cakephp/cakephp/src/Event/composer.json b/app/vendor/cakephp/cakephp/src/Event/composer.json
index e984d41e2..c0fd41185 100644
--- a/app/vendor/cakephp/cakephp/src/Event/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Event/composer.json
@@ -23,7 +23,7 @@
"source": "https://github.com/cakephp/event"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0"
},
"autoload": {
diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/File.php b/app/vendor/cakephp/cakephp/src/Filesystem/File.php
index b39dc999b..21c02c026 100644
--- a/app/vendor/cakephp/cakephp/src/Filesystem/File.php
+++ b/app/vendor/cakephp/cakephp/src/Filesystem/File.php
@@ -22,12 +22,11 @@
*/
class File
{
-
/**
* Folder object of the file
*
* @var \Cake\Filesystem\Folder
- * @link https://book.cakephp.org/3.0/en/core-libraries/file-folder.html
+ * @link https://book.cakephp.org/3/en/core-libraries/file-folder.html
*/
public $Folder;
@@ -35,7 +34,7 @@ class File
* File name
*
* @var string
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\File::$name
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\File::$name
*/
public $name;
@@ -43,7 +42,7 @@ class File
* File info
*
* @var array
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\File::$info
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\File::$info
*/
public $info = [];
@@ -51,7 +50,7 @@ class File
* Holds the file handler resource if the file is opened
*
* @var resource|null
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\File::$handle
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\File::$handle
*/
public $handle;
@@ -59,7 +58,7 @@ class File
* Enable locking for file reading and writing
*
* @var bool|null
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\File::$lock
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\File::$lock
*/
public $lock;
@@ -69,7 +68,7 @@ class File
* Current file's absolute path
*
* @var string|null
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\File::$path
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\File::$path
*/
public $path;
@@ -79,7 +78,7 @@ class File
* @param string $path Path to file
* @param bool $create Create file if it does not exist (if true)
* @param int $mode Mode to apply to the folder holding the file
- * @link https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#file-api
+ * @link https://book.cakephp.org/3/en/core-libraries/file-folder.html#file-api
*/
public function __construct($path, $create = false, $mode = 0755)
{
@@ -140,14 +139,14 @@ public function open($mode = 'r', $force = false)
/**
* Return the contents of this file as a string.
*
- * @param string|bool $bytes where to start
+ * @param int|false $lengthInBytes The length to read in bytes or `false` for the full file. Defaults to `false`.
* @param string $mode A `fread` compatible mode.
* @param bool $force If true then the file will be re-opened even if its already opened, otherwise it won't
- * @return string|false string on success, false on failure
+ * @return string|false String on success, false on failure
*/
- public function read($bytes = false, $mode = 'rb', $force = false)
+ public function read($lengthInBytes = false, $mode = 'rb', $force = false)
{
- if ($bytes === false && $this->lock === null) {
+ if ($lengthInBytes === false && $this->lock === null) {
return file_get_contents($this->path);
}
if ($this->open($mode, $force) === false) {
@@ -156,8 +155,8 @@ public function read($bytes = false, $mode = 'rb', $force = false)
if ($this->lock !== null && flock($this->handle, LOCK_SH) === false) {
return false;
}
- if (is_int($bytes)) {
- return fread($this->handle, $bytes);
+ if (is_int($lengthInBytes)) {
+ return fread($this->handle, $lengthInBytes);
}
$data = '';
@@ -168,7 +167,7 @@ public function read($bytes = false, $mode = 'rb', $force = false)
if ($this->lock !== null) {
flock($this->handle, LOCK_UN);
}
- if ($bytes === false) {
+ if ($lengthInBytes === false) {
$this->close();
}
@@ -363,7 +362,7 @@ protected static function _basename($path, $ext = null)
{
// check for multibyte string and use basename() if not found
if (mb_strlen($path) === strlen($path)) {
- return ($ext === null)? basename($path) : basename($path, $ext);
+ return ($ext === null) ? basename($path) : basename($path, $ext);
}
$splInfo = new SplFileInfo($path);
@@ -376,7 +375,7 @@ protected static function _basename($path, $ext = null)
$new = preg_replace("/({$ext})$/u", "", $name);
// basename of '/etc/.d' is '.d' not ''
- return ($new === '')? $name : $new;
+ return ($new === '') ? $name : $new;
}
/**
@@ -591,7 +590,7 @@ public function copy($dest, $overwrite = true)
* Gets the mime type of the file. Uses the finfo extension if
* it's available, otherwise falls back to mime_content_type().
*
- * @return false|string The mimetype of the file, or false if reading fails.
+ * @return string|false The mimetype of the file, or false if reading fails.
*/
public function mime()
{
diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php
index b425cbfe2..9a81de315 100644
--- a/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php
+++ b/app/vendor/cakephp/cakephp/src/Filesystem/Folder.php
@@ -24,11 +24,10 @@
* Folder structure browser, lists folders and files.
* Provides an Object interface for Common directory related tasks.
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#folder-api
+ * @link https://book.cakephp.org/3/en/core-libraries/file-folder.html#folder-api
*/
class Folder
{
-
/**
* Default scheme for Folder::copy
* Recursively merges subfolders with the same name
@@ -86,16 +85,18 @@ class Folder
* Mode to be used on create. Does nothing on windows platforms.
*
* @var int
- * https://book.cakephp.org/3.0/en/core-libraries/file-folder.html#Cake\Filesystem\Folder::$mode
+ * https://book.cakephp.org/3/en/core-libraries/file-folder.html#Cake\Filesystem\Folder::$mode
*/
public $mode = 0755;
/**
* Functions array to be called depending on the sort type chosen.
+ *
+ * @var string[]
*/
protected $_fsorts = [
self::SORT_NAME => 'getPathname',
- self::SORT_TIME => 'getCTime'
+ self::SORT_TIME => 'getCTime',
];
/**
@@ -167,7 +168,7 @@ public function pwd()
* Change directory to $path.
*
* @param string $path Path to the directory to change to
- * @return string|bool The new path. Returns false on failure
+ * @return string|false The new path. Returns false on failure
*/
public function cd($path)
{
@@ -354,7 +355,6 @@ public static function isRegisteredStreamWrapper($path)
*
* @param string $path Path to check
* @return string Set of slashes ("\\" or "/")
- *
* @deprecated 3.7.0 This method will be removed in 4.0.0. Use correctSlashFor() instead.
*/
public static function normalizePath($path)
@@ -582,6 +582,8 @@ public function tree($path = null, $exceptions = false, $type = null)
$directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_SELF);
$iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
} catch (Exception $e) {
+ unset($directory, $iterator);
+
if ($type === null) {
return [[], []];
}
@@ -597,12 +599,14 @@ public function tree($path = null, $exceptions = false, $type = null)
if ($skipHidden) {
$subPathName = $fsIterator->getSubPathname();
if ($subPathName[0] === '.' || strpos($subPathName, DIRECTORY_SEPARATOR . '.') !== false) {
+ unset($fsIterator);
continue;
}
}
/** @var \FilesystemIterator $item */
$item = $fsIterator->current();
if (!empty($exceptions) && isset($exceptions[$item->getFilename()])) {
+ unset($fsIterator, $item);
continue;
}
@@ -611,7 +615,15 @@ public function tree($path = null, $exceptions = false, $type = null)
} elseif ($item->isDir() && !$item->isDot()) {
$directories[] = $itemPath;
}
+
+ // inner iterators need to be unset too in order for locks on parents to be released
+ unset($fsIterator, $item);
}
+
+ // unsetting iterators helps releasing possible locks in certain environments,
+ // which could otherwise make `rmdir()` fail
+ unset($directory, $iterator);
+
if ($type === null) {
return [$directories, $files];
}
@@ -731,6 +743,8 @@ public function delete($path = null)
$directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::CURRENT_AS_SELF);
$iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::CHILD_FIRST);
} catch (Exception $e) {
+ unset($directory, $iterator);
+
return false;
}
@@ -752,11 +766,20 @@ public function delete($path = null)
} else {
$this->_errors[] = sprintf('%s NOT removed', $filePath);
+ unset($directory, $iterator, $item);
+
return false;
}
}
+
+ // inner iterators need to be unset too in order for locks on parents to be released
+ unset($item);
}
+ // unsetting iterators helps releasing possible locks in certain environments,
+ // which could otherwise make `rmdir()` fail
+ unset($directory, $iterator);
+
$path = rtrim($path, DIRECTORY_SEPARATOR);
//@codingStandardsIgnoreStart
if (@rmdir($path)) {
@@ -803,7 +826,7 @@ public function copy($options)
'mode' => $this->mode,
'skip' => [],
'scheme' => Folder::MERGE,
- 'recursive' => true
+ 'recursive' => true,
];
$fromDir = $options['from'];
diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/README.md b/app/vendor/cakephp/cakephp/src/Filesystem/README.md
index 769837df4..74ec083ea 100644
--- a/app/vendor/cakephp/cakephp/src/Filesystem/README.md
+++ b/app/vendor/cakephp/cakephp/src/Filesystem/README.md
@@ -32,4 +32,4 @@ foreach ($files as $file) {
## Documentation
Please make sure you check the [official
-documentation](https://book.cakephp.org/3.0/en/core-libraries/file-folder.html)
+documentation](https://book.cakephp.org/3/en/core-libraries/file-folder.html)
diff --git a/app/vendor/cakephp/cakephp/src/Filesystem/composer.json b/app/vendor/cakephp/cakephp/src/Filesystem/composer.json
index e5dcb0702..62dc4ffec 100644
--- a/app/vendor/cakephp/cakephp/src/Filesystem/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Filesystem/composer.json
@@ -23,7 +23,7 @@
"source": "https://github.com/cakephp/filesystem"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0"
},
"autoload": {
diff --git a/app/vendor/cakephp/cakephp/src/Form/Form.php b/app/vendor/cakephp/cakephp/src/Form/Form.php
index 019950e53..bbff3c653 100644
--- a/app/vendor/cakephp/cakephp/src/Form/Form.php
+++ b/app/vendor/cakephp/cakephp/src/Form/Form.php
@@ -45,13 +45,6 @@
*/
class Form implements EventListenerInterface, EventDispatcherInterface, ValidatorAwareInterface
{
- /**
- * Schema class.
- *
- * @var string
- */
- protected $_schemaClass = Schema::class;
-
use EventDispatcherTrait;
use ValidatorAwareTrait;
@@ -69,6 +62,13 @@ class Form implements EventListenerInterface, EventDispatcherInterface, Validato
*/
const BUILD_VALIDATOR_EVENT = 'Form.buildValidator';
+ /**
+ * Schema class.
+ *
+ * @var string
+ */
+ protected $_schemaClass = Schema::class;
+
/**
* The schema used by this form.
*
@@ -142,7 +142,7 @@ public function implementedEvents()
public function schema(Schema $schema = null)
{
if ($schema === null && empty($this->_schema)) {
- $schema = $this->_buildSchema(new $this->_schemaClass);
+ $schema = $this->_buildSchema(new $this->_schemaClass());
}
if ($schema) {
$this->_schema = $schema;
@@ -185,7 +185,7 @@ public function validator(Validator $validator = null)
);
if ($validator === null && empty($this->_validator)) {
- $validator = $this->_buildValidator(new $this->_validatorClass);
+ $validator = $this->_buildValidator(new $this->_validatorClass());
}
if ($validator) {
$this->_validator = $validator;
@@ -239,7 +239,7 @@ public function validate(array $data)
$validator = $this->validator();
}
}
- $this->_errors = $validator->errors($data);
+ $this->_errors = $validator->validate($data);
return count($this->_errors) === 0;
}
@@ -373,7 +373,7 @@ public function __debugInfo()
$special = [
'_schema' => $this->schema()->__debugInfo(),
'_errors' => $this->getErrors(),
- '_validator' => $this->getValidator()->__debugInfo()
+ '_validator' => $this->getValidator()->__debugInfo(),
];
return $special + get_object_vars($this);
diff --git a/app/vendor/cakephp/cakephp/src/Form/README.md b/app/vendor/cakephp/cakephp/src/Form/README.md
index 62d2b1d6f..fe8caef68 100644
--- a/app/vendor/cakephp/cakephp/src/Form/README.md
+++ b/app/vendor/cakephp/cakephp/src/Form/README.md
@@ -60,4 +60,4 @@ $errors = $contact->getErrors();
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/form.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/form.html)
diff --git a/app/vendor/cakephp/cakephp/src/Form/Schema.php b/app/vendor/cakephp/cakephp/src/Form/Schema.php
index 11d927f44..db30fa203 100644
--- a/app/vendor/cakephp/cakephp/src/Form/Schema.php
+++ b/app/vendor/cakephp/cakephp/src/Form/Schema.php
@@ -19,7 +19,6 @@
*/
class Schema
{
-
/**
* The fields in this schema.
*
@@ -100,7 +99,7 @@ public function fields()
* Get the attributes for a given field.
*
* @param string $name The field name.
- * @return null|array The attributes for a field, or null.
+ * @return array|null The attributes for a field, or null.
*/
public function field($name)
{
@@ -136,7 +135,7 @@ public function fieldType($name)
public function __debugInfo()
{
return [
- '_fields' => $this->_fields
+ '_fields' => $this->_fields,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Form/composer.json b/app/vendor/cakephp/cakephp/src/Form/composer.json
index 5e1dfdc92..f186aa5d8 100644
--- a/app/vendor/cakephp/cakephp/src/Form/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Form/composer.json
@@ -21,7 +21,7 @@
"source": "https://github.com/cakephp/form"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/event": "^3.6.0",
"cakephp/validation": "^3.6.0"
},
diff --git a/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php b/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php
index e514204da..35a3677d9 100644
--- a/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php
+++ b/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php
@@ -12,11 +12,13 @@
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
namespace Cake\Http;
use Cake\Core\App;
use Cake\Core\BasePlugin;
use Cake\Core\ConsoleApplicationInterface;
+use Cake\Core\Exception\MissingPluginException;
use Cake\Core\HttpApplicationInterface;
use Cake\Core\Plugin;
use Cake\Core\PluginApplicationInterface;
@@ -42,7 +44,6 @@ abstract class BaseApplication implements
HttpApplicationInterface,
PluginApplicationInterface
{
-
use EventDispatcherTrait;
/**
@@ -109,6 +110,26 @@ public function addPlugin($name, array $config = [])
return $this;
}
+ /**
+ * Add an optional plugin
+ *
+ * If it isn't available, ignore it.
+ *
+ * @param string|\Cake\Core\PluginInterface $name The plugin name or plugin object.
+ * @param array $config The configuration data for the plugin if using a string for $name
+ * @return $this
+ */
+ public function addOptionalPlugin($name, array $config = [])
+ {
+ try {
+ $this->addPlugin($name, $config);
+ } catch (MissingPluginException $e) {
+ // Do not halt if the plugin is missing
+ }
+
+ return $this;
+ }
+
/**
* Get the plugin collection in use.
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php b/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php
index f6ecbff1e..64510cb1d 100644
--- a/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php
+++ b/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php
@@ -14,12 +14,12 @@
*/
namespace Cake\Http;
-use Zend\Diactoros\CallbackStream as BaseCallbackStream;
+use Laminas\Diactoros\CallbackStream as BaseCallbackStream;
/**
* Implementation of PSR HTTP streams.
*
- * This differs from Zend\Diactoros\Callback stream in that
+ * This differs from Laminas\Diactoros\Callback stream in that
* it allows the use of `echo` inside the callback, and gracefully
* handles the callback not returning a string.
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client.php b/app/vendor/cakephp/cakephp/src/Http/Client.php
index ecc194dac..6848957ee 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client.php
@@ -24,7 +24,7 @@
use Cake\Http\Cookie\CookieInterface;
use Cake\Utility\Hash;
use InvalidArgumentException;
-use Zend\Diactoros\Uri;
+use Laminas\Diactoros\Uri;
/**
* The end user interface for doing HTTP requests.
@@ -114,6 +114,7 @@ class Client
'ssl_verify_depth' => 5,
'ssl_verify_host' => true,
'redirect' => false,
+ 'protocolVersion' => '1.1',
];
/**
@@ -156,6 +157,7 @@ class Client
* - adapter - The adapter class name or instance. Defaults to
* \Cake\Http\Client\Adapter\Curl if `curl` extension is loaded else
* \Cake\Http\Client\Adapter\Stream.
+ * - protocolVersion - The HTTP protocol version to use. Defaults to 1.1
*
* @param array $config Config options for scoped clients.
* @throws \InvalidArgumentException
@@ -418,17 +420,16 @@ public function send(Request $request, $options = [])
$handleRedirect = $response->isRedirect() && $redirects-- > 0;
if ($handleRedirect) {
$url = $request->getUri();
- $request = $this->_cookies->addToRequest($request, []);
$location = $response->getHeaderLine('Location');
$locationUrl = $this->buildUrl($location, [], [
'host' => $url->getHost(),
'port' => $url->getPort(),
'scheme' => $url->getScheme(),
- 'protocolRelative' => true
+ 'protocolRelative' => true,
]);
-
$request = $request->withUri(new Uri($locationUrl));
+ $request = $this->_cookies->addToRequest($request, []);
}
} while ($handleRedirect);
@@ -475,7 +476,7 @@ public function buildUrl($url, $query = [], $options = [])
'host' => null,
'port' => null,
'scheme' => 'http',
- 'protocolRelative' => false
+ 'protocolRelative' => false,
];
$options += $defaults;
@@ -488,7 +489,7 @@ public function buildUrl($url, $query = [], $options = [])
$defaultPorts = [
'http' => 80,
- 'https' => 443
+ 'https' => 443,
];
$out = $options['scheme'] . '://' . $options['host'];
if ($options['port'] && $options['port'] != $defaultPorts[$options['scheme']]) {
@@ -519,6 +520,8 @@ protected function _createRequest($method, $url, $data, $options)
}
$request = new Request($url, $method, $headers, $data);
+ $request = $request->withProtocolVersion($this->getConfig('protocolVersion'));
+
$cookies = isset($options['cookies']) ? $options['cookies'] : [];
/** @var \Cake\Http\Client\Request $request */
$request = $this->_cookies->addToRequest($request, $cookies);
@@ -537,7 +540,7 @@ protected function _createRequest($method, $url, $data, $options)
* or full mime-type.
*
* @param string $type short type alias or full mimetype.
- * @return array Headers to set on the request.
+ * @return string[] Headers to set on the request.
* @throws \Cake\Core\Exception\Exception When an unknown type alias is used.
*/
protected function _typeHeaders($type)
@@ -545,7 +548,7 @@ protected function _typeHeaders($type)
if (strpos($type, '/') !== false) {
return [
'Accept' => $type,
- 'Content-Type' => $type
+ 'Content-Type' => $type,
];
}
$typeMap = [
@@ -575,6 +578,7 @@ protected function _typeHeaders($type)
protected function _addAuthentication(Request $request, $options)
{
$auth = $options['auth'];
+ /** @var \Cake\Http\Client\Auth\Basic $adapter */
$adapter = $this->_createAuth($auth, $options);
$result = $adapter->authentication($request, $options['auth']);
@@ -594,6 +598,7 @@ protected function _addAuthentication(Request $request, $options)
protected function _addProxy(Request $request, $options)
{
$auth = $options['proxy'];
+ /** @var \Cake\Http\Client\Auth\Basic $adapter */
$adapter = $this->_createAuth($auth, $options);
$result = $adapter->proxyAuthentication($request, $options['proxy']);
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php
index 3f1ace12f..ba39347ac 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php
@@ -75,7 +75,7 @@ public function buildOptions(Request $request, array $options)
CURLOPT_HTTP_VERSION => $this->getProtocolVersion($request),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => $headers
+ CURLOPT_HTTPHEADER => $headers,
];
switch ($request->getMethod()) {
case Request::METHOD_GET:
@@ -86,6 +86,10 @@ public function buildOptions(Request $request, array $options)
$out[CURLOPT_POST] = true;
break;
+ case Request::METHOD_HEAD:
+ $out[CURLOPT_NOBODY] = true;
+ break;
+
default:
$out[CURLOPT_POST] = true;
$out[CURLOPT_CUSTOMREQUEST] = $request->getMethod();
@@ -96,6 +100,10 @@ public function buildOptions(Request $request, array $options)
if ($body) {
$body->rewind();
$out[CURLOPT_POSTFIELDS] = $body->getContents();
+ // GET requests with bodies require custom request to be used.
+ if (isset($out[CURLOPT_HTTPGET])) {
+ $out[CURLOPT_CUSTOMREQUEST] = 'get';
+ }
}
if (empty($options['ssl_cafile'])) {
@@ -148,11 +156,15 @@ protected function getProtocolVersion(Request $request)
return CURL_HTTP_VERSION_1_0;
case '1.1':
return CURL_HTTP_VERSION_1_1;
+ case '2':
case '2.0':
+ if (defined('CURL_HTTP_VERSION_2TLS')) {
+ return CURL_HTTP_VERSION_2TLS;
+ }
if (defined('CURL_HTTP_VERSION_2_0')) {
return CURL_HTTP_VERSION_2_0;
}
- throw new HttpException('libcurl 7.33 needed for HTTP 2.0 support');
+ throw new HttpException('libcurl 7.33 or greater required for HTTP/2 support');
}
return CURL_HTTP_VERSION_NONE;
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php
index 8b0e4e2c0..125a74d6a 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Stream.php
@@ -27,7 +27,6 @@
*/
class Stream implements AdapterInterface
{
-
/**
* Context resource used by the stream API.
*
@@ -213,6 +212,7 @@ protected function _buildSslContext(Request $request, $options)
'ssl_allow_self_signed',
'ssl_cafile',
'ssl_local_cert',
+ 'ssl_local_pk',
'ssl_passphrase',
];
if (empty($options['ssl_cafile'])) {
@@ -283,7 +283,6 @@ protected function _send(Request $request)
*
* @param array $headers Unparsed headers.
* @param string $body The response body.
- *
* @return \Cake\Http\Client\Response
*/
protected function _buildResponse($headers, $body)
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Basic.php b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Basic.php
index cb4f85dd6..4043b4167 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Basic.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Basic.php
@@ -23,7 +23,6 @@
*/
class Basic
{
-
/**
* Add Authorization header to the request.
*
@@ -36,6 +35,7 @@ public function authentication(Request $request, array $credentials)
{
if (isset($credentials['username'], $credentials['password'])) {
$value = $this->_generateHeader($credentials['username'], $credentials['password']);
+ /** @var \Cake\Http\Client\Request $request */
$request = $request->withHeader('Authorization', $value);
}
@@ -54,6 +54,7 @@ public function proxyAuthentication(Request $request, array $credentials)
{
if (isset($credentials['username'], $credentials['password'])) {
$value = $this->_generateHeader($credentials['username'], $credentials['password']);
+ /** @var \Cake\Http\Client\Request $request */
$request = $request->withHeader('Proxy-Authorization', $value);
}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php
index 0e110952f..e374e3511 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Digest.php
@@ -24,7 +24,6 @@
*/
class Digest
{
-
/**
* Instance of Cake\Http\Client
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Oauth.php b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Oauth.php
index 16861a2f6..ef22138c9 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Oauth.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Auth/Oauth.php
@@ -30,7 +30,6 @@
*/
class Oauth
{
-
/**
* Add headers for Oauth authorization.
*
@@ -139,10 +138,14 @@ protected function _hmacSha1($request, $credentials)
'oauth_timestamp' => $timestamp,
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => $credentials['token'],
- 'oauth_consumer_key' => $credentials['consumerKey'],
+ 'oauth_consumer_key' => $this->_encode($credentials['consumerKey']),
];
$baseString = $this->baseString($request, $values);
+ // Consumer key should only be encoded for base string calculation as
+ // auth header generation already encodes independently
+ $values['oauth_consumer_key'] = $credentials['consumerKey'];
+
if (isset($credentials['realm'])) {
$values['oauth_realm'] = $credentials['realm'];
}
@@ -165,7 +168,6 @@ protected function _hmacSha1($request, $credentials)
* @param \Cake\Http\Client\Request $request The request object.
* @param array $credentials Authentication credentials.
* @return string
- *
* @throws \RuntimeException
*/
protected function _rsaSha1($request, $credentials)
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/CookieCollection.php b/app/vendor/cakephp/cakephp/src/Http/Client/CookieCollection.php
index a93396775..387f63924 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/CookieCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/CookieCollection.php
@@ -26,7 +26,6 @@
*/
class CookieCollection extends BaseCollection
{
-
/**
* {@inheritDoc}
*/
@@ -112,7 +111,7 @@ protected function convertCookieToArray(CookieInterface $cookie)
'domain' => $cookie->getDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->isHttpOnly(),
- 'expires' => $cookie->getExpiresTimestamp()
+ 'expires' => $cookie->getExpiresTimestamp(),
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/FormData.php b/app/vendor/cakephp/cakephp/src/Http/Client/FormData.php
index 50e878f18..2b6124ae5 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/FormData.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/FormData.php
@@ -25,7 +25,6 @@
*/
class FormData implements Countable
{
-
/**
* Boundary marker.
*
@@ -231,7 +230,7 @@ public function contentType()
return 'application/x-www-form-urlencoded';
}
- return 'multipart/form-data; boundary="' . $this->boundary() . '"';
+ return 'multipart/form-data; boundary=' . $this->boundary();
}
/**
@@ -250,7 +249,7 @@ public function __toString()
$out .= (string)$part;
$out .= "\r\n";
}
- $out .= "--$boundary--\r\n\r\n";
+ $out .= "--$boundary--\r\n";
return $out;
}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/FormDataPart.php b/app/vendor/cakephp/cakephp/src/Http/Client/FormDataPart.php
index 6a5d4c892..d30f778d3 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/FormDataPart.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/FormDataPart.php
@@ -13,6 +13,9 @@
*/
namespace Cake\Http\Client;
+use Cake\Utility\Inflector;
+use Cake\Utility\Text;
+
/**
* Contains the data and behavior for a single
* part in a Multipart FormData request body.
@@ -24,7 +27,6 @@
*/
class FormDataPart
{
-
/**
* Name of the value.
*
@@ -74,18 +76,27 @@ class FormDataPart
*/
protected $_contentId;
+ /**
+ * The charset attribute for the Content-Disposition header fields
+ *
+ * @var string|null
+ */
+ protected $_charset;
+
/**
* Constructor
*
* @param string $name The name of the data.
* @param string $value The value of the data.
* @param string $disposition The type of disposition to use, defaults to form-data.
+ * @param string|null $charset The charset of the data.
*/
- public function __construct($name, $value, $disposition = 'form-data')
+ public function __construct($name, $value, $disposition = 'form-data', $charset = null)
{
$this->_name = $name;
$this->_value = $value;
$this->_disposition = $disposition;
+ $this->_charset = $charset;
}
/**
@@ -94,7 +105,7 @@ public function __construct($name, $value, $disposition = 'form-data')
* By passing in `false` you can disable the disposition
* header from being added.
*
- * @param null|string $disposition Use null to get/string to set.
+ * @param string|null $disposition Use null to get/string to set.
* @return string|null
*/
public function disposition($disposition = null)
@@ -108,7 +119,7 @@ public function disposition($disposition = null)
/**
* Get/set the contentId for a part.
*
- * @param null|string $id The content id.
+ * @param string|null $id The content id.
* @return string|null
*/
public function contentId($id = null)
@@ -125,7 +136,7 @@ public function contentId($id = null)
* Setting the filename to `false` will exclude it from the
* generated output.
*
- * @param null|string $filename Use null to get/string to set.
+ * @param string|null $filename Use null to get/string to set.
* @return string|null
*/
public function filename($filename = null)
@@ -139,7 +150,7 @@ public function filename($filename = null)
/**
* Get/set the content type.
*
- * @param null|string $type Use null to get/string to set.
+ * @param string|null $type Use null to get/string to set.
* @return string|null
*/
public function type($type)
@@ -155,7 +166,7 @@ public function type($type)
*
* Useful when content bodies are in encodings like base64.
*
- * @param null|string $type The type of encoding the value has.
+ * @param string|null $type The type of encoding the value has.
* @return string|null
*/
public function transferEncoding($type)
@@ -199,10 +210,10 @@ public function __toString()
if ($this->_disposition) {
$out .= 'Content-Disposition: ' . $this->_disposition;
if ($this->_name) {
- $out .= '; name="' . $this->_name . '"';
+ $out .= '; ' . $this->_headerParameterToString('name', $this->_name);
}
if ($this->_filename) {
- $out .= '; filename="' . $this->_filename . '"';
+ $out .= '; ' . $this->_headerParameterToString('filename', $this->_filename);
}
$out .= "\r\n";
}
@@ -220,6 +231,27 @@ public function __toString()
return $out;
}
+
+ /**
+ * Get the string for the header parameter.
+ *
+ * If the value contains non-ASCII letters an additional header indicating
+ * the charset encoding will be set.
+ *
+ * @param string $name The name of the header parameter
+ * @param string $value The value of the header parameter
+ * @return string
+ */
+ protected function _headerParameterToString($name, $value)
+ {
+ $transliterated = Text::transliterate(str_replace('"', '', $value));
+ $return = sprintf('%s="%s"', $name, $transliterated);
+ if ($this->_charset !== null && $value !== $transliterated) {
+ $return .= sprintf("; %s*=%s''%s", $name, strtolower($this->_charset), rawurlencode($value));
+ }
+
+ return $return;
+ }
}
// @deprecated 3.4.0 Add backwards compat alias.
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Message.php b/app/vendor/cakephp/cakephp/src/Http/Client/Message.php
index 5b6dccd5c..9ad5dc227 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Message.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Message.php
@@ -23,7 +23,6 @@
*/
class Message
{
-
/**
* HTTP 200 code
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Request.php b/app/vendor/cakephp/cakephp/src/Http/Client/Request.php
index b27686c84..1d259c538 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Request.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Request.php
@@ -14,9 +14,9 @@
namespace Cake\Http\Client;
use Cake\Core\Exception\Exception;
+use Laminas\Diactoros\RequestTrait;
+use Laminas\Diactoros\Stream;
use Psr\Http\Message\RequestInterface;
-use Zend\Diactoros\RequestTrait;
-use Zend\Diactoros\Stream;
/**
* Implements methods for HTTP requests.
@@ -45,7 +45,7 @@ public function __construct($url = '', $method = self::METHOD_GET, array $header
$this->uri = $this->createUri($url);
$headers += [
'Connection' => 'close',
- 'User-Agent' => 'CakePHP'
+ 'User-Agent' => 'CakePHP',
];
$this->addHeaders($headers);
$this->body($data);
diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Response.php b/app/vendor/cakephp/cakephp/src/Http/Client/Response.php
index 144ff9f81..3c9be24e6 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Client/Response.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Client/Response.php
@@ -17,10 +17,10 @@
// with the deprecated class in this namespace.
use Cake\Http\Cookie\CookieCollection as CookiesCollection;
use Cake\Http\Cookie\CookieInterface;
+use Laminas\Diactoros\MessageTrait;
+use Laminas\Diactoros\Stream;
use Psr\Http\Message\ResponseInterface;
use RuntimeException;
-use Zend\Diactoros\MessageTrait;
-use Zend\Diactoros\Stream;
/**
* Implements methods for HTTP responses.
@@ -240,12 +240,22 @@ public function isOk()
static::STATUS_CREATED,
static::STATUS_ACCEPTED,
static::STATUS_NON_AUTHORITATIVE_INFORMATION,
- static::STATUS_NO_CONTENT
+ static::STATUS_NO_CONTENT,
];
return in_array($this->code, $codes);
}
+ /**
+ * Check if the response status code was in the 2xx range
+ *
+ * @return bool
+ */
+ public function isSuccess()
+ {
+ return $this->code >= 200 && $this->code <= 299;
+ }
+
/**
* Check if the response had a redirect status code.
*
@@ -491,7 +501,7 @@ protected function convertCookieToArray(CookieInterface $cookie)
'domain' => $cookie->getDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->isHttpOnly(),
- 'expires' => $cookie->getFormattedExpires()
+ 'expires' => $cookie->getFormattedExpires(),
];
}
@@ -550,7 +560,7 @@ public function version()
* For example to get the json data as an object:
*
* ```
- * $body = $response->body('json_decode');
+ * $body = $response->getJson();
* ```
*
* @param callable|null $parser The callback to use to decode
@@ -610,7 +620,7 @@ protected function _getJson()
/**
* Get the response body as XML decoded data.
*
- * @return null|\SimpleXMLElement
+ * @return \SimpleXMLElement|null
*/
public function getXml()
{
@@ -620,7 +630,7 @@ public function getXml()
/**
* Get the response body as XML decoded data.
*
- * @return null|\SimpleXMLElement
+ * @return \SimpleXMLElement|null
*/
protected function _getXml()
{
diff --git a/app/vendor/cakephp/cakephp/src/Http/ControllerFactory.php b/app/vendor/cakephp/cakephp/src/Http/ControllerFactory.php
index 02b5343a1..6d5b06301 100644
--- a/app/vendor/cakephp/cakephp/src/Http/ControllerFactory.php
+++ b/app/vendor/cakephp/cakephp/src/Http/ControllerFactory.php
@@ -81,7 +81,8 @@ public function getControllerClass(ServerRequest $request)
// Disallow plugin short forms, / and \\ from
// controller names as they allow direct references to
// be created.
- if (strpos($controller, '\\') !== false ||
+ if (
+ strpos($controller, '\\') !== false ||
strpos($controller, '/') !== false ||
strpos($controller, '.') !== false ||
$firstChar === strtolower($firstChar)
@@ -105,7 +106,7 @@ protected function missingController($request)
'class' => $request->getParam('controller'),
'plugin' => $request->getParam('plugin'),
'prefix' => $request->getParam('prefix'),
- '_ext' => $request->getParam('_ext')
+ '_ext' => $request->getParam('_ext'),
]);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php b/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php
index 7d6f3bde6..0576de31c 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Cookie/Cookie.php
@@ -42,12 +42,11 @@
*
* @link https://tools.ietf.org/html/rfc6265
* @link https://en.wikipedia.org/wiki/HTTP_cookie
- * @see Cake\Http\Cookie\CookieCollection for working with collections of cookies.
- * @see Cake\Http\Response::getCookieCollection() for working with response cookies.
+ * @see \Cake\Http\Cookie\CookieCollection for working with collections of cookies.
+ * @see \Cake\Http\Response::getCookieCollection() for working with response cookies.
*/
class Cookie implements CookieInterface
{
-
/**
* Cookie name
*
@@ -104,6 +103,13 @@ class Cookie implements CookieInterface
*/
protected $httpOnly = false;
+ /**
+ * Samesite
+ *
+ * @var string|null
+ */
+ protected $sameSite = null;
+
/**
* Constructor
*
@@ -119,6 +125,8 @@ class Cookie implements CookieInterface
* @param string $domain Domain
* @param bool $secure Is secure
* @param bool $httpOnly HTTP Only
+ * @param string|null $sameSite Samesite
+ * @throws \InvalidArgumentException If an invalid value is passed for any of the arguments.
*/
public function __construct(
$name,
@@ -127,7 +135,8 @@ public function __construct(
$path = '/',
$domain = '',
$secure = false,
- $httpOnly = false
+ $httpOnly = false,
+ $sameSite = null
) {
$this->validateName($name);
$this->name = $name;
@@ -145,6 +154,12 @@ public function __construct(
$this->validateBool($secure);
$this->secure = $secure;
+
+ if ($sameSite) {
+ $this->validateSameSiteValue($sameSite);
+ $this->sameSite = $sameSite;
+ }
+
if ($expiresAt) {
$expiresAt = $expiresAt->setTimezone(new DateTimeZone('GMT'));
}
@@ -170,6 +185,9 @@ public function toHeaderValue()
if ($this->path !== '') {
$headerValue[] = sprintf('path=%s', $this->path);
}
+ if ($this->sameSite) {
+ $headerValue[] = sprintf('samesite=%s', $this->sameSite);
+ }
if ($this->domain !== '') {
$headerValue[] = sprintf('domain=%s', $this->domain);
}
@@ -467,6 +485,52 @@ public function withExpired()
return $new;
}
+ /**
+ * Get the SameSite attribute.
+ *
+ * @return string|null
+ */
+ public function getSameSite()
+ {
+ return $this->sameSite;
+ }
+
+ /**
+ * Create a cookie with an updated SameSite option.
+ *
+ * @param string|null $sameSite Value for to set for Samesite option.
+ * One of CookieInterface::SAMESITE_* constants.
+ * @return static
+ * @throws \InvalidArgumentException If argument value is not one of CookieInterface::SAMESITE_VALUES
+ */
+ public function withSameSite($sameSite = null)
+ {
+ if ($sameSite !== null) {
+ $this->validateSameSiteValue($sameSite);
+ }
+
+ $new = clone $this;
+ $new->sameSite = $sameSite;
+
+ return $new;
+ }
+
+ /**
+ * Check that value passed for SameSite is valid.
+ *
+ * @param string $sameSite SameSite value
+ * @return void
+ * @throws \InvalidArgumentException
+ */
+ protected static function validateSameSiteValue($sameSite)
+ {
+ if (!in_array($sameSite, CookieInterface::SAMESITE_VALUES, true)) {
+ throw new InvalidArgumentException(
+ 'SameSite value must be either of: ' . implode(', ', CookieInterface::SAMESITE_VALUES)
+ );
+ }
+ }
+
/**
* Checks if a value exists in the cookie data.
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php
index 1e91778f8..6a3b575c9 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieCollection.php
@@ -32,7 +32,6 @@
*/
class CookieCollection implements IteratorAggregate, Countable
{
-
/**
* Cookie objects
*
@@ -351,7 +350,7 @@ protected static function parseSetCookieHeader($values)
'secure' => false,
'httponly' => false,
'expires' => null,
- 'max-age' => null
+ 'max-age' => null,
];
foreach ($parts as $i => $part) {
if (strpos($part, '=') !== false) {
diff --git a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieInterface.php b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieInterface.php
index 3d752812f..3a5b42346 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Cookie/CookieInterface.php
@@ -15,10 +15,12 @@
/**
* Cookie Interface
+ *
+ * @method string|null getSameSite()
+ * @method static withSameSite($sameSite = null)
*/
interface CookieInterface
{
-
/**
* Expires attribute format.
*
@@ -26,6 +28,38 @@ interface CookieInterface
*/
const EXPIRES_FORMAT = 'D, d-M-Y H:i:s T';
+ /**
+ * SameSite attribute value: Lax
+ *
+ * @var string
+ */
+ const SAMESITE_LAX = 'Lax';
+
+ /**
+ * SameSite attribute value: Strict
+ *
+ * @var string
+ */
+ const SAMESITE_STRICT = 'Strict';
+
+ /**
+ * SameSite attribute value: None
+ *
+ * @var string
+ */
+ const SAMESITE_NONE = 'None';
+
+ /**
+ * Valid values for "SameSite" attribute.
+ *
+ * @var string[]
+ */
+ const SAMESITE_VALUES = [
+ self::SAMESITE_LAX,
+ self::SAMESITE_STRICT,
+ self::SAMESITE_NONE,
+ ];
+
/**
* Sets the cookie name
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/CorsBuilder.php b/app/vendor/cakephp/cakephp/src/Http/CorsBuilder.php
index cacbd4472..36918c334 100644
--- a/app/vendor/cakephp/cakephp/src/Http/CorsBuilder.php
+++ b/app/vendor/cakephp/cakephp/src/Http/CorsBuilder.php
@@ -30,7 +30,6 @@
*/
class CorsBuilder
{
-
/**
* The response object this builder is attached to.
*
@@ -175,7 +174,7 @@ public function allowCredentials()
/**
* Whitelist headers that can be sent in CORS requests.
*
- * @param array $headers The list of headers to accept in CORS requests.
+ * @param string[] $headers The list of headers to accept in CORS requests.
* @return $this
*/
public function allowHeaders(array $headers)
@@ -188,7 +187,7 @@ public function allowHeaders(array $headers)
/**
* Define the headers a client library/browser can expose to scripting
*
- * @param array $headers The list of headers to expose CORS responses
+ * @param string[] $headers The list of headers to expose CORS responses
* @return $this
*/
public function exposeHeaders(array $headers)
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/BadRequestException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/BadRequestException.php
index ea51c0d8e..62ff763cc 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/BadRequestException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/BadRequestException.php
@@ -17,7 +17,6 @@
*/
class BadRequestException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/ConflictException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/ConflictException.php
index ef561ebfd..b169c0c36 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/ConflictException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/ConflictException.php
@@ -17,7 +17,6 @@
*/
class ConflictException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/ForbiddenException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/ForbiddenException.php
index c22043490..b504ffdb2 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/ForbiddenException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/ForbiddenException.php
@@ -17,7 +17,6 @@
*/
class ForbiddenException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/GoneException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/GoneException.php
index 2da289d6f..09d9845bf 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/GoneException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/GoneException.php
@@ -17,7 +17,6 @@
*/
class GoneException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/InternalErrorException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/InternalErrorException.php
index 8d1adb6dd..872fccf72 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/InternalErrorException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/InternalErrorException.php
@@ -17,7 +17,6 @@
*/
class InternalErrorException extends HttpException
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/InvalidCsrfTokenException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/InvalidCsrfTokenException.php
index d8bde20eb..fe48b358c 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/InvalidCsrfTokenException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/InvalidCsrfTokenException.php
@@ -17,7 +17,6 @@
*/
class InvalidCsrfTokenException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/MethodNotAllowedException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/MethodNotAllowedException.php
index 887695337..fdae9b051 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/MethodNotAllowedException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/MethodNotAllowedException.php
@@ -17,7 +17,6 @@
*/
class MethodNotAllowedException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/NotAcceptableException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/NotAcceptableException.php
index 879adf5b2..31cecf098 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/NotAcceptableException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/NotAcceptableException.php
@@ -17,7 +17,6 @@
*/
class NotAcceptableException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/NotFoundException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/NotFoundException.php
index 3fb687e35..f7f55a149 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/NotFoundException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/NotFoundException.php
@@ -17,7 +17,6 @@
*/
class NotFoundException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/NotImplementedException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/NotImplementedException.php
index 024285204..9c9332108 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/NotImplementedException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/NotImplementedException.php
@@ -17,7 +17,6 @@
*/
class NotImplementedException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/ServiceUnavailableException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/ServiceUnavailableException.php
index 7e9614ca2..fd16851e4 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/ServiceUnavailableException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/ServiceUnavailableException.php
@@ -17,7 +17,6 @@
*/
class ServiceUnavailableException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/UnauthorizedException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/UnauthorizedException.php
index 77ee425d5..421b89824 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/UnauthorizedException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/UnauthorizedException.php
@@ -17,7 +17,6 @@
*/
class UnauthorizedException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Exception/UnavailableForLegalReasonsException.php b/app/vendor/cakephp/cakephp/src/Http/Exception/UnavailableForLegalReasonsException.php
index e99f3443e..5fa34beb9 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Exception/UnavailableForLegalReasonsException.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Exception/UnavailableForLegalReasonsException.php
@@ -17,7 +17,6 @@
*/
class UnavailableForLegalReasonsException extends HttpException
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/Middleware/CspMiddleware.php b/app/vendor/cakephp/cakephp/src/Http/Middleware/CspMiddleware.php
new file mode 100644
index 000000000..ab528e9de
--- /dev/null
+++ b/app/vendor/cakephp/cakephp/src/Http/Middleware/CspMiddleware.php
@@ -0,0 +1,72 @@
+csp = $csp;
+ }
+
+ /**
+ * Apply the middleware.
+ *
+ * This will inject the CSP header into the response.
+ *
+ * @param ServerRequestInterface $requestInterface The Request.
+ * @param ResponseInterface $responseInterface The Response.
+ * @param callable $next Callback to invoke the next middleware.
+ * @return \Psr\Http\Message\MessageInterface
+ */
+ public function __invoke(ServerRequestInterface $requestInterface, ResponseInterface $responseInterface, callable $next)
+ {
+ $response = $this->csp->injectCSPHeader($responseInterface);
+
+ return $next($requestInterface, $response, $next);
+ }
+}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php b/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php
index 4b11e35c6..5c6b410a7 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php
@@ -46,6 +46,7 @@ class CsrfProtectionMiddleware
* Defaults to browser session.
* - `secure` Whether or not the cookie will be set with the Secure flag. Defaults to false.
* - `httpOnly` Whether or not the cookie will be set with the HttpOnly flag. Defaults to false.
+ * - `samesite` Value for "SameSite" attribute. Default to null.
* - `field` The form field to check. Changing this will also require configuring
* FormHelper.
*
@@ -56,6 +57,7 @@ class CsrfProtectionMiddleware
'expiry' => 0,
'secure' => false,
'httpOnly' => false,
+ 'samesite' => null,
'field' => '_csrfToken',
];
@@ -95,7 +97,8 @@ public function __construct(array $config = [])
*/
public function __invoke(ServerRequest $request, Response $response, $next)
{
- if ($this->whitelistCallback !== null
+ if (
+ $this->whitelistCallback !== null
&& call_user_func($this->whitelistCallback, $request) === true
) {
return $next($request, $response);
@@ -104,7 +107,7 @@ public function __invoke(ServerRequest $request, Response $response, $next)
$cookies = $request->getCookieParams();
$cookieData = Hash::get($cookies, $this->_config['cookieName']);
- if (strlen($cookieData) > 0) {
+ if (is_string($cookieData) && strlen($cookieData) > 0) {
$params = $request->getAttribute('params');
$params['_csrfToken'] = $cookieData;
$request = $request->withAttribute('params', $params);
@@ -203,7 +206,8 @@ protected function _addTokenCookie($token, ServerRequest $request, Response $res
$request->getAttribute('webroot'),
'',
(bool)$this->_config['secure'],
- (bool)$this->_config['httpOnly']
+ (bool)$this->_config['httpOnly'],
+ isset($this->_config['samesite']) ? $this->_config['samesite'] : $this->_defaultConfig['samesite']
);
return $response->withCookie($cookie);
diff --git a/app/vendor/cakephp/cakephp/src/Http/Middleware/EncryptedCookieMiddleware.php b/app/vendor/cakephp/cakephp/src/Http/Middleware/EncryptedCookieMiddleware.php
index dbb4d3f51..991182972 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Middleware/EncryptedCookieMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Middleware/EncryptedCookieMiddleware.php
@@ -40,6 +40,7 @@ class EncryptedCookieMiddleware
/**
* The list of cookies to encrypt/decrypt
+ *
* @var array
*/
protected $cookieNames;
diff --git a/app/vendor/cakephp/cakephp/src/Http/Middleware/SecurityHeadersMiddleware.php b/app/vendor/cakephp/cakephp/src/Http/Middleware/SecurityHeadersMiddleware.php
index c86ee6484..82eeb4dd9 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Middleware/SecurityHeadersMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Middleware/SecurityHeadersMiddleware.php
@@ -21,7 +21,7 @@
/**
* Handles common security headers in a convenient way
*
- * @link https://book.cakephp.org/3.0/en/controllers/middleware.html#security-header-middleware
+ * @link https://book.cakephp.org/3/en/controllers/middleware.html#security-header-middleware
*/
class SecurityHeadersMiddleware
{
diff --git a/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php b/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php
index 7f12d3bb1..7e05983c1 100644
--- a/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php
+++ b/app/vendor/cakephp/cakephp/src/Http/MiddlewareQueue.php
@@ -87,7 +87,7 @@ protected function resolve($index)
$class
));
}
- $callable = new $className;
+ $callable = new $className();
} else {
$callable = $this->queue[$index];
}
@@ -174,9 +174,10 @@ public function insertAt($index, $middleware)
public function insertBefore($class, $middleware)
{
$found = false;
- $i = null;
+ $i = 0;
foreach ($this->queue as $i => $object) {
- if ((is_string($object) && $object === $class)
+ if (
+ (is_string($object) && $object === $class)
|| is_a($object, $class)
) {
$found = true;
@@ -203,9 +204,10 @@ public function insertBefore($class, $middleware)
public function insertAfter($class, $middleware)
{
$found = false;
- $i = null;
+ $i = 0;
foreach ($this->queue as $i => $object) {
- if ((is_string($object) && $object === $class)
+ if (
+ (is_string($object) && $object === $class)
|| is_a($object, $class)
) {
$found = true;
diff --git a/app/vendor/cakephp/cakephp/src/Http/RequestTransformer.php b/app/vendor/cakephp/cakephp/src/Http/RequestTransformer.php
index df89d29a2..cd1f59180 100644
--- a/app/vendor/cakephp/cakephp/src/Http/RequestTransformer.php
+++ b/app/vendor/cakephp/cakephp/src/Http/RequestTransformer.php
@@ -83,7 +83,7 @@ protected static function getParams(PsrRequest $request)
'controller' => null,
'action' => null,
'_ext' => null,
- 'pass' => []
+ 'pass' => [],
];
return $params;
diff --git a/app/vendor/cakephp/cakephp/src/Http/Response.php b/app/vendor/cakephp/cakephp/src/Http/Response.php
index 16b97bd8e..7fb615a37 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Response.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Response.php
@@ -27,21 +27,36 @@
use DateTimeInterface;
use DateTimeZone;
use InvalidArgumentException;
+use Laminas\Diactoros\MessageTrait;
+use Laminas\Diactoros\Stream;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
-use Zend\Diactoros\MessageTrait;
-use Zend\Diactoros\Stream;
/**
* Responses contain the response text, status and headers of a HTTP response.
+ *
+ * There are external packages such as `fig/http-message-util` that provide HTTP
+ * status code constants. These can be used with any method that accepts or
+ * returns a status code integer. Keep in mind that these consants might
+ * include status codes that are now allowed which will throw an
+ * `\InvalidArgumentException`.
*/
class Response implements ResponseInterface
{
-
use MessageTrait;
/**
- * Holds HTTP response statuses
+ * @var int
+ */
+ const STATUS_CODE_MIN = 100;
+
+ /**
+ * @var int
+ */
+ const STATUS_CODE_MAX = 599;
+
+ /**
+ * Allowed HTTP status codes and their default description.
*
* @var string[]
*/
@@ -340,7 +355,7 @@ class Response implements ResponseInterface
'mkv' => 'video/x-matroska',
'pkpass' => 'application/vnd.apple.pkpass',
'ajax' => 'text/html',
- 'bmp' => 'image/bmp'
+ 'bmp' => 'image/bmp',
];
/**
@@ -357,14 +372,6 @@ class Response implements ResponseInterface
*/
protected $_status = 200;
- /**
- * Content type to send. This can be an 'extension' that will be transformed using the $_mimetypes array
- * or a complete mime-type
- *
- * @var string
- */
- protected $_contentType = 'text/html';
-
/**
* File object for file to be read out as response
*
@@ -462,10 +469,11 @@ public function __construct(array $options = [])
$options['charset'] = Configure::read('App.encoding');
}
$this->_charset = $options['charset'];
+ $type = 'text/html';
if (isset($options['type'])) {
- $this->_contentType = $this->resolveType($options['type']);
+ $type = $this->resolveType($options['type']);
}
- $this->_setContentType();
+ $this->_setContentType($type);
$this->_cookies = new CookieCollection();
}
@@ -484,7 +492,7 @@ protected function _createStream()
* Will echo out the content in the response body.
*
* @return void
- * @deprecated 3.4.0 Will be removed in 4.0.0
+ * @deprecated 3.4.0 Will be removed in 4.0.0. Use Cake\Http\ResponseEmitter if required
*/
public function send()
{
@@ -502,7 +510,7 @@ public function send()
$this->_file = null;
$this->_fileRange = [];
} else {
- $this->_sendContent($this->body());
+ $this->_sendContent($this->getBody());
}
if (function_exists('fastcgi_finish_request')) {
@@ -532,7 +540,6 @@ public function sendHeaders()
$codeMessage = $this->_statusCodes[$this->_status];
$this->_setCookies();
$this->_sendHeader("{$this->_protocol} {$this->_status} {$codeMessage}");
- $this->_setContentType();
foreach ($this->headers as $header => $values) {
foreach ((array)$values as $value) {
@@ -572,9 +579,10 @@ protected function _setCookies()
* Formats the Content-Type header based on the configured contentType and charset
* the charset will only be set in the header if the response is of type text/*
*
+ * @param string $type The type to set.
* @return void
*/
- protected function _setContentType()
+ protected function _setContentType($type)
{
if (in_array($this->_status, [304, 204])) {
$this->_clearHeader('Content-Type');
@@ -582,20 +590,24 @@ protected function _setContentType()
return;
}
$whitelist = [
- 'application/javascript', 'application/xml', 'application/rss+xml'
+ 'application/javascript', 'application/xml', 'application/rss+xml',
];
$charset = false;
- if ($this->_charset &&
- (strpos($this->_contentType, 'text/') === 0 || in_array($this->_contentType, $whitelist))
+ if (
+ $this->_charset &&
+ (
+ strpos($type, 'text/') === 0 ||
+ in_array($type, $whitelist, true)
+ )
) {
$charset = true;
}
- if ($charset) {
- $this->_setHeader('Content-Type', "{$this->_contentType}; charset={$this->_charset}");
+ if ($charset && strpos($type, ';') === false) {
+ $this->_setHeader('Content-Type', "{$type}; charset={$this->_charset}");
} else {
- $this->_setHeader('Content-Type', (string)$this->_contentType);
+ $this->_setHeader('Content-Type', $type);
}
}
@@ -763,7 +775,7 @@ protected function getSimpleHeaders()
*
* Get/Set the Location header value.
*
- * @param null|string $url Either null to get the current location, or a string to set one.
+ * @param string|null $url Either null to get the current location, or a string to set one.
* @return string|null When setting the location null will be returned. When reading the location
* a string of the current location header value (if any) will be returned.
* @deprecated 3.4.0 Mutable responses are deprecated. Use `withLocation()` and `getHeaderLine()`
@@ -900,8 +912,8 @@ protected function _handleCallableBody(callable $content)
}
/**
- * Sets the HTTP status code to be sent
- * if $code is null the current code is returned
+ * Sets the HTTP status code to be sent.
+ * If $code is null the current code is returned
*
* If the status code is 304 or 204, the existing Content-Type header
* will be cleared, as these response codes have no body.
@@ -956,9 +968,15 @@ public function getStatusCode()
* If the status code is 304 or 204, the existing Content-Type header
* will be cleared, as these response codes have no body.
*
+ * There are external packages such as `fig/http-message-util` that provide HTTP
+ * status code constants. These can be used with any method that accepts or
+ * returns a status code integer. However, keep in mind that these consants
+ * might include status codes that are now allowed which will throw an
+ * `\InvalidArgumentException`.
+ *
* @link https://tools.ietf.org/html/rfc7231#section-6
* @link https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
- * @param int $code The 3-digit integer result code to set.
+ * @param int $code The 3-digit integer status code to set.
* @param string $reasonPhrase The reason phrase to use with the
* provided status code; if none is provided, implementations MAY
* use the defaults as suggested in the HTTP specification.
@@ -976,14 +994,14 @@ public function withStatus($code, $reasonPhrase = '')
/**
* Modifier for response status
*
- * @param int $code The code to set.
+ * @param int $code The status code to set.
* @param string $reasonPhrase The response reason phrase.
* @return void
* @throws \InvalidArgumentException For invalid status code arguments.
*/
protected function _setStatus($code, $reasonPhrase = '')
{
- if (!isset($this->_statusCodes[$code])) {
+ if ($code < static::STATUS_CODE_MIN || $code > static::STATUS_CODE_MAX) {
throw new InvalidArgumentException(sprintf(
'Invalid status code: %s. Use a valid HTTP status code in range 1xx - 5xx.',
$code
@@ -991,11 +1009,15 @@ protected function _setStatus($code, $reasonPhrase = '')
}
$this->_status = $code;
- if (empty($reasonPhrase)) {
+ if ($reasonPhrase === '' && isset($this->_statusCodes[$code])) {
$reasonPhrase = $this->_statusCodes[$code];
}
$this->_reasonPhrase = $reasonPhrase;
- $this->_setContentType();
+
+ // These status codes don't have bodies and can't have content-types.
+ if (in_array($code, [304, 204], true)) {
+ $this->_clearHeader('Content-Type');
+ }
}
/**
@@ -1042,7 +1064,6 @@ public function getReasonPhrase()
* ]); // throws an exception due to invalid codes
*
* For more on HTTP status codes see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
- *
* @return mixed Associative array of the HTTP codes as keys, and the message
* strings as values, or null of the given $code does not exist.
* @throws \InvalidArgumentException If an attempt is made to add an invalid status code
@@ -1133,8 +1154,7 @@ public function type($contentType = null)
if (strpos($contentType, '/') === false) {
return false;
}
- $this->_contentType = $contentType;
- $this->_setContentType();
+ $this->_setContentType($contentType);
return $contentType;
}
@@ -1162,7 +1182,12 @@ public function setTypeMap($type, $mimeType)
*/
public function getType()
{
- return $this->_contentType;
+ $header = $this->getHeaderLine('Content-Type');
+ if (strpos($header, ';') !== false) {
+ return explode(';', $header)[0];
+ }
+
+ return $header;
}
/**
@@ -1178,8 +1203,7 @@ public function withType($contentType)
{
$mappedType = $this->resolveType($contentType);
$new = clone $this;
- $new->_contentType = $mappedType;
- $new->_setContentType();
+ $new->_setContentType($mappedType);
return $new;
}
@@ -1263,7 +1287,7 @@ public function charset($charset = null)
return $this->_charset;
}
$this->_charset = $charset;
- $this->_setContentType();
+ $this->_setContentType($this->getType());
return $this->_charset;
}
@@ -1288,7 +1312,7 @@ public function withCharset($charset)
{
$new = clone $this;
$new->_charset = $charset;
- $new->_setContentType();
+ $new->_setContentType($this->getType());
return $new;
}
@@ -1346,7 +1370,7 @@ public function cache($since, $time = '+1 day')
}
}
- $this->_setHeader('Date', gmdate('D, j M Y G:i:s ', time()) . 'GMT');
+ $this->_setHeader('Date', gmdate('D, d M Y H:i:s ', time()) . 'GMT');
$this->modified($since);
$this->expires($time);
@@ -1371,7 +1395,7 @@ public function withCache($since, $time = '+1 day')
}
}
- return $this->withHeader('Date', gmdate('D, j M Y G:i:s ', time()) . 'GMT')
+ return $this->withHeader('Date', gmdate('D, d M Y H:i:s ', time()) . 'GMT')
->withModified($since)
->withExpires($time)
->withSharable(true)
@@ -1741,7 +1765,7 @@ public function notModified()
'Content-Length',
'Content-MD5',
'Content-Type',
- 'Last-Modified'
+ 'Last-Modified',
];
foreach ($remove as $header) {
$this->_clearHeader($header);
@@ -1768,7 +1792,7 @@ public function withNotModified()
'Content-Length',
'Content-MD5',
'Content-Type',
- 'Last-Modified'
+ 'Last-Modified',
];
foreach ($remove as $header) {
$new = $new->withoutHeader($header);
@@ -2183,7 +2207,7 @@ public function cookie($options = null)
'path' => '/',
'domain' => '',
'secure' => false,
- 'httpOnly' => false
+ 'httpOnly' => false,
];
$expires = $options['expire'] ? new DateTime('@' . $options['expire']) : null;
$cookie = new Cookie(
@@ -2246,7 +2270,8 @@ public function withCookie($name, $data = '')
'path' => '/',
'domain' => '',
'secure' => false,
- 'httpOnly' => false
+ 'httpOnly' => false,
+ 'samesite' => null,
];
$expires = $data['expire'] ? new DateTime('@' . $data['expire']) : null;
$cookie = new Cookie(
@@ -2256,7 +2281,8 @@ public function withCookie($name, $data = '')
$data['path'],
$data['domain'],
$data['secure'],
- $data['httpOnly']
+ $data['httpOnly'],
+ $data['samesite']
);
}
@@ -2307,7 +2333,7 @@ public function withExpiredCookie($name, $options = [])
'path' => '/',
'domain' => '',
'secure' => false,
- 'httpOnly' => false
+ 'httpOnly' => false,
];
$cookie = new Cookie(
@@ -2382,7 +2408,8 @@ protected function convertCookieToArray(CookieInterface $cookie)
'domain' => $cookie->getDomain(),
'secure' => $cookie->isSecure(),
'httpOnly' => $cookie->isHttpOnly(),
- 'expire' => $cookie->getExpiresTimestamp()
+ 'expire' => $cookie->getExpiresTimestamp(),
+ 'samesite' => $cookie->getSameSite(),
];
}
@@ -2444,9 +2471,9 @@ public function withCookieCollection(CookieCollection $cookieCollection)
* Instead the builder object should be used.
*
* @param \Cake\Http\ServerRequest $request Request object
- * @param string|array $allowedDomains List of allowed domains, see method description for more details
- * @param string|array $allowedMethods List of HTTP verbs allowed
- * @param string|array $allowedHeaders List of HTTP headers allowed
+ * @param string|string[] $allowedDomains List of allowed domains, see method description for more details
+ * @param string|string[] $allowedMethods List of HTTP verbs allowed
+ * @param string|string[] $allowedHeaders List of HTTP headers allowed
* @return \Cake\Http\CorsBuilder A builder object the provides a fluent interface for defining
* additional CORS headers.
*/
@@ -2512,7 +2539,7 @@ public function file($path, array $options = [])
$file = $this->validateFile($path);
$options += [
'name' => null,
- 'download' => null
+ 'download' => null,
];
$extension = strtolower($file->ext());
@@ -2580,7 +2607,7 @@ public function withFile($path, array $options = [])
$file = $this->validateFile($path);
$options += [
'name' => null,
- 'download' => null
+ 'download' => null,
];
$extension = strtolower($file->ext());
@@ -2857,7 +2884,7 @@ public function __debugInfo()
{
return [
'status' => $this->_status,
- 'contentType' => $this->_contentType,
+ 'contentType' => $this->getType(),
'headers' => $this->headers,
'file' => $this->_file,
'fileRange' => $this->_fileRange,
diff --git a/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php b/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php
index 72b60d082..81ab6d2e7 100644
--- a/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php
+++ b/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php
@@ -13,7 +13,6 @@
* @license https://opensource.org/licenses/mit-license.php MIT License
*
* Parts of this file are derived from Zend-Diactoros
- *
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (https://www.zend.com/)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
@@ -21,9 +20,9 @@
use Cake\Core\Configure;
use Cake\Log\Log;
+use Laminas\Diactoros\RelativeStream;
+use Laminas\Diactoros\Response\EmitterInterface;
use Psr\Http\Message\ResponseInterface;
-use Zend\Diactoros\RelativeStream;
-use Zend\Diactoros\Response\EmitterInterface;
/**
* Emits a Response to the PHP Server API.
@@ -41,6 +40,9 @@ class ResponseEmitter implements EmitterInterface
{
/**
* {@inheritDoc}
+ *
+ * @param \Psr\Http\Message\ResponseInterface $response Response
+ * @param int $maxBufferLength Max buffer length
*/
public function emit(ResponseInterface $response, $maxBufferLength = 8192)
{
@@ -200,14 +202,15 @@ protected function emitCookies(array $cookies)
{
foreach ($cookies as $cookie) {
if (is_array($cookie)) {
- setcookie(
+ $options = $cookie;
+ $options['httponly'] = $options['httpOnly'];
+ $options['expires'] = $options['expire'];
+ unset($options['name'], $options['value'], $options['httpOnly'], $options['expire']);
+
+ $this->setcookie(
$cookie['name'],
$cookie['value'],
- $cookie['expire'],
- $cookie['path'],
- $cookie['domain'],
- $cookie['secure'],
- $cookie['httpOnly']
+ $options
);
continue;
}
@@ -220,40 +223,70 @@ protected function emitCookies(array $cookies)
}
list($name, $value) = explode('=', array_shift($parts), 2);
+ $name = urldecode($name);
+ $value = urldecode($value);
$data = [
- 'name' => urldecode($name),
- 'value' => urldecode($value),
'expires' => 0,
'path' => '',
'domain' => '',
'secure' => false,
- 'httponly' => false
+ 'httponly' => false,
+ 'samesite' => null,
];
foreach ($parts as $part) {
if (strpos($part, '=') !== false) {
- list($key, $value) = explode('=', $part);
+ list($key, $val) = explode('=', $part);
} else {
$key = $part;
- $value = true;
+ $val = true;
}
$key = strtolower($key);
- $data[$key] = $value;
+ $data[$key] = $val;
}
- if (!empty($data['expires'])) {
+ if (is_string($data['expires'])) {
$data['expires'] = strtotime($data['expires']);
}
+ unset($data['']);
+
+ $this->setcookie($name, $value, $data);
+ }
+ }
+
+ /**
+ * Set cookies uses setcookie()
+ *
+ * @param string $name Cookie name.
+ * @param string $value Cookie value.
+ * @param array $options Cookie options.
+ * @return void
+ */
+ protected function setcookie($name, $value, array $options)
+ {
+ if (PHP_VERSION_ID >= 70300) {
setcookie(
- $data['name'],
- $data['value'],
- $data['expires'],
- $data['path'],
- $data['domain'],
- $data['secure'],
- $data['httponly']
+ $name,
+ $value,
+ $options
);
+
+ return;
+ }
+
+ if (!empty($options['samesite'])) {
+ $options['path'] .= '; SameSite=' . $options['samesite'];
}
+
+ setcookie(
+ $name,
+ $value,
+ $options['expires'],
+ $options['path'],
+ $options['domain'],
+ $options['secure'],
+ $options['httponly']
+ );
}
/**
@@ -279,7 +312,7 @@ protected function flush($maxBufferLevel = null)
* https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
*
* @param string $header The Content-Range header to parse.
- * @return false|array [unit, first, last, length]; returns false if no
+ * @return array|false [unit, first, last, length]; returns false if no
* content range or an invalid content range is provided
*/
protected function parseContentRange($header)
diff --git a/app/vendor/cakephp/cakephp/src/Http/ResponseTransformer.php b/app/vendor/cakephp/cakephp/src/Http/ResponseTransformer.php
index 58363baae..3bdac5113 100644
--- a/app/vendor/cakephp/cakephp/src/Http/ResponseTransformer.php
+++ b/app/vendor/cakephp/cakephp/src/Http/ResponseTransformer.php
@@ -188,7 +188,7 @@ protected static function setContentType($headers, $response)
}
$whitelist = [
- 'application/javascript', 'application/json', 'application/xml', 'application/rss+xml'
+ 'application/javascript', 'application/json', 'application/xml', 'application/rss+xml',
];
$type = $response->type();
@@ -219,7 +219,7 @@ protected static function buildCookieHeader($cookies)
$headers = [];
foreach ($cookies as $cookie) {
$parts = [
- sprintf('%s=%s', urlencode($cookie['name']), urlencode($cookie['value']))
+ sprintf('%s=%s', urlencode($cookie['name']), urlencode($cookie['value'])),
];
if ($cookie['expire']) {
$cookie['expire'] = gmdate('D, d M Y H:i:s T', $cookie['expire']);
diff --git a/app/vendor/cakephp/cakephp/src/Http/Server.php b/app/vendor/cakephp/cakephp/src/Http/Server.php
index 874d6ec70..ac286f3de 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Server.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Server.php
@@ -20,17 +20,16 @@
use Cake\Event\EventDispatcherTrait;
use Cake\Event\EventManager;
use InvalidArgumentException;
+use Laminas\Diactoros\Response\EmitterInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use RuntimeException;
-use Zend\Diactoros\Response\EmitterInterface;
/**
* Runs an application invoking all the PSR7 middleware and the registered application.
*/
class Server implements EventDispatcherInterface
{
-
/**
* Alias methods away so we can implement proxying methods.
*/
@@ -129,7 +128,7 @@ protected function bootstrap()
* Emit the response using the PHP SAPI.
*
* @param \Psr\Http\Message\ResponseInterface $response The response to emit
- * @param \Zend\Diactoros\Response\EmitterInterface|null $emitter The emitter to use.
+ * @param \Laminas\Diactoros\Response\EmitterInterface|null $emitter The emitter to use.
* When null, a SAPI Stream Emitter will be used.
* @return void
*/
diff --git a/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php b/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php
index a67191b30..87014b205 100644
--- a/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php
+++ b/app/vendor/cakephp/cakephp/src/Http/ServerRequest.php
@@ -22,13 +22,13 @@
use Cake\Http\Session;
use Cake\Utility\Hash;
use InvalidArgumentException;
+use Laminas\Diactoros\PhpInputStream;
+use Laminas\Diactoros\Stream;
+use Laminas\Diactoros\UploadedFile;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;
use Psr\Http\Message\UriInterface;
-use Zend\Diactoros\PhpInputStream;
-use Zend\Diactoros\Stream;
-use Zend\Diactoros\UploadedFile;
/**
* A class that helps wrap Request information and particulars about a single request.
@@ -36,7 +36,6 @@
*/
class ServerRequest implements ArrayAccess, ServerRequestInterface
{
-
/**
* Array of parameters parsed from the URL.
*
@@ -48,7 +47,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
'controller' => null,
'action' => null,
'_ext' => null,
- 'pass' => []
+ 'pass' => [],
];
/**
@@ -56,7 +55,7 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
* In PUT/PATCH/DELETE requests this property will contain the form-urlencoded
* data.
*
- * @var null|array|object
+ * @var array|object|null
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use getData() instead.
*/
protected $data = [];
@@ -243,6 +242,13 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
'here' => ['get' => 'getAttribute("here")', 'set' => 'withAttribute("here")'],
];
+ /**
+ * Whether to merge file uploads as objects (`true`) or arrays (`false`).
+ *
+ * @var bool
+ */
+ private $mergeFilesAsObjects = false;
+
/**
* Wrapper method to create a new request from PHP superglobals.
*
@@ -281,6 +287,7 @@ public static function createFromGlobals()
* - `input` The data that would come from php://input this is useful for simulating
* requests with put, patch or delete data.
* - `session` An instance of a Session object
+ * - `mergeFilesAsObjects` Whether to merge file uploads as objects (`true`) or arrays (`false`).
*
* @param string|array $config An array of request data to create a request with.
* The string version of this argument is *deprecated* and will be removed in 4.0.0
@@ -302,6 +309,7 @@ public function __construct($config = [])
'base' => '',
'webroot' => '',
'input' => null,
+ 'mergeFilesAsObjects' => false,
];
$this->_setConfig($config);
@@ -321,7 +329,7 @@ protected function _setConfig($config)
if (empty($config['session'])) {
$config['session'] = new Session([
- 'cookiePath' => $config['base']
+ 'cookiePath' => $config['base'],
]);
}
@@ -364,6 +372,8 @@ protected function _setConfig($config)
}
$this->stream = $stream;
+ $this->mergeFilesAsObjects = $config['mergeFilesAsObjects'];
+
$config['post'] = $this->_processPost($config['post']);
$this->data = $this->_processFiles($config['post'], $config['files']);
$this->query = $this->_processGet($config['query'], $querystr);
@@ -384,7 +394,8 @@ protected function _processPost($data)
$method = $this->getEnv('REQUEST_METHOD');
$override = false;
- if (in_array($method, ['PUT', 'DELETE', 'PATCH']) &&
+ if (
+ in_array($method, ['PUT', 'DELETE', 'PATCH'], true) &&
strpos($this->contentType(), 'application/x-www-form-urlencoded') === 0
) {
$data = $this->input();
@@ -401,7 +412,7 @@ protected function _processPost($data)
$override = true;
}
- if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'])) {
+ if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
$data = [];
}
@@ -436,7 +447,10 @@ protected function _processGet($query, $queryString = '')
*/
protected function _processFiles($post, $files)
{
- if (!is_array($files)) {
+ if (
+ empty($files) ||
+ !is_array($files)
+ ) {
return $post;
}
$fileData = [];
@@ -458,6 +472,10 @@ protected function _processFiles($post, $files)
}
$this->uploadedFiles = $fileData;
+ if ($this->mergeFilesAsObjects) {
+ return Hash::merge($post, $fileData);
+ }
+
// Make a flat map that can be inserted into $post for BC.
$fileMap = Hash::flatten($fileData);
foreach ($fileMap as $key => $file) {
@@ -689,7 +707,6 @@ public function __call($name, $params)
/**
* Magic set method allows backward compatibility for former public properties
*
- *
* @param string $name The property being accessed.
* @param mixed $value The property value.
* @return mixed Either the value of the parameter or null.
@@ -782,17 +799,21 @@ public function __isset($name)
* defined with Cake\Http\ServerRequest::addDetector(). Any detector can be called
* as `is($type)` or `is$Type()`.
*
- * @param string|array $type The type of request you want to check. If an array
+ * @param string|string[] $type The type of request you want to check. If an array
* this method will return true if the request matches any type.
- * @param array ...$args List of arguments
+ * @param mixed ...$args List of arguments
* @return bool Whether or not the request is the type you are checking.
*/
public function is($type, ...$args)
{
if (is_array($type)) {
- $result = array_map([$this, 'is'], $type);
+ foreach ($type as $_type) {
+ if ($this->is($_type)) {
+ return true;
+ }
+ }
- return count(array_filter($result)) > 0;
+ return false;
}
$type = strtolower($type);
@@ -949,9 +970,13 @@ protected function _environmentDetector($detect)
*/
public function isAll(array $types)
{
- $result = array_filter(array_map([$this, 'is'], $types));
+ foreach ($types as $type) {
+ if (!$this->is($type)) {
+ return false;
+ }
+ }
- return count($result) === count($types);
+ return true;
}
/**
@@ -1120,7 +1145,7 @@ public function here($base = true)
protected function normalizeHeaderName($name)
{
$name = str_replace('-', '_', strtoupper($name));
- if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'])) {
+ if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
$name = 'HTTP_' . $name;
}
@@ -1336,7 +1361,8 @@ public function withMethod($method)
{
$new = clone $this;
- if (!is_string($method) ||
+ if (
+ !is_string($method) ||
!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)
) {
throw new InvalidArgumentException(sprintf(
@@ -1497,7 +1523,7 @@ public function accepts($type = null)
return $accept;
}
- return in_array($type, $accept);
+ return in_array($type, $accept, true);
}
/**
@@ -1545,7 +1571,7 @@ public function acceptLanguage($language = null)
return $accept;
}
- return in_array(strtolower($language), $accept);
+ return in_array(strtolower($language), $accept, true);
}
/**
@@ -1625,7 +1651,7 @@ public function query($name = null)
*
* @param string|null $name The name or dotted path to the query param or null to read all.
* @param mixed $default The default value if the named parameter is not set, and $name is not null.
- * @return null|string|array Query data.
+ * @return array|string|null Query data.
* @see ServerRequest::getQueryParams()
*/
public function getQuery($name = null, $default = null)
@@ -1703,7 +1729,7 @@ public function data($name = null, ...$args)
*
* @param string|null $name Dot separated name of the value to read. Or null to read all data.
* @param mixed $default The default data.
- * @return null|string|array The value being read.
+ * @return array|string|null The value being read.
*/
public function getData($name = null, $default = null)
{
@@ -1783,7 +1809,7 @@ public function input($callback = null, ...$args)
* Read cookie data from the request's cookie data.
*
* @param string $key The key you want to read.
- * @return null|string Either the cookie value, or null if the value doesn't exist.
+ * @return string|null Either the cookie value, or null if the value doesn't exist.
* @deprecated 3.4.0 Use getCookie() instead.
*/
public function cookie($key)
@@ -1805,7 +1831,7 @@ public function cookie($key)
*
* @param string $key The key or dotted path you want to read.
* @param string $default The default value if the cookie is not set.
- * @return null|array|string Either the cookie value, or null if the value doesn't exist.
+ * @return string|array|null Either the cookie value, or null if the value doesn't exist.
*/
public function getCookie($key, $default = null)
{
@@ -1883,7 +1909,7 @@ public function withCookieParams(array $cookies)
* post data. For other content types, it may be the deserialized request
* body.
*
- * @return null|array|object The deserialized body parameters, if any.
+ * @return object|array|null The deserialized body parameters, if any.
* These will typically be an array or object.
*/
public function getParsedBody()
@@ -1894,7 +1920,7 @@ public function getParsedBody()
/**
* Update the parsed body and get a new instance.
*
- * @param null|array|object $data The deserialized body data. This will
+ * @param object|array|null $data The deserialized body data. This will
* typically be in an array or object.
* @return static
*/
@@ -2228,7 +2254,7 @@ public function getAttributes()
'params' => $this->params,
'webroot' => $this->webroot,
'base' => $this->base,
- 'here' => $this->here
+ 'here' => $this->here,
];
return $this->attributes + $emulated;
@@ -2238,7 +2264,7 @@ public function getAttributes()
* Get the uploaded file from a dotted path.
*
* @param string $path The dot separated path to the file you want.
- * @return null|\Psr\Http\Message\UploadedFileInterface
+ * @return \Psr\Http\Message\UploadedFileInterface|null
*/
public function getUploadedFile($path)
{
diff --git a/app/vendor/cakephp/cakephp/src/Http/ServerRequestFactory.php b/app/vendor/cakephp/cakephp/src/Http/ServerRequestFactory.php
index daaf20f51..707322872 100644
--- a/app/vendor/cakephp/cakephp/src/Http/ServerRequestFactory.php
+++ b/app/vendor/cakephp/cakephp/src/Http/ServerRequestFactory.php
@@ -16,7 +16,7 @@
use Cake\Core\Configure;
use Cake\Utility\Hash;
-use Zend\Diactoros\ServerRequestFactory as BaseFactory;
+use Laminas\Diactoros\ServerRequestFactory as BaseFactory;
/**
* Factory for making ServerRequest instances.
@@ -41,7 +41,7 @@ public static function fromGlobals(
$uri = static::createUri($server);
$sessionConfig = (array)Configure::read('Session') + [
'defaults' => 'php',
- 'cookiePath' => $uri->webroot
+ 'cookiePath' => $uri->webroot,
];
$session = Session::create($sessionConfig);
$request = new ServerRequest([
@@ -54,6 +54,7 @@ public static function fromGlobals(
'webroot' => $uri->webroot,
'base' => $uri->base,
'session' => $session,
+ 'mergeFilesAsObjects' => Configure::read('App.uploadedFilesAsObjects', false),
]);
return $request;
@@ -132,7 +133,8 @@ protected static function updatePath($base, $uri)
}
$endsWithIndex = '/' . (Configure::read('App.webroot') ?: 'webroot') . '/index.php';
$endsWithLength = strlen($endsWithIndex);
- if (strlen($path) >= $endsWithLength &&
+ if (
+ strlen($path) >= $endsWithLength &&
substr($path, -$endsWithLength) === $endsWithIndex
) {
$path = '/';
@@ -153,7 +155,7 @@ protected static function getBase($uri, $server)
$config = (array)Configure::read('App') + [
'base' => null,
'webroot' => null,
- 'baseUrl' => null
+ 'baseUrl' => null,
];
$base = $config['base'];
$baseUrl = $config['baseUrl'];
diff --git a/app/vendor/cakephp/cakephp/src/Http/Session.php b/app/vendor/cakephp/cakephp/src/Http/Session.php
index 1f2a94992..20ba16a23 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Session.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Session.php
@@ -35,7 +35,6 @@
*/
class Session
{
-
/**
* The Session handler instance used as an engine for persisting the session data.
*
@@ -142,7 +141,7 @@ protected static function _defaultConfig($name)
'cookie' => 'CAKEPHP',
'ini' => [
'session.use_trans_sid' => 0,
- ]
+ ],
],
'cake' => [
'cookie' => 'CAKEPHP',
@@ -151,8 +150,8 @@ protected static function _defaultConfig($name)
'session.serialize_handler' => 'php',
'session.use_cookies' => 1,
'session.save_path' => TMP . 'sessions',
- 'session.save_handler' => 'files'
- ]
+ 'session.save_handler' => 'files',
+ ],
],
'cache' => [
'cookie' => 'CAKEPHP',
@@ -163,8 +162,8 @@ protected static function _defaultConfig($name)
],
'handler' => [
'engine' => 'CacheSession',
- 'config' => 'default'
- ]
+ 'config' => 'default',
+ ],
],
'database' => [
'cookie' => 'CAKEPHP',
@@ -175,9 +174,9 @@ protected static function _defaultConfig($name)
'session.serialize_handler' => 'php',
],
'handler' => [
- 'engine' => 'DatabaseSession'
- ]
- ]
+ 'engine' => 'DatabaseSession',
+ ],
+ ],
];
if (isset($defaults[$name])) {
@@ -421,7 +420,7 @@ public function check($name = null)
* Returns given session variable, or all of them, if no parameters given.
*
* @param string|null $name The name of the session variable (or a path as sent to Hash.extract)
- * @return string|array|null The value of the session variable, null if session not available,
+ * @return mixed|null The value of the session variable, null if session not available,
* session not started, or provided name not found in the session.
*/
public function read($name = null)
@@ -605,17 +604,27 @@ public function renew()
$this->start();
$params = session_get_cookie_params();
- setcookie(
- session_name(),
- '',
- time() - 42000,
- $params['path'],
- $params['domain'],
- $params['secure'],
- $params['httponly']
- );
-
- if (session_id()) {
+ if (PHP_VERSION_ID >= 70300) {
+ unset($params['lifetime']);
+ $params['expires'] = time() - 42000;
+ setcookie(
+ session_name(),
+ '',
+ $params
+ );
+ } else {
+ setcookie(
+ session_name(),
+ '',
+ time() - 42000,
+ $params['path'],
+ $params['domain'],
+ $params['secure'],
+ $params['httponly']
+ );
+ }
+
+ if (session_id() !== '') {
session_regenerate_id(true);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Http/Session/CacheSession.php b/app/vendor/cakephp/cakephp/src/Http/Session/CacheSession.php
index 250567f2a..ab05b4e81 100644
--- a/app/vendor/cakephp/cakephp/src/Http/Session/CacheSession.php
+++ b/app/vendor/cakephp/cakephp/src/Http/Session/CacheSession.php
@@ -27,7 +27,6 @@
*/
class CacheSession implements SessionHandlerInterface
{
-
/**
* Options for this session engine
*
@@ -41,7 +40,6 @@ class CacheSession implements SessionHandlerInterface
* @param array $config The configuration to use for this engine
* It requires the key 'config' which is the name of the Cache config to use for
* storing the session
- *
* @throws \InvalidArgumentException if the 'config' key is not provided
*/
public function __construct(array $config = [])
@@ -77,7 +75,7 @@ public function close()
/**
* Method used to read from a cache session.
*
- * @param string|int $id ID that uniquely identifies session in cache.
+ * @param string $id ID that uniquely identifies session in cache.
* @return string Session data or empty string if it does not exist.
*/
public function read($id)
@@ -94,8 +92,8 @@ public function read($id)
/**
* Helper function called on write for cache sessions.
*
- * @param string|int $id ID that uniquely identifies session in cache.
- * @param mixed $data The data to be saved.
+ * @param string $id ID that uniquely identifies session in cache.
+ * @param string $data The data to be saved.
* @return bool True for successful write, false otherwise.
*/
public function write($id, $data)
@@ -110,7 +108,7 @@ public function write($id, $data)
/**
* Method called on the destruction of a cache session.
*
- * @param string|int $id ID that uniquely identifies session in cache.
+ * @param string $id ID that uniquely identifies session in cache.
* @return bool Always true.
*/
public function destroy($id)
diff --git a/app/vendor/cakephp/cakephp/src/I18n/ChainMessagesLoader.php b/app/vendor/cakephp/cakephp/src/I18n/ChainMessagesLoader.php
index 9b613013d..4557c69bb 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/ChainMessagesLoader.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/ChainMessagesLoader.php
@@ -23,7 +23,6 @@
*/
class ChainMessagesLoader
{
-
/**
* The list of callables to execute one after another for loading messages
*
diff --git a/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php b/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php
index ba34a505a..423d1a7a1 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php
@@ -26,7 +26,6 @@
*/
trait DateFormatTrait
{
-
/**
* The default locale to be used for displaying formatted date strings.
*
@@ -35,6 +34,15 @@ trait DateFormatTrait
*/
public static $defaultLocale;
+ /**
+ * Whether lenient parsing is enabled for IntlDateFormatter.
+ *
+ * Defaults to true which is the default for IntlDateFormatter.
+ *
+ * @var bool
+ */
+ protected static $lenientParsing = true;
+
/**
* In-memory cache of date formatters
*
@@ -53,7 +61,7 @@ trait DateFormatTrait
* will be used for formatting the date part of the object and the second position
* will be used to format the time part.
*
- * @var string|array|int
+ * @var string|array|int|\Closure
* @see \Cake\I18n\Time::i18nFormat()
*/
protected static $_jsonEncodeFormat = "yyyy-MM-dd'T'HH':'mm':'ssxxx";
@@ -78,6 +86,8 @@ public static function getDefaultLocale()
/**
* Sets the default locale.
*
+ * Set to null to use IntlDateFormatter default.
+ *
* @param string|null $locale The default locale string to be used or null.
* @return void
*/
@@ -86,6 +96,36 @@ public static function setDefaultLocale($locale = null)
static::$defaultLocale = $locale;
}
+ /**
+ * Gets whether locale format parsing is set to lenient.
+ *
+ * @return bool
+ */
+ public static function lenientParsingEnabled()
+ {
+ return static::$lenientParsing;
+ }
+
+ /**
+ * Enables lenient parsing for locale formats.
+ *
+ * @return void
+ */
+ public static function enableLenientParsing()
+ {
+ static::$lenientParsing = true;
+ }
+
+ /**
+ * Enables lenient parsing for locale formats.
+ *
+ * @return void
+ */
+ public static function disableLenientParsing()
+ {
+ static::$lenientParsing = false;
+ }
+
/**
* Returns a nicely formatted date string for this object.
*
@@ -99,7 +139,7 @@ public static function setDefaultLocale($locale = null)
*/
public function nice($timezone = null, $locale = null)
{
- return $this->i18nFormat(static::$niceFormat, $timezone, $locale);
+ return (string)$this->i18nFormat(static::$niceFormat, $timezone, $locale);
}
/**
@@ -148,7 +188,7 @@ public function nice($timezone = null, $locale = null)
* You can control the default locale used through `Time::setDefaultLocale()`.
* If empty, the default will be taken from the `intl.default_locale` ini config.
*
- * @param string|int|null $format Format string.
+ * @param string|int|array|null $format Format string.
* @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object
* in which the date will be displayed. The timezone stored for this object will not
* be changed.
@@ -179,7 +219,7 @@ public function i18nFormat($format = null, $timezone = null, $locale = null)
* Returns a translated and localized date string.
* Implements what IntlDateFormatter::formatObject() is in PHP 5.5+
*
- * @param \DateTime $date Date.
+ * @param \DateTime|\DateTimeImmutable $date Date.
* @param string|int|array $format Format.
* @param string|null $locale The locale name in which the date should be displayed.
* @return string
@@ -218,11 +258,11 @@ protected function _formatObject($date, $format, $locale)
}
$formatter = datefmt_create(
$locale,
- $dateFormat,
- $timeFormat,
+ (int)$dateFormat,
+ (int)$timeFormat,
$timezone,
$calendar,
- $pattern
+ (string)$pattern
);
if (!$formatter) {
throw new RuntimeException(
@@ -241,7 +281,7 @@ protected function _formatObject($date, $format, $locale)
*/
public function __toString()
{
- return $this->i18nFormat();
+ return (string)$this->i18nFormat();
}
/**
@@ -285,8 +325,11 @@ public static function setToStringFormat($format)
* will be used for formatting the date part of the object and the second position
* will be used to format the time part.
*
+ * Alternatively, the format can provide a callback. In this case, the callback
+ * can receive this datetime object and return a formatted string.
+ *
* @see \Cake\I18n\Time::i18nFormat()
- * @param string|array|int $format Format.
+ * @param string|array|int|\Closure $format Format.
* @return void
*/
public static function setJsonEncodeFormat($format)
@@ -344,6 +387,8 @@ public static function parseDateTime($time, $format = null)
null,
$pattern
);
+ $formatter->setLenient(static::$lenientParsing);
+
$time = $formatter->parse($time);
if ($time !== false) {
$result = new static('@' . $time);
@@ -423,6 +468,10 @@ public static function parseTime($time, $format = null)
*/
public function jsonSerialize()
{
+ if (is_callable(static::$_jsonEncodeFormat)) {
+ return call_user_func(static::$_jsonEncodeFormat, $this);
+ }
+
return $this->i18nFormat(static::$_jsonEncodeFormat);
}
@@ -454,9 +503,9 @@ public static function diffFormatter($formatter = null)
public function __debugInfo()
{
return [
- 'time' => $this->toIso8601String(),
+ 'time' => $this->format('Y-m-d H:i:s.uP'),
'timezone' => $this->getTimezone()->getName(),
- 'fixedNowTime' => static::hasTestNow() ? static::getTestNow()->toIso8601String() : false
+ 'fixedNowTime' => static::hasTestNow() ? static::getTestNow()->format('Y-m-d\TH:i:s.uP') : false,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php b/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php
index c0cd00d02..e02d5264f 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php
@@ -24,7 +24,6 @@
*/
class IcuFormatter implements FormatterInterface
{
-
/**
* Returns a string with all passed variables interpolated into the original
* message. Variables are interpolated using the MessageFormatter class.
@@ -37,25 +36,6 @@ class IcuFormatter implements FormatterInterface
* @throws \Aura\Intl\Exception\CannotInstantiateFormatter
*/
public function format($locale, $message, array $vars)
- {
- unset($vars['_singular'], $vars['_count']);
-
- return $this->_formatMessage($locale, $message, $vars);
- }
-
- /**
- * Does the actual formatting using the MessageFormatter class
- *
- * @param string $locale The locale in which the message is presented.
- * @param string|array $message The message to be translated
- * @param array $vars The list of values to interpolate in the message
- * @return string The formatted message
- * @throws \Aura\Intl\Exception\CannotInstantiateFormatter if any error occurred
- * while parsing the message
- * @throws \Aura\Intl\Exception\CannotFormat If any error related to the passed
- * variables is found
- */
- protected function _formatMessage($locale, $message, $vars)
{
if ($message === '') {
return $message;
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Formatter/SprintfFormatter.php b/app/vendor/cakephp/cakephp/src/I18n/Formatter/SprintfFormatter.php
index 2cb8d5dc3..460d7d3c8 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Formatter/SprintfFormatter.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Formatter/SprintfFormatter.php
@@ -22,7 +22,6 @@
*/
class SprintfFormatter implements FormatterInterface
{
-
/**
* Returns a string with all passed variables interpolated into the original
* message. Variables are interpolated using the sprintf format.
@@ -34,8 +33,6 @@ class SprintfFormatter implements FormatterInterface
*/
public function format($locale, $message, array $vars)
{
- unset($vars['_singular']);
-
return vsprintf($message, $vars);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php b/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php
index 7181d3fdc..61909ac17 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/FrozenTime.php
@@ -111,7 +111,7 @@ public function __construct($time = null, $tz = null)
{
if ($time instanceof DateTimeInterface) {
$tz = $time->getTimezone();
- $time = $time->format('Y-m-d H:i:s');
+ $time = $time->format('Y-m-d H:i:s.u');
}
if (is_numeric($time)) {
diff --git a/app/vendor/cakephp/cakephp/src/I18n/I18n.php b/app/vendor/cakephp/cakephp/src/I18n/I18n.php
index 8f18f529b..db3248652 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/I18n.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/I18n.php
@@ -26,7 +26,6 @@
*/
class I18n
{
-
/**
* Default locale
*
@@ -62,7 +61,7 @@ public static function translators()
}
static::$_collection = new TranslatorRegistry(
- new PackageLocator,
+ new PackageLocator(),
new FormatterLocator([
'sprintf' => function () {
return new SprintfFormatter();
@@ -71,7 +70,7 @@ public static function translators()
return new IcuFormatter();
},
]),
- new TranslatorFactory,
+ new TranslatorFactory(),
static::getLocale()
);
diff --git a/app/vendor/cakephp/cakephp/src/I18n/MessagesFileLoader.php b/app/vendor/cakephp/cakephp/src/I18n/MessagesFileLoader.php
index 33cb7c7b0..f98691bef 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/MessagesFileLoader.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/MessagesFileLoader.php
@@ -29,7 +29,6 @@
*/
class MessagesFileLoader
{
-
/**
* The package (domain) name.
*
@@ -135,7 +134,7 @@ public function __invoke()
throw new RuntimeException(sprintf('Could not find class %s', "{$name}FileParser"));
}
- $messages = (new $class)->parse($file);
+ $messages = (new $class())->parse($file);
$package = new Package('default');
$package->setMessages($messages);
@@ -146,7 +145,7 @@ public function __invoke()
* Returns the folders where the file should be looked for according to the locale
* and package name.
*
- * @return array The list of folders where the translation file should be looked for
+ * @return string[] The list of folders where the translation file should be looked for
*/
public function translationsFolders()
{
@@ -154,7 +153,7 @@ public function translationsFolders()
$folders = [
implode('_', [$locale['language'], $locale['region']]),
- $locale['language']
+ $locale['language'],
];
$searchPaths = [];
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Number.php b/app/vendor/cakephp/cakephp/src/I18n/Number.php
index eaba2d444..060a7eef1 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Number.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Number.php
@@ -21,25 +21,32 @@
*
* Methods to make numbers more readable.
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/number.html
+ * @link https://book.cakephp.org/3/en/core-libraries/number.html
*/
class Number
{
-
/**
* Default locale
- *
- * @var string
*/
const DEFAULT_LOCALE = 'en_US';
/**
* Format type to format as currency
- *
- * @var string
*/
const FORMAT_CURRENCY = 'currency';
+ /**
+ * Format type to format as currency, accounting style (negative numbers in parentheses)
+ */
+ const FORMAT_CURRENCY_ACCOUNTING = 'currency_accounting';
+
+ /**
+ * ICU Constant for accounting format; not yet widely supported by INTL library.
+ * This will be able to go away once CakePHP minimum PHP requirement is 7.4.1 or higher.
+ * See UNUM_CURRENCY_ACCOUNTING in https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/unum_8h.html
+ */
+ const CURRENCY_ACCOUNTING = 12;
+
/**
* A list of number formatters indexed by locale and type
*
@@ -54,6 +61,13 @@ class Number
*/
protected static $_defaultCurrency;
+ /**
+ * Default currency format used by Number::currency()
+ *
+ * @var string
+ */
+ protected static $_defaultCurrencyFormat;
+
/**
* Formats a number with a level of precision.
*
@@ -61,11 +75,11 @@ class Number
*
* - `locale`: The locale name to use for formatting the number, e.g. fr_FR
*
- * @param float $value A floating point number.
+ * @param float|string $value A floating point number.
* @param int $precision The precision of the returned number.
* @param array $options Additional options
* @return string Formatted float.
- * @link https://book.cakephp.org/3.0/en/core-libraries/number.html#formatting-floating-point-numbers
+ * @link https://book.cakephp.org/3/en/core-libraries/number.html#formatting-floating-point-numbers
*/
public static function precision($value, $precision = 3, array $options = [])
{
@@ -77,12 +91,14 @@ public static function precision($value, $precision = 3, array $options = [])
/**
* Returns a formatted-for-humans file size.
*
- * @param int $size Size in bytes
+ * @param int|string $size Size in bytes
* @return string Human readable size
- * @link https://book.cakephp.org/3.0/en/core-libraries/number.html#interacting-with-human-readable-values
+ * @link https://book.cakephp.org/3/en/core-libraries/number.html#interacting-with-human-readable-values
*/
public static function toReadableSize($size)
{
+ $size = (int)$size;
+
switch (true) {
case $size < 1024:
return __dn('cake', '{0,number,integer} Byte', '{0,number,integer} Bytes', $size, $size);
@@ -105,20 +121,20 @@ public static function toReadableSize($size)
* - `multiply`: Multiply the input value by 100 for decimal percentages.
* - `locale`: The locale name to use for formatting the number, e.g. fr_FR
*
- * @param float $value A floating point number
+ * @param float|string $value A floating point number
* @param int $precision The precision of the returned number
* @param array $options Options
* @return string Percentage string
- * @link https://book.cakephp.org/3.0/en/core-libraries/number.html#formatting-percentages
+ * @link https://book.cakephp.org/3/en/core-libraries/number.html#formatting-percentages
*/
public static function toPercentage($value, $precision = 2, array $options = [])
{
- $options += ['multiply' => false];
- if ($options['multiply']) {
- $value *= 100;
+ $options += ['multiply' => false, 'type' => NumberFormatter::PERCENT];
+ if (!$options['multiply']) {
+ $value /= 100;
}
- return static::precision($value, $precision, $options) . '%';
+ return static::precision($value, $precision, $options);
}
/**
@@ -133,7 +149,7 @@ public static function toPercentage($value, $precision = 2, array $options = [])
* - `before` - The string to place before whole numbers, e.g. '['
* - `after` - The string to place after decimal numbers, e.g. ']'
*
- * @param float $value A floating point number.
+ * @param float|string $value A floating point number.
* @param array $options An array with options.
* @return string Formatted number
*/
@@ -142,7 +158,7 @@ public static function format($value, array $options = [])
$formatter = static::formatter($options);
$options += ['before' => '', 'after' => ''];
- return $options['before'] . $formatter->format($value) . $options['after'];
+ return $options['before'] . $formatter->format((float)$value) . $options['after'];
}
/**
@@ -176,14 +192,14 @@ public static function parseFloat($value, array $options = [])
* - `before` - The string to place before whole numbers, e.g. '['
* - `after` - The string to place after decimal numbers, e.g. ']'
*
- * @param float $value A floating point number
+ * @param float|string $value A floating point number
* @param array $options Options list.
* @return string formatted delta
*/
public static function formatDelta($value, array $options = [])
{
$options += ['places' => 0];
- $value = number_format($value, $options['places'], '.', '');
+ $value = number_format((float)$value, $options['places'], '.', '');
$sign = $value > 0 ? '+' : '';
$options['before'] = isset($options['before']) ? $options['before'] . $sign : $sign;
@@ -208,7 +224,7 @@ public static function formatDelta($value, array $options = [])
* - `useIntlCode` - Whether or not to replace the currency symbol with the international
* currency code.
*
- * @param float $value Value to format.
+ * @param float|string $value Value to format.
* @param string|null $currency International currency name such as 'USD', 'EUR', 'JPY', 'CAD'
* @param array $options Options list.
* @return string Number formatted as a currency.
@@ -216,13 +232,13 @@ public static function formatDelta($value, array $options = [])
public static function currency($value, $currency = null, array $options = [])
{
$value = (float)$value;
- $currency = $currency ?: static::defaultCurrency();
+ $currency = $currency ?: static::getDefaultCurrency();
if (isset($options['zero']) && !$value) {
return $options['zero'];
}
- $formatter = static::formatter(['type' => static::FORMAT_CURRENCY] + $options);
+ $formatter = static::formatter(['type' => static::getDefaultCurrencyFormat()] + $options);
$abs = abs($value);
if (!empty($options['fractionSymbol']) && $abs > 0 && $abs < 1) {
$value *= 100;
@@ -238,30 +254,89 @@ public static function currency($value, $currency = null, array $options = [])
}
/**
- * Getter/setter for default currency
+ * Getter/setter for default currency. This behavior is *deprecated* and will be
+ * removed in future versions of CakePHP.
*
- * @param string|bool|null $currency Default currency string to be used by currency()
+ * @deprecated 3.9 Use getDefaultCurrency() and setDefaultCurrency()
+ * @param string|false|null $currency Default currency string to be used by currency()
* if $currency argument is not provided. If boolean false is passed, it will clear the
* currently stored value
* @return string|null Currency
*/
public static function defaultCurrency($currency = null)
{
- if (!empty($currency)) {
- return self::$_defaultCurrency = $currency;
- }
+ deprecationWarning(
+ 'Number::defaultCurrency() is deprecated. ' .
+ 'Use Number::setDefaultCurrency()/getDefaultCurrency() instead.'
+ );
if ($currency === false) {
- return self::$_defaultCurrency = null;
+ static::setDefaultCurrency(null);
+
+ // This doesn't seem like a useful result to return, but it's what the old version did.
+ // Retaining it for backward compatibility.
+ return null;
+ } elseif ($currency !== null) {
+ static::setDefaultCurrency($currency);
}
- if (empty(self::$_defaultCurrency)) {
+ return static::getDefaultCurrency();
+ }
+
+ /**
+ * Getter for default currency
+ *
+ * @return string Currency
+ */
+ public static function getDefaultCurrency()
+ {
+ if (static::$_defaultCurrency === null) {
$locale = ini_get('intl.default_locale') ?: static::DEFAULT_LOCALE;
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
- self::$_defaultCurrency = $formatter->getTextAttribute(NumberFormatter::CURRENCY_CODE);
+ static::$_defaultCurrency = $formatter->getTextAttribute(NumberFormatter::CURRENCY_CODE);
}
- return self::$_defaultCurrency;
+ return static::$_defaultCurrency;
+ }
+
+ /**
+ * Setter for default currency
+ *
+ * @param string|null $currency Default currency string to be used by currency()
+ * if $currency argument is not provided. If null is passed, it will clear the
+ * currently stored value
+ * @return void
+ */
+ public static function setDefaultCurrency($currency = null)
+ {
+ static::$_defaultCurrency = $currency;
+ }
+
+ /**
+ * Getter for default currency format
+ *
+ * @return string Currency Format
+ */
+ public static function getDefaultCurrencyFormat()
+ {
+ if (static::$_defaultCurrencyFormat === null) {
+ static::$_defaultCurrencyFormat = static::FORMAT_CURRENCY;
+ }
+
+ return static::$_defaultCurrencyFormat;
+ }
+
+ /**
+ * Setter for default currency format
+ *
+ * @param string|null $currencyFormat Default currency format to be used by currency()
+ * if $currencyFormat argument is not provided. If null is passed, it will clear the
+ * currently stored value
+ * @return void
+ */
+ public static function setDefaultCurrencyFormat($currencyFormat = null)
+ {
+ static::$_defaultCurrencyFormat = $currencyFormat;
}
/**
@@ -297,6 +372,12 @@ public static function formatter($options = [])
$type = $options['type'];
if ($options['type'] === static::FORMAT_CURRENCY) {
$type = NumberFormatter::CURRENCY;
+ } elseif ($options['type'] === static::FORMAT_CURRENCY_ACCOUNTING) {
+ if (defined('NumberFormatter::CURRENCY_ACCOUNTING')) {
+ $type = NumberFormatter::CURRENCY_ACCOUNTING;
+ } else {
+ $type = static::CURRENCY_ACCOUNTING;
+ }
}
}
@@ -304,13 +385,14 @@ public static function formatter($options = [])
static::$_formatters[$locale][$type] = new NumberFormatter($locale, $type);
}
+ /** @var \NumberFormatter $formatter */
$formatter = static::$_formatters[$locale][$type];
$options = array_intersect_key($options, [
'places' => null,
'precision' => null,
'pattern' => null,
- 'useIntlCode' => null
+ 'useIntlCode' => null,
]);
if (empty($options)) {
return $formatter;
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Parser/MoFileParser.php b/app/vendor/cakephp/cakephp/src/I18n/Parser/MoFileParser.php
index f7a11b73c..c48471c55 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Parser/MoFileParser.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Parser/MoFileParser.php
@@ -17,14 +17,13 @@
use RuntimeException;
/**
- * Parses file in PO format
+ * Parses file in MO format
*
* @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
* @copyright Copyright (c) 2014, Fabien Potencier https://github.com/symfony/Translation/blob/master/LICENSE
*/
class MoFileParser
{
-
/**
* Magic used for validating the format of a MO file as well as
* detecting if the machine used to create that file was little endian.
@@ -53,7 +52,6 @@ class MoFileParser
* was created on. Both 32bit and 64bit systems are supported.
*
* @param resource $resource The file to be parsed.
- *
* @return array List of messages extracted from the file
* @throws \RuntimeException If stream content has an invalid format.
*/
@@ -69,9 +67,9 @@ public function parse($resource)
$magic = unpack('V1', fread($stream, 4));
$magic = hexdec(substr(dechex(current($magic)), -8));
- if ($magic == self::MO_LITTLE_ENDIAN_MAGIC) {
+ if ($magic === self::MO_LITTLE_ENDIAN_MAGIC) {
$isBigEndian = false;
- } elseif ($magic == self::MO_BIG_ENDIAN_MAGIC) {
+ } elseif ($magic === self::MO_BIG_ENDIAN_MAGIC) {
$isBigEndian = true;
} else {
throw new RuntimeException('Invalid format for MO translations file');
@@ -121,11 +119,11 @@ public function parse($resource)
if ($pluralId !== null || strpos($translated, "\000") !== false) {
$translated = explode("\000", $translated);
- $plurals = $pluralId !== null ? array_map('stripcslashes', $translated) : null;
+ $plurals = $pluralId !== null ? $translated : null;
$translated = $translated[0];
}
- $singular = stripcslashes($translated);
+ $singular = $translated;
if ($context !== null) {
$messages[$singularId]['_context'][$context] = $singular;
if ($pluralId !== null) {
@@ -157,6 +155,6 @@ protected function _readLong($stream, $isBigEndian)
$result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4));
$result = current($result);
- return (int)substr($result, -8);
+ return (int)substr((string)$result, -8);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Parser/PoFileParser.php b/app/vendor/cakephp/cakephp/src/I18n/Parser/PoFileParser.php
index d0bbc4f36..2a8e80d1f 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Parser/PoFileParser.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Parser/PoFileParser.php
@@ -66,7 +66,6 @@ class PoFileParser
* Items with an empty id are ignored.
*
* @param string $resource The file name to parse
- *
* @return array
*/
public function parse($resource)
@@ -75,12 +74,12 @@ public function parse($resource)
$defaults = [
'ids' => [],
- 'translated' => null
+ 'translated' => null,
];
$messages = [];
$item = $defaults;
- $stage = null;
+ $stage = [];
while ($line = fgets($stream)) {
$line = trim($line);
@@ -89,7 +88,7 @@ public function parse($resource)
// Whitespace indicated current item is done
$this->_addMessage($messages, $item);
$item = $defaults;
- $stage = null;
+ $stage = [];
} elseif (substr($line, 0, 7) === 'msgid "') {
// We start a new msg so save previous
$this->_addMessage($messages, $item);
@@ -164,7 +163,7 @@ protected function _addMessage(array &$messages, array $item)
// Make sure every index is filled.
end($plurals);
- $count = key($plurals);
+ $count = (int)key($plurals);
// Fill missing spots with an empty string.
$empties = array_fill(0, $count + 1, '');
diff --git a/app/vendor/cakephp/cakephp/src/I18n/PluralRules.php b/app/vendor/cakephp/cakephp/src/I18n/PluralRules.php
index 0e4f66630..649058bdd 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/PluralRules.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/PluralRules.php
@@ -14,13 +14,14 @@
*/
namespace Cake\I18n;
+use Cake\Core\Exception\Exception;
+
/**
* Utility class used to determine the plural number to be used for a variable
* base on the locale
*/
class PluralRules
{
-
/**
* A map of locale => plurals group used to determine
* which plural rules apply to the language
@@ -151,50 +152,52 @@ public static function calculate($locale, $n)
case 0:
return 0;
case 1:
- return $n == 1 ? 0 : 1;
+ return $n === 1 ? 0 : 1;
case 2:
return $n > 1 ? 1 : 0;
case 3:
- return $n % 10 == 1 && $n % 100 != 11 ? 0 :
+ return $n % 10 === 1 && $n % 100 !== 11 ? 0 :
(($n % 10 >= 2 && $n % 10 <= 4) && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
case 4:
- return $n == 1 ? 0 :
+ return $n === 1 ? 0 :
($n >= 2 && $n <= 4 ? 1 : 2);
case 5:
- return $n == 1 ? 0 :
- ($n == 2 ? 1 : ($n < 7 ? 2 : ($n < 11 ? 3 : 4)));
+ return $n === 1 ? 0 :
+ ($n === 2 ? 1 : ($n < 7 ? 2 : ($n < 11 ? 3 : 4)));
case 6:
- return $n % 10 == 1 && $n % 100 != 11 ? 0 :
+ return $n % 10 === 1 && $n % 100 !== 11 ? 0 :
($n % 10 >= 2 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
case 7:
- return $n % 100 == 1 ? 1 :
- ($n % 100 == 2 ? 2 : ($n % 100 == 3 || $n % 100 == 4 ? 3 : 0));
+ return $n % 100 === 1 ? 1 :
+ ($n % 100 === 2 ? 2 : ($n % 100 === 3 || $n % 100 === 4 ? 3 : 0));
case 8:
- return $n % 10 == 1 ? 0 : ($n % 10 == 2 ? 1 : 2);
+ return $n % 10 === 1 ? 0 : ($n % 10 === 2 ? 1 : 2);
case 9:
- return $n == 1 ? 0 :
- ($n == 0 || ($n % 100 > 0 && $n % 100 <= 10) ? 1 :
+ return $n === 1 ? 0 :
+ ($n === 0 || ($n % 100 > 0 && $n % 100 <= 10) ? 1 :
($n % 100 > 10 && $n % 100 < 20 ? 2 : 3));
case 10:
- return $n % 10 == 1 && $n % 100 != 11 ? 0 : ($n != 0 ? 1 : 2);
+ return $n % 10 === 1 && $n % 100 !== 11 ? 0 : ($n !== 0 ? 1 : 2);
case 11:
- return $n == 1 ? 0 :
+ return $n === 1 ? 0 :
($n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
case 12:
- return $n == 1 ? 0 :
- ($n == 0 || $n % 100 > 0 && $n % 100 < 20 ? 1 : 2);
+ return $n === 1 ? 0 :
+ ($n === 0 || $n % 100 > 0 && $n % 100 < 20 ? 1 : 2);
case 13:
- return $n == 0 ? 0 :
- ($n == 1 ? 1 :
- ($n == 2 ? 2 :
+ return $n === 0 ? 0 :
+ ($n === 1 ? 1 :
+ ($n === 2 ? 2 :
($n % 100 >= 3 && $n % 100 <= 10 ? 3 :
($n % 100 >= 11 ? 4 : 5))));
case 14:
- return $n == 1 ? 0 :
- ($n == 2 ? 1 :
- ($n != 8 && $n != 11 ? 2 : 3));
+ return $n === 1 ? 0 :
+ ($n === 2 ? 1 :
+ ($n !== 8 && $n !== 11 ? 2 : 3));
case 15:
- return ($n % 10 != 1 || $n % 100 == 11) ? 1 : 0;
+ return $n % 10 !== 1 || $n % 100 === 11 ? 1 : 0;
}
+
+ throw new Exception('Unable to find plural rule number.');
}
}
diff --git a/app/vendor/cakephp/cakephp/src/I18n/README.md b/app/vendor/cakephp/cakephp/src/I18n/README.md
index 72ff29ff0..93f2e6ecc 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/README.md
+++ b/app/vendor/cakephp/cakephp/src/I18n/README.md
@@ -31,7 +31,7 @@ use Cake\Core\Configure;
Configure::write('App.paths.locales', ['/path/with/trailing/slash/']);
```
-Please refer to the [CakePHP Manual](https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#language-files) for details
+Please refer to the [CakePHP Manual](https://book.cakephp.org/3/en/core-libraries/internationalization-and-localization.html#language-files) for details
about expected folder structure and file naming.
### Translating a Message
@@ -92,12 +92,12 @@ echo Number::currency(123456.7890, 'EUR');
## Documentation
Please make sure you check the [official I18n
-documentation](https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html).
+documentation](https://book.cakephp.org/3/en/core-libraries/internationalization-and-localization.html).
The [documentation for the Time
-class](https://book.cakephp.org/3.0/en/core-libraries/time.html) contains
+class](https://book.cakephp.org/3/en/core-libraries/time.html) contains
instructions on how to configure and output time strings for selected locales.
The [documentation for the Number
-class](https://book.cakephp.org/3.0/en/core-libraries/number.html) shows how to
+class](https://book.cakephp.org/3/en/core-libraries/number.html) shows how to
use the `Number` class for displaying numbers in specific locales.
diff --git a/app/vendor/cakephp/cakephp/src/I18n/RelativeTimeFormatter.php b/app/vendor/cakephp/cakephp/src/I18n/RelativeTimeFormatter.php
index d921f7812..c19fff189 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/RelativeTimeFormatter.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/RelativeTimeFormatter.php
@@ -154,7 +154,7 @@ public function timeAgoInWords(DateTimeInterface $time, array $options = [])
'day' => __d('cake', 'about a day ago'),
'week' => __d('cake', 'about a week ago'),
'month' => __d('cake', 'about a month ago'),
- 'year' => __d('cake', 'about a year ago')
+ 'year' => __d('cake', 'about a year ago'),
];
return $relativeDate ? sprintf($options['relativeString'], $relativeDate) : $aboutAgo[$fWord];
@@ -171,7 +171,7 @@ public function timeAgoInWords(DateTimeInterface $time, array $options = [])
'day' => __d('cake', 'in about a day'),
'week' => __d('cake', 'in about a week'),
'month' => __d('cake', 'in about a month'),
- 'year' => __d('cake', 'in about a year')
+ 'year' => __d('cake', 'in about a year'),
];
return $aboutIn[$fWord];
@@ -332,7 +332,7 @@ public function dateAgoInWords(DateTimeInterface $date, array $options = [])
'day' => __d('cake', 'about a day ago'),
'week' => __d('cake', 'about a week ago'),
'month' => __d('cake', 'about a month ago'),
- 'year' => __d('cake', 'about a year ago')
+ 'year' => __d('cake', 'about a year ago'),
];
return $relativeDate ? sprintf($options['relativeString'], $relativeDate) : $aboutAgo[$fWord];
@@ -346,7 +346,7 @@ public function dateAgoInWords(DateTimeInterface $date, array $options = [])
'day' => __d('cake', 'in about a day'),
'week' => __d('cake', 'in about a week'),
'month' => __d('cake', 'in about a month'),
- 'year' => __d('cake', 'in about a year')
+ 'year' => __d('cake', 'in about a year'),
];
return $aboutIn[$fWord];
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Time.php b/app/vendor/cakephp/cakephp/src/I18n/Time.php
index e13af084f..e67b2c2e5 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Time.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Time.php
@@ -109,7 +109,7 @@ public function __construct($time = null, $tz = null)
{
if ($time instanceof DateTimeInterface) {
$tz = $time->getTimezone();
- $time = $time->format('Y-m-d H:i:s');
+ $time = $time->format('Y-m-d H:i:s.u');
}
if (is_numeric($time)) {
@@ -168,11 +168,11 @@ public function isThisYear()
* Returns the quarter
*
* @param bool $range Range.
- * @return int|array 1, 2, 3, or 4 quarter of year, or array if $range true
+ * @return string[]|int 1, 2, 3, or 4 quarter of year, or array if $range true
*/
public function toQuarter($range = false)
{
- $quarter = (int)ceil($this->format('m') / 3);
+ $quarter = (int)ceil((int)$this->format('m') / 3);
if ($range === false) {
return $quarter;
}
diff --git a/app/vendor/cakephp/cakephp/src/I18n/Translator.php b/app/vendor/cakephp/cakephp/src/I18n/Translator.php
index 880471a03..4c4751bca 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/Translator.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/Translator.php
@@ -21,13 +21,14 @@
*/
class Translator extends BaseTranslator
{
-
+ /**
+ * @var string
+ */
const PLURAL_PREFIX = 'p:';
/**
* Translates the message formatting any placeholders
*
- *
* @param string $key The message key.
* @param array $tokensValues Token values to interpolate into the
* message.
@@ -74,7 +75,7 @@ public function translate($key, array $tokensValues = [])
// Resolve plural form.
if (is_array($message)) {
- $count = isset($tokensValues['_count']) ? $tokensValues['_count'] : 0;
+ $count = isset($tokensValues['_count']) ? (int)$tokensValues['_count'] : 0;
$form = PluralRules::calculate($this->locale, $count);
$message = isset($message[$form]) ? $message[$form] : (string)end($message);
}
@@ -83,6 +84,8 @@ public function translate($key, array $tokensValues = [])
$message = $key;
}
+ unset($tokensValues['_count'], $tokensValues['_singular']);
+
return $this->formatter->format($this->locale, $message, $tokensValues);
}
@@ -92,7 +95,7 @@ public function translate($key, array $tokensValues = [])
* @param string $key The message key being handled.
* @param string|array $message The message content.
* @param array $vars The variables containing the `_context` key.
- * @return string
+ * @return string|array
*/
protected function resolveContext($key, $message, array $vars)
{
diff --git a/app/vendor/cakephp/cakephp/src/I18n/TranslatorFactory.php b/app/vendor/cakephp/cakephp/src/I18n/TranslatorFactory.php
index 79c370196..c34f9e2b0 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/TranslatorFactory.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/TranslatorFactory.php
@@ -32,7 +32,7 @@ class TranslatorFactory extends BaseTranslatorFactory
*
* @var string
*/
- protected $class = 'Cake\I18n\Translator';
+ protected $class = Translator::class;
/**
* Returns a new Translator.
diff --git a/app/vendor/cakephp/cakephp/src/I18n/TranslatorRegistry.php b/app/vendor/cakephp/cakephp/src/I18n/TranslatorRegistry.php
index df06dc61b..b773501a7 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/TranslatorRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/TranslatorRegistry.php
@@ -26,7 +26,6 @@
*/
class TranslatorRegistry extends TranslatorLocator
{
-
/**
* A list of loader functions indexed by domain name. Loaders are
* callables that are invoked as a default for building translation
@@ -87,7 +86,7 @@ public function __construct(
$this->registerLoader($this->_fallbackLoader, function ($name, $locale) {
$chain = new ChainMessagesLoader([
new MessagesFileLoader($name, $locale, 'mo'),
- new MessagesFileLoader($name, $locale, 'po')
+ new MessagesFileLoader($name, $locale, 'po'),
]);
// \Aura\Intl\Package by default uses formatter configured with key "basic".
@@ -119,7 +118,7 @@ public function setCacher(CacheEngine $cacher)
/**
* Gets a translator from the registry by package for a locale.
*
- * @param string $name The translator package to retrieve.
+ * @param string|null $name The translator package to retrieve.
* @param string|null $locale The locale to use; if empty, uses the default
* locale.
* @return \Aura\Intl\TranslatorInterface|null A translator object.
@@ -286,7 +285,7 @@ public function setLoaderFallback($name, callable $loader)
return $loader;
}
$loader = function () use ($loader, $fallbackDomain) {
- /* @var \Aura\Intl\Package $package */
+ /** @var \Aura\Intl\Package $package */
$package = $loader();
if (!$package->getFallback()) {
$package->setFallback($fallbackDomain);
diff --git a/app/vendor/cakephp/cakephp/src/I18n/composer.json b/app/vendor/cakephp/cakephp/src/I18n/composer.json
index 7ffc86fa6..611e487ad 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/composer.json
+++ b/app/vendor/cakephp/cakephp/src/I18n/composer.json
@@ -28,7 +28,7 @@
"source": "https://github.com/cakephp/i18n"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"ext-intl": "*",
"cakephp/core": "^3.6.0",
"cakephp/chronos": "^1.0.0",
diff --git a/app/vendor/cakephp/cakephp/src/I18n/functions.php b/app/vendor/cakephp/cakephp/src/I18n/functions.php
index 65f46ab68..bbb6aeeda 100644
--- a/app/vendor/cakephp/cakephp/src/I18n/functions.php
+++ b/app/vendor/cakephp/cakephp/src/I18n/functions.php
@@ -12,6 +12,7 @@
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
+
use Cake\I18n\I18n;
if (!function_exists('__')) {
@@ -19,14 +20,14 @@
* Returns a translated string if one is found; Otherwise, the submitted message.
*
* @param string $singular Text to translate.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null The translated text, or null if invalid.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string The translated text.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__
*/
function __($singular, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -45,14 +46,14 @@ function __($singular, ...$args)
* @param string $singular Singular text to translate.
* @param string $plural Plural text.
* @param int $count Count.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Plural form of translated string, or null if invalid.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__n
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Plural form of translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__n
*/
function __n($singular, $plural, $count, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -72,14 +73,14 @@ function __n($singular, $plural, $count, ...$args)
*
* @param string $domain Domain.
* @param string $msg String to translate.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__d
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__d
*/
function __d($domain, $msg, ...$args)
{
if (!$msg) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -100,14 +101,14 @@ function __d($domain, $msg, ...$args)
* @param string $singular Singular string to translate.
* @param string $plural Plural.
* @param int $count Count.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Plural form of translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dn
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Plural form of translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__dn
*/
function __dn($domain, $singular, $plural, $count, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -129,14 +130,14 @@ function __dn($domain, $singular, $plural, $count, ...$args)
*
* @param string $context Context of the text.
* @param string $singular Text to translate.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__x
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__x
*/
function __x($context, $singular, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -158,14 +159,14 @@ function __x($context, $singular, ...$args)
* @param string $singular Singular text to translate.
* @param string $plural Plural text.
* @param int $count Count.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Plural form of translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__xn
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Plural form of translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__xn
*/
function __xn($context, $singular, $plural, $count, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -188,14 +189,14 @@ function __xn($context, $singular, $plural, $count, ...$args)
* @param string $domain Domain.
* @param string $context Context of the text.
* @param string $msg String to translate.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dx
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__dx
*/
function __dx($domain, $context, $msg, ...$args)
{
if (!$msg) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
@@ -221,14 +222,14 @@ function __dx($domain, $context, $msg, ...$args)
* @param string $singular Singular text to translate.
* @param string $plural Plural text.
* @param int $count Count.
- * @param array ...$args Array with arguments or multiple arguments in function.
- * @return string|null Plural form of translated string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dxn
+ * @param mixed ...$args Array with arguments or multiple arguments in function.
+ * @return string Plural form of translated string.
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#__dxn
*/
function __dxn($domain, $context, $singular, $plural, $count, ...$args)
{
if (!$singular) {
- return null;
+ return '';
}
if (isset($args[0]) && is_array($args[0])) {
$args = $args[0];
diff --git a/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php b/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php
index 1aca5140e..2ef6fcc3f 100644
--- a/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php
+++ b/app/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php
@@ -33,7 +33,7 @@ abstract class BaseLog extends AbstractLogger
*/
protected $_defaultConfig = [
'levels' => [],
- 'scopes' => []
+ 'scopes' => [],
];
/**
@@ -71,7 +71,7 @@ public function levels()
/**
* Get the scopes this logger is interested in.
*
- * @return array
+ * @return array|false
*/
public function scopes()
{
diff --git a/app/vendor/cakephp/cakephp/src/Log/Engine/ConsoleLog.php b/app/vendor/cakephp/cakephp/src/Log/Engine/ConsoleLog.php
index 4d9e71176..6566df300 100644
--- a/app/vendor/cakephp/cakephp/src/Log/Engine/ConsoleLog.php
+++ b/app/vendor/cakephp/cakephp/src/Log/Engine/ConsoleLog.php
@@ -22,7 +22,6 @@
*/
class ConsoleLog extends BaseLog
{
-
/**
* Default config for this class
*
diff --git a/app/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php b/app/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php
index 5e424be34..e9114529d 100644
--- a/app/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php
+++ b/app/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php
@@ -23,7 +23,6 @@
*/
class FileLog extends BaseLog
{
-
/**
* Default config for this class
*
@@ -86,7 +85,8 @@ public function __construct(array $config = [])
if (!empty($this->_config['path'])) {
$this->_path = $this->_config['path'];
}
- if ($this->_path !== null &&
+ if (
+ $this->_path !== null &&
Configure::read('debug') &&
!is_dir($this->_path)
) {
@@ -185,7 +185,8 @@ protected function _rotateFile($filename)
$filePath = $this->_path . $filename;
clearstatcache(true, $filePath);
- if (!file_exists($filePath) ||
+ if (
+ !file_exists($filePath) ||
filesize($filePath) < $this->_size
) {
return null;
diff --git a/app/vendor/cakephp/cakephp/src/Log/Engine/SyslogLog.php b/app/vendor/cakephp/cakephp/src/Log/Engine/SyslogLog.php
index 503c9ce2a..efbeb0f82 100644
--- a/app/vendor/cakephp/cakephp/src/Log/Engine/SyslogLog.php
+++ b/app/vendor/cakephp/cakephp/src/Log/Engine/SyslogLog.php
@@ -19,7 +19,6 @@
*/
class SyslogLog extends BaseLog
{
-
/**
* Default config for this class
*
@@ -54,7 +53,7 @@ class SyslogLog extends BaseLog
'format' => '%s: %s',
'flag' => LOG_ODELAY,
'prefix' => '',
- 'facility' => LOG_USER
+ 'facility' => LOG_USER,
];
/**
@@ -70,7 +69,7 @@ class SyslogLog extends BaseLog
'warning' => LOG_WARNING,
'notice' => LOG_NOTICE,
'info' => LOG_INFO,
- 'debug' => LOG_DEBUG
+ 'debug' => LOG_DEBUG,
];
/**
diff --git a/app/vendor/cakephp/cakephp/src/Log/Log.php b/app/vendor/cakephp/cakephp/src/Log/Log.php
index 894c2f03d..61997446a 100644
--- a/app/vendor/cakephp/cakephp/src/Log/Log.php
+++ b/app/vendor/cakephp/cakephp/src/Log/Log.php
@@ -103,7 +103,6 @@
*/
class Log
{
-
use StaticConfigTrait {
setConfig as protected _setConfig;
}
@@ -111,7 +110,7 @@ class Log
/**
* An array mapping url schemes to fully qualified Log engine class names
*
- * @var array
+ * @var string[]
*/
protected static $_dsnClassMap = [
'console' => 'Cake\Log\Engine\ConsoleLog',
@@ -136,7 +135,7 @@ class Log
/**
* Handled log levels
*
- * @var array
+ * @var string[]
*/
protected static $_levels = [
'emergency',
@@ -146,7 +145,7 @@ class Log
'warning',
'notice',
'info',
- 'debug'
+ 'debug',
];
/**
@@ -223,7 +222,7 @@ public static function reset()
* Call this method to obtain current
* level configuration.
*
- * @return array active log levels
+ * @return string[] active log levels
*/
public static function levels()
{
diff --git a/app/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php b/app/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php
index 0fa534f79..48202f018 100644
--- a/app/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php
@@ -24,7 +24,6 @@
*/
class LogEngineRegistry extends ObjectRegistry
{
-
/**
* Resolve a logger classname.
*
@@ -48,7 +47,7 @@ protected function _resolveClassName($class)
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the logger is missing in.
+ * @param string|null $plugin The plugin the logger is missing in.
* @return void
* @throws \RuntimeException
*/
@@ -95,10 +94,12 @@ protected function _create($class, $alias, $settings)
* Remove a single logger from the registry.
*
* @param string $name The logger name.
- * @return void
+ * @return $this
*/
public function unload($name)
{
unset($this->_loaded[$name]);
+
+ return $this;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Log/LogTrait.php b/app/vendor/cakephp/cakephp/src/Log/LogTrait.php
index 31b943e87..0aac978f6 100644
--- a/app/vendor/cakephp/cakephp/src/Log/LogTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Log/LogTrait.php
@@ -21,18 +21,17 @@
*/
trait LogTrait
{
-
/**
* Convenience method to write a message to Log. See Log::write()
* for more information on writing to logs.
*
- * @param mixed $msg Log message.
+ * @param mixed $message Log message.
* @param int|string $level Error level.
* @param string|array $context Additional log data relevant to this message.
* @return bool Success of log write.
*/
- public function log($msg, $level = LogLevel::ERROR, $context = [])
+ public function log($message, $level = LogLevel::ERROR, $context = [])
{
- return Log::write($level, $msg, $context);
+ return Log::write($level, $message, $context);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Log/README.md b/app/vendor/cakephp/cakephp/src/Log/README.md
index 200a8a43d..8eead7995 100644
--- a/app/vendor/cakephp/cakephp/src/Log/README.md
+++ b/app/vendor/cakephp/cakephp/src/Log/README.md
@@ -8,7 +8,7 @@ multiple logging backends using a simple interface. With the `Log` class it is
possible to send a single message to multiple logging backends at the same time
or just a subset of them based on the log level or context.
-By default you can use Files or Syslog as logging backends, but you can use any
+By default, you can use Files or Syslog as logging backends, but you can use any
object implementing `Psr\Log\LoggerInterface` as an engine for the `Log` class.
## Usage
@@ -80,4 +80,4 @@ Log::warning('this gets written only to payments.log', ['scope' => ['payments']]
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/logging.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/logging.html)
diff --git a/app/vendor/cakephp/cakephp/src/Log/composer.json b/app/vendor/cakephp/cakephp/src/Log/composer.json
index a775a4f9f..eeb2dacc3 100644
--- a/app/vendor/cakephp/cakephp/src/Log/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Log/composer.json
@@ -23,7 +23,7 @@
"source": "https://github.com/cakephp/log"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0",
"psr/log": "^1.0.0"
},
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Email.php b/app/vendor/cakephp/cakephp/src/Mailer/Email.php
index d9a9807c1..59f1e0d2a 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Email.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Email.php
@@ -49,7 +49,6 @@
*/
class Email implements JsonSerializable, Serializable
{
-
use StaticConfigTrait;
use ViewVarsTrait;
@@ -110,7 +109,7 @@ class Email implements JsonSerializable, Serializable
protected $_sender = [];
/**
- * The email the recipient will reply to
+ * List of email(s) that the recipient will reply to.
*
* @var array
*/
@@ -258,7 +257,7 @@ class Email implements JsonSerializable, Serializable
'8bit',
'base64',
'binary',
- 'quoted-printable'
+ 'quoted-printable',
];
/**
@@ -295,7 +294,7 @@ class Email implements JsonSerializable, Serializable
* An array mapping url schemes to fully qualified Transport class names.
* Unused.
*
- * @var array
+ * @var string[]
* @deprecated 3.7.0 This property is unused and will be removed in 4.0.0.
*/
protected static $_dsnClassMap = [];
@@ -321,7 +320,7 @@ class Email implements JsonSerializable, Serializable
* @var array
*/
protected $_contentTypeCharset = [
- 'ISO-2022-JP-MS' => 'ISO-2022-JP'
+ 'ISO-2022-JP-MS' => 'ISO-2022-JP',
];
/**
@@ -422,13 +421,14 @@ public function from($email = null, $name = null)
}
/**
- * Sets "sender" address.
+ * Sets the "sender" address. See rfc link below for full explanation.
*
* @param string|array $email String with email,
* Array with email as key, name as value or email as value (without name)
* @param string|null $name Name
* @return $this
* @throws \InvalidArgumentException
+ * @link https://tools.ietf.org/html/rfc2822.html#section-3.6.2
*/
public function setSender($email, $name = null)
{
@@ -436,9 +436,10 @@ public function setSender($email, $name = null)
}
/**
- * Gets "sender" address.
+ * Gets the "sender" address. See rfc link below for full explanation.
*
* @return array
+ * @link https://tools.ietf.org/html/rfc2822.html#section-3.6.2
*/
public function getSender()
{
@@ -477,7 +478,7 @@ public function sender($email = null, $name = null)
*/
public function setReplyTo($email, $name = null)
{
- return $this->_setEmailSingle('_replyTo', $email, $name, 'Reply-To requires only 1 email address.');
+ return $this->_setEmail('_replyTo', $email, $name);
}
/**
@@ -833,7 +834,7 @@ public function setHeaderCharset($charset)
*/
public function getHeaderCharset()
{
- return $this->headerCharset;
+ return $this->headerCharset ? $this->headerCharset : $this->charset;
}
/**
@@ -916,7 +917,7 @@ public function getEmailPattern()
* EmailPattern setter/getter
*
* @deprecated 3.4.0 Use setEmailPattern()/getEmailPattern() instead.
- * @param string|bool|null $regex The pattern to use for email address validation,
+ * @param string|false|null $regex The pattern to use for email address validation,
* null to unset the pattern and make use of filter_var() instead, false or
* nothing to return the current value
* @return string|$this
@@ -1166,11 +1167,20 @@ public function getHeaders(array $include = [])
'from' => 'From',
'replyTo' => 'Reply-To',
'readReceipt' => 'Disposition-Notification-To',
- 'returnPath' => 'Return-Path'
+ 'returnPath' => 'Return-Path',
+ 'to' => 'To',
+ 'cc' => 'Cc',
+ 'bcc' => 'Bcc',
];
- foreach ($relation as $var => $header) {
- if ($include[$var]) {
- $var = '_' . $var;
+ $headerMultipleEmails = ['to', 'cc', 'bcc', 'replyTo'];
+ foreach ($relation as $key => $header) {
+ $var = '_' . $key;
+ if (!$include[$key]) {
+ continue;
+ }
+ if (in_array($key, $headerMultipleEmails, true)) {
+ $headers[$header] = implode(', ', $this->_formatAddress($this->{$var}));
+ } else {
$headers[$header] = current($this->_formatAddress($this->{$var}));
}
}
@@ -1182,13 +1192,6 @@ public function getHeaders(array $include = [])
}
}
- foreach (['to', 'cc', 'bcc'] as $var) {
- if ($include[$var]) {
- $classVar = '_' . $var;
- $headers[ucfirst($var)] = implode(', ', $this->_formatAddress($this->{$classVar}));
- }
- }
-
$headers += $this->_headers;
if (!isset($headers['Date'])) {
$headers['Date'] = date(DATE_RFC2822);
@@ -1257,6 +1260,7 @@ protected function _formatAddress($address)
*
* @param string|null $template Template name or null to not use.
* @return $this
+ * @deprecated 3.7.0 Use $email->viewBuilder()->setTemplate() instead.
*/
public function setTemplate($template)
{
@@ -1273,6 +1277,7 @@ public function setTemplate($template)
* Gets template.
*
* @return string
+ * @deprecated 3.7.0 Use $email->viewBuilder()->getTemplate() instead.
*/
public function getTemplate()
{
@@ -1334,13 +1339,13 @@ public function template($template = false, $layout = false)
if ($template === false) {
return [
- 'template' => $this->getTemplate(),
- 'layout' => $this->getLayout()
+ 'template' => $this->viewBuilder()->getTemplate(),
+ 'layout' => $this->viewBuilder()->getLayout(),
];
}
- $this->setTemplate($template);
+ $this->viewBuilder()->setTemplate($template);
if ($layout !== false) {
- $this->setLayout($layout);
+ $this->viewBuilder()->setLayout($layout);
}
return $this;
@@ -1476,10 +1481,12 @@ public function theme($theme = null)
);
if ($theme === null) {
- return $this->getTheme();
+ return $this->viewBuilder()->getTheme();
}
- return $this->setTheme($theme);
+ $this->viewBuilder()->setTheme($theme);
+
+ return $this;
}
/**
@@ -1529,10 +1536,12 @@ public function helpers($helpers = null)
);
if ($helpers === null) {
- return $this->getHelpers();
+ return $this->viewBuilder()->getHelpers();
}
- return $this->setHelpers((array)$helpers);
+ $this->viewBuilder()->setHelpers((array)$helpers);
+
+ return $this;
}
/**
@@ -2094,7 +2103,7 @@ public function getProfile()
* Get/Set the configuration profile to use for this instance.
*
* @deprecated 3.4.0 Use setProfile()/getProfile() instead.
- * @param null|string|array $config String with configuration name, or
+ * @param array|string|null $config String with configuration name, or
* an array with config or null to return current config.
* @return string|array|$this
*/
@@ -2156,7 +2165,7 @@ protected function _logDelivery($contents)
}
$config = [
'level' => 'debug',
- 'scope' => 'email'
+ 'scope' => 'email',
];
if ($this->_profile['log'] !== true) {
if (!is_array($this->_profile['log'])) {
@@ -2200,7 +2209,7 @@ public static function deliver($to = null, $subject = null, $message = null, $co
if (is_array($config) && !isset($config['transport'])) {
$config['transport'] = 'default';
}
- /* @var \Cake\Mailer\Email $instance */
+ /** @var \Cake\Mailer\Email $instance */
$instance = new $class($config);
if ($to !== null) {
$instance->setTo($to);
@@ -2245,7 +2254,7 @@ protected function _applyConfig($config)
$simpleMethods = [
'from', 'sender', 'to', 'replyTo', 'readReceipt', 'returnPath',
'cc', 'bcc', 'messageId', 'domain', 'subject', 'attachments',
- 'transport', 'emailFormat', 'emailPattern', 'charset', 'headerCharset'
+ 'transport', 'emailFormat', 'emailPattern', 'charset', 'headerCharset',
];
foreach ($simpleMethods as $method) {
if (isset($config[$method])) {
@@ -2261,7 +2270,7 @@ protected function _applyConfig($config)
}
$viewBuilderMethods = [
- 'template', 'layout', 'theme'
+ 'template', 'layout', 'theme',
];
foreach ($viewBuilderMethods as $method) {
if (array_key_exists($method, $config)) {
@@ -2453,7 +2462,7 @@ protected function _wrap($message, $wrapLength = Email::LINE_LENGTH_MUST)
$tmpLine .= $char;
$tmpLineLength++;
if ($tmpLineLength === $wrapLength) {
- $nextChar = $line[$i + 1];
+ $nextChar = isset($line[$i + 1]) ? $line[$i + 1] : '';
if ($nextChar === ' ' || $nextChar === '<') {
$formatted[] = trim($tmpLine);
$tmpLine = '';
@@ -2516,7 +2525,7 @@ protected function _attachFiles($boundary = null)
!isset($fileInfo['contentDisposition']) ||
$fileInfo['contentDisposition']
);
- $part = new FormDataPart(false, $data, false);
+ $part = new FormDataPart('', $data, '', $this->getHeaderCharset());
if ($hasDisposition) {
$part->disposition('attachment');
@@ -2566,7 +2575,7 @@ protected function _attachInlineFiles($boundary = null)
$data = isset($fileInfo['data']) ? $fileInfo['data'] : $this->_readFile($fileInfo['file']);
$msg[] = '--' . $boundary;
- $part = new FormDataPart(false, $data, 'inline');
+ $part = new FormDataPart('', $data, 'inline', $this->getHeaderCharset());
$part->type($fileInfo['mimetype']);
$part->transferEncoding('base64');
$part->contentId($fileInfo['contentId']);
@@ -2794,7 +2803,7 @@ public function jsonSerialize()
$properties = [
'_to', '_from', '_sender', '_replyTo', '_cc', '_bcc', '_subject',
'_returnPath', '_readReceipt', '_emailFormat', '_emailPattern', '_domain',
- '_attachments', '_messageId', '_headers', '_appCharset', 'viewVars', 'charset', 'headerCharset'
+ '_attachments', '_messageId', '_headers', '_appCharset', 'viewVars', 'charset', 'headerCharset',
];
$array = ['viewConfig' => $this->viewBuilder()->jsonSerialize()];
@@ -2830,7 +2839,8 @@ protected function _checkViewVars(&$item, $key)
$item = (string)$item;
}
- if (is_resource($item) ||
+ if (
+ is_resource($item) ||
$item instanceof Closure ||
$item instanceof PDO
) {
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingActionException.php b/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingActionException.php
index d1a9734eb..25bc6fc7e 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingActionException.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingActionException.php
@@ -19,7 +19,6 @@
*/
class MissingActionException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingMailerException.php b/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingMailerException.php
index f3e7f8872..070d60e6b 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingMailerException.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Exception/MissingMailerException.php
@@ -21,6 +21,8 @@
*/
class MissingMailerException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Mailer class "%s" could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php b/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php
index 38c301b4e..43eaf8713 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Mailer.php
@@ -161,7 +161,6 @@
*/
abstract class Mailer implements EventListenerInterface
{
-
use ModelAwareTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php b/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php
index 8b98f50da..402e18beb 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/MailerAwareTrait.php
@@ -26,7 +26,6 @@
*/
trait MailerAwareTrait
{
-
/**
* Returns a mailer instance.
*
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Transport/DebugTransport.php b/app/vendor/cakephp/cakephp/src/Mailer/Transport/DebugTransport.php
index 0f973c03c..e93f6be47 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Transport/DebugTransport.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Transport/DebugTransport.php
@@ -25,7 +25,6 @@
*/
class DebugTransport extends AbstractTransport
{
-
/**
* Send mail
*
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php b/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php
index 885eff625..1916a3cf9 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php
@@ -25,7 +25,6 @@
*/
class MailTransport extends AbstractTransport
{
-
/**
* Send mail
*
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php b/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php
index 835245059..4df6382e1 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/Transport/SmtpTransport.php
@@ -25,7 +25,6 @@
*/
class SmtpTransport extends AbstractTransport
{
-
/**
* Default config for this class
*
@@ -39,13 +38,13 @@ class SmtpTransport extends AbstractTransport
'password' => null,
'client' => null,
'tls' => false,
- 'keepAlive' => false
+ 'keepAlive' => false,
];
/**
* Socket to SMTP server
*
- * @var \Cake\Network\Socket
+ * @var \Cake\Network\Socket|null
*/
protected $_socket;
@@ -200,7 +199,7 @@ protected function _bufferResponseLines(array $responseLines)
if (preg_match('/^(\d{3})(?:[ -]+(.*))?$/', $responseLine, $match)) {
$response[] = [
'code' => $match[1],
- 'message' => isset($match[2]) ? $match[2] : null
+ 'message' => isset($match[2]) ? $match[2] : null,
];
}
}
@@ -258,24 +257,66 @@ protected function _connect()
*/
protected function _auth()
{
- if (isset($this->_config['username'], $this->_config['password'])) {
- $replyCode = (string)$this->_smtpSend('AUTH LOGIN', '334|500|502|504');
- if ($replyCode === '334') {
- try {
- $this->_smtpSend(base64_encode($this->_config['username']), '334');
- } catch (SocketException $e) {
- throw new SocketException('SMTP server did not accept the username.', null, $e);
- }
- try {
- $this->_smtpSend(base64_encode($this->_config['password']), '235');
- } catch (SocketException $e) {
- throw new SocketException('SMTP server did not accept the password.', null, $e);
- }
- } elseif ($replyCode === '504') {
- throw new SocketException('SMTP authentication method not allowed, check if SMTP server requires TLS.');
- } else {
- throw new SocketException('AUTH command not recognized or not implemented, SMTP server may not require authentication.');
+ if (!isset($this->_config['username'], $this->_config['password'])) {
+ return;
+ }
+
+ $username = $this->_config['username'];
+ $password = $this->_config['password'];
+
+ $replyCode = $this->_authPlain($username, $password);
+ if ($replyCode === '235') {
+ return;
+ }
+
+ $this->_authLogin($username, $password);
+ }
+
+ /**
+ * Authenticate using AUTH PLAIN mechanism.
+ *
+ * @param string $username Username.
+ * @param string $password Password.
+ * @return string|null Response code for the command.
+ */
+ protected function _authPlain($username, $password)
+ {
+ return $this->_smtpSend(
+ sprintf(
+ 'AUTH PLAIN %s',
+ base64_encode(chr(0) . $username . chr(0) . $password)
+ ),
+ '235|504|534|535'
+ );
+ }
+
+ /**
+ * Authenticate using AUTH LOGIN mechanism.
+ *
+ * @param string $username Username.
+ * @param string $password Password.
+ * @return void
+ */
+ protected function _authLogin($username, $password)
+ {
+ $replyCode = $this->_smtpSend('AUTH LOGIN', '334|500|502|504');
+ if ($replyCode === '334') {
+ try {
+ $this->_smtpSend(base64_encode($username), '334');
+ } catch (SocketException $e) {
+ throw new SocketException('SMTP server did not accept the username.', null, $e);
}
+ try {
+ $this->_smtpSend(base64_encode($password), '235');
+ } catch (SocketException $e) {
+ throw new SocketException('SMTP server did not accept the password.', null, $e);
+ }
+ } elseif ($replyCode === '504') {
+ throw new SocketException('SMTP authentication method not allowed, check if SMTP server requires TLS.');
+ } else {
+ throw new SocketException(
+ 'AUTH command not recognized or not implemented, SMTP server may not require authentication.'
+ );
}
}
@@ -427,7 +468,7 @@ protected function _generateSocket()
* Protected method for sending data to SMTP connection
*
* @param string|null $data Data to be sent to SMTP server
- * @param string|bool $checkCode Code to check for in server response, false to skip
+ * @param string|false $checkCode Code to check for in server response, false to skip
* @return string|null The matched code, or null if nothing matched
* @throws \Cake\Network\Exception\SocketException
*/
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/TransportFactory.php b/app/vendor/cakephp/cakephp/src/Mailer/TransportFactory.php
index 77516151a..633289ad8 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/TransportFactory.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/TransportFactory.php
@@ -34,7 +34,7 @@ class TransportFactory
/**
* An array mapping url schemes to fully qualified Transport class names
*
- * @var array
+ * @var string[]
*/
protected static $_dsnClassMap = [
'debug' => 'Cake\Mailer\Transport\DebugTransport',
diff --git a/app/vendor/cakephp/cakephp/src/Mailer/TransportRegistry.php b/app/vendor/cakephp/cakephp/src/Mailer/TransportRegistry.php
index 3fba03b48..a2ededa03 100644
--- a/app/vendor/cakephp/cakephp/src/Mailer/TransportRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/Mailer/TransportRegistry.php
@@ -58,7 +58,7 @@ protected function _resolveClassName($class)
* Part of the template method for Cake\Core\ObjectRegistry::load()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the cache is missing in.
+ * @param string|null $plugin The plugin the cache is missing in.
* @return void
* @throws \BadMethodCallException
*/
@@ -103,10 +103,12 @@ protected function _create($class, $alias, $config)
* Remove a single adapter from the registry.
*
* @param string $name The adapter name.
- * @return void
+ * @return $this
*/
public function unload($name)
{
unset($this->_loaded[$name]);
+
+ return $this;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Network/Exception/SocketException.php b/app/vendor/cakephp/cakephp/src/Network/Exception/SocketException.php
index 3dcfb64cd..5819ddef7 100644
--- a/app/vendor/cakephp/cakephp/src/Network/Exception/SocketException.php
+++ b/app/vendor/cakephp/cakephp/src/Network/Exception/SocketException.php
@@ -20,7 +20,6 @@
*/
class SocketException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Network/Socket.php b/app/vendor/cakephp/cakephp/src/Network/Socket.php
index 9bc06e3fe..d8b4dbe74 100644
--- a/app/vendor/cakephp/cakephp/src/Network/Socket.php
+++ b/app/vendor/cakephp/cakephp/src/Network/Socket.php
@@ -14,6 +14,7 @@
*/
namespace Cake\Network;
+use Cake\Core\Exception\Exception as CakeException;
use Cake\Core\InstanceConfigTrait;
use Cake\Network\Exception\SocketException;
use Cake\Validation\Validation;
@@ -46,7 +47,7 @@ class Socket
'host' => 'localhost',
'protocol' => 'tcp',
'port' => 80,
- 'timeout' => 30
+ 'timeout' => 30,
];
/**
@@ -166,7 +167,8 @@ public function connect()
if ($port > 0) {
$remoteSocketTarget .= ':' . $port;
}
- $this->connection = stream_socket_client(
+
+ $this->connection = $this->_getStreamSocketClient(
$remoteSocketTarget,
$errNum,
$errStr,
@@ -194,6 +196,29 @@ public function connect()
return $this->connected;
}
+ /**
+ * Create a stream socket client. Mock utility.
+ *
+ * @param string $remoteSocketTarget remote socket
+ * @param int $errNum error number
+ * @param string $errStr error string
+ * @param int $timeout timeout
+ * @param int $connectAs flags
+ * @param resource $context context
+ * @return bool|resource
+ */
+ protected function _getStreamSocketClient($remoteSocketTarget, &$errNum, &$errStr, $timeout, $connectAs, $context)
+ {
+ return stream_socket_client(
+ $remoteSocketTarget,
+ $errNum,
+ $errStr,
+ $timeout,
+ $connectAs,
+ $context
+ );
+ }
+
/**
* Configure the SSL context options.
*
@@ -247,7 +272,7 @@ protected function _connectionErrorHandler($code, $message)
/**
* Get the connection context.
*
- * @return null|array Null when there is no connection, an array when there is.
+ * @return array|null Null when there is no connection, an array when there is.
*/
public function context()
{
@@ -472,6 +497,9 @@ public function enableCrypto($type, $clientOrServer = 'client', $enable = true)
}
try {
+ if ($this->connection === null) {
+ throw new CakeException('You must call connect() first.');
+ }
$enableCryptoResult = stream_socket_enable_crypto($this->connection, $enable, $method);
} catch (Exception $e) {
$this->setLastError(null, $e->getMessage());
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association.php b/app/vendor/cakephp/cakephp/src/ORM/Association.php
index a408c8338..96d945807 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association.php
@@ -34,7 +34,6 @@
*/
abstract class Association
{
-
use ConventionsTrait;
use LocatorAwareTrait;
@@ -188,12 +187,12 @@ abstract class Association
/**
* Valid strategies for this association. Subclasses can narrow this down.
*
- * @var array
+ * @var string[]
*/
protected $_validStrategies = [
self::STRATEGY_JOIN,
self::STRATEGY_SELECT,
- self::STRATEGY_SUBQUERY
+ self::STRATEGY_SUBQUERY,
];
/**
@@ -217,7 +216,7 @@ public function __construct($alias, array $options = [])
'tableLocator',
'propertyName',
'sourceTable',
- 'targetTable'
+ 'targetTable',
];
foreach ($defaults as $property) {
if (isset($options[$property])) {
@@ -345,7 +344,8 @@ public function cascadeCallbacks($cascadeCallbacks = null)
*/
public function setClassName($className)
{
- if ($this->_targetTable !== null &&
+ if (
+ $this->_targetTable !== null &&
get_class($this->_targetTable) !== App::className($className, 'Model/Table', 'Table')
) {
throw new InvalidArgumentException(
@@ -994,7 +994,7 @@ public function attachTo(Query $query, array $options = [])
'fields' => [],
'type' => $joinType,
'table' => $table,
- 'finder' => $this->getFinder()
+ 'finder' => $this->getFinder(),
];
if (!empty($options['foreignKey'])) {
@@ -1264,7 +1264,7 @@ protected function _formatAssociationResults($query, $surrogate, $options)
$property = $options['propertyPath'];
$propertyPath = explode('.', $property);
- $query->formatResults(function ($results) use ($formatters, $property, $propertyPath) {
+ $query->formatResults(function ($results) use ($formatters, $property, $propertyPath, $query) {
$extracted = [];
foreach ($results as $result) {
foreach ($propertyPath as $propertyPathItem) {
@@ -1281,8 +1281,17 @@ protected function _formatAssociationResults($query, $surrogate, $options)
$extracted = new ResultSetDecorator($callable($extracted));
}
- /* @var \Cake\Collection\CollectionInterface $results */
- return $results->insert($property, $extracted);
+ /** @var \Cake\Collection\CollectionInterface $results */
+ $results = $results->insert($property, $extracted);
+ if ($query->isHydrationEnabled()) {
+ $results = $results->map(function ($result) {
+ $result->clean();
+
+ return $result;
+ });
+ }
+
+ return $results;
}, Query::PREPEND);
}
@@ -1523,7 +1532,7 @@ abstract public function isOwningSide(Table $side);
*
* @param \Cake\Datasource\EntityInterface $entity the data to be saved
* @param array $options The options for saving associated data.
- * @return bool|\Cake\Datasource\EntityInterface false if $entity could not be saved, otherwise it returns
+ * @return \Cake\Datasource\EntityInterface|false False if $entity could not be saved, otherwise it returns
* the saved entity
* @see \Cake\ORM\Table::save()
*/
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsTo.php b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsTo.php
index 651f81e30..dac887d80 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsTo.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsTo.php
@@ -30,21 +30,20 @@
*/
class BelongsTo extends Association
{
-
/**
* Valid strategies for this type of association
*
- * @var array
+ * @var string[]
*/
protected $_validStrategies = [
self::STRATEGY_JOIN,
- self::STRATEGY_SELECT
+ self::STRATEGY_SELECT,
];
/**
* Gets the name of the field representing the foreign key to the target table.
*
- * @return string
+ * @return string|string[]
*/
public function getForeignKey()
{
@@ -112,7 +111,7 @@ public function type()
*
* @param \Cake\Datasource\EntityInterface $entity an entity from the source table
* @param array $options options to be passed to the save method in the target table
- * @return bool|\Cake\Datasource\EntityInterface false if $entity could not be saved, otherwise it returns
+ * @return \Cake\Datasource\EntityInterface|false False if $entity could not be saved, otherwise it returns
* the saved entity
* @see \Cake\ORM\Table::save()
*/
@@ -143,7 +142,7 @@ public function saveAssociated(EntityInterface $entity, array $options = [])
* clause for getting the results on the target table.
*
* @param array $options list of options passed to attachTo method
- * @return array
+ * @return \Cake\Database\Expression\IdentifierExpression[]
* @throws \RuntimeException if the number of columns in the foreignKey do not
* match the number of columns in the target table primaryKey
*/
@@ -194,7 +193,7 @@ public function eagerLoader(array $options)
'bindingKey' => $this->getBindingKey(),
'strategy' => $this->getStrategy(),
'associationType' => $this->type(),
- 'finder' => [$this, 'find']
+ 'finder' => [$this, 'find'],
]);
return $loader->buildEagerLoader($options);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php
index 9020fd837..aad0f83c9 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php
@@ -17,6 +17,7 @@
use Cake\Core\App;
use Cake\Database\ExpressionInterface;
use Cake\Database\Expression\IdentifierExpression;
+use Cake\Database\Expression\QueryExpression;
use Cake\Datasource\EntityInterface;
use Cake\Datasource\QueryInterface;
use Cake\ORM\Association;
@@ -36,7 +37,6 @@
*/
class BelongsToMany extends Association
{
-
/**
* Saving strategy that will only append to the links set
*
@@ -119,11 +119,11 @@ class BelongsToMany extends Association
/**
* Valid strategies for this type of association
*
- * @var array
+ * @var string[]
*/
protected $_validStrategies = [
self::STRATEGY_SELECT,
- self::STRATEGY_SUBQUERY
+ self::STRATEGY_SUBQUERY,
];
/**
@@ -139,14 +139,14 @@ class BelongsToMany extends Association
/**
* Filtered conditions that reference the target table.
*
- * @var null|array
+ * @var array|null
*/
protected $_targetConditions;
/**
* Filtered conditions that reference the junction table.
*
- * @var null|array
+ * @var array|null
*/
protected $_junctionConditions;
@@ -220,7 +220,7 @@ public function canBeJoined(array $options = [])
/**
* Gets the name of the field representing the foreign key to the source table.
*
- * @return string
+ * @return string|string[]
*/
public function getForeignKey()
{
@@ -353,10 +353,17 @@ protected function _generateTargetAssociations($junction, $source, $target)
{
$junctionAlias = $junction->getAlias();
$sAlias = $source->getAlias();
+ $tAlias = $target->getAlias();
+
+ $targetBindingKey = null;
+ if ($junction->hasAssociation($tAlias)) {
+ $targetBindingKey = $junction->getAssociation($tAlias)->getBindingKey();
+ }
if (!$target->hasAssociation($junctionAlias)) {
$target->hasMany($junctionAlias, [
'targetTable' => $junction,
+ 'bindingKey' => $targetBindingKey,
'foreignKey' => $this->getTargetForeignKey(),
'strategy' => $this->_strategy,
]);
@@ -391,9 +398,17 @@ protected function _generateTargetAssociations($junction, $source, $target)
protected function _generateSourceAssociations($junction, $source)
{
$junctionAlias = $junction->getAlias();
+ $sAlias = $source->getAlias();
+
+ $sourceBindingKey = null;
+ if ($junction->hasAssociation($sAlias)) {
+ $sourceBindingKey = $junction->getAssociation($sAlias)->getBindingKey();
+ }
+
if (!$source->hasAssociation($junctionAlias)) {
$source->hasMany($junctionAlias, [
'targetTable' => $junction,
+ 'bindingKey' => $sourceBindingKey,
'foreignKey' => $this->getForeignKey(),
'strategy' => $this->_strategy,
]);
@@ -424,13 +439,13 @@ protected function _generateJunctionAssociations($junction, $source, $target)
if (!$junction->hasAssociation($tAlias)) {
$junction->belongsTo($tAlias, [
'foreignKey' => $this->getTargetForeignKey(),
- 'targetTable' => $target
+ 'targetTable' => $target,
]);
}
if (!$junction->hasAssociation($sAlias)) {
$junction->belongsTo($sAlias, [
'foreignKey' => $this->getForeignKey(),
- 'targetTable' => $source
+ 'targetTable' => $source,
]);
}
}
@@ -514,12 +529,12 @@ protected function _appendNotMatching($query, $options)
$assoc = $junction->getAssociation($this->getTarget()->getAlias());
$conditions = $assoc->_joinCondition([
- 'foreignKey' => $this->getTargetForeignKey()
+ 'foreignKey' => $this->getTargetForeignKey(),
]);
$subquery = $this->_appendJunctionJoin($subquery, $conditions);
$query
- ->andWhere(function ($exp) use ($subquery, $conds) {
+ ->andWhere(function (QueryExpression $exp) use ($subquery, $conds) {
$identifiers = [];
foreach (array_keys($conds) as $field) {
$identifiers[] = new IdentifierExpression($field);
@@ -528,7 +543,7 @@ protected function _appendNotMatching($query, $options)
$nullExp = clone $exp;
return $exp
- ->or_([
+ ->or([
$exp->notIn($identifiers, $subquery),
$nullExp->and(array_map([$nullExp, 'isNull'], array_keys($conds))),
]);
@@ -579,7 +594,7 @@ public function eagerLoader(array $options)
'junctionConditions' => $this->junctionConditions(),
'finder' => function () {
return $this->_appendJunctionJoin($this->find(), []);
- }
+ },
]);
return $loader->buildEagerLoader($options);
@@ -704,7 +719,7 @@ public function saveStrategy($strategy = null)
* @param array $options options to be passed to the save method in the target table
* @throws \InvalidArgumentException if the property representing the association
* in the parent entity cannot be traversed
- * @return bool|\Cake\Datasource\EntityInterface false if $entity could not be saved, otherwise it returns
+ * @return \Cake\Datasource\EntityInterface|false False if $entity could not be saved, otherwise it returns
* the saved entity
* @see \Cake\ORM\Table::save()
* @see \Cake\ORM\Association\BelongsToMany::replaceLinks()
@@ -744,7 +759,7 @@ public function saveAssociated(EntityInterface $entity, array $options = [])
* @param array $options list of options accepted by `Table::save()`
* @throws \InvalidArgumentException if the property representing the association
* in the parent entity cannot be traversed
- * @return \Cake\Datasource\EntityInterface|bool The parent entity after all links have been
+ * @return \Cake\Datasource\EntityInterface|false The parent entity after all links have been
* created if no errors happened, false otherwise
*/
protected function _saveTarget(EntityInterface $parentEntity, $entities, $options)
@@ -822,7 +837,7 @@ protected function _saveLinks(EntityInterface $sourceEntity, $targetEntities, $o
$belongsTo = $junction->getAssociation($target->getAlias());
$foreignKey = (array)$this->getForeignKey();
$assocForeignKey = (array)$belongsTo->getForeignKey();
- $targetPrimaryKey = (array)$target->getPrimaryKey();
+ $targetBindingKey = (array)$belongsTo->getBindingKey();
$bindingKey = (array)$this->getBindingKey();
$jointProperty = $this->_junctionProperty;
$junctionRegistryAlias = $junction->getRegistryAlias();
@@ -833,7 +848,7 @@ protected function _saveLinks(EntityInterface $sourceEntity, $targetEntities, $o
$joint = new $entityClass([], ['markNew' => true, 'source' => $junctionRegistryAlias]);
}
$sourceKeys = array_combine($foreignKey, $sourceEntity->extract($bindingKey));
- $targetKeys = array_combine($assocForeignKey, $e->extract($targetPrimaryKey));
+ $targetKeys = array_combine($assocForeignKey, $e->extract($targetBindingKey));
$changedKeys = (
$sourceKeys !== $joint->extract($foreignKey) ||
@@ -844,7 +859,7 @@ protected function _saveLinks(EntityInterface $sourceEntity, $targetEntities, $o
// as new, we let save() sort out whether or not we have a new link
// or if we are updating an existing link.
if ($changedKeys) {
- $joint->isNew(true);
+ $joint->setNew(true);
$joint->unsetProperty($junction->getPrimaryKey())
->set(array_merge($sourceKeys, $targetKeys), ['guard' => false]);
}
@@ -945,7 +960,7 @@ public function unlink(EntityInterface $sourceEntity, array $targetEntities, $op
{
if (is_bool($options)) {
$options = [
- 'cleanProperty' => $options
+ 'cleanProperty' => $options,
];
} else {
$options += ['cleanProperty' => true];
@@ -1112,7 +1127,7 @@ public function find($type = null, array $options = [])
$belongsTo = $this->junction()->getAssociation($this->getTarget()->getAlias());
$conditions = $belongsTo->_joinCondition([
- 'foreignKey' => $this->getTargetForeignKey()
+ 'foreignKey' => $this->getTargetForeignKey(),
]);
$conditions += $this->junctionConditions();
@@ -1135,8 +1150,8 @@ protected function _appendJunctionJoin($query, $conditions)
$name => [
'table' => $this->junction()->getTable(),
'conditions' => $conditions,
- 'type' => QueryInterface::JOIN_TYPE_INNER
- ]
+ 'type' => QueryInterface::JOIN_TYPE_INNER,
+ ],
];
$assoc = $this->getTarget()->getAssociation($name);
@@ -1434,7 +1449,7 @@ protected function _junctionTableName($name = null)
if (empty($this->_junctionTableName)) {
$tablesNames = array_map('Cake\Utility\Inflector::underscore', [
$this->getSource()->getTable(),
- $this->getTarget()->getTable()
+ $this->getTarget()->getTable(),
]);
sort($tablesNames);
$this->_junctionTableName = implode('_', $tablesNames);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteHelper.php b/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteHelper.php
index 5bd74aff6..7e395c56b 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteHelper.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteHelper.php
@@ -24,7 +24,6 @@
*/
class DependentDeleteHelper
{
-
/**
* Cascade a delete to remove dependent records.
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteTrait.php b/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteTrait.php
index aab6048a1..16d30d746 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteTrait.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteTrait.php
@@ -26,7 +26,6 @@
*/
trait DependentDeleteTrait
{
-
/**
* Cascade a delete to remove dependent records.
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php b/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php
index 3d39cbe74..f8c238849 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/HasMany.php
@@ -1,6 +1,5 @@
isNew() ||
+ if (
+ $entity->isNew() ||
$this->getSaveStrategy() !== self::SAVE_REPLACE
) {
return $entity;
@@ -180,7 +179,8 @@ public function saveAssociated(EntityInterface $entity, array $options = [])
$targetEntities = [];
}
- if (!is_array($targetEntities) &&
+ if (
+ !is_array($targetEntities) &&
!($targetEntities instanceof Traversable)
) {
$name = $this->getProperty();
@@ -195,7 +195,8 @@ public function saveAssociated(EntityInterface $entity, array $options = [])
$options['_sourceTable'] = $this->getSource();
- if ($this->_saveStrategy === self::SAVE_REPLACE &&
+ if (
+ $this->_saveStrategy === self::SAVE_REPLACE &&
!$this->_unlinkAssociated($foreignKeyReference, $entity, $this->getTarget(), $targetEntities, $options)
) {
return false;
@@ -357,7 +358,7 @@ public function unlink(EntityInterface $sourceEntity, array $targetEntities, $op
{
if (is_bool($options)) {
$options = [
- 'cleanProperty' => $options
+ 'cleanProperty' => $options,
];
} else {
$options += ['cleanProperty' => true];
@@ -377,7 +378,7 @@ public function unlink(EntityInterface $sourceEntity, array $targetEntities, $op
/** @var \Cake\Datasource\EntityInterface $entity */
return $entity->extract($targetPrimaryKey);
})
- ->toList()
+ ->toList(),
];
$this->_unlink($foreignKey, $target, $conditions, $options);
@@ -493,9 +494,9 @@ function ($v) {
if (count($exclusions) > 0) {
$conditions = [
'NOT' => [
- 'OR' => $exclusions
+ 'OR' => $exclusions,
],
- $foreignKeyReference
+ $foreignKeyReference,
];
}
@@ -532,16 +533,13 @@ protected function _unlink(array $foreignKey, Table $target, array $conditions =
return $ok;
}
-
- $conditions = array_merge($conditions, $this->getConditions());
- $target->deleteAll($conditions);
+ $this->deleteAll($conditions);
return true;
}
$updateFields = array_fill_keys($foreignKey, null);
- $conditions = array_merge($conditions, $this->getConditions());
- $target->updateAll($updateFields, $conditions);
+ $this->updateAll($updateFields, $conditions);
return true;
}
@@ -691,7 +689,7 @@ public function eagerLoader(array $options)
'strategy' => $this->getStrategy(),
'associationType' => $this->type(),
'sort' => $this->getSort(),
- 'finder' => [$this, 'find']
+ 'finder' => [$this, 'find'],
]);
return $loader->buildEagerLoader($options);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/HasOne.php b/app/vendor/cakephp/cakephp/src/ORM/Association/HasOne.php
index 88e6b49f4..14efa63e0 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/HasOne.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/HasOne.php
@@ -32,11 +32,11 @@ class HasOne extends Association
/**
* Valid strategies for this type of association
*
- * @var array
+ * @var string[]
*/
protected $_validStrategies = [
self::STRATEGY_JOIN,
- self::STRATEGY_SELECT
+ self::STRATEGY_SELECT,
];
/**
@@ -96,7 +96,7 @@ public function type()
*
* @param \Cake\Datasource\EntityInterface $entity an entity from the source table
* @param array $options options to be passed to the save method in the target table
- * @return bool|\Cake\Datasource\EntityInterface false if $entity could not be saved, otherwise it returns
+ * @return \Cake\Datasource\EntityInterface|false False if $entity could not be saved, otherwise it returns
* the saved entity
* @see \Cake\ORM\Table::save()
*/
@@ -137,7 +137,7 @@ public function eagerLoader(array $options)
'bindingKey' => $this->getBindingKey(),
'strategy' => $this->getStrategy(),
'associationType' => $this->type(),
- 'finder' => [$this, 'find']
+ 'finder' => [$this, 'find'],
]);
return $loader->buildEagerLoader($options);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php
index 14e896370..dabcd497e 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectLoader.php
@@ -28,7 +28,6 @@
*/
class SelectLoader
{
-
/**
* The alias of the association loading the results
*
@@ -139,7 +138,7 @@ protected function _defaultOptions()
'conditions' => [],
'strategy' => $this->strategy,
'nestKey' => $this->alias,
- 'sort' => $this->sort
+ 'sort' => $this->sort,
];
}
@@ -163,7 +162,7 @@ protected function _buildQuery($options)
$options['fields'] = [];
}
- /* @var \Cake\ORM\Query $query */
+ /** @var \Cake\ORM\Query $query */
$query = $finder();
if (isset($options['finder'])) {
list($finderName, $opts) = $this->_extractFinder($options['finder']);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectWithPivotLoader.php b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectWithPivotLoader.php
index 521a2ace5..df9c81955 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectWithPivotLoader.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Association/Loader/SelectWithPivotLoader.php
@@ -23,7 +23,6 @@
*/
class SelectWithPivotLoader extends SelectLoader
{
-
/**
* The name of the junction association
*
@@ -54,7 +53,6 @@ class SelectWithPivotLoader extends SelectLoader
/**
* {@inheritDoc}
- *
*/
public function __construct(array $options)
{
@@ -128,6 +126,14 @@ protected function _buildQuery($options)
return $query;
}
+ /**
+ * @inheritDoc
+ */
+ protected function _assertFieldsPresent($fetchQuery, $key)
+ {
+ // _buildQuery() manually adds in required fields from junction table
+ }
+
/**
* Generates a string used as a table field that contains the values upon
* which the filter should be applied
diff --git a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php
index a6ccca210..7ac3f7b83 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php
@@ -29,7 +29,6 @@
*/
class AssociationCollection implements IteratorAggregate
{
-
use AssociationsNormalizerTrait;
use LocatorAwareTrait;
@@ -84,7 +83,7 @@ public function add($alias, Association $association)
public function load($className, $associated, array $options = [])
{
$options += [
- 'tableLocator' => $this->getTableLocator()
+ 'tableLocator' => $this->getTableLocator(),
];
$association = new $className($associated, $options);
@@ -171,7 +170,7 @@ public function type($class)
/**
* Get an array of associations matching a specific type.
*
- * @param string|array $class The type of associations you want.
+ * @param string|string[] $class The type of associations you want.
* For example 'BelongsTo' or array like ['BelongsTo', 'HasOne']
* @return array An array of Association objects.
* @since 3.5.3
diff --git a/app/vendor/cakephp/cakephp/src/ORM/AssociationsNormalizerTrait.php b/app/vendor/cakephp/cakephp/src/ORM/AssociationsNormalizerTrait.php
index 335804b41..8c96e4dbc 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/AssociationsNormalizerTrait.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/AssociationsNormalizerTrait.php
@@ -20,12 +20,11 @@
*/
trait AssociationsNormalizerTrait
{
-
/**
* Returns an array out of the original passed associations list where dot notation
* is transformed into nested arrays so that they can be parsed by other routines
*
- * @param array $associations The array of included associations.
+ * @param array|string $associations The array of included associations.
* @return array An array having dot notation transformed into nested arrays
*/
protected function _normalizeAssociations($associations)
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior.php
index fce15777b..57513505a 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior.php
@@ -112,7 +112,6 @@
*/
class Behavior implements EventListenerInterface
{
-
use InstanceConfigTrait;
/**
@@ -261,6 +260,7 @@ public function implementedEvents()
{
$eventMap = [
'Model.beforeMarshal' => 'beforeMarshal',
+ 'Model.afterMarshal' => 'afterMarshal',
'Model.beforeFind' => 'beforeFind',
'Model.beforeSave' => 'beforeSave',
'Model.afterSave' => 'afterSave',
@@ -286,7 +286,7 @@ public function implementedEvents()
} else {
$events[$event] = [
'callable' => $method,
- 'priority' => $priority
+ 'priority' => $priority,
];
}
}
@@ -306,8 +306,8 @@ public function implementedEvents()
* ]
* ```
*
- * With the above example, a call to `$Table->find('this')` will call `$Behavior->findThis()`
- * and a call to `$Table->find('alias')` will call `$Behavior->findMethodName()`
+ * With the above example, a call to `$table->find('this')` will call `$behavior->findThis()`
+ * and a call to `$table->find('alias')` will call `$behavior->findMethodName()`
*
* It is recommended, though not required, to define implementedFinders in the config property
* of child classes such that it is not necessary to use reflections to derive the available
@@ -379,14 +379,14 @@ protected function _reflectionCache()
$eventMethods = [];
foreach ($events as $e => $binding) {
if (is_array($binding) && isset($binding['callable'])) {
- /* @var string $callable */
+ /** @var string $callable */
$callable = $binding['callable'];
$binding = $callable;
}
$eventMethods[$binding] = true;
}
- $baseClass = 'Cake\ORM\Behavior';
+ $baseClass = self::class;
if (isset(self::$_reflectionCache[$baseClass])) {
$baseMethods = self::$_reflectionCache[$baseClass];
} else {
@@ -396,14 +396,15 @@ protected function _reflectionCache()
$return = [
'finders' => [],
- 'methods' => []
+ 'methods' => [],
];
$reflection = new ReflectionClass($class);
foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$methodName = $method->getName();
- if (in_array($methodName, $baseMethods, true) ||
+ if (
+ in_array($methodName, $baseMethods, true) ||
isset($eventMethods[$methodName])
) {
continue;
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/CounterCacheBehavior.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/CounterCacheBehavior.php
index b89a42d37..f9b63de3e 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/CounterCacheBehavior.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/CounterCacheBehavior.php
@@ -100,7 +100,6 @@
*/
class CounterCacheBehavior extends Behavior
{
-
/**
* Store the fields which should be ignored
*
@@ -134,7 +133,8 @@ public function beforeSave(Event $event, EntityInterface $entity, $options)
$registryAlias = $assoc->getTarget()->getRegistryAlias();
$entityAlias = $assoc->getProperty();
- if (!is_callable($config) &&
+ if (
+ !is_callable($config) &&
isset($config['ignoreDirty']) &&
$config['ignoreDirty'] === true &&
$entity->$entityAlias->isDirty($field)
@@ -227,7 +227,8 @@ protected function _processAssociation(Event $event, EntityInterface $entity, As
$config = [];
}
- if (isset($this->_ignoreDirty[$assoc->getTarget()->getRegistryAlias()][$field]) &&
+ if (
+ isset($this->_ignoreDirty[$assoc->getTarget()->getRegistryAlias()][$field]) &&
$this->_ignoreDirty[$assoc->getTarget()->getRegistryAlias()][$field] === true
) {
continue;
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TimestampBehavior.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TimestampBehavior.php
index 6d2d54fec..71a8e8bd2 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TimestampBehavior.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TimestampBehavior.php
@@ -27,7 +27,6 @@
*/
class TimestampBehavior extends Behavior
{
-
/**
* Default config
*
@@ -47,15 +46,15 @@ class TimestampBehavior extends Behavior
'implementedFinders' => [],
'implementedMethods' => [
'timestamp' => 'timestamp',
- 'touch' => 'touch'
+ 'touch' => 'touch',
],
'events' => [
'Model.beforeSave' => [
'created' => 'new',
- 'modified' => 'always'
- ]
+ 'modified' => 'always',
+ ],
],
- 'refreshTimestamp' => true
+ 'refreshTimestamp' => true,
];
/**
@@ -87,7 +86,7 @@ public function initialize(array $config)
* @param \Cake\Event\Event $event Event instance.
* @param \Cake\Datasource\EntityInterface $entity Entity instance.
* @throws \UnexpectedValueException if a field's when value is misdefined
- * @return bool Returns true irrespective of the behavior logic, the save will not be prevented.
+ * @return true Returns true irrespective of the behavior logic, the save will not be prevented.
* @throws \UnexpectedValueException When the value for an event is not 'always', 'new' or 'existing'
*/
public function handleEvent(Event $event, EntityInterface $entity)
@@ -104,7 +103,8 @@ public function handleEvent(Event $event, EntityInterface $entity)
sprintf('When should be one of "always", "new" or "existing". The passed value "%s" is invalid', $when)
);
}
- if ($when === 'always' ||
+ if (
+ $when === 'always' ||
($when === 'new' && $new) ||
($when === 'existing' && !$new)
) {
@@ -174,7 +174,7 @@ public function touch(EntityInterface $entity, $eventName = 'Model.beforeSave')
$refresh = $this->_config['refreshTimestamp'];
foreach ($events[$eventName] as $field => $when) {
- if (in_array($when, ['always', 'existing'])) {
+ if (in_array($when, ['always', 'existing'], true)) {
$return = true;
$entity->setDirty($field, false);
$this->_updateField($entity, $field, $refresh);
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/TranslateTrait.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/TranslateTrait.php
index 343740e23..9ce6126e0 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/TranslateTrait.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/TranslateTrait.php
@@ -22,7 +22,6 @@
*/
trait TranslateTrait
{
-
/**
* Returns the entity containing the translated fields for this object and for
* the specified language. If the translation for the passed language is not
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TranslateBehavior.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TranslateBehavior.php
index 9d3219ad2..c44083793 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TranslateBehavior.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TranslateBehavior.php
@@ -42,7 +42,6 @@
*/
class TranslateBehavior extends Behavior implements PropertyMarshalInterface
{
-
use LocatorAwareTrait;
/**
@@ -80,7 +79,7 @@ class TranslateBehavior extends Behavior implements PropertyMarshalInterface
'setLocale' => 'setLocale',
'getLocale' => 'getLocale',
'locale' => 'locale',
- 'translationField' => 'translationField'
+ 'translationField' => 'translationField',
],
'fields' => [],
'translationTable' => 'I18n',
@@ -90,7 +89,7 @@ class TranslateBehavior extends Behavior implements PropertyMarshalInterface
'onlyTranslated' => false,
'strategy' => 'subquery',
'tableLocator' => null,
- 'validator' => false
+ 'validator' => false,
];
/**
@@ -103,7 +102,7 @@ public function __construct(Table $table, array $config = [])
{
$config += [
'defaultLocale' => I18n::getDefaultLocale(),
- 'referenceName' => $this->_referenceName($table)
+ 'referenceName' => $this->_referenceName($table),
];
if (isset($config['tableLocator'])) {
@@ -144,7 +143,6 @@ public function initialize(array $config)
* @param string $table the table name to use for storing each field translation
* @param string $model the model field value
* @param string $strategy the strategy used in the _i18n association
- *
* @return void
*/
public function setupFieldAssociations($fields, $table, $model, $strategy)
@@ -161,7 +159,7 @@ public function setupFieldAssociations($fields, $table, $model, $strategy)
$fieldTable = $tableLocator->get($name, [
'className' => $table,
'alias' => $name,
- 'table' => $this->_translationTable->getTable()
+ 'table' => $this->_translationTable->getTable(),
]);
} else {
$fieldTable = $tableLocator->get($name);
@@ -180,7 +178,7 @@ public function setupFieldAssociations($fields, $table, $model, $strategy)
'foreignKey' => 'foreign_key',
'joinType' => $filter ? QueryInterface::JOIN_TYPE_INNER : QueryInterface::JOIN_TYPE_LEFT,
'conditions' => $conditions,
- 'propertyName' => $field . '_translation'
+ 'propertyName' => $field . '_translation',
]);
}
@@ -195,7 +193,7 @@ public function setupFieldAssociations($fields, $table, $model, $strategy)
'strategy' => $strategy,
'conditions' => $conditions,
'propertyName' => '_i18n',
- 'dependent' => true
+ 'dependent' => true,
]);
}
@@ -219,11 +217,12 @@ public function beforeFind(Event $event, Query $query, $options)
$conditions = function ($field, $locale, $query, $select) {
return function ($q) use ($field, $locale, $query, $select) {
- /* @var \Cake\Datasource\QueryInterface $q */
+ /** @var \Cake\Datasource\QueryInterface $q */
$q->where([$q->getRepository()->aliasField('locale') => $locale]);
- /* @var \Cake\ORM\Query $query */
- if ($query->isAutoFieldsEnabled() ||
+ /** @var \Cake\ORM\Query $query */
+ if (
+ $query->isAutoFieldsEnabled() ||
in_array($field, $select, true) ||
in_array($this->_table->aliasField($field), $select, true)
) {
@@ -332,7 +331,7 @@ public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $o
'field IN' => $fields,
'locale' => $locale,
'foreign_key' => $key,
- 'model' => $model
+ 'model' => $model,
])
->disableBufferedResults()
->all()
@@ -348,7 +347,7 @@ public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $o
foreach ($new as $field => $content) {
$new[$field] = new Entity(compact('locale', 'field', 'content', 'model'), [
'useSetters' => false,
- 'markNew' => true
+ 'markNew' => true,
]);
}
@@ -374,11 +373,11 @@ public function afterSave(Event $event, EntityInterface $entity)
}
/**
+ * {@inheritDoc}
+ *
* Add in `_translations` marshalling handlers. You can disable marshalling
* of translations by setting `'translations' => false` in the options
* provided to `Table::newEntity()` or `Table::patchEntity()`.
- *
- * {@inheritDoc}
*/
public function buildMarshalMap($marshaller, $map, $options)
{
@@ -388,7 +387,7 @@ public function buildMarshalMap($marshaller, $map, $options)
return [
'_translations' => function ($value, $entity) use ($marshaller, $options) {
- /* @var \Cake\Datasource\EntityInterface $entity */
+ /** @var \Cake\Datasource\EntityInterface $entity */
$translations = $entity->get('_translations');
foreach ($this->_config['fields'] as $field) {
$options['validate'] = $this->_config['validator'];
@@ -411,7 +410,7 @@ public function buildMarshalMap($marshaller, $map, $options)
}
return $translations;
- }
+ },
];
}
@@ -432,8 +431,8 @@ public function buildMarshalMap($marshaller, $map, $options)
* globally configured locale.
* @return $this
* @see \Cake\ORM\Behavior\TranslateBehavior::getLocale()
- * @link https://book.cakephp.org/3.0/en/orm/behaviors/translate.html#retrieving-one-language-without-using-i18n-locale
- * @link https://book.cakephp.org/3.0/en/orm/behaviors/translate.html#saving-in-another-language
+ * @link https://book.cakephp.org/3/en/orm/behaviors/translate.html#retrieving-one-language-without-using-i18n-locale
+ * @link https://book.cakephp.org/3/en/orm/behaviors/translate.html#saving-in-another-language
*/
public function setLocale($locale)
{
@@ -535,7 +534,7 @@ public function findTranslations(Query $query, array $options)
return $query
->contain([$targetAlias => function ($query) use ($locales, $targetAlias) {
if ($locales) {
- /* @var \Cake\Datasource\QueryInterface $query */
+ /** @var \Cake\Datasource\QueryInterface $query */
$query->where(["$targetAlias.locale IN" => $locales]);
}
@@ -602,7 +601,7 @@ protected function _rowMapper($results, $locale)
$row['_locale'] = $locale;
if ($hydrated) {
- /* @var \Cake\Datasource\EntityInterface $row */
+ /** @var \Cake\Datasource\EntityInterface $row */
$row->clean();
}
@@ -635,7 +634,7 @@ public function groupTranslations($results)
$translation = new $entityClass($keys + ['locale' => $locale], [
'markNew' => false,
'useSetters' => false,
- 'markClean' => true
+ 'markClean' => true,
]);
$result[$locale] = $translation;
}
@@ -678,7 +677,7 @@ protected function _bundleTranslatedFields($entity)
}
$find[] = ['locale' => $lang, 'field' => $field, 'foreign_key' => $key];
$contents[] = new Entity(['content' => $translation->get($field)], [
- 'useSetters' => false
+ 'useSetters' => false,
]);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TreeBehavior.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TreeBehavior.php
index 44b32daac..d37d0a227 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/TreeBehavior.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/TreeBehavior.php
@@ -37,7 +37,6 @@
*/
class TreeBehavior extends Behavior
{
-
/**
* Cached copy of the first column in a table's primary key.
*
@@ -195,7 +194,7 @@ protected function _setChildrenLevel($entity)
'order' => $config['left'],
]);
- /* @var \Cake\Datasource\EntityInterface $node */
+ /** @var \Cake\Datasource\EntityInterface $node */
foreach ($children as $node) {
$parentIdValue = $node->get($config['parent']);
$depth = $depths[$parentIdValue] + 1;
@@ -227,7 +226,7 @@ public function beforeDelete(Event $event, EntityInterface $entity)
$query = $this->_scope($this->_table->query())
->delete()
->where(function ($exp) use ($config, $left, $right) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp
->gte($config['leftField'], $left + 1)
->lte($config['leftField'], $right - 1);
@@ -347,7 +346,7 @@ protected function _unmarkInternalTree()
$config = $this->getConfig();
$this->_table->updateAll(
function ($exp) use ($config) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
$leftInverse = clone $exp;
$leftInverse->setConjunction('*')->add('-1');
$rightInverse = clone $leftInverse;
@@ -357,7 +356,7 @@ function ($exp) use ($config) {
->eq($config['rightField'], $rightInverse->add($config['rightField']));
},
function ($exp) use ($config) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp->lt($config['leftField'], 0);
}
);
@@ -521,7 +520,7 @@ public function findTreeList(Query $query, array $options)
public function formatTreeList(Query $query, array $options = [])
{
return $query->formatResults(function ($results) use ($options) {
- /* @var \Cake\Collection\CollectionTrait $results */
+ /** @var \Cake\Collection\CollectionTrait $results */
$options += [
'keyPath' => $this->_getPrimaryKey(),
'valuePath' => $this->_table->getDisplayField(),
@@ -604,7 +603,7 @@ protected function _removeFromTree($node)
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node, or true to move to first position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
- * @return \Cake\Datasource\EntityInterface|bool $node The node after being moved or false on failure
+ * @return \Cake\Datasource\EntityInterface|false $node The node after being moved or false on failure
*/
public function moveUp(EntityInterface $node, $number = 1)
{
@@ -625,7 +624,7 @@ public function moveUp(EntityInterface $node, $number = 1)
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node, or true to move to first position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
- * @return \Cake\Datasource\EntityInterface|bool $node The node after being moved or false on failure
+ * @return \Cake\Datasource\EntityInterface|false $node The node after being moved or false on failure
*/
protected function _moveUp($node, $number)
{
@@ -639,7 +638,7 @@ protected function _moveUp($node, $number)
->select([$left, $right])
->where(["$parent IS" => $nodeParent])
->where(function ($exp) use ($config, $nodeLeft) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp->lt($config['rightField'], $nodeLeft);
})
->orderDesc($config['leftField'])
@@ -652,7 +651,7 @@ protected function _moveUp($node, $number)
->select([$left, $right])
->where(["$parent IS" => $nodeParent])
->where(function ($exp) use ($config, $nodeLeft) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp->lt($config['rightField'], $nodeLeft);
})
->orderAsc($config['leftField'])
@@ -694,7 +693,7 @@ protected function _moveUp($node, $number)
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node or true to move to last position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
- * @return \Cake\Datasource\EntityInterface|bool the entity after being moved or false on failure
+ * @return \Cake\Datasource\EntityInterface|false the entity after being moved or false on failure
*/
public function moveDown(EntityInterface $node, $number = 1)
{
@@ -715,7 +714,7 @@ public function moveDown(EntityInterface $node, $number = 1)
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node, or true to move to last position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
- * @return \Cake\Datasource\EntityInterface|bool $node The node after being moved or false on failure
+ * @return \Cake\Datasource\EntityInterface|false $node The node after being moved or false on failure
*/
protected function _moveDown($node, $number)
{
@@ -729,7 +728,7 @@ protected function _moveDown($node, $number)
->select([$left, $right])
->where(["$parent IS" => $nodeParent])
->where(function ($exp) use ($config, $nodeRight) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp->gt($config['leftField'], $nodeRight);
})
->orderAsc($config['leftField'])
@@ -742,7 +741,7 @@ protected function _moveDown($node, $number)
->select([$left, $right])
->where(["$parent IS" => $nodeParent])
->where(function ($exp) use ($config, $nodeRight) {
- /* @var \Cake\Database\Expression\QueryExpression $exp */
+ /** @var \Cake\Database\Expression\QueryExpression $exp */
return $exp->gt($config['leftField'], $nodeRight);
})
->orderDesc($config['leftField'])
@@ -820,47 +819,41 @@ public function recover()
/**
* Recursive method used to recover a single level of the tree
*
- * @param int $counter The Last left column value that was assigned
+ * @param int $lftRght The starting lft/rght value
* @param mixed $parentId the parent id of the level to be recovered
* @param int $level Node level
- * @return int The next value to use for the left column
+ * @return int The next lftRght value
*/
- protected function _recoverTree($counter = 0, $parentId = null, $level = -1)
+ protected function _recoverTree($lftRght = 1, $parentId = null, $level = 0)
{
$config = $this->getConfig();
list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
$primaryKey = $this->_getPrimaryKey();
- $aliasedPrimaryKey = $this->_table->aliasField($primaryKey);
- $order = $config['recoverOrder'] ?: $aliasedPrimaryKey;
+ $order = $config['recoverOrder'] ?: $primaryKey;
- $query = $this->_scope($this->_table->query())
- ->select([$aliasedPrimaryKey])
- ->where([$this->_table->aliasField($parent) . ' IS' => $parentId])
+ $nodes = $this->_scope($this->_table->query())
+ ->select($primaryKey)
+ ->where([$parent . ' IS' => $parentId])
->order($order)
- ->disableHydration();
+ ->disableHydration()
+ ->all();
- $leftCounter = $counter;
- $nextLevel = $level + 1;
- foreach ($query as $row) {
- $counter++;
- $counter = $this->_recoverTree($counter, $row[$primaryKey], $nextLevel);
- }
+ foreach ($nodes as $node) {
+ $nodeLft = $lftRght++;
+ $lftRght = $this->_recoverTree($lftRght, $node[$primaryKey], $level + 1);
- if ($parentId === null) {
- return $counter;
- }
+ $fields = [$left => $nodeLft, $right => $lftRght++];
+ if ($config['level']) {
+ $fields[$config['level']] = $level;
+ }
- $fields = [$left => $leftCounter, $right => $counter + 1];
- if ($config['level']) {
- $fields[$config['level']] = $level;
+ $this->_table->updateAll(
+ $fields,
+ [$primaryKey => $node[$primaryKey]]
+ );
}
- $this->_table->updateAll(
- $fields,
- [$primaryKey => $parentId]
- );
-
- return $counter + 1;
+ return $lftRght;
}
/**
@@ -877,7 +870,7 @@ protected function _getMax()
->orderDesc($rightField)
->first();
- if (empty($edge->{$field})) {
+ if ($edge === null || empty($edge[$field])) {
return 0;
}
@@ -987,7 +980,7 @@ protected function _getPrimaryKey()
* Returns the depth level of a node in the tree.
*
* @param int|string|\Cake\Datasource\EntityInterface $entity The entity or primary key get the level of.
- * @return int|bool Integer of the level or false if the node does not exist.
+ * @return int|false Integer of the level or false if the node does not exist.
*/
public function getLevel($entity)
{
diff --git a/app/vendor/cakephp/cakephp/src/ORM/BehaviorRegistry.php b/app/vendor/cakephp/cakephp/src/ORM/BehaviorRegistry.php
index a72389e6e..d5c7f84d0 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/BehaviorRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/BehaviorRegistry.php
@@ -27,10 +27,11 @@
* and constructing behavior objects.
*
* This class also provides method for checking and dispatching behavior methods.
+ *
+ * @extends \Cake\Core\ObjectRegistry<\Cake\ORM\Behavior>
*/
class BehaviorRegistry extends ObjectRegistry implements EventDispatcherInterface
{
-
use EventDispatcherTrait;
/**
@@ -118,7 +119,7 @@ protected function _resolveClassName($class)
* and Cake\Core\ObjectRegistry::unload()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the behavior is missing in.
+ * @param string|null $plugin The plugin the behavior is missing in.
* @return void
* @throws \Cake\ORM\Exception\MissingBehaviorException
*/
@@ -126,7 +127,7 @@ protected function _throwMissingClassError($class, $plugin)
{
throw new MissingBehaviorException([
'class' => $class . 'Behavior',
- 'plugin' => $plugin
+ 'plugin' => $plugin,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/EagerLoadable.php b/app/vendor/cakephp/cakephp/src/ORM/EagerLoadable.php
index 9d93f5b1b..b01e6809e 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/EagerLoadable.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/EagerLoadable.php
@@ -24,7 +24,6 @@
*/
class EagerLoadable
{
-
/**
* The name of the association to load.
*
@@ -132,7 +131,7 @@ public function __construct($name, array $config = [])
$this->_name = $name;
$allowed = [
'associations', 'instance', 'config', 'canBeJoined',
- 'aliasPath', 'propertyPath', 'forMatching', 'targetProperty'
+ 'aliasPath', 'propertyPath', 'forMatching', 'targetProperty',
];
foreach ($allowed as $property) {
if (isset($config[$property])) {
@@ -337,8 +336,8 @@ public function asContainArray()
return [
$this->_name => [
'associations' => $associations,
- 'config' => $config
- ]
+ 'config' => $config,
+ ],
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/EagerLoader.php b/app/vendor/cakephp/cakephp/src/ORM/EagerLoader.php
index 83f0d4bf7..55eb4a08f 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/EagerLoader.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/EagerLoader.php
@@ -28,7 +28,6 @@
*/
class EagerLoader
{
-
/**
* Nested array describing the association to be fetched
* and the options to apply for each of them, if any
@@ -62,7 +61,7 @@ class EagerLoader
'finder' => 1,
'joinType' => 1,
'strategy' => 1,
- 'negateMatch' => 1
+ 'negateMatch' => 1,
];
/**
@@ -153,8 +152,8 @@ public function contain($associations = [], callable $queryBuilder = null)
$associations = [
$associations => [
- 'queryBuilder' => $queryBuilder
- ]
+ 'queryBuilder' => $queryBuilder,
+ ],
];
}
@@ -558,8 +557,9 @@ protected function _normalizeContain(Table $parent, $alias, $options, $paths)
$paths += ['aliasPath' => '', 'propertyPath' => '', 'root' => $alias];
$paths['aliasPath'] .= '.' . $alias;
- if (isset($options['matching']) &&
- $options['matching'] === true
+ if (
+ isset($options['matching']) &&
+ $options['matching'] === true
) {
$paths['propertyPath'] = '_matchingData.' . $alias;
} else {
@@ -575,7 +575,7 @@ protected function _normalizeContain(Table $parent, $alias, $options, $paths)
'config' => array_diff_key($options, $extra),
'aliasPath' => trim($paths['aliasPath'], '.'),
'propertyPath' => trim($paths['propertyPath'], '.'),
- 'targetProperty' => $instance->getProperty()
+ 'targetProperty' => $instance->getProperty(),
];
$config['canBeJoined'] = $instance->canBeJoined($config['config']);
$eagerLoadable = new EagerLoadable($alias, $config);
@@ -612,7 +612,7 @@ protected function _fixStrategies()
if (count($configs) < 2) {
continue;
}
- /* @var \Cake\ORM\EagerLoadable $loadable */
+ /** @var \Cake\ORM\EagerLoadable $loadable */
foreach ($configs as $loadable) {
if (strpos($loadable->aliasPath(), '.')) {
$this->_correctStrategy($loadable);
@@ -716,7 +716,7 @@ public function loadExternal($query, $statement)
'query' => $query,
'contain' => $contain,
'keys' => $keys,
- 'nestKey' => $meta->aliasPath()
+ 'nestKey' => $meta->aliasPath(),
]
);
$statement = new CallbackStatement($statement, $driver, $f);
@@ -766,7 +766,7 @@ public function associationsMap($table)
*/
protected function _buildAssociationsMap($map, $level, $matching = false)
{
- /* @var \Cake\ORM\EagerLoadable $meta */
+ /** @var \Cake\ORM\EagerLoadable $meta */
foreach ($level as $assoc => $meta) {
$canBeJoined = $meta->canBeJoined();
$instance = $meta->instance();
@@ -779,7 +779,7 @@ protected function _buildAssociationsMap($map, $level, $matching = false)
'entityClass' => $instance->getTarget()->getEntityClass(),
'nestKey' => $canBeJoined ? $assoc : $meta->aliasPath(),
'matching' => $forMatching !== null ? $forMatching : $matching,
- 'targetProperty' => $meta->targetProperty()
+ 'targetProperty' => $meta->targetProperty(),
];
if ($canBeJoined && $associations) {
$map = $this->_buildAssociationsMap($map, $associations, $matching);
@@ -810,7 +810,7 @@ public function addToJoinsMap($alias, Association $assoc, $asMatching = false, $
'instance' => $assoc,
'canBeJoined' => true,
'forMatching' => $asMatching,
- 'targetProperty' => $targetProperty ?: $assoc->getProperty()
+ 'targetProperty' => $targetProperty ?: $assoc->getProperty(),
]);
}
@@ -826,7 +826,7 @@ public function addToJoinsMap($alias, Association $assoc, $asMatching = false, $
protected function _collectKeys($external, $query, $statement)
{
$collectKeys = [];
- /* @var \Cake\ORM\EagerLoadable $meta */
+ /** @var \Cake\ORM\EagerLoadable $meta */
foreach ($external as $meta) {
$instance = $meta->instance();
if (!$instance->requiresKeys($meta->getConfig())) {
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Entity.php b/app/vendor/cakephp/cakephp/src/ORM/Entity.php
index a3771491e..980273a1d 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Entity.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Entity.php
@@ -52,7 +52,7 @@ public function __construct(array $properties = [], array $options = [])
'markClean' => false,
'markNew' => null,
'guard' => false,
- 'source' => null
+ 'source' => null,
];
if (!empty($options['source'])) {
@@ -60,7 +60,7 @@ public function __construct(array $properties = [], array $options = [])
}
if ($options['markNew'] !== null) {
- $this->isNew($options['markNew']);
+ $this->setNew($options['markNew']);
}
if (!empty($properties) && $options['markClean'] && !$options['useSetters']) {
@@ -72,7 +72,7 @@ public function __construct(array $properties = [], array $options = [])
if (!empty($properties)) {
$this->set($properties, [
'setter' => $options['useSetters'],
- 'guard' => $options['guard']
+ 'guard' => $options['guard'],
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingBehaviorException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingBehaviorException.php
index 725e5e8ac..3925742a3 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingBehaviorException.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingBehaviorException.php
@@ -19,6 +19,8 @@
*/
class MissingBehaviorException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Behavior class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingEntityException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingEntityException.php
index 6f3552799..14dd8281d 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingEntityException.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingEntityException.php
@@ -23,6 +23,8 @@
*/
class MissingEntityException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Entity class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingTableClassException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingTableClassException.php
index 544a968d9..890653cd5 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingTableClassException.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/MissingTableClassException.php
@@ -21,6 +21,8 @@
*/
class MissingTableClassException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Table class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php
index 8596f1e98..4673cb325 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/PersistenceFailedException.php
@@ -21,7 +21,6 @@
*/
class PersistenceFailedException extends Exception
{
-
/**
* The entity on which the persistence operation failed
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Exception/RolledbackTransactionException.php b/app/vendor/cakephp/cakephp/src/ORM/Exception/RolledbackTransactionException.php
index ac31a9d0f..dd15821ea 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Exception/RolledbackTransactionException.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Exception/RolledbackTransactionException.php
@@ -19,6 +19,8 @@
*/
class RolledbackTransactionException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'The afterSave event in "%s" is aborting the transaction before the save process is done.';
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/LazyEagerLoader.php b/app/vendor/cakephp/cakephp/src/ORM/LazyEagerLoader.php
index 0fedcffcc..a4e8cfce4 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/LazyEagerLoader.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/LazyEagerLoader.php
@@ -26,7 +26,6 @@
*/
class LazyEagerLoader
{
-
/**
* Loads the specified associations in the passed entity or list of entities
* by executing extra queries in the database and merging the results in the
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorAwareTrait.php b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorAwareTrait.php
index 2d26e5199..53e09ae7b 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorAwareTrait.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorAwareTrait.php
@@ -21,7 +21,6 @@
*/
trait LocatorAwareTrait
{
-
/**
* Table locator instance
*
@@ -70,7 +69,7 @@ public function setTableLocator(LocatorInterface $tableLocator)
*/
public function getTableLocator()
{
- if (!$this->_tableLocator) {
+ if ($this->_tableLocator === null) {
$this->_tableLocator = TableRegistry::getTableLocator();
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php
index 08cddd6a2..3bd075891 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Locator/LocatorInterface.php
@@ -24,7 +24,6 @@
*/
interface LocatorInterface
{
-
/**
* Stores a list of options to be used when instantiating an object
* with a matching alias.
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php b/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php
index 215d1f6e9..cb3ed7b93 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php
@@ -26,7 +26,6 @@
*/
class TableLocator implements LocatorInterface
{
-
/**
* Contains a list of locations where table classes should be looked for.
*
@@ -235,7 +234,7 @@ public function get($alias, array $options = [])
if (!empty($options['connectionName'])) {
$connectionName = $options['connectionName'];
} else {
- /* @var \Cake\ORM\Table $className */
+ /** @var \Cake\ORM\Table $className */
$className = $options['className'];
$connectionName = $className::defaultConnectionName();
}
@@ -318,6 +317,7 @@ public function clear()
$this->_instances = [];
$this->_config = [];
$this->_fallbacked = [];
+ $this->_options = [];
}
/**
@@ -350,7 +350,6 @@ public function remove($alias)
*
* @param string $location Location to add.
* @return $this
- *
* @since 3.8.0
*/
public function addLocation($location)
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Marshaller.php b/app/vendor/cakephp/cakephp/src/ORM/Marshaller.php
index a54160d86..f3c4dbf20 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Marshaller.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Marshaller.php
@@ -35,7 +35,6 @@
*/
class Marshaller
{
-
use AssociationsNormalizerTrait;
/**
@@ -159,6 +158,14 @@ protected function _buildPropertyMap($data, $options)
* ]);
* ```
*
+ * ```
+ * $result = $marshaller->one($data, [
+ * 'associated' => [
+ * 'Tags' => ['accessibleFields' => ['*' => true]]
+ * ]
+ * ]);
+ * ```
+ *
* @param array $data The data to hydrate.
* @param array $options List of options
* @return \Cake\Datasource\EntityInterface
@@ -223,6 +230,7 @@ public function one(array $data, array $options = [])
}
$entity->setErrors($errors);
+ $this->dispatchAfterMarshal($entity, $data, $options);
return $entity;
}
@@ -258,7 +266,7 @@ protected function _validate($data, $options, $isNew)
);
}
- return $validator->errors($data, $isNew);
+ return $validator->validate($data, $isNew);
}
/**
@@ -309,10 +317,11 @@ protected function _marshalAssociation($assoc, $value, $options)
$targetTable = $assoc->getTarget();
$marshaller = $targetTable->marshaller();
$types = [Association::ONE_TO_ONE, Association::MANY_TO_ONE];
- if (in_array($assoc->type(), $types, true)) {
+ $type = $assoc->type();
+ if (in_array($type, $types, true)) {
return $marshaller->one($value, (array)$options);
}
- if ($assoc->type() === Association::ONE_TO_MANY || $assoc->type() === Association::MANY_TO_MANY) {
+ if ($type === Association::ONE_TO_MANY || $type === Association::MANY_TO_MANY) {
$hasIds = array_key_exists('_ids', $value);
$onlyIds = array_key_exists('onlyIds', $options) && $options['onlyIds'];
@@ -323,7 +332,7 @@ protected function _marshalAssociation($assoc, $value, $options)
return [];
}
}
- if ($assoc->type() === Association::MANY_TO_MANY) {
+ if ($type === Association::MANY_TO_MANY) {
return $marshaller->_belongsToMany($assoc, $value, (array)$options);
}
@@ -419,7 +428,7 @@ protected function _belongsToMany(BelongsToMany $assoc, array $data, $options =
$query = $target->find();
$query->andWhere(function ($exp) use ($conditions) {
/** @var \Cake\Database\Expression\QueryExpression $exp */
- return $exp->or_($conditions);
+ return $exp->or($conditions);
});
$keyFields = array_keys($primaryKey);
@@ -487,7 +496,12 @@ protected function _loadAssociatedByIds($assoc, $ids)
if (!is_array($first) || count($first) !== count($primaryKey)) {
return [];
}
- $filter = new TupleComparison($primaryKey, $ids, [], 'IN');
+ $type = [];
+ $schema = $target->getSchema();
+ foreach ((array)$target->getPrimaryKey() as $column) {
+ $type[] = $schema->getColumnType($column);
+ }
+ $filter = new TupleComparison($primaryKey, $ids, $type, 'IN');
} else {
$filter = [$primaryKey[0] . ' IN' => $ids];
}
@@ -587,7 +601,8 @@ public function merge(EntityInterface $entity, array $data, array $options = [])
// change. Arrays will always be marked as dirty because
// the original/updated list could contain references to the
// same objects, even though those objects may have changed internally.
- if ((is_scalar($value) && $original === $value) ||
+ if (
+ (is_scalar($value) && $original === $value) ||
($value === null && $original === $value) ||
(is_object($value) && !($value instanceof EntityInterface) && $original == $value)
) {
@@ -606,6 +621,7 @@ public function merge(EntityInterface $entity, array $data, array $options = [])
$entity->setDirty($field, $value->isDirty());
}
}
+ $this->dispatchAfterMarshal($entity, $data, $options);
return $entity;
}
@@ -619,6 +635,7 @@ public function merge(EntityInterface $entity, array $data, array $options = [])
$entity->setDirty($field, $properties[$field]->isDirty());
}
}
+ $this->dispatchAfterMarshal($entity, $data, $options);
return $entity;
}
@@ -747,14 +764,17 @@ protected function _mergeAssociation($original, $assoc, $value, $options)
$targetTable = $assoc->getTarget();
$marshaller = $targetTable->marshaller();
$types = [Association::ONE_TO_ONE, Association::MANY_TO_ONE];
- if (in_array($assoc->type(), $types, true)) {
+ $type = $assoc->type();
+ if (in_array($type, $types, true)) {
+ /** @psalm-suppress PossiblyInvalidArgument */
return $marshaller->merge($original, $value, (array)$options);
}
- if ($assoc->type() === Association::MANY_TO_MANY) {
+ if ($type === Association::MANY_TO_MANY) {
+ /** @psalm-suppress PossiblyInvalidArgument */
return $marshaller->_mergeBelongsToMany($original, $assoc, $value, (array)$options);
}
- if ($assoc->type() === Association::ONE_TO_MANY) {
+ if ($type === Association::ONE_TO_MANY) {
$hasIds = array_key_exists('_ids', $value);
$onlyIds = array_key_exists('onlyIds', $options) && $options['onlyIds'];
if ($hasIds && is_array($value['_ids'])) {
@@ -859,4 +879,19 @@ protected function _mergeJoinData($original, $assoc, $value, $options)
return $records;
}
+
+ /**
+ * dispatch Model.afterMarshal event.
+ *
+ * @param \Cake\Datasource\EntityInterface $entity The entity that was marshaled.
+ * @param array $data readOnly $data to use.
+ * @param array $options List of options that are readOnly.
+ * @return void
+ */
+ protected function dispatchAfterMarshal(EntityInterface $entity, array $data, array $options)
+ {
+ $data = new ArrayObject($data);
+ $options = new ArrayObject($options);
+ $this->_table->dispatchEvent('Model.afterMarshal', compact('entity', 'data', 'options'));
+ }
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Query.php b/app/vendor/cakephp/cakephp/src/ORM/Query.php
index 4107290fd..0dd1db232 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Query.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Query.php
@@ -43,9 +43,9 @@
* @method \Cake\Collection\CollectionInterface extract($field) Extracts a single column from each row
* @method mixed max($field, $type = SORT_NUMERIC) Returns the maximum value for a single column in all the results.
* @method mixed min($field, $type = SORT_NUMERIC) Returns the minimum value for a single column in all the results.
- * @method \Cake\Collection\CollectionInterface groupBy(string|callable $field) In-memory group all results by the value of a column.
- * @method \Cake\Collection\CollectionInterface indexBy(string|callable $field) Returns the results indexed by the value of a column.
- * @method \Cake\Collection\CollectionInterface countBy(string|callable $field) Returns the number of unique values for a column
+ * @method \Cake\Collection\CollectionInterface groupBy(string|callable $callable) In-memory group all results by the value of a column.
+ * @method \Cake\Collection\CollectionInterface indexBy(string|callable $callable) Returns the results indexed by the value of a column.
+ * @method \Cake\Collection\CollectionInterface countBy(string|callable $callable) Returns the number of unique values for a column
* @method float sumOf(string|callable $field) Returns the sum of all values for a single column
* @method \Cake\Collection\CollectionInterface shuffle() In-memory randomize the order the results are returned
* @method \Cake\Collection\CollectionInterface sample($size = 10) In-memory shuffle the results and return a subset of them.
@@ -101,7 +101,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
* Whether the user select any fields before being executed, this is used
* to determined if any fields should be automatically be selected.
*
- * @var bool
+ * @var bool|null
*/
protected $_hasFields;
@@ -109,7 +109,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
* Tracks whether or not the original query should include
* fields from the top level table.
*
- * @var bool
+ * @var bool|null
*/
protected $_autoFields;
@@ -124,7 +124,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
* A callable function that can be used to calculate the total amount of
* records this query will match when not using `limit`
*
- * @var callable
+ * @var callable|null
*/
protected $_counter;
@@ -132,7 +132,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
* Instance of a class responsible for storing association containments and
* for eager loading them when this query is executed
*
- * @var \Cake\ORM\EagerLoader
+ * @var \Cake\ORM\EagerLoader|null
*/
protected $_eagerLoader;
@@ -228,8 +228,6 @@ public function select($fields = [], $overwrite = false)
* been added to the query by the first. If you need to change the list after the first call,
* pass overwrite boolean true which will reset the select clause removing all previous additions.
*
- *
- *
* @param \Cake\ORM\Table|\Cake\ORM\Association $table The table to use to get an array of columns
* @param string[] $excludedFields The un-aliased column names you do not want selected from $table
* @param bool $overwrite Whether to reset/remove previous selected fields
@@ -656,7 +654,7 @@ public function leftJoinWith($assoc, callable $builder = null)
$result = $this->getEagerLoader()
->setMatching($assoc, $builder, [
'joinType' => QueryInterface::JOIN_TYPE_LEFT,
- 'fields' => false
+ 'fields' => false,
])
->getMatching();
$this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result);
@@ -705,7 +703,7 @@ public function innerJoinWith($assoc, callable $builder = null)
$result = $this->getEagerLoader()
->setMatching($assoc, $builder, [
'joinType' => QueryInterface::JOIN_TYPE_INNER,
- 'fields' => false
+ 'fields' => false,
])
->getMatching();
$this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result);
@@ -770,7 +768,7 @@ public function notMatching($assoc, callable $builder = null)
->setMatching($assoc, $builder, [
'joinType' => QueryInterface::JOIN_TYPE_LEFT,
'fields' => false,
- 'negateMatch' => true
+ 'negateMatch' => true,
])
->getMatching();
$this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result);
@@ -878,6 +876,19 @@ public function cleanCopy()
return $clone;
}
+ /**
+ * Clears the internal result cache and the internal count value from the current
+ * query object.
+ *
+ * @return $this
+ */
+ public function clearResult()
+ {
+ $this->_dirty();
+
+ return $this;
+ }
+
/**
* Object clone hook.
*
@@ -1105,21 +1116,24 @@ public function triggerBeforeFind()
$repository->dispatchEvent('Model.beforeFind', [
$this,
new ArrayObject($this->_options),
- !$this->isEagerLoaded()
+ !$this->isEagerLoaded(),
]);
}
}
/**
- * {@inheritDoc}
+ * Converts the Node into a SQL string fragment.
+ *
+ * @param \Cake\Database\ValueBinder|null $generator Placeholder generator object
+ * @return string
*/
- public function sql(ValueBinder $binder = null)
+ public function sql(ValueBinder $generator = null)
{
$this->triggerBeforeFind();
$this->_transformQuery();
- return parent::sql($binder);
+ return parent::sql($generator);
}
/**
@@ -1341,7 +1355,7 @@ public function __debugInfo()
'contain' => $eagerLoader ? $eagerLoader->getContain() : [],
'matching' => $eagerLoader ? $eagerLoader->getMatching() : [],
'extraOptions' => $this->_options,
- 'repository' => $this->_repository
+ 'repository' => $this->_repository,
];
}
@@ -1391,7 +1405,7 @@ public function disableAutoFields()
* By default calling select() will disable auto-fields. You can re-enable
* auto-fields with enableAutoFields().
*
- * @return bool The current value.
+ * @return bool|null The current value. Returns null if neither enabled or disabled yet.
*/
public function isAutoFieldsEnabled()
{
@@ -1406,7 +1420,7 @@ public function isAutoFieldsEnabled()
*
* @deprecated 3.4.0 Use enableAutoFields()/isAutoFieldsEnabled() instead.
* @param bool|null $value The value to set or null to read the current value.
- * @return bool|$this Either the current value or the query object.
+ * @return bool|null|$this Either the current value or the query object.
*/
public function autoFields($value = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/ORM/README.md b/app/vendor/cakephp/cakephp/src/ORM/README.md
index 19ac4a00d..0e51ff4c0 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/README.md
+++ b/app/vendor/cakephp/cakephp/src/ORM/README.md
@@ -59,7 +59,7 @@ use Cake\ORM\Locator\LocatorAwareTrait;
$articles = $this->getTableLocator()->get('Articles');
```
-By default classes using `LocatorAwareTrait` will share a global locator instance.
+By default, classes using `LocatorAwareTrait` will share a global locator instance.
You can inject your own locator instance into the object:
```php
@@ -78,12 +78,12 @@ In your table classes you can define the relations between your tables. CakePHP'
supports 4 association types out of the box:
* belongsTo - E.g. Many articles belong to a user.
-* hasOne - E.g. A user has one profile
-* hasMany - E.g. A user has many articles
+* hasOne - E.g. A user has one profile.
+* hasMany - E.g. A user has many articles.
* belongsToMany - E.g. An article belongsToMany tags.
You define associations in your table's `initialize()` method. See the
-[documentation](https://book.cakephp.org/3.0/en/orm/associations.html) for
+[documentation](https://book.cakephp.org/3/en/orm/associations.html) for
complete examples.
## Reading Data
@@ -99,8 +99,8 @@ foreach ($articles->find() as $article) {
}
```
-You can use the [query builder](https://book.cakephp.org/3.0/en/orm/query-builder.html) to create
-complex queries, and a [variety of methods](https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html)
+You can use the [query builder](https://book.cakephp.org/3/en/orm/query-builder.html) to create
+complex queries, and a [variety of methods](https://book.cakephp.org/3/en/orm/retrieving-data-and-resultsets.html)
to access your data.
## Saving Data
@@ -134,7 +134,7 @@ $articles->save($article, [
```
The above shows how you can easily marshal and save an entity and its
-associations in a simple & powerful way. Consult the [ORM documentation](https://book.cakephp.org/3.0/en/orm/saving-data.html)
+associations in a simple & powerful way. Consult the [ORM documentation](https://book.cakephp.org/3/en/orm/saving-data.html)
for more in-depth examples.
## Deleting Data
@@ -149,7 +149,7 @@ $articles->delete($article);
## Meta Data Cache
-It is recommended to enable meta data cache for production systems to avoid performance issues.
+It is recommended to enable metadata cache for production systems to avoid performance issues.
For e.g. file system strategy your bootstrap file could look like this:
```php
use Cake\Cache\Engine\FileEngine;
@@ -234,5 +234,5 @@ Configure::write('App.namespace', 'My\Log\SubNamespace');
## Additional Documentation
-Consult [the CakePHP ORM documentation](https://book.cakephp.org/3.0/en/orm.html)
+Consult [the CakePHP ORM documentation](https://book.cakephp.org/3/en/orm.html)
for more in-depth documentation.
diff --git a/app/vendor/cakephp/cakephp/src/ORM/ResultSet.php b/app/vendor/cakephp/cakephp/src/ORM/ResultSet.php
index 5d1554311..7cdb4e277 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/ResultSet.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/ResultSet.php
@@ -30,7 +30,6 @@
*/
class ResultSet implements ResultSetInterface
{
-
use CollectionTrait;
/**
@@ -124,7 +123,7 @@ class ResultSet implements ResultSetInterface
/**
* Tracks value of $_autoFields property of $query passed to constructor.
*
- * @var bool
+ * @var bool|null
*/
protected $_autoFields;
@@ -506,7 +505,7 @@ protected function _groupResult($row)
'useSetters' => false,
'markClean' => true,
'markNew' => false,
- 'guard' => false
+ 'guard' => false,
];
foreach ($this->_matchingMapColumns as $alias => $keys) {
@@ -516,10 +515,10 @@ protected function _groupResult($row)
array_intersect_key($row, $keys)
);
if ($this->_hydrate) {
- /* @var \Cake\ORM\Table $table */
+ /** @var \Cake\ORM\Table $table */
$table = $matching['instance'];
$options['source'] = $table->getRegistryAlias();
- /* @var \Cake\Datasource\EntityInterface $entity */
+ /** @var \Cake\Datasource\EntityInterface $entity */
$entity = new $matching['entityClass']($results['_matchingData'][$alias], $options);
$results['_matchingData'][$alias] = $entity;
}
@@ -546,7 +545,7 @@ protected function _groupResult($row)
continue;
}
- /* @var \Cake\ORM\Association $instance */
+ /** @var \Cake\ORM\Association $instance */
$instance = $assoc['instance'];
if (!$assoc['canBeJoined'] && !isset($row[$alias])) {
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php b/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php
index d583120ba..104f9a86a 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Rule/ExistsIn.php
@@ -24,7 +24,6 @@
*/
class ExistsIn
{
-
/**
* The list of fields to check
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Rule/IsUnique.php b/app/vendor/cakephp/cakephp/src/ORM/Rule/IsUnique.php
index 53713b1be..9d1524b13 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Rule/IsUnique.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Rule/IsUnique.php
@@ -21,7 +21,6 @@
*/
class IsUnique
{
-
/**
* The list of fields to check
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Rule/ValidCount.php b/app/vendor/cakephp/cakephp/src/ORM/Rule/ValidCount.php
index 33a980812..33696ad7c 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Rule/ValidCount.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Rule/ValidCount.php
@@ -23,7 +23,6 @@
*/
class ValidCount
{
-
/**
* The field to check
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php b/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php
index c9e1d8a99..1457f6768 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/RulesChecker.php
@@ -28,7 +28,6 @@
*/
class RulesChecker extends BaseRulesChecker
{
-
/**
* Returns a callable that can be used as a rule for checking the uniqueness of a value
* in the table.
@@ -83,7 +82,7 @@ public function isUnique(array $fields, $message = null)
* 'message' sets a custom error message.
* Set 'allowNullableNulls' to true to accept composite foreign keys where one or more nullable columns are null.
*
- * @param string|array $field The field or list of fields to check for existence by
+ * @param string|string[] $field The field or list of fields to check for existence by
* primary key lookup in the other table.
* @param object|string $table The table name where the fields existence will be checked.
* @param string|array|null $message The error message to show in case the rule does not pass. Can
diff --git a/app/vendor/cakephp/cakephp/src/ORM/SaveOptionsBuilder.php b/app/vendor/cakephp/cakephp/src/ORM/SaveOptionsBuilder.php
index f3ea0b95c..470ed5023 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/SaveOptionsBuilder.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/SaveOptionsBuilder.php
@@ -27,7 +27,6 @@
*/
class SaveOptionsBuilder extends ArrayObject
{
-
use AssociationsNormalizerTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/ORM/Table.php b/app/vendor/cakephp/cakephp/src/ORM/Table.php
index 4084a3dc2..45fc47a35 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/Table.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/Table.php
@@ -20,6 +20,7 @@
use Cake\Database\Schema\TableSchema;
use Cake\Database\Type;
use Cake\Datasource\ConnectionInterface;
+use Cake\Datasource\ConnectionManager;
use Cake\Datasource\EntityInterface;
use Cake\Datasource\Exception\InvalidPrimaryKeyException;
use Cake\Datasource\RepositoryInterface;
@@ -39,6 +40,7 @@
use Cake\Utility\Inflector;
use Cake\Validation\ValidatorAwareInterface;
use Cake\Validation\ValidatorAwareTrait;
+use Exception;
use InvalidArgumentException;
use RuntimeException;
@@ -126,7 +128,6 @@
*/
class Table implements RepositoryInterface, EventListenerInterface, EventDispatcherInterface, ValidatorAwareInterface
{
-
use EventDispatcherTrait;
use RulesAwareTrait;
use ValidatorAwareTrait;
@@ -424,6 +425,7 @@ public function getAlias()
/**
* {@inheritDoc}
+ *
* @deprecated 3.4.0 Use setAlias()/getAlias() instead.
*/
public function alias($alias = null)
@@ -523,6 +525,10 @@ public function setConnection(ConnectionInterface $connection)
*/
public function getConnection()
{
+ if (!$this->_connection) {
+ $this->_connection = ConnectionManager::get(static::defaultConnectionName());
+ }
+
return $this->_connection;
}
@@ -583,7 +589,7 @@ public function setSchema($schema)
unset($schema['_constraints']);
}
- $schema = new TableSchema($this->getTable(), $schema);
+ $schema = $this->getConnection()->getDriver()->newTableSchema($this->getTable(), $schema);
foreach ($constraints as $name => $value) {
$schema->addConstraint($name, $value);
@@ -1129,6 +1135,12 @@ public function addAssociations(array $params)
* - finder: The finder method to use when loading records from this association.
* Defaults to 'all'. When the strategy is 'join', only the fields, containments,
* and where conditions will be used from the finder.
+ * - propertyName: The property name that should be filled with data from the
+ * associated table into the source table results. By default this is the underscored
+ * & singular name of the association. For an association of ProductCategories it would
+ * be product_category.
+ * - bindingKey: The name of the column in the other table used to match 'foreignKey'.
+ * The default value is the primary key of the other table.
*
* This method will return the association object that was built.
*
@@ -1175,6 +1187,12 @@ public function belongsTo($associated, array $options = [])
* - finder: The finder method to use when loading records from this association.
* Defaults to 'all'. When the strategy is 'join', only the fields, containments,
* and where conditions will be used from the finder.
+ * - propertyName: The property name that should be filled with data from the
+ * associated table into the source table results. By default this is the underscored
+ * & singular name of the association. For an association of ProductCategories it would
+ * be product_category.
+ * - bindingKey: The name of the column in the other table used to match 'foreignKey'.
+ * The default value is the primary key of the other table.
*
* This method will return the association object that was built.
*
@@ -1227,6 +1245,12 @@ public function hasOne($associated, array $options = [])
* target table.
* - finder: The finder method to use when loading records from this association.
* Defaults to 'all'.
+ * - propertyName: The property name that should be filled with data from the
+ * associated table into the source table results. By default this is the underscored
+ * & singular name of the association. For an association of ProductCategories it would
+ * be product_category.
+ * - bindingKey: The name of the column in the other table used to match 'foreignKey'.
+ * The default value is the primary key of the other table.
*
* This method will return the association object that was built.
*
@@ -1281,6 +1305,12 @@ public function hasMany($associated, array $options = [])
* - strategy: The loading strategy to use. 'select' and 'subquery' are supported.
* - finder: The finder method to use when loading records from this association.
* Defaults to 'all'.
+ * - propertyName: The property name that should be filled with data from the
+ * associated table into the source table results. By default this is the underscored
+ * & singular name of the association. For an association of ProductCategories it would
+ * be product_category.
+ * - bindingKey: The name of the column in the other table used to match 'foreignKey'.
+ * The default value is the primary key of the other table.
*
* This method will return the association object that was built.
*
@@ -1442,7 +1472,7 @@ public function findList(Query $query, array $options)
$options += [
'keyField' => $this->getPrimaryKey(),
'valueField' => $this->getDisplayField(),
- 'groupField' => null
+ 'groupField' => null,
];
if (isset($options['idField'])) {
@@ -1451,7 +1481,8 @@ public function findList(Query $query, array $options)
deprecationWarning('Option "idField" is deprecated, use "keyField" instead.');
}
- if (!$query->clause('select') &&
+ if (
+ !$query->clause('select') &&
!is_object($options['keyField']) &&
!is_object($options['valueField']) &&
!is_object($options['groupField'])
@@ -1511,7 +1542,7 @@ public function findThreaded(Query $query, array $options)
$options += [
'keyField' => $this->getPrimaryKey(),
'parentField' => 'parent_id',
- 'nestingKey' => 'children'
+ 'nestingKey' => 'children',
];
if (isset($options['idField'])) {
@@ -1578,8 +1609,8 @@ protected function _setFieldMatchers($options, $keys)
* $article = $articles->get(1, ['contain' => ['Users', 'Comments']]);
* ```
*
- * @throws \Cake\Datasource\Exception\InvalidPrimaryKeyException When $primaryKey has an
- * incorrect number of elements.
+ * @throws \Cake\Datasource\Exception\InvalidPrimaryKeyException When the given `$primaryKey`
+ * was not found in the table.
*/
public function get($primaryKey, $options = [])
{
@@ -1904,7 +1935,7 @@ public function exists($conditions)
* ```
*
* @param \Cake\Datasource\EntityInterface $entity
- * @param array $options
+ * @param \Cake\ORM\SaveOptionsBuilder|array $options
* @return \Cake\Datasource\EntityInterface|false
* @throws \Cake\ORM\Exception\RolledbackTransactionException If the transaction is aborted in the afterSave event.
*/
@@ -1919,7 +1950,7 @@ public function save(EntityInterface $entity, $options = [])
'associated' => true,
'checkRules' => true,
'checkExisting' => true,
- '_primary' => true
+ '_primary' => true,
]);
if ($entity->hasErrors($options['associated'])) {
@@ -1940,7 +1971,7 @@ public function save(EntityInterface $entity, $options = [])
}
if ($options['atomic'] || $options['_primary']) {
$entity->clean();
- $entity->isNew(false);
+ $entity->setNew(false);
$entity->setSource($this->getRegistryAlias());
}
}
@@ -1973,7 +2004,7 @@ public function saveOrFail(EntityInterface $entity, $options = [])
*
* @param \Cake\Datasource\EntityInterface $entity the entity to be saved
* @param \ArrayObject $options the options to use for the save operation
- * @return \Cake\Datasource\EntityInterface|bool
+ * @return \Cake\Datasource\EntityInterface|false
* @throws \RuntimeException When an entity is missing some of the primary keys.
* @throws \Cake\ORM\Exception\RolledbackTransactionException If the transaction
* is aborted in the afterSave event.
@@ -1988,7 +2019,7 @@ protected function _processSave($entity, $options)
foreach ($entity->extract($primaryColumns) as $k => $v) {
$conditions["$alias.$k"] = $v;
}
- $entity->isNew(!$this->exists($conditions));
+ $entity->setNew(!$this->exists($conditions));
}
$mode = $entity->isNew() ? RulesChecker::CREATE : RulesChecker::UPDATE;
@@ -2029,7 +2060,7 @@ protected function _processSave($entity, $options)
if (!$success && $isNew) {
$entity->unsetProperty($this->getPrimaryKey());
- $entity->isNew(true);
+ $entity->setNew(true);
}
return $success ? $entity : false;
@@ -2066,7 +2097,7 @@ protected function _onSaveSuccess($entity, $options)
if (!$options['atomic'] && !$options['_primary']) {
$entity->clean();
- $entity->isNew(false);
+ $entity->setNew(false);
$entity->setSource($this->getRegistryAlias());
}
@@ -2078,7 +2109,7 @@ protected function _onSaveSuccess($entity, $options)
*
* @param \Cake\Datasource\EntityInterface $entity the subject entity from were $data was extracted
* @param array $data The actual data that needs to be saved
- * @return \Cake\Datasource\EntityInterface|bool
+ * @return \Cake\Datasource\EntityInterface|false
* @throws \RuntimeException if not all the primary keys where supplied or could
* be generated when the table has composite primary keys. Or when the table has no primary key.
*/
@@ -2176,7 +2207,7 @@ protected function _newId($primary)
*
* @param \Cake\Datasource\EntityInterface $entity the subject entity from were $data was extracted
* @param array $data The actual data that needs to be saved
- * @return \Cake\Datasource\EntityInterface|bool
+ * @return \Cake\Datasource\EntityInterface|false
* @throws \InvalidArgumentException When primary key data is missing.
*/
protected function _update($entity, $data)
@@ -2231,36 +2262,75 @@ protected function _update($entity, $data)
*/
public function saveMany($entities, $options = [])
{
+ try {
+ return $this->_saveMany($entities, $options);
+ } catch (PersistenceFailedException $exception) {
+ return false;
+ }
+ }
+
+ /**
+ * Persists multiple entities of a table.
+ *
+ * The records will be saved in a transaction which will be rolled back if
+ * any one of the records fails to save due to failed validation or database
+ * error.
+ *
+ * @param \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface $entities Entities to save.
+ * @param array|\ArrayAccess $options Options used when calling Table::save() for each entity.
+ * @return \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface Entities list.
+ * @throws \Exception
+ * @throws \Cake\ORM\Exception\PersistenceFailedException If an entity couldn't be saved.
+ */
+ public function saveManyOrFail($entities, $options = [])
+ {
+ return $this->_saveMany($entities, $options);
+ }
+
+ /**
+ * @param \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface $entities Entities to save.
+ * @param array|\ArrayAccess $options Options used when calling Table::save() for each entity.
+ * @return \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface Entities list.
+ * @throws \Cake\ORM\Exception\PersistenceFailedException If an entity couldn't be saved.
+ */
+ protected function _saveMany($entities, $options = [])
+ {
+ /** @var bool[] $isNew */
$isNew = [];
$cleanup = function ($entities) use (&$isNew) {
+ /** @var \Cake\Datasource\EntityInterface[] $entities */
foreach ($entities as $key => $entity) {
if (isset($isNew[$key]) && $isNew[$key]) {
$entity->unsetProperty($this->getPrimaryKey());
- $entity->isNew(true);
+ $entity->setNew(true);
}
}
};
+ /** @var \Cake\Datasource\EntityInterface|null $failed */
+ $failed = null;
try {
- $return = $this->getConnection()
- ->transactional(function () use ($entities, $options, &$isNew) {
+ $this->getConnection()
+ ->transactional(function () use ($entities, $options, &$isNew, &$failed) {
foreach ($entities as $key => $entity) {
$isNew[$key] = $entity->isNew();
if ($this->save($entity, $options) === false) {
+ $failed = $entity;
+
return false;
}
}
});
- } catch (\Exception $e) {
+ } catch (Exception $e) {
$cleanup($entities);
throw $e;
}
- if ($return === false) {
+ if ($failed !== null) {
$cleanup($entities);
- return false;
+ throw new PersistenceFailedException($failed, ['saveMany']);
}
return $entities;
@@ -2291,7 +2361,6 @@ public function saveMany($entities, $options = [])
* The options argument will be converted into an \ArrayObject instance
* for the duration of the callbacks, this allows listeners to modify
* the options used in the delete operation.
- *
*/
public function delete(EntityInterface $entity, $options = [])
{
@@ -2308,7 +2377,7 @@ public function delete(EntityInterface $entity, $options = [])
if ($success && $this->_transactionCommitted($options['atomic'], $options['_primary'])) {
$this->dispatchEvent('Model.afterDeleteCommit', [
'entity' => $entity,
- 'options' => $options
+ 'options' => $options,
]);
}
@@ -2335,6 +2404,91 @@ public function deleteOrFail(EntityInterface $entity, $options = [])
return $deleted;
}
+ /**
+ * Deletes multiple entities of a table.
+ *
+ * The records will be deleted in a transaction which will be rolled back if
+ * any one of the records fails to delete due to failed validation or database
+ * error.
+ *
+ * @param \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface $entities Entities to delete.
+ * @param array|\ArrayAccess $options Options used when calling Table::save() for each entity.
+ * @return bool|\Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface
+ * False on failure, entities list on success.
+ * @throws \Exception
+ * @see \Cake\ORM\Table::delete() for options and events related to this method.
+ */
+ public function deleteMany($entities, $options = [])
+ {
+ $failed = $this->_deleteMany($entities, $options);
+
+ if ($failed !== null) {
+ return false;
+ }
+
+ return $entities;
+ }
+
+ /**
+ * Deletes multiple entities of a table.
+ *
+ * The records will be deleted in a transaction which will be rolled back if
+ * any one of the records fails to delete due to failed validation or database
+ * error.
+ *
+ * @param \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface $entities Entities to delete.
+ * @param array|\ArrayAccess $options Options used when calling Table::save() for each entity.
+ * @return \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface Entities list.
+ * @throws \Exception
+ * @throws \Cake\ORM\Exception\PersistenceFailedException
+ * @see \Cake\ORM\Table::delete() for options and events related to this method.
+ */
+ public function deleteManyOrFail($entities, $options = [])
+ {
+ $failed = $this->_deleteMany($entities, $options);
+
+ if ($failed !== null) {
+ throw new PersistenceFailedException($failed, ['deleteMany']);
+ }
+
+ return $entities;
+ }
+
+ /**
+ * @param \Cake\Datasource\EntityInterface[]|\Cake\Datasource\ResultSetInterface $entities Entities to delete.
+ * @param array|\ArrayAccess $options Options used.
+ * @return \Cake\Datasource\EntityInterface|null
+ */
+ protected function _deleteMany($entities, $options = [])
+ {
+ $options = new ArrayObject((array)$options + [
+ 'atomic' => true,
+ 'checkRules' => true,
+ '_primary' => true,
+ ]);
+
+ $failed = $this->_executeTransaction(function () use ($entities, $options) {
+ foreach ($entities as $entity) {
+ if (!$this->_processDelete($entity, $options)) {
+ return $entity;
+ }
+ }
+
+ return null;
+ }, $options['atomic']);
+
+ if ($failed === null && $this->_transactionCommitted($options['atomic'], $options['_primary'])) {
+ foreach ($entities as $entity) {
+ $this->dispatchEvent('Model.afterDeleteCommit', [
+ 'entity' => $entity,
+ 'options' => $options,
+ ]);
+ }
+ }
+
+ return $failed;
+ }
+
/**
* Perform the delete operation.
*
@@ -2365,7 +2519,7 @@ protected function _processDelete($entity, $options)
$event = $this->dispatchEvent('Model.beforeDelete', [
'entity' => $entity,
- 'options' => $options
+ 'options' => $options,
]);
if ($event->isStopped()) {
@@ -2390,7 +2544,7 @@ protected function _processDelete($entity, $options)
$this->dispatchEvent('Model.afterDelete', [
'entity' => $entity,
- 'options' => $options
+ 'options' => $options,
]);
return $success;
@@ -2400,7 +2554,6 @@ protected function _processDelete($entity, $options)
* Returns true if the finder exists for the table
*
* @param string $type name of finder to check
- *
* @return bool
*/
public function hasFinder($type)
@@ -2439,7 +2592,7 @@ public function callFinder($type, Query $query, array $options = [])
}
/**
- * Provides the dynamic findBy and findByAll methods.
+ * Provides the dynamic findBy and findAllBy methods.
*
* @param string $method The method name that was fired.
* @param array $args List of arguments passed to the function.
@@ -2490,7 +2643,7 @@ protected function _dynamicFinder($method, $args)
} elseif ($hasOr !== false) {
$fields = explode('_or_', $fields);
$conditions = [
- 'OR' => $makeConditions($fields, $args)
+ 'OR' => $makeConditions($fields, $args),
];
} elseif ($hasAnd !== false) {
$fields = explode('_and_', $fields);
@@ -2809,7 +2962,7 @@ public function validateUnique($value, array $options, array $context = null)
[
'useSetters' => false,
'markNew' => $context['newRecord'],
- 'source' => $this->getRegistryAlias()
+ 'source' => $this->getRegistryAlias(),
]
);
$fields = array_merge(
@@ -2840,6 +2993,7 @@ public function validateUnique($value, array $options, array $context = null)
* The conventional method map is:
*
* - Model.beforeMarshal => beforeMarshal
+ * - Model.afterMarshal => afterMarshal
* - Model.buildValidator => buildValidator
* - Model.beforeFind => beforeFind
* - Model.beforeSave => beforeSave
@@ -2857,6 +3011,7 @@ public function implementedEvents()
{
$eventMap = [
'Model.beforeMarshal' => 'beforeMarshal',
+ 'Model.afterMarshal' => 'afterMarshal',
'Model.buildValidator' => 'buildValidator',
'Model.beforeFind' => 'beforeFind',
'Model.beforeSave' => 'beforeSave',
@@ -2934,15 +3089,15 @@ public function getSaveOptionsBuilder(array $options = [])
*/
public function loadInto($entities, array $contain)
{
- return (new LazyEagerLoader)->loadInto($entities, $contain, $this);
+ return (new LazyEagerLoader())->loadInto($entities, $contain, $this);
}
/**
* {@inheritDoc}
*/
- protected function validationMethodExists($method)
+ protected function validationMethodExists($name)
{
- return method_exists($this, $method) || $this->behaviors()->hasMethod($method);
+ return method_exists($this, $name) || $this->behaviors()->hasMethod($name);
}
/**
@@ -2965,7 +3120,7 @@ public function __debugInfo()
'associations' => $associations ? $associations->keys() : false,
'behaviors' => $behaviors ? $behaviors->loaded() : false,
'defaultConnection' => static::defaultConnectionName(),
- 'connectionName' => $conn ? $conn->configName() : null
+ 'connectionName' => $conn ? $conn->configName() : null,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/ORM/TableRegistry.php b/app/vendor/cakephp/cakephp/src/ORM/TableRegistry.php
index ee5056886..1cb465dfc 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/TableRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/ORM/TableRegistry.php
@@ -55,7 +55,6 @@
*/
class TableRegistry
{
-
/**
* LocatorInterface implementation instance.
*
diff --git a/app/vendor/cakephp/cakephp/src/ORM/composer.json b/app/vendor/cakephp/cakephp/src/ORM/composer.json
index 143289396..0ebc7f748 100644
--- a/app/vendor/cakephp/cakephp/src/ORM/composer.json
+++ b/app/vendor/cakephp/cakephp/src/ORM/composer.json
@@ -23,7 +23,7 @@
"source": "https://github.com/cakephp/orm"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/collection": "^3.6.0",
"cakephp/core": "^3.6.0",
"cakephp/datasource": "^3.6.0",
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php b/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php
index d1a3f2be4..df29aa638 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php
@@ -30,7 +30,6 @@
*/
class Dispatcher
{
-
use EventDispatcherTrait;
/**
diff --git a/app/vendor/cakephp/cakephp/src/Routing/DispatcherFactory.php b/app/vendor/cakephp/cakephp/src/Routing/DispatcherFactory.php
index 91dc68620..4b178fd5c 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/DispatcherFactory.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/DispatcherFactory.php
@@ -26,7 +26,6 @@
*/
class DispatcherFactory
{
-
/**
* Stack of middleware to apply to dispatchers.
*
diff --git a/app/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php b/app/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php
index 3cb186d48..7b4f9d88c 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php
@@ -120,11 +120,11 @@ public function implementedEvents()
return [
'Dispatcher.beforeDispatch' => [
'callable' => 'handle',
- 'priority' => $this->_config['priority']
+ 'priority' => $this->_config['priority'],
],
'Dispatcher.afterDispatch' => [
'callable' => 'handle',
- 'priority' => $this->_config['priority']
+ 'priority' => $this->_config['priority'],
],
];
}
@@ -155,7 +155,7 @@ public function handle(Event $event)
*/
public function matches(Event $event)
{
- /* @var \Cake\Http\ServerRequest $request */
+ /** @var \Cake\Http\ServerRequest $request */
$request = $event->getData('request');
$pass = true;
if (!empty($this->_config['for'])) {
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php
index 4fbcbe83d..253d1b885 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/DuplicateNamedRouteException.php
@@ -19,7 +19,6 @@
*/
class DuplicateNamedRouteException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingControllerException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingControllerException.php
index 5bd79f49a..dfbdada1d 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingControllerException.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingControllerException.php
@@ -20,7 +20,6 @@
*/
class MissingControllerException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingDispatcherFilterException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingDispatcherFilterException.php
index 647760af3..945b38d3d 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingDispatcherFilterException.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingDispatcherFilterException.php
@@ -19,7 +19,6 @@
*/
class MissingDispatcherFilterException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php
index 84ffbfcc6..7a03641de 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/MissingRouteException.php
@@ -20,7 +20,6 @@
*/
class MissingRouteException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Exception/RedirectException.php b/app/vendor/cakephp/cakephp/src/Routing/Exception/RedirectException.php
index 2a392b95a..4c5c0a888 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Exception/RedirectException.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Exception/RedirectException.php
@@ -28,7 +28,6 @@
*/
class RedirectException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Filter/AssetFilter.php b/app/vendor/cakephp/cakephp/src/Routing/Filter/AssetFilter.php
index b60b045fc..7c829e0df 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Filter/AssetFilter.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Filter/AssetFilter.php
@@ -27,7 +27,6 @@
*/
class AssetFilter extends DispatcherFilter
{
-
/**
* Default priority for all methods in this filter
* This filter should run before the request gets parsed by router
@@ -44,7 +43,6 @@ class AssetFilter extends DispatcherFilter
protected $_cacheTime = '+1 day';
/**
- *
* Constructor.
*
* @param array $config Array of config.
@@ -66,7 +64,7 @@ public function __construct($config = [])
*/
public function beforeDispatch(Event $event)
{
- /* @var \Cake\Http\ServerRequest $request */
+ /** @var \Cake\Http\ServerRequest $request */
$request = $event->getData('request');
$url = urldecode($request->getUri()->getPath());
@@ -78,7 +76,7 @@ public function beforeDispatch(Event $event)
if ($assetFile === null || !file_exists($assetFile)) {
return null;
}
- /* @var \Cake\Http\Response $response */
+ /** @var \Cake\Http\Response $response */
$response = $event->getData('response');
$event->stopPropagation();
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php b/app/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php
index 7a6164c59..aec14df8b 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php
@@ -27,7 +27,6 @@
*/
class ControllerFactoryFilter extends DispatcherFilter
{
-
/**
* Priority is set high to allow other filters to be called first.
*
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Filter/LocaleSelectorFilter.php b/app/vendor/cakephp/cakephp/src/Routing/Filter/LocaleSelectorFilter.php
index 63a9ada1f..a65384ac5 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Filter/LocaleSelectorFilter.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Filter/LocaleSelectorFilter.php
@@ -26,7 +26,6 @@
*/
class LocaleSelectorFilter extends DispatcherFilter
{
-
/**
* List of valid locales for the request
*
@@ -58,7 +57,7 @@ public function __construct($config = [])
*/
public function beforeDispatch(Event $event)
{
- /* @var \Cake\Http\ServerRequest $request */
+ /** @var \Cake\Http\ServerRequest $request */
$request = $event->getData('request');
$locale = Locale::acceptFromHttp($request->getHeaderLine('Accept-Language'));
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Filter/RoutingFilter.php b/app/vendor/cakephp/cakephp/src/Routing/Filter/RoutingFilter.php
index ed9f378a7..509e73f2b 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Filter/RoutingFilter.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Filter/RoutingFilter.php
@@ -27,7 +27,6 @@
*/
class RoutingFilter extends DispatcherFilter
{
-
/**
* Priority setting.
*
@@ -47,7 +46,7 @@ class RoutingFilter extends DispatcherFilter
*/
public function beforeDispatch(Event $event)
{
- /* @var \Cake\Http\ServerRequest $request */
+ /** @var \Cake\Http\ServerRequest $request */
$request = $event->getData('request');
if (Router::getRequest(true) !== $request) {
Router::setRequestInfo($request);
@@ -62,7 +61,7 @@ public function beforeDispatch(Event $event)
return null;
} catch (RedirectException $e) {
$event->stopPropagation();
- /* @var \Cake\Http\Response $response */
+ /** @var \Cake\Http\Response $response */
$response = $event->getData('response');
$response = $response->withStatus($e->getCode())
->withLocation($e->getMessage());
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php b/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php
index de40cc267..035f9355e 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php
@@ -17,10 +17,10 @@
use Cake\Core\Plugin;
use Cake\Filesystem\File;
use Cake\Utility\Inflector;
+use Laminas\Diactoros\Response;
+use Laminas\Diactoros\Stream;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use Zend\Diactoros\Response;
-use Zend\Diactoros\Stream;
/**
* Handles serving plugin assets in development mode.
@@ -174,9 +174,9 @@ protected function deliverAsset(ServerRequestInterface $request, ResponseInterfa
return $response->withBody($stream)
->withHeader('Content-Type', $contentType)
->withHeader('Cache-Control', 'public,max-age=' . $maxAge)
- ->withHeader('Date', gmdate('D, j M Y G:i:s \G\M\T', time()))
- ->withHeader('Last-Modified', gmdate('D, j M Y G:i:s \G\M\T', $modified))
- ->withHeader('Expires', gmdate('D, j M Y G:i:s \G\M\T', $expire));
+ ->withHeader('Date', gmdate('D, d M Y H:i:s \G\M\T', time()))
+ ->withHeader('Last-Modified', gmdate('D, d M Y H:i:s \G\M\T', $modified))
+ ->withHeader('Expires', gmdate('D, d M Y H:i:s \G\M\T', $expire));
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php b/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php
index f9a71e40d..d47c42bc8 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php
@@ -21,9 +21,9 @@
use Cake\Http\Runner;
use Cake\Routing\Exception\RedirectException;
use Cake\Routing\Router;
+use Laminas\Diactoros\Response\RedirectResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-use Zend\Diactoros\Response\RedirectResponse;
/**
* Applies routing rules to the request and creates the controller
@@ -33,6 +33,8 @@ class RoutingMiddleware
{
/**
* Key used to store the route collection in the cache engine
+ *
+ * @var string
*/
const ROUTE_COLLECTION_CACHE_KEY = 'routeCollection';
@@ -153,7 +155,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
} catch (RedirectException $e) {
return new RedirectResponse(
$e->getMessage(),
- $e->getCode(),
+ (int)$e->getCode(),
$response->getHeaders()
);
}
diff --git a/app/vendor/cakephp/cakephp/src/Routing/RequestActionTrait.php b/app/vendor/cakephp/cakephp/src/Routing/RequestActionTrait.php
index 27f535002..4c7fd4e76 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/RequestActionTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/RequestActionTrait.php
@@ -27,7 +27,6 @@
*/
trait RequestActionTrait
{
-
/**
* Calls a controller's method from any location. Can be used to connect controllers together
* or tie plugins into a main application. requestAction can be used to return rendered views
@@ -122,14 +121,14 @@ public function requestAction($url, array $extra = [])
}
if (is_string($url)) {
$params = [
- 'url' => $url
+ 'url' => $url,
];
} elseif (is_array($url)) {
$defaultParams = ['plugin' => null, 'controller' => null, 'action' => null];
$params = [
'params' => $url + $defaultParams,
'base' => false,
- 'url' => Router::reverse($url)
+ 'url' => Router::reverse($url),
];
if (empty($params['params']['pass'])) {
$params['params']['pass'] = [];
@@ -166,7 +165,7 @@ public function requestAction($url, array $extra = [])
// we need to 'fix' their missing dispatcher filters.
$needed = [
'routing' => RoutingFilter::class,
- 'controller' => ControllerFactoryFilter::class
+ 'controller' => ControllerFactoryFilter::class,
];
foreach ($dispatcher->filters() as $filter) {
if ($filter instanceof RoutingFilter) {
@@ -177,7 +176,7 @@ public function requestAction($url, array $extra = [])
}
}
foreach ($needed as $class) {
- $dispatcher->addFilter(new $class);
+ $dispatcher->addFilter(new $class());
}
$result = $dispatcher->dispatch($request, new Response());
Router::popRequest();
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Route/DashedRoute.php b/app/vendor/cakephp/cakephp/src/Routing/Route/DashedRoute.php
index 71ff7f436..d21be8e14 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Route/DashedRoute.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Route/DashedRoute.php
@@ -23,7 +23,6 @@
*/
class DashedRoute extends Route
{
-
/**
* Flag for tracking whether or not the defaults have been inflected.
*
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Route/InflectedRoute.php b/app/vendor/cakephp/cakephp/src/Routing/Route/InflectedRoute.php
index face5d188..cf5de1523 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Route/InflectedRoute.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Route/InflectedRoute.php
@@ -22,7 +22,6 @@
*/
class InflectedRoute extends Route
{
-
/**
* Flag for tracking whether or not the defaults have been inflected.
*
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Route/PluginShortRoute.php b/app/vendor/cakephp/cakephp/src/Routing/Route/PluginShortRoute.php
index 2e7cf7d50..9b780d6ae 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Route/PluginShortRoute.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Route/PluginShortRoute.php
@@ -20,7 +20,6 @@
*/
class PluginShortRoute extends InflectedRoute
{
-
/**
* Parses a string URL into an array. If a plugin key is found, it will be copied to the
* controller parameter.
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Route/RedirectRoute.php b/app/vendor/cakephp/cakephp/src/Routing/Route/RedirectRoute.php
index 7de437913..3729f54ea 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Route/RedirectRoute.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Route/RedirectRoute.php
@@ -27,7 +27,6 @@
*/
class RedirectRoute extends Route
{
-
/**
* A Response object
*
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Route/Route.php b/app/vendor/cakephp/cakephp/src/Routing/Route/Route.php
index d175e395a..d9bc270c2 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Route/Route.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Route/Route.php
@@ -28,7 +28,6 @@
*/
class Route
{
-
/**
* An array of named segments in a Route.
* `/:controller/:action/:id` has 3 key elements
@@ -143,7 +142,7 @@ public function __construct($template, $defaults = [], array $options = [])
* Get/Set the supported extensions for this route.
*
* @deprecated 3.3.9 Use getExtensions/setExtensions instead.
- * @param null|string|array $extensions The extensions to set. Use null to get.
+ * @param array|string|null $extensions The extensions to set. Use null to get.
* @return array|null The extensions or null.
*/
public function extensions($extensions = null)
@@ -220,7 +219,7 @@ public function setPatterns(array $patterns)
if (mb_strlen($patternValues) < strlen($patternValues)) {
$this->options['multibytePattern'] = true;
}
- $this->options = array_merge($this->options, $patterns);
+ $this->options = $patterns + $this->options;
return $this;
}
@@ -280,7 +279,7 @@ public function setPersist(array $names)
*/
public function compiled()
{
- return !empty($this->_compiledRoute);
+ return $this->_compiledRoute !== null;
}
/**
@@ -388,11 +387,14 @@ public function getName()
'prefix' => ':',
'plugin' => '.',
'controller' => ':',
- 'action' => ''
+ 'action' => '',
];
foreach ($keys as $key => $glue) {
$value = null;
- if (strpos($this->template, ':' . $key) !== false) {
+ if (
+ strpos($this->template, ':' . $key) !== false
+ || strpos($this->template, '{' . $key . '}') !== false
+ ) {
$value = '_' . $key;
} elseif (isset($this->defaults[$key])) {
$value = $this->defaults[$key];
@@ -622,7 +624,8 @@ public function match(array $url, array $context = [])
$defaults = $this->defaults;
$context += ['params' => [], '_port' => null, '_scheme' => null, '_host' => null];
- if (!empty($this->options['persist']) &&
+ if (
+ !empty($this->options['persist']) &&
is_array($this->options['persist'])
) {
$url = $this->_persistParams($url, $context['params']);
@@ -647,7 +650,8 @@ public function match(array $url, array $context = [])
// Check for properties that will cause an
// absolute url. Copy the other properties over.
- if (isset($hostOptions['_scheme']) ||
+ if (
+ isset($hostOptions['_scheme']) ||
isset($hostOptions['_port']) ||
isset($hostOptions['_host'])
) {
@@ -742,13 +746,21 @@ public function match(array $url, array $context = [])
// check patterns for routed params
if (!empty($this->options)) {
foreach ($this->options as $key => $pattern) {
- if (isset($url[$key]) && !preg_match('#^' . $pattern . '$#u', $url[$key])) {
+ if (isset($url[$key]) && !preg_match('#^' . $pattern . '$#u', (string)$url[$key])) {
return false;
}
}
}
$url += $hostOptions;
+ // Ensure controller/action keys are not null.
+ if (
+ (isset($keyNames['controller']) && !isset($url['controller'])) ||
+ (isset($keyNames['action']) && !isset($url['action']))
+ ) {
+ return false;
+ }
+
return $this->_writeUrl($url, $pass, $query);
}
@@ -799,12 +811,10 @@ protected function _writeUrl($params, $pass = [], $query = [])
$search = $replace = [];
foreach ($this->keys as $key) {
- $string = null;
- if (isset($params[$key])) {
- $string = $params[$key];
- } elseif (strpos($out, $key) != strlen($out) - strlen($key)) {
- $key .= '/';
+ if (!array_key_exists($key, $params)) {
+ throw new InvalidArgumentException("Missing required route key `{$key}`");
}
+ $string = $params[$key];
if ($this->braceKeys) {
$search[] = "{{$key}}";
} else {
@@ -829,7 +839,8 @@ protected function _writeUrl($params, $pass = [], $query = [])
}
$out = str_replace('//', '/', $out);
- if (isset($params['_scheme']) ||
+ if (
+ isset($params['_scheme']) ||
isset($params['_host']) ||
isset($params['_port'])
) {
diff --git a/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php b/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php
index 5074ded44..f6a7b2f3e 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/RouteBuilder.php
@@ -31,7 +31,6 @@
*/
class RouteBuilder
{
-
/**
* Regular expression for auto increment IDs
*
@@ -105,7 +104,7 @@ class RouteBuilder
* The list of middleware that routes in this builder get
* added during construction.
*
- * @var array
+ * @var string[]
*/
protected $middleware = [];
@@ -192,8 +191,8 @@ public function getRouteClass()
* extensions applied. However, setting extensions does not modify existing routes.
*
* @deprecated 3.5.0 Use getExtensions/setExtensions instead.
- * @param null|string|array $extensions Either the extensions to use or null.
- * @return array|null
+ * @param string[]|string|null $extensions Either the extensions to use or null.
+ * @return string[]|null
*/
public function extensions($extensions = null)
{
@@ -236,7 +235,7 @@ public function getExtensions()
/**
* Add additional extensions to what is already in current scope
*
- * @param string|array $extensions One or more extensions to add
+ * @param string|string[] $extensions One or more extensions to add
* @return void
*/
public function addExtensions($extensions)
@@ -470,9 +469,9 @@ public function resources($name, $options = [], $callback = null)
* Create a route that only responds to GET requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function get($template, $target, $name = null)
@@ -484,9 +483,9 @@ public function get($template, $target, $name = null)
* Create a route that only responds to POST requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function post($template, $target, $name = null)
@@ -498,9 +497,9 @@ public function post($template, $target, $name = null)
* Create a route that only responds to PUT requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function put($template, $target, $name = null)
@@ -512,9 +511,9 @@ public function put($template, $target, $name = null)
* Create a route that only responds to PATCH requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function patch($template, $target, $name = null)
@@ -526,9 +525,9 @@ public function patch($template, $target, $name = null)
* Create a route that only responds to DELETE requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function delete($template, $target, $name = null)
@@ -540,9 +539,9 @@ public function delete($template, $target, $name = null)
* Create a route that only responds to HEAD requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function head($template, $target, $name = null)
@@ -554,9 +553,9 @@ public function head($template, $target, $name = null)
* Create a route that only responds to OPTIONS requests.
*
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
public function options($template, $target, $name = null)
@@ -569,9 +568,9 @@ public function options($template, $target, $name = null)
*
* @param string $method The HTTP method name to match.
* @param string $template The URL template to use.
- * @param array $target An array describing the target route parameters. These parameters
+ * @param array|string $target An array describing the target route parameters. These parameters
* should indicate the plugin, prefix, controller, and action that this route points to.
- * @param string $name The name of the route.
+ * @param string|null $name The name of the route.
* @return \Cake\Routing\Route\Route
*/
protected function _methodRoute($method, $template, $target, $name)
@@ -946,8 +945,14 @@ public function prefix($name, $params = [], callable $callback = null)
* Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set.
*
+ * ### Options
+ *
+ * - `path` The path prefix to use. Defaults to `Inflector::dasherize($name)`.
+ * - `_namePrefix` Set a prefix used for named routes. The prefix is prepended to the
+ * name of any route created in a scope callback.
+ *
* @param string $name The plugin name to build routes for
- * @param array|callable $options Either the options to use, or a callback
+ * @param array|callable $options Either the options to use, or a callback to build routes.
* @param callable|null $callback The callback to invoke that builds the plugin routes
* Only required when $options is defined.
* @return void
@@ -958,11 +963,14 @@ public function plugin($name, $options = [], $callback = null)
$callback = $options;
$options = [];
}
- $params = ['plugin' => $name] + $this->_params;
if (empty($options['path'])) {
- $options['path'] = '/' . Inflector::underscore($name);
+ $path = '/' . Inflector::underscore($name);
+ } else {
+ $path = $options['path'];
}
- $this->scope($options['path'], $params, $callback);
+ unset($options['path']);
+ $params = ['plugin' => $name] + $options + $this->_params;
+ $this->scope($path, $params, $callback);
}
/**
@@ -972,6 +980,11 @@ public function plugin($name, $options = [], $callback = null)
* added to. This means that both the current path and parameters will be appended
* to the supplied parameters.
*
+ * ### Special Keys in $params
+ *
+ * - `_namePrefix` Set a prefix used for named routes. The prefix is prepended to the
+ * name of any route created in a scope callback.
+ *
* @param string $path The path to create a scope for.
* @param array|callable $params Either the parameters to add to routes, or a callback.
* @param callable|null $callback The callback to invoke that builds the plugin routes.
@@ -1021,8 +1034,8 @@ public function scope($path, $params, $callback = null)
public function fallbacks($routeClass = null)
{
$routeClass = $routeClass ?: $this->_routeClass;
- $this->connect('/:controller', ['action' => 'index'], compact('routeClass'));
- $this->connect('/:controller/:action/*', [], compact('routeClass'));
+ $this->connect('/{controller}', ['action' => 'index'], compact('routeClass'));
+ $this->connect('/{controller}/{action}/*', [], compact('routeClass'));
}
/**
@@ -1050,6 +1063,7 @@ public function registerMiddleware($name, $middleware)
*
* @param string ...$names The names of the middleware to apply to the current scope.
* @return $this
+ * @throws \RuntimeException
* @see \Cake\Routing\RouteCollection::addMiddlewareToScope()
*/
public function applyMiddleware(...$names)
diff --git a/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php b/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php
index faafc9f15..093259319 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/RouteCollection.php
@@ -30,7 +30,6 @@
*/
class RouteCollection
{
-
/**
* The routes connected to this collection.
*
@@ -155,7 +154,7 @@ public function parse($url, $method = '')
list($url, $queryParameters) = explode('?', $url, 2);
parse_str($queryParameters, $queryParameters);
}
- /* @var \Cake\Routing\Route\Route $route */
+ /** @var \Cake\Routing\Route\Route $route */
foreach ($this->_paths[$path] as $route) {
$r = $route->parse($url, $method);
if ($r === false) {
@@ -200,7 +199,7 @@ public function parseRequest(ServerRequestInterface $request)
continue;
}
- /* @var \Cake\Routing\Route\Route $route */
+ /** @var \Cake\Routing\Route\Route $route */
foreach ($this->_paths[$path] as $route) {
$r = $route->parseRequest($request);
if ($r === false) {
@@ -222,7 +221,7 @@ public function parseRequest(ServerRequestInterface $request)
* and newer style urls containing '_name'
*
* @param array $url The url to match.
- * @return array The set of names of the url
+ * @return string[] The set of names of the url
*/
protected function _getNames($url)
{
@@ -336,7 +335,7 @@ public function match($url, $context)
if (empty($this->_routeTable[$name])) {
continue;
}
- /* @var \Cake\Routing\Route\Route $route */
+ /** @var \Cake\Routing\Route\Route $route */
foreach ($this->_routeTable[$name] as $route) {
$match = $route->match($url, $context);
if ($match) {
@@ -370,11 +369,11 @@ public function named()
/**
* Get/set the extensions that the route collection could handle.
*
- * @param null|string|array $extensions Either the list of extensions to set,
+ * @param string[]|string|null $extensions Either the list of extensions to set,
* or null to get.
* @param bool $merge Whether to merge with or override existing extensions.
* Defaults to `true`.
- * @return array The valid extensions.
+ * @return string[] The valid extensions.
* @deprecated 3.5.0 Use getExtensions()/setExtensions() instead.
*/
public function extensions($extensions = null, $merge = true)
@@ -445,6 +444,7 @@ public function registerMiddleware($name, $middleware)
* @param string $name Name of the middleware group
* @param string[] $middlewareNames Names of the middleware
* @return $this
+ * @throws \RuntimeException
*/
public function middlewareGroup($name, array $middlewareNames)
{
@@ -504,6 +504,7 @@ public function middlewareExists($name)
* @param string $path The URL path to register middleware for.
* @param string[] $middleware The middleware names to add for the path.
* @return $this
+ * @throws \RuntimeException
*/
public function applyMiddleware($path, array $middleware)
{
diff --git a/app/vendor/cakephp/cakephp/src/Routing/Router.php b/app/vendor/cakephp/cakephp/src/Routing/Router.php
index d6953dcdf..713fbdc4a 100644
--- a/app/vendor/cakephp/cakephp/src/Routing/Router.php
+++ b/app/vendor/cakephp/cakephp/src/Routing/Router.php
@@ -39,7 +39,6 @@
*/
class Router
{
-
/**
* Have routes been loaded
*
@@ -59,7 +58,7 @@ class Router
* Contains the base string that will be applied to all generated URLs
* For example `https://example.com`
*
- * @var string
+ * @var string|null
*/
protected static $_fullBaseUrl;
@@ -130,7 +129,7 @@ class Router
'Month' => Router::MONTH,
'Day' => Router::DAY,
'ID' => Router::ID,
- 'UUID' => Router::UUID
+ 'UUID' => Router::UUID,
];
/**
@@ -161,7 +160,7 @@ class Router
/**
* Default extensions defined with Router::extensions()
*
- * @var array
+ * @var string[]
*/
protected static $_defaultExtensions = [];
@@ -420,7 +419,7 @@ public static function setRequestInfo($request)
$requestData[0] += [
'controller' => false,
'action' => false,
- 'plugin' => null
+ 'plugin' => null,
];
$request = new ServerRequest([
'params' => $requestData[0],
@@ -647,10 +646,10 @@ protected static function _applyUrlFilters($url)
* - `_name` - Name of route. If you have setup named routes you can use this key
* to specify it.
*
- * @param string|array|null $url An array specifying any of the following:
+ * @param string|array|\Psr\Http\Message\UriInterface|null $url An array specifying any of the following:
* 'controller', 'action', 'plugin' additionally, you can provide routed
* elements or query string parameters. If string it can be name any valid url
- * string.
+ * string or it can be an UriInterface instance.
* @param bool $full If true, the full base URL will be prepended to the result.
* Default is false.
* @return string Full translated URL with base path.
@@ -706,7 +705,8 @@ public static function url($url = null, $full = false)
if (!isset($url['_name'])) {
// Copy the current action if the controller is the current one.
- if (empty($url['action']) &&
+ if (
+ empty($url['action']) &&
(empty($url['controller']) || $params['controller'] === $url['controller'])
) {
$url['action'] = $params['action'];
@@ -721,7 +721,7 @@ public static function url($url = null, $full = false)
'plugin' => $params['plugin'],
'controller' => $params['controller'],
'action' => 'index',
- '_ext' => null
+ '_ext' => null,
];
}
@@ -734,6 +734,8 @@ public static function url($url = null, $full = false)
$output = static::$_collection->match($url, $context);
} else {
+ $url = (string)$url;
+
$plainString = (
strpos($url, 'javascript:') === 0 ||
strpos($url, 'mailto:') === 0 ||
@@ -769,7 +771,6 @@ public static function url($url = null, $full = false)
* ### Usage
*
* @see Router::url()
- *
* @param string|array|null $url An array specifying any of the following:
* 'controller', 'action', 'plugin' additionally, you can provide routed
* elements or query string parameters. If string it can be name any valid url
@@ -852,7 +853,9 @@ public static function reverseToArray($params)
$params['bare'],
$params['requested'],
$params['return'],
+ $params['isAjax'],
$params['_Token'],
+ $params['_csrfToken'],
$params['_matchedRoute'],
$params['_name']
);
@@ -941,10 +944,10 @@ public static function normalize($url = '/')
* A string or an array of valid extensions can be passed to this method.
* If called without any parameters it will return current list of set extensions.
*
- * @param array|string|null $extensions List of extensions to be added.
+ * @param string[]|string|null $extensions List of extensions to be added.
* @param bool $merge Whether to merge with or override existing extensions.
* Defaults to `true`.
- * @return array Array of extensions Router is configured to parse.
+ * @return string[] Array of extensions Router is configured to parse.
*/
public static function extensions($extensions = null, $merge = true)
{
@@ -1010,7 +1013,7 @@ public static function parseNamedParams(ServerRequest $request, array $options =
$arr = [$arr];
} else {
$arr = [
- $match[1] => $arr
+ $match[1] => $arr,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Shell/CacheShell.php b/app/vendor/cakephp/cakephp/src/Shell/CacheShell.php
index 8a13fee58..9f023e711 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/CacheShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/CacheShell.php
@@ -29,7 +29,6 @@
*/
class CacheShell extends Shell
{
-
/**
* Get the option parser for this shell.
*
@@ -50,15 +49,15 @@ public function getOptionParser()
'description' => [
'Clear the cache for a particular prefix.',
'For example, `cake cache clear _cake_model_` will clear the model cache',
- 'Use `cake cache list_prefixes` to list available prefixes'
+ 'Use `cake cache list_prefixes` to list available prefixes',
],
'arguments' => [
'prefix' => [
'help' => 'The cache prefix to be cleared.',
- 'required' => true
- ]
- ]
- ]
+ 'required' => true,
+ ],
+ ],
+ ],
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/CommandListShell.php b/app/vendor/cakephp/cakephp/src/Shell/CommandListShell.php
index 09054ce34..c00701880 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/CommandListShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/CommandListShell.php
@@ -29,7 +29,6 @@
*/
class CommandListShell extends Shell
{
-
/**
* Contains tasks to load and instantiate
*
@@ -160,10 +159,10 @@ public function getOptionParser()
'Get the list of available shells for this CakePHP application.'
)->addOption('xml', [
'help' => 'Get the listing as XML.',
- 'boolean' => true
+ 'boolean' => true,
])->addOption('version', [
'help' => 'Prints the currently installed version of CakePHP. (deprecated - use `cake --version` instead)',
- 'boolean' => true
+ 'boolean' => true,
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/CompletionShell.php b/app/vendor/cakephp/cakephp/src/Shell/CompletionShell.php
index a2843322c..3a9da8d7e 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/CompletionShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/CompletionShell.php
@@ -23,7 +23,6 @@
*/
class CompletionShell extends Shell
{
-
/**
* Contains tasks to load and instantiate
*
@@ -123,7 +122,7 @@ public function getOptionParser()
'help' => 'Output a list of available commands',
'parser' => [
'description' => 'List all available',
- ]
+ ],
])->addSubcommand('subcommands', [
'help' => 'Output a list of available subcommands',
'parser' => [
@@ -132,9 +131,9 @@ public function getOptionParser()
'command' => [
'help' => 'The command name',
'required' => false,
- ]
- ]
- ]
+ ],
+ ],
+ ],
])->addSubcommand('options', [
'help' => 'Output a list of available options',
'parser' => [
@@ -147,11 +146,11 @@ public function getOptionParser()
'subcommand' => [
'help' => 'The subcommand name',
'required' => false,
- ]
- ]
- ]
+ ],
+ ],
+ ],
])->addSubcommand('fuzzy', [
- 'help' => 'Guess autocomplete'
+ 'help' => 'Guess autocomplete',
])->setEpilog([
'This command is not intended to be called manually',
]);
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php b/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php
index 9d92e5424..5522a28d4 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Helper/ProgressHelper.php
@@ -33,11 +33,10 @@
*/
class ProgressHelper extends Helper
{
-
/**
* The current progress.
*
- * @var int
+ * @var int|float
*/
protected $_progress = 0;
@@ -112,7 +111,7 @@ public function init(array $args = [])
/**
* Increment the progress bar.
*
- * @param int $num The amount of progress to advance by.
+ * @param int|float $num The amount of progress to advance by.
* @return $this
*/
public function increment($num = 1)
@@ -134,12 +133,12 @@ public function draw()
$barLen = ($this->_width - $numberLen) * ($this->_progress / $this->_total);
$bar = '';
if ($barLen > 1) {
- $bar = str_repeat('=', $barLen - 1) . '>';
+ $bar = str_repeat('=', (int)$barLen - 1) . '>';
}
$pad = ceil($this->_width - $numberLen - $barLen);
if ($pad > 0) {
- $bar .= str_repeat(' ', $pad);
+ $bar .= str_repeat(' ', (int)$pad);
}
$percent = ($complete * 100) . '%';
$bar .= str_pad($percent, $numberLen, ' ', STR_PAD_LEFT);
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Helper/TableHelper.php b/app/vendor/cakephp/cakephp/src/Shell/Helper/TableHelper.php
index b8116b634..ae3edeef9 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Helper/TableHelper.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Helper/TableHelper.php
@@ -21,7 +21,6 @@
*/
class TableHelper extends Helper
{
-
/**
* Default config for this helper.
*
@@ -37,7 +36,7 @@ class TableHelper extends Helper
* Calculate the column widths
*
* @param array $rows The rows on which the columns width will be calculated on.
- * @return array
+ * @return int[]
*/
protected function _calculateWidths($rows)
{
@@ -57,11 +56,15 @@ protected function _calculateWidths($rows)
/**
* Get the width of a cell exclusive of style tags.
*
- * @param string $text The text to calculate a width for.
+ * @param string|null $text The text to calculate a width for.
* @return int The width of the textual content in visible characters.
*/
protected function _cellWidth($text)
{
+ if ($text === null) {
+ return 0;
+ }
+
if (strpos($text, '<') === false && strpos($text, '>') === false) {
return mb_strwidth($text);
}
@@ -77,7 +80,7 @@ protected function _cellWidth($text)
/**
* Output a row separator.
*
- * @param array $widths The widths of each column to output.
+ * @param int[] $widths The widths of each column to output.
* @return void
*/
protected function _rowSeparator($widths)
@@ -94,7 +97,7 @@ protected function _rowSeparator($widths)
* Output a row.
*
* @param array $row The row to output.
- * @param array $widths The widths of each column to output.
+ * @param int[] $widths The widths of each column to output.
* @param array $options Options to be passed.
* @return void
*/
diff --git a/app/vendor/cakephp/cakephp/src/Shell/I18nShell.php b/app/vendor/cakephp/cakephp/src/Shell/I18nShell.php
index 4dd6e748d..5e9360eff 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/I18nShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/I18nShell.php
@@ -27,7 +27,6 @@
*/
class I18nShell extends Shell
{
-
/**
* Contains tasks to load and instantiate
*
@@ -138,30 +137,30 @@ public function getOptionParser()
'options' => [
'plugin' => [
'help' => 'Plugin name.',
- 'short' => 'p'
+ 'short' => 'p',
],
'force' => [
'help' => 'Force overwriting.',
'short' => 'f',
- 'boolean' => true
- ]
+ 'boolean' => true,
+ ],
],
'arguments' => [
'language' => [
- 'help' => 'Two-letter language code.'
- ]
- ]
+ 'help' => 'Two-letter language code.',
+ ],
+ ],
];
$parser->setDescription(
'I18n Shell generates .pot files(s) with translations.'
)->addSubcommand('extract', [
'help' => 'Extract the po translations from your application',
- 'parser' => $this->Extract->getOptionParser()
+ 'parser' => $this->Extract->getOptionParser(),
])
->addSubcommand('init', [
'help' => 'Init PO language file from POT file',
- 'parser' => $initParser
+ 'parser' => $initParser,
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/OrmCacheShell.php b/app/vendor/cakephp/cakephp/src/Shell/OrmCacheShell.php
index 7d4448258..03762e553 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/OrmCacheShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/OrmCacheShell.php
@@ -27,5 +27,4 @@
*/
class OrmCacheShell extends SchemaCacheShell
{
-
}
diff --git a/app/vendor/cakephp/cakephp/src/Shell/PluginShell.php b/app/vendor/cakephp/cakephp/src/Shell/PluginShell.php
index 3236a956c..402dc713c 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/PluginShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/PluginShell.php
@@ -26,7 +26,6 @@
*/
class PluginShell extends Shell
{
-
/**
* Tasks to load
*
@@ -61,7 +60,7 @@ public function getOptionParser()
$parser->setDescription('Plugin Shell perform various tasks related to plugin.')
->addSubcommand('assets', [
'help' => 'Symlink / copy plugin assets to app\'s webroot',
- 'parser' => $this->Assets->getOptionParser()
+ 'parser' => $this->Assets->getOptionParser(),
])
->addSubcommand('loaded', [
'help' => 'Lists all loaded plugins',
diff --git a/app/vendor/cakephp/cakephp/src/Shell/RoutesShell.php b/app/vendor/cakephp/cakephp/src/Shell/RoutesShell.php
index 00eb608fc..9f1f736c0 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/RoutesShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/RoutesShell.php
@@ -17,6 +17,7 @@
use Cake\Console\Shell;
use Cake\Http\ServerRequest;
use Cake\Routing\Exception\MissingRouteException;
+use Cake\Routing\Exception\RedirectException;
use Cake\Routing\Router;
/**
@@ -24,7 +25,6 @@
*/
class RoutesShell extends Shell
{
-
/**
* Override main() to handle action
* Displays all routes in an application.
@@ -34,7 +34,7 @@ class RoutesShell extends Shell
public function main()
{
$output = [
- ['Route name', 'URI template', 'Defaults']
+ ['Route name', 'URI template', 'Defaults'],
];
foreach (Router::routes() as $route) {
$name = isset($route->options['_name']) ? $route->options['_name'] : $route->getName();
@@ -69,7 +69,14 @@ public function check($url)
$output = [
['Route name', 'URI template', 'Defaults'],
- [$name, $url, json_encode($route)]
+ [$name, $url, json_encode($route)],
+ ];
+ $this->helper('table')->output($output);
+ $this->out();
+ } catch (RedirectException $e) {
+ $output = [
+ ['URI template', 'Redirect'],
+ [$url, $e->getMessage()],
];
$this->helper('table')->output($output);
$this->out();
@@ -87,6 +94,7 @@ public function check($url)
* Generate a URL based on a set of parameters
*
* Takes variadic arguments of key/value pairs.
+ *
* @return bool Success
*/
public function generate()
@@ -119,12 +127,12 @@ public function getOptionParser()
'This tool also lets you test URL generation and URL parsing.'
)->addSubcommand('check', [
'help' => 'Check a URL string against the routes. ' .
- 'Will output the routing parameters the route resolves to.'
+ 'Will output the routing parameters the route resolves to.',
])->addSubcommand('generate', [
'help' => 'Check a routing array against the routes. ' .
"Will output the URL if there is a match.\n\n" .
'Routing parameters should be supplied in a key:value format. ' .
- 'For example `controller:Articles action:view 2`'
+ 'For example `controller:Articles action:view 2`',
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/SchemaCacheShell.php b/app/vendor/cakephp/cakephp/src/Shell/SchemaCacheShell.php
index 61eea2fe0..b9b2658de 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/SchemaCacheShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/SchemaCacheShell.php
@@ -30,7 +30,6 @@
*/
class SchemaCacheShell extends Shell
{
-
/**
* Build metadata.
*
diff --git a/app/vendor/cakephp/cakephp/src/Shell/ServerShell.php b/app/vendor/cakephp/cakephp/src/Shell/ServerShell.php
index 67b7ac3f2..91d978b35 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/ServerShell.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/ServerShell.php
@@ -23,7 +23,6 @@
*/
class ServerShell extends Shell
{
-
/**
* Default ServerHost
*
@@ -74,7 +73,7 @@ class ServerShell extends Shell
* or otherwise modify the pre-command flow.
*
* @return void
- * @link https://book.cakephp.org/3.0/en/console-and-shells.html#hook-methods
+ * @link https://book.cakephp.org/3/en/console-and-shells.html#hook-methods
*/
public function startup()
{
@@ -164,16 +163,16 @@ public function getOptionParser()
'[WARN] Don\'t use this in a production environment',
])->addOption('host', [
'short' => 'H',
- 'help' => 'ServerHost'
+ 'help' => 'ServerHost',
])->addOption('port', [
'short' => 'p',
- 'help' => 'ListenPort'
+ 'help' => 'ListenPort',
])->addOption('ini_path', [
'short' => 'I',
- 'help' => 'php.ini path'
+ 'help' => 'php.ini path',
])->addOption('document_root', [
'short' => 'd',
- 'help' => 'DocumentRoot'
+ 'help' => 'DocumentRoot',
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Task/AssetsTask.php b/app/vendor/cakephp/cakephp/src/Shell/Task/AssetsTask.php
index 23fd28021..9f26183a6 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Task/AssetsTask.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Task/AssetsTask.php
@@ -24,7 +24,6 @@
*/
class AssetsTask extends Shell
{
-
/**
* Attempt to symlink plugin assets to app's webroot. If symlinking fails it
* fallbacks to copying the assets. For vendor namespaced plugin, parent folder
@@ -123,7 +122,7 @@ protected function _list($name = null)
'srcPath' => Plugin::path($plugin) . 'webroot',
'destDir' => $dir,
'link' => $link,
- 'namespaced' => $namespaced
+ 'namespaced' => $namespaced,
];
}
@@ -147,7 +146,8 @@ protected function _process($plugins, $copy = false, $overwrite = false)
$this->out('For plugin: ' . $plugin);
$this->hr();
- if ($config['namespaced'] &&
+ if (
+ $config['namespaced'] &&
!is_dir($config['destDir']) &&
!$this->_createDirectory($config['destDir'])
) {
@@ -320,18 +320,18 @@ public function getOptionParser()
$parser = parent::getOptionParser();
$parser->addSubcommand('symlink', [
- 'help' => 'Symlink (copy as fallback) plugin assets to app\'s webroot.'
+ 'help' => 'Symlink (copy as fallback) plugin assets to app\'s webroot.',
])->addSubcommand('copy', [
- 'help' => 'Copy plugin assets to app\'s webroot.'
+ 'help' => 'Copy plugin assets to app\'s webroot.',
])->addSubcommand('remove', [
- 'help' => 'Remove plugin assets from app\'s webroot.'
+ 'help' => 'Remove plugin assets from app\'s webroot.',
])->addArgument('name', [
'help' => 'A specific plugin you want to symlink assets for.',
'optional' => true,
])->addOption('overwrite', [
'help' => 'Overwrite existing symlink / folder / files.',
'default' => false,
- 'boolean' => true
+ 'boolean' => true,
]);
return $parser;
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Task/CommandTask.php b/app/vendor/cakephp/cakephp/src/Shell/Task/CommandTask.php
index e45281b82..5bc80a06c 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Task/CommandTask.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Task/CommandTask.php
@@ -28,7 +28,6 @@
*/
class CommandTask extends Shell
{
-
/**
* Gets the shell command listing.
*
@@ -82,9 +81,9 @@ protected function _findShells($shellList, $path, $key, $skip)
* Scan the provided paths for shells, and append them into $shellList
*
* @param string $type The type of object.
- * @param array $shells The shell name.
+ * @param string[] $shells The shell names.
* @param array $shellList List of shells.
- * @param array $skip List of command names to skip.
+ * @param string[] $skip List of command names to skip.
* @return array The updated $shellList
*/
protected function _appendShells($type, $shells, $shellList, $skip)
@@ -145,7 +144,8 @@ public function commands()
foreach ($shellList as $type => $commands) {
foreach ($commands as $shell) {
$prefix = '';
- if (!in_array(strtolower($type), ['app', 'core']) &&
+ if (
+ !in_array(strtolower($type), ['app', 'core']) &&
isset($duplicates[$type]) &&
in_array($shell, $duplicates[$type])
) {
@@ -202,7 +202,7 @@ public function subCommands($commandName)
* Get Shell instance for the given command
*
* @param string $commandName The command you want.
- * @return \Cake\Console\Shell|bool Shell instance if the command can be found, false otherwise.
+ * @return \Cake\Console\Shell|false Shell instance if the command can be found, false otherwise.
*/
public function getShell($commandName)
{
@@ -238,7 +238,7 @@ public function getShell($commandName)
return false;
}
- /* @var \Cake\Console\Shell $Shell */
+ /** @var \Cake\Console\Shell $Shell */
$Shell = new $class();
$Shell->plugin = trim($pluginDot, '.');
$Shell->initialize();
@@ -275,7 +275,7 @@ public function options($commandName, $subCommandName = '')
$options = [];
$array = $parser->options();
- /* @var \Cake\Console\ConsoleInputOption $obj */
+ /** @var \Cake\Console\ConsoleInputOption $obj */
foreach ($array as $name => $obj) {
$options[] = "--$name";
$short = $obj->short();
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Task/ExtractTask.php b/app/vendor/cakephp/cakephp/src/Shell/Task/ExtractTask.php
index c182bab97..dd7c823c4 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Task/ExtractTask.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Task/ExtractTask.php
@@ -27,7 +27,6 @@
*/
class ExtractTask extends Shell
{
-
/**
* Paths to use when looking for strings
*
@@ -114,12 +113,14 @@ class ExtractTask extends Shell
/**
* Displays marker error(s) if true
+ *
* @var bool
*/
protected $_markerError;
/**
* Count number of marker errors found
+ *
* @var bool
*/
protected $_countMarkerError = 0;
@@ -286,7 +287,7 @@ protected function _addTranslation($domain, $msgid, $details = [])
if (empty($this->_translations[$domain][$msgid][$context])) {
$this->_translations[$domain][$msgid][$context] = [
- 'msgid_plural' => false
+ 'msgid_plural' => false,
];
}
@@ -342,24 +343,24 @@ public function getOptionParser()
$parser->setDescription(
'CakePHP Language String Extraction:'
)->addOption('app', [
- 'help' => 'Directory where your application is located.'
+ 'help' => 'Directory where your application is located.',
])->addOption('paths', [
- 'help' => 'Comma separated list of paths.'
+ 'help' => 'Comma separated list of paths.',
])->addOption('merge', [
'help' => 'Merge all domain strings into the default.po file.',
- 'choices' => ['yes', 'no']
+ 'choices' => ['yes', 'no'],
])->addOption('relative-paths', [
'help' => 'Use relative paths in the .pot file',
'boolean' => true,
'default' => false,
])->addOption('output', [
- 'help' => 'Full path to output directory.'
+ 'help' => 'Full path to output directory.',
])->addOption('files', [
- 'help' => 'Comma separated list of files.'
+ 'help' => 'Comma separated list of files.',
])->addOption('exclude-plugins', [
'boolean' => true,
'default' => true,
- 'help' => 'Ignores all files in plugins if this command is run inside from the same app directory.'
+ 'help' => 'Ignores all files in plugins if this command is run inside from the same app directory.',
])->addOption('plugin', [
'help' => 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.',
'short' => 'p',
@@ -368,19 +369,19 @@ public function getOptionParser()
'default' => false,
'help' => 'Ignores validation messages in the $validate property.' .
' If this flag is not set and the command is run from the same app directory,' .
- ' all messages in model validation rules will be extracted as tokens.'
+ ' all messages in model validation rules will be extracted as tokens.',
])->addOption('validation-domain', [
- 'help' => 'If set to a value, the localization domain to be used for model validation messages.'
+ 'help' => 'If set to a value, the localization domain to be used for model validation messages.',
])->addOption('exclude', [
'help' => 'Comma separated list of directories to exclude.' .
- ' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors'
+ ' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors',
])->addOption('overwrite', [
'boolean' => true,
'default' => false,
- 'help' => 'Always overwrite existing .pot files.'
+ 'help' => 'Always overwrite existing .pot files.',
])->addOption('extract-core', [
'help' => 'Extract messages from the CakePHP core libs.',
- 'choices' => ['yes', 'no']
+ 'choices' => ['yes', 'no'],
])->addOption('no-location', [
'boolean' => true,
'default' => false,
@@ -602,12 +603,14 @@ protected function _store($domain, $header, $sentence)
*/
protected function _writeFiles()
{
+ $this->out();
$overwriteAll = false;
if (!empty($this->params['overwrite'])) {
$overwriteAll = true;
}
foreach ($this->_storage as $domain => $sentences) {
$output = $this->_writeHeader();
+ $headerLength = strlen($output);
foreach ($sentences as $sentence => $header) {
$output .= $header . $sentence;
}
@@ -620,6 +623,13 @@ protected function _writeFiles()
$filename = str_replace('/', '_', $domain) . '.pot';
$File = new File($this->_output . $filename);
+
+ if ($File->exists() && $this->_checkUnchanged($File, $headerLength, $output) === true) {
+ $this->out($filename . ' is unchanged. Skipping.');
+ $File->close();
+ continue;
+ }
+
$response = '';
while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') {
$this->out();
@@ -670,6 +680,26 @@ protected function _writeHeader()
return $output;
}
+ /**
+ * Check whether the old and new output are the same, thus unchanged
+ *
+ * Compares the sha1 hashes of the old and new file without header.
+ *
+ * @param File $oldFile The existing file.
+ * @param int $headerLength The length of the file header in bytes.
+ * @param string $newFileContent The content of the new file.
+ * @return bool Whether or not the old and new file are unchanged.
+ */
+ protected function _checkUnchanged(File $oldFile, $headerLength, $newFileContent)
+ {
+ $oldFileContent = $oldFile->read();
+
+ $oldChecksum = sha1(substr($oldFileContent, $headerLength));
+ $newChecksum = sha1(substr($newFileContent, $headerLength));
+
+ return $oldChecksum === $newChecksum;
+ }
+
/**
* Get the strings from the position forward
*
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Task/LoadTask.php b/app/vendor/cakephp/cakephp/src/Shell/Task/LoadTask.php
index 8fc005dd2..3c11c70ec 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Task/LoadTask.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Task/LoadTask.php
@@ -22,7 +22,6 @@
*/
class LoadTask extends Shell
{
-
/**
* Path to the bootstrap file.
*
diff --git a/app/vendor/cakephp/cakephp/src/Shell/Task/UnloadTask.php b/app/vendor/cakephp/cakephp/src/Shell/Task/UnloadTask.php
index 6139e7119..9904fa816 100644
--- a/app/vendor/cakephp/cakephp/src/Shell/Task/UnloadTask.php
+++ b/app/vendor/cakephp/cakephp/src/Shell/Task/UnloadTask.php
@@ -22,7 +22,6 @@
*/
class UnloadTask extends Shell
{
-
/**
* Path to the bootstrap file.
*
diff --git a/app/vendor/cakephp/cakephp/src/Template/Element/plugin_class_error.ctp b/app/vendor/cakephp/cakephp/src/Template/Element/plugin_class_error.ctp
index fe52e5110..a8a9d350e 100644
--- a/app/vendor/cakephp/cakephp/src/Template/Element/plugin_class_error.ctp
+++ b/app/vendor/cakephp/cakephp/src/Template/Element/plugin_class_error.ctp
@@ -25,8 +25,8 @@ if (!Plugin::isLoaded($plugin)):
else:
echo sprintf('Make sure your plugin was loaded from %s and Composer is able to autoload its classes, see %s and %s',
'config' . DIRECTORY_SEPARATOR . 'bootstrap.php',
- 'Loading a plugin',
- 'Plugins - autoloading plugin classes'
+ 'Loading a plugin',
+ 'Plugins - autoloading plugin classes'
);
endif;
diff --git a/app/vendor/cakephp/cakephp/src/Template/Layout/dev_error.ctp b/app/vendor/cakephp/cakephp/src/Template/Layout/dev_error.ctp
index c747fd7f0..f62bf42e4 100644
--- a/app/vendor/cakephp/cakephp/src/Template/Layout/dev_error.ctp
+++ b/app/vendor/cakephp/cakephp/src/Template/Layout/dev_error.ctp
@@ -205,7 +205,7 @@
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/ConsoleIntegrationTestTrait.php b/app/vendor/cakephp/cakephp/src/TestSuite/ConsoleIntegrationTestTrait.php
index 9dd15475b..1fc0837fe 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/ConsoleIntegrationTestTrait.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/ConsoleIntegrationTestTrait.php
@@ -26,6 +26,7 @@
use Cake\TestSuite\Constraint\Console\ExitCode;
use Cake\TestSuite\Stub\ConsoleInput;
use Cake\TestSuite\Stub\ConsoleOutput;
+use Cake\TestSuite\Stub\MissingConsoleInputException;
/**
* A test case class intended to make integration tests of cake console commands
@@ -88,6 +89,12 @@ public function exec($command, array $input = [])
try {
$this->_exitCode = $runner->run($args, $io);
+ } catch (MissingConsoleInputException $e) {
+ $messages = $this->_out->messages();
+ if (count($messages)) {
+ $e->setQuestion($messages[count($messages) - 1]);
+ }
+ throw $e;
} catch (StopException $exception) {
$this->_exitCode = $exception->getCode();
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsBase.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsBase.php
index 4b4818604..c508d5ee9 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsBase.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsBase.php
@@ -22,7 +22,6 @@
*/
abstract class ContentsBase extends Constraint
{
-
/**
* @var string
*/
@@ -36,7 +35,7 @@ abstract class ContentsBase extends Constraint
/**
* Constructor
*
- * @param int $contents Contents
+ * @param array $contents Contents
* @param string $output Output type
*/
public function __construct($contents, $output)
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContain.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContain.php
index c51873852..e1cee959c 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContain.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContain.php
@@ -20,7 +20,6 @@
*/
class ContentsContain extends ContentsBase
{
-
/**
* Checks if contents contain expected
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContainRow.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContainRow.php
index e73bb2019..a9dabc3f9 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContainRow.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsContainRow.php
@@ -20,7 +20,6 @@
*/
class ContentsContainRow extends ContentsRegExp
{
-
/**
* Checks if contents contain expected
*
@@ -54,6 +53,6 @@ public function toString()
*/
public function failureDescription($other)
{
- return $this->exporter->shortenedExport($other) . ' ' . $this->toString();
+ return '`' . $this->exporter->shortenedExport($other) . '` ' . $this->toString();
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsEmpty.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsEmpty.php
index e9bccc440..5b4d05e50 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsEmpty.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsEmpty.php
@@ -20,7 +20,6 @@
*/
class ContentsEmpty extends ContentsBase
{
-
/**
* Checks if contents are empty
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsNotContain.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsNotContain.php
index 22e066b29..2cc3b7a78 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsNotContain.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsNotContain.php
@@ -20,7 +20,6 @@
*/
class ContentsNotContain extends ContentsBase
{
-
/**
* Checks if contents contain expected
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsRegExp.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsRegExp.php
index 44b5690ce..636e29fd0 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsRegExp.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ContentsRegExp.php
@@ -20,7 +20,6 @@
*/
class ContentsRegExp extends ContentsBase
{
-
/**
* Checks if contents contain expected
*
@@ -48,6 +47,6 @@ public function toString()
*/
public function failureDescription($other)
{
- return $other . ' ' . $this->toString();
+ return '`' . $other . '` ' . $this->toString();
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ExitCode.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ExitCode.php
index c7bcd927f..5635d18f7 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ExitCode.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Console/ExitCode.php
@@ -22,7 +22,6 @@
*/
class ExitCode extends Constraint
{
-
/**
* @var int
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailConstraintBase.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailConstraintBase.php
index 356f2e320..157fea3e0 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailConstraintBase.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailConstraintBase.php
@@ -24,7 +24,9 @@
*/
abstract class MailConstraintBase extends Constraint
{
-
+ /**
+ * @var int|null
+ */
protected $at;
/**
@@ -48,7 +50,7 @@ public function getEmails()
{
$emails = TestEmailTransport::getEmails();
- if ($this->at) {
+ if ($this->at !== null) {
if (!isset($emails[$this->at])) {
return [];
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContains.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContains.php
index a4a4e55ae..5269c270c 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContains.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContains.php
@@ -21,7 +21,6 @@
*/
class MailContains extends MailConstraintBase
{
-
/**
* Mail type to check contents of
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsAttachment.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsAttachment.php
new file mode 100644
index 000000000..54b1c3d8d
--- /dev/null
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsAttachment.php
@@ -0,0 +1,76 @@
+getEmails();
+ foreach ($messages as $message) {
+ foreach ($message->getAttachments() as $filename => $fileInfo) {
+ if ($filename === $expectedFilename && empty($expectedFileInfo)) {
+ return true;
+ }
+ if (!empty($expectedFileInfo) && array_intersect($expectedFileInfo, $fileInfo) === $expectedFileInfo) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Assertion message string
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ if ($this->at) {
+ return sprintf('is an attachment of email #%d', $this->at);
+ }
+
+ return 'is an attachment of an email';
+ }
+
+ /**
+ * Overwrites the descriptions so we can remove the automatic "expected" message
+ *
+ * @param mixed $other Value
+ * @return string
+ */
+ protected function failureDescription($other)
+ {
+ list($expectedFilename) = $other;
+
+ return '\'' . $expectedFilename . '\' ' . $this->toString();
+ }
+}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsHtml.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsHtml.php
index ff87bfb2d..ef9bba312 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsHtml.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsHtml.php
@@ -23,6 +23,9 @@
*/
class MailContainsHtml extends MailContains
{
+ /**
+ * @inheritDoc
+ */
protected $type = Email::MESSAGE_HTML;
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsText.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsText.php
index 1e1d773ec..4244ffa8e 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsText.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailContainsText.php
@@ -23,6 +23,9 @@
*/
class MailContainsText extends MailContains
{
+ /**
+ * @inheritDoc
+ */
protected $type = Email::MESSAGE_TEXT;
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailCount.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailCount.php
index 34f02e5c4..c49beb5e8 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailCount.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailCount.php
@@ -21,7 +21,6 @@
*/
class MailCount extends MailConstraintBase
{
-
/**
* Checks constraint
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentFrom.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentFrom.php
index 7ddb6e0a7..d23a2e158 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentFrom.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentFrom.php
@@ -21,6 +21,9 @@
*/
class MailSentFrom extends MailSentWith
{
+ /**
+ * @inheritDoc
+ */
protected $method = 'from';
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentTo.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentTo.php
index 910903fee..a9dc6eefd 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentTo.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentTo.php
@@ -21,6 +21,9 @@
*/
class MailSentTo extends MailSentWith
{
+ /**
+ * @inheritDoc
+ */
protected $method = 'to';
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentWith.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentWith.php
index dc785026b..f141b5f4b 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentWith.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/MailSentWith.php
@@ -21,6 +21,9 @@
*/
class MailSentWith extends MailConstraintBase
{
+ /**
+ * @var string
+ */
protected $method;
/**
@@ -48,11 +51,15 @@ public function matches($other)
{
$emails = $this->getEmails();
foreach ($emails as $email) {
- $value = $email->{'get' . ucfirst($this->method)}();
- if (in_array($this->method, ['to', 'cc', 'bcc', 'from']) && isset($value[$other])) {
+ $value = $this->getValue($email);
+ if ($value === $other) {
return true;
}
- if ($value === $other) {
+ if (
+ !is_array($other)
+ && in_array($this->method, ['to', 'cc', 'bcc', 'from'])
+ && array_key_exists($other, $value)
+ ) {
return true;
}
}
@@ -60,6 +67,22 @@ public function matches($other)
return false;
}
+ /**
+ * Read a value from the email
+ *
+ * @param \Cake\Mailer\Email $email The email to read properties from.
+ * @return mixed
+ */
+ protected function getValue($email)
+ {
+ $viewBuilderMethods = ['template', 'layout', 'helpers', 'theme'];
+ if (in_array($this->method, $viewBuilderMethods, true)) {
+ return $email->viewBuilder()->{'get' . ucfirst($this->method)}();
+ }
+
+ return $email->{'get' . ucfirst($this->method)}();
+ }
+
/**
* Assertion message string
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/NoMailSent.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/NoMailSent.php
index 29aa08a49..159a9c6fa 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/NoMailSent.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Email/NoMailSent.php
@@ -21,7 +21,6 @@
*/
class NoMailSent extends MailConstraintBase
{
-
/**
* Checks constraint
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/EventFiredWith.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/EventFiredWith.php
index 966325af0..d8dc42265 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/EventFiredWith.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/EventFiredWith.php
@@ -83,7 +83,7 @@ public function matches($other)
throw new AssertionFailedError(sprintf('Event "%s" was fired %d times, cannot make data assertion', $other, count($events)));
}
- /* @var \Cake\Event\Event $event */
+ /** @var \Cake\Event\Event $event */
$event = $events[0];
if (array_key_exists($this->_dataKey, $event->getData()) === false) {
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyContains.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyContains.php
index 0b753952f..6ab1669f9 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyContains.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyContains.php
@@ -22,7 +22,6 @@
*/
class BodyContains extends ResponseBase
{
-
/**
* @var bool
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEmpty.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEmpty.php
index a0c0c4140..77eed2c03 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEmpty.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEmpty.php
@@ -20,7 +20,6 @@
*/
class BodyEmpty extends ResponseBase
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEquals.php
index df817b6cb..1e785a9c0 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyEquals.php
@@ -20,7 +20,6 @@
*/
class BodyEquals extends ResponseBase
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotContains.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotContains.php
index 281f963ad..a71f5f8d3 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotContains.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotContains.php
@@ -20,7 +20,6 @@
*/
class BodyNotContains extends BodyContains
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEmpty.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEmpty.php
index 16a64e900..a25decd68 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEmpty.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEmpty.php
@@ -20,7 +20,6 @@
*/
class BodyNotEmpty extends BodyEmpty
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEquals.php
index 3309224c5..a175b5d41 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotEquals.php
@@ -20,7 +20,6 @@
*/
class BodyNotEquals extends BodyEquals
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotRegExp.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotRegExp.php
index 0c5095baa..db222e3a9 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotRegExp.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyNotRegExp.php
@@ -20,7 +20,6 @@
*/
class BodyNotRegExp extends BodyRegExp
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyRegExp.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyRegExp.php
index f091eca7b..4527091e0 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyRegExp.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/BodyRegExp.php
@@ -20,7 +20,6 @@
*/
class BodyRegExp extends ResponseBase
{
-
/**
* Checks assertion
*
@@ -48,6 +47,6 @@ public function toString()
*/
public function failureDescription($other)
{
- return $other . ' ' . $this->toString();
+ return '`' . $other . '`' . ' ' . $this->toString();
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ContentType.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ContentType.php
index 29d5f39f2..b166f66df 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ContentType.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ContentType.php
@@ -20,7 +20,6 @@
*/
class ContentType extends ResponseBase
{
-
/**
* Checks assertion
*
@@ -44,6 +43,6 @@ public function matches($other)
*/
public function toString()
{
- return 'was set as the Content-Type';
+ return 'is set as the Content-Type (`' . $this->response->getType() . '`)';
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEncryptedEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEncryptedEquals.php
index 660f42b27..a0e055d03 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEncryptedEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEncryptedEquals.php
@@ -72,7 +72,7 @@ public function matches($other)
*/
public function toString()
{
- return sprintf('was encrypted in cookie \'%s\'', $this->cookieName);
+ return sprintf('is encrypted in cookie \'%s\'', $this->cookieName);
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEquals.php
index 5a69a9911..cbe7684a8 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieEquals.php
@@ -60,6 +60,6 @@ public function matches($other)
*/
public function toString()
{
- return sprintf('was in cookie \'%s\'', $this->cookieName);
+ return sprintf('is in cookie \'%s\'', $this->cookieName);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieNotSet.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieNotSet.php
index 6b041ad54..1b2d30a66 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieNotSet.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieNotSet.php
@@ -20,7 +20,6 @@
*/
class CookieNotSet extends CookieSet
{
-
/**
* Checks assertion
*
@@ -39,6 +38,6 @@ public function matches($other)
*/
public function toString()
{
- return 'cookie was not set';
+ return 'cookie is not set';
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieSet.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieSet.php
index 691032020..5b4783a54 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieSet.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/CookieSet.php
@@ -20,7 +20,6 @@
*/
class CookieSet extends ResponseBase
{
-
/**
* Checks assertion
*
@@ -41,6 +40,6 @@ public function matches($other)
*/
public function toString()
{
- return 'cookie was set';
+ return 'cookie is set';
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSent.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSent.php
index d0e1ddc3d..1ddeda3fd 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSent.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSent.php
@@ -20,7 +20,6 @@
*/
class FileSent extends ResponseBase
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSentAs.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSentAs.php
index f1bd05234..0dbd5b7f6 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSentAs.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/FileSentAs.php
@@ -20,7 +20,6 @@
*/
class FileSentAs extends ResponseBase
{
-
/**
* Checks assertion
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderContains.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderContains.php
index ddde398e9..39cd80974 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderContains.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderContains.php
@@ -20,7 +20,6 @@
*/
class HeaderContains extends HeaderEquals
{
-
/**
* Checks assertion
*
@@ -39,6 +38,6 @@ public function matches($other)
*/
public function toString()
{
- return sprintf('is in header \'%s\'', $this->headerName);
+ return sprintf('is in header \'%s\' (`%s`)', $this->headerName, $this->response->getHeaderLine($this->headerName));
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderEquals.php
index 387e975ea..f3ded3130 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderEquals.php
@@ -58,6 +58,8 @@ public function matches($other)
*/
public function toString()
{
- return sprintf('equals content in header \'%s\'', $this->headerName);
+ $responseHeader = $this->response->getHeaderLine($this->headerName);
+
+ return sprintf('equals content in header \'%s\' (`%s`)', $this->headerName, $responseHeader);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderNotContains.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderNotContains.php
index 1851cff49..132acee71 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderNotContains.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/HeaderNotContains.php
@@ -20,7 +20,6 @@
*/
class HeaderNotContains extends HeaderContains
{
-
/**
* Checks assertion
*
@@ -39,6 +38,6 @@ public function matches($other)
*/
public function toString()
{
- return sprintf("is not in header '%s'", $this->headerName);
+ return sprintf("is not in header '%s' (`%s`)", $this->headerName, $this->response->getHeaderLine($this->headerName));
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ResponseBase.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ResponseBase.php
index e05bb3880..3427bf3c9 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ResponseBase.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/ResponseBase.php
@@ -23,7 +23,6 @@
*/
abstract class ResponseBase extends Constraint
{
-
/**
* @var \Cake\Http\Response
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCode.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCode.php
index 624c4c385..a4f385169 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCode.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCode.php
@@ -20,7 +20,6 @@
*/
class StatusCode extends StatusCodeBase
{
-
/**
* Assertion message
*
@@ -28,7 +27,7 @@ class StatusCode extends StatusCodeBase
*/
public function toString()
{
- return sprintf('matches response status code %d', $this->response->getStatusCode());
+ return sprintf('matches response status code `%d`', $this->response->getStatusCode());
}
/**
@@ -39,6 +38,6 @@ public function toString()
*/
public function failureDescription($other)
{
- return $other . ' ' . $this->toString();
+ return '`' . $other . '` ' . $this->toString();
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php
index 4542867f9..4f61292ee 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusCodeBase.php
@@ -20,7 +20,6 @@
*/
abstract class StatusCodeBase extends ResponseBase
{
-
/**
* @var int|array
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php
index b1ff484b7..12ccca60a 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusError.php
@@ -20,7 +20,9 @@
*/
class StatusError extends StatusCodeBase
{
-
+ /**
+ * @inheritDoc
+ */
protected $code = [400, 429];
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php
index 588ba1251..218d6f901 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusFailure.php
@@ -20,7 +20,9 @@
*/
class StatusFailure extends StatusCodeBase
{
-
+ /**
+ * @inheritDoc
+ */
protected $code = [500, 505];
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php
index d8a60f6fa..b02d15e72 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusOk.php
@@ -20,7 +20,9 @@
*/
class StatusOk extends StatusCodeBase
{
-
+ /**
+ * @inheritDoc
+ */
protected $code = [200, 204];
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php
index 4ffcc07a5..de16ed6dd 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Response/StatusSuccess.php
@@ -20,7 +20,9 @@
*/
class StatusSuccess extends StatusCodeBase
{
-
+ /**
+ * @inheritDoc
+ */
protected $code = [200, 308];
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/FlashParamEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/FlashParamEquals.php
index e2a5e2200..305e6d304 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/FlashParamEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/FlashParamEquals.php
@@ -23,7 +23,6 @@
*/
class FlashParamEquals extends Constraint
{
-
/**
* @var \Cake\Http\Session
*/
@@ -101,9 +100,9 @@ public function matches($other)
public function toString()
{
if ($this->at !== null) {
- return sprintf('was in \'%s\' %s #%d', $this->key, $this->param, $this->at);
+ return sprintf('is in \'%s\' %s #%d', $this->key, $this->param, $this->at);
}
- return sprintf('was in \'%s\' %s', $this->key, $this->param);
+ return sprintf('is in \'%s\' %s', $this->key, $this->param);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/SessionEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/SessionEquals.php
index 4ed4840eb..81eb5ebd5 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/SessionEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/Session/SessionEquals.php
@@ -23,7 +23,6 @@
*/
class SessionEquals extends Constraint
{
-
/**
* @var \Cake\Http\Session
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/LayoutFileEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/LayoutFileEquals.php
index 3428b8789..ff3e2ce0b 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/LayoutFileEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/LayoutFileEquals.php
@@ -20,7 +20,6 @@
*/
class LayoutFileEquals extends TemplateFileEquals
{
-
/**
* Assertion message
*
@@ -28,6 +27,6 @@ class LayoutFileEquals extends TemplateFileEquals
*/
public function toString()
{
- return sprintf('equals layout file %s', $this->filename);
+ return sprintf('equals layout file `%s`', $this->filename);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/TemplateFileEquals.php b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/TemplateFileEquals.php
index 6cc48397b..3311c3a27 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/TemplateFileEquals.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Constraint/View/TemplateFileEquals.php
@@ -22,7 +22,6 @@
*/
class TemplateFileEquals extends Constraint
{
-
/**
* @var string
*/
@@ -58,6 +57,6 @@ public function matches($other)
*/
public function toString()
{
- return sprintf('equals template file %s', $this->filename);
+ return sprintf('equals template file `%s`', $this->filename);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/EmailAssertTrait.php b/app/vendor/cakephp/cakephp/src/TestSuite/EmailAssertTrait.php
index d272e4a2a..c1e1108f8 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/EmailAssertTrait.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/EmailAssertTrait.php
@@ -23,12 +23,10 @@
* @method void assertSame($expected, $result, $message)
* @method void assertTextContains($needle, $haystack, $message)
* @method \PHPUnit_Framework_MockObject_MockBuilder getMockBuilder($className)
- *
* @deprecated 3.7.0 Use Cake\TestSuite\EmailTrait instead
*/
trait EmailAssertTrait
{
-
/**
* @var \Cake\Mailer\Email
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/EmailTrait.php b/app/vendor/cakephp/cakephp/src/TestSuite/EmailTrait.php
index 0a264c731..fabc49542 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/EmailTrait.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/EmailTrait.php
@@ -15,6 +15,7 @@
namespace Cake\TestSuite;
use Cake\TestSuite\Constraint\Email\MailContains;
+use Cake\TestSuite\Constraint\Email\MailContainsAttachment;
use Cake\TestSuite\Constraint\Email\MailContainsHtml;
use Cake\TestSuite\Constraint\Email\MailContainsText;
use Cake\TestSuite\Constraint\Email\MailCount;
@@ -61,19 +62,18 @@ public function cleanupEmailTrait()
* @param string $message Message
* @return void
*/
- public function assertMailCount($count, $message = null)
+ public function assertMailCount($count, $message = '')
{
$this->assertThat($count, new MailCount(), $message);
}
/**
- *
* Asserts that no emails were sent
*
* @param string $message Message
* @return void
*/
- public function assertNoMailSent($message = null)
+ public function assertNoMailSent($message = '')
{
$this->assertThat(null, new NoMailSent(), $message);
}
@@ -86,7 +86,7 @@ public function assertNoMailSent($message = null)
* @param string $message Message
* @return void
*/
- public function assertMailSentToAt($at, $address, $message = null)
+ public function assertMailSentToAt($at, $address, $message = '')
{
$this->assertThat($address, new MailSentTo($at), $message);
}
@@ -95,11 +95,11 @@ public function assertMailSentToAt($at, $address, $message = null)
* Asserts an email at a specific index was sent from an address
*
* @param int $at Email index
- * @param string $address Email address
+ * @param string|array $address Email address or [$emailAddress => $displayName].
* @param string $message Message
* @return void
*/
- public function assertMailSentFromAt($at, $address, $message = null)
+ public function assertMailSentFromAt($at, $address, $message = '')
{
$this->assertThat($address, new MailSentFrom($at), $message);
}
@@ -112,7 +112,7 @@ public function assertMailSentFromAt($at, $address, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailContainsAt($at, $contents, $message = null)
+ public function assertMailContainsAt($at, $contents, $message = '')
{
$this->assertThat($contents, new MailContains($at), $message);
}
@@ -125,7 +125,7 @@ public function assertMailContainsAt($at, $contents, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailContainsHtmlAt($at, $contents, $message = null)
+ public function assertMailContainsHtmlAt($at, $contents, $message = '')
{
$this->assertThat($contents, new MailContainsHtml($at), $message);
}
@@ -138,7 +138,7 @@ public function assertMailContainsHtmlAt($at, $contents, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailContainsTextAt($at, $contents, $message = null)
+ public function assertMailContainsTextAt($at, $contents, $message = '')
{
$this->assertThat($contents, new MailContainsText($at), $message);
}
@@ -152,7 +152,7 @@ public function assertMailContainsTextAt($at, $contents, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailSentWithAt($at, $expected, $parameter, $message = null)
+ public function assertMailSentWithAt($at, $expected, $parameter, $message = '')
{
$this->assertThat($expected, new MailSentWith($at, $parameter), $message);
}
@@ -164,7 +164,7 @@ public function assertMailSentWithAt($at, $expected, $parameter, $message = null
* @param string $message Message
* @return void
*/
- public function assertMailSentTo($address, $message = null)
+ public function assertMailSentTo($address, $message = '')
{
$this->assertThat($address, new MailSentTo(), $message);
}
@@ -172,11 +172,11 @@ public function assertMailSentTo($address, $message = null)
/**
* Asserts an email was sent from an address
*
- * @param string $address Email address
+ * @param string|array $address Email address or [$emailAddress => $displayName].
* @param string $message Message
* @return void
*/
- public function assertMailSentFrom($address, $message = null)
+ public function assertMailSentFrom($address, $message = '')
{
$this->assertThat($address, new MailSentFrom(), $message);
}
@@ -188,11 +188,24 @@ public function assertMailSentFrom($address, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailContains($contents, $message = null)
+ public function assertMailContains($contents, $message = '')
{
$this->assertThat($contents, new MailContains(), $message);
}
+ /**
+ * Asserts an email contains expected attachment
+ *
+ * @param string $filename Filename
+ * @param array $file Additional file properties
+ * @param string $message Message
+ * @return void
+ */
+ public function assertMailContainsAttachment($filename, array $file = [], $message = '')
+ {
+ $this->assertThat([$filename, $file], new MailContainsAttachment(), $message);
+ }
+
/**
* Asserts an email contains expected html contents
*
@@ -200,7 +213,7 @@ public function assertMailContains($contents, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailContainsHtml($contents, $message = null)
+ public function assertMailContainsHtml($contents, $message = '')
{
$this->assertThat($contents, new MailContainsHtml(), $message);
}
@@ -212,7 +225,7 @@ public function assertMailContainsHtml($contents, $message = null)
* @param string $message Message to display if assertion fails.
* @return void
*/
- public function assertMailContainsText($expectedText, $message = null)
+ public function assertMailContainsText($expectedText, $message = '')
{
$this->assertThat($expectedText, new MailContainsText(), $message);
}
@@ -225,7 +238,7 @@ public function assertMailContainsText($expectedText, $message = null)
* @param string $message Message
* @return void
*/
- public function assertMailSentWith($expected, $parameter, $message = null)
+ public function assertMailSentWith($expected, $parameter, $message = '')
{
$this->assertThat($expected, new MailSentWith(null, $parameter), $message);
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php
index 3f5044fda..2dc067d63 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php
@@ -27,7 +27,6 @@
*/
class FixtureInjector extends BaseTestListener
{
-
/**
* The instance of the fixture manager to use
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php
index 6817fcf7e..88af335b3 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php
@@ -30,7 +30,6 @@
*/
class FixtureManager
{
-
/**
* Was this instance already initialized?
*
@@ -94,12 +93,9 @@ public function setDebug($debug)
public function fixturize($test)
{
$this->_initDb();
- if (empty($test->fixtures) || !empty($this->_processed[get_class($test)])) {
+ if (!$test->getFixtures() || !empty($this->_processed[get_class($test)])) {
return;
}
- if (!is_array($test->fixtures)) {
- $test->fixtures = array_map('trim', explode(',', $test->fixtures));
- }
$this->_loadFixtures($test);
$this->_processed[get_class($test)] = true;
}
@@ -168,10 +164,11 @@ protected function _initDb()
*/
protected function _loadFixtures($test)
{
- if (empty($test->fixtures)) {
+ $fixtures = $test->getFixtures();
+ if (!$fixtures) {
return;
}
- foreach ($test->fixtures as $fixture) {
+ foreach ($fixtures as $fixture) {
if (isset($this->_loaded[$fixture])) {
continue;
}
@@ -231,7 +228,7 @@ protected function _loadFixtures($test)
$baseNamespace,
'Test\Fixture',
$additionalPath,
- $name . 'Fixture'
+ $name . 'Fixture',
];
$className = implode('\\', array_filter($nameSegments));
} else {
@@ -298,11 +295,7 @@ protected function _setupTable($fixture, $db, array $sources, $drop = true)
*/
public function load($test)
{
- if (empty($test->fixtures)) {
- return;
- }
-
- $fixtures = $test->fixtures;
+ $fixtures = $test->getFixtures();
if (empty($fixtures) || !$test->autoFixtures) {
return;
}
@@ -450,7 +443,8 @@ protected function _fixtureConnections($fixtures)
*/
public function unload($test)
{
- if (empty($test->fixtures)) {
+ $fixtures = $test->getFixtures();
+ if (!$fixtures) {
return;
}
$truncate = function ($db, $fixtures) {
@@ -468,7 +462,7 @@ public function unload($test)
}
}
};
- $this->_runOperation($test->fixtures, $truncate);
+ $this->_runOperation($fixtures, $truncate);
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php
index 5a0ec612d..9ee2a3dd1 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Fixture/TestFixture.php
@@ -32,7 +32,6 @@
*/
class TestFixture implements FixtureInterface, TableSchemaInterface, TableSchemaAwareInterface
{
-
use LocatorAwareTrait;
/**
@@ -180,7 +179,7 @@ protected function _tableFromClass()
protected function _schemaFromFields()
{
$connection = ConnectionManager::get($this->connection());
- $this->_schema = new TableSchema($this->table);
+ $this->_schema = $connection->getDriver()->newTableSchema($this->table);
foreach ($this->fields as $field => $data) {
if ($field === '_constraints' || $field === '_indexes' || $field === '_options') {
continue;
@@ -250,7 +249,7 @@ protected function _schemaFromReflection()
$schemaCollection = $db->getSchemaCollection();
$tables = $schemaCollection->listTables();
- if (!in_array($this->table, $tables)) {
+ if (!in_array($this->table, $tables, true)) {
throw new CakeException(
sprintf(
'Cannot describe schema for table `%s` for fixture `%s` : the table does not exist.',
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/IntegrationTestTrait.php b/app/vendor/cakephp/cakephp/src/TestSuite/IntegrationTestTrait.php
index a339d7d14..0936daad7 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/IntegrationTestTrait.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/IntegrationTestTrait.php
@@ -54,9 +54,9 @@
use Cake\Utility\Text;
use Cake\View\Helper\SecureFieldTokenTrait;
use Exception;
+use Laminas\Diactoros\Uri;
use LogicException;
use PHPUnit\Exception as PhpunitException;
-use Zend\Diactoros\Uri;
/**
* A trait intended to make integration tests of your controllers easier.
@@ -184,13 +184,12 @@ trait IntegrationTestTrait
/**
* Stored flash messages before render
*
- * @var null|array
+ * @var array|null
*/
protected $_flashMessages;
/**
- *
- * @var null|string
+ * @var string|null
*/
protected $_cookieEncryptionKey;
@@ -858,7 +857,7 @@ public function assertResponseCode($code, $message = null)
}
/**
- * Asserts that the Location header is correct.
+ * Asserts that the Location header is correct. Comparison is made against a full URL.
*
* @param string|array|null $url The URL you expected the client to go to. This
* can either be a string URL or an array compatible with Router::url(). Use null to
@@ -876,6 +875,25 @@ public function assertRedirect($url = null, $message = '')
}
}
+ /**
+ * Asserts that the Location header is correct. Comparison is made against exactly the URL provided.
+ *
+ * @param string|array|null $url The URL you expected the client to go to. This
+ * can either be a string URL or an array compatible with Router::url(). Use null to
+ * simply check for the existence of this header.
+ * @param string $message The failure message that will be appended to the generated message.
+ * @return void
+ */
+ public function assertRedirectEquals($url = null, $message = '')
+ {
+ $verboseMessage = $this->extractVerboseMessage($message);
+ $this->assertThat(null, new HeaderSet($this->_response, 'Location'), $verboseMessage);
+
+ if ($url) {
+ $this->assertThat(Router::url($url), new HeaderEquals($this->_response, 'Location'), $verboseMessage);
+ }
+ }
+
/**
* Asserts that the Location header contains a substring
*
@@ -1259,7 +1277,7 @@ public function assertFileResponse($expected, $message = '')
* Inspect controller to extract possible causes of the failed assertion
*
* @param string $message Original message to use as a base
- * @return null|string
+ * @return string|null
*/
protected function extractVerboseMessage($message = null)
{
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/LegacyRequestDispatcher.php b/app/vendor/cakephp/cakephp/src/TestSuite/LegacyRequestDispatcher.php
index 86626e145..1d80310d2 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/LegacyRequestDispatcher.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/LegacyRequestDispatcher.php
@@ -26,7 +26,6 @@
*/
class LegacyRequestDispatcher
{
-
/**
* @var \Cake\TestSuite\IntegrationTestCase
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/MiddlewareDispatcher.php b/app/vendor/cakephp/cakephp/src/TestSuite/MiddlewareDispatcher.php
index b2b0ae927..e25e9c4eb 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/MiddlewareDispatcher.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/MiddlewareDispatcher.php
@@ -20,10 +20,10 @@
use Cake\Http\Server;
use Cake\Http\ServerRequestFactory;
use Cake\Routing\Router;
+use Laminas\Diactoros\Stream;
use LogicException;
use ReflectionClass;
use ReflectionException;
-use Zend\Diactoros\Stream;
/**
* Dispatches a request capturing the response for integration
@@ -57,7 +57,7 @@ class MiddlewareDispatcher
/**
* The application that is being dispatched.
*
- * @var \Cake\Core\HttpApplicationInterface
+ * @var \Cake\Core\HttpApplicationInterface|\Cake\Core\ConsoleApplicationInterface
*/
protected $app;
@@ -85,7 +85,7 @@ public function __construct($test, $class = null, $constructorArgs = null, $disa
$app = $reflect->newInstanceArgs($this->_constructorArgs);
$this->app = $app;
} catch (ReflectionException $e) {
- throw new LogicException(sprintf('Cannot load "%s" for use in integration testing.', $this->_class));
+ throw new LogicException(sprintf('Cannot load `%s` for use in integration testing.', $this->_class));
}
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/MockBuilder.php b/app/vendor/cakephp/cakephp/src/TestSuite/MockBuilder.php
new file mode 100644
index 000000000..bf961ef5f
--- /dev/null
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/MockBuilder.php
@@ -0,0 +1,57 @@
+replies);
$message = "There are no more input replies available. This is the {$nth} read operation, " .
- "only {$total} replies were set. The provided replies are: {$replies}";
- throw new ConsoleException($message);
+ "only {$total} replies were set.\nThe provided replies are: {$replies}";
+ throw new MissingConsoleInputException($message);
}
return $this->replies[$this->currentIndex];
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/ConsoleOutput.php b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/ConsoleOutput.php
index f9c2b76b0..33d1536ea 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/ConsoleOutput.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/ConsoleOutput.php
@@ -31,7 +31,6 @@
*/
class ConsoleOutput extends ConsoleOutputBase
{
-
/**
* Buffered messages.
*
@@ -42,7 +41,7 @@ class ConsoleOutput extends ConsoleOutputBase
/**
* Write output to the buffer.
*
- * @param string|array $message A string or an array of strings to output
+ * @param string|string[] $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return void
*/
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/MissingConsoleInputException.php b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/MissingConsoleInputException.php
new file mode 100644
index 000000000..8c097884a
--- /dev/null
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/MissingConsoleInputException.php
@@ -0,0 +1,33 @@
+message .= "\nThe question asked was: " . $question;
+ }
+}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/Response.php b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/Response.php
index 1d8b51252..697cce0af 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/Response.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/Response.php
@@ -20,7 +20,6 @@
*/
class Response extends Base
{
-
/**
* Stub the send() method so headers and output are not sent.
*
@@ -31,7 +30,7 @@ public function send()
if ($this->hasHeader('Location') && $this->_status === 200) {
$this->statusCode(302);
}
- $this->_setContentType();
+ $this->_setContentType($this->getType());
return $this;
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/TestExceptionRenderer.php b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/TestExceptionRenderer.php
index 5d194cf1d..0c6158941 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/Stub/TestExceptionRenderer.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/Stub/TestExceptionRenderer.php
@@ -28,7 +28,6 @@
*/
class TestExceptionRenderer
{
-
/**
* Simply rethrow the given exception
*
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/TestCase.php b/app/vendor/cakephp/cakephp/src/TestSuite/TestCase.php
index d8c987d9a..8d4dd068d 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/TestCase.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/TestCase.php
@@ -34,7 +34,6 @@
*/
abstract class TestCase extends BaseTestCase
{
-
use LocatorAwareTrait;
/**
@@ -44,6 +43,13 @@ abstract class TestCase extends BaseTestCase
*/
public $fixtureManager;
+ /**
+ * Fixtures used by this test case.
+ *
+ * @var string[]|string|null
+ */
+ public $fixtures;
+
/**
* By default, all fixtures attached to this class will be truncated and reloaded after each test.
* Set this to false to handle manually
@@ -69,13 +75,6 @@ abstract class TestCase extends BaseTestCase
*/
protected $_configure = [];
- /**
- * Path settings to restore at the end of the test.
- *
- * @var array
- */
- protected $_pathRestore = [];
-
/**
* Overrides SimpleTestCase::skipIf to provide a boolean return value
*
@@ -161,6 +160,9 @@ public function tearDown()
Configure::write($this->_configure);
}
$this->getTableLocator()->clear();
+ $this->_configure = [];
+ $this->_tableLocator = null;
+ $this->fixtureManager = null;
}
/**
@@ -730,6 +732,107 @@ protected function skipUnless($condition, $message = '')
// @codingStandardsIgnoreEnd
+ /**
+ * @inheritDoc
+ */
+ public function getMockBuilder($className)
+ {
+ return new MockBuilder($this, $className);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function getMockClass(
+ $originalClassName,
+ $methods = [],
+ array $arguments = [],
+ $mockClassName = '',
+ $callOriginalConstructor = false,
+ $callOriginalClone = true,
+ $callAutoload = true,
+ $cloneArguments = false
+ ) {
+ MockBuilder::setSupressedErrorHandler();
+
+ try {
+ return parent::getMockClass(
+ $originalClassName,
+ $methods,
+ $arguments,
+ $mockClassName,
+ $callOriginalConstructor,
+ $callOriginalClone,
+ $callAutoload,
+ $cloneArguments
+ );
+ } finally {
+ restore_error_handler();
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function getMockForTrait(
+ $traitName,
+ array $arguments = [],
+ $mockClassName = '',
+ $callOriginalConstructor = true,
+ $callOriginalClone = true,
+ $callAutoload = true,
+ $mockedMethods = [],
+ $cloneArguments = false
+ ) {
+ MockBuilder::setSupressedErrorHandler();
+
+ try {
+ return parent::getMockForTrait(
+ $traitName,
+ $arguments,
+ $mockClassName,
+ $callOriginalConstructor,
+ $callOriginalClone,
+ $callAutoload,
+ $mockedMethods,
+ $cloneArguments
+ );
+ } finally {
+ restore_error_handler();
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function getMockForAbstractClass(
+ $originalClassName,
+ array $arguments = [],
+ $mockClassName = '',
+ $callOriginalConstructor = true,
+ $callOriginalClone = true,
+ $callAutoload = true,
+ $mockedMethods = [],
+ $cloneArguments = false
+ ) {
+ MockBuilder::setSupressedErrorHandler();
+
+ try {
+ return parent::getMockForAbstractClass(
+ $originalClassName,
+ $arguments,
+ $mockClassName,
+ $callOriginalConstructor,
+ $callOriginalClone,
+ $callAutoload,
+ $mockedMethods,
+ $cloneArguments
+ );
+ } finally {
+ restore_error_handler();
+ }
+ }
+
/**
* Mock a model, maintain fixtures and table association
*
@@ -809,4 +912,57 @@ public static function setAppNamespace($appNamespace = 'TestApp')
{
Configure::write('App.namespace', $appNamespace);
}
+
+ /**
+ * Adds a fixture to this test case.
+ *
+ * Examples:
+ * - core.Tags
+ * - app.MyRecords
+ * - plugin.MyPluginName.MyModelName
+ *
+ * Use this method inside your test cases' {@link getFixtures()} method
+ * to build up the fixture list.
+ *
+ * @param string $fixture Fixture
+ * @return $this
+ */
+ protected function addFixture($fixture)
+ {
+ if (!isset($this->fixtures)) {
+ $this->fixtures = [];
+ } elseif (is_string($this->fixtures)) {
+ deprecationWarning(
+ 'Setting fixtures as string is deprecated and will be removed in 4.0.' .
+ ' Set TestCase::$fixtures as array instead.'
+ );
+ $this->fixtures = array_map('trim', explode(',', $this->fixtures));
+ }
+
+ $this->fixtures[] = $fixture;
+
+ return $this;
+ }
+
+ /**
+ * Gets fixtures.
+ *
+ * @return array
+ */
+ public function getFixtures()
+ {
+ if (!isset($this->fixtures)) {
+ return [];
+ }
+ if (is_string($this->fixtures)) {
+ deprecationWarning(
+ 'Setting fixtures as string is deprecated and will be removed in 4.0.' .
+ ' Set TestCase::$fixtures as array instead.'
+ );
+
+ return array_map('trim', explode(',', $this->fixtures));
+ }
+
+ return $this->fixtures;
+ }
}
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php b/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php
index da2c6d842..5361f7e6a 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/TestEmailTransport.php
@@ -23,7 +23,7 @@
*
* Set this as the email transport to capture emails for later assertions
*
- * @see Cake\TestSuite\EmailTrait
+ * @see \Cake\TestSuite\EmailTrait
*/
class TestEmailTransport extends DebugTransport
{
diff --git a/app/vendor/cakephp/cakephp/src/TestSuite/TestSuite.php b/app/vendor/cakephp/cakephp/src/TestSuite/TestSuite.php
index 1c27a5bb2..88f899429 100644
--- a/app/vendor/cakephp/cakephp/src/TestSuite/TestSuite.php
+++ b/app/vendor/cakephp/cakephp/src/TestSuite/TestSuite.php
@@ -26,7 +26,6 @@
*/
class TestSuite extends BaseTestSuite
{
-
/**
* Adds all the files in a directory to the test suite. Does not recursive through directories.
*
diff --git a/app/vendor/cakephp/cakephp/src/Utility/CookieCryptTrait.php b/app/vendor/cakephp/cakephp/src/Utility/CookieCryptTrait.php
index 6f225934e..4a7b1300f 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/CookieCryptTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/CookieCryptTrait.php
@@ -21,15 +21,14 @@
*
* Provides the encrypt/decrypt logic for the CookieComponent.
*
- * @link https://book.cakephp.org/3.0/en/controllers/components/cookie.html
+ * @link https://book.cakephp.org/3/en/controllers/components/cookie.html
*/
trait CookieCryptTrait
{
-
/**
* Valid cipher names for encrypted cookies.
*
- * @var array
+ * @var string[]
*/
protected $_validCiphers = ['aes', 'rijndael'];
@@ -43,8 +42,8 @@ abstract protected function _getCookieEncryptionKey();
/**
* Encrypts $value using public $type method in Security class
*
- * @param string $value Value to encrypt
- * @param string|bool $encrypt Encryption mode to use. False
+ * @param string|array $value Value to encrypt
+ * @param string|false $encrypt Encryption mode to use. False
* disabled encryption.
* @param string|null $key Used as the security salt if specified.
* @return string Encoded values
@@ -94,8 +93,8 @@ protected function _checkCipher($encrypt)
/**
* Decrypts $value using public $type method in Security class
*
- * @param array $values Values to decrypt
- * @param string|bool $mode Encryption mode
+ * @param string[]|string $values Values to decrypt
+ * @param string|false $mode Encryption mode
* @param string|null $key Used as the security salt if specified.
* @return string|array Decrypted values
*/
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Crypto/Mcrypt.php b/app/vendor/cakephp/cakephp/src/Utility/Crypto/Mcrypt.php
index 7d0b7a3b7..038d01dea 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Crypto/Mcrypt.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Crypto/Mcrypt.php
@@ -20,12 +20,11 @@
* This class is not intended to be used directly and should only
* be used in the context of Cake\Utility\Security.
*
- * @deprecated 3.3.0 It is recommended to use {@see Cake\Utility\Crypto\OpenSsl} instead.
+ * @deprecated 3.3.0 It is recommended to use {@see \Cake\Utility\Crypto\OpenSsl} instead.
* @internal
*/
class Mcrypt
{
-
/**
* Encrypts/Decrypts a text using the given key using rijndael method.
*
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Crypto/OpenSsl.php b/app/vendor/cakephp/cakephp/src/Utility/Crypto/OpenSsl.php
index 0d0e4d71e..2197f486a 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Crypto/OpenSsl.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Crypto/OpenSsl.php
@@ -29,6 +29,10 @@
*/
class OpenSsl
{
+ /**
+ * @var string
+ */
+ const METHOD_AES_256_CBC = 'aes-256-cbc';
/**
* Not implemented
@@ -58,7 +62,7 @@ public static function rijndael($text, $key, $operation)
*/
public static function encrypt($plain, $key)
{
- $method = 'AES-256-CBC';
+ $method = static::METHOD_AES_256_CBC;
$ivSize = openssl_cipher_iv_length($method);
$iv = openssl_random_pseudo_bytes($ivSize);
@@ -76,7 +80,7 @@ public static function encrypt($plain, $key)
*/
public static function decrypt($cipher, $key)
{
- $method = 'AES-256-CBC';
+ $method = static::METHOD_AES_256_CBC;
$ivSize = openssl_cipher_iv_length($method);
$iv = mb_substr($cipher, 0, $ivSize, '8bit');
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Exception/XmlException.php b/app/vendor/cakephp/cakephp/src/Utility/Exception/XmlException.php
index 4a09ab2b4..63e8978db 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Exception/XmlException.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Exception/XmlException.php
@@ -20,7 +20,6 @@
*/
class XmlException extends Exception
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Hash.php b/app/vendor/cakephp/cakephp/src/Utility/Hash.php
index 24f5a56e8..351b93fc3 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Hash.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Hash.php
@@ -26,11 +26,10 @@
* support for pseudo Xpath, its more fully featured dot notation provides
* similar features in a more consistent implementation.
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html
*/
class Hash
{
-
/**
* Get a single value specified by $path out of $data.
* Does not support the full dot notation feature set,
@@ -38,12 +37,12 @@ class Hash
*
* @param array|\ArrayAccess $data Array of data or object implementing
* \ArrayAccess interface to operate on.
- * @param string|array $path The path being searched for. Either a dot
+ * @param string|int|string[]|null $path The path being searched for. Either a dot
* separated string, or an array of path segments.
* @param mixed $default The return value when the path does not exist
* @throws \InvalidArgumentException
* @return mixed The value fetched from the array, or null.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::get
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::get
*/
public static function get($data, $path, $default = null)
{
@@ -58,7 +57,7 @@ public static function get($data, $path, $default = null)
}
if (is_string($path) || is_numeric($path)) {
- $parts = explode('.', $path);
+ $parts = explode('.', (string)$path);
} else {
if (!is_array($path)) {
throw new InvalidArgumentException(sprintf(
@@ -106,7 +105,7 @@ public static function get($data, $path, $default = null)
* - `>`, `<`, `>=`, `<=` Value comparison.
* - `=/.../` Regular expression pattern match.
*
- * Given a set of User array data, from a `$User->find('all')` call:
+ * Given a set of User array data, from a `$usersTable->find('all')` call:
*
* - `1.User.name` Get the name of the user at index 1.
* - `{n}.User.name` Get the name of every user in the set of users.
@@ -119,7 +118,7 @@ public static function get($data, $path, $default = null)
* @param string $path The path to extract.
* @return array|\ArrayAccess An array of the extracted values. Returns an empty array
* if there are no matches.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::extract
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::extract
*/
public static function extract($data, $path)
{
@@ -174,7 +173,8 @@ public static function extract($data, $path)
if ($conditions) {
$filter = [];
foreach ($next as $item) {
- if ((is_array($item) || $item instanceof ArrayAccess) &&
+ if (
+ (is_array($item) || $item instanceof ArrayAccess) &&
static::_matches($item, $conditions)
) {
$filter[] = $item;
@@ -281,7 +281,8 @@ protected static function _matches($data, $selector)
if (!preg_match($val, $prop)) {
return false;
}
- } elseif (($op === '=' && $prop != $val) ||
+ } elseif (
+ ($op === '=' && $prop != $val) ||
($op === '!=' && $prop == $val) ||
($op === '>' && $prop <= $val) ||
($op === '<' && $prop >= $val) ||
@@ -301,9 +302,9 @@ protected static function _matches($data, $selector)
*
* @param array $data The data to insert into.
* @param string $path The path to insert at.
- * @param array|null $values The values to insert.
+ * @param mixed $values The values to insert.
* @return array The data with $values inserted.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::insert
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::insert
*/
public static function insert(array $data, $path, $values = null)
{
@@ -347,7 +348,7 @@ public static function insert(array $data, $path, $values = null)
*
* @param string $op The operation to do.
* @param array $data The data to operate on.
- * @param array $path The path to work on.
+ * @param string[] $path The path to work on.
* @param mixed $values The values to insert when doing inserts.
* @return array data.
*/
@@ -385,6 +386,8 @@ protected static function _simpleOp($op, $data, $path, $values = null)
$_list =& $_list[$key];
}
}
+
+ return $data;
}
/**
@@ -395,7 +398,7 @@ protected static function _simpleOp($op, $data, $path, $values = null)
* @param array $data The data to operate on
* @param string $path A path expression to use to remove.
* @return array The modified array.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::remove
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::remove
*/
public static function remove(array $data, $path)
{
@@ -451,12 +454,12 @@ public static function remove(array $data, $path)
* following the path specified in `$groupPath`.
*
* @param array $data Array from where to extract keys and values
- * @param string $keyPath A dot-separated string.
- * @param string|null $valuePath A dot-separated string.
+ * @param array|string|null $keyPath A dot-separated string. If null it will create a numbered array.
+ * @param array|string|null $valuePath A dot-separated string.
* @param string|null $groupPath A dot-separated string.
* @return array Combined array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::combine
- * @throws \RuntimeException When keys and values count is unequal.
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::combine
+ * @throws \RuntimeException When keys is an array, and keys and values count is unequal.
*/
public static function combine(array $data, $keyPath, $valuePath = null, $groupPath = null)
{
@@ -467,10 +470,12 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
if (is_array($keyPath)) {
$format = array_shift($keyPath);
$keys = static::format($data, $keyPath, $format);
+ } elseif ($keyPath === null) {
+ $keys = $keyPath;
} else {
$keys = static::extract($data, $keyPath);
}
- if (empty($keys)) {
+ if ($keyPath !== null && empty($keys)) {
return [];
}
@@ -482,10 +487,10 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
$vals = static::extract($data, $valuePath);
}
if (empty($vals)) {
- $vals = array_fill(0, count($keys), null);
+ $vals = array_fill(0, $keys === null ? count($data) : count($keys), null);
}
- if (count($keys) !== count($vals)) {
+ if (is_array($keys) && count($keys) !== count($vals)) {
throw new RuntimeException(
'Hash::combine() needs an equal number of keys + values.'
);
@@ -494,7 +499,7 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
if ($groupPath !== null) {
$group = static::extract($data, $groupPath);
if (!empty($group)) {
- $c = count($keys);
+ $c = is_array($keys) ? count($keys) : count($vals);
$out = [];
for ($i = 0; $i < $c; $i++) {
if (!isset($group[$i])) {
@@ -503,7 +508,11 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
if (!isset($out[$group[$i]])) {
$out[$group[$i]] = [];
}
- $out[$group[$i]][$keys[$i]] = $vals[$i];
+ if ($keys === null) {
+ $out[$group[$i]][] = $vals[$i];
+ } else {
+ $out[$group[$i]][$keys[$i]] = $vals[$i];
+ }
}
return $out;
@@ -513,7 +522,7 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
return [];
}
- return array_combine($keys, $vals);
+ return array_combine($keys === null ? range(0, count($vals) - 1) : $keys, $vals);
}
/**
@@ -529,10 +538,10 @@ public static function combine(array $data, $keyPath, $valuePath = null, $groupP
* The `$format` string can use any format options that `vsprintf()` and `sprintf()` do.
*
* @param array $data Source array from which to extract the data
- * @param array $paths An array containing one or more Hash::extract()-style key paths
+ * @param string[] $paths An array containing one or more Hash::extract()-style key paths
* @param string $format Format string into which values will be inserted, see sprintf()
- * @return array|null An array of strings extracted from `$path` and formatted with `$format`
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::format
+ * @return string[]|null An array of strings extracted from `$path` and formatted with `$format`
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::format
* @see sprintf()
* @see \Cake\Utility\Hash::extract()
*/
@@ -572,7 +581,7 @@ public static function format(array $data, array $paths, $format)
* @param array $data The data to search through.
* @param array $needle The values to file in $data
* @return bool true If $data contains $needle, false otherwise
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::contains
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::contains
*/
public static function contains(array $data, array $needle)
{
@@ -616,7 +625,7 @@ public static function contains(array $data, array $needle)
* @param string $path The path to check for.
* @return bool Existence of path.
* @see \Cake\Utility\Hash::extract()
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::check
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::check
*/
public static function check(array $data, $path)
{
@@ -635,7 +644,7 @@ public static function check(array $data, $path)
* @param callable|array $callback A function to filter the data with. Defaults to
* `static::_filter()` Which strips out all non-zero empty values.
* @return array Filtered array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::filter
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::filter
*/
public static function filter(array $data, $callback = ['self', '_filter'])
{
@@ -667,7 +676,7 @@ protected static function _filter($var)
* @param array $data Array to flatten
* @param string $separator String used to separate array key elements in a path, defaults to '.'
* @return array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::flatten
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::flatten
*/
public static function flatten(array $data, $separator = '.')
{
@@ -711,21 +720,21 @@ public static function flatten(array $data, $separator = '.')
* @param array $data Flattened array
* @param string $separator The delimiter used
* @return array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::expand
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::expand
*/
public static function expand(array $data, $separator = '.')
{
$result = [];
foreach ($data as $flat => $value) {
- $keys = explode($separator, $flat);
+ $keys = explode($separator, (string)$flat);
$keys = array_reverse($keys);
$child = [
- $keys[0] => $value
+ $keys[0] => $value,
];
array_shift($keys);
foreach ($keys as $k) {
$child = [
- $k => $child
+ $k => $child,
];
}
@@ -748,7 +757,7 @@ public static function expand(array $data, $separator = '.')
* @param array $data Array to be merged
* @param mixed $merge Array to merge with. The argument and all trailing arguments will be array cast when merged
* @return array Merged array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::merge
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::merge
*/
public static function merge(array $data, $merge)
{
@@ -798,7 +807,7 @@ protected static function _merge($stack, &$return)
*
* @param array $data The array to check.
* @return bool true if values are numeric, false otherwise
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::numeric
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::numeric
*/
public static function numeric(array $data)
{
@@ -818,7 +827,7 @@ public static function numeric(array $data)
*
* @param array $data Array to count dimensions on
* @return int The number of dimensions in $data
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::dimensions
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::dimensions
*/
public static function dimensions(array $data)
{
@@ -845,7 +854,7 @@ public static function dimensions(array $data)
*
* @param array $data Array to count dimensions on
* @return int The maximum number of dimensions in $data
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::maxDimensions
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::maxDimensions
*/
public static function maxDimensions(array $data)
{
@@ -871,7 +880,7 @@ public static function maxDimensions(array $data)
* @param string $path The path to extract for mapping over.
* @param callable $function The function to call on each extracted value.
* @return array An array of the modified values.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::map
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::map
*/
public static function map(array $data, $path, $function)
{
@@ -887,7 +896,7 @@ public static function map(array $data, $path, $function)
* @param string $path The path to extract from $data.
* @param callable $function The function to call on each extracted value.
* @return mixed The reduced value.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::reduce
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::reduce
*/
public static function reduce(array $data, $path, $function)
{
@@ -919,7 +928,7 @@ public static function reduce(array $data, $path, $function)
* @param string $path The path to extract from $data.
* @param callable $function The function to call on each extracted value.
* @return mixed The results of the applied method.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::apply
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::apply
*/
public static function apply(array $data, $path, $function)
{
@@ -959,7 +968,7 @@ public static function apply(array $data, $path, $function)
* @param string $dir See directions above. Defaults to 'asc'.
* @param array|string $type See direction types above. Defaults to 'regular'.
* @return array Sorted array of data
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::sort
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::sort
*/
public static function sort(array $data, $path, $dir = 'asc', $type = 'regular')
{
@@ -1074,7 +1083,7 @@ protected static function _squash(array $data, $key = null)
* @param array $compare Second value
* @return array Returns the key => value pairs that are not common in $data and $compare
* The expression for this function is ($data - $compare) + ($compare - ($data - $compare))
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::diff
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::diff
*/
public static function diff(array $data, array $compare)
{
@@ -1101,7 +1110,7 @@ public static function diff(array $data, array $compare)
* @param array $data The data to append onto.
* @param array $compare The data to compare and append onto.
* @return array The merged array.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::mergeDiff
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::mergeDiff
*/
public static function mergeDiff(array $data, array $compare)
{
@@ -1114,8 +1123,8 @@ public static function mergeDiff(array $data, array $compare)
foreach ($compare as $key => $value) {
if (!array_key_exists($key, $data)) {
$data[$key] = $value;
- } elseif (is_array($value)) {
- $data[$key] = static::mergeDiff($data[$key], $compare[$key]);
+ } elseif (is_array($value) && is_array($data[$key])) {
+ $data[$key] = static::mergeDiff($data[$key], $value);
}
}
@@ -1128,7 +1137,7 @@ public static function mergeDiff(array $data, array $compare)
* @param array $data List to normalize
* @param bool $assoc If true, $data will be converted to an associative array.
* @return array
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::normalize
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::normalize
*/
public static function normalize(array $data, $assoc = true)
{
@@ -1176,7 +1185,7 @@ public static function normalize(array $data, $assoc = true)
* @return array of results, nested
* @see \Cake\Utility\Hash::extract()
* @throws \InvalidArgumentException When providing invalid data.
- * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::nest
+ * @link https://book.cakephp.org/3/en/core-libraries/hash.html#Cake\Utility\Hash::nest
*/
public static function nest(array $data, array $options = [])
{
@@ -1189,7 +1198,7 @@ public static function nest(array $data, array $options = [])
'idPath' => "{n}.$alias.id",
'parentPath' => "{n}.$alias.parent_id",
'children' => 'children',
- 'root' => null
+ 'root' => null,
];
$return = $idMap = [];
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Inflector.php b/app/vendor/cakephp/cakephp/src/Utility/Inflector.php
index 8fcec95b1..bcd3cc5fc 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Inflector.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Inflector.php
@@ -20,11 +20,10 @@
* Inflector pluralizes and singularizes English nouns.
* Used by CakePHP's naming conventions throughout the framework.
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html
*/
class Inflector
{
-
/**
* Plural inflector rules
*
@@ -95,7 +94,7 @@ class Inflector
'/(n)ews$/i' => '\1\2ews',
'/eaus$/' => 'eau',
'/^(.*us)$/' => '\\1',
- '/s$/i' => ''
+ '/s$/i' => '',
];
/**
@@ -158,7 +157,7 @@ class Inflector
'.*pox', '.*sheep', 'people', 'feedback', 'stadia', '.*?media',
'chassis', 'clippers', 'debris', 'diabetes', 'equipment', 'gallows',
'graffiti', 'headquarters', 'information', 'innings', 'news', 'nexus',
- 'pokemon', 'proceedings', 'research', 'sea[- ]bass', 'series', 'species', 'weather'
+ 'pokemon', 'proceedings', 'research', 'sea[- ]bass', 'series', 'species', 'weather',
];
/**
@@ -417,7 +416,7 @@ class Inflector
*
* @param string $type Inflection type
* @param string $key Original value
- * @param string|bool $value Inflected value
+ * @param string|false $value Inflected value
* @return string|false Inflected value on cache hit or false on cache miss.
*/
protected static function _cache($type, $key, $value = false)
@@ -499,7 +498,7 @@ public static function rules($type, $rules, $reset = false)
*
* @param string $word Word in singular
* @return string Word in plural
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-plural-singular-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-plural-singular-forms
*/
public static function pluralize($word)
{
@@ -508,10 +507,17 @@ public static function pluralize($word)
}
if (!isset(static::$_cache['irregular']['pluralize'])) {
- static::$_cache['irregular']['pluralize'] = '(?:' . implode('|', array_keys(static::$_irregular)) . ')';
+ $words = array_keys(static::$_irregular);
+ static::$_cache['irregular']['pluralize'] = '/(.*?(?:\\b|_))(' . implode('|', $words) . ')$/i';
+
+ $upperWords = array_map('ucfirst', $words);
+ static::$_cache['irregular']['upperPluralize'] = '/(.*?(?:\\b|[a-z]))(' . implode('|', $upperWords) . ')$/';
}
- if (preg_match('/(.*?(?:\\b|_))(' . static::$_cache['irregular']['pluralize'] . ')$/i', $word, $regs)) {
+ if (
+ preg_match(static::$_cache['irregular']['pluralize'], $word, $regs) ||
+ preg_match(static::$_cache['irregular']['upperPluralize'], $word, $regs)
+ ) {
static::$_cache['pluralize'][$word] = $regs[1] . substr($regs[2], 0, 1) .
substr(static::$_irregular[strtolower($regs[2])], 1);
@@ -519,10 +525,10 @@ public static function pluralize($word)
}
if (!isset(static::$_cache['uninflected'])) {
- static::$_cache['uninflected'] = '(?:' . implode('|', static::$_uninflected) . ')';
+ static::$_cache['uninflected'] = '/^(' . implode('|', static::$_uninflected) . ')$/i';
}
- if (preg_match('/^(' . static::$_cache['uninflected'] . ')$/i', $word, $regs)) {
+ if (preg_match(static::$_cache['uninflected'], $word, $regs)) {
static::$_cache['pluralize'][$word] = $word;
return $word;
@@ -542,7 +548,7 @@ public static function pluralize($word)
*
* @param string $word Word in plural
* @return string Word in singular
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-plural-singular-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-plural-singular-forms
*/
public static function singularize($word)
{
@@ -551,10 +557,19 @@ public static function singularize($word)
}
if (!isset(static::$_cache['irregular']['singular'])) {
- static::$_cache['irregular']['singular'] = '(?:' . implode('|', static::$_irregular) . ')';
+ $wordList = array_values(static::$_irregular);
+ static::$_cache['irregular']['singular'] = '/(.*?(?:\\b|_))(' . implode('|', $wordList) . ')$/i';
+
+ $upperWordList = array_map('ucfirst', $wordList);
+ static::$_cache['irregular']['singularUpper'] = '/(.*?(?:\\b|[a-z]))(' .
+ implode('|', $upperWordList) .
+ ')$/';
}
- if (preg_match('/(.*?(?:\\b|_))(' . static::$_cache['irregular']['singular'] . ')$/i', $word, $regs)) {
+ if (
+ preg_match(static::$_cache['irregular']['singular'], $word, $regs) ||
+ preg_match(static::$_cache['irregular']['singularUpper'], $word, $regs)
+ ) {
static::$_cache['singularize'][$word] = $regs[1] . substr($regs[2], 0, 1) .
substr(array_search(strtolower($regs[2]), static::$_irregular, true), 1);
@@ -562,10 +577,10 @@ public static function singularize($word)
}
if (!isset(static::$_cache['uninflected'])) {
- static::$_cache['uninflected'] = '(?:' . implode('|', static::$_uninflected) . ')';
+ static::$_cache['uninflected'] = '/^(' . implode('|', static::$_uninflected) . ')$/i';
}
- if (preg_match('/^(' . static::$_cache['uninflected'] . ')$/i', $word, $regs)) {
+ if (preg_match(static::$_cache['uninflected'], $word, $regs)) {
static::$_cache['pluralize'][$word] = $word;
return $word;
@@ -589,7 +604,7 @@ public static function singularize($word)
* @param string $string String to camelize
* @param string $delimiter the delimiter in the input string
* @return string CamelizedStringLikeThis.
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-camelcase-and-under-scored-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-camelcase-and-under-scored-forms
*/
public static function camelize($string, $delimiter = '_')
{
@@ -612,7 +627,7 @@ public static function camelize($string, $delimiter = '_')
*
* @param string $string CamelCasedString to be "underscorized"
* @return string underscore_version of the input string
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-camelcase-and-under-scored-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-camelcase-and-under-scored-forms
*/
public static function underscore($string)
{
@@ -639,7 +654,7 @@ public static function dasherize($string)
* @param string $string String to be humanized
* @param string $delimiter the character to replace with a space
* @return string Human-readable string
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-human-readable-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-human-readable-forms
*/
public static function humanize($string, $delimiter = '_')
{
@@ -685,7 +700,7 @@ public static function delimit($string, $delimiter = '_')
*
* @param string $className Name of class to get database table name for
* @return string Name of the database table for given class
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-table-and-class-name-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-table-and-class-name-forms
*/
public static function tableize($className)
{
@@ -704,7 +719,7 @@ public static function tableize($className)
*
* @param string $tableName Name of database table to get class name for
* @return string Class name
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-table-and-class-name-forms
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-table-and-class-name-forms
*/
public static function classify($tableName)
{
@@ -723,7 +738,7 @@ public static function classify($tableName)
*
* @param string $string String to convert.
* @return string in variable form
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-variable-names
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-variable-names
*/
public static function variable($string)
{
@@ -747,7 +762,7 @@ public static function variable($string)
* @param string $string the string you want to slug
* @param string $replacement will replace keys in map
* @return string
- * @link https://book.cakephp.org/3.0/en/core-libraries/inflector.html#creating-url-safe-strings
+ * @link https://book.cakephp.org/3/en/core-libraries/inflector.html#creating-url-safe-strings
*/
public static function slug($string, $replacement = '-')
{
diff --git a/app/vendor/cakephp/cakephp/src/Utility/MergeVariablesTrait.php b/app/vendor/cakephp/cakephp/src/Utility/MergeVariablesTrait.php
index 8517cc7a0..d77264c31 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/MergeVariablesTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/MergeVariablesTrait.php
@@ -19,7 +19,6 @@
*/
trait MergeVariablesTrait
{
-
/**
* Merge the list of $properties with all parent classes of the current class.
*
@@ -68,7 +67,8 @@ protected function _mergeProperty($property, $parentClasses, $options)
{
$thisValue = $this->{$property};
$isAssoc = false;
- if (isset($options['associative']) &&
+ if (
+ isset($options['associative']) &&
in_array($property, (array)$options['associative'])
) {
$isAssoc = true;
diff --git a/app/vendor/cakephp/cakephp/src/Utility/README.md b/app/vendor/cakephp/cakephp/src/Utility/README.md
index 3183e002c..2798d2838 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/README.md
+++ b/app/vendor/cakephp/cakephp/src/Utility/README.md
@@ -23,7 +23,7 @@ $bigPeople = Hash::extract($things, '{n}[age>21].name');
// $bigPeople will contain ['Susan', 'Lucy']
```
-Check the [official Hash class documentation](https://book.cakephp.org/3.0/en/core-libraries/hash.html)
+Check the [official Hash class documentation](https://book.cakephp.org/3/en/core-libraries/hash.html)
### Inflector
@@ -36,7 +36,7 @@ echo Inflector::pluralize('Apple'); // echoes Apples
echo Inflector::singularize('People'); // echoes Person
```
-Check the [official Inflector class documentation](https://book.cakephp.org/3.0/en/core-libraries/inflector.html)
+Check the [official Inflector class documentation](https://book.cakephp.org/3/en/core-libraries/inflector.html)
### Text
@@ -57,7 +57,7 @@ This is the song
that never ends.
```
-Check the [official Text class documentation](https://book.cakephp.org/3.0/en/core-libraries/text.html)
+Check the [official Text class documentation](https://book.cakephp.org/3/en/core-libraries/text.html)
### Security
@@ -70,7 +70,7 @@ $result = Security::encrypt($value, $key);
Security::decrypt($result, $key);
```
-Check the [official Security class documentation](https://book.cakephp.org/3.0/en/core-libraries/security.html)
+Check the [official Security class documentation](https://book.cakephp.org/3/en/core-libraries/security.html)
### Xml
@@ -88,4 +88,4 @@ $data = [
$xml = Xml::build($data);
```
-Check the [official Xml class documentation](https://book.cakephp.org/3.0/en/core-libraries/xml.html)
+Check the [official Xml class documentation](https://book.cakephp.org/3/en/core-libraries/xml.html)
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Security.php b/app/vendor/cakephp/cakephp/src/Utility/Security.php
index e80098103..f649f78e2 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Security.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Security.php
@@ -24,7 +24,6 @@
*/
class Security
{
-
/**
* Default hash method. If `$type` param for `Security::hash()` is not specified
* this value is used. Defaults to 'sha1'.
@@ -36,7 +35,7 @@ class Security
/**
* The HMAC salt to use for encryption and decryption routines
*
- * @var string
+ * @var string|null
*/
protected static $_salt;
@@ -57,7 +56,8 @@ class Security
* @param mixed $salt If true, automatically prepends the application's salt
* value to $string (Security.salt).
* @return string Hash
- * @link https://book.cakephp.org/3.0/en/core-libraries/security.html#hashing-data
+ * @throws \RuntimeException
+ * @link https://book.cakephp.org/3/en/core-libraries/security.html#hashing-data
*/
public static function hash($string, $algorithm = null, $salt = false)
{
@@ -67,7 +67,7 @@ public static function hash($string, $algorithm = null, $salt = false)
$algorithm = strtolower($algorithm);
$availableAlgorithms = hash_algos();
- if (!in_array($algorithm, $availableAlgorithms)) {
+ if (!in_array($algorithm, $availableAlgorithms, true)) {
throw new RuntimeException(sprintf(
'The hash type `%s` was not found. Available algorithms are: %s',
$algorithm,
@@ -284,7 +284,7 @@ protected static function _checkKey($key, $method)
* @param string $cipher The ciphertext to decrypt.
* @param string $key The 256 bit/32 byte key to use as a cipher key.
* @param string|null $hmacSalt The salt to use for the HMAC process. Leave null to use Security.salt.
- * @return string|bool Decrypted data. Any trailing null bytes will be removed.
+ * @return string|false Decrypted data. Any trailing null bytes will be removed.
* @throws \InvalidArgumentException On invalid data or key.
*/
public static function decrypt($cipher, $key, $hmacSalt = null)
@@ -353,6 +353,12 @@ public static function constantEquals($original, $compare)
*/
public static function getSalt()
{
+ if (static::$_salt === null) {
+ throw new RuntimeException(
+ 'Salt not set. Use Security::setSalt() to set one, ideally in `config/bootstrap.php`.'
+ );
+ }
+
return static::$_salt;
}
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Text.php b/app/vendor/cakephp/cakephp/src/Utility/Text.php
index 06d34034c..5b24cdfb3 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Text.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Text.php
@@ -14,6 +14,7 @@
*/
namespace Cake\Utility;
+use Cake\Core\Exception\Exception;
use InvalidArgumentException;
/**
@@ -21,11 +22,10 @@
*/
class Text
{
-
/**
* Default transliterator.
*
- * @var \Transliterator Transliterator instance.
+ * @var \Transliterator|null Transliterator instance.
*/
protected static $_defaultTransliterator;
@@ -43,7 +43,7 @@ class Text
*/
protected static $_defaultHtmlNoCount = [
'style',
- 'script'
+ 'script',
];
/**
@@ -61,25 +61,23 @@ class Text
*/
public static function uuid()
{
- $random = function_exists('random_int') ? 'random_int' : 'mt_rand';
-
return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
- $random(0, 65535),
- $random(0, 65535),
+ random_int(0, 65535),
+ random_int(0, 65535),
// 16 bits for "time_mid"
- $random(0, 65535),
+ random_int(0, 65535),
// 12 bits before the 0100 of (version) 4 for "time_hi_and_version"
- $random(0, 4095) | 0x4000,
+ random_int(0, 4095) | 0x4000,
// 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1
- $random(0, 0x3fff) | 0x8000,
+ random_int(0, 0x3fff) | 0x8000,
// 48 bits for "node"
- $random(0, 65535),
- $random(0, 65535),
- $random(0, 65535)
+ random_int(0, 65535),
+ random_int(0, 65535),
+ random_int(0, 65535)
);
}
@@ -111,7 +109,7 @@ public static function tokenize($data, $separator = ',', $leftBound = '(', $righ
$offsets = [
mb_strpos($data, $separator, $offset),
mb_strpos($data, $leftBound, $offset),
- mb_strpos($data, $rightBound, $offset)
+ mb_strpos($data, $rightBound, $offset),
];
for ($i = 0; $i < 3; $i++) {
if ($offsets[$i] !== false && ($offsets[$i] < $tmpOffset || $tmpOffset == -1)) {
@@ -190,7 +188,7 @@ public static function tokenize($data, $separator = ',', $leftBound = '(', $righ
public static function insert($str, $data, array $options = [])
{
$defaults = [
- 'before' => ':', 'after' => null, 'escape' => '\\', 'format' => null, 'clean' => false
+ 'before' => ':', 'after' => null, 'escape' => '\\', 'format' => null, 'clean' => false,
];
$options += $defaults;
$format = $options['format'];
@@ -484,7 +482,7 @@ protected static function _wordWrap($text, $width = 72, $break = "\n", $cut = fa
* @param string|array $phrase The phrase or phrases that will be searched.
* @param array $options An array of HTML attributes and options.
* @return string The highlighted text
- * @link https://book.cakephp.org/3.0/en/core-libraries/text.html#highlighting-substrings
+ * @link https://book.cakephp.org/3/en/core-libraries/text.html#highlighting-substrings
*/
public static function highlight($text, $phrase, array $options = [])
{
@@ -572,7 +570,7 @@ public static function stripLinks($text)
public static function tail($text, $length = 100, array $options = [])
{
$default = [
- 'ellipsis' => '...', 'exact' => true
+ 'ellipsis' => '...', 'exact' => true,
];
$options += $default;
$exact = $ellipsis = null;
@@ -612,7 +610,7 @@ public static function tail($text, $length = 100, array $options = [])
* @param int $length Length of returned string, including ellipsis.
* @param array $options An array of HTML attributes and options.
* @return string Trimmed string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/text.html#truncating-text
+ * @link https://book.cakephp.org/3/en/core-libraries/text.html#truncating-text
*/
public static function truncate($text, $length = 100, array $options = [])
{
@@ -828,7 +826,8 @@ protected static function _substr($text, $start, $length, array $options)
$len = self::_strlen($part, $options);
if ($offset !== 0 || $totalLength + $len > $length) {
- if (strpos($part, '&') === 0 && preg_match($pattern, $part)
+ if (
+ strpos($part, '&') === 0 && preg_match($pattern, $part)
&& $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8')
) {
// Entities cannot be passed substr.
@@ -883,7 +882,7 @@ protected static function _removeLastWord($text)
* @param int $radius The amount of characters that will be returned on each side of the founded phrase
* @param string $ellipsis Ending that will be appended
* @return string Modified string
- * @link https://book.cakephp.org/3.0/en/core-libraries/text.html#extracting-an-excerpt
+ * @link https://book.cakephp.org/3/en/core-libraries/text.html#extracting-an-excerpt
*/
public static function excerpt($text, $phrase, $radius = 100, $ellipsis = '...')
{
@@ -926,7 +925,7 @@ public static function excerpt($text, $phrase, $radius = 100, $ellipsis = '...')
* @param string|null $and The word used to join the last and second last items together with. Defaults to 'and'.
* @param string $separator The separator used to join all the other items together. Defaults to ', '.
* @return string The glued together string.
- * @link https://book.cakephp.org/3.0/en/core-libraries/text.html#converting-an-array-to-sentence-form
+ * @link https://book.cakephp.org/3/en/core-libraries/text.html#converting-an-array-to-sentence-form
*/
public static function toList(array $list, $and = null, $separator = ', ')
{
@@ -937,7 +936,7 @@ public static function toList(array $list, $and = null, $separator = ', ')
return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list);
}
- return array_pop($list);
+ return (string)array_pop($list);
}
/**
@@ -987,7 +986,7 @@ public static function utf8($string)
$values[] = $value;
if (count($values) === $find) {
- if ($find == 3) {
+ if ($find === 3) {
$map[] = (($values[0] % 16) * 4096) + (($values[1] % 64) * 64) + ($values[2] % 64);
} else {
$map[] = (($values[0] % 32) * 64) + ($values[1] % 64);
@@ -1035,7 +1034,7 @@ public static function ascii(array $array)
* @param mixed $default Value to be returned when invalid size was used, for example 'Unknown type'
* @return mixed Number of bytes as integer on success, `$default` on failure if not false
* @throws \InvalidArgumentException On invalid Unit type.
- * @link https://book.cakephp.org/3.0/en/core-libraries/text.html#Cake\Utility\Text::parseFileSize
+ * @link https://book.cakephp.org/3/en/core-libraries/text.html#Cake\Utility\Text::parseFileSize
*/
public static function parseFileSize($size, $default = false)
{
@@ -1053,7 +1052,7 @@ public static function parseFileSize($size, $default = false)
if ($i !== false) {
$size = (float)substr($size, 0, $l);
- return $size * pow(1024, $i + 1);
+ return (int)($size * pow(1024, $i + 1));
}
if (substr($size, -1) === 'B' && ctype_digit(substr($size, 0, -1))) {
@@ -1110,7 +1109,12 @@ public static function getTransliteratorId()
*/
public static function setTransliteratorId($transliteratorId)
{
- static::setTransliterator(transliterator_create($transliteratorId));
+ $transliterator = transliterator_create($transliteratorId);
+ if ($transliterator === null) {
+ throw new Exception('Unable to create transliterator for id: ' . $transliteratorId);
+ }
+
+ static::setTransliterator($transliterator);
static::$_defaultTransliteratorId = $transliteratorId;
}
@@ -1131,7 +1135,12 @@ public static function transliterate($string, $transliterator = null)
$transliterator = static::$_defaultTransliterator ?: static::$_defaultTransliteratorId;
}
- return transliterator_transliterate($transliterator, $string);
+ $return = transliterator_transliterate($transliterator, $string);
+ if ($return === false) {
+ throw new Exception(sprintf('Unable to transliterate string: %s', $string));
+ }
+
+ return $return;
}
/**
@@ -1149,7 +1158,7 @@ public static function transliterate($string, $transliterator = null)
* For e.g. this option can be set to '.' to generate clean file names.
*
* @param string $string the string you want to slug
- * @param array $options If string it will be use as replacement character
+ * @param array|string $options If string it will be use as replacement character
* or an array of options.
* @return string
* @see setTransliterator()
@@ -1163,23 +1172,25 @@ public static function slug($string, $options = [])
$options += [
'replacement' => '-',
'transliteratorId' => null,
- 'preserve' => null
+ 'preserve' => null,
];
if ($options['transliteratorId'] !== false) {
$string = static::transliterate($string, $options['transliteratorId']);
}
- $regex = '^\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}';
+ $regex = '^\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}';
if ($options['preserve']) {
$regex .= preg_quote($options['preserve'], '/');
}
- $quotedReplacement = preg_quote($options['replacement'], '/');
+ $quotedReplacement = preg_quote((string)$options['replacement'], '/');
$map = [
- '/[' . $regex . ']/mu' => ' ',
- '/[\s]+/mu' => $options['replacement'],
+ '/[' . $regex . ']/mu' => $options['replacement'],
sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '',
];
+ if (is_string($options['replacement']) && strlen($options['replacement']) > 0) {
+ $map[sprintf('/[%s]+/mu', $quotedReplacement)] = $options['replacement'];
+ }
$string = preg_replace(array_keys($map), $map, $string);
return $string;
diff --git a/app/vendor/cakephp/cakephp/src/Utility/Xml.php b/app/vendor/cakephp/cakephp/src/Utility/Xml.php
index 2ab5c37c1..e7cd6a3ee 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/Xml.php
+++ b/app/vendor/cakephp/cakephp/src/Utility/Xml.php
@@ -28,7 +28,6 @@
*/
class Xml
{
-
/**
* Initialize SimpleXMLElement or DOMDocument from a given XML string, file path, URL or array.
*
@@ -59,7 +58,7 @@ class Xml
*
* $http = new Client();
* $response = $http->get('http://example.com/example.xml');
- * $xml = Xml::build($response->body());
+ * $xml = Xml::build($response->getStringBody());
* ```
*
* Building from an array:
@@ -96,7 +95,7 @@ class Xml
*
* If using array as input, you can pass `options` from Xml::fromArray.
*
- * @param string|array $input XML string, a path to a file, a URL or an array
+ * @param string|array|object $input XML string, a path to a file, a URL or an array
* @param array $options The options to use
* @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument
* @throws \Cake\Utility\Exception\XmlException
@@ -124,7 +123,12 @@ public static function build($input, array $options = [])
}
if (!is_string($input)) {
- throw new XmlException('Invalid input.');
+ $type = gettype($input);
+ throw new XmlException("Invalid input. {$type} cannot be parsed as XML.");
+ }
+
+ if (strpos($input, '<') !== false) {
+ return static::_loadXml($input, $options);
}
throw new XmlException('XML cannot be read.');
@@ -247,8 +251,8 @@ public static function loadHtml($input, $options = [])
*
* `description`
*
- * @param array|\Cake\Collection\Collection $input Array with data or a collection instance.
- * @param string|array $options The options to use or a string to use as format.
+ * @param array|object $input Array with data or a collection instance.
+ * @param array $options The options to use.
* @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument
* @throws \Cake\Utility\Exception\XmlException
*/
@@ -273,7 +277,7 @@ public static function fromArray($input, $options = [])
'version' => '1.0',
'encoding' => mb_internal_encoding(),
'return' => 'simplexml',
- 'pretty' => false
+ 'pretty' => false,
];
$options += $defaults;
@@ -295,7 +299,7 @@ public static function fromArray($input, $options = [])
* Recursive method to create childs from array
*
* @param \DOMDocument $dom Handler to DOMDocument
- * @param \DOMElement $node Handler to DOMElement (child)
+ * @param \DOMDocument|\DOMElement $node Handler to DOMElement (child)
* @param array $data Array of data to append to the $node.
* @param string $format Either 'attributes' or 'tags'. This determines where nested keys go.
* @return void
@@ -320,7 +324,7 @@ protected static function _fromArray($dom, $node, &$data, $format)
}
$isNamespace = strpos($key, 'xmlns:');
if ($isNamespace !== false) {
- $node->setAttributeNS('http://www.w3.org/2000/xmlns/', $key, $value);
+ $node->setAttributeNS('http://www.w3.org/2000/xmlns/', $key, (string)$value);
continue;
}
if ($key[0] !== '@' && $format === 'tags') {
@@ -329,7 +333,7 @@ protected static function _fromArray($dom, $node, &$data, $format)
// https://www.w3.org/TR/REC-xml/#syntax
// https://bugs.php.net/bug.php?id=36795
$child = $dom->createElement($key, '');
- $child->appendChild(new DOMText($value));
+ $child->appendChild(new DOMText((string)$value));
} else {
$child = $dom->createElement($key, $value);
}
@@ -339,7 +343,7 @@ protected static function _fromArray($dom, $node, &$data, $format)
$key = substr($key, 1);
}
$attribute = $dom->createAttribute($key);
- $attribute->appendChild($dom->createTextNode($value));
+ $attribute->appendChild($dom->createTextNode((string)$value));
$node->appendChild($attribute);
}
} else {
diff --git a/app/vendor/cakephp/cakephp/src/Utility/composer.json b/app/vendor/cakephp/cakephp/src/Utility/composer.json
index 4c5c8f1eb..bf5d6842b 100644
--- a/app/vendor/cakephp/cakephp/src/Utility/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Utility/composer.json
@@ -25,7 +25,7 @@
"source": "https://github.com/cakephp/utility"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0"
},
"suggest": {
diff --git a/app/vendor/cakephp/cakephp/src/Validation/README.md b/app/vendor/cakephp/cakephp/src/Validation/README.md
index 179665169..45c57a77a 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/README.md
+++ b/app/vendor/cakephp/cakephp/src/Validation/README.md
@@ -26,7 +26,7 @@ $validator
->requirePresence('comment')
->notEmpty('comment', 'You need to give a comment.');
-$errors = $validator->errors($_POST);
+$errors = $validator->validate($_POST);
if (!empty($errors)) {
// display errors.
}
@@ -34,4 +34,4 @@ if (!empty($errors)) {
## Documentation
-Please make sure you check the [official documentation](https://book.cakephp.org/3.0/en/core-libraries/validation.html)
+Please make sure you check the [official documentation](https://book.cakephp.org/3/en/core-libraries/validation.html)
diff --git a/app/vendor/cakephp/cakephp/src/Validation/RulesProvider.php b/app/vendor/cakephp/cakephp/src/Validation/RulesProvider.php
index efdee0db5..382c92ada 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/RulesProvider.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/RulesProvider.php
@@ -19,10 +19,11 @@
/**
* A Proxy class used to remove any extra arguments when the user intended to call
* a method in another class that is not aware of validation providers signature
+ *
+ * @method bool extension(mixed $check, array $extensions, array $context = [])
*/
class RulesProvider
{
-
/**
* The class/object to proxy.
*
@@ -59,7 +60,7 @@ public function __construct($class = Validation::class)
*
* @param string $method the validation method to call
* @param array $arguments the list of arguments to pass to the method
- * @return bool whether or not the validation rule passed
+ * @return bool Whether or not the validation rule passed
*/
public function __call($method, $arguments)
{
diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidatableInterface.php b/app/vendor/cakephp/cakephp/src/Validation/ValidatableInterface.php
index 35780823c..73a05297e 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/ValidatableInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/ValidatableInterface.php
@@ -19,7 +19,6 @@
*/
interface ValidatableInterface
{
-
/**
* Validates the internal properties using a validator object and returns any
* validation errors found.
diff --git a/app/vendor/cakephp/cakephp/src/Validation/Validation.php b/app/vendor/cakephp/cakephp/src/Validation/Validation.php
index 82312df31..446518e21 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/Validation.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/Validation.php
@@ -30,54 +30,73 @@
*/
class Validation
{
-
/**
* Default locale
+ *
+ * @var string
*/
const DEFAULT_LOCALE = 'en_US';
/**
* Same as operator.
+ *
+ * @var string
*/
const COMPARE_SAME = '===';
/**
* Not same as comparison operator.
+ *
+ * @var string
*/
const COMPARE_NOT_SAME = '!==';
/**
* Equal to comparison operator.
+ *
+ * @var string
*/
const COMPARE_EQUAL = '==';
/**
* Not equal to comparison operator.
+ *
+ * @var string
*/
const COMPARE_NOT_EQUAL = '!=';
/**
* Greater than comparison operator.
+ *
+ * @var string
*/
const COMPARE_GREATER = '>';
/**
* Greater than or equal to comparison operator.
+ *
+ * @var string
*/
const COMPARE_GREATER_OR_EQUAL = '>=';
/**
* Less than comparison operator.
+ *
+ * @var string
*/
const COMPARE_LESS = '<';
/**
* Less than or equal to comparison operator.
+ *
+ * @var string
*/
const COMPARE_LESS_OR_EQUAL = '<=';
/**
* Datetime ISO8601 format
+ *
+ * @var string
*/
const DATETIME_ISO8601 = 'iso8601';
@@ -123,7 +142,7 @@ public static function notEmpty($check)
*
* Returns true if string contains something other than whitespace
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @return bool Success
*/
public static function notBlank($check)
@@ -136,40 +155,81 @@ public static function notBlank($check)
}
/**
- * Checks that a string contains only integer or letters
+ * Checks that a string contains only integer or letters.
*
- * Returns true if string contains only integer or letters
+ * This method's definition of letters and integers includes unicode characters.
+ * Use `asciiAlphaNumeric()` if you want to exclude unicode.
*
* @param string $check Value to check
* @return bool Success
*/
public static function alphaNumeric($check)
{
- if (empty($check) && $check !== '0') {
+ if ((empty($check) && $check !== '0') || !is_scalar($check)) {
return false;
}
return self::_check($check, '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/Du');
}
+ /**
+ * Checks that a doesn't contain any alpha numeric characters
+ *
+ * This method's definition of letters and integers includes unicode characters.
+ * Use `notAsciiAlphaNumeric()` if you want to exclude ascii only.
+ *
+ * @param mixed $check Value to check
+ * @return bool Success
+ */
+ public static function notAlphaNumeric($check)
+ {
+ return !static::alphaNumeric($check);
+ }
+
+ /**
+ * Checks that a string contains only ascii integer or letters.
+ *
+ * @param mixed $check Value to check
+ * @return bool Success
+ */
+ public static function asciiAlphaNumeric($check)
+ {
+ if ((empty($check) && $check !== '0') || !is_scalar($check)) {
+ return false;
+ }
+
+ return self::_check($check, '/^[[:alnum:]]+$/');
+ }
+
+ /**
+ * Checks that a doesn't contain any non-ascii alpha numeric characters
+ *
+ * @param mixed $check Value to check
+ * @return bool Success
+ */
+ public static function notAsciiAlphaNumeric($check)
+ {
+ return !static::asciiAlphaNumeric($check);
+ }
+
/**
* Checks that a string length is within specified range.
* Spaces are included in the character count.
* Returns true if string matches value min, max, or between min and max,
*
- * @param string $check Value to check for length
+ * @param mixed $check Value to check for length
* @param int $min Minimum value in range (inclusive)
* @param int $max Maximum value in range (inclusive)
* @return bool Success
*/
public static function lengthBetween($check, $min, $max)
{
- if (!is_string($check)) {
+ if (!is_scalar($check)) {
return false;
}
- $length = mb_strlen($check);
+ $length = mb_strlen((string)$check);
- return ($length >= $min && $length <= $max);
+ return $length >= $min && $length <= $max;
}
/**
@@ -216,9 +276,9 @@ public static function cc($check, $type = 'fast', $deep = false, $regex = null)
* Validation of credit card numbers.
* Returns true if $check is in the proper credit card format.
*
- * @param string $check credit card number to validate
- * @param string|array $type 'all' may be passed as a string, defaults to fast which checks format of most major credit cards
- * if an array is used only the values of the array are checked.
+ * @param mixed $check credit card number to validate
+ * @param string|string[] $type 'all' may be passed as a string, defaults to fast which checks format of
+ * most major credit cards if an array is used only the values of the array are checked.
* Example: ['amex', 'bankcard', 'maestro']
* @param bool $deep set to true this will check the Luhn algorithm of the credit card.
* @param string|null $regex A custom regex can also be passed, this will be used instead of the defined regex values
@@ -227,11 +287,11 @@ public static function cc($check, $type = 'fast', $deep = false, $regex = null)
*/
public static function creditCard($check, $type = 'fast', $deep = false, $regex = null)
{
- if (!is_scalar($check)) {
+ if (!(is_string($check) || is_int($check))) {
return false;
}
- $check = str_replace(['-', ' '], '', $check);
+ $check = str_replace(['-', ' '], '', (string)$check);
if (mb_strlen($check) < 13) {
return false;
}
@@ -253,9 +313,9 @@ public static function creditCard($check, $type = 'fast', $deep = false, $regex
'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
'switch' => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
'visa' => '/^4\\d{12}(\\d{3})?$/',
- 'voyager' => '/^8699[0-9]{11}$/'
+ 'voyager' => '/^8699[0-9]{11}$/',
],
- 'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/'
+ 'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/',
];
if (is_array($type)) {
@@ -288,7 +348,7 @@ public static function creditCard($check, $type = 'fast', $deep = false, $regex
/**
* Used to check the count of a given value of type array or Countable.
*
- * @param array|\Countable $check The value to check the count on.
+ * @param mixed $check The value to check the count on.
* @param string $operator Can be either a word or operand
* is greater >, is less <, greater or equal >=
* less or equal <=, is less <, equal to ==, not equal !=
@@ -307,11 +367,11 @@ public static function numElements($check, $operator, $expectedCount)
/**
* Used to compare 2 numeric values.
*
- * @param string $check1 The left value to compare.
+ * @param string|int $check1 The left value to compare.
* @param string $operator Can be either a word or operand
* is greater >, is less <, greater or equal >=
* less or equal <=, is less <, equal to ==, not equal !=
- * @param int $check2 The right value to compare.
+ * @param string|int $check2 The right value to compare.
* @return bool Success
*/
public static function comparison($check1, $operator, $check2)
@@ -436,7 +496,7 @@ public static function compareWith($check, $field, $context)
*/
public static function compareFields($check, $field, $operator, $context)
{
- if (!isset($context['data'][$field])) {
+ if (!isset($context['data']) || !array_key_exists($field, $context['data'])) {
return false;
}
@@ -451,6 +511,7 @@ public static function compareFields($check, $field, $operator, $context)
* @param string $check Value to check
* @param int $count Number of non-alphanumerics to check for
* @return bool Success
+ * @deprecated 3.9.0 Use notAlphaNumeric() instead. Will be removed in 5.0
*/
public static function containsNonAlphaNumeric($check, $count = 1)
{
@@ -485,7 +546,7 @@ public static function custom($check, $regex = null)
* Date validation, determines if the string passed is a valid date.
* keys that expect full month, day and year will validate leap years.
*
- * Years are valid from 1800 to 2999.
+ * Years are valid from 0001 to 2999.
*
* ### Formats:
*
@@ -499,7 +560,7 @@ public static function custom($check, $regex = null)
* - `ym` 2006/12 or 06/12 separators can be a space, period, dash, forward slash
* - `y` 2006 just the year without any separators
*
- * @param string|\DateTimeInterface $check a valid date string/object
+ * @param mixed $check a valid date string/object
* @param string|array $format Use a string or an array of the keys above.
* Arrays should be passed as ['dmy', 'mdy', etc]
* @param string|null $regex If a custom regular expression is used this is the only validation that will occur.
@@ -523,29 +584,35 @@ public static function date($check, $format = 'ymd', $regex = null)
}
$month = '(0[123456789]|10|11|12)';
$separator = '([- /.])';
- $fourDigitYear = '(([1][8-9][0-9][0-9])|([2][0-9][0-9][0-9]))';
- $twoDigitYear = '([0-9]{2})';
+ // Don't allow 0000, but 0001-2999 are ok.
+ $fourDigitYear = '(?:(?!0000)[012]\d{3})';
+ $twoDigitYear = '(?:\d{2})';
$year = '(?:' . $fourDigitYear . '|' . $twoDigitYear . ')';
+ // 2 or 4 digit leap year sub-pattern
+ $leapYear = '(?:(?:(?:(?!0000)[012]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))';
+ // 4 digit leap year sub-pattern
+ $fourDigitLeapYear = '(?:(?:(?:(?!0000)[012]\\d)(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))';
+
$regex['dmy'] = '%^(?:(?:31(\\/|-|\\.|\\x20)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)' .
- $separator . '(?:0?[1,3-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29' .
- $separator . '0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])' .
- $separator . '(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
+ $separator . '(?:0?[1,3-9]|1[0-2])\\2))' . $year . '$|^(?:29' .
+ $separator . '0?2\\3' . $leapYear . ')$|^(?:0?[1-9]|1\\d|2[0-8])' .
+ $separator . '(?:(?:0?[1-9])|(?:1[0-2]))\\4' . $year . '$%';
$regex['mdy'] = '%^(?:(?:(?:0?[13578]|1[02])(\\/|-|\\.|\\x20)31)\\1|(?:(?:0?[13-9]|1[0-2])' .
- $separator . '(?:29|30)\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:0?2' . $separator . '29\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))' .
- $separator . '(?:0?[1-9]|1\\d|2[0-8])\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%';
+ $separator . '(?:29|30)\\2))' . $year . '$|^(?:0?2' . $separator . '29\\3' . $leapYear . ')$|^(?:(?:0?[1-9])|(?:1[0-2]))' .
+ $separator . '(?:0?[1-9]|1\\d|2[0-8])\\4' . $year . '$%';
- $regex['ymd'] = '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))' .
- $separator . '(?:0?2\\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\\d)?\\d{2})' .
+ $regex['ymd'] = '%^(?:(?:' . $leapYear .
+ $separator . '(?:0?2\\1(?:29)))|(?:' . $year .
$separator . '(?:(?:(?:0?[13578]|1[02])\\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\\2(?:0?[1-9]|1\\d|2[0-8]))))$%';
- $regex['dMy'] = '/^((31(?!\\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\\b|t)t?|Nov)(ember)?)))|((30|29)(?!\\ Feb(ruary)?))|(29(?=\\ Feb(ruary)?\\ (((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\\d|2[0-8])\\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ((1[6-9]|[2-9]\\d)\\d{2})$/';
+ $regex['dMy'] = '/^((31(?!\\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\\b|t)t?|Nov)(ember)?)))|((30|29)(?!\\ Feb(ruary)?))|(29(?=\\ Feb(ruary)?\\ ' . $fourDigitLeapYear . '))|(0?[1-9])|1\\d|2[0-8])\\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ' . $fourDigitYear . '$/';
- $regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep)(tember)?|(Nov|Dec)(ember)?)\\ (0?[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\ ((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/';
+ $regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep)(tember)?|(Nov|Dec)(ember)?)\\ (0?[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\ ' . $fourDigitLeapYear . ')))))\\,?\\ ' . $fourDigitYear . ')$/';
$regex['My'] = '%^(Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)' .
- $separator . '((1[6-9]|[2-9]\\d)\\d{2})$%';
+ $separator . $fourDigitYear . '$%';
$regex['my'] = '%^(' . $month . $separator . $year . ')$%';
$regex['ym'] = '%^(' . $year . $separator . $month . ')$%';
@@ -566,10 +633,11 @@ public static function date($check, $format = 'ymd', $regex = null)
*
* All values matching the "date" core validation rule, and the "time" one will be valid
*
- * @param string|\DateTimeInterface $check Value to check
+ * @param mixed $check Value to check
* @param string|array $dateFormat Format of the date part. See Validation::date() for more information.
- * Or `Validation::DATETIME_ISO8601` to valid an ISO8601 datetime value
- * @param string|null $regex Regex for the date part. If a custom regular expression is used this is the only validation that will occur.
+ * Or `Validation::DATETIME_ISO8601` to validate an ISO8601 datetime value.
+ * @param string|null $regex Regex for the date part. If a custom regular expression is used
+ * this is the only validation that will occur.
* @return bool True if the value is valid, false otherwise
* @see \Cake\Validation\Validation::date()
* @see \Cake\Validation\Validation::time()
@@ -582,6 +650,9 @@ public static function datetime($check, $dateFormat = 'ymd', $regex = null)
if (is_object($check)) {
return false;
}
+ if (is_array($dateFormat) && count($dateFormat) === 1) {
+ $dateFormat = reset($dateFormat);
+ }
if ($dateFormat === static::DATETIME_ISO8601 && !static::iso8601($check)) {
return false;
}
@@ -610,10 +681,8 @@ public static function datetime($check, $dateFormat = 'ymd', $regex = null)
* Validates an iso8601 datetime format
* ISO8601 recognize datetime like 2019 as a valid date. To validate and check date integrity, use @see \Cake\Validation\Validation::datetime()
*
- * @param string|\DateTimeInterface $check Value to check
- *
+ * @param mixed $check Value to check
* @return bool True if the value is valid, false otherwise
- *
* @see Regex credits: https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
*/
public static function iso8601($check)
@@ -632,8 +701,7 @@ public static function iso8601($check)
/**
* Time validation, determines if the string passed is a valid time.
- * Validates time as 24hr (HH:MM) or am/pm ([H]H:MM[a|p]m)
- * Does not allow/validate seconds.
+ * Validates time as 24hr (HH:MM[:SS]) or am/pm ([H]H[:MM][:SS][a|p]m)
*
* @param string|\DateTimeInterface $check a valid time string/object
* @return bool Success
@@ -647,7 +715,7 @@ public static function time($check)
$check = static::_getDateString($check);
}
- return static::_check($check, '%^((0?[1-9]|1[012])(:[0-5]\d){0,2} ?([AP]M|[ap]m))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$%');
+ return static::_check($check, '%^((0?[1-9]|1[012])(:[0-5]\d){0,2} ?([AP]M|[ap]m))$|^([01]\d|2[0-3])(:[0-5]\d){1,2}$%');
}
/**
@@ -659,7 +727,9 @@ public static function time($check)
* @param string|int|null $format any format accepted by IntlDateFormatter
* @return bool Success
* @throws \InvalidArgumentException when unsupported $type given
- * @see \Cake\I18n\Time::parseDate(), \Cake\I18n\Time::parseTime(), \Cake\I18n\Time::parseDateTime()
+ * @see \Cake\I18n\Time::parseDate()
+ * @see \Cake\I18n\Time::parseTime()
+ * @see \Cake\I18n\Time::parseDateTime()
*/
public static function localizedTime($check, $type = 'datetime', $format = null)
{
@@ -745,13 +815,17 @@ public static function falsey($check, array $falseyValues = [])
* - true => Any number of decimal places greater than 0, or a float|double. The '.' is required.
* - 1..N => Exactly that many number of decimal places. The '.' is required.
*
- * @param float $check The value the test for decimal.
- * @param int|bool|null $places Decimal places.
+ * @param mixed $check The value the test for decimal.
+ * @param int|true|null $places Decimal places.
* @param string|null $regex If a custom regular expression is used, this is the only validation that will occur.
* @return bool Success
*/
public static function decimal($check, $places = null, $regex = null)
{
+ if (!is_scalar($check)) {
+ return false;
+ }
+
if ($regex === null) {
$lnum = '[0-9]+';
$dnum = "[0-9]*[\.]{$lnum}";
@@ -769,6 +843,8 @@ public static function decimal($check, $places = null, $regex = null)
$places = '[0-9]{' . $places . '}';
$dnum = "(?:[0-9]*[\.]{$places}|{$lnum}[\.]{$places})";
$regex = "/^{$sign}{$dnum}{$exp}$/";
+ } else {
+ return false;
}
}
@@ -778,6 +854,13 @@ public static function decimal($check, $places = null, $regex = null)
$decimalPoint = $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);
$groupingSep = $formatter->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL);
+ // There are two types of non-breaking spaces - we inject a space to account for human input
+ if ($groupingSep == "\xc2\xa0" || $groupingSep == "\xe2\x80\xaf") {
+ $check = str_replace([' ', $groupingSep, $decimalPoint], ['', '', '.'], $check);
+ } else {
+ $check = str_replace([$groupingSep, $decimalPoint], ['', '.'], $check);
+ }
+
$check = str_replace([$groupingSep, $decimalPoint], ['', '.'], $check);
return static::_check($check, $regex);
@@ -789,7 +872,7 @@ public static function decimal($check, $places = null, $regex = null)
* Only uses getmxrr() checking for deep validation, or
* any PHP version on a non-windows distribution
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @param bool $deep Perform a deeper validation (if true), by also checking availability of host
* @param string|null $regex Regex to use (if none it will use built in regex)
* @return bool Success
@@ -838,7 +921,7 @@ public static function equalTo($check, $comparedTo)
* Checks that value has a valid file extension.
*
* @param string|array|\Psr\Http\Message\UploadedFileInterface $check Value to check
- * @param array $extensions file extensions to allow. By default extensions are 'gif', 'jpeg', 'png', 'jpg'
+ * @param string[] $extensions file extensions to allow. By default extensions are 'gif', 'jpeg', 'png', 'jpg'
* @return bool Success
*/
public static function extension($check, $extensions = ['gif', 'jpeg', 'png', 'jpg'])
@@ -864,12 +947,16 @@ public static function extension($check, $extensions = ['gif', 'jpeg', 'png', 'j
/**
* Validation of an IP address.
*
- * @param string $check The string to test.
+ * @param mixed $check The string to test.
* @param string $type The IP Protocol version to validate against
* @return bool Success
*/
public static function ip($check, $type = 'both')
{
+ if (!is_string($check)) {
+ return false;
+ }
+
$type = strtolower($type);
$flags = 0;
if ($type === 'ipv4') {
@@ -885,7 +972,7 @@ public static function ip($check, $type = 'both')
/**
* Checks whether the length of a string (in characters) is greater or equal to a minimal length.
*
- * @param string $check The string to test
+ * @param mixed $check The string to test
* @param int $min The minimal string length
* @return bool Success
*/
@@ -895,13 +982,13 @@ public static function minLength($check, $min)
return false;
}
- return mb_strlen($check) >= $min;
+ return mb_strlen((string)$check) >= $min;
}
/**
* Checks whether the length of a string (in characters) is smaller or equal to a maximal length.
*
- * @param string $check The string to test
+ * @param mixed $check The string to test
* @param int $max The maximal string length
* @return bool Success
*/
@@ -911,13 +998,13 @@ public static function maxLength($check, $max)
return false;
}
- return mb_strlen($check) <= $max;
+ return mb_strlen((string)$check) <= $max;
}
/**
* Checks whether the length of a string (in bytes) is greater or equal to a minimal length.
*
- * @param string $check The string to test
+ * @param mixed $check The string to test
* @param int $min The minimal string length (in bytes)
* @return bool Success
*/
@@ -927,13 +1014,13 @@ public static function minLengthBytes($check, $min)
return false;
}
- return strlen($check) >= $min;
+ return strlen((string)$check) >= $min;
}
/**
* Checks whether the length of a string (in bytes) is smaller or equal to a maximal length.
*
- * @param string $check The string to test
+ * @param mixed $check The string to test
* @param int $max The maximal string length
* @return bool Success
*/
@@ -943,13 +1030,13 @@ public static function maxLengthBytes($check, $max)
return false;
}
- return strlen($check) <= $max;
+ return strlen((string)$check) <= $max;
}
/**
* Checks that a value is a monetary amount.
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @param string $symbolPosition Where symbol is located (left/right)
* @return bool Success
*/
@@ -974,7 +1061,7 @@ public static function money($check, $symbolPosition = 'left')
* - max => maximum number of non-zero choices that can be made
* - min => minimum number of non-zero choices that can be made
*
- * @param array $check Value to check
+ * @param mixed $check Value to check
* @param array $options Options for the check.
* @param bool $caseInsensitive Set to true for case insensitive comparison.
* @return bool Success
@@ -1017,7 +1104,7 @@ public static function multiple($check, array $options = [], $caseInsensitive =
/**
* Checks if a value is numeric.
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @return bool Success
*/
public static function numeric($check)
@@ -1028,7 +1115,7 @@ public static function numeric($check)
/**
* Checks if a value is a natural number.
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @param bool $allowZero Set true to allow zero, defaults to false
* @return bool Success
* @see https://en.wikipedia.org/wiki/Natural_number
@@ -1064,7 +1151,7 @@ public static function range($check, $lower = null, $upper = null)
return ($check >= $lower && $check <= $upper);
}
- return is_finite($check);
+ return is_finite((float)$check);
}
/**
@@ -1080,13 +1167,17 @@ public static function range($check, $lower = null, $upper = null)
* - an optional query string (get parameters)
* - an optional fragment (anchor tag) as defined in RFC 3986
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @param bool $strict Require URL to be prefixed by a valid scheme (one of http(s)/ftp(s)/file/news/gopher)
* @return bool Success
* @link https://tools.ietf.org/html/rfc3986
*/
public static function url($check, $strict = false)
{
+ if (!is_string($check)) {
+ return false;
+ }
+
static::_populateIp();
$emoji = '\x{1F190}-\x{1F9EF}';
@@ -1107,16 +1198,19 @@ public static function url($check, $strict = false)
/**
* Checks if a value is in a given list. Comparison is case sensitive by default.
*
- * @param string $check Value to check.
+ * @param mixed $check Value to check.
* @param string[] $list List to check against.
* @param bool $caseInsensitive Set to true for case insensitive comparison.
* @return bool Success.
*/
public static function inList($check, array $list, $caseInsensitive = false)
{
+ if (!is_scalar($check)) {
+ return false;
+ }
if ($caseInsensitive) {
$list = array_map('mb_strtolower', $list);
- $check = mb_strtolower($check);
+ $check = mb_strtolower((string)$check);
} else {
$list = array_map('strval', $list);
}
@@ -1147,7 +1241,7 @@ public static function userDefined($check, $object, $method, $args = null)
/**
* Checks that a value is a valid UUID - https://tools.ietf.org/html/rfc4122
*
- * @param string $check Value to check
+ * @param mixed $check Value to check
* @return bool Success
*/
public static function uuid($check)
@@ -1160,19 +1254,19 @@ public static function uuid($check)
/**
* Runs a regular expression match.
*
- * @param string $check Value to check against the $regex expression
+ * @param mixed $check Value to check against the $regex expression
* @param string $regex Regular expression
* @return bool Success of match
*/
protected static function _check($check, $regex)
{
- return is_string($regex) && is_scalar($check) && preg_match($regex, $check);
+ return is_scalar($check) && preg_match($regex, (string)$check);
}
/**
* Luhn algorithm
*
- * @param string|array $check Value to check.
+ * @param mixed $check Value to check.
* @return bool Success
* @see https://en.wikipedia.org/wiki/Luhn_algorithm
*/
@@ -1182,10 +1276,11 @@ public static function luhn($check)
return false;
}
$sum = 0;
+ $check = (string)$check;
$length = strlen($check);
for ($position = 1 - ($length % 2); $position < $length; $position += 2) {
- $sum += $check[$position];
+ $sum += (int)$check[$position];
}
for ($position = ($length % 2); $position < $length; $position += 2) {
@@ -1241,7 +1336,7 @@ public static function mimeType($check, $mimeTypes = [])
$mimeTypes[$key] = strtolower($val);
}
- return in_array(strtolower($mime), $mimeTypes);
+ return in_array(strtolower($mime), $mimeTypes, true);
}
/**
@@ -1249,7 +1344,7 @@ public static function mimeType($check, $mimeTypes = [])
* we accept.
*
* @param string|array|\Psr\Http\Message\UploadedFileInterface $check The data to read a filename out of.
- * @return string|bool Either the filename or false on failure.
+ * @return string|false Either the filename or false on failure.
*/
protected static function getFilename($check)
{
@@ -1339,7 +1434,7 @@ public static function uploadError($check, $allowNoFile = false)
* - `optional` - Whether or not this file is optional. Defaults to false.
* If true a missing file will pass the validator regardless of other constraints.
*
- * @param array|\Psr\Http\Message\UploadedFileInterface $file The uploaded file data from PHP.
+ * @param mixed $file The uploaded file data from PHP.
* @param array $options An array of options for the validation.
* @return bool
*/
@@ -1362,7 +1457,7 @@ public static function uploadedFile($file, array $options = [])
if (is_array($file)) {
$keys = ['error', 'name', 'size', 'tmp_name', 'type'];
ksort($file);
- if (array_keys($file) != $keys) {
+ if (array_keys($file) !== $keys) {
return false;
}
$error = (int)$file['error'];
@@ -1391,7 +1486,7 @@ public static function uploadedFile($file, array $options = [])
/**
* Validates the size of an uploaded image.
*
- * @param array|\Psr\Http\Message\UploadedFileInterface $file The uploaded file data from PHP.
+ * @param mixed $file The uploaded file data from PHP.
* @param array $options Options to validate width and height.
* @return bool
* @throws \InvalidArgumentException
@@ -1440,17 +1535,17 @@ public static function imageWidth($file, $operator, $width)
return self::imageSize($file, [
'width' => [
$operator,
- $width
- ]
+ $width,
+ ],
]);
}
/**
- * Validates the image width.
+ * Validates the image height.
*
* @param array $file The uploaded file data from PHP.
* @param string $operator Comparison operator.
- * @param int $height Min or max width.
+ * @param int $height Min or max height.
* @return bool
*/
public static function imageHeight($file, $operator, $height)
@@ -1458,8 +1553,8 @@ public static function imageHeight($file, $operator, $height)
return self::imageSize($file, [
'height' => [
$operator,
- $height
- ]
+ $height,
+ ],
]);
}
@@ -1476,15 +1571,19 @@ public static function imageHeight($file, $operator, $height)
* - `format` - By default `both`, can be `long` and `lat` as well to validate
* only a part of the coordinate.
*
- * @param string $value Geographic location as string
+ * @param mixed $value Geographic location as string
* @param array $options Options for the validation logic.
* @return bool
*/
public static function geoCoordinate($value, array $options = [])
{
+ if (!is_scalar($value)) {
+ return false;
+ }
+
$options += [
'format' => 'both',
- 'type' => 'latLong'
+ 'type' => 'latLong',
];
if ($options['type'] !== 'latLong') {
throw new RuntimeException(sprintf(
@@ -1500,13 +1599,13 @@ public static function geoCoordinate($value, array $options = [])
$pattern = '/^' . self::$_pattern['latitude'] . '$/';
}
- return (bool)preg_match($pattern, $value);
+ return (bool)preg_match($pattern, (string)$value);
}
/**
* Convenience method for latitude validation.
*
- * @param string $value Latitude as string
+ * @param mixed $value Latitude as string
* @param array $options Options for the validation logic.
* @return bool
* @link https://en.wikipedia.org/wiki/Latitude
@@ -1522,7 +1621,7 @@ public static function latitude($value, array $options = [])
/**
* Convenience method for longitude validation.
*
- * @param string $value Latitude as string
+ * @param mixed $value Latitude as string
* @param array $options Options for the validation logic.
* @return bool
* @link https://en.wikipedia.org/wiki/Longitude
@@ -1540,7 +1639,7 @@ public static function longitude($value, array $options = [])
*
* This method will reject all non-string values.
*
- * @param string $value The value to check
+ * @param mixed $value The value to check
* @return bool
*/
public static function ascii($value)
@@ -1563,7 +1662,7 @@ public static function ascii($value)
* MySQL's older utf8 encoding type does not allow characters above
* the basic multilingual plane. Defaults to false.
*
- * @param string $value The value to check
+ * @param mixed $value The value to check
* @param array $options An array of options. See above for the supported options.
* @return bool
*/
@@ -1586,25 +1685,26 @@ public static function utf8($value, array $options = [])
* This method will accept strings that contain only integer data
* as well.
*
- * @param string $value The value to check
+ * @param mixed $value The value to check
* @return bool
*/
public static function isInteger($value)
{
- if (!is_numeric($value) || is_float($value)) {
- return false;
- }
if (is_int($value)) {
return true;
}
+ if (!is_string($value) || !is_numeric($value)) {
+ return false;
+ }
+
return (bool)preg_match('/^-?[0-9]+$/', $value);
}
/**
* Check that the input value is an array.
*
- * @param array $value The value to check
+ * @param mixed $value The value to check
* @return bool
*/
public static function isArray($value)
@@ -1629,7 +1729,7 @@ public static function isScalar($value)
/**
* Check that the input value is a 6 digits hex color.
*
- * @param string|array $check The value to check
+ * @param mixed $check The value to check
* @return bool Success
*/
public static function hexColor($check)
@@ -1642,13 +1742,15 @@ public static function hexColor($check)
* Requirements are uppercase, no whitespaces, max length 34, country code and checksum exist at right spots,
* body matches against checksum via Mod97-10 algorithm
*
- * @param string $check The value to check
- *
+ * @param mixed $check The value to check
* @return bool Success
*/
public static function iban($check)
{
- if (!preg_match('/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/', $check)) {
+ if (
+ !is_string($check) ||
+ !preg_match('/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/', $check)
+ ) {
return false;
}
@@ -1669,7 +1771,7 @@ public static function iban($check)
$checksum %= 97;
}
- return ((98 - $checksum) === $checkInt);
+ return $checkInt === 98 - $checksum;
}
/**
@@ -1683,7 +1785,8 @@ public static function iban($check)
protected static function _getDateString($value)
{
$formatted = '';
- if (isset($value['year'], $value['month'], $value['day']) &&
+ if (
+ isset($value['year'], $value['month'], $value['day']) &&
(is_numeric($value['year']) && is_numeric($value['month']) && is_numeric($value['day']))
) {
$formatted .= sprintf('%d-%02d-%02d ', $value['year'], $value['month'], $value['day']);
diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidationRule.php b/app/vendor/cakephp/cakephp/src/Validation/ValidationRule.php
index e5dd4e5bf..91a86d2f7 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/ValidationRule.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/ValidationRule.php
@@ -26,7 +26,6 @@
*/
class ValidationRule
{
-
/**
* The method to be called for a given scope
*
@@ -105,7 +104,7 @@ public function isLast()
* new record
* - data: The full data that was passed to the validation process
* - field: The name of the field that is being processed
- * @return bool|string
+ * @return bool|string|array
* @throws \InvalidArgumentException when the supplied rule is not a valid
* callable for the configured scope
*/
@@ -193,7 +192,7 @@ protected function _addValidatorProps($validator = [])
$this->_pass = array_slice($value, 1);
$value = array_shift($value);
}
- if (in_array($key, ['rule', 'on', 'message', 'last', 'provider', 'pass'])) {
+ if (in_array($key, ['rule', 'on', 'message', 'last', 'provider', 'pass'], true)) {
$this->{"_$key"} = $value;
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidationSet.php b/app/vendor/cakephp/cakephp/src/Validation/ValidationSet.php
index de4aa4446..bb6028951 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/ValidationSet.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/ValidationSet.php
@@ -25,7 +25,6 @@
*/
class ValidationSet implements ArrayAccess, IteratorAggregate, Countable
{
-
/**
* Holds the ValidationRule objects
*
@@ -131,6 +130,8 @@ public function rule($name)
if (!empty($this->_rules[$name])) {
return $this->_rules[$name];
}
+
+ return null;
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/Validation/Validator.php b/app/vendor/cakephp/cakephp/src/Validation/Validator.php
index 49949719c..cb24fc037 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/Validator.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/Validator.php
@@ -19,6 +19,7 @@
use Countable;
use InvalidArgumentException;
use IteratorAggregate;
+use Psr\Http\Message\UploadedFileInterface;
/**
* Validator object encapsulates all methods related to data validations for a model
@@ -26,7 +27,7 @@
*
* Implements ArrayAccess to easily modify rules in the set
*
- * @link https://book.cakephp.org/3.0/en/core-libraries/validation.html
+ * @link https://book.cakephp.org/3/en/core-libraries/validation.html
*/
class Validator implements ArrayAccess, IteratorAggregate, Countable
{
@@ -62,6 +63,9 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
* and the value of `error` is equal to `UPLOAD_ERR_NO_FILE`, the value will be recognized as
* empty.
*
+ * When an instance of \Psr\Http\Message\UploadedFileInterface is given the
+ * return value of it's getError() method must be equal to `UPLOAD_ERR_NO_FILE`.
+ *
* @var int
*/
const EMPTY_FILE = 4;
@@ -147,7 +151,6 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* Constructor
- *
*/
public function __construct()
{
@@ -156,14 +159,26 @@ public function __construct()
}
/**
- * Returns an array of fields that have failed validation. On the current model. This method will
- * actually run validation rules over data, not just return the messages.
+ * Validates and returns an array of failed fields and their error messages.
*
* @param array $data The data to be checked for errors
* @param bool $newRecord whether the data to be validated is new or to be updated.
- * @return array Array of invalid fields
+ * @return array Array of failed fields
+ * @deprecated 3.9.0 Renamed to validate()
*/
public function errors(array $data, $newRecord = true)
+ {
+ return $this->validate($data, $newRecord);
+ }
+
+ /**
+ * Validates and returns an array of failed fields and their error messages.
+ *
+ * @param array $data The data to be checked for errors
+ * @param bool $newRecord whether the data to be validated is new or to be updated.
+ * @return array Array of failed fields
+ */
+ public function validate(array $data, $newRecord = true)
{
$errors = [];
@@ -324,7 +339,7 @@ public static function getDefaultProviders()
*
* @deprecated 3.4.0 Use setProvider()/getProvider() instead.
* @param string $name The name under which the provider should be set.
- * @param null|object|string $object Provider object or class name.
+ * @param string|object|null $object Provider object or class name.
* @return $this|object|string|null
*/
public function provider($name, $object = null)
@@ -496,7 +511,7 @@ public function addNested($field, Validator $validator, $message = null, $when =
foreach ($this->providers() as $provider) {
$validator->setProvider($provider, $this->getProvider($provider));
}
- $errors = $validator->errors($value, $context['newRecord']);
+ $errors = $validator->validate($value, $context['newRecord']);
$message = $message ? [static::NESTED => $message] : [];
@@ -543,7 +558,7 @@ public function addNestedMany($field, Validator $validator, $message = null, $wh
if (!is_array($row)) {
return false;
}
- $check = $validator->errors($row, $context['newRecord']);
+ $check = $validator->validate($row, $context['newRecord']);
if (!empty($check)) {
$errors[$i] = $check;
}
@@ -605,7 +620,7 @@ public function requirePresence($field, $mode = true, $message = null)
{
$defaults = [
'mode' => $mode,
- 'message' => $message
+ 'message' => $message,
];
if (!is_array($field)) {
@@ -809,7 +824,8 @@ public function allowEmptyFor($field, $flags, $when = true, $message = null)
protected function sortMessageAndWhen($first, $second, $method)
{
// Called with `$message, $when`. No order change necessary
- if ((
+ if (
+ (
in_array($second, [true, false, 'create', 'update'], true) ||
is_callable($second)
) && (
@@ -1200,7 +1216,7 @@ public function notEmpty($field, $message = null, $when = false)
{
$defaults = [
'when' => $when,
- 'message' => $message
+ 'message' => $message,
];
if (!is_array($field)) {
@@ -1282,6 +1298,63 @@ public function alphaNumeric($field, $message = null, $when = null)
]);
}
+ /**
+ * Add a non-alphanumeric rule to a field.
+ *
+ * @param string $field The field you want to apply the rule to.
+ * @param string|null $message The error message when the rule fails.
+ * @param string|callable|null $when Either 'create' or 'update' or a callable that returns
+ * true when the validation rule should be applied.
+ * @see \Cake\Validation\Validation::notAlphaNumeric()
+ * @return $this
+ */
+ public function notAlphaNumeric($field, $message = null, $when = null)
+ {
+ $extra = array_filter(['on' => $when, 'message' => $message]);
+
+ return $this->add($field, 'notAlphaNumeric', $extra + [
+ 'rule' => 'notAlphaNumeric',
+ ]);
+ }
+
+ /**
+ * Add an ascii-alphanumeric rule to a field.
+ *
+ * @param string $field The field you want to apply the rule to.
+ * @param string|null $message The error message when the rule fails.
+ * @param string|callable|null $when Either 'create' or 'update' or a callable that returns
+ * true when the validation rule should be applied.
+ * @see \Cake\Validation\Validation::asciiAlphaNumeric()
+ * @return $this
+ */
+ public function asciiAlphaNumeric($field, $message = null, $when = null)
+ {
+ $extra = array_filter(['on' => $when, 'message' => $message]);
+
+ return $this->add($field, 'asciiAlphaNumeric', $extra + [
+ 'rule' => 'asciiAlphaNumeric',
+ ]);
+ }
+
+ /**
+ * Add a non-ascii alphanumeric rule to a field.
+ *
+ * @param string $field The field you want to apply the rule to.
+ * @param string|null $message The error message when the rule fails.
+ * @param string|callable|null $when Either 'create' or 'update' or a callable that returns
+ * true when the validation rule should be applied.
+ * @see \Cake\Validation\Validation::notAlphaNumeric()
+ * @return $this
+ */
+ public function notAsciiAlphaNumeric($field, $message = null, $when = null)
+ {
+ $extra = array_filter(['on' => $when, 'message' => $message]);
+
+ return $this->add($field, 'notAsciiAlphaNumeric', $extra + [
+ 'rule' => 'notAsciiAlphaNumeric',
+ ]);
+ }
+
/**
* Add an rule that ensures a string length is within a range.
*
@@ -1342,7 +1415,7 @@ public function greaterThan($field, $value, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'greaterThan', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_GREATER, $value]
+ 'rule' => ['comparison', Validation::COMPARE_GREATER, $value],
]);
}
@@ -1362,7 +1435,7 @@ public function greaterThanOrEqual($field, $value, $message = null, $when = null
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'greaterThanOrEqual', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_GREATER_OR_EQUAL, $value]
+ 'rule' => ['comparison', Validation::COMPARE_GREATER_OR_EQUAL, $value],
]);
}
@@ -1382,7 +1455,7 @@ public function lessThan($field, $value, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'lessThan', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_LESS, $value]
+ 'rule' => ['comparison', Validation::COMPARE_LESS, $value],
]);
}
@@ -1402,7 +1475,7 @@ public function lessThanOrEqual($field, $value, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'lessThanOrEqual', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_LESS_OR_EQUAL, $value]
+ 'rule' => ['comparison', Validation::COMPARE_LESS_OR_EQUAL, $value],
]);
}
@@ -1422,7 +1495,7 @@ public function equals($field, $value, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'equals', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_EQUAL, $value]
+ 'rule' => ['comparison', Validation::COMPARE_EQUAL, $value],
]);
}
@@ -1442,7 +1515,7 @@ public function notEquals($field, $value, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'notEquals', $extra + [
- 'rule' => ['comparison', Validation::COMPARE_NOT_EQUAL, $value]
+ 'rule' => ['comparison', Validation::COMPARE_NOT_EQUAL, $value],
]);
}
@@ -1464,7 +1537,7 @@ public function sameAs($field, $secondField, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'sameAs', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_SAME]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_SAME],
]);
}
@@ -1485,7 +1558,7 @@ public function notSameAs($field, $secondField, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'notSameAs', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_NOT_SAME]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_NOT_SAME],
]);
}
@@ -1506,7 +1579,7 @@ public function equalToField($field, $secondField, $message = null, $when = null
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'equalToField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_EQUAL]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_EQUAL],
]);
}
@@ -1527,7 +1600,7 @@ public function notEqualToField($field, $secondField, $message = null, $when = n
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'notEqualToField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_NOT_EQUAL]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_NOT_EQUAL],
]);
}
@@ -1548,7 +1621,7 @@ public function greaterThanField($field, $secondField, $message = null, $when =
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'greaterThanField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_GREATER]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_GREATER],
]);
}
@@ -1569,7 +1642,7 @@ public function greaterThanOrEqualToField($field, $secondField, $message = null,
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'greaterThanOrEqualToField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_GREATER_OR_EQUAL]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_GREATER_OR_EQUAL],
]);
}
@@ -1590,7 +1663,7 @@ public function lessThanField($field, $secondField, $message = null, $when = nul
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'lessThanField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_LESS]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_LESS],
]);
}
@@ -1611,7 +1684,7 @@ public function lessThanOrEqualToField($field, $secondField, $message = null, $w
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'lessThanOrEqualToField', $extra + [
- 'rule' => ['compareFields', $secondField, Validation::COMPARE_LESS_OR_EQUAL]
+ 'rule' => ['compareFields', $secondField, Validation::COMPARE_LESS_OR_EQUAL],
]);
}
@@ -1625,13 +1698,14 @@ public function lessThanOrEqualToField($field, $secondField, $message = null, $w
* true when the validation rule should be applied.
* @see \Cake\Validation\Validation::containsNonAlphaNumeric()
* @return $this
+ * @deprecated 3.9.0 Use notAlphaNumeric() instead. Will be removed in 5.0
*/
public function containsNonAlphaNumeric($field, $limit = 1, $message = null, $when = null)
{
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'containsNonAlphaNumeric', $extra + [
- 'rule' => ['containsNonAlphaNumeric', $limit]
+ 'rule' => ['containsNonAlphaNumeric', $limit],
]);
}
@@ -1651,7 +1725,7 @@ public function date($field, $formats = ['ymd'], $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'date', $extra + [
- 'rule' => ['date', $formats]
+ 'rule' => ['date', $formats],
]);
}
@@ -1671,7 +1745,7 @@ public function dateTime($field, $formats = ['ymd'], $message = null, $when = nu
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'dateTime', $extra + [
- 'rule' => ['datetime', $formats]
+ 'rule' => ['datetime', $formats],
]);
}
@@ -1690,7 +1764,7 @@ public function time($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'time', $extra + [
- 'rule' => 'time'
+ 'rule' => 'time',
]);
}
@@ -1710,7 +1784,7 @@ public function localizedTime($field, $type = 'datetime', $message = null, $when
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'localizedTime', $extra + [
- 'rule' => ['localizedTime', $type]
+ 'rule' => ['localizedTime', $type],
]);
}
@@ -1729,7 +1803,7 @@ public function boolean($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'boolean', $extra + [
- 'rule' => 'boolean'
+ 'rule' => 'boolean',
]);
}
@@ -1749,7 +1823,7 @@ public function decimal($field, $places = null, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'decimal', $extra + [
- 'rule' => ['decimal', $places]
+ 'rule' => ['decimal', $places],
]);
}
@@ -1769,7 +1843,7 @@ public function email($field, $checkMX = false, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'email', $extra + [
- 'rule' => ['email', $checkMX]
+ 'rule' => ['email', $checkMX],
]);
}
@@ -1790,7 +1864,7 @@ public function ip($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'ip', $extra + [
- 'rule' => 'ip'
+ 'rule' => 'ip',
]);
}
@@ -1809,7 +1883,7 @@ public function ipv4($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'ipv4', $extra + [
- 'rule' => ['ip', 'ipv4']
+ 'rule' => ['ip', 'ipv4'],
]);
}
@@ -1828,7 +1902,7 @@ public function ipv6($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'ipv6', $extra + [
- 'rule' => ['ip', 'ipv6']
+ 'rule' => ['ip', 'ipv6'],
]);
}
@@ -1848,7 +1922,7 @@ public function minLength($field, $min, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'minLength', $extra + [
- 'rule' => ['minLength', $min]
+ 'rule' => ['minLength', $min],
]);
}
@@ -1868,7 +1942,7 @@ public function minLengthBytes($field, $min, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'minLengthBytes', $extra + [
- 'rule' => ['minLengthBytes', $min]
+ 'rule' => ['minLengthBytes', $min],
]);
}
@@ -1888,7 +1962,7 @@ public function maxLength($field, $max, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'maxLength', $extra + [
- 'rule' => ['maxLength', $max]
+ 'rule' => ['maxLength', $max],
]);
}
@@ -1908,7 +1982,7 @@ public function maxLengthBytes($field, $max, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'maxLengthBytes', $extra + [
- 'rule' => ['maxLengthBytes', $max]
+ 'rule' => ['maxLengthBytes', $max],
]);
}
@@ -1927,7 +2001,7 @@ public function numeric($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'numeric', $extra + [
- 'rule' => 'numeric'
+ 'rule' => 'numeric',
]);
}
@@ -1946,7 +2020,7 @@ public function naturalNumber($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'naturalNumber', $extra + [
- 'rule' => ['naturalNumber', false]
+ 'rule' => ['naturalNumber', false],
]);
}
@@ -1965,7 +2039,7 @@ public function nonNegativeInteger($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'nonNegativeInteger', $extra + [
- 'rule' => ['naturalNumber', true]
+ 'rule' => ['naturalNumber', true],
]);
}
@@ -1988,7 +2062,7 @@ public function range($field, array $range, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'range', $extra + [
- 'rule' => ['range', array_shift($range), array_shift($range)]
+ 'rule' => ['range', array_shift($range), array_shift($range)],
]);
}
@@ -2009,7 +2083,7 @@ public function url($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'url', $extra + [
- 'rule' => ['url', false]
+ 'rule' => ['url', false],
]);
}
@@ -2030,7 +2104,7 @@ public function urlWithProtocol($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'urlWithProtocol', $extra + [
- 'rule' => ['url', true]
+ 'rule' => ['url', true],
]);
}
@@ -2050,7 +2124,7 @@ public function inList($field, array $list, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'inList', $extra + [
- 'rule' => ['inList', $list]
+ 'rule' => ['inList', $list],
]);
}
@@ -2069,7 +2143,7 @@ public function uuid($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'uuid', $extra + [
- 'rule' => 'uuid'
+ 'rule' => 'uuid',
]);
}
@@ -2091,7 +2165,7 @@ public function uploadedFile($field, array $options, $message = null, $when = nu
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'uploadedFile', $extra + [
- 'rule' => ['uploadedFile', $options]
+ 'rule' => ['uploadedFile', $options],
]);
}
@@ -2112,7 +2186,7 @@ public function latLong($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'latLong', $extra + [
- 'rule' => 'geoCoordinate'
+ 'rule' => 'geoCoordinate',
]);
}
@@ -2131,7 +2205,7 @@ public function latitude($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'latitude', $extra + [
- 'rule' => 'latitude'
+ 'rule' => 'latitude',
]);
}
@@ -2150,7 +2224,7 @@ public function longitude($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'longitude', $extra + [
- 'rule' => 'longitude'
+ 'rule' => 'longitude',
]);
}
@@ -2169,7 +2243,7 @@ public function ascii($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'ascii', $extra + [
- 'rule' => 'ascii'
+ 'rule' => 'ascii',
]);
}
@@ -2188,7 +2262,7 @@ public function utf8($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'utf8', $extra + [
- 'rule' => ['utf8', ['extended' => false]]
+ 'rule' => ['utf8', ['extended' => false]],
]);
}
@@ -2209,7 +2283,7 @@ public function utf8Extended($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'utf8Extended', $extra + [
- 'rule' => ['utf8', ['extended' => true]]
+ 'rule' => ['utf8', ['extended' => true]],
]);
}
@@ -2228,7 +2302,7 @@ public function integer($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'integer', $extra + [
- 'rule' => 'isInteger'
+ 'rule' => 'isInteger',
]);
}
@@ -2247,7 +2321,7 @@ public function isArray($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'isArray', $extra + [
- 'rule' => 'isArray'
+ 'rule' => 'isArray',
]);
}
@@ -2266,7 +2340,7 @@ public function scalar($field, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'scalar', $extra + [
- 'rule' => 'isScalar'
+ 'rule' => 'isScalar',
]);
}
@@ -2308,7 +2382,7 @@ public function multipleOptions($field, array $options = [], $message = null, $w
unset($options['caseInsensitive']);
return $this->add($field, 'multipleOptions', $extra + [
- 'rule' => ['multiple', $options, $caseInsensitive]
+ 'rule' => ['multiple', $options, $caseInsensitive],
]);
}
@@ -2335,7 +2409,7 @@ public function hasAtLeast($field, $count, $message = null, $when = null)
}
return Validation::numElements($value, Validation::COMPARE_GREATER_OR_EQUAL, $count);
- }
+ },
]);
}
@@ -2362,7 +2436,7 @@ public function hasAtMost($field, $count, $message = null, $when = null)
}
return Validation::numElements($value, Validation::COMPARE_LESS_OR_EQUAL, $count);
- }
+ },
]);
}
@@ -2415,7 +2489,7 @@ public function regex($field, $regex, $message = null, $when = null)
$extra = array_filter(['on' => $when, 'message' => $message]);
return $this->add($field, 'regex', $extra + [
- 'rule' => ['custom', $regex]
+ 'rule' => ['custom', $regex],
]);
}
@@ -2558,7 +2632,8 @@ protected function isEmpty($data, $flags)
}
if (is_array($data)) {
- if (($flags & self::EMPTY_FILE)
+ if (
+ ($flags & self::EMPTY_FILE)
&& isset($data['name'], $data['type'], $data['tmp_name'], $data['error'])
&& (int)$data['error'] === UPLOAD_ERR_NO_FILE
) {
@@ -2584,6 +2659,14 @@ protected function isEmpty($data, $flags)
}
}
+ if (
+ ($flags & self::EMPTY_FILE)
+ && $data instanceof UploadedFileInterface
+ && $data->getError() === UPLOAD_ERR_NO_FILE
+ ) {
+ return true;
+ }
+
return false;
}
@@ -2652,7 +2735,7 @@ public function __debugInfo()
'_allowEmptyFlags' => $this->_allowEmptyFlags,
'_useI18n' => $this->_useI18n,
'_providers' => array_keys($this->_providers),
- '_fields' => $fields
+ '_fields' => $fields,
];
}
}
diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareInterface.php b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareInterface.php
index e7f67b2a0..ac3fd1315 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareInterface.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareInterface.php
@@ -19,7 +19,6 @@
*/
interface ValidatorAwareInterface
{
-
/**
* Name of default validation set.
*
diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php
index 0b11f1ba5..ab5bc7e52 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php
+++ b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php
@@ -38,7 +38,6 @@
*/
trait ValidatorAwareTrait
{
-
/**
* Validator class.
*
@@ -174,7 +173,7 @@ protected function createValidator($name)
throw new RuntimeException($message);
}
- $validator = new $this->_validatorClass;
+ $validator = new $this->_validatorClass();
$validator = $this->$method($validator);
if ($this instanceof EventDispatcherInterface) {
$event = defined(self::class . '::BUILD_VALIDATOR_EVENT') ? self::BUILD_VALIDATOR_EVENT : 'Model.buildValidator';
@@ -208,7 +207,7 @@ protected function createValidator($name)
*/
public function setValidator($name, Validator $validator)
{
- $validator->setProvider(self::VALIDATOR_PROVIDER_NAME, $this);
+ $validator->setProvider(static::VALIDATOR_PROVIDER_NAME, $this);
$this->_validators[$name] = $validator;
return $this;
diff --git a/app/vendor/cakephp/cakephp/src/Validation/composer.json b/app/vendor/cakephp/cakephp/src/Validation/composer.json
index e4de56aa7..db585a33d 100644
--- a/app/vendor/cakephp/cakephp/src/Validation/composer.json
+++ b/app/vendor/cakephp/cakephp/src/Validation/composer.json
@@ -22,7 +22,7 @@
"source": "https://github.com/cakephp/validation"
},
"require": {
- "php": ">=5.6.0",
+ "php": ">=5.6.0,<8.0.0",
"cakephp/core": "^3.6.0",
"cakephp/utility": "^3.6.0",
"psr/http-message": "^1.0.0"
diff --git a/app/vendor/cakephp/cakephp/src/View/AjaxView.php b/app/vendor/cakephp/cakephp/src/View/AjaxView.php
index 6538fc1f2..6648b0d07 100644
--- a/app/vendor/cakephp/cakephp/src/View/AjaxView.php
+++ b/app/vendor/cakephp/cakephp/src/View/AjaxView.php
@@ -25,7 +25,6 @@
*/
class AjaxView extends View
{
-
/**
* {@inheritDoc}
*/
diff --git a/app/vendor/cakephp/cakephp/src/View/Cell.php b/app/vendor/cakephp/cakephp/src/View/Cell.php
index d273dd4a1..cd3139aaa 100644
--- a/app/vendor/cakephp/cakephp/src/View/Cell.php
+++ b/app/vendor/cakephp/cakephp/src/View/Cell.php
@@ -35,7 +35,6 @@
*/
abstract class Cell
{
-
use EventDispatcherTrait;
use LocatorAwareTrait;
use ModelAwareTrait;
@@ -87,7 +86,7 @@ abstract class Cell
* @deprecated 3.7.0 Use ViewBuilder::setOptions() or any one of it's setter methods instead.
*/
protected $_validViewOptions = [
- 'viewPath'
+ 'viewPath',
];
/**
@@ -231,7 +230,7 @@ protected function _cacheConfig($action, $template = null)
$key = str_replace('\\', '_', $key);
$default = [
'config' => 'default',
- 'key' => $key
+ 'key' => $key,
];
if ($this->_cache === true) {
return $default;
diff --git a/app/vendor/cakephp/cakephp/src/View/CellTrait.php b/app/vendor/cakephp/cakephp/src/View/CellTrait.php
index 324ce8817..ebe26595f 100644
--- a/app/vendor/cakephp/cakephp/src/View/CellTrait.php
+++ b/app/vendor/cakephp/cakephp/src/View/CellTrait.php
@@ -23,7 +23,6 @@
*/
trait CellTrait
{
-
/**
* Renders the given cell.
*
@@ -92,7 +91,7 @@ protected function cell($cell, array $data = [], array $options = [])
*/
protected function _createCell($className, $action, $plugin, $options)
{
- /* @var \Cake\View\Cell $instance */
+ /** @var \Cake\View\Cell $instance */
$instance = new $className($this->request, $this->response, $this->getEventManager(), $options);
$builder = $instance->viewBuilder();
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellException.php
index 1c2a4a293..938ac4da7 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellException.php
@@ -21,6 +21,8 @@
*/
class MissingCellException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Cell class %s is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellViewException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellViewException.php
index 330e1ea90..bad1e1b27 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellViewException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingCellViewException.php
@@ -19,6 +19,8 @@
*/
class MissingCellViewException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Cell view file "%s" is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingElementException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingElementException.php
index 0585285fa..4fa9bb282 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingElementException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingElementException.php
@@ -19,11 +19,8 @@
*/
class MissingElementException extends Exception
{
-
/**
- * Message template
- *
- * @var string
+ * @inheritDoc
*/
protected $_messageTemplate = 'Element file "%s" is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingHelperException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingHelperException.php
index d370aaf79..3c48a62d4 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingHelperException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingHelperException.php
@@ -19,6 +19,8 @@
*/
class MissingHelperException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Helper class %s could not be found.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingLayoutException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingLayoutException.php
index 9af79e530..a50c703df 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingLayoutException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingLayoutException.php
@@ -19,6 +19,8 @@
*/
class MissingLayoutException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Layout file "%s" is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php
index 83f882ee0..76c7e2e45 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php
@@ -19,6 +19,8 @@
*/
class MissingTemplateException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'Template file "%s" is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingViewException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingViewException.php
index 5fe5e073b..d01027d6b 100644
--- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingViewException.php
+++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingViewException.php
@@ -21,6 +21,8 @@
*/
class MissingViewException extends Exception
{
-
+ /**
+ * @inheritDoc
+ */
protected $_messageTemplate = 'View class "%s" is missing.';
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/ArrayContext.php b/app/vendor/cakephp/cakephp/src/View/Form/ArrayContext.php
index c307cb71f..e009d8325 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/ArrayContext.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/ArrayContext.php
@@ -66,7 +66,6 @@
*/
class ArrayContext implements ContextInterface
{
-
/**
* The request object.
*
@@ -106,7 +105,8 @@ public function __construct(ServerRequest $request, array $context)
*/
public function primaryKey()
{
- if (empty($this->_context['schema']['_constraints']) ||
+ if (
+ empty($this->_context['schema']['_constraints']) ||
!is_array($this->_context['schema']['_constraints'])
) {
return [];
@@ -127,7 +127,7 @@ public function isPrimaryKey($field)
{
$primaryKey = $this->primaryKey();
- return in_array($field, $primaryKey);
+ return in_array($field, $primaryKey, true);
}
/**
@@ -170,7 +170,7 @@ public function val($field, $options = [])
{
$options += [
'default' => null,
- 'schemaDefault' => true
+ 'schemaDefault' => true,
];
$val = $this->_request->getData($field);
@@ -261,7 +261,7 @@ public function fieldNames()
* Get the abstract field type for a given field name.
*
* @param string $field A dot separated path to get a schema type for.
- * @return null|string An abstract data type or null.
+ * @return string|null An abstract data type or null.
* @see \Cake\Database\Type
*/
public function type($field)
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/ContextFactory.php b/app/vendor/cakephp/cakephp/src/View/Form/ContextFactory.php
index a3b68db7d..bfe31524d 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/ContextFactory.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/ContextFactory.php
@@ -71,7 +71,7 @@ public static function createWithDefaults(array $providers = [])
if (is_array($data['entity']) && empty($data['entity']['schema'])) {
return new EntityContext($request, $data);
}
- }
+ },
],
[
'type' => 'array',
@@ -79,7 +79,7 @@ public static function createWithDefaults(array $providers = [])
if (is_array($data['entity']) && isset($data['entity']['schema'])) {
return new ArrayContext($request, $data['entity']);
}
- }
+ },
],
[
'type' => 'form',
@@ -87,7 +87,7 @@ public static function createWithDefaults(array $providers = [])
if ($data['entity'] instanceof Form) {
return new FormContext($request, $data);
}
- }
+ },
],
] + $providers;
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/ContextInterface.php b/app/vendor/cakephp/cakephp/src/View/Form/ContextInterface.php
index a87e3ea1e..039a4ef92 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/ContextInterface.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/ContextInterface.php
@@ -22,7 +22,6 @@
*/
interface ContextInterface
{
-
/**
* Get the fields used in the context as a primary key.
*
@@ -84,7 +83,7 @@ public function fieldNames();
* Get the abstract field type for a given field name.
*
* @param string $field A dot separated path to get a schema type for.
- * @return null|string An abstract data type or null.
+ * @return string|null An abstract data type or null.
* @see \Cake\Database\Type
*/
public function type($field);
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/EntityContext.php b/app/vendor/cakephp/cakephp/src/View/Form/EntityContext.php
index 52812391e..ad52be87d 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/EntityContext.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/EntityContext.php
@@ -184,7 +184,7 @@ public function isPrimaryKey($field)
$table = $this->_getTable($parts);
$primaryKey = (array)$table->getPrimaryKey();
- return in_array(array_pop($parts), $primaryKey);
+ return in_array(array_pop($parts), $primaryKey, true);
}
/**
@@ -231,7 +231,7 @@ public function val($field, $options = [])
{
$options += [
'default' => null,
- 'schemaDefault' => true
+ 'schemaDefault' => true,
];
$val = $this->_request->getData($field);
@@ -254,7 +254,8 @@ public function val($field, $options = [])
if ($val !== null) {
return $val;
}
- if ($options['default'] !== null
+ if (
+ $options['default'] !== null
|| !$options['schemaDefault']
|| !$entity->isNew()
) {
@@ -322,7 +323,7 @@ protected function _extractMultiple($values, $path)
*
* @param array|null $path Each one of the parts in a path for a field name
* or null to get the entity passed in constructor context.
- * @return \Cake\Datasource\EntityInterface|\Traversable|array|bool
+ * @return \Cake\Datasource\EntityInterface|\Traversable|array|false
* @throws \RuntimeException When properties cannot be read.
*/
public function entity($path = null)
@@ -602,7 +603,7 @@ protected function _getValidator($parts)
* @param array $parts Each one of the parts in a path for a field name
* @param bool $fallback Whether or not to fallback to the last found table
* when a non-existent field/property is being encountered.
- * @return \Cake\ORM\Table|bool Table instance or false
+ * @return \Cake\ORM\Table|false Table instance or false
*/
protected function _getTable($parts, $fallback = true)
{
@@ -653,7 +654,7 @@ protected function _getTable($parts, $fallback = true)
* Get the abstract field type for a given field name.
*
* @param string $field A dot separated path to get a schema type for.
- * @return null|string An abstract data type or null.
+ * @return string|null An abstract data type or null.
* @see \Cake\Database\Type
*/
public function type($field)
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/FormContext.php b/app/vendor/cakephp/cakephp/src/View/Form/FormContext.php
index 494be6b27..169178687 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/FormContext.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/FormContext.php
@@ -25,7 +25,6 @@
*/
class FormContext implements ContextInterface
{
-
/**
* The request object.
*
@@ -80,13 +79,19 @@ public function isCreate()
}
/**
- * {@inheritDoc}
+ * Get the value for a given path.
+ *
+ * Traverses the request and form data and finds the value for $path.
+ *
+ * @param string $field The dot separated path to the value.
+ * @param array $options options
+ * @return mixed The value of the field or null on a miss.
*/
public function val($field, $options = [])
{
$options += [
'default' => null,
- 'schemaDefault' => true
+ 'schemaDefault' => true,
];
$val = $this->_request->getData($field);
diff --git a/app/vendor/cakephp/cakephp/src/View/Form/NullContext.php b/app/vendor/cakephp/cakephp/src/View/Form/NullContext.php
index c05c63ee4..45f0da620 100644
--- a/app/vendor/cakephp/cakephp/src/View/Form/NullContext.php
+++ b/app/vendor/cakephp/cakephp/src/View/Form/NullContext.php
@@ -24,7 +24,6 @@
*/
class NullContext implements ContextInterface
{
-
/**
* The request object.
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper.php b/app/vendor/cakephp/cakephp/src/View/Helper.php
index 765d0d6c8..abc5cac09 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper.php
@@ -40,7 +40,6 @@
*/
class Helper implements EventListenerInterface
{
-
use InstanceConfigTrait;
/**
@@ -110,7 +109,7 @@ public function __construct(View $View, array $config = [])
*
* @param string $method Method to invoke
* @param array $params Array of params for the method.
- * @return void
+ * @return mixed|void
*/
public function __call($method, $params)
{
@@ -257,7 +256,7 @@ protected function _cleanConfirmMessage($message)
*
* @param array $options Array options/attributes to add a class to
* @param string|null $class The class name being added.
- * @param string $key the key to use for class.
+ * @param string $key the key to use for class. Defaults to `'class'`.
* @return array Array of options with $key set.
*/
public function addClass(array $options = [], $class = null, $key = 'class')
@@ -292,7 +291,7 @@ public function implementedEvents()
'View.beforeRender' => 'beforeRender',
'View.afterRender' => 'afterRender',
'View.beforeLayout' => 'beforeLayout',
- 'View.afterLayout' => 'afterLayout'
+ 'View.afterLayout' => 'afterLayout',
];
$events = [];
foreach ($eventMap as $event => $method) {
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/BreadcrumbsHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/BreadcrumbsHelper.php
index 06effa520..14de4dee5 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/BreadcrumbsHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/BreadcrumbsHelper.php
@@ -25,7 +25,6 @@
*/
class BreadcrumbsHelper extends Helper
{
-
use StringTemplateTrait;
/**
@@ -45,8 +44,8 @@ class BreadcrumbsHelper extends Helper
'wrapper' => '
',
'item' => '{{title}}{{separator}}',
'itemWithoutLink' => '{{title}}{{separator}}',
- 'separator' => '{{separator}}'
- ]
+ 'separator' => '{{separator}}',
+ ],
];
/**
@@ -92,7 +91,7 @@ public function add($title, $url = null, array $options = [])
/**
* Prepend a crumb to the start of the queue.
*
- * @param string $title If provided as a string, it represents the title of the crumb.
+ * @param string|array $title If provided as a string, it represents the title of the crumb.
* Alternatively, if you want to add multiple crumbs at once, you can provide an array, with each values being a
* single crumb. Arrays are expected to be of this form:
* - *title* The title of the crumb
@@ -292,7 +291,7 @@ public function render(array $attributes = [], array $separator = [])
'title' => $title,
'url' => $url,
'separator' => '',
- 'templateVars' => isset($options['templateVars']) ? $options['templateVars'] : []
+ 'templateVars' => isset($options['templateVars']) ? $options['templateVars'] : [],
];
if (!$url) {
@@ -309,7 +308,7 @@ public function render(array $attributes = [], array $separator = [])
$crumbTrail = $this->formatTemplate('wrapper', [
'content' => $crumbTrail,
'attrs' => $templater->formatAttributes($attributes, ['templateVars']),
- 'templateVars' => isset($attributes['templateVars']) ? $attributes['templateVars'] : []
+ 'templateVars' => isset($attributes['templateVars']) ? $attributes['templateVars'] : [],
]);
return $crumbTrail;
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/FlashHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/FlashHelper.php
index f47aea38f..91f81b9c8 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/FlashHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/FlashHelper.php
@@ -25,7 +25,6 @@
*/
class FlashHelper extends Helper
{
-
/**
* Used to render the message set in FlashComponent::set()
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php
index ffdb236bc..f4b43ff10 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/FormHelper.php
@@ -35,18 +35,17 @@
*
* Automatic generation of HTML FORMs from given data.
*
- * @method string text($fieldName, array $options = [])
- * @method string number($fieldName, array $options = [])
- * @method string email($fieldName, array $options = [])
- * @method string password($fieldName, array $options = [])
- * @method string search($fieldName, array $options = [])
+ * @method string text(string $fieldName, array $options = [])
+ * @method string number(string $fieldName, array $options = [])
+ * @method string email(string $fieldName, array $options = [])
+ * @method string password(string $fieldName, array $options = [])
+ * @method string search(string $fieldName, array $options = [])
* @property \Cake\View\Helper\HtmlHelper $Html
* @property \Cake\View\Helper\UrlHelper $Url
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html
*/
class FormHelper extends Helper
{
-
use IdGeneratorTrait;
use SecureFieldTokenTrait;
use StringTemplateTrait;
@@ -72,7 +71,7 @@ class FormHelper extends Helper
*/
protected $_datetimeOptions = [
'interval', 'round', 'monthNames', 'minYear', 'maxYear',
- 'orderYear', 'timeFormat', 'second'
+ 'orderYear', 'timeFormat', 'second',
];
/**
@@ -162,8 +161,10 @@ class FormHelper extends Helper
'textarea' => '',
// Container for submit buttons.
'submitContainer' => '{{content}}
',
- //Confirm javascript template for postLink()
+ // Confirm javascript template for postLink()
'confirmJs' => '{{confirm}}',
+ // selected class
+ 'selectedClass' => 'selected',
],
// set HTML5 validation message to custom required/empty messages
'autoSetCustomValidity' => false,
@@ -191,7 +192,7 @@ class FormHelper extends Helper
/**
* List of fields created, used with secure forms.
*
- * @var array
+ * @var string[]
*/
public $fields = [];
@@ -307,9 +308,9 @@ public function __construct(View $View, array $config = [])
/**
* Set the widget registry the helper will use.
*
- * @param \Cake\View\Widget\WidgetRegistry|null $instance The registry instance to set.
+ * @param \Cake\View\Widget\WidgetLocator|null $instance The registry instance to set.
* @param array $widgets An array of widgets
- * @return \Cake\View\Widget\WidgetRegistry
+ * @return \Cake\View\Widget\WidgetLocator
* @deprecated 3.6.0 Use FormHelper::widgetLocator() instead.
*/
public function widgetRegistry(WidgetRegistry $instance = null, $widgets = [])
@@ -396,15 +397,19 @@ public function contextFactory(ContextFactory $instance = null, array $contexts
*
* @param mixed $context The context for which the form is being defined.
* Can be a ContextInterface instance, ORM entity, ORM resultset, or an
- * array of meta data. You can use false or null to make a context-less form.
+ * array of meta data. You can use null to make a context-less form.
* @param array $options An array of html attributes and options.
* @return string An formatted opening FORM tag.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#Cake\View\Helper\FormHelper::create
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#Cake\View\Helper\FormHelper::create
*/
public function create($context = null, array $options = [])
{
$append = '';
+ if (is_bool($context) || is_string($context)) {
+ deprecationWarning('Using `string` or `bool` for $context is deprecated, use `null` to make a context-less form.');
+ }
+
if ($context instanceof ContextInterface) {
$this->context($context);
} else {
@@ -480,7 +485,7 @@ public function create($context = null, array $options = [])
$append .= $this->hidden('_method', [
'name' => '_method',
'value' => strtoupper($options['type']),
- 'secure' => static::SECURE_SKIP
+ 'secure' => static::SECURE_SKIP,
]);
// Default to post method
default:
@@ -515,7 +520,7 @@ public function create($context = null, array $options = [])
return $this->formatTemplate('formStart', [
'attrs' => $templater->formatAttributes($htmlAttributes) . $actionAttr,
- 'templateVars' => isset($options['templateVars']) ? $options['templateVars'] : []
+ 'templateVars' => isset($options['templateVars']) ? $options['templateVars'] : [],
]) . $append;
}
@@ -534,7 +539,8 @@ protected function _formUrl($context, $options)
return $request->getRequestTarget();
}
- if (is_string($options['url']) ||
+ if (
+ is_string($options['url']) ||
(is_array($options['url']) && isset($options['url']['_name']))
) {
return $options['url'];
@@ -566,7 +572,7 @@ protected function _formUrl($context, $options)
/**
* Correctly store the last created form action URL.
*
- * @param string|array $url The URL of the last form.
+ * @param string|array|null $url The URL of the last form.
* @return void
*/
protected function _lastAction($url)
@@ -615,7 +621,7 @@ protected function _csrfField()
* @param array $secureAttributes Secure attributes which will be passed as HTML attributes
* into the hidden input elements generated for the Security Component.
* @return string A closing FORM tag.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#closing-the-form
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#closing-the-form
*/
public function end(array $secureAttributes = [])
{
@@ -683,7 +689,7 @@ public function secure(array $fields = [], array $secureAttributes = [])
'value' => urlencode(json_encode([
$this->_lastAction,
$fields,
- $this->_unlockedFields
+ $this->_unlockedFields,
])),
]);
$out .= $this->hidden('_Token.debug', $tokenDebug);
@@ -700,7 +706,7 @@ public function secure(array $fields = [], array $secureAttributes = [])
*
* @param string|null $name The dot separated name for the field.
* @return array|null Either null, or the list of fields.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#working-with-securitycomponent
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#working-with-securitycomponent
*/
public function unlockField($name = null)
{
@@ -770,7 +776,7 @@ protected function _secure($lock, $field, $value = null)
*
* @param string $field This should be "modelname.fieldname"
* @return bool If there are errors this method returns true, else false.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#displaying-and-checking-errors
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#displaying-and-checking-errors
*/
public function isFieldError($field)
{
@@ -792,7 +798,7 @@ public function isFieldError($field)
* it should be a hash of key names => messages.
* @param array $options See above.
* @return string Formatted errors or ''.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#displaying-and-checking-errors
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#displaying-and-checking-errors
*/
public function error($field, $text = null, array $options = [])
{
@@ -837,7 +843,7 @@ public function error($field, $text = null, array $options = [])
$errorText[] = $this->formatTemplate('errorItem', ['text' => $err]);
}
$error = $this->formatTemplate('errorList', [
- 'content' => implode('', $errorText)
+ 'content' => implode('', $errorText),
]);
} else {
$error = array_pop($error);
@@ -903,7 +909,7 @@ public function error($field, $text = null, array $options = [])
* fieldName.
* @param array $options An array of HTML attributes.
* @return string The formatted LABEL element
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-labels
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-labels
*/
public function label($fieldName, $text = null, array $options = [])
{
@@ -971,7 +977,7 @@ public function label($fieldName, $text = null, array $options = [])
* - `legend` Set to false to disable the legend for the generated control set. Or supply a string
* to customize the legend text.
* @return string Completed form controls.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#generating-entire-forms
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#generating-entire-forms
*/
public function allControls(array $fields = [], array $options = [])
{
@@ -1000,7 +1006,7 @@ public function allControls(array $fields = [], array $options = [])
* - `legend` Set to false to disable the legend for the generated control set. Or supply a string
* to customize the legend text.
* @return string Completed form controls.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#generating-entire-forms
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#generating-entire-forms
* @deprecated 3.4.0 Use FormHelper::allControls() instead.
*/
public function allInputs(array $fields = [], array $options = [])
@@ -1033,7 +1039,7 @@ public function allInputs(array $fields = [], array $options = [])
* - `legend` Set to false to disable the legend for the generated input set.
* Or supply a string to customize the legend text.
* @return string Completed form inputs.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#generating-entire-forms
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#generating-entire-forms
*/
public function controls(array $fields, array $options = [])
{
@@ -1063,7 +1069,7 @@ public function controls(array $fields, array $options = [])
* - `legend` Set to false to disable the legend for the generated input set.
* Or supply a string to customize the legend text.
* @return string Completed form inputs.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#generating-entire-forms
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#generating-entire-forms
* @deprecated 3.4.0 Use FormHelper::controls() instead.
*/
public function inputs(array $fields, array $options = [])
@@ -1132,7 +1138,7 @@ public function fieldset($fields = '', array $options = [])
* ### Options
*
* See each field type method for more information. Any options that are part of
- * $attributes or $options for the different **type** methods can be included in `$options` for input().
+ * $attributes or $options for the different **type** methods can be included in `$options` for control().
* Additionally, any unknown keys that are not in the list below, or part of the selected type's options
* will be treated as a regular HTML attribute for the generated input.
*
@@ -1155,7 +1161,7 @@ public function fieldset($fields = '', array $options = [])
* @param string $fieldName This should be "modelname.fieldname"
* @param array $options Each type of input takes different options.
* @return string Completed form widget.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-form-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-form-inputs
*/
public function control($fieldName, array $options = [])
{
@@ -1167,7 +1173,7 @@ public function control($fieldName, array $options = [])
'options' => null,
'templates' => [],
'templateVars' => [],
- 'labelOptions' => true
+ 'labelOptions' => true,
];
$options = $this->_parseOptions($fieldName, $options);
$options += ['id' => $this->_domId($fieldName)];
@@ -1230,7 +1236,7 @@ public function control($fieldName, array $options = [])
'content' => $result,
'error' => $error,
'errorSuffix' => $errorSuffix,
- 'options' => $options
+ 'options' => $options,
]);
if ($newTemplates) {
@@ -1246,7 +1252,7 @@ public function control($fieldName, array $options = [])
* @param string $fieldName This should be "modelname.fieldname"
* @param array $options Each type of input takes different options.
* @return string Completed form widget.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-form-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-form-inputs
* @deprecated 3.4.0 Use FormHelper::control() instead.
*/
public function input($fieldName, array $options = [])
@@ -1276,7 +1282,7 @@ protected function _groupTemplate($options)
'input' => isset($options['input']) ? $options['input'] : [],
'label' => $options['label'],
'error' => $options['error'],
- 'templateVars' => isset($options['options']['templateVars']) ? $options['options']['templateVars'] : []
+ 'templateVars' => isset($options['options']['templateVars']) ? $options['options']['templateVars'] : [],
]);
}
@@ -1298,7 +1304,7 @@ protected function _inputContainerTemplate($options)
'error' => $options['error'],
'required' => $options['options']['required'] ? ' required' : '',
'type' => $options['options']['type'],
- 'templateVars' => isset($options['options']['templateVars']) ? $options['options']['templateVars'] : []
+ 'templateVars' => isset($options['options']['templateVars']) ? $options['options']['templateVars'] : [],
]);
}
@@ -1453,7 +1459,7 @@ protected function _magicOptions($fieldName, $options, $allowOverride)
$context = $this->_getContext();
$options += [
- 'templateVars' => []
+ 'templateVars' => [],
];
if (!isset($options['required']) && $options['type'] !== 'hidden') {
@@ -1504,7 +1510,8 @@ protected function _magicOptions($fieldName, $options, $allowOverride)
}
$typesWithMaxLength = ['text', 'textarea', 'email', 'tel', 'url', 'search'];
- if (!array_key_exists('maxlength', $options)
+ if (
+ !array_key_exists('maxlength', $options)
&& in_array($options['type'], $typesWithMaxLength)
) {
$maxLength = null;
@@ -1630,7 +1637,7 @@ protected function _inputLabel($fieldName, $label, $options)
* @param string $fieldName Name of a field, like this "modelname.fieldname"
* @param array $options Array of HTML attributes.
* @return string|array An HTML text input element.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-checkboxes
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-checkboxes
*/
public function checkbox($fieldName, array $options = [])
{
@@ -1648,7 +1655,7 @@ public function checkbox($fieldName, array $options = [])
'name' => $options['name'],
'value' => $options['hiddenField'] !== true && $options['hiddenField'] !== '_split' ? $options['hiddenField'] : '0',
'form' => isset($options['form']) ? $options['form'] : null,
- 'secure' => false
+ 'secure' => false,
];
if (isset($options['disabled']) && $options['disabled']) {
$hiddenOptions['disabled'] = 'disabled';
@@ -1686,7 +1693,7 @@ public function checkbox($fieldName, array $options = [])
* @param array|\Traversable $options Radio button options array.
* @param array $attributes Array of attributes.
* @return string Completed radio widget set.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-radio-buttons
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-radio-buttons
*/
public function radio($fieldName, $options = [], array $attributes = [])
{
@@ -1761,7 +1768,7 @@ public function __call($method, $params)
* @param string $fieldName Name of a field, in the form "modelname.fieldname"
* @param array $options Array of HTML attributes, and special options above.
* @return string A generated HTML text input element
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-textareas
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-textareas
*/
public function textarea($fieldName, array $options = [])
{
@@ -1777,7 +1784,7 @@ public function textarea($fieldName, array $options = [])
* @param string $fieldName Name of a field, in the form of "modelname.fieldname"
* @param array $options Array of HTML attributes.
* @return string A generated hidden input
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-hidden-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-hidden-inputs
*/
public function hidden($fieldName, array $options = [])
{
@@ -1806,7 +1813,7 @@ public function hidden($fieldName, array $options = [])
* @param string $fieldName Name of a field, in the form "modelname.fieldname"
* @param array $options Array of HTML attributes.
* @return string A generated file input.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-file-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-file-inputs
*/
public function file($fieldName, array $options = [])
{
@@ -1832,7 +1839,7 @@ public function file($fieldName, array $options = [])
* @param string $title The button's caption. Not automatically HTML encoded
* @param array $options Array of options and HTML attributes.
* @return string A HTML button tag.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-button-elements
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-button-elements
*/
public function button($title, array $options = [])
{
@@ -1867,7 +1874,7 @@ public function button($title, array $options = [])
* @param string|array $url URL as string or array
* @param array $options Array of options and HTML attributes.
* @return string A HTML button tag.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-standalone-buttons-and-post-links
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-standalone-buttons-and-post-links
*/
public function postButton($title, $url, array $options = [])
{
@@ -1880,7 +1887,7 @@ public function postButton($title, $url, array $options = [])
$formOptions = $options['form'] + $formOptions;
unset($options['form']);
}
- $out = $this->create(false, $formOptions);
+ $out = $this->create(null, $formOptions);
if (isset($options['data']) && is_array($options['data'])) {
foreach (Hash::flatten($options['data']) as $key => $value) {
$out .= $this->hidden($key, ['value' => $value]);
@@ -1920,7 +1927,7 @@ public function postButton($title, $url, array $options = [])
* external URL (starts with http://)
* @param array $options Array of HTML attributes.
* @return string An `` element.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-standalone-buttons-and-post-links
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-standalone-buttons-and-post-links
*/
public function postLink($title, $url = null, array $options = [])
{
@@ -1952,15 +1959,15 @@ public function postLink($title, $url = null, array $options = [])
$action = $templater->formatAttributes([
'action' => $this->Url->build($url),
- 'escape' => false
+ 'escape' => false,
]);
$out = $this->formatTemplate('formStart', [
- 'attrs' => $templater->formatAttributes($formOptions) . $action
+ 'attrs' => $templater->formatAttributes($formOptions) . $action,
]);
$out .= $this->hidden('_method', [
'value' => $requestMethod,
- 'secure' => static::SECURE_SKIP
+ 'secure' => static::SECURE_SKIP,
]);
$out .= $this->_csrfField();
@@ -1996,7 +2003,7 @@ public function postLink($title, $url = null, array $options = [])
$options['onclick'] = $this->templater()->format('confirmJs', [
'confirmMessage' => $this->_cleanConfirmMessage($confirmMessage),
'formName' => $formName,
- 'confirm' => $confirm
+ 'confirm' => $confirm,
]);
$out .= $this->Html->link($title, $url, $options);
@@ -2021,7 +2028,7 @@ public function postLink($title, $url = null, array $options = [])
* OR if the first character is not /, image is relative to webroot/img.
* @param array $options Array of options. See above.
* @return string A HTML submit button
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-buttons-and-submit-elements
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-buttons-and-submit-elements
*/
public function submit($caption = null, array $options = [])
{
@@ -2031,7 +2038,7 @@ public function submit($caption = null, array $options = [])
$options += [
'type' => 'submit',
'secure' => false,
- 'templateVars' => []
+ 'templateVars' => [],
];
if (isset($options['name'])) {
@@ -2050,7 +2057,7 @@ public function submit($caption = null, array $options = [])
if (isset($options['name'])) {
$unlockFields = [
$options['name'] . '_x',
- $options['name'] . '_y'
+ $options['name'] . '_y',
];
}
foreach ($unlockFields as $ignore) {
@@ -2076,12 +2083,12 @@ public function submit($caption = null, array $options = [])
$input = $this->formatTemplate('inputSubmit', [
'type' => $type,
'attrs' => $this->templater()->formatAttributes($options),
- 'templateVars' => $options['templateVars']
+ 'templateVars' => $options['templateVars'],
]);
return $this->formatTemplate('submitContainer', [
'content' => $input,
- 'templateVars' => $options['templateVars']
+ 'templateVars' => $options['templateVars'],
]);
}
@@ -2136,7 +2143,7 @@ public function submit($caption = null, array $options = [])
* @param array $attributes The HTML attributes of the select element.
* @return string Formatted SELECT element
* @see \Cake\View\Helper\FormHelper::multiCheckbox() for creating multiple checkboxes.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-select-pickers
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-select-pickers
*/
public function select($fieldName, $options = [], array $attributes = [])
{
@@ -2159,7 +2166,8 @@ public function select($fieldName, $options = [], array $attributes = [])
// Secure the field if there are options, or it's a multi select.
// Single selects with no options don't submit, but multiselects do.
- if ($attributes['secure'] &&
+ if (
+ $attributes['secure'] &&
empty($options) &&
empty($attributes['empty']) &&
empty($attributes['multiple'])
@@ -2277,7 +2285,7 @@ protected function _singleDatetime($options, $keep)
* @param string|null $fieldName Prefix name for the SELECT element
* @param array $options Options & HTML attributes for the select element
* @return string A generated day select box.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-day-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-day-inputs
*/
public function day($fieldName = null, array $options = [])
{
@@ -2287,7 +2295,7 @@ public function day($fieldName = null, array $options = [])
$options['val'] = [
'year' => date('Y'),
'month' => date('m'),
- 'day' => (int)$options['val']
+ 'day' => (int)$options['val'],
];
}
@@ -2310,7 +2318,7 @@ public function day($fieldName = null, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options Options & attributes for the select elements.
* @return string Completed year select input
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-year-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-year-inputs
*/
public function year($fieldName, array $options = [])
{
@@ -2321,7 +2329,7 @@ public function year($fieldName, array $options = [])
$options['val'] = [
'year' => (int)$options['val'],
'month' => date('m'),
- 'day' => date('d')
+ 'day' => date('d'),
];
}
@@ -2342,7 +2350,7 @@ public function year($fieldName, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options Attributes for the select element
* @return string A generated month select dropdown.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-month-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-month-inputs
*/
public function month($fieldName, array $options = [])
{
@@ -2352,7 +2360,7 @@ public function month($fieldName, array $options = [])
$options['val'] = [
'year' => date('Y'),
'month' => (int)$options['val'],
- 'day' => date('d')
+ 'day' => date('d'),
];
}
@@ -2372,7 +2380,7 @@ public function month($fieldName, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options List of HTML attributes
* @return string Completed hour select input
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-hour-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-hour-inputs
*/
public function hour($fieldName, array $options = [])
{
@@ -2407,7 +2415,7 @@ public function hour($fieldName, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options Array of options.
* @return string Completed minute select input.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-minute-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-minute-inputs
*/
public function minute($fieldName, array $options = [])
{
@@ -2435,7 +2443,7 @@ public function minute($fieldName, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options Array of options
* @return string Completed meridian select input
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-meridian-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-meridian-inputs
*/
public function meridian($fieldName, array $options = [])
{
@@ -2487,7 +2495,7 @@ public function meridian($fieldName, array $options = [])
* @param string $fieldName Prefix name for the SELECT element
* @param array $options Array of Options
* @return string Generated set of select boxes for the date and time formats chosen.
- * @link https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-date-and-time-inputs
+ * @link https://book.cakephp.org/3/en/views/helpers/form.html#creating-date-and-time-inputs
*/
public function dateTime($fieldName, array $options = [])
{
@@ -2525,10 +2533,10 @@ protected function _datetimeOptions($options)
$options[$type] = [];
}
- // Pass empty options to each type.
- if (!empty($options['empty']) &&
- is_array($options[$type])
- ) {
+ // Pass boolean/scalar empty options to each type.
+ if (is_array($options[$type]) && isset($options['empty']) && !is_array($options['empty'])) {
+ $options[$type]['empty'] = $options['empty'];
+ } elseif (is_array($options[$type]) && !empty($options['empty'])) {
$options[$type]['empty'] = $options['empty'];
}
@@ -2956,7 +2964,7 @@ public function getSourceValue($fieldname, $options = [])
{
$valueMap = [
'data' => 'getData',
- 'query' => 'getQuery'
+ 'query' => 'getQuery',
];
foreach ($this->getValueSources() as $valuesSource) {
if ($valuesSource === 'context') {
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php
index c27745aea..6eb4619d1 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/HtmlHelper.php
@@ -26,11 +26,10 @@
* HtmlHelper encloses all methods needed while working with HTML pages.
*
* @property \Cake\View\Helper\UrlHelper $Url
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html
*/
class HtmlHelper extends Helper
{
-
use StringTemplateTrait;
/**
@@ -82,8 +81,8 @@ class HtmlHelper extends Helper
'javascriptstart' => '',
'javascriptend' => '',
- 'confirmJs' => '{{confirm}}'
- ]
+ 'confirmJs' => '{{confirm}}',
+ ],
];
/**
@@ -121,7 +120,7 @@ class HtmlHelper extends Helper
'xhtml-strict' => '',
'xhtml-trans' => '',
'xhtml-frame' => '',
- 'xhtml11' => ''
+ 'xhtml11' => '',
];
/**
@@ -154,7 +153,7 @@ public function __construct(View $View, array $config = [])
* @param array $options Link attributes e.g. ['id' => 'selected']
* @return $this
* @see \Cake\View\Helper\HtmlHelper::link() for details on $options that can be used.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
* @deprecated 3.3.6 Use the BreadcrumbsHelper instead
*/
public function addCrumb($name, $link = null, array $options = [])
@@ -185,10 +184,13 @@ public function addCrumb($name, $link = null, array $options = [])
*
* @param string $type Doctype to use.
* @return string|null Doctype string
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-doctype-tags
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-doctype-tags
+ * @deprecated 3.9.0 This method will be removed in 4.0.0.
*/
public function docType($type = 'html5')
{
+ deprecationWarning('HtmlHelper::docType() is deprecated and will be removed in 4.0.0');
+
if (isset($this->_docTypes[$type])) {
return $this->_docTypes[$type];
}
@@ -234,7 +236,7 @@ public function docType($type = 'html5')
* @param array $options Other attributes for the generated tag. If the type attribute is html,
* rss, atom, or icon, the mime-type is returned.
* @return string|null A completed `` element, or null if the element was sent to a block.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-meta-tags
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-meta-tags
*/
public function meta($type, $content = null, array $options = [])
{
@@ -251,7 +253,7 @@ public function meta($type, $content = null, array $options = [])
'next' => ['rel' => 'next', 'link' => $content],
'prev' => ['rel' => 'prev', 'link' => $content],
'first' => ['rel' => 'first', 'link' => $content],
- 'last' => ['rel' => 'last', 'link' => $content]
+ 'last' => ['rel' => 'last', 'link' => $content],
];
if ($type === 'icon' && $content === null) {
@@ -278,21 +280,25 @@ public function meta($type, $content = null, array $options = [])
$out = null;
if (isset($options['link'])) {
- $options['link'] = $this->Url->assetUrl($options['link']);
+ if (is_array($options['link'])) {
+ $options['link'] = $this->Url->build($options['link']);
+ } else {
+ $options['link'] = $this->Url->assetUrl($options['link']);
+ }
if (isset($options['rel']) && $options['rel'] === 'icon') {
$out = $this->formatTemplate('metalink', [
'url' => $options['link'],
- 'attrs' => $this->templater()->formatAttributes($options, ['block', 'link'])
+ 'attrs' => $this->templater()->formatAttributes($options, ['block', 'link']),
]);
$options['rel'] = 'shortcut icon';
}
$out .= $this->formatTemplate('metalink', [
'url' => $options['link'],
- 'attrs' => $this->templater()->formatAttributes($options, ['block', 'link'])
+ 'attrs' => $this->templater()->formatAttributes($options, ['block', 'link']),
]);
} else {
$out = $this->formatTemplate('meta', [
- 'attrs' => $this->templater()->formatAttributes($options, ['block', 'type'])
+ 'attrs' => $this->templater()->formatAttributes($options, ['block', 'type']),
]);
}
@@ -311,7 +317,7 @@ public function meta($type, $content = null, array $options = [])
* @param string|null $charset The character set to be used in the meta tag. If empty,
* The App.encoding value will be used. Example: "utf-8".
* @return string A meta tag containing the specified character set.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-charset-tags
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-charset-tags
*/
public function charset($charset = null)
{
@@ -320,7 +326,7 @@ public function charset($charset = null)
}
return $this->formatTemplate('charset', [
- 'charset' => !empty($charset) ? $charset : 'utf-8'
+ 'charset' => !empty($charset) ? $charset : 'utf-8',
]);
}
@@ -346,7 +352,7 @@ public function charset($charset = null)
* external URL (starts with http://)
* @param array $options Array of options and HTML attributes.
* @return string An `` element.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-links
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-links
*/
public function link($title, $url = null, array $options = [])
{
@@ -384,14 +390,14 @@ public function link($title, $url = null, array $options = [])
$confirm = $this->_confirm($confirmMessage, 'return true;', 'return false;', $options);
$options['onclick'] = $templater->format('confirmJs', [
'confirmMessage' => $this->_cleanConfirmMessage($confirmMessage),
- 'confirm' => $confirm
+ 'confirm' => $confirm,
]);
}
return $templater->format('link', [
'url' => $url,
'attrs' => $templater->formatAttributes($options),
- 'content' => $title
+ 'content' => $title,
]);
}
@@ -440,7 +446,7 @@ public function link($title, $url = null, array $options = [])
* of your application. Otherwise, the path will be relative to your CSS path, usually webroot/css.
* @param array $options Array of options and HTML arguments.
* @return string|null CSS `` or `` tag, depending on the type of link.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#linking-to-css-files
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#linking-to-css-files
*/
public function css($path, array $options = [])
{
@@ -492,6 +498,8 @@ public function css($path, array $options = [])
$options['block'] = __FUNCTION__;
}
$this->_View->append($options['block'], $out);
+
+ return null;
}
/**
@@ -533,7 +541,7 @@ public function css($path, array $options = [])
* @param array $options Array of options, and html attributes see above.
* @return string|null String of `` tags or null if block is specified in options
* or if $once is true and the file has been included before.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#linking-to-javascript-files
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#linking-to-javascript-files
*/
public function script($url, array $options = [])
{
@@ -573,6 +581,8 @@ public function script($url, array $options = [])
$options['block'] = __FUNCTION__;
}
$this->_View->append($options['block'], $out);
+
+ return null;
}
/**
@@ -589,7 +599,7 @@ public function script($url, array $options = [])
* @param array $options The options to use. Options not listed above will be
* treated as HTML attributes.
* @return string|null String or null depending on the value of `$options['block']`
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-inline-javascript-blocks
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-inline-javascript-blocks
*/
public function scriptBlock($script, array $options = [])
{
@@ -601,7 +611,7 @@ public function scriptBlock($script, array $options = [])
$out = $this->formatTemplate('javascriptblock', [
'attrs' => $this->templater()->formatAttributes($options, ['block']),
- 'content' => $script
+ 'content' => $script,
]);
if (empty($options['block'])) {
@@ -611,6 +621,8 @@ public function scriptBlock($script, array $options = [])
$options['block'] = 'script';
}
$this->_View->append($options['block'], $out);
+
+ return null;
}
/**
@@ -627,7 +639,7 @@ public function scriptBlock($script, array $options = [])
*
* @param array $options Options for the code block.
* @return void
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-inline-javascript-blocks
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-inline-javascript-blocks
*/
public function scriptStart(array $options = [])
{
@@ -641,7 +653,7 @@ public function scriptStart(array $options = [])
* the settings used when the scriptBlock was started
*
* @return string|null Depending on the settings of scriptStart() either a script tag or null
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-inline-javascript-blocks
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-inline-javascript-blocks
*/
public function scriptEnd()
{
@@ -667,7 +679,7 @@ public function scriptEnd()
* @param array $data Style data array, keys will be used as property names, values as property values.
* @param bool $oneLine Whether or not the style block should be displayed on one line.
* @return string CSS styling data
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-css-programatically
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-css-programatically
*/
public function style(array $data, $oneLine = true)
{
@@ -696,7 +708,7 @@ public function style(array $data, $oneLine = true)
* @param string|array|bool $startText This will be the first crumb, if false it defaults to first crumb in array. Can
* also be an array, see above for details.
* @return string|null Composed bread crumbs
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
* @deprecated 3.3.6 Use the BreadcrumbsHelper instead
*/
public function getCrumbs($separator = '»', $startText = false)
@@ -740,7 +752,7 @@ public function getCrumbs($separator = '»', $startText = false)
* @param string|array|bool $startText This will be the first crumb, if false it defaults to first crumb in array. Can
* also be an array, see `HtmlHelper::getCrumbs` for details.
* @return string|null Breadcrumbs HTML list.
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
* @deprecated 3.3.6 Use the BreadcrumbsHelper instead
*/
public function getCrumbList(array $options = [], $startText = false)
@@ -783,13 +795,13 @@ public function getCrumbList(array $options = [], $startText = false)
}
$result .= $this->formatTemplate('li', [
'content' => $elementContent,
- 'attrs' => $this->templater()->formatAttributes($options)
+ 'attrs' => $this->templater()->formatAttributes($options),
]);
}
return $this->formatTemplate('ul', [
'content' => $result,
- 'attrs' => $this->templater()->formatAttributes($ulOptions)
+ 'attrs' => $this->templater()->formatAttributes($ulOptions),
]);
}
@@ -813,7 +825,7 @@ protected function _prepareCrumbs($startText, $escape = true)
if (!is_array($startText)) {
$startText = [
'url' => '/',
- 'text' => $startText
+ 'text' => $startText,
];
}
$startText += ['url' => '/', 'text' => __d('cake', 'Home')];
@@ -851,14 +863,18 @@ protected function _prepareCrumbs($startText, $escape = true)
* - `fullBase` If true the src attribute will get a full address for the image file.
* - `plugin` False value will prevent parsing path as a plugin
*
- * @param string|array $path Path to the image file, relative to the app/webroot/img/ directory.
+ * @param string|array $path Path to the image file, relative to the webroot/img/ directory.
* @param array $options Array of HTML attributes. See above for special options.
* @return string completed img tag
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#linking-to-images
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#linking-to-images
*/
public function image($path, array $options = [])
{
- $path = $this->Url->image($path, $options);
+ if (is_string($path)) {
+ $path = $this->Url->image($path, $options);
+ } else {
+ $path = $this->Url->build($path, $options);
+ }
$options = array_diff_key($options, ['fullBase' => null, 'pathPrefix' => null]);
if (!isset($options['alt'])) {
@@ -881,7 +897,7 @@ public function image($path, array $options = [])
return $templater->format('link', [
'url' => $this->Url->build($url),
'attrs' => null,
- 'content' => $image
+ 'content' => $image,
]);
}
@@ -891,28 +907,32 @@ public function image($path, array $options = [])
/**
* Returns a row of formatted and named TABLE headers.
*
- * @param array $names Array of tablenames. Each tablename also can be a key that points to an array with a set
+ * @param array $names Array of tablenames. Each tablename can be string, or array with name and an array with a set
* of attributes to its specific tag
* @param array|null $trOptions HTML options for TR elements.
* @param array|null $thOptions HTML options for TH elements.
* @return string Completed table headers
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-table-headings
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-table-headings
*/
public function tableHeaders(array $names, array $trOptions = null, array $thOptions = null)
{
$out = [];
foreach ($names as $arg) {
if (!is_array($arg)) {
- $out[] = $this->formatTemplate('tableheader', [
- 'attrs' => $this->templater()->formatAttributes($thOptions),
- 'content' => $arg
- ]);
+ $content = $arg;
+ $attrs = $thOptions;
+ } elseif (isset($arg[0], $arg[1])) {
+ $content = $arg[0];
+ $attrs = $arg[1];
} else {
- $out[] = $this->formatTemplate('tableheader', [
- 'attrs' => $this->templater()->formatAttributes(current($arg)),
- 'content' => key($arg)
- ]);
+ $content = key($arg);
+ $attrs = current($arg);
}
+
+ $out[] = $this->formatTemplate('tableheader', [
+ 'attrs' => $this->templater()->formatAttributes($attrs),
+ 'content' => $content,
+ ]);
}
return $this->tableRow(implode(' ', $out), (array)$trOptions);
@@ -928,7 +948,7 @@ public function tableHeaders(array $names, array $trOptions = null, array $thOpt
* @param bool $continueOddEven If false, will use a non-static $count variable,
* so that the odd/even count is reset to zero just for that call.
* @return string Formatted HTML
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-table-cells
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-table-cells
*/
public function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCount = false, $continueOddEven = true)
{
@@ -1011,7 +1031,7 @@ public function tableRow($content, array $options = [])
{
return $this->formatTemplate('tablerow', [
'attrs' => $this->templater()->formatAttributes($options),
- 'content' => $content
+ 'content' => $content,
]);
}
@@ -1026,7 +1046,7 @@ public function tableCell($content, array $options = [])
{
return $this->formatTemplate('tablecell', [
'attrs' => $this->templater()->formatAttributes($options),
- 'content' => $content
+ 'content' => $content,
]);
}
@@ -1104,7 +1124,7 @@ public function para($class, $text, array $options = [])
if (!empty($options['escape'])) {
$text = h($text);
}
- if ($class && !empty($class)) {
+ if ($class) {
$options['class'] = $class;
}
$tag = 'para';
@@ -1183,7 +1203,7 @@ public function media($path, array $options = [])
$options += [
'tag' => null,
'pathPrefix' => 'files/',
- 'text' => ''
+ 'text' => '',
];
if (!empty($options['tag'])) {
@@ -1207,7 +1227,7 @@ public function media($path, array $options = [])
$source['src'] = $this->Url->assetUrl($source['src'], $options);
$sourceTags .= $this->formatTemplate('tagselfclosing', [
'tag' => 'source',
- 'attrs' => $this->templater()->formatAttributes($source)
+ 'attrs' => $this->templater()->formatAttributes($source),
]);
}
unset($source);
@@ -1242,7 +1262,7 @@ public function media($path, array $options = [])
'tag' => null,
'fullBase' => null,
'pathPrefix' => null,
- 'text' => null
+ 'text' => null,
]);
return $this->tag($tag, $text, $options);
@@ -1264,7 +1284,7 @@ public function media($path, array $options = [])
* @param array $options Options and additional HTML attributes of the list (ol/ul) tag.
* @param array $itemOptions Options and additional HTML attributes of the list item (LI) tag.
* @return string The nested list
- * @link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-nested-lists
+ * @link https://book.cakephp.org/3/en/views/helpers/html.html#creating-nested-lists
*/
public function nestedList(array $list, array $options = [], array $itemOptions = [])
{
@@ -1273,7 +1293,7 @@ public function nestedList(array $list, array $options = [], array $itemOptions
return $this->formatTemplate($options['tag'], [
'attrs' => $this->templater()->formatAttributes($options, ['tag']),
- 'content' => $items
+ 'content' => $items,
]);
}
@@ -1302,7 +1322,7 @@ protected function _nestedListItem($items, $options, $itemOptions)
}
$out .= $this->formatTemplate('li', [
'attrs' => $this->templater()->formatAttributes($itemOptions, ['even', 'odd']),
- 'content' => $item
+ 'content' => $item,
]);
$index++;
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/IdGeneratorTrait.php b/app/vendor/cakephp/cakephp/src/View/Helper/IdGeneratorTrait.php
index 663e82d05..f3cec7680 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/IdGeneratorTrait.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/IdGeneratorTrait.php
@@ -22,7 +22,6 @@
*/
trait IdGeneratorTrait
{
-
/**
* Prefix for id attribute.
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/NumberHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/NumberHelper.php
index afe73305b..2120b847a 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/NumberHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/NumberHelper.php
@@ -24,19 +24,18 @@
*
* Methods to make numbers more readable.
*
- * @link https://book.cakephp.org/3.0/en/views/helpers/number.html
+ * @link https://book.cakephp.org/3/en/views/helpers/number.html
* @see \Cake\I18n\Number
*/
class NumberHelper extends Helper
{
-
/**
* Default config for this class
*
* @var array
*/
protected $_defaultConfig = [
- 'engine' => 'Cake\I18n\Number'
+ 'engine' => 'Cake\I18n\Number',
];
/**
@@ -89,13 +88,14 @@ public function __call($method, $params)
*
* @param float $number A floating point number.
* @param int $precision The precision of the returned number.
+ * @param array $options Additional options.
* @return string Formatted float.
* @see \Cake\I18n\Number::precision()
- * @link https://book.cakephp.org/3.0/en/views/helpers/number.html#formatting-floating-point-numbers
+ * @link https://book.cakephp.org/3/en/views/helpers/number.html#formatting-floating-point-numbers
*/
- public function precision($number, $precision = 3)
+ public function precision($number, $precision = 3, array $options = [])
{
- return $this->_engine->precision($number, $precision);
+ return $this->_engine->precision($number, $precision, $options);
}
/**
@@ -104,7 +104,7 @@ public function precision($number, $precision = 3)
* @param int $size Size in bytes
* @return string Human readable size
* @see \Cake\I18n\Number::toReadableSize()
- * @link https://book.cakephp.org/3.0/en/views/helpers/number.html#interacting-with-human-readable-values
+ * @link https://book.cakephp.org/3/en/views/helpers/number.html#interacting-with-human-readable-values
*/
public function toReadableSize($size)
{
@@ -118,12 +118,12 @@ public function toReadableSize($size)
*
* - `multiply`: Multiply the input value by 100 for decimal percentages.
*
- * @param float $number A floating point number
+ * @param float|string $number A floating point number
* @param int $precision The precision of the returned number
* @param array $options Options
* @return string Percentage string
* @see \Cake\I18n\Number::toPercentage()
- * @link https://book.cakephp.org/3.0/en/views/helpers/number.html#formatting-percentages
+ * @link https://book.cakephp.org/3/en/views/helpers/number.html#formatting-percentages
*/
public function toPercentage($number, $precision = 2, array $options = [])
{
@@ -142,10 +142,10 @@ public function toPercentage($number, $precision = 2, array $options = [])
* - `after` - The string to place after decimal numbers, e.g. ']'
* - `escape` - Whether or not to escape html in resulting string
*
- * @param float $number A floating point number.
+ * @param float|string $number A floating point number.
* @param array $options An array with options.
* @return string Formatted number
- * @link https://book.cakephp.org/3.0/en/views/helpers/number.html#formatting-numbers
+ * @link https://book.cakephp.org/3/en/views/helpers/number.html#formatting-numbers
*/
public function format($number, array $options = [])
{
@@ -174,7 +174,7 @@ public function format($number, array $options = [])
* currency code.
* - `escape` - Whether or not to escape html in resulting string
*
- * @param float $number Value to format.
+ * @param float|string $number Value to format.
* @param string|null $currency International currency name such as 'USD', 'EUR', 'JPY', 'CAD'
* @param array $options Options list.
* @return string Number formatted as a currency.
@@ -199,7 +199,7 @@ public function currency($number, $currency = null, array $options = [])
* - `after` - The string to place after decimal numbers, e.g. ']'
* - `escape` - Set to false to prevent escaping
*
- * @param float $value A floating point number
+ * @param float|string $value A floating point number
* @param array $options Options list.
* @return string formatted delta
*/
@@ -214,10 +214,11 @@ public function formatDelta($value, array $options = [])
/**
* Getter/setter for default currency
*
- * @param string|bool $currency Default currency string to be used by currency()
+ * @param string|false|null $currency Default currency string to be used by currency()
* if $currency argument is not provided. If boolean false is passed, it will clear the
- * currently stored value
- * @return string Currency
+ * currently stored value. Null reads the current default.
+ * @return string|null Currency
+ * @deprecated 3.9.0 Use setDefaultCurrency()/getDefaultCurrency() instead.
*/
public function defaultCurrency($currency)
{
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php
index e7f0cccc0..5a3afc73a 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php
@@ -29,11 +29,10 @@
* @property \Cake\View\Helper\NumberHelper $Number
* @property \Cake\View\Helper\HtmlHelper $Html
* @property \Cake\View\Helper\FormHelper $Form
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html
*/
class PaginatorHelper extends Helper
{
-
use StringTemplateTrait;
/**
@@ -80,7 +79,7 @@ class PaginatorHelper extends Helper
'sortDesc' => '{{text}}',
'sortAscLocked' => '{{text}}',
'sortDescLocked' => '{{text}}',
- ]
+ ],
];
/**
@@ -189,7 +188,7 @@ public function options(array $options = [])
*
* @param string|null $model Optional model name. Uses the default if none is specified.
* @return int The current page number of the recordset.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#checking-the-pagination-state
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#checking-the-pagination-state
*/
public function current($model = null)
{
@@ -226,7 +225,7 @@ public function total($model = null)
* @param array $options Options for pagination links. See #options for list of keys.
* @return string|null The name of the key by which the recordset is being sorted, or
* null if the results are not currently sorted.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-sort-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-sort-links
*/
public function sortKey($model = null, array $options = [])
{
@@ -247,7 +246,7 @@ public function sortKey($model = null, array $options = [])
* @param array $options Options for pagination links. See #options for list of keys.
* @return string The direction by which the recordset is being sorted, or
* null if the results are not currently sorted.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-sort-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-sort-links
*/
public function sortDir($model = null, array $options = [])
{
@@ -271,7 +270,7 @@ public function sortDir($model = null, array $options = [])
/**
* Generate an active/inactive link for next/prev methods.
*
- * @param string|bool $text The enabled text for the link.
+ * @param string|false $text The enabled text for the link.
* @param bool $enabled Whether or not the enabled/disabled version should be created.
* @param array $options An array of options from the calling method.
* @param array $templates An array of templates with the 'active' and 'disabled' keys.
@@ -347,7 +346,7 @@ protected function _toggledLink($text, $enabled, $options, $templates)
* @param string $title Title for the link. Defaults to '<< Previous'.
* @param array $options Options for pagination link. See above for list of keys.
* @return string A "previous" link or a disabled link.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-jump-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-jump-links
*/
public function prev($title = '<< Previous', array $options = [])
{
@@ -363,7 +362,7 @@ public function prev($title = '<< Previous', array $options = [])
$enabled = $this->hasPrev($options['model']);
$templates = [
'active' => 'prevActive',
- 'disabled' => 'prevDisabled'
+ 'disabled' => 'prevDisabled',
];
return $this->_toggledLink($title, $enabled, $options, $templates);
@@ -387,7 +386,7 @@ public function prev($title = '<< Previous', array $options = [])
* @param string $title Title for the link. Defaults to 'Next >>'.
* @param array $options Options for pagination link. See above for list of keys.
* @return string A "next" link or $disabledTitle text if the link is disabled.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-jump-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-jump-links
*/
public function next($title = 'Next >>', array $options = [])
{
@@ -403,7 +402,7 @@ public function next($title = 'Next >>', array $options = [])
$enabled = $this->hasNext($options['model']);
$templates = [
'active' => 'nextActive',
- 'disabled' => 'nextDisabled'
+ 'disabled' => 'nextDisabled',
];
return $this->_toggledLink($title, $enabled, $options, $templates);
@@ -421,12 +420,13 @@ public function next($title = 'Next >>', array $options = [])
* - `lock` Lock direction. Will only use the default direction then, defaults to false.
*
* @param string $key The name of the key that the recordset should be sorted.
- * @param string|null $title Title for the link. If $title is null $key will be used
- * for the title and will be generated by inflection.
+ * @param string|array|null $title Title for the link. If $title is null $key will be used
+ * for the title and will be generated by inflection. It can also be an array
+ * with keys `asc` and `desc` for specifying separate titles based on the direction.
* @param array $options Options for sorting link. See above for list of keys.
* @return string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified
* key the returned link will sort by 'desc'.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-sort-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-sort-links
*/
public function sort($key, $title = null, array $options = [])
{
@@ -505,7 +505,7 @@ public function sort($key, $title = null, array $options = [])
* @param array $urlOptions Array of options
* The bool version of this argument is *deprecated* and will be removed in 4.0.0
* @return string By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#generating-pagination-urls
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#generating-pagination-urls
*/
public function generateUrl(array $options = [], $model = null, $urlOptions = [])
{
@@ -519,7 +519,7 @@ public function generateUrl(array $options = [], $model = null, $urlOptions = []
}
$urlOptions += [
'escape' => true,
- 'fullBase' => false
+ 'fullBase' => false,
];
return $this->Url->build($this->generateUrlParams($options, $model), $urlOptions);
@@ -565,7 +565,8 @@ public function generateUrlParams(array $options = [], $model = null)
$url['page'] = false;
}
- if (isset($paging['sortDefault'], $paging['directionDefault'], $url['sort'], $url['direction']) &&
+ if (
+ isset($paging['sortDefault'], $paging['directionDefault'], $url['sort'], $url['direction']) &&
$url['sort'] === $paging['sortDefault'] &&
strtolower($url['direction']) === strtolower($paging['directionDefault'])
) {
@@ -624,7 +625,7 @@ protected function _removeAlias($field, $model = null)
*
* @param string|null $model Optional model name. Uses the default if none is specified.
* @return bool True if the result set is not at the first page.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#checking-the-pagination-state
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#checking-the-pagination-state
*/
public function hasPrev($model = null)
{
@@ -636,7 +637,7 @@ public function hasPrev($model = null)
*
* @param string|null $model Optional model name. Uses the default if none is specified.
* @return bool True if the result set is not at the last page.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#checking-the-pagination-state
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#checking-the-pagination-state
*/
public function hasNext($model = null)
{
@@ -649,7 +650,7 @@ public function hasNext($model = null)
* @param string|null $model Optional model name. Uses the default if none is specified.
* @param int $page The page number - if not set defaults to 1.
* @return bool True if the given result set has the specified page number.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#checking-the-pagination-state
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#checking-the-pagination-state
*/
public function hasPage($model = null, $page = 1)
{
@@ -715,7 +716,7 @@ public function defaultModel($model = null)
* @param string|array $options Options for the counter string. See #options for list of keys.
* If string it will be used as format.
* @return string Counter string.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-a-page-counter
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-a-page-counter
*/
public function counter($options = [])
{
@@ -748,11 +749,11 @@ public function counter($options = [])
'current' => $paging['current'],
'count' => $paging['count'],
'start' => $paging['start'],
- 'end' => $paging['end']
+ 'end' => $paging['end'],
]);
$map += [
- 'model' => strtolower(Inflector::humanize(Inflector::tableize($options['model'])))
+ 'model' => strtolower(Inflector::humanize(Inflector::tableize($options['model']))),
];
return $this->templater()->format($template, $map);
@@ -792,13 +793,13 @@ public function counter($options = [])
*
* @param array $options Options for the numbers.
* @return string|false Numbers string.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-page-number-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-page-number-links
*/
public function numbers(array $options = [])
{
$defaults = [
'before' => null, 'after' => null, 'model' => $this->defaultModel(),
- 'modulus' => 8, 'first' => null, 'last' => null, 'url' => []
+ 'modulus' => 8, 'first' => null, 'last' => null, 'url' => [],
];
$options += $defaults;
@@ -1046,14 +1047,14 @@ protected function _numbers($templater, $params, $options)
* you want at the beginning of the range.
* @param array $options An array of options.
* @return string|false Numbers string.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-jump-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-jump-links
*/
public function first($first = '<< first', array $options = [])
{
$options += [
'url' => [],
'model' => $this->defaultModel(),
- 'escape' => true
+ 'escape' => true,
];
$params = $this->params($options['model']);
@@ -1069,14 +1070,15 @@ public function first($first = '<< first', array $options = [])
$url = array_merge($options['url'], ['page' => $i]);
$out .= $this->templater()->format('number', [
'url' => $this->generateUrl($url, $options['model']),
- 'text' => $this->Number->format($i)
+ 'text' => $this->Number->format($i),
]);
}
} elseif ($params['page'] > 1 && is_string($first)) {
$first = $options['escape'] ? h($first) : $first;
+ $url = array_merge($options['url'], ['page' => 1]);
$out .= $this->templater()->format('first', [
- 'url' => $this->generateUrl(['page' => 1], $options['model']),
- 'text' => $first
+ 'url' => $this->generateUrl($url, $options['model']),
+ 'text' => $first,
]);
}
@@ -1107,14 +1109,14 @@ public function first($first = '<< first', array $options = [])
* @param string|int $last if string use as label for the link, if numeric print page numbers
* @param array $options Array of options
* @return string|false Numbers string.
- * @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-jump-links
+ * @link https://book.cakephp.org/3/en/views/helpers/paginator.html#creating-jump-links
*/
public function last($last = 'last >>', array $options = [])
{
$options += [
'model' => $this->defaultModel(),
'escape' => true,
- 'url' => []
+ 'url' => [],
];
$params = $this->params($options['model']);
@@ -1130,14 +1132,15 @@ public function last($last = 'last >>', array $options = [])
$url = array_merge($options['url'], ['page' => $i]);
$out .= $this->templater()->format('number', [
'url' => $this->generateUrl($url, $options['model']),
- 'text' => $this->Number->format($i)
+ 'text' => $this->Number->format($i),
]);
}
} elseif ($params['page'] < $params['pageCount'] && is_string($last)) {
$last = $options['escape'] ? h($last) : $last;
+ $url = array_merge($options['url'], ['page' => $params['pageCount']]);
$out .= $this->templater()->format('last', [
- 'url' => $this->generateUrl(['page' => $params['pageCount']], $options['model']),
- 'text' => $last
+ 'url' => $this->generateUrl($url, $options['model']),
+ 'text' => $last,
]);
}
@@ -1180,7 +1183,7 @@ public function meta(array $options = [])
'prev' => true,
'next' => true,
'first' => false,
- 'last' => false
+ 'last' => false,
];
$model = isset($options['model']) ? $options['model'] : null;
@@ -1261,16 +1264,17 @@ public function limitControl(array $limits = [], $default = null, array $options
$limits = [
'20' => '20',
'50' => '50',
- '100' => '100'
+ '100' => '100',
];
}
$out .= $this->Form->control('limit', $options + [
'type' => 'select',
'label' => __('View'),
- 'value' => $default,
+ 'default' => $default,
+ 'value' => $this->_View->getRequest()->getQuery('limit'),
'options' => $limits,
- 'onChange' => 'this.form.submit()'
+ 'onChange' => 'this.form.submit()',
]);
$out .= $this->Form->end();
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/RssHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/RssHelper.php
index 422952ffe..4e874a36b 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/RssHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/RssHelper.php
@@ -23,12 +23,11 @@
*
* @property \Cake\View\Helper\UrlHelper $Url
* @property \Cake\View\Helper\TimeHelper $Time
- * @link https://book.cakephp.org/3.0/en/views/helpers/rss.html
+ * @link https://book.cakephp.org/3/en/views/helpers/rss.html
* @deprecated 3.5.0 RssHelper is deprecated and will be removed in 4.0.0
*/
class RssHelper extends Helper
{
-
/**
* Helpers used by RSS Helper
*
@@ -93,12 +92,12 @@ class RssHelper extends Helper
public $version = '2.0';
/**
- * {@inheritDoc}
+ * @inheritDoc
*/
- public function __construct(View $view, array $settings = [])
+ public function __construct(View $View, array $config = [])
{
deprecationWarning('RssHelper is deprecated and will be removed in 4.0.0');
- parent::__construct($view, $settings);
+ parent::__construct($View, $config);
}
/**
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/SessionHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/SessionHelper.php
index ad2d4da3d..18905a463 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/SessionHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/SessionHelper.php
@@ -22,12 +22,11 @@
*
* Session reading from the view.
*
- * @link https://book.cakephp.org/3.0/en/views/helpers/session.html
+ * @link https://book.cakephp.org/3/en/views/helpers/session.html
* @deprecated 3.0.2 Use request->session() instead.
*/
class SessionHelper extends Helper
{
-
/**
* Constructor
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php
index 211150adf..a8297d33d 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/TextHelper.php
@@ -26,12 +26,11 @@
* Text manipulations: Highlight, excerpt, truncate, strip of links, convert email addresses to mailto: links...
*
* @property \Cake\View\Helper\HtmlHelper $Html
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html
* @see \Cake\Utility\Text
*/
class TextHelper extends Helper
{
-
/**
* helpers
*
@@ -45,7 +44,7 @@ class TextHelper extends Helper
* @var array
*/
protected $_defaultConfig = [
- 'engine' => 'Cake\Utility\Text'
+ 'engine' => 'Cake\Utility\Text',
];
/**
@@ -111,7 +110,7 @@ public function __call($method, $params)
* @param string $text Text
* @param array $options Array of HTML options, and options listed above.
* @return string The text with links
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#linking-urls
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#linking-urls
*/
public function autoLinkUrls($text, array $options = [])
{
@@ -171,7 +170,7 @@ protected function _insertPlaceHolder($matches)
$key = hash_hmac('sha1', $match, Security::getSalt());
$this->_placeholders[$key] = [
'content' => $match,
- 'envelope' => $envelope
+ 'envelope' => $envelope,
];
return $key;
@@ -229,7 +228,7 @@ protected function _linkEmails($text, $options)
* @param string $text Text
* @param array $options Array of HTML options, and options listed above.
* @return string The text with links
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#linking-email-addresses
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#linking-email-addresses
*/
public function autoLinkEmails($text, array $options = [])
{
@@ -259,7 +258,7 @@ public function autoLinkEmails($text, array $options = [])
* @param string $text Text
* @param array $options Array of HTML options, and options listed above.
* @return string The text with links
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#linking-both-urls-and-email-addresses
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#linking-both-urls-and-email-addresses
*/
public function autoLink($text, array $options = [])
{
@@ -277,7 +276,7 @@ public function autoLink($text, array $options = [])
* @param array $options An array of HTML attributes and options.
* @return string The highlighted text
* @see \Cake\Utility\Text::highlight()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#highlighting-substrings
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#highlighting-substrings
*/
public function highlight($text, $phrase, array $options = [])
{
@@ -291,7 +290,7 @@ public function highlight($text, $phrase, array $options = [])
*
* @param string $text Text
* @return string The text with proper and
tags
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#converting-text-into-paragraphs
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#converting-text-into-paragraphs
*/
public function autoParagraph($text)
{
@@ -315,7 +314,7 @@ public function autoParagraph($text)
* @param string $text Text
* @return string The text without links
* @see \Cake\Utility\Text::stripLinks()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#removing-links
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#removing-links
*/
public function stripLinks($text)
{
@@ -339,7 +338,7 @@ public function stripLinks($text)
* @param array $options An array of HTML attributes and options.
* @return string Trimmed string.
* @see \Cake\Utility\Text::truncate()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#truncating-text
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#truncating-text
*/
public function truncate($text, $length = 100, array $options = [])
{
@@ -362,7 +361,7 @@ public function truncate($text, $length = 100, array $options = [])
* @param array $options An array of HTML attributes and options.
* @return string Trimmed string.
* @see \Cake\Utility\Text::tail()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#truncating-the-tail-of-a-string
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#truncating-the-tail-of-a-string
*/
public function tail($text, $length = 100, array $options = [])
{
@@ -379,7 +378,7 @@ public function tail($text, $length = 100, array $options = [])
* @param string $ending Ending that will be appended
* @return string Modified string
* @see \Cake\Utility\Text::excerpt()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#extracting-an-excerpt
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#extracting-an-excerpt
*/
public function excerpt($text, $phrase, $radius = 100, $ending = '...')
{
@@ -394,13 +393,39 @@ public function excerpt($text, $phrase, $radius = 100, $ending = '...')
* @param string $separator The separator used to join all the other items together. Defaults to ', '.
* @return string The glued together string.
* @see \Cake\Utility\Text::toList()
- * @link https://book.cakephp.org/3.0/en/views/helpers/text.html#converting-an-array-to-sentence-form
+ * @link https://book.cakephp.org/3/en/views/helpers/text.html#converting-an-array-to-sentence-form
*/
public function toList($list, $and = null, $separator = ', ')
{
return $this->_engine->toList($list, $and, $separator);
}
+ /**
+ * Returns a string with all spaces converted to dashes (by default),
+ * characters transliterated to ASCII characters, and non word characters removed.
+ *
+ * ### Options:
+ *
+ * - `replacement`: Replacement string. Default '-'.
+ * - `transliteratorId`: A valid transliterator id string.
+ * If `null` (default) the transliterator (identifier) set via
+ * `Text::setTransliteratorId()` or `Text::setTransliterator()` will be used.
+ * If `false` no transliteration will be done, only non words will be removed.
+ * - `preserve`: Specific non-word character to preserve. Default `null`.
+ * For e.g. this option can be set to '.' to generate clean file names.
+ *
+ * @param string $string the string you want to slug
+ * @param array|string $options If string it will be use as replacement character
+ * or an array of options.
+ * @return string
+ * @see \Cake\Utility\Text::setTransliterator()
+ * @see \Cake\Utility\Text::setTransliteratorId()
+ */
+ public function slug($string, $options = [])
+ {
+ return $this->_engine->slug($string, $options);
+ }
+
/**
* Event listeners.
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/TimeHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/TimeHelper.php
index 817bfd759..1c0e51157 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/TimeHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/TimeHelper.php
@@ -24,12 +24,11 @@
*
* Manipulation of time data.
*
- * @link https://book.cakephp.org/3.0/en/views/helpers/time.html
+ * @link https://book.cakephp.org/3/en/views/helpers/time.html
* @see \Cake\I18n\Time
*/
class TimeHelper extends Helper
{
-
use StringTemplateTrait;
/**
@@ -38,7 +37,7 @@ class TimeHelper extends Helper
* @var array
*/
protected $_defaultConfig = [
- 'outputTimezone' => null
+ 'outputTimezone' => null,
];
/**
@@ -46,8 +45,8 @@ class TimeHelper extends Helper
*
* Will use the provided timezone, or default output timezone if defined.
*
- * @param null|string|\DateTimeZone $timezone The override timezone if applicable.
- * @return null|string|\DateTimeZone The chosen timezone or null.
+ * @param \DateTimeZone|string|null $timezone The override timezone if applicable.
+ * @return \DateTimeZone|string|null The chosen timezone or null.
*/
protected function _getTimezone($timezone)
{
@@ -163,7 +162,6 @@ public function isThisYear($dateString, $timezone = null)
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
* @return bool True if datetime string was yesterday
- *
*/
public function wasYesterday($dateString, $timezone = null)
{
@@ -187,7 +185,7 @@ public function isTomorrow($dateString, $timezone = null)
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param bool $range if true returns a range in Y-m-d format
- * @return int|array 1, 2, 3, or 4 quarter of year or array if $range true
+ * @return string[]|int 1, 2, 3, or 4 quarter of year or array if $range true
* @see \Cake\I18n\Time::toQuarter()
*/
public function toQuarter($dateString, $range = false)
@@ -258,7 +256,7 @@ public function timeAgoInWords($dateTime, array $options = [])
$element = null;
$options += [
'element' => null,
- 'timezone' => null
+ 'timezone' => null,
];
$options['timezone'] = $this->_getTimezone($options['timezone']);
if ($options['timezone']) {
@@ -270,7 +268,7 @@ public function timeAgoInWords($dateTime, array $options = [])
$element = [
'tag' => 'span',
'class' => 'time-ago-in-words',
- 'title' => $dateTime
+ 'title' => $dateTime,
];
if (is_array($options['element'])) {
@@ -345,11 +343,13 @@ public function gmt($string = null)
*
* This method is an alias for TimeHelper::i18nFormat().
*
- * @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
- * @param int|string|null $format date format string (or a UNIX timestamp, strtotime() valid string or DateTime object)
- * @param bool|string $invalid Default value to display on invalid dates
+ * @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string
+ * or DateTime object (or a date format string).
+ * @param int|string|null $format date format string (or a UNIX timestamp,
+ * strtotime() valid string or DateTime object).
+ * @param string|false $invalid Default value to display on invalid dates
* @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
- * @return string Formatted and translated date string
+ * @return string|int|false Formatted and translated date string
* @see \Cake\I18n\Time::i18nFormat()
*/
public function format($date, $format = null, $invalid = false, $timezone = null)
@@ -361,11 +361,11 @@ public function format($date, $format = null, $invalid = false, $timezone = null
* Returns a formatted date string, given either a Datetime instance,
* UNIX timestamp or a valid strtotime() date string.
*
- * @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object
- * @param string|null $format Intl compatible format string.
- * @param bool|string $invalid Default value to display on invalid dates
+ * @param int|string|\DateTimeInterface|null $date UNIX timestamp, strtotime() valid string or DateTime object
+ * @param string|int|null $format Intl compatible format string.
+ * @param string|false $invalid Default value to display on invalid dates
* @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
- * @return string|false Formatted and translated date string or value for `$invalid` on failure.
+ * @return string|int|false Formatted and translated date string or value for `$invalid` on failure.
* @throws \Exception When the date cannot be parsed
* @see \Cake\I18n\Time::i18nFormat()
*/
diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/UrlHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/UrlHelper.php
index 63ca1dcb8..e3c1cbf00 100644
--- a/app/vendor/cakephp/cakephp/src/View/Helper/UrlHelper.php
+++ b/app/vendor/cakephp/cakephp/src/View/Helper/UrlHelper.php
@@ -25,7 +25,6 @@
*/
class UrlHelper extends Helper
{
-
/**
* Returns a URL based on provided parameters.
*
@@ -175,10 +174,11 @@ public function assetUrl($path, array $options = [])
if (!array_key_exists('plugin', $options) || $options['plugin'] !== false) {
list($plugin, $path) = $this->_View->pluginSplit($path, false);
}
- if (!empty($options['pathPrefix']) && $path[0] !== '/') {
+ if (!empty($options['pathPrefix']) && (substr((string)$path, 0, 1) !== '/')) {
$path = $options['pathPrefix'] . $path;
}
- if (!empty($options['ext']) &&
+ if (
+ !empty($options['ext']) &&
strpos($path, '?') === false &&
substr($path, -strlen($options['ext'])) !== $options['ext']
) {
@@ -237,11 +237,15 @@ protected function _encodeUrl($url)
*/
public function assetTimestamp($path, $timestamp = null)
{
+ if (strpos($path, '?') !== false) {
+ return $path;
+ }
+
if ($timestamp === null) {
$timestamp = Configure::read('Asset.timestamp');
}
$timestampEnabled = $timestamp === 'force' || ($timestamp === true && Configure::read('debug'));
- if ($timestampEnabled && strpos($path, '?') === false) {
+ if ($timestampEnabled) {
$filepath = preg_replace(
'/^' . preg_quote($this->_View->getRequest()->getAttribute('webroot'), '/') . '/',
'',
diff --git a/app/vendor/cakephp/cakephp/src/View/HelperRegistry.php b/app/vendor/cakephp/cakephp/src/View/HelperRegistry.php
index b3eb0f38d..87c1bf4ac 100644
--- a/app/vendor/cakephp/cakephp/src/View/HelperRegistry.php
+++ b/app/vendor/cakephp/cakephp/src/View/HelperRegistry.php
@@ -26,7 +26,6 @@
*/
class HelperRegistry extends ObjectRegistry implements EventDispatcherInterface
{
-
use EventDispatcherTrait;
/**
@@ -118,7 +117,7 @@ protected function _resolveClassName($class)
* and Cake\Core\ObjectRegistry::unload()
*
* @param string $class The classname that is missing.
- * @param string $plugin The plugin the helper is missing in.
+ * @param string|null $plugin The plugin the helper is missing in.
* @return void
* @throws \Cake\View\Exception\MissingHelperException
*/
@@ -126,7 +125,7 @@ protected function _throwMissingClassError($class, $plugin)
{
throw new MissingHelperException([
'class' => $class . 'Helper',
- 'plugin' => $plugin
+ 'plugin' => $plugin,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/View/JsonView.php b/app/vendor/cakephp/cakephp/src/View/JsonView.php
index 0dfa7ed1a..1d3de40f6 100644
--- a/app/vendor/cakephp/cakephp/src/View/JsonView.php
+++ b/app/vendor/cakephp/cakephp/src/View/JsonView.php
@@ -55,7 +55,6 @@
*/
class JsonView extends SerializedView
{
-
/**
* JSON layouts are located in the json sub directory of `Layouts/`
*
diff --git a/app/vendor/cakephp/cakephp/src/View/SerializedView.php b/app/vendor/cakephp/cakephp/src/View/SerializedView.php
index bed8513a2..857b33d99 100644
--- a/app/vendor/cakephp/cakephp/src/View/SerializedView.php
+++ b/app/vendor/cakephp/cakephp/src/View/SerializedView.php
@@ -24,7 +24,6 @@
*/
abstract class SerializedView extends View
{
-
/**
* Response type.
*
@@ -55,13 +54,15 @@ public function __construct(
/**
* Load helpers only if serialization is disabled.
*
- * @return void
+ * @return $this
*/
public function loadHelpers()
{
if (empty($this->viewVars['_serialize'])) {
parent::loadHelpers();
}
+
+ return $this;
}
/**
@@ -82,7 +83,7 @@ abstract protected function _serialize($serialize);
* names. If true all view variables will be serialized. If unset normal
* view template will be rendered.
*
- * @param string|bool|null $view The view being rendered.
+ * @param string|false|null $view The view being rendered.
* @param string|null $layout The layout being rendered.
* @return string|null The rendered view.
*/
diff --git a/app/vendor/cakephp/cakephp/src/View/StringTemplate.php b/app/vendor/cakephp/cakephp/src/View/StringTemplate.php
index e45e8a7ee..2b3d58d80 100644
--- a/app/vendor/cakephp/cakephp/src/View/StringTemplate.php
+++ b/app/vendor/cakephp/cakephp/src/View/StringTemplate.php
@@ -28,7 +28,6 @@
*/
class StringTemplate
{
-
use InstanceConfigTrait {
getConfig as get;
}
@@ -122,7 +121,7 @@ public function push()
{
$this->_configStack[] = [
$this->_config,
- $this->_compiled
+ $this->_compiled,
];
}
@@ -183,7 +182,7 @@ protected function _compileTemplates(array $templates = [])
preg_match_all('#\{\{([\w\._]+)\}\}#', $template, $matches);
$this->_compiled[$name] = [
str_replace($matches[0], '%s', $template),
- $matches[1]
+ $matches[1],
];
}
}
@@ -301,7 +300,7 @@ public function formatAttributes($options, $exclude = null)
* Works with minimized attributes that have the same value as their name such as 'disabled' and 'checked'
*
* @param string $key The name of the attribute to create
- * @param string|array $value The value of the attribute to create.
+ * @param string|string[] $value The value of the attribute to create.
* @param bool $escape Define if the value must be escaped
* @return string The composed attribute.
*/
diff --git a/app/vendor/cakephp/cakephp/src/View/StringTemplateTrait.php b/app/vendor/cakephp/cakephp/src/View/StringTemplateTrait.php
index b61369387..499681a39 100644
--- a/app/vendor/cakephp/cakephp/src/View/StringTemplateTrait.php
+++ b/app/vendor/cakephp/cakephp/src/View/StringTemplateTrait.php
@@ -24,7 +24,6 @@
*/
trait StringTemplateTrait
{
-
/**
* StringTemplate instance.
*
@@ -60,7 +59,7 @@ public function getTemplates($template = null)
* Gets/sets templates to use.
*
* @deprecated 3.4.0 Use setTemplates()/getTemplates() instead.
- * @param string|null|array $templates null or string allow reading templates. An array
+ * @param string|array|null $templates null or string allow reading templates. An array
* allows templates to be added.
* @return $this|string|array
*/
diff --git a/app/vendor/cakephp/cakephp/src/View/View.php b/app/vendor/cakephp/cakephp/src/View/View.php
index 46dcca7d8..8f80b70be 100644
--- a/app/vendor/cakephp/cakephp/src/View/View.php
+++ b/app/vendor/cakephp/cakephp/src/View/View.php
@@ -30,6 +30,7 @@
use Cake\View\Exception\MissingHelperException;
use Cake\View\Exception\MissingLayoutException;
use Cake\View\Exception\MissingTemplateException;
+use Exception;
use InvalidArgumentException;
use LogicException;
use RuntimeException;
@@ -74,7 +75,6 @@
*/
class View implements EventDispatcherInterface
{
-
use CellTrait {
cell as public;
}
@@ -198,7 +198,7 @@ class View implements EventDispatcherInterface
/**
* List of generated DOM UUIDs.
*
- * @var array
+ * @var string[]
* @deprecated 3.7.0 The property is deprecated and will be removed in 4.0.0.
*/
public $uuids = [];
@@ -236,27 +236,27 @@ class View implements EventDispatcherInterface
*/
protected $_passedVars = [
'viewVars', 'autoLayout', 'helpers', 'template', 'layout', 'name', 'theme',
- 'layoutPath', 'templatePath', 'plugin', 'passedArgs'
+ 'layoutPath', 'templatePath', 'plugin', 'passedArgs',
];
/**
* Holds an array of paths.
*
- * @var array
+ * @var string[]
*/
protected $_paths = [];
/**
* Holds an array of plugin paths.
*
- * @var array
+ * @var string[][]
*/
protected $_pathsForPlugin = [];
/**
* The names of views and their parents used with View::extend();
*
- * @var array
+ * @var string[]
*/
protected $_parents = [];
@@ -367,7 +367,7 @@ public function __construct(
$this->request = new ServerRequest([
'base' => '',
'url' => '',
- 'webroot' => '/'
+ 'webroot' => '/',
]);
}
$this->Blocks = new $this->_viewBlockClass();
@@ -815,8 +815,20 @@ public function cache(callable $block, array $options = [])
if ($result) {
return $result;
}
+
+ $bufferLevel = ob_get_level();
ob_start();
- $block();
+
+ try {
+ $block();
+ } catch (Exception $exception) {
+ while (ob_get_level() > $bufferLevel) {
+ ob_end_clean();
+ }
+
+ throw $exception;
+ }
+
$result = ob_get_clean();
Cache::write($options['key'], $result, $options['config']);
@@ -899,7 +911,7 @@ public function render($view = null, $layout = null)
*
* @param string $content Content to render in a template, wrapped by the surrounding layout.
* @param string|null $layout Layout name
- * @return mixed Rendered output, or false on error
+ * @return string|false Rendered output, or false on error
* @throws \Cake\Core\Exception\Exception if there is an error in the view.
* @triggers View.beforeLayout $this, [$layoutFileName]
* @triggers View.afterLayout $this, [$layoutFileName]
@@ -912,14 +924,14 @@ public function renderLayout($content, $layout = null)
}
if (!empty($content)) {
- $this->Blocks->set('content', $content);
+ $this->Blocks->set('content', $content);
}
$this->dispatchEvent('View.beforeLayout', [$layoutFileName]);
$title = $this->Blocks->get('title');
if ($title === '') {
- $title = Inflector::humanize($this->templatePath);
+ $title = Inflector::humanize(str_replace(DIRECTORY_SEPARATOR, '/', $this->templatePath));
$this->Blocks->set('title', $title);
}
@@ -960,7 +972,7 @@ public function get($var, $default = null)
/**
* Get the names of all the existing blocks.
*
- * @return array An array containing the blocks.
+ * @return string[] An array containing the blocks.
* @see \Cake\View\ViewBlock::keys()
*/
public function blocks()
@@ -1098,7 +1110,6 @@ public function end()
* Check if a block exists
*
* @param string $name Name of the block
- *
* @return bool
*/
public function exists($name)
@@ -1144,7 +1155,7 @@ public function extend($name)
if ($parent == $this->_current) {
throw new LogicException('You cannot have views extend themselves.');
}
- if (isset($this->_parents[$parent]) && $this->_parents[$parent] == $this->_current) {
+ if (isset($this->_parents[$parent]) && $this->_parents[$parent] === $this->_current) {
throw new LogicException('You cannot have views extend in a loop.');
}
$this->_parents[$this->_current] = $parent;
@@ -1326,7 +1337,9 @@ public function __set($name, $value)
'Use the helper registry through View::helpers() to manage helpers.'
);
- return $this->helpers = $value;
+ $this->helpers = $value;
+
+ return;
}
if ($name === 'name') {
@@ -1414,9 +1427,19 @@ protected function _render($viewFile, $data = [])
protected function _evaluate($viewFile, $dataForView)
{
extract($dataForView);
+
+ $bufferLevel = ob_get_level();
ob_start();
- include func_get_arg(0);
+ try {
+ include func_get_arg(0);
+ } catch (Exception $exception) {
+ while (ob_get_level() > $bufferLevel) {
+ ob_end_clean();
+ }
+
+ throw $exception;
+ }
return ob_get_clean();
}
@@ -1674,7 +1697,7 @@ protected function _getLayoutFileName($name = null)
}
}
throw new MissingLayoutException([
- 'file' => $layoutPaths[0] . $name . $this->_ext
+ 'file' => $layoutPaths[0] . $name . $this->_ext,
]);
}
@@ -1738,7 +1761,7 @@ protected function _getSubPaths($basePath)
*
* @param string|null $plugin Optional plugin name to scan for view files.
* @param bool $cached Set to false to force a refresh of view paths. Default true.
- * @return array paths
+ * @return string[] paths
*/
protected function _paths($plugin = null, $cached = true)
{
@@ -1803,26 +1826,27 @@ protected function _elementCache($name, $data, $options)
$plugin = null;
list($plugin, $name) = $this->pluginSplit($name);
- $underscored = null;
+ $pluginKey = null;
if ($plugin) {
- $underscored = Inflector::underscore($plugin);
+ $pluginKey = str_replace('/', '_', Inflector::underscore($plugin));
}
+ $elementKey = str_replace(['\\', '/'], '_', $name);
$cache = $options['cache'];
unset($options['cache'], $options['callbacks'], $options['plugin']);
$keys = array_merge(
- [$underscored, $name],
+ [$pluginKey, $elementKey],
array_keys($options),
array_keys($data)
);
$config = [
'config' => $this->elementCache,
- 'key' => implode('_', $keys)
+ 'key' => implode('_', $keys),
];
if (is_array($cache)) {
$defaults = [
'config' => $this->elementCache,
- 'key' => $config['key']
+ 'key' => $config['key'],
];
$config = $cache + $defaults;
}
diff --git a/app/vendor/cakephp/cakephp/src/View/ViewBlock.php b/app/vendor/cakephp/cakephp/src/View/ViewBlock.php
index 5d4e079d9..4e38bf32b 100644
--- a/app/vendor/cakephp/cakephp/src/View/ViewBlock.php
+++ b/app/vendor/cakephp/cakephp/src/View/ViewBlock.php
@@ -24,7 +24,6 @@
*/
class ViewBlock
{
-
/**
* Override content
*
@@ -217,9 +216,9 @@ public function active()
}
/**
- * Get the names of the unclosed/active blocks.
+ * Get the unclosed/active blocks. Key is name, value is mode.
*
- * @return array An array of unclosed blocks.
+ * @return string[] An array of unclosed blocks.
*/
public function unclosed()
{
diff --git a/app/vendor/cakephp/cakephp/src/View/ViewBuilder.php b/app/vendor/cakephp/cakephp/src/View/ViewBuilder.php
index 9fdcd342c..c6fbbf833 100644
--- a/app/vendor/cakephp/cakephp/src/View/ViewBuilder.php
+++ b/app/vendor/cakephp/cakephp/src/View/ViewBuilder.php
@@ -30,7 +30,6 @@
*/
class ViewBuilder implements JsonSerializable, Serializable
{
-
/**
* The subdirectory to the template.
*
@@ -48,21 +47,21 @@ class ViewBuilder implements JsonSerializable, Serializable
/**
* The plugin name to use.
*
- * @var string|null|false
+ * @var string|false|null
*/
protected $_plugin;
/**
* The theme name to use.
*
- * @var string|null|false
+ * @var string|false|null
*/
protected $_theme;
/**
* The layout name to render.
*
- * @var string|null|false
+ * @var string|false|null
*/
protected $_layout;
@@ -329,7 +328,7 @@ public function autoLayout($enable = null)
*
* `False` to remove current plugin name is deprecated as of 3.4.0. Use directly `null` instead.
*
- * @param string|null|false $name Plugin name.
+ * @param string|false|null $name Plugin name.
* Use null or false to remove the current plugin name.
* @return $this
*/
@@ -343,7 +342,7 @@ public function setPlugin($name)
/**
* Gets the plugin name to use.
*
- * @return string|null|false
+ * @return string|false|null
*/
public function getPlugin()
{
@@ -354,7 +353,7 @@ public function getPlugin()
* The plugin name to use
*
* @deprecated 3.4.0 Use setPlugin()/getPlugin() instead.
- * @param string|null|false $name Plugin name. If null returns current plugin.
+ * @param string|false|null $name Plugin name. If null returns current plugin.
* Use false to remove the current plugin name.
* @return string|false|null|$this
*/
@@ -418,7 +417,7 @@ public function helpers(array $helpers = null, $merge = true)
*
* `False` to remove current theme is deprecated as of 3.4.0. Use directly `null` instead.
*
- * @param string|null|false $theme Theme name.
+ * @param string|false|null $theme Theme name.
* Use null or false to remove the current theme.
* @return $this
*/
@@ -432,7 +431,7 @@ public function setTheme($theme)
/**
* Gets the view theme to use.
*
- * @return string|null|false
+ * @return string|false|null
*/
public function getTheme()
{
@@ -443,7 +442,7 @@ public function getTheme()
* The view theme to use.
*
* @deprecated 3.4.0 Use setTheme()/getTheme() instead.
- * @param string|null|false $theme Theme name. If null returns current theme.
+ * @param string|false|null $theme Theme name. If null returns current theme.
* Use false to remove the current theme.
* @return string|false|null|$this
*/
@@ -505,7 +504,7 @@ public function template($name = null)
* The name specified is the filename of the layout in /src/Template/Layout
* without the .ctp extension.
*
- * @param string|null|false $name Layout file name to set.
+ * @param string|false|null $name Layout file name to set.
* @return $this
*/
public function setLayout($name)
@@ -518,7 +517,7 @@ public function setLayout($name)
/**
* Gets the name of the layout file to render the view inside of.
*
- * @return string|null|false
+ * @return string|false|null
*/
public function getLayout()
{
@@ -737,7 +736,7 @@ public function jsonSerialize()
{
$properties = [
'_templatePath', '_template', '_plugin', '_theme', '_layout', '_autoLayout',
- '_layoutPath', '_name', '_className', '_options', '_helpers'
+ '_layoutPath', '_name', '_className', '_options', '_helpers',
];
$array = [];
diff --git a/app/vendor/cakephp/cakephp/src/View/ViewVarsTrait.php b/app/vendor/cakephp/cakephp/src/View/ViewVarsTrait.php
index d671ff328..766a56adb 100644
--- a/app/vendor/cakephp/cakephp/src/View/ViewVarsTrait.php
+++ b/app/vendor/cakephp/cakephp/src/View/ViewVarsTrait.php
@@ -25,7 +25,6 @@
*/
trait ViewVarsTrait
{
-
/**
* The name of default View class.
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/BasicWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/BasicWidget.php
index 969189940..137f13b9c 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/BasicWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/BasicWidget.php
@@ -25,7 +25,6 @@
*/
class BasicWidget implements WidgetInterface
{
-
/**
* StringTemplate instance.
*
@@ -65,7 +64,7 @@ public function render(array $data, ContextInterface $context)
'val' => null,
'type' => 'text',
'escape' => true,
- 'templateVars' => []
+ 'templateVars' => [],
];
$data['value'] = $data['val'];
unset($data['val']);
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/ButtonWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/ButtonWidget.php
index 34c0c7501..155db302a 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/ButtonWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/ButtonWidget.php
@@ -25,7 +25,6 @@
*/
class ButtonWidget extends BasicWidget
{
-
/**
* Render a button.
*
@@ -48,7 +47,7 @@ public function render(array $data, ContextInterface $context)
'text' => '',
'type' => 'submit',
'escape' => false,
- 'templateVars' => []
+ 'templateVars' => [],
];
return $this->_templates->format('button', [
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/CheckboxWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/CheckboxWidget.php
index d21934d9f..7e76f2680 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/CheckboxWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/CheckboxWidget.php
@@ -21,7 +21,6 @@
*/
class CheckboxWidget extends BasicWidget
{
-
/**
* Render a checkbox element.
*
@@ -46,7 +45,7 @@ public function render(array $data, ContextInterface $context)
'value' => 1,
'val' => null,
'disabled' => false,
- 'templateVars' => []
+ 'templateVars' => [],
];
if ($this->_isChecked($data)) {
$data['checked'] = true;
@@ -62,7 +61,7 @@ public function render(array $data, ContextInterface $context)
'name' => $data['name'],
'value' => $data['value'],
'templateVars' => $data['templateVars'],
- 'attrs' => $attrs
+ 'attrs' => $attrs,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/DateTimeWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/DateTimeWidget.php
index 701e7d8e9..b198b6698 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/DateTimeWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/DateTimeWidget.php
@@ -28,7 +28,6 @@
*/
class DateTimeWidget implements WidgetInterface
{
-
/**
* Select box widget.
*
@@ -259,7 +258,7 @@ protected function _deconstructDate($value, $options)
$date = new DateTime();
} else {
- /* @var \DateTime $value */
+ /** @var \DateTime $value */
$date = clone $value;
}
} catch (Exception $e) {
@@ -323,7 +322,7 @@ protected function _yearSelect($options, $context)
'end' => date('Y', strtotime('+5 years')),
'order' => 'desc',
'templateVars' => [],
- 'options' => []
+ 'options' => [],
];
if (!empty($options['val'])) {
@@ -581,7 +580,7 @@ protected function _generateNumbers($start, $end, $options = [])
$options += [
'leadingZeroKey' => true,
'leadingZeroValue' => true,
- 'interval' => 1
+ 'interval' => 1,
];
$numbers = [];
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/FileWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/FileWidget.php
index 1f9a1d00f..5a603bce2 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/FileWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/FileWidget.php
@@ -24,7 +24,6 @@
*/
class FileWidget implements WidgetInterface
{
-
/**
* Templates
*
@@ -73,7 +72,7 @@ public function render(array $data, ContextInterface $context)
'attrs' => $this->_templates->formatAttributes(
$data,
['name']
- )
+ ),
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/LabelWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/LabelWidget.php
index fe620e97a..4c2629ff2 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/LabelWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/LabelWidget.php
@@ -24,7 +24,6 @@
*/
class LabelWidget implements WidgetInterface
{
-
/**
* Templates
*
@@ -76,7 +75,7 @@ public function render(array $data, ContextInterface $context)
'input' => '',
'hidden' => '',
'escape' => true,
- 'templateVars' => []
+ 'templateVars' => [],
];
return $this->_templates->format($this->_labelTemplate, [
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/MultiCheckboxWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/MultiCheckboxWidget.php
index f54b6dce3..516d2609f 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/MultiCheckboxWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/MultiCheckboxWidget.php
@@ -22,7 +22,6 @@
*/
class MultiCheckboxWidget implements WidgetInterface
{
-
use IdGeneratorTrait;
/**
@@ -113,7 +112,7 @@ public function render(array $data, ContextInterface $context)
'val' => null,
'idPrefix' => null,
'templateVars' => [],
- 'label' => true
+ 'label' => true,
];
$this->_idPrefix = $data['idPrefix'];
$this->_clearIds();
@@ -137,7 +136,7 @@ protected function _renderInputs($data, $context)
$inputs = $this->_renderInputs(['options' => $val] + $data, $context);
$title = $this->_templates->format('multicheckboxTitle', ['text' => $key]);
$out[] = $this->_templates->format('multicheckboxWrapper', [
- 'content' => $title . implode('', $inputs)
+ 'content' => $title . implode('', $inputs),
]);
continue;
}
@@ -195,7 +194,7 @@ protected function _renderInput($checkbox, $context)
'attrs' => $this->_templates->formatAttributes(
$checkbox,
['name', 'value', 'text', 'options', 'label', 'val', 'type']
- )
+ ),
]);
if ($checkbox['label'] === false && strpos($this->_templates->get('checkboxWrapper'), '{{input}}') === false) {
@@ -207,11 +206,12 @@ protected function _renderInput($checkbox, $context)
'escape' => $checkbox['escape'],
'text' => $checkbox['text'],
'templateVars' => $checkbox['templateVars'],
- 'input' => $input
+ 'input' => $input,
];
if ($checkbox['checked']) {
- $labelAttrs = $this->_templates->addClass($labelAttrs, 'selected');
+ $selectedClass = $this->_templates->format('selectedClass', []);
+ $labelAttrs = $this->_templates->addClass($labelAttrs, $selectedClass);
}
$label = $this->_label->render($labelAttrs, $context);
@@ -220,7 +220,7 @@ protected function _renderInput($checkbox, $context)
return $this->_templates->format('checkboxWrapper', [
'templateVars' => $checkbox['templateVars'],
'label' => $label,
- 'input' => $input
+ 'input' => $input,
]);
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/NestingLabelWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/NestingLabelWidget.php
index 09ef0fbb1..b02b4c481 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/NestingLabelWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/NestingLabelWidget.php
@@ -22,7 +22,6 @@
*/
class NestingLabelWidget extends LabelWidget
{
-
/**
* The template to use.
*
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php
index 35d7867ab..840a2ad4f 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php
@@ -26,7 +26,6 @@
*/
class RadioWidget implements WidgetInterface
{
-
use IdGeneratorTrait;
/**
@@ -122,7 +121,7 @@ public function render(array $data, ContextInterface $context)
* Disabled attribute detection.
*
* @param array $radio Radio info.
- * @param array|null|true $disabled The disabled values.
+ * @param array|true|null $disabled The disabled values.
* @return bool
*/
protected function _isDisabled($radio, $disabled)
@@ -183,7 +182,8 @@ protected function _renderInput($val, $text, $data, $context)
}
if (!is_bool($data['label']) && isset($radio['checked']) && $radio['checked']) {
- $data['label'] = $this->_templates->addClass($data['label'], 'selected');
+ $selectedClass = $this->_templates->format('selectedClass', []);
+ $data['label'] = $this->_templates->addClass($data['label'], $selectedClass);
}
$radio['disabled'] = $this->_isDisabled($radio, $data['disabled']);
@@ -209,7 +209,8 @@ protected function _renderInput($val, $text, $data, $context)
$escape
);
- if ($label === false &&
+ if (
+ $label === false &&
strpos($this->_templates->get('radioWrapper'), '{{input}}') === false
) {
$label = $input;
@@ -229,7 +230,7 @@ protected function _renderInput($val, $text, $data, $context)
* input types (multi-checkboxes) will also need labels generated.
*
* @param array $radio The input properties.
- * @param false|string|array $label The properties for a label.
+ * @param array|string|false $label The properties for a label.
* @param string $input The input widget.
* @param \Cake\View\Form\ContextInterface $context The form context.
* @param bool $escape Whether or not to HTML escape the label.
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/SelectBoxWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/SelectBoxWidget.php
index 499b64d06..65c1e6336 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/SelectBoxWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/SelectBoxWidget.php
@@ -25,7 +25,6 @@
*/
class SelectBoxWidget extends BasicWidget
{
-
/**
* Render a select box form input.
*
@@ -110,7 +109,7 @@ public function render(array $data, ContextInterface $context)
'options' => [],
'disabled' => null,
'val' => null,
- 'templateVars' => []
+ 'templateVars' => [],
];
$options = $this->_renderContent($data);
@@ -227,7 +226,7 @@ protected function _renderOptgroup($label, $optgroup, $disabled, $selected, $tem
* @param array|string|null $selected The options to select.
* @param array $templateVars Additional template variables.
* @param bool $escape Toggle HTML escaping.
- * @return array Option elements.
+ * @return string[] Option elements.
*/
protected function _renderOptions($options, $disabled, $selected, $templateVars, $escape)
{
@@ -235,7 +234,8 @@ protected function _renderOptions($options, $disabled, $selected, $templateVars,
foreach ($options as $key => $val) {
// Option groups
$arrayVal = (is_array($val) || $val instanceof Traversable);
- if ((!is_int($key) && $arrayVal) ||
+ if (
+ (!is_int($key) && $arrayVal) ||
(is_int($key) && $arrayVal && (isset($val['options']) || !isset($val['value'])))
) {
$out[] = $this->_renderOptgroup($key, $val, $disabled, $selected, $templateVars, $escape);
@@ -281,7 +281,7 @@ protected function _renderOptions($options, $disabled, $selected, $templateVars,
* Helper method for deciding what options are selected.
*
* @param string $key The key to test.
- * @param array|string|null $selected The selected values.
+ * @param string[]|string|null $selected The selected values.
* @return bool
*/
protected function _isSelected($key, $selected)
@@ -304,7 +304,7 @@ protected function _isSelected($key, $selected)
* Helper method for deciding what options are disabled.
*
* @param string $key The key to test.
- * @param array|null $disabled The disabled values.
+ * @param string[]|null $disabled The disabled values.
* @return bool
*/
protected function _isDisabled($key, $disabled)
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/TextareaWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/TextareaWidget.php
index 1775799aa..a898c5f56 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/TextareaWidget.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/TextareaWidget.php
@@ -46,7 +46,7 @@ public function render(array $data, ContextInterface $context)
'name' => '',
'escape' => true,
'rows' => 5,
- 'templateVars' => []
+ 'templateVars' => [],
];
return $this->_templates->format('textarea', [
@@ -56,7 +56,7 @@ public function render(array $data, ContextInterface $context)
'attrs' => $this->_templates->formatAttributes(
$data,
['name', 'val']
- )
+ ),
]);
}
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/WidgetInterface.php b/app/vendor/cakephp/cakephp/src/View/Widget/WidgetInterface.php
index daa2e3dc8..3df2470a9 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/WidgetInterface.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/WidgetInterface.php
@@ -21,7 +21,6 @@
*/
interface WidgetInterface
{
-
/**
* Converts the $data into one or many HTML elements.
*
@@ -36,7 +35,7 @@ public function render(array $data, ContextInterface $context);
* this widget. Fields are in the form of Model[field][suffix]
*
* @param array $data The data to render.
- * @return array Array of fields to secure.
+ * @return string[] Array of fields to secure.
*/
public function secureFields(array $data);
}
diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/WidgetLocator.php b/app/vendor/cakephp/cakephp/src/View/Widget/WidgetLocator.php
index 6f491163a..e8a61a2bb 100644
--- a/app/vendor/cakephp/cakephp/src/View/Widget/WidgetLocator.php
+++ b/app/vendor/cakephp/cakephp/src/View/Widget/WidgetLocator.php
@@ -38,7 +38,6 @@
*/
class WidgetLocator
{
-
/**
* Array of widgets + widget configuration.
*
@@ -115,7 +114,8 @@ public function load($file)
public function add(array $widgets)
{
foreach ($widgets as $object) {
- if (is_object($object) &&
+ if (
+ is_object($object) &&
!($object instanceof WidgetInterface)
) {
throw new RuntimeException(
diff --git a/app/vendor/cakephp/cakephp/src/View/XmlView.php b/app/vendor/cakephp/cakephp/src/View/XmlView.php
index 3c382bd6a..b750dbe06 100644
--- a/app/vendor/cakephp/cakephp/src/View/XmlView.php
+++ b/app/vendor/cakephp/cakephp/src/View/XmlView.php
@@ -57,7 +57,6 @@
*/
class XmlView extends SerializedView
{
-
/**
* XML layouts are located in the xml sub directory of `Layouts/`
*
diff --git a/app/vendor/cakephp/cakephp/src/basics.php b/app/vendor/cakephp/cakephp/src/basics.php
index 364d6d62f..e86c84b5d 100644
--- a/app/vendor/cakephp/cakephp/src/basics.php
+++ b/app/vendor/cakephp/cakephp/src/basics.php
@@ -37,8 +37,8 @@
* @param bool|null $showHtml If set to true, the method prints the debug data in a browser-friendly way.
* @param bool $showFrom If set to true, the method prints from where the function was called.
* @return mixed The same $var that was passed
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#basic-debugging
- * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#debug
+ * @link https://book.cakephp.org/3/en/development/debugging.html#basic-debugging
+ * @link https://book.cakephp.org/3/en/core-libraries/global-constants-and-functions.html#debug
*/
function debug($var, $showHtml = null, $showFrom = true)
{
@@ -51,7 +51,7 @@ function debug($var, $showHtml = null, $showFrom = true)
$trace = Debugger::trace(['start' => 1, 'depth' => 2, 'format' => 'array']);
$location = [
'line' => $trace[0]['line'],
- 'file' => $trace[0]['file']
+ 'file' => $trace[0]['file'],
];
}
@@ -97,11 +97,13 @@ function stackTrace(array $options = [])
* Command to return the eval-able code to startup PsySH in interactive debugger
* Works the same way as eval(\Psy\sh());
* psy/psysh must be loaded in your project
- * @link http://psysh.org/
+ *
* ```
* eval(breakpoint());
* ```
- * @return string
+ *
+ * @return string|null
+ * @link http://psysh.org/
*/
function breakpoint()
{
@@ -112,6 +114,8 @@ function breakpoint()
'psy/psysh must be installed and you must be in a CLI environment to use the breakpoint function',
E_USER_WARNING
);
+
+ return null;
}
}
@@ -125,7 +129,7 @@ function breakpoint()
* @param mixed $var Variable to show debug information for.
* @param bool|null $showHtml If set to true, the method prints the debug data in a browser-friendly way.
* @return void
- * @link https://book.cakephp.org/3.0/en/development/debugging.html#basic-debugging
+ * @link https://book.cakephp.org/3/en/development/debugging.html#basic-debugging
*/
function dd($var, $showHtml = null)
{
@@ -136,7 +140,7 @@ function dd($var, $showHtml = null)
$trace = Debugger::trace(['start' => 1, 'depth' => 2, 'format' => 'array']);
$location = [
'line' => $trace[0]['line'],
- 'file' => $trace[0]['file']
+ 'file' => $trace[0]['file'],
];
Debugger::printVar($var, $location, $showHtml);
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesFixture.php
index 31d707fcb..99e848a32 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesFixture.php
@@ -21,7 +21,6 @@
*/
class ArticlesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class ArticlesFixture extends TestFixture
'title' => ['type' => 'string', 'null' => true],
'body' => 'text',
'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -44,6 +43,6 @@ class ArticlesFixture extends TestFixture
public $records = [
['author_id' => 1, 'title' => 'First Article', 'body' => 'First Article Body', 'published' => 'Y'],
['author_id' => 3, 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y'],
- ['author_id' => 1, 'title' => 'Third Article', 'body' => 'Third Article Body', 'published' => 'Y']
+ ['author_id' => 1, 'title' => 'Third Article', 'body' => 'Third Article Body', 'published' => 'Y'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesTagsFixture.php
index 7d1e9b2f9..d7d3082a2 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/ArticlesTagsFixture.php
@@ -21,7 +21,6 @@
*/
class ArticlesTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -38,8 +37,8 @@ class ArticlesTagsFixture extends TestFixture
'references' => ['tags', 'id'],
'update' => 'cascade',
'delete' => 'cascade',
- ]
- ]
+ ],
+ ],
];
/**
@@ -51,6 +50,6 @@ class ArticlesTagsFixture extends TestFixture
['article_id' => 1, 'tag_id' => 1],
['article_id' => 1, 'tag_id' => 2],
['article_id' => 2, 'tag_id' => 1],
- ['article_id' => 2, 'tag_id' => 3]
+ ['article_id' => 2, 'tag_id' => 3],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/AssertIntegrationTestCase.php b/app/vendor/cakephp/cakephp/tests/Fixture/AssertIntegrationTestCase.php
index 7d810b0de..c6b14a8bb 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/AssertIntegrationTestCase.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/AssertIntegrationTestCase.php
@@ -9,7 +9,6 @@
*/
class AssertIntegrationTestCase extends IntegrationTestCase
{
-
/**
* testBadAssertNoRedirect
*
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/AttachmentsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/AttachmentsFixture.php
index efbe46d0d..41604a77c 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/AttachmentsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/AttachmentsFixture.php
@@ -21,7 +21,6 @@
*/
class AttachmentsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class AttachmentsFixture extends TestFixture
'attachment' => ['type' => 'string', 'null' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -42,6 +41,6 @@ class AttachmentsFixture extends TestFixture
* @var array
*/
public $records = [
- ['comment_id' => 5, 'attachment' => 'attachment.zip', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31']
+ ['comment_id' => 5, 'attachment' => 'attachment.zip', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/AuthUsersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/AuthUsersFixture.php
index 7951109c9..669354eb6 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/AuthUsersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/AuthUsersFixture.php
@@ -21,7 +21,6 @@
*/
class AuthUsersFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class AuthUsersFixture extends TestFixture
'password' => ['type' => 'string', 'null' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsFixture.php
index b6844fe5d..2530d1915 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsFixture.php
@@ -21,7 +21,6 @@
*/
class AuthorsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class AuthorsFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'default' => null],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsTagsFixture.php
index 246d9219c..b83068da5 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/AuthorsTagsFixture.php
@@ -20,7 +20,6 @@
*/
class AuthorsTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class AuthorsTagsFixture extends TestFixture
'tag_id' => ['type' => 'integer', 'null' => false],
'_constraints' => [
'unique_tag' => ['type' => 'primary', 'columns' => ['author_id', 'tag_id']],
- ]
+ ],
];
/**
@@ -43,6 +42,6 @@ class AuthorsTagsFixture extends TestFixture
['author_id' => 3, 'tag_id' => 1],
['author_id' => 3, 'tag_id' => 2],
['author_id' => 2, 'tag_id' => 1],
- ['author_id' => 2, 'tag_id' => 3]
+ ['author_id' => 2, 'tag_id' => 3],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/BinaryUuiditemsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/BinaryUuiditemsFixture.php
index 7b2152b8c..5033abf2c 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/BinaryUuiditemsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/BinaryUuiditemsFixture.php
@@ -21,7 +21,6 @@
*/
class BinaryUuiditemsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class BinaryUuiditemsFixture extends TestFixture
'id' => ['type' => 'binaryuuid'],
'name' => ['type' => 'string', 'null' => false],
'published' => ['type' => 'boolean', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CakeSessionsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CakeSessionsFixture.php
index bf1f7228d..d4e815f08 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CakeSessionsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CakeSessionsFixture.php
@@ -21,7 +21,6 @@
*/
class CakeSessionsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class CakeSessionsFixture extends TestFixture
'id' => ['type' => 'string', 'length' => 128],
'data' => ['type' => 'text', 'null' => true],
'expires' => ['type' => 'integer', 'length' => 11, 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CategoriesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CategoriesFixture.php
index 03edfb3eb..5174d7338 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CategoriesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CategoriesFixture.php
@@ -21,7 +21,6 @@
*/
class CategoriesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class CategoriesFixture extends TestFixture
'name' => ['type' => 'string', 'null' => false],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CommentsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CommentsFixture.php
index 07d8e2ac7..4274d44da 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CommentsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CommentsFixture.php
@@ -21,7 +21,6 @@
*/
class CommentsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -35,7 +34,7 @@ class CommentsFixture extends TestFixture
'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
'created' => ['type' => 'datetime'],
'updated' => ['type' => 'datetime'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -49,6 +48,6 @@ class CommentsFixture extends TestFixture
['article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'],
['article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'published' => 'N', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'],
['article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'],
- ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31']
+ ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CompositeIncrementsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CompositeIncrementsFixture.php
index 675451883..e2765da41 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CompositeIncrementsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CompositeIncrementsFixture.php
@@ -18,7 +18,6 @@
class CompositeIncrementsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -28,7 +27,7 @@ class CompositeIncrementsFixture extends TestFixture
'id' => ['type' => 'integer', 'null' => false, 'autoIncrement' => true],
'account_id' => ['type' => 'integer', 'null' => false],
'name' => ['type' => 'string', 'default' => null],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'account_id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'account_id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCategoriesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCategoriesFixture.php
index 801b16ef8..e71bd6f5b 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCategoriesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCategoriesFixture.php
@@ -21,12 +21,11 @@
*/
class CounterCacheCategoriesFixture extends TestFixture
{
-
public $fields = [
'id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'length' => 255, 'null' => false],
'post_count' => ['type' => 'integer', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
public $records = [
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCommentsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCommentsFixture.php
index 1e169453c..25c85d1e0 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCommentsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheCommentsFixture.php
@@ -21,12 +21,11 @@
*/
class CounterCacheCommentsFixture extends TestFixture
{
-
public $fields = [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'length' => 255],
'user_id' => ['type' => 'integer', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
public $records = [
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCachePostsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCachePostsFixture.php
index f65a01d7a..d59006998 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCachePostsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCachePostsFixture.php
@@ -21,14 +21,13 @@
*/
class CounterCachePostsFixture extends TestFixture
{
-
public $fields = [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'length' => 255],
'user_id' => ['type' => 'integer', 'null' => true],
'category_id' => ['type' => 'integer', 'null' => true],
'published' => ['type' => 'boolean', 'null' => false, 'default' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
public $records = [
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUserCategoryPostsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUserCategoryPostsFixture.php
index e70054446..16234ef36 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUserCategoryPostsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUserCategoryPostsFixture.php
@@ -21,18 +21,17 @@
*/
class CounterCacheUserCategoryPostsFixture extends TestFixture
{
-
public $fields = [
'id' => ['type' => 'integer'],
'category_id' => ['type' => 'integer'],
'user_id' => ['type' => 'integer'],
'post_count' => ['type' => 'integer', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
public $records = [
['category_id' => 1, 'user_id' => 1, 'post_count' => 1],
['category_id' => 2, 'user_id' => 1, 'post_count' => 1],
- ['category_id' => 2, 'user_id' => 2, 'post_count' => 1]
+ ['category_id' => 2, 'user_id' => 2, 'post_count' => 1],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUsersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUsersFixture.php
index f7289e4d2..164f46136 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUsersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/CounterCacheUsersFixture.php
@@ -21,14 +21,13 @@
*/
class CounterCacheUsersFixture extends TestFixture
{
-
public $fields = [
'id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'length' => 255, 'null' => false],
'post_count' => ['type' => 'integer', 'null' => true],
'comment_count' => ['type' => 'integer', 'null' => true],
'posts_published' => ['type' => 'integer', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
public $records = [
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/DatatypesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/DatatypesFixture.php
index 4c6bcf48b..1509625f7 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/DatatypesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/DatatypesFixture.php
@@ -21,7 +21,6 @@
*/
class DatatypesFixture extends TestFixture
{
-
/**
* @var array
*/
@@ -31,7 +30,7 @@ class DatatypesFixture extends TestFixture
'floaty' => ['type' => 'float', 'null' => true],
'small' => ['type' => 'smallinteger', 'null' => true],
'tiny' => ['type' => 'tinyinteger', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/DateKeysFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/DateKeysFixture.php
index c2bf31d4f..5e9dd32a2 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/DateKeysFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/DateKeysFixture.php
@@ -21,7 +21,6 @@
*/
class DateKeysFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class DateKeysFixture extends TestFixture
public $fields = [
'id' => ['type' => 'date'],
'title' => ['type' => 'string', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/FeaturedTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/FeaturedTagsFixture.php
index 65bbf8f77..86025e653 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/FeaturedTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/FeaturedTagsFixture.php
@@ -21,7 +21,6 @@
*/
class FeaturedTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class FeaturedTagsFixture extends TestFixture
public $fields = [
'tag_id' => ['type' => 'integer', 'null' => false],
'priority' => ['type' => 'integer', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['tag_id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['tag_id']]],
];
/**
@@ -41,6 +40,6 @@ class FeaturedTagsFixture extends TestFixture
public $records = [
['priority' => 1],
['priority' => 2],
- ['priority' => 3]
+ ['priority' => 3],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/FixturizedTestCase.php b/app/vendor/cakephp/cakephp/tests/Fixture/FixturizedTestCase.php
index 79e02724c..b68991626 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/FixturizedTestCase.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/FixturizedTestCase.php
@@ -9,9 +9,9 @@
*/
class FixturizedTestCase extends TestCase
{
-
/**
* Fixtures to use in this test
+ *
* @var array
*/
public $fixtures = ['core.Categories', 'core.Articles'];
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/GroupsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/GroupsFixture.php
index e7c08cca1..8d7389162 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/GroupsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/GroupsFixture.php
@@ -21,7 +21,6 @@
*/
class GroupsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class GroupsFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/GroupsMembersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/GroupsMembersFixture.php
index 3b007f2a5..bff558e1f 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/GroupsMembersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/GroupsMembersFixture.php
@@ -21,7 +21,6 @@
*/
class GroupsMembersFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class GroupsMembersFixture extends TestFixture
'id' => ['type' => 'integer'],
'group_id' => ['type' => 'integer'],
'member_id' => ['type' => 'integer'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/MembersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/MembersFixture.php
index 63fe10580..f76752442 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/MembersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/MembersFixture.php
@@ -21,7 +21,6 @@
*/
class MembersFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class MembersFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer'],
'group_count' => ['type' => 'integer'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/MenuLinkTreesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/MenuLinkTreesFixture.php
index f034d578f..d169d865a 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/MenuLinkTreesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/MenuLinkTreesFixture.php
@@ -23,7 +23,6 @@
*/
class MenuLinkTreesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -37,7 +36,7 @@ class MenuLinkTreesFixture extends TestFixture
'parent_id' => 'integer',
'url' => ['type' => 'string', 'null' => false],
'title' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/NumberTreesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/NumberTreesFixture.php
index 14fdcfb4e..28bc1b6bb 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/NumberTreesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/NumberTreesFixture.php
@@ -23,7 +23,6 @@
*/
class NumberTreesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -36,7 +35,7 @@ class NumberTreesFixture extends TestFixture
'lft' => ['type' => 'integer'],
'rght' => ['type' => 'integer'],
'depth' => ['type' => 'integer'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -62,77 +61,77 @@ class NumberTreesFixture extends TestFixture
'parent_id' => null,
'lft' => '1',
'rght' => '20',
- 'depth' => 0
+ 'depth' => 0,
],
[
'name' => 'televisions',
'parent_id' => '1',
'lft' => '2',
'rght' => '9',
- 'depth' => 1
+ 'depth' => 1,
],
[
'name' => 'tube',
'parent_id' => '2',
'lft' => '3',
'rght' => '4',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'lcd',
'parent_id' => '2',
'lft' => '5',
'rght' => '6',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'plasma',
'parent_id' => '2',
'lft' => '7',
'rght' => '8',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'portable',
'parent_id' => '1',
'lft' => '10',
'rght' => '19',
- 'depth' => 1
+ 'depth' => 1,
],
[
'name' => 'mp3',
'parent_id' => '6',
'lft' => '11',
'rght' => '14',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'flash',
'parent_id' => '7',
'lft' => '12',
'rght' => '13',
- 'depth' => 3
+ 'depth' => 3,
],
[
'name' => 'cd',
'parent_id' => '6',
'lft' => '15',
'rght' => '16',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'radios',
'parent_id' => '6',
'lft' => '17',
'rght' => '18',
- 'depth' => 2
+ 'depth' => 2,
],
[
'name' => 'alien hardware',
'parent_id' => null,
'lft' => '21',
'rght' => '22',
- 'depth' => 0
- ]
+ 'depth' => 0,
+ ],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/OrderedUuidItemsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/OrderedUuidItemsFixture.php
index c30d14770..469248e59 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/OrderedUuidItemsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/OrderedUuidItemsFixture.php
@@ -18,11 +18,9 @@
/**
* Class OrderedUuiditemFixture
- *
*/
class OrderedUuidItemsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -32,7 +30,7 @@ class OrderedUuidItemsFixture extends TestFixture
'id' => ['type' => 'string', 'length' => 32],
'published' => ['type' => 'boolean', 'null' => false],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/OrdersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/OrdersFixture.php
index 55706040b..43eca665b 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/OrdersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/OrdersFixture.php
@@ -21,7 +21,6 @@
*/
class OrdersFixture extends TestFixture
{
-
/**
* {@inheritDoc}
*/
@@ -39,12 +38,12 @@ class OrdersFixture extends TestFixture
'_indexes' => [
'product_category' => [
'type' => 'index',
- 'columns' => ['product_category', 'product_id']
- ]
+ 'columns' => ['product_category', 'product_id'],
+ ],
],
'_constraints' => [
'primary' => [
- 'type' => 'primary', 'columns' => ['id']
+ 'type' => 'primary', 'columns' => ['id'],
],
'product_category_fk' => [
'type' => 'foreign',
@@ -52,8 +51,8 @@ class OrdersFixture extends TestFixture
'references' => ['products', ['category', 'id']],
'update' => 'cascade',
'delete' => 'cascade',
- ]
- ]
+ ],
+ ],
];
/**
@@ -62,6 +61,6 @@ class OrdersFixture extends TestFixture
* @var array
*/
public $records = [
- ['product_category' => 1, 'product_id' => 1]
+ ['product_category' => 1, 'product_id' => 1],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/PolymorphicTaggedFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/PolymorphicTaggedFixture.php
index a64f6a340..429101cbd 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/PolymorphicTaggedFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/PolymorphicTaggedFixture.php
@@ -18,7 +18,6 @@
class PolymorphicTaggedFixture extends TestFixture
{
-
/**
* table property
*
@@ -37,7 +36,7 @@ class PolymorphicTaggedFixture extends TestFixture
'foreign_key' => ['type' => 'integer'],
'foreign_model' => ['type' => 'string'],
'position' => ['type' => 'integer', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/PostsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/PostsFixture.php
index d39ab19b1..eebf694fe 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/PostsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/PostsFixture.php
@@ -21,7 +21,6 @@
*/
class PostsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class PostsFixture extends TestFixture
'title' => ['type' => 'string', 'null' => false],
'body' => 'text',
'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -44,6 +43,6 @@ class PostsFixture extends TestFixture
public $records = [
['author_id' => 1, 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y'],
['author_id' => 3, 'title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y'],
- ['author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y']
+ ['author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/ProductsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/ProductsFixture.php
index e801d2b53..f770311ab 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/ProductsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/ProductsFixture.php
@@ -36,7 +36,7 @@ class ProductsFixture extends TestFixture
'category' => ['type' => 'integer', 'null' => false],
'name' => ['type' => 'string', 'null' => false],
'price' => ['type' => 'integer'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['category', 'id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['category', 'id']]],
];
/**
@@ -47,6 +47,6 @@ class ProductsFixture extends TestFixture
public $records = [
['id' => 1, 'category' => 1, 'name' => 'First product', 'price' => 10],
['id' => 2, 'category' => 2, 'name' => 'Second product', 'price' => 20],
- ['id' => 3, 'category' => 3, 'name' => 'Third product', 'price' => 30]
+ ['id' => 3, 'category' => 3, 'name' => 'Third product', 'price' => 30],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/ProfilesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/ProfilesFixture.php
index 9fee49701..21b284e6d 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/ProfilesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/ProfilesFixture.php
@@ -21,7 +21,6 @@
*/
class ProfilesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -35,7 +34,7 @@ class ProfilesFixture extends TestFixture
'is_active' => ['type' => 'boolean', 'null' => false, 'default' => true],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id']],
- ]
+ ],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SessionsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SessionsFixture.php
index 3a7274928..eb35eac6e 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SessionsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SessionsFixture.php
@@ -22,7 +22,6 @@
*/
class SessionsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -32,7 +31,7 @@ class SessionsFixture extends TestFixture
'id' => ['type' => 'string', 'length' => 128],
'data' => ['type' => 'binary', 'length' => TableSchema::LENGTH_MEDIUM, 'null' => true],
'expires' => ['type' => 'integer', 'length' => 11, 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesFixture.php
index a8f31b4fd..d6454c352 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesFixture.php
@@ -18,7 +18,6 @@
class SiteArticlesFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class SiteArticlesFixture extends TestFixture
'site_id' => ['type' => 'integer', 'null' => false],
'title' => ['type' => 'string', 'null' => true],
'body' => 'text',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]],
];
/**
@@ -66,6 +65,6 @@ class SiteArticlesFixture extends TestFixture
'site_id' => 1,
'title' => 'Fourth Article',
'body' => 'Fourth Article Body',
- ]
+ ],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesTagsFixture.php
index d348660aa..6488ec1f9 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SiteArticlesTagsFixture.php
@@ -18,7 +18,6 @@
class SiteArticlesTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -29,8 +28,8 @@ class SiteArticlesTagsFixture extends TestFixture
'tag_id' => ['type' => 'integer', 'null' => false],
'site_id' => ['type' => 'integer', 'null' => false],
'_constraints' => [
- 'UNIQUE_TAG2' => ['type' => 'primary', 'columns' => ['article_id', 'tag_id', 'site_id']]
- ]
+ 'UNIQUE_TAG2' => ['type' => 'primary', 'columns' => ['article_id', 'tag_id', 'site_id']],
+ ],
];
/**
@@ -43,6 +42,6 @@ class SiteArticlesTagsFixture extends TestFixture
['article_id' => 1, 'tag_id' => 2, 'site_id' => 2],
['article_id' => 2, 'tag_id' => 4, 'site_id' => 2],
['article_id' => 4, 'tag_id' => 1, 'site_id' => 1],
- ['article_id' => 1, 'tag_id' => 3, 'site_id' => 1]
+ ['article_id' => 1, 'tag_id' => 3, 'site_id' => 1],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SiteAuthorsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SiteAuthorsFixture.php
index c70a94e34..071fb0e2b 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SiteAuthorsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SiteAuthorsFixture.php
@@ -18,7 +18,6 @@
class SiteAuthorsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -28,7 +27,7 @@ class SiteAuthorsFixture extends TestFixture
'id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'default' => null],
'site_id' => ['type' => 'integer', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]],
];
/**
@@ -40,6 +39,6 @@ class SiteAuthorsFixture extends TestFixture
['id' => 1, 'name' => 'mark', 'site_id' => 1],
['id' => 2, 'name' => 'juan', 'site_id' => 2],
['id' => 3, 'name' => 'jose', 'site_id' => 2],
- ['id' => 4, 'name' => 'andy', 'site_id' => 1]
+ ['id' => 4, 'name' => 'andy', 'site_id' => 1],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SiteTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SiteTagsFixture.php
index 42a836593..2610bc147 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SiteTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SiteTagsFixture.php
@@ -18,7 +18,6 @@
class SiteTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -28,7 +27,7 @@ class SiteTagsFixture extends TestFixture
'id' => ['type' => 'integer'],
'site_id' => ['type' => 'integer'],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'site_id']]],
];
/**
@@ -40,6 +39,6 @@ class SiteTagsFixture extends TestFixture
['id' => 1, 'site_id' => 1, 'name' => 'tag1'],
['id' => 2, 'site_id' => 2, 'name' => 'tag2'],
['id' => 3, 'site_id' => 1, 'name' => 'tag3'],
- ['id' => 4, 'site_id' => 2, 'name' => 'tag4']
+ ['id' => 4, 'site_id' => 2, 'name' => 'tag4'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/SpecialTagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/SpecialTagsFixture.php
index dde1367b3..86b865645 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/SpecialTagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/SpecialTagsFixture.php
@@ -21,7 +21,6 @@
*/
class SpecialTagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -37,8 +36,8 @@ class SpecialTagsFixture extends TestFixture
'author_id' => ['type' => 'integer', 'null' => true],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id']],
- 'UNIQUE_TAG2' => ['type' => 'unique', 'columns' => ['article_id', 'tag_id']]
- ]
+ 'UNIQUE_TAG2' => ['type' => 'unique', 'columns' => ['article_id', 'tag_id']],
+ ],
];
/**
@@ -49,6 +48,6 @@ class SpecialTagsFixture extends TestFixture
public $records = [
['article_id' => 1, 'tag_id' => 3, 'highlighted' => false, 'highlighted_time' => null, 'extra_info' => 'Foo', 'author_id' => 1],
['article_id' => 2, 'tag_id' => 1, 'highlighted' => true, 'highlighted_time' => '2014-06-01 10:10:00', 'extra_info' => 'Bar', 'author_id' => 2],
- ['article_id' => 10, 'tag_id' => 10, 'highlighted' => true, 'highlighted_time' => '2014-06-01 10:10:00', 'extra_info' => 'Baz', 'author_id' => null]
+ ['article_id' => 10, 'tag_id' => 10, 'highlighted' => true, 'highlighted_time' => '2014-06-01 10:10:00', 'extra_info' => 'Baz', 'author_id' => null],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/TagsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/TagsFixture.php
index 4620122f3..bf9660963 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/TagsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/TagsFixture.php
@@ -22,7 +22,6 @@
*/
class TagsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class TagsFixture extends TestFixture
'name' => ['type' => 'string', 'null' => false],
'description' => ['type' => 'text', 'length' => TableSchema::LENGTH_MEDIUM],
'created' => ['type' => 'datetime', 'null' => true, 'default' => null],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -44,6 +43,6 @@ class TagsFixture extends TestFixture
public $records = [
['name' => 'tag1', 'description' => 'A big description', 'created' => '2016-01-01 00:00'],
['name' => 'tag2', 'description' => 'Another big description', 'created' => '2016-01-01 00:00'],
- ['name' => 'tag3', 'description' => 'Yet another one', 'created' => '2016-01-01 00:00']
+ ['name' => 'tag3', 'description' => 'Yet another one', 'created' => '2016-01-01 00:00'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/TagsTranslationsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/TagsTranslationsFixture.php
index 658a268e4..6eb113c00 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/TagsTranslationsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/TagsTranslationsFixture.php
@@ -21,7 +21,6 @@
*/
class TagsTranslationsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class TagsTranslationsFixture extends TestFixture
'id' => ['type' => 'integer', 'null' => false, 'autoIncrement' => true],
'locale' => ['type' => 'string', 'null' => false],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -42,6 +41,6 @@ class TagsTranslationsFixture extends TestFixture
public $records = [
['locale' => 'en_us', 'name' => 'tag 1 translated into en_us'],
['locale' => 'en_us', 'name' => 'tag 2 translated into en_us'],
- ['locale' => 'en_us', 'name' => 'tag 3 translated into en_us']
+ ['locale' => 'en_us', 'name' => 'tag 3 translated into en_us'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/TestPluginCommentsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/TestPluginCommentsFixture.php
index 90ff6ffda..f0c149755 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/TestPluginCommentsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/TestPluginCommentsFixture.php
@@ -21,7 +21,6 @@
*/
class TestPluginCommentsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -35,7 +34,7 @@ class TestPluginCommentsFixture extends TestFixture
'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
'created' => 'datetime',
'updated' => 'datetime',
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -49,6 +48,6 @@ class TestPluginCommentsFixture extends TestFixture
['article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:49:23', 'updated' => '2008-09-24 10:51:31'],
['article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Plugin Article', 'published' => 'N', 'created' => '2008-09-24 10:51:23', 'updated' => '2008-09-24 10:53:31'],
['article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:53:23', 'updated' => '2008-09-24 10:55:31'],
- ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:55:23', 'updated' => '2008-09-24 10:57:31']
+ ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:55:23', 'updated' => '2008-09-24 10:57:31'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/ThingsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/ThingsFixture.php
index af75a7fec..b03eee689 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/ThingsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/ThingsFixture.php
@@ -18,7 +18,6 @@
class ThingsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -27,7 +26,7 @@ class ThingsFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'length' => 20],
- 'body' => ['type' => 'string', 'length' => 50]
+ 'body' => ['type' => 'string', 'length' => 50],
];
/**
@@ -37,6 +36,6 @@ class ThingsFixture extends TestFixture
*/
public $records = [
['id' => 1, 'title' => 'a title', 'body' => 'a body'],
- ['id' => 2, 'title' => 'another title', 'body' => 'another body']
+ ['id' => 2, 'title' => 'another title', 'body' => 'another body'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/TranslatesFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/TranslatesFixture.php
index f75a531a6..af5d1d157 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/TranslatesFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/TranslatesFixture.php
@@ -21,7 +21,6 @@
*/
class TranslatesFixture extends TestFixture
{
-
/**
* table property
*
@@ -41,7 +40,7 @@ class TranslatesFixture extends TestFixture
'foreign_key' => ['type' => 'integer', 'null' => false],
'field' => ['type' => 'string', 'null' => false],
'content' => ['type' => 'text'],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/UsersFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/UsersFixture.php
index 668b5a6cc..5aaa08c02 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/UsersFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/UsersFixture.php
@@ -21,7 +21,6 @@
*/
class UsersFixture extends TestFixture
{
-
/**
* fields property
*
@@ -33,7 +32,7 @@ class UsersFixture extends TestFixture
'password' => ['type' => 'string', 'null' => true],
'created' => ['type' => 'timestamp', 'null' => true],
'updated' => ['type' => 'timestamp', 'null' => true],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/UuiditemsFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/UuiditemsFixture.php
index 851f3fd96..028a92daf 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/UuiditemsFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/UuiditemsFixture.php
@@ -21,7 +21,6 @@
*/
class UuiditemsFixture extends TestFixture
{
-
/**
* fields property
*
@@ -31,7 +30,7 @@ class UuiditemsFixture extends TestFixture
'id' => ['type' => 'uuid'],
'published' => ['type' => 'boolean', 'null' => false],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
@@ -45,6 +44,6 @@ class UuiditemsFixture extends TestFixture
['id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'published' => 0, 'name' => 'Item 3'],
['id' => '482cfd4b-0e7c-4ea3-9582-4cec40cf8569', 'published' => 0, 'name' => 'Item 4'],
['id' => '4831181b-4020-4983-a29b-131440cf8569', 'published' => 0, 'name' => 'Item 5'],
- ['id' => '483798c8-c7cc-430e-8cf9-4fcc40cf8569', 'published' => 0, 'name' => 'Item 6']
+ ['id' => '483798c8-c7cc-430e-8cf9-4fcc40cf8569', 'published' => 0, 'name' => 'Item 6'],
];
}
diff --git a/app/vendor/cakephp/cakephp/tests/Fixture/UuidportfoliosFixture.php b/app/vendor/cakephp/cakephp/tests/Fixture/UuidportfoliosFixture.php
index b9661fa4d..ce5f4d9dc 100644
--- a/app/vendor/cakephp/cakephp/tests/Fixture/UuidportfoliosFixture.php
+++ b/app/vendor/cakephp/cakephp/tests/Fixture/UuidportfoliosFixture.php
@@ -21,7 +21,6 @@
*/
class UuidportfoliosFixture extends TestFixture
{
-
/**
* fields property
*
@@ -30,7 +29,7 @@ class UuidportfoliosFixture extends TestFixture
public $fields = [
'id' => ['type' => 'uuid'],
'name' => ['type' => 'string', 'null' => false],
- '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
+ '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
];
/**
diff --git a/app/vendor/cakephp/cakephp/tests/PHPStan/AssociationTableMixinClassReflectionExtension.php b/app/vendor/cakephp/cakephp/tests/PHPStan/AssociationTableMixinClassReflectionExtension.php
index 72f733283..133fdca0d 100644
--- a/app/vendor/cakephp/cakephp/tests/PHPStan/AssociationTableMixinClassReflectionExtension.php
+++ b/app/vendor/cakephp/cakephp/tests/PHPStan/AssociationTableMixinClassReflectionExtension.php
@@ -1,18 +1,19 @@
- [TEST_APP . 'Plugin' . DS],
'templates' => [APP . 'Template' . DS],
'locales' => [APP . 'Locale' . DS],
- ]
+ ],
]);
Cache::setConfig([
'_cake_core_' => [
'engine' => 'File',
'prefix' => 'cake_core_',
- 'serialize' => true
+ 'serialize' => true,
],
'_cake_model_' => [
'engine' => 'File',
'prefix' => 'cake_model_',
- 'serialize' => true
- ]
+ 'serialize' => true,
+ ],
]);
// Ensure default test connection is defined
@@ -104,7 +105,7 @@
ConnectionManager::setConfig('test_custom_i18n_datasource', ['url' => getenv('db_dsn')]);
Configure::write('Session', [
- 'defaults' => 'php'
+ 'defaults' => 'php',
]);
Log::setConfig([
@@ -124,7 +125,7 @@
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
'file' => 'error',
'path' => LOGS,
- ]
+ ],
]);
Chronos::setTestNow(Chronos::now());
@@ -132,6 +133,8 @@
ini_set('intl.default_locale', 'en_US');
ini_set('session.gc_divisor', '1');
+Security::setSalt('a-long-but-not-random-value');
+
loadPHPUnitAliases();
// Fixate sessionid early on, as php7.2+
diff --git a/app/vendor/cakephp/cakephp/tests/phpunit_aliases.php b/app/vendor/cakephp/cakephp/tests/phpunit_aliases.php
index 2e30c2455..aca6a057c 100644
--- a/app/vendor/cakephp/cakephp/tests/phpunit_aliases.php
+++ b/app/vendor/cakephp/cakephp/tests/phpunit_aliases.php
@@ -17,3 +17,7 @@ class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\Framework\Error\Warning'
class_alias('PHPUnit_Framework_ExpectationFailedException', 'PHPUnit\Framework\ExpectationFailedException');
}
}
+
+if (!class_exists('PHPUnit\Framework\MockObject\MockBuilder')) {
+ class_alias('PHPUnit_Framework_MockObject_MockBuilder', 'PHPUnit\Framework\MockObject\MockBuilder');
+}
diff --git a/app/vendor/cakephp/chronos/.appveyor.yml b/app/vendor/cakephp/chronos/.appveyor.yml
new file mode 100644
index 000000000..827713bd1
--- /dev/null
+++ b/app/vendor/cakephp/chronos/.appveyor.yml
@@ -0,0 +1,34 @@
+build: false
+shallow_clone: false
+platform: 'x86'
+clone_folder: c:\projects\chronos
+
+branches:
+ only:
+ - master
+
+environment:
+ global:
+ PHP: "C:/PHP"
+
+init:
+ - SET PATH=C:\php\;%PATH%
+
+install:
+ - cd c:\
+ - curl -fsS https://windows.php.net/downloads/releases/archives/php-5.6.40-nts-Win32-VC11-x86.zip -o php.zip
+ - 7z x php.zip -oc:\php
+ - cd c:\php
+ - copy php.ini-production php.ini
+ - echo date.timezone="UTC" >> php.ini
+ - echo extension_dir=ext >> php.ini
+ - echo extension=php_openssl.dll >> php.ini
+ - cd C:\projects\chronos
+ - appveyor DownloadFile https://getcomposer.org/composer.phar
+ # phpstan requires php 7.0. While here used php 5.5 we can't install it
+ - php composer.phar remove --dev phpstan/phpstan
+ - php composer.phar install --prefer-dist --no-interaction --ansi --no-progress
+
+test_script:
+ - cd C:\projects\chronos
+ - vendor\bin\phpunit.bat
diff --git a/app/vendor/cakephp/chronos/README.md b/app/vendor/cakephp/chronos/README.md
index 70bb73f2e..5049973f5 100644
--- a/app/vendor/cakephp/chronos/README.md
+++ b/app/vendor/cakephp/chronos/README.md
@@ -39,6 +39,9 @@ Any time method called on this type of object is basically a no-op.
A minor but still noticeable difference is that `Chronos` has no external dependencies, it is completely standalone.
+There are other implementation changes, but one that users might not notice is ``Chronos`` considers Monday as
+the start of the week instead of Sunday. This follows the ISO-8601 and current versions of PHP 5.6 and PHP 7.
+
Finally, Chronos is faster than Carbon as it has been optimized for the creation of hundreds of instances with minimal
overhead.
@@ -61,12 +64,12 @@ want to migrate, we could use the following to update files:
```
# Replace imports
-find ./src -type f -exec sed -i '' 's/use Carbon\\CarbonInterval/use Cake\\Chronos\\ChronosInterval/g' {} \;
-find ./src -type f -exec sed -i '' 's/use Carbon\\Carbon/use Cake\\Chronos\\Chronos/g' {} \;
+find ./src -type f -name '*.php' -exec sed -i '' 's/use Carbon\\CarbonInterval/use Cake\\Chronos\\ChronosInterval/g' {} \;
+find ./src -type f -name '*.php' -exec sed -i '' 's/use Carbon\\Carbon/use Cake\\Chronos\\Chronos/g' {} \;
# Replace typehints and extensions
-find ./src -type f -exec sed -i '' 's/CarbonInterval/ChronosInterval/g' {} \;
-find ./src -type f -exec sed -i '' 's/Carbon/Chronos/g' {} \;
+find ./src -type f -name '*.php' -exec sed -i '' 's/CarbonInterval/ChronosInterval/g' {} \;
+find ./src -type f -name '*.php' -exec sed -i '' 's/Carbon/Chronos/g' {} \;
```
At this point your code should mostly work as it did before. The biggest
diff --git a/app/vendor/cakephp/chronos/composer.json b/app/vendor/cakephp/chronos/composer.json
index 6aa3f8787..d63b28472 100644
--- a/app/vendor/cakephp/chronos/composer.json
+++ b/app/vendor/cakephp/chronos/composer.json
@@ -26,14 +26,13 @@
"source": "https://github.com/cakephp/chronos"
},
"require": {
- "php": "^5.5.9|^7"
+ "php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "<6.0 || ^7.0",
"athletic/athletic": "~0.1",
"cakephp/cakephp-codesniffer": "^3.0",
- "phpbench/phpbench": "@dev",
- "phpstan/phpstan": "^0.6.4"
+ "phpbench/phpbench": "@dev"
},
"autoload": {
"psr-4": {
@@ -57,6 +56,7 @@
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"bench": "phpbench run",
- "phpstan": "phpstan analyze -c phpstan.neon -l 3 src tests"
+ "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
+ "phpstan": "phpstan analyze -c phpstan.neon -l 3 src/"
}
}
diff --git a/app/vendor/cakephp/chronos/docs.Dockerfile b/app/vendor/cakephp/chronos/docs.Dockerfile
index e881add62..3c6a7f509 100644
--- a/app/vendor/cakephp/chronos/docs.Dockerfile
+++ b/app/vendor/cakephp/chronos/docs.Dockerfile
@@ -5,9 +5,9 @@ RUN pip install git+https://github.com/sphinx-contrib/video.git@master
COPY docs /data/docs
+# build docs with sphinx
RUN cd /data/docs-builder && \
- # In the future repeat website for each version
- make website LANGS="en fr ja pt" SOURCE=/data/docs DEST=/data/website/1.x
+ make website LANGS="en fr ja pt" SOURCE=/data/docs DEST=/data/website
# Build a small nginx container with just the static site in it.
FROM nginx:1.15-alpine
@@ -15,5 +15,6 @@ FROM nginx:1.15-alpine
COPY --from=builder /data/website /data/website
COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf
-# Move each version into place
-RUN mv /data/website/1.x/html/ /usr/share/nginx/html/1.x
+# Move docs into place.
+RUN cp -R /data/website/html/* /usr/share/nginx/html \
+ && rm -rf /data/website
diff --git a/app/vendor/cakephp/chronos/docs/config/all.py b/app/vendor/cakephp/chronos/docs/config/all.py
index 2f802ca1d..c3103072e 100644
--- a/app/vendor/cakephp/chronos/docs/config/all.py
+++ b/app/vendor/cakephp/chronos/docs/config/all.py
@@ -44,3 +44,5 @@
repository = 'cakephp/chronos'
source_path = 'docs/'
+
+hide_page_contents = ('search', '404', 'contents')
diff --git a/app/vendor/cakephp/chronos/docs/en/index.rst b/app/vendor/cakephp/chronos/docs/en/index.rst
index 234710512..3cffdd9fc 100644
--- a/app/vendor/cakephp/chronos/docs/en/index.rst
+++ b/app/vendor/cakephp/chronos/docs/en/index.rst
@@ -118,16 +118,16 @@ Chronos objects provide modifier methods that let you modify the value in
a granular way::
// Set components of the datetime value.
- $halloween = Date::create()
+ $halloween = Chronos::create()
->year(2015)
->month(10)
->day(31)
->hour(20)
->minute(30);
-You can also modify parts of a date relatively::
+You can also modify parts of the datetime relatively::
- $future = Date::create()
+ $future = Chronos::create()
->addYear(1)
->subMonth(2)
->addDays(15)
diff --git a/app/vendor/cakephp/chronos/docs/fr/index.rst b/app/vendor/cakephp/chronos/docs/fr/index.rst
index 932eaf60a..f313d8b97 100644
--- a/app/vendor/cakephp/chronos/docs/fr/index.rst
+++ b/app/vendor/cakephp/chronos/docs/fr/index.rst
@@ -122,7 +122,7 @@ Les objets Chronos fournissent des méthodes de modification qui vous laissent
modifier la valeur d'une façon assez précise::
// Définit les composants de la valeur du datetime.
- $halloween = Date::create()
+ $halloween = Chronos::create()
->year(2015)
->month(10)
->day(31)
@@ -131,7 +131,7 @@ modifier la valeur d'une façon assez précise::
Vous pouvez aussi modifier les parties de la date de façon relative::
- $future = Date::create()
+ $future = Chronos::create()
->addYear(1)
->subMonth(2)
->addDays(15)
diff --git a/app/vendor/cakephp/chronos/docs/ja/index.rst b/app/vendor/cakephp/chronos/docs/ja/index.rst
index e17578bf4..9e1db71d0 100644
--- a/app/vendor/cakephp/chronos/docs/ja/index.rst
+++ b/app/vendor/cakephp/chronos/docs/ja/index.rst
@@ -116,16 +116,16 @@ Chronos は日時表現のための ``Date`` オブジェクトを提供しま
Chronos オブジェクトは細やかに値を変更できるメソッドを提供します。 ::
// 日時の値のコンポーネントを設定
- $halloween = Date::create()
+ $halloween = Chronos::create()
->year(2015)
->month(10)
->day(31)
->hour(20)
->minute(30);
-また、日付部分を相対日付に変更することもできます。 ::
+また、日時の部分を相対的に変更することもできます。 ::
- $future = Date::create()
+ $future = Chronos::create()
->addYear(1)
->subMonth(2)
->addDays(15)
diff --git a/app/vendor/cakephp/chronos/docs/pt/index.rst b/app/vendor/cakephp/chronos/docs/pt/index.rst
index ebf45656a..d4a90af83 100644
--- a/app/vendor/cakephp/chronos/docs/pt/index.rst
+++ b/app/vendor/cakephp/chronos/docs/pt/index.rst
@@ -118,7 +118,7 @@ Objetos Chronos disponibilizam métodos que permitem a modificação de valores
forma granular::
// Define componentes do valor datetime
- $halloween = Date::create()
+ $halloween = Chronos::create()
->year(2015)
->month(10)
->day(31)
@@ -127,7 +127,7 @@ forma granular::
Você também pode modificar partes da data relativamente::
- $future = Date::create()
+ $future = Chronos::create()
->addYear(1)
->subMonth(2)
->addDays(15)
diff --git a/app/vendor/cakephp/chronos/src/Chronos.php b/app/vendor/cakephp/chronos/src/Chronos.php
index 625c99955..d39556327 100644
--- a/app/vendor/cakephp/chronos/src/Chronos.php
+++ b/app/vendor/cakephp/chronos/src/Chronos.php
@@ -110,8 +110,8 @@ public function __construct($time = 'now', $tz = null)
$testNow = $testNow->modify($time);
}
- $relativetime = static::isTimeExpression($time);
- if (!$relativetime && $tz !== $testNow->getTimezone()) {
+ $relativeTime = static::isTimeExpression($time);
+ if (!$relativeTime && $tz !== $testNow->getTimezone()) {
$testNow = $testNow->setTimezone($tz === null ? date_default_timezone_get() : $tz);
}
@@ -191,22 +191,12 @@ public static function hasTestNow()
*/
public function __debugInfo()
{
- // Conditionally add properties if state exists to avoid
- // errors when using a debugger.
- $vars = get_object_vars($this);
-
$properties = [
'hasFixedNow' => static::hasTestNow(),
+ 'time' => $this->format('Y-m-d H:i:s.u'),
+ 'timezone' => $this->getTimezone()->getName(),
];
- if (isset($vars['date'])) {
- $properties['time'] = $this->format('Y-m-d H:i:s.u');
- }
-
- if (isset($vars['timezone'])) {
- $properties['timezone'] = $this->getTimezone()->getName();
- }
-
return $properties;
}
}
diff --git a/app/vendor/cakephp/chronos/src/ChronosInterface.php b/app/vendor/cakephp/chronos/src/ChronosInterface.php
index ce89c8fe6..d73c7a1cd 100644
--- a/app/vendor/cakephp/chronos/src/ChronosInterface.php
+++ b/app/vendor/cakephp/chronos/src/ChronosInterface.php
@@ -286,49 +286,103 @@ public function toW3cString();
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see equals
*/
public function eq(ChronosInterface $dt);
+ /**
+ * Determines if the instance is equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function equals(ChronosInterface $dt);
+
/**
* Determines if the instance is not equal to another
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see notEquals
*/
public function ne(ChronosInterface $dt);
+ /**
+ * Determines if the instance is not equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function notEquals(ChronosInterface $dt);
+
/**
* Determines if the instance is greater (after) than another
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see greaterThan
*/
public function gt(ChronosInterface $dt);
+ /**
+ * Determines if the instance is greater (after) than another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function greaterThan(ChronosInterface $dt);
+
/**
* Determines if the instance is greater (after) than or equal to another
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see greaterThanOrEquals
*/
public function gte(ChronosInterface $dt);
+ /**
+ * Determines if the instance is greater (after) than or equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function greaterThanOrEquals(ChronosInterface $dt);
+
/**
* Determines if the instance is less (before) than another
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see lessThan
*/
public function lt(ChronosInterface $dt);
+ /**
+ * Determines if the instance is less (before) than another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function lessThan(ChronosInterface $dt);
+
/**
* Determines if the instance is less (before) or equal to another
*
* @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
* @return bool
+ * @see lessThanOrEquals
*/
public function lte(ChronosInterface $dt);
+ /**
+ * Determines if the instance is less (before) or equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function lessThanOrEquals(ChronosInterface $dt);
+
/**
* Determines if the instance is between two others
*
diff --git a/app/vendor/cakephp/chronos/src/ChronosInterval.php b/app/vendor/cakephp/chronos/src/ChronosInterval.php
index a60605b63..a10d9342f 100644
--- a/app/vendor/cakephp/chronos/src/ChronosInterval.php
+++ b/app/vendor/cakephp/chronos/src/ChronosInterval.php
@@ -83,13 +83,6 @@ class ChronosInterval extends DateInterval
*/
const PHP_DAYS_FALSE = -99999;
- /**
- * Whether or not this object was created in HHVM
- *
- * @var bool
- */
- protected $isHHVM = false;
-
/**
* Determine if the interval was created via DateTime:diff() or not.
*
@@ -114,7 +107,6 @@ protected static function wasCreatedFromDiff(DateInterval $interval)
*/
public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
{
- $this->isHHVM = defined('HHVM_VERSION');
$spec = static::PERIOD_PREFIX;
$spec .= $years > 0 ? $years . static::PERIOD_YEARS : '';
@@ -247,31 +239,31 @@ public function __get($name)
{
switch ($name) {
case 'years':
- return $this->isHHVM ? parent::__get('y') : $this->y;
+ return $this->y;
case 'months':
- return $this->isHHVM ? parent::__get('m') : $this->m;
+ return $this->m;
case 'dayz':
- return $this->isHHVM ? parent::__get('d') : $this->d;
+ return $this->d;
case 'hours':
- return $this->isHHVM ? parent::__get('h') : $this->h;
+ return $this->h;
case 'minutes':
- return $this->isHHVM ? parent::__get('i') : $this->i;
+ return $this->i;
case 'seconds':
- return $this->isHHVM ? parent::__get('s') : $this->s;
+ return $this->s;
case 'weeks':
- return (int)floor(($this->isHHVM ? parent::__get('d') : $this->d) / ChronosInterface::DAYS_PER_WEEK);
+ return (int)floor($this->d / ChronosInterface::DAYS_PER_WEEK);
case 'daysExcludeWeeks':
case 'dayzExcludeWeeks':
return $this->dayz % ChronosInterface::DAYS_PER_WEEK;
case 'days':
- return $this->isHHVM ? parent::__get('days') : $this->days;
+ return $this->days;
case 'y':
case 'm':
case 'd':
@@ -297,41 +289,37 @@ public function __set($name, $val)
{
switch ($name) {
case 'years':
- $this->isHHVM ? parent::__set('y', $val) : $this->y = $val;
+ $this->y = $val;
break;
case 'months':
- $this->isHHVM ? parent::__set('m', $val) : $this->m = $val;
+ $this->m = $val;
break;
case 'weeks':
$val = $val * ChronosInterface::DAYS_PER_WEEK;
- $this->isHHVM ? parent::__set('d', $val) : $this->d = $val;
+ $this->d = $val;
break;
case 'dayz':
- $this->isHHVM ? parent::__set('d', $val) : $this->d = $val;
+ $this->d = $val;
break;
case 'hours':
- $this->isHHVM ? parent::__set('h', $val) : $this->h = $val;
+ $this->h = $val;
break;
case 'minutes':
- $this->isHHVM ? parent::__set('i', $val) : $this->i = $val;
+ $this->i = $val;
break;
case 'seconds':
- $this->isHHVM ? parent::__set('s', $val) : $this->s = $val;
+ $this->s = $val;
break;
case 'invert':
- $this->isHHVM ? parent::__set('invert', $val) : $this->invert = $val;
+ $this->invert = $val;
break;
- default:
- if ($this->isHHVM) {
- parent::__set($name, $val);
- }
}
}
diff --git a/app/vendor/cakephp/chronos/src/Date.php b/app/vendor/cakephp/chronos/src/Date.php
index 387d0a949..711d45230 100644
--- a/app/vendor/cakephp/chronos/src/Date.php
+++ b/app/vendor/cakephp/chronos/src/Date.php
@@ -77,7 +77,7 @@ class Date extends DateTimeImmutable implements ChronosInterface
* timezone will always be UTC. Normalizing the timezone allows for
* subtraction/addition to have deterministic results.
*
- * @param string|null $time Fixed or relative time
+ * @param string|null|\DateTimeInterface $time Fixed or relative time
*/
public function __construct($time = 'now')
{
@@ -133,18 +133,11 @@ public function toMutable()
*/
public function __debugInfo()
{
- // Conditionally add properties if state exists to avoid
- // errors when using a debugger.
- $vars = get_object_vars($this);
-
$properties = [
'hasFixedNow' => static::hasTestNow(),
+ 'date' => $this->format('Y-m-d'),
];
- if (isset($vars['date'])) {
- $properties['date'] = $this->format('Y-m-d');
- }
-
return $properties;
}
}
diff --git a/app/vendor/cakephp/chronos/src/MutableDate.php b/app/vendor/cakephp/chronos/src/MutableDate.php
index 00ea85bf9..3efaf73b5 100644
--- a/app/vendor/cakephp/chronos/src/MutableDate.php
+++ b/app/vendor/cakephp/chronos/src/MutableDate.php
@@ -76,7 +76,7 @@ class MutableDate extends DateTime implements ChronosInterface
* timezone will always be UTC. Normalizing the timezone allows for
* subtraction/addition to have deterministic results.
*
- * @param string|null $time Fixed or relative time
+ * @param string|null|\DateTimeInterface $time Fixed or relative time
*/
public function __construct($time = 'now')
{
@@ -132,18 +132,11 @@ public function toImmutable()
*/
public function __debugInfo()
{
- // Conditionally add properties if state exists to avoid
- // errors when using a debugger.
- $vars = get_object_vars($this);
-
$properties = [
'hasFixedNow' => static::hasTestNow(),
+ 'date' => $this->format('Y-m-d'),
];
- if (isset($vars['date'])) {
- $properties['date'] = $this->format('Y-m-d');
- }
-
return $properties;
}
}
diff --git a/app/vendor/cakephp/chronos/src/MutableDateTime.php b/app/vendor/cakephp/chronos/src/MutableDateTime.php
index 78985aecb..4afa460c2 100644
--- a/app/vendor/cakephp/chronos/src/MutableDateTime.php
+++ b/app/vendor/cakephp/chronos/src/MutableDateTime.php
@@ -22,17 +22,17 @@
* This object can be mutated in place using any setter method,
* or __set().
*
- * @property-read int $year
- * @property-read int $yearIso
- * @property-read int $month
- * @property-read int $day
- * @property-read int $hour
- * @property-read int $minute
- * @property-read int $second
- * @property-read int $timestamp seconds since the Unix Epoch
- * @property-read DateTimeZone $timezone the current timezone
- * @property-read DateTimeZone $tz alias of timezone
- * @property-read int $micro
+ * @property int $year
+ * @property int $yearIso
+ * @property int $month
+ * @property int $day
+ * @property int $hour
+ * @property int $minute
+ * @property int $second
+ * @property int $timestamp seconds since the Unix Epoch
+ * @property DateTimeZone|string $timezone the current timezone
+ * @property DateTimeZone|string $tz alias of timezone
+ * @property int $micro
* @property-read int $dayOfWeek 1 (for Monday) through 7 (for Sunday)
* @property-read int $dayOfYear 0 through 365
* @property-read int $weekOfMonth 1 through 5
@@ -175,22 +175,12 @@ public function __set($name, $value)
*/
public function __debugInfo()
{
- // Conditionally add properties if state exists to avoid
- // errors when using a debugger.
- $vars = get_object_vars($this);
-
$properties = [
'hasFixedNow' => static::hasTestNow(),
+ 'time' => $this->format('Y-m-d H:i:s.u'),
+ 'timezone' => $this->getTimezone()->getName(),
];
- if (isset($vars['date'])) {
- $properties['time'] = $this->format('Y-m-d H:i:s.u');
- }
-
- if (isset($vars['timezone'])) {
- $properties['timezone'] = $this->getTimezone()->getName();
- }
-
return $properties;
}
}
diff --git a/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php b/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php
index 8973e4ecd..eeeb98b9a 100644
--- a/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/ComparisonTrait.php
@@ -61,6 +61,17 @@ public function eq(ChronosInterface $dt)
return $this == $dt;
}
+ /**
+ * Determines if the instance is equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function equals(ChronosInterface $dt)
+ {
+ return $this->eq($dt);
+ }
+
/**
* Determines if the instance is not equal to another
*
@@ -72,6 +83,17 @@ public function ne(ChronosInterface $dt)
return !$this->eq($dt);
}
+ /**
+ * Determines if the instance is not equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function notEquals(ChronosInterface $dt)
+ {
+ return $this->ne($dt);
+ }
+
/**
* Determines if the instance is greater (after) than another
*
@@ -83,6 +105,17 @@ public function gt(ChronosInterface $dt)
return $this > $dt;
}
+ /**
+ * Determines if the instance is greater (after) than another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function greaterThan(ChronosInterface $dt)
+ {
+ return $this->gt($dt);
+ }
+
/**
* Determines if the instance is greater (after) than or equal to another
*
@@ -94,6 +127,17 @@ public function gte(ChronosInterface $dt)
return $this >= $dt;
}
+ /**
+ * Determines if the instance is greater (after) than or equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function greaterThanOrEquals(ChronosInterface $dt)
+ {
+ return $this->gte($dt);
+ }
+
/**
* Determines if the instance is less (before) than another
*
@@ -105,6 +149,17 @@ public function lt(ChronosInterface $dt)
return $this < $dt;
}
+ /**
+ * Determines if the instance is less (before) than another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function lessThan(ChronosInterface $dt)
+ {
+ return $this->lt($dt);
+ }
+
/**
* Determines if the instance is less (before) or equal to another
*
@@ -116,6 +171,17 @@ public function lte(ChronosInterface $dt)
return $this <= $dt;
}
+ /**
+ * Determines if the instance is less (before) or equal to another
+ *
+ * @param \Cake\Chronos\ChronosInterface $dt The instance to compare with.
+ * @return bool
+ */
+ public function lessThanOrEquals(ChronosInterface $dt)
+ {
+ return $this->lte($dt);
+ }
+
/**
* Determines if the instance is between two others
*
@@ -167,7 +233,7 @@ public function farthest(ChronosInterface $dt1, ChronosInterface $dt2)
* Get the minimum instance between a given instance (default now) and the current instance.
*
* @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with.
- * @return static
+ * @return \Cake\Chronos\ChronosInterface
*/
public function min(ChronosInterface $dt = null)
{
@@ -180,7 +246,7 @@ public function min(ChronosInterface $dt = null)
* Get the maximum instance between a given instance (default now) and the current instance.
*
* @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with.
- * @return static
+ * @return \Cake\Chronos\ChronosInterface
*/
public function max(ChronosInterface $dt = null)
{
@@ -444,7 +510,7 @@ public function isThisYear()
* Check if its the birthday. Compares the date/month values of the two dates.
*
* @param \Cake\Chronos\ChronosInterface|null $dt The instance to compare with or null to use current day.
- * @return static
+ * @return bool
*/
public function isBirthday(ChronosInterface $dt = null)
{
diff --git a/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php b/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php
index 1e1650b6c..c9b1c33c1 100644
--- a/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/FactoryTrait.php
@@ -49,7 +49,7 @@ public static function instance(DateTimeInterface $dt)
* ChronosInterface::parse('Monday next week')->fn() rather than
* (new Chronos('Monday next week'))->fn()
*
- * @param string $time The strtotime compatible string to parse
+ * @param \DateTimeInterface|string $time The strtotime compatible string to parse
* @param \DateTimeZone|string|null $tz The DateTimeZone object or timezone name.
* @return static
*/
@@ -220,6 +220,61 @@ public static function createFromFormat($format, $time, $tz = null)
return $dt;
}
+ /**
+ * Creates a ChronosInterface instance from an array of date and time values.
+ *
+ * The 'year', 'month' and 'day' values must all be set for a date. The time
+ * values all default to 0.
+ *
+ * The 'timezone' value can be any format supported by `\DateTimeZone`.
+ *
+ * Allowed values:
+ * - year
+ * - month
+ * - day
+ * - hour
+ * - minute
+ * - second
+ * - microsecond
+ * - meridian ('am' or 'pm')
+ * - timezone
+ *
+ * @param (int|string)[] $values Array of date and time values.
+ * @return static
+ */
+ public static function createFromArray($values)
+ {
+ $values += ['hour' => 0, 'minute' => 0, 'second' => 0, 'microsecond' => 0, 'timezone' => null];
+
+ $formatted = '';
+ if (
+ isset($values['year'], $values['month'], $values['day']) &&
+ (
+ is_numeric($values['year']) &&
+ is_numeric($values['month']) &&
+ is_numeric($values['day'])
+ )
+ ) {
+ $formatted .= sprintf('%04d-%02d-%02d ', $values['year'], $values['month'], $values['day']);
+ }
+
+ if (isset($values['meridian']) && (int)$values['hour'] === 12) {
+ $values['hour'] = 0;
+ }
+ if (isset($values['meridian'])) {
+ $values['hour'] = strtolower($values['meridian']) === 'am' ? $values['hour'] : $values['hour'] + 12;
+ }
+ $formatted .= sprintf(
+ '%02d:%02d:%02d.%06d',
+ $values['hour'],
+ $values['minute'],
+ $values['second'],
+ $values['microsecond']
+ );
+
+ return static::parse($formatted, $values['timezone']);
+ }
+
/**
* Create a ChronosInterface instance from a timestamp
*
diff --git a/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php b/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php
index 8222d7bae..eaa611b74 100644
--- a/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php
@@ -27,7 +27,7 @@ trait FrozenTimeTrait
*
* Used to ensure constructed objects always lack time.
*
- * @param string|int $time The input time. Integer values will be assumed
+ * @param string|int|\DateTimeInterface $time The input time. Integer values will be assumed
* to be in UTC. The 'now' and '' values will use the current local time.
* @return string The date component of $time.
*/
diff --git a/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php b/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php
index 1af4b88c4..5556880cf 100644
--- a/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/MagicPropertyTrait.php
@@ -52,7 +52,7 @@ trait MagicPropertyTrait
* Get a part of the ChronosInterface object
*
* @param string $name The property name to read.
- * @return string|int|\DateTimeZone The property value.
+ * @return mixed The property value.
* @throws \InvalidArgumentException
*/
public function __get($name)
@@ -66,6 +66,7 @@ public function __get($name)
'minute' => 'i',
'second' => 's',
'micro' => 'u',
+ 'microsecond' => 'u',
'dayOfWeek' => 'N',
'dayOfYear' => 'z',
'weekOfYear' => 'W',
diff --git a/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php b/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php
index d561a4ecc..95bda309b 100644
--- a/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/ModifierTrait.php
@@ -155,9 +155,9 @@ public function setDateTime($year, $month, $day, $hour, $minute, $second = 0)
public function setTimeFromTimeString($time)
{
$time = explode(":", $time);
- $hour = $time[0];
- $minute = isset($time[1]) ? $time[1] : 0;
- $second = isset($time[2]) ? $time[2] : 0;
+ $hour = (int)$time[0];
+ $minute = isset($time[1]) ? (int)$time[1] : 0;
+ $second = isset($time[2]) ? (int)$time[2] : 0;
return $this->setTime($hour, $minute, $second);
}
diff --git a/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php b/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php
index 58d1408a5..19f8732c6 100644
--- a/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php
+++ b/app/vendor/cakephp/chronos/src/Traits/TestingAidTrait.php
@@ -39,7 +39,7 @@ public static function setTestNow($testNow = null)
* Get the test instance stored in Chronos
*
* @see \Cake\Chronos\Chronos::getTestNow()
- * @return static|null the current instance used for testing or null.
+ * @return \Cake\Chronos\ChronosInterface|null the current instance used for testing or null.
*/
public static function getTestNow()
{
diff --git a/app/vendor/cakephp/debug_kit/.github/workflows/ci.yml b/app/vendor/cakephp/debug_kit/.github/workflows/ci.yml
new file mode 100644
index 000000000..5c039aaf5
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/.github/workflows/ci.yml
@@ -0,0 +1,91 @@
+name: CI
+
+
+on:
+ push:
+ branches:
+ - 3.x
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ testsuite-linux:
+ runs-on: ubuntu-18.04
+ strategy:
+ fail-fast: false
+ matrix:
+ php-version: ['5.6', '7.4']
+ db-type: [mysql, pgsql, sqlite]
+ prefer-lowest: ['']
+ include:
+ - php-version: '5.6'
+ db-type: 'sqlite'
+ prefer-lowest: 'prefer-lowest'
+
+ services:
+ postgres:
+ image: postgres
+ ports:
+ - 5432:5432
+ env:
+ POSTGRES_PASSWORD: postgres
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Service
+ if: matrix.db-type == 'mysql'
+ run: |
+ sudo service mysql start
+ mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-version }}
+ extensions: mbstring, intl, pdo_${{ matrix.db-type }}
+ coverage: pcov
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Get date part for cache key
+ id: key-date
+ run: echo "::set-output name=date::$(date +'%Y-%m')"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v1
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
+
+ - name: Composer install
+ run: |
+ if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
+ composer update --prefer-lowest --prefer-stable
+ else
+ composer update
+ fi
+
+ - name: Run PHPUnit
+ run: |
+ if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then
+ export DB_URL='sqlite://./tests.sqlite'
+ fi
+ if [[ ${{ matrix.db-type }} == 'mysql' ]]; then
+ export DB_URL='mysql://root:root@127.0.0.1/cakephp'
+ fi
+ if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then
+ export DB_URL='postgres://postgres:postgres@127.0.0.1/postgres'
+ fi
+ if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.db-type }} == 'mysql' ]]; then
+ vendor/bin/phpunit --coverage-clover=coverage.xml
+ else
+ vendor/bin/phpunit
+ fi
+
+ - name: Code Coverage Report
+ if: matrix.php-version == '7.4' && matrix.db-type == 'mysql'
+ uses: codecov/codecov-action@v1
diff --git a/app/vendor/cakephp/debug_kit/.jshintrc b/app/vendor/cakephp/debug_kit/.jshintrc
deleted file mode 100644
index 50681abe4..000000000
--- a/app/vendor/cakephp/debug_kit/.jshintrc
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- // JSHint Default Configuration File (as on JSHint website)
- // See http://jshint.com/docs/ for more details
-
- "maxerr" : 500, // {int} Maximum error before stopping
-
- // Enforcing
- "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
- "camelcase" : true, // true: Identifiers must be in camelCase
- "curly" : true, // true: Require {} for every new block or scope
- "eqeqeq" : true, // true: Require triple equals (===) for comparison
- "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
- "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
- "indent" : 2, // {int} Number of spaces to use for indentation
- "latedef" : false, // true: Require variables/functions to be defined before being used
- "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
- "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
- "noempty" : true, // true: Prohibit use of empty blocks
- "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
- "plusplus" : false, // true: Prohibit use of `++` & `--`
- "quotmark" : "single", // Quotation mark consistency:
- // false : do nothing (default)
- // true : ensure whatever is used is consistent
- // "single" : require single quotes
- // "double" : require double quotes
- "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
- "unused" : true, // true: Require all defined variables be used
- "strict" : true, // true: Requires all functions run in ES5 Strict Mode
- "trailing" : true, // true: Prohibit trailing whitespaces
- "maxparams" : false, // {int} Max number of formal params allowed per function
- "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
- "maxstatements" : false, // {int} Max number statements per function
- "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
- "maxlen" : 120, // {int} Max number of characters per line
-
- // Relaxing
- "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
- "boss" : false, // true: Tolerate assignments where comparisons would be expected
- "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
- "eqnull" : false, // true: Tolerate use of `== null`
- "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
- "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
- "evil" : false, // true: Tolerate use of `eval` and `new Function()`
- "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
- "funcscope" : false, // true: Tolerate defining variables inside control statements"
- "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
- "iterator" : false, // true: Tolerate using the `__iterator__` property
- "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
- "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
- "laxcomma" : false, // true: Tolerate comma-first style coding
- "loopfunc" : false, // true: Tolerate functions being defined in loops
- "multistr" : false, // true: Tolerate multi-line strings
- "proto" : false, // true: Tolerate using the `__proto__` property
- "scripturl" : false, // true: Tolerate script-targeted URLs
- "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
- "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
- "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
- "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
- "validthis" : false, // true: Tolerate using this in a non-constructor function
-
- // Environments
- "browser" : true, // Web Browser (window, document, etc)
- "couch" : false, // CouchDB
- "devel" : true, // Development/debugging (alert, confirm, etc)
- "dojo" : false, // Dojo Toolkit
- "jquery" : false, // jQuery
- "mootools" : false, // MooTools
- "node" : false, // Node.js
- "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
- "prototypejs" : false, // Prototype and Scriptaculous
- "rhino" : false, // Rhino
- "worker" : false, // Web Workers
- "wsh" : false, // Windows Scripting Host
- "yui" : false, // Yahoo User Interface
-
- // Legacy
- "nomen" : false, // true: Prohibit dangling `_` in variables
- "onevar" : false, // true: Allow only one `var` statement per function
- "passfail" : false, // true: Stop on first error
- "white" : true, // true: Check against strict whitespace and indentation rules
-
- // Custom Globals
- "predef" : [ ] // additional predefined global variables
-}
diff --git a/app/vendor/cakephp/debug_kit/.stickler.yml b/app/vendor/cakephp/debug_kit/.stickler.yml
deleted file mode 100644
index deca14e28..000000000
--- a/app/vendor/cakephp/debug_kit/.stickler.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-linters:
- phpcs:
- standard: CakePHP
- fixer: true
-
-ignore:
- branches: ['2.2']
-
-fixers:
- enable: true
- workflow: commit
diff --git a/app/vendor/cakephp/debug_kit/Dockerfile b/app/vendor/cakephp/debug_kit/Dockerfile
new file mode 100644
index 000000000..296613920
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/Dockerfile
@@ -0,0 +1,24 @@
+# Basic docker based environment
+# Necessary to trick dokku into building the documentation
+# using dockerfile instead of herokuish
+FROM ubuntu:17.04
+
+# Add basic tools
+RUN apt-get update && \
+ apt-get install -y build-essential \
+ software-properties-common \
+ curl \
+ git \
+ libxml2 \
+ libffi-dev \
+ libssl-dev
+
+RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \
+ apt-get update && \
+ apt-get install -y php7.2-cli php7.2-mbstring php7.2-xml php7.2-zip php7.2-intl php7.2-opcache php7.2-sqlite
+
+WORKDIR /code
+
+VOLUME ["/code"]
+
+CMD [ '/bin/bash' ]
diff --git a/app/vendor/cakephp/debug_kit/LICENSE.txt b/app/vendor/cakephp/debug_kit/LICENSE.txt
index 5849d31d4..0a0a98c8e 100644
--- a/app/vendor/cakephp/debug_kit/LICENSE.txt
+++ b/app/vendor/cakephp/debug_kit/LICENSE.txt
@@ -1,7 +1,7 @@
The MIT License
CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org)
-Copyright (c) 2005-2018, Cake Software Foundation, Inc.
+Copyright (c) 2005-present, Cake Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/app/vendor/cakephp/debug_kit/README.md b/app/vendor/cakephp/debug_kit/README.md
index 677594d2c..5cb12fc3e 100644
--- a/app/vendor/cakephp/debug_kit/README.md
+++ b/app/vendor/cakephp/debug_kit/README.md
@@ -17,8 +17,6 @@ configuration data and environment variables hidden. :warning:
The `master` branch has the following requirements:
-* CakePHP 3.6.0 or greater.
-* PHP 5.6.0 or greater.
* SQLite (pdo_sqlite) or another database driver that CakePHP can talk to. By
default DebugKit will use SQLite, if you need to use a different database see
the Database Configuration section below.
@@ -31,7 +29,7 @@ If you want DebugKit for your 2.x application, you can use the latest `2.2.y` ta
* Install the plugin with [Composer](https://getcomposer.org/) from your CakePHP Project's ROOT directory (where the **composer.json** file is located)
```sh
-php composer.phar require --dev cakephp/debug_kit "~3.0"
+php composer.phar require --dev cakephp/debug_kit:"~3.0"
```
* [Load the plugin](http://book.cakephp.org/3.0/en/plugins.html#loading-a-plugin)
@@ -78,4 +76,4 @@ correct branch.
# Documentation
Documentation for DebugKit can be found in the
-[CakePHP documentation](https://book.cakephp.org/3.0/en/debug-kit.html).
+[CakePHP documentation](https://book.cakephp.org/debugkit/3.x/en/index.html).
diff --git a/app/vendor/cakephp/debug_kit/composer.json b/app/vendor/cakephp/debug_kit/composer.json
index 2d859b2a1..a075b83bd 100644
--- a/app/vendor/cakephp/debug_kit/composer.json
+++ b/app/vendor/cakephp/debug_kit/composer.json
@@ -8,7 +8,7 @@
"authors": [
{
"name": "Mark Story",
- "homepage": "http://mark-story.com",
+ "homepage": "https://mark-story.com",
"role": "Author"
},
{
@@ -24,31 +24,40 @@
},
"require": {
"php": ">=5.6.0",
- "cakephp/cakephp": "^3.6.0",
+ "cakephp/cakephp": "^3.7.0",
"cakephp/chronos": "^1.0.0",
- "cakephp/plugin-installer": "^1.0.0",
- "composer/composer": "^1.3.0",
+ "composer/composer": "^1.3 | ^2.0",
"jdorn/sql-formatter": "^1.2.0"
},
"require-dev": {
+ "cakephp/authorization": "^1.3.2",
"cakephp/cakephp-codesniffer": "^3.0",
+ "cakephp/plugin-installer": "^1.3",
"phpunit/phpunit": "^5.7.14|^6.0"
},
"autoload": {
"psr-4": {
- "DebugKit\\": "src",
- "DebugKit\\Test\\Fixture\\": "tests\\Fixture"
+ "DebugKit\\": "src/",
+ "DebugKit\\Test\\Fixture\\": "tests/Fixture/"
}
},
"autoload-dev": {
"psr-4": {
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/",
"DebugKit\\Test\\": "tests/",
- "DebugKit\\TestApp\\": "tests/test_app/"
+ "DebugKit\\TestApp\\": "tests/test_app/",
+ "DebugkitTestPlugin\\": "tests/test_app/Plugin/DebugkitTestPlugin/src/"
}
},
"suggest": {
"ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use."
},
- "minimum-stability": "stable"
+ "scripts": {
+ "check": [
+ "@cs-check",
+ "@test"
+ ],
+ "cs-check": "phpcs --colors -p src/ tests/",
+ "cs-fix": "phpcbf --colors -p src/ tests/"
+ }
}
diff --git a/app/vendor/cakephp/debug_kit/config/bootstrap.php b/app/vendor/cakephp/debug_kit/config/bootstrap.php
index ed3f81522..5b368080d 100644
--- a/app/vendor/cakephp/debug_kit/config/bootstrap.php
+++ b/app/vendor/cakephp/debug_kit/config/bootstrap.php
@@ -30,6 +30,7 @@
}
if (!empty($service->getConfig('panels')['DebugKit.Deprecations'])) {
+ $errorLevel = Configure::read('Error.errorLevel', E_ALL | E_STRICT);
$previousHandler = set_error_handler(
function ($code, $message, $file, $line, $context = null) use (&$previousHandler) {
if ($code == E_USER_DEPRECATED || $code == E_DEPRECATED) {
@@ -38,9 +39,11 @@ function ($code, $message, $file, $line, $context = null) use (&$previousHandler
return;
}
if ($previousHandler) {
+ $context['_trace_frame_offset'] = 1;
return $previousHandler($code, $message, $file, $line, $context);
}
- }
+ },
+ $errorLevel | E_USER_DEPRECATED | E_DEPRECATED
);
}
diff --git a/app/vendor/cakephp/debug_kit/config/routes.php b/app/vendor/cakephp/debug_kit/config/routes.php
index b31d727eb..4645f19cf 100644
--- a/app/vendor/cakephp/debug_kit/config/routes.php
+++ b/app/vendor/cakephp/debug_kit/config/routes.php
@@ -1,9 +1,12 @@
'/debug-kit'], function (RouteBuilder $routes) {
$routes->setExtensions('json');
+ $routes->setRouteClass(DashedRoute::class);
+
$routes->connect(
'/toolbar/clear-cache',
['controller' => 'Toolbar', 'action' => 'clearCache']
@@ -36,4 +39,8 @@ function (RouteBuilder $routes) {
$routes->connect('/sent/:panel/:id', ['action' => 'sent'], ['pass' => ['panel', 'id']]);
}
);
+
+ $routes->get('/', ['controller' => 'Dashboard', 'action' => 'index']);
+ $routes->get('/dashboard', ['controller' => 'Dashboard', 'action' => 'index']);
+ $routes->post('/dashboard/reset', ['controller' => 'Dashboard', 'action' => 'reset']);
});
diff --git a/app/vendor/cakephp/debug_kit/docs.Dockerfile b/app/vendor/cakephp/debug_kit/docs.Dockerfile
new file mode 100644
index 000000000..88f2c0235
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs.Dockerfile
@@ -0,0 +1,24 @@
+# Generate the HTML output.
+FROM markstory/cakephp-docs-builder as builder
+
+RUN pip install git+https://github.com/sphinx-contrib/video.git@master
+
+# Copy entire repo in with .git so we can build all versions in one image.
+COPY docs /data/src
+
+# Make docs
+RUN cd /data/docs-builder \
+ && make website LANGS="en fr ja pt" SOURCE=/data/src DEST=/data/website \
+ # Move media files into the output directory so video elements work.
+ && mkdir -p /data/website/html/_static \
+ && cp /data/src/static/* /data/website/html/_static/
+
+# Build a small nginx container with just the static site in it.
+FROM nginx:1.15-alpine
+
+COPY --from=builder /data/website /data/website
+COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf
+
+# Move files into final location
+RUN cp -R /data/website/html/* /usr/share/nginx/html \
+ && rm -rf /data/website/
diff --git a/app/vendor/psy/psysh/test/fixtures/default/.local/share/psysh/php_manual.sqlite b/app/vendor/cakephp/debug_kit/docs/config/__init__.py
similarity index 100%
rename from app/vendor/psy/psysh/test/fixtures/default/.local/share/psysh/php_manual.sqlite
rename to app/vendor/cakephp/debug_kit/docs/config/__init__.py
diff --git a/app/vendor/cakephp/debug_kit/docs/config/all.py b/app/vendor/cakephp/debug_kit/docs/config/all.py
new file mode 100644
index 000000000..fcc02a3c9
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/config/all.py
@@ -0,0 +1,52 @@
+# Global configuration information used across all the
+# translations of documentation.
+#
+# Import the base theme configuration
+from cakephpsphinx.config.all import *
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+
+# The full version, including alpha/beta/rc tags.
+release = '3.x'
+
+# The search index version.
+search_version = 'debugkit-3'
+
+# The marketing display name for the book.
+version_name = ''
+
+# Project name shown in the black header bar
+project = 'CakePHP DebugKit'
+
+# Other versions that display in the version picker menu.
+version_list = [
+ {'name': '3.x', 'number': '/debugkit/3', 'title': '3.x', 'current': True},
+ {'name': '4.x', 'number': '/debugkit/4', 'title': '4.x'},
+]
+
+# Languages available.
+languages = ['en', 'fr', 'ja', 'pt']
+
+# The GitHub branch name for this version of the docs
+# for edit links to point at.
+branch = '3.x'
+
+# Current version being built
+version = '3.x'
+
+# Language in use for this directory.
+language = 'en'
+
+show_root_link = True
+
+repository = 'cakephp/debug_kit'
+
+source_path = 'docs/'
+
+hide_page_contents = ('search', '404', 'contents')
+
+# DebugKit docs use mp4 videos to show the UI
+extensions.append('sphinxcontrib.video')
diff --git a/app/vendor/cakephp/debug_kit/docs/en/conf.py b/app/vendor/cakephp/debug_kit/docs/en/conf.py
new file mode 100644
index 000000000..f638bda22
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/en/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'en'
diff --git a/app/vendor/cakephp/debug_kit/docs/en/contents.rst b/app/vendor/cakephp/debug_kit/docs/en/contents.rst
new file mode 100644
index 000000000..423e20aa4
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/en/contents.rst
@@ -0,0 +1,5 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP DebugKit
+
+ /index
diff --git a/app/vendor/cakephp/debug_kit/docs/en/index.rst b/app/vendor/cakephp/debug_kit/docs/en/index.rst
new file mode 100644
index 000000000..d7b8677dd
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/en/index.rst
@@ -0,0 +1,286 @@
+Debug Kit
+#########
+
+DebugKit provides a debugging toolbar and enhanced debugging tools for CakePHP
+applications. It lets you quickly see configuration data, log messages, SQL
+queries, and timing data for your application.
+
+.. warning::
+
+ DebugKit is only intended for use in single-user local development
+ environments. You should avoid using DebugKit in shared development
+ environments, staging environments, or any environment where you need to
+ keep configuration data and environment variables hidden.
+
+Installation
+============
+
+By default DebugKit is installed with the default application skeleton. If
+you've removed it and want to re-install it, you can do so by running the
+following from your application's ROOT directory (where composer.json file is
+located)::
+
+ php composer.phar require --dev cakephp/debug_kit "~3.0"
+
+Then, you need to enable the plugin by executing the following line::
+
+ bin/cake plugin load DebugKit
+
+Configuration
+=============
+
+* ``DebugKit.panels`` - Enable or disable panels for DebugKit. You can disable any of the
+ standard panels by::
+
+ // Before loading DebugKit
+ Configure::write('DebugKit.panels', ['DebugKit.Packages' => false]);
+
+* ``DebugKit.includeSchemaReflection`` - Set to true to enable logging of schema
+ reflection queries. Disabled by default.
+
+* ``DebugKit.safeTld`` - Set an array of whitelisted TLDs for local development.
+ This can be used to make sure DebugKit displays on hosts it otherwise determines unsafe. ::
+
+ // Allow e.g. http://foo.bar.dev or http://my-shop.local domains locally
+ Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']);
+
+* ``DebugKit.forceEnable`` - Force DebugKit to display. Careful with this, it is usually
+ safer to simply whitelist your local TLDs. Example usage::
+
+ // Before loading DebugKit
+ Configure::write('DebugKit.forceEnable', true);
+
+* ``DebugKit.ignoreAuthorization`` - Set to true to ignore Cake Authorization plugin for DebugKit requests. Disabled by default.
+
+Database Configuration
+----------------------
+
+By default DebugKit will store panel data into a SQLite database in your
+application's ``tmp`` directory. If you cannot install pdo_sqlite, you can
+configure DebugKit to use a different database by defining a ``debug_kit``
+connection in your **config/app.php** file. For example::
+
+ /**
+ * The debug_kit connection stores DebugKit meta-data.
+ */
+ 'debug_kit' => [
+ 'className' => 'Cake\Database\Connection',
+ 'driver' => 'Cake\Database\Driver\Mysql',
+ 'persistent' => false,
+ 'host' => 'localhost',
+ //'port' => 'nonstandard_port_number',
+ 'username' => 'dbusername', // Your DB username here
+ 'password' => 'dbpassword', // Your DB password here
+ 'database' => 'debug_kit',
+ 'encoding' => 'utf8',
+ 'timezone' => 'UTC',
+ 'cacheMetadata' => true,
+ 'quoteIdentifiers' => false,
+ //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
+ ],
+
+You can safely remove the **tmp/debug_kit.sqlite** file at any point.
+DebugKit will regenerate it when necessary.
+
+Toolbar Usage
+=============
+
+The DebugKit Toolbar is comprised of several panels, which are shown by clicking
+the CakePHP icon in the bottom right-hand corner of your browser after DebugKit
+has been installed and loaded. Each panel is comprised of a panel class and view
+element. Typically, a panel handles the collection and display of a single type
+of information such as Logs or Request information. You can choose to view panels
+from the toolbar or add your own custom panels.
+
+Each panel lets you look at a different aspect of your application:
+
+* **Cache** See cache usage during a request and clear caches.
+* **Environment** Display environment variables related to PHP + CakePHP.
+* **History** Displays a list of previous requests, and allows you to load
+ and view toolbar data from previous requests.
+* **Include** View the included files grouped by type.
+* **Log** Display any entries made to the log files this request.
+* **Packages** Display the list of packages dependencies with their actual
+ version and allow you to check for outdated packages.
+* **Mail** Display all emails sent during the request and allow to preview
+ emails during development without sending them.
+* **Request** Displays information about the current request, GET, POST, Cake
+ Parameters, Current Route information and Cookies.
+* **Session** Display the information currently in the Session.
+* **Sql Logs** Displays SQL logs for each database connection.
+* **Timer** Display any timers that were set during the request with
+ ``DebugKit\DebugTimer``, and memory usage collected with
+ ``DebugKit\DebugMemory``.
+* **Variables** Display View variables set in controller.
+* **Deprecations** Display deprecation warnings in a more readable and less
+ disruptive format.
+
+Using the History Panel
+=======================
+
+The history panel is one of the most frequently misunderstood features of
+DebugKit. It provides a way to view toolbar data from previous requests,
+including errors and redirects.
+
+.. figure:: ../_static/history-panel.png
+ :alt: Screenshot of the history panel in debug kit.
+
+As you can see, the panel contains a list of requests. On the left you can see
+a dot marking the active request. Clicking any request data will load the panel
+data for that request. When historical data is loaded the panel titles will
+transition to indicate that alternative data has been loaded.
+
+.. only:: html or epub
+
+ .. video:: ../_static/history-panel-use.mp4
+ :alt: Video of history panel in action.
+
+Using The Mail Panel
+====================
+
+The mail panel allow you to track all emails sent during a request.
+
+.. only:: html or epub
+
+ .. video:: ../_static/mail-panel.mp4
+ :alt: Video of Mail panel in action.
+
+The mailer preview allows you to easily check emails during development.
+
+.. only:: html or epub
+
+ .. video:: ../_static/mail-previewer.mp4
+ :alt: Video of Mail panel in action.
+
+Creating Preview Classes
+------------------------
+
+In order to preview emails before sending them, you need to create a preview
+class that defines the receipient and required template variables for your
+mailer methods::
+
+ // in src/Mailer/MailPreview/WelcomePreview.php
+ namespace App\Mailer\Preview;
+
+ use DebugKit\Mailer\MailPreview;
+
+ class WelcomePreview extends MailPreview
+ {
+ public function welcome()
+ {
+ $mailer = $this->getMailer('Welcome');
+ // set any template variables receipients for the mailer.
+
+ return $mailer;
+ }
+ }
+
+MailPreview classes should live in the ``Mailer\Preview`` namespace of your
+application or plugin, and use the ``Preview`` class suffix.
+
+Developing Your Own Panels
+==========================
+
+You can create your own custom panels for DebugKit to help in debugging your
+applications.
+
+Creating a Panel Class
+----------------------
+
+Panel Classes simply need to be placed in the **src/Panel** directory. The
+filename should match the classname, so the class ``MyCustomPanel`` would be
+expected to have a filename of **src/Panel/MyCustomPanel.php**::
+
+ namespace App\Panel;
+
+ use DebugKit\DebugPanel;
+
+ /**
+ * My Custom Panel
+ */
+ class MyCustomPanel extends DebugPanel
+ {
+ ...
+ }
+
+Notice that custom panels are required to extend the ``DebugPanel`` class.
+
+Callbacks
+---------
+
+By default Panel objects have two callbacks, allowing them to hook into the
+current request. Panels subscribe to the ``Controller.initialize`` and
+``Controller.shutdown`` events. If your panel needs to subscribe to additional
+events, you can use the ``implementedEvents()`` method to define all of the events
+your panel is interested in.
+
+You should refer to the built-in panels for some examples on how you can build
+panels.
+
+Panel Elements
+--------------
+
+Each Panel is expected to have a view element that renders the content from the
+panel. The element name must be the underscored inflection of the class name.
+For example ``SessionPanel`` has an element named **session_panel.ctp**, and
+SqllogPanel has an element named **sqllog_panel.ctp**. These elements should be
+located in the root of your **src/Template/Element** directory.
+
+Custom Titles and Elements
+--------------------------
+
+Panels should pick up their title and element name by convention. However, if
+you need to choose a custom element name or title, you can define methods to
+customize your panel's behavior:
+
+- ``title()`` - Configure the title that is displayed in the toolbar.
+- ``elementName()`` - Configure which element should be used for a given panel.
+
+Panel Hook Methods
+------------------
+
+You can also implement the following hook methods to customize how your panel
+behaves and appears:
+
+* ``shutdown(Event $event)`` This method typically collects and prepares the
+ data for the panel. Data is generally stored in ``$this->_data``.
+* ``summary()`` Can return a string of summary data to be displayed in the
+ toolbar even when a panel is collapsed. Often this is a counter, or short
+ summary information.
+* ``data()`` Returns the panel's data to be used as element context. This hook
+ method lets you further manipulate the data collected in the ``shutdown()``
+ method. This method **must** return data that can be serialized.
+
+Panels in Other Plugins
+-----------------------
+
+Panels provided by `plugins `_ work
+almost entirely the same as other plugins, with one minor difference: You must
+set ``public $plugin`` to be the name of the plugin directory, so that the
+panel's Elements can be located at render time::
+
+ namespace MyPlugin\Panel;
+
+ use DebugKit\DebugPanel;
+
+ class MyCustomPanel extends DebugPanel
+ {
+ public $plugin = 'MyPlugin';
+ ...
+ }
+
+To use a plugin or app panel, update your application's DebugKit configuration
+to include the panel::
+
+ // in src/Application.php bootstrap() method add
+ Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']);
+ $this->addPlugin('DebugKit', ['bootstrap' => true]);
+
+The above would load all the default panels as well as the ``AppPanel``, and
+``MyCustomPanel`` panel from ``MyPlugin``.
+
+Helper Functions
+================
+
+* ``sql()`` Dumps out the SQL from an ORM query.
+* ``sqld()`` Dumps out the SQL from an ORM query, and exits.
diff --git a/app/vendor/cakephp/debug_kit/docs/fr/conf.py b/app/vendor/cakephp/debug_kit/docs/fr/conf.py
new file mode 100644
index 000000000..b02032efa
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/fr/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'fr'
diff --git a/app/vendor/cakephp/debug_kit/docs/fr/contents.rst b/app/vendor/cakephp/debug_kit/docs/fr/contents.rst
new file mode 100644
index 000000000..423e20aa4
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/fr/contents.rst
@@ -0,0 +1,5 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP DebugKit
+
+ /index
diff --git a/app/vendor/cakephp/debug_kit/docs/fr/index.rst b/app/vendor/cakephp/debug_kit/docs/fr/index.rst
new file mode 100644
index 000000000..209477f6d
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/fr/index.rst
@@ -0,0 +1,239 @@
+Debug Kit
+#########
+
+DebugKit est un plugin supporté par la core team qui fournit une toolbar pour
+vous aider à debugger les applications CakePHP plus facilement.
+DebugKit fournit une barre d'outils de débuggage et des outils de débuggage
+améliorés pour les applications CakePHP. Il vous permet de voir rapidement les
+données de configuration, les messages de logs, les requêtes SQL et des données
+de temps d'exécution pour votre application.
+
+.. warning::
+
+ DebugKit est uniquement destiné à être utilisé dans des environnements de
+ développement local à un seul utilisateur. Vous devez éviter d'utiliser
+ DebugKit dans les environnements de développement partagés, les
+ environnements de stagging où vous devez garder les données de configuration
+ et les variables d'environnement cachées.
+
+Installation
+============
+
+Par défaut DebugKit est installé avec le squelette d'application. Si vous
+le retirez et voulez le réinstaller, vous pouvez le faire en lançant ce qui
+suit à partir du répertoire ROOT de votre application (où le fichier
+composer.json est localisé)::
+
+ php composer.phar require --dev cakephp/debug_kit "~3.0"
+
+Ensuite, vous devez activer le plugin en exécutant la ligne suivante::
+
+ bin/cake plugin load DebugKit
+
+Configuration
+=============
+
+* ``DebugKit.ignoreAuthorization`` - Définie à true pour ignorer le plugin Cake Authorization uniquement pour les requêtes DebugKit. Par défaut à false.
+
+Stockage de DebugKit
+====================
+
+Par défaut, DebugKit utilise une petite base de données SQLite dans le
+répertoire ``/tmp`` de votre application pour stocker les données du panneau.
+Si vous voulez que DebugKit stocke ses données ailleurs, vous pouvez définir
+une connexion ``debug_kit``.
+
+Configuration de Base de Données
+--------------------------------
+
+Par défaut DebugKit va stocker les données du panneau dans une base de données
+SQLite dans le répertoire ``tmp`` de votre application. Si vous ne pouvez pas
+installer pdo_sqlite, vous pouvez configurer DebugKit pour utiliser une base
+de données différente en définissant une connexion ``debug_kit`` dans votre
+fichier **config/app.php**.
+
+Utilisation de la Toolbar
+=========================
+
+La Toolbar de DebugKit comprend plusieurs panneaux, qui apparaissent en
+cliquant sur l'icone CakePHP dans le coin en bas à droite de la fenêtre de
+votre navigateur. Une fois que la toolbar est ouverte, vous devriez voir une
+série de boutons. Chacun de ces boutons s'agrandit en un panneau avec des
+informations liées.
+
+Chaque panneau vous permet d'inspecter plusieurs aspects de votre application:
+
+* **Cache** Voir l'utilisation du cache pendant une requête et nettoyer les
+ caches.
+* **Environment** Affiche les variables d'environnement liées à PHP + CakePHP.
+* **History** Affiche une liste des requêtes précédentes, et vous permet de
+ charger et de voir les données de la toolbar des requêtes précédentes.
+* **Include** Voir les fichiers inclus groupés par type.
+* **Log** Affiche toute entrée faite dans les fichiers de log par cette requête.
+* **Packages** Affiche la liste des dépendances avec leur version courante et
+ vous permet de vérifier les packages qui ne sont pas à jour.
+* **Mail** Affiche tous les emails envoyés pendant la requête et permet de
+ prévisualiser les emails pendant le développement sans les envoyer.
+* **Request** Affiche les informations sur la requête courante, GET, POST, les
+ paramètre de Cake, sur la Route Courante et les Cookies.
+* **Session** Affiche les informations actuellement dans la Session.
+* **Sql Logs** Affiche les logs SQL pour chaque connexion à la base de données.
+* **Timer** Affiche tout timers qui a été défini pendant la requête avec
+ ``DebugKit\DebugTimer``, et l'utilisation de la mémoire collectée avec
+ ``DebugKit\DebugMemory``.
+* **Variables** Affiche les variables de View définies dans le controller.
+
+Typiquement, un panneau gère la collection et affiche un type unique
+d'information comme les Logs ou les informations de la Requête. Vous pouvez
+choisir de voir les panneaux de la toolbar ou ajouter vos panneaux
+personnalisés.
+
+Utiliser le Panneau d'Historique
+================================
+
+Le panneau d'historique est l'une des fonctionnalités les plus souvent mal
+comprise de DebugKit. Elle est un moyen de voir les données de la toolbar des
+requêtes précédentes, d'inclure les erreurs et les redirects.
+
+.. figure:: ../_static/history-panel.png
+ :alt: Capture d'écran du panneau historique dans debug kit.
+
+Comme vous pouvez le voir, le panneau contient une liste des requêtes. Sur la
+gauche, vous pouvez voir un point marquant la requête actuelle. Cliquer
+sur n'importe quelles données de requête va charger les données du panneau
+pour cette requête. Quand les données historiques sont chargées, les titres
+du panneau seront colorés pour indiquer que des données alternatives ont été
+chargées.
+
+.. only:: html or epub
+
+ .. video:: ../_static/history-panel-use.mp4
+ :alt: Video du panneau historique en action.
+
+Utiliser le Panneau Mail
+========================
+
+Le panneau de mail vous permet de pister tous les emails envoyés pendant une
+requête.
+
+.. only:: html or epub
+
+ .. video:: ../_static//mail-panel.mp4
+ :alt: Video du panneau Mail en action.
+
+La prévisualisation de mail vous permet de facilement vérifier les emails
+pendant le développement.
+
+.. only:: html or epub
+
+ .. video:: ../_static/img/mail-previewer.gif
+ :alt: Video du panneau Mail en action.
+
+Développer vos Propres Panneaux
+===============================
+
+Vous pouvez créer vos propres panneaux personnalisés pour DebugKit pour
+améliorer le debug de vos applications.
+
+Créer une Classe Panel
+----------------------
+
+Les Classes Panel doivent simplement être placées dans le répertoire
+**src/Panel**. Le nom de fichier doit correspondre au nom de la classe, pour
+que la classe ``MyCustomPanel`` s'attende à avoir un fichier au nom
+**src/Panel/MyCustomPanel.php**::
+
+ namespace App\Panel;
+
+ use DebugKit\DebugPanel;
+
+ /**
+ * Mon panneau Personnalisé
+ */
+ class MyCustomPanel extends DebugPanel
+ {
+ ...
+ }
+
+Remarquez que les panneaux personnalisés doivent étendre la classe
+``DebugPanel``.
+
+Callbacks
+---------
+
+Par défaut, les objets Panel ont deux callbacks, leur permettant de s'insérer
+dans la requête actuelle. Les panneaux s'inscrivent aux events
+``Controller.initialize`` et ``Controller.shutdown``. Si votre panneau doit
+s'inscrire à des events supplémentaires, vous pouvez utiliser la méthode
+``implementedEvents()`` pour définir tous les events auxquels votre panneau
+doit s'intéresser.
+
+Vous devez vous référer aux panneaux intégrés pour avoir quelques exemples sur
+la façon de construire des panneaux.
+
+Elements de Panneau
+-------------------
+
+Chaque panneau s'attend à avoir un element de view qui rend le contenu du
+panneau. Le nom de l'element doit être avec une inflection en underscore du
+nom de la classe.
+Par exemple ``SessionPanel`` a un element nommé **session_panel.ctp**, et
+SqllogPanel a un element nommé **sqllog_panel.ctp**. Ces elements doivent être
+localisés à la racine de votre répertoire **src/Template/Element**.
+
+Titres Personnalisés et Elements
+--------------------------------
+
+Les panneaux doivent choisir leur titre et leur nom d'element par convention.
+Cependant, si vous avez besoin de choisir un nom ou un titre d'element
+personnalisé, vous pouvez définir des méthodes pour personnaliser le
+comportement de votre panneau:
+
+- ``title()`` - Configure le titre qui est affiché dans la toolbar.
+- ``elementName()`` Configure l'element qui doit être utilisé pour un panneau
+ donné.
+
+Méthodes de Hook pour Panneaux
+------------------------------
+
+Vous pouvez également implémenter les méthodes suivantes pour personnaliser
+la manière dont votre panneau se comporte et s'affiche:
+
+* ``shutdown(Event $event)`` Cette méthode collecte et prépare les données pour
+ panneau. Les données sont généralement stockées dans ``$this->_data``.
+* ``summary()`` Peut retourner une chaine de caractères contenu un résumé de
+ données qui sera affiché dans la barre lorsque le panneau est replié. C'est
+ souvent un compteur ou un court résumé.
+* ``data()`` Retourne les données du panneau pour être utilisées dans un
+ element. Cette méthode vous laisse manipuler les données collectées dans
+ la méthode ``shutdown()``. cette méthode **doit** retourner des données
+ sérializables.
+
+Panneaux dans d'autres Plugins
+------------------------------
+
+Les panneaux fournis par les `plugins
+`_ fonctionnent presque entièrement de
+la même façon que les autres plugins, avec quelques différences mineures: Vous
+devez définir ``public $plugin`` comme nom de répertoire de plugin, pour
+que les elements du panneau puissent être localisés au moment de les afficher::
+
+ namespace MyPlugin\Panel;
+
+ use DebugKit\DebugPanel;
+
+ class MyCustomPanel extends DebugPanel
+ {
+ public $plugin = 'MyPlugin';
+ ...
+ }
+
+Pour utiliser un panneau de plugin ou de l'application, mettez à jour
+la configuration du DebugKit de votre application pour ajouter le panneau::
+
+ // dans config/bootstrap.php
+ Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']);
+ Plugin::load('DebugKit', ['bootstrap' => true]);
+
+Ce qui est au-dessus charge tous les panneaux par défaut ainsi que le panneau
+``AppPanel``et le panneau ``MyCustomPanel`` depuis ``MyPlugin``.
diff --git a/app/vendor/cakephp/debug_kit/docs/ja/conf.py b/app/vendor/cakephp/debug_kit/docs/ja/conf.py
new file mode 100644
index 000000000..5871da648
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/ja/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'ja'
diff --git a/app/vendor/cakephp/debug_kit/docs/ja/contents.rst b/app/vendor/cakephp/debug_kit/docs/ja/contents.rst
new file mode 100644
index 000000000..423e20aa4
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/ja/contents.rst
@@ -0,0 +1,5 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP DebugKit
+
+ /index
diff --git a/app/vendor/cakephp/debug_kit/docs/ja/index.rst b/app/vendor/cakephp/debug_kit/docs/ja/index.rst
new file mode 100644
index 000000000..a6f0277cf
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/ja/index.rst
@@ -0,0 +1,267 @@
+Debug Kit
+#########
+
+DebugKit は、CakePHP アプリケーション用のデバッグツールバーと拡張デバッグツールを提供します。
+アプリケーションの設定データ、ログメッセージ、SQL クエリー、およびタイミングデータをすばやく
+確認できます。
+
+.. warning::
+
+ DebugKit は、シングルユーザーのローカル開発環境での使用を目的としています。
+ 共有開発環境、ステージング環境、または設定データと環境変数を隠しておく必要がある環境では、
+ DebugKit を使用しないでください。
+
+インストール
+============
+
+デフォルトで、DebugKit はデフォルトのアプリケーションスケルトンにインストールされています。
+もし削除してしまって再インストールしたい場合は、以下のコマンドをアプリケーションの
+ルートディレクトリー (composer.json ファイルのある場所) で実行してください。 ::
+
+ php composer.phar require --dev cakephp/debug_kit "~3.0"
+
+そして以下のコマンドでプラグインを有効化する必要があります。 ::
+
+ bin/cake plugin load DebugKit
+
+設定
+====
+
+* ``DebugKit.panels`` - DebugKit のパネルを有効化または無効化します。
+ 次のようにして、任意の標準パネルを無効にすることができます。 ::
+
+ // DebugKit をロードする前に
+ Configure::write('DebugKit.panels', ['DebugKit.Packages' => false]);
+
+* ``DebugKit.includeSchemaReflection`` - スキーマリフレクションクエリーの
+ ロギングを有効にするには、true に設定します。デフォルトは無効になっています。
+
+* ``DebugKit.safeTld`` - ローカル開発用のトップレベルドメインのホワイトリストを設定します。
+ これにより安全でないと判断したホスト上で DebugKit を表示できるようになります。 ::
+
+ // 例: http://foo.bar.dev または http://my-shop.local のドメインはローカルとして許可する
+ Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']);
+
+* ``DebugKit.forceEnable`` - DebugKit を強制的に表示します。これを使うときは注意してください。
+ 通常は単純にローカルのトップレベルドメインをホワイトリストに追加したほうが安全です。 使用例::
+
+ // DebugKit をロードする前に
+ Configure::write('DebugKit.forceEnable', true);
+
+データベース設定
+----------------
+
+デフォルトでは DebugKit はアプリケーションの ``/tmp`` 内の SQLite データベースに
+パネルデータを保持します。もし pdo_sqlite をインストールできない場合は、
+**config/app.php** ファイル に ``debug_kit`` コネクションを定義すると
+DebugKit が異なるデータベースを使用するように設定できます。例::
+
+ /**
+ * debug_kit コネクションは DebugKit のメタデータを格納します。
+ */
+ 'debug_kit' => [
+ 'className' => 'Cake\Database\Connection',
+ 'driver' => 'Cake\Database\Driver\Mysql',
+ 'persistent' => false,
+ 'host' => 'localhost',
+ //'port' => 'nonstandard_port_number',
+ 'username' => 'dbusername', // Your DB username here
+ 'password' => 'dbpassword', // Your DB password here
+ 'database' => 'debug_kit',
+ 'encoding' => 'utf8',
+ 'timezone' => 'UTC',
+ 'cacheMetadata' => true,
+ 'quoteIdentifiers' => false,
+ //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
+ ],
+
+**tmp/debug_kit.sqlite** ファイルは、いつでも削除することができます。
+DebugKit は、必要に応じて、それを再生成します。
+
+ツールバーの使い方
+==================
+
+DebugKit ツールバーは、いくつかのパネルで構成されています。これらのパネルは、
+DebugKit をインストールしてロードした後、ブラウザーの右下隅にある CakePHP
+アイコンをクリックすると表示されます。各パネルは、パネルクラスとビューエレメントで構成されています。
+一般的に、パネルは単一の種類の情報のコレクションの処理やログやリクエスト情報の表示を行います。
+ツールバーからパネルを表示したり、独自のカスタムパネルを追加することを選択できます。
+
+各パネルはアプリケーションの様々な側面を見せてくれます。
+
+* **Cache** リクエスト中のキャッシュの使用状況の確認とキャッシュのクリアー。
+* **Environment** PHP 及び CakePHP に関連する環境変数の表示。
+* **History** 以前のリクエストの一覧の表示と、以前のリクエストのツールバーデータの読み込みと表示。
+* **Include** タイプごとにグループ化されたインクルードファイルを表示。
+* **Log** このリクエスト中にログファイルに加えられたすべてのエントリーを表示。
+* **Packages** 現在のバージョンのパッケージの依存関係の一覧を表示し、
+ 古いパッケージをチェックすることができます。
+* **Mail** このリクエスト中の全てのメール送信を表示し、
+ 送信せずに開発中のメールのプレビューができます。
+* **Request** 現在のリクエスト、GET、POST、Cake パラメーター、現在のルート情報、クッキー情報の表示。
+* **Session** 現在のセッション情報の表示。
+* **Sql Logs** 各データベースコネクションの SQL ログの表示。
+* **Timer** リクエスト中に ``DebugKit\DebugTimer`` で設定されたすべてのタイマーと、
+ ``DebugKit\DebugMemory`` で収集されたメモリー使用状況の表示。
+* **Variables** コントローラーでセットされたビュー変数の表示。
+
+履歴パネルを使用する
+====================
+
+履歴パネルは DebugKit で最も勘違いされやすい機能の一つです。
+エラーやリダイレクトを含む以前のリクエストのツールバーのデータを表示することができます。
+
+.. figure:: ../_static/history-panel.png
+ :alt: Screenshot of the history panel in debug kit.
+
+ご覧のようにパネルにはリクエストの一覧が含まれます。左側にドットがついているのがアクティブな
+リクエストです。どれかのリクエストをクリックするとそのリクエストのデータが読み込まれます。
+履歴データがロードされると代替のデータが読み込まれたことを示すようにパネルのタイトルが遷移します。
+
+.. only:: html or epub
+
+ .. video:: ../_static/history-panel-use.mp4
+ :alt: Video of history panel in action.
+
+メールパネルを使用
+==================
+
+メールパネルは、リクエストの間に送信された全てのメールを追跡することができます。
+
+.. only:: html or epub
+
+ .. video:: ../_static/mail-panel.mp4
+ :alt: Video of mail panel in action
+
+メーラープレビューは、開発中のメールを簡単にプレビューすることができます。
+
+.. only:: html or epub
+
+ .. video:: ../_static/mail-previewer.mp4
+ :alt: Video of mail panel in action
+
+プレビュークラスの作成
+------------------------
+
+メールを送信する前にプレビューするには、受信者と mailer メソッドに必要なテンプレート変数を
+定義するプレビュークラスを作成する必要があります。 ::
+
+ // src/Mailer/MailPreview/WelcomePreview.php の中で
+ namespace App\Mailer\Preview;
+
+ use DebugKit\Mailer\MailPreview;
+
+ class WelcomePreview extends MailPreview
+ {
+ public function welcome()
+ {
+ $mailer = $this->getMailer('Welcome');
+ // メーラーのテンプレート変数受信者を設定します。
+
+ return $mailer;
+ }
+ }
+
+MailPreview クラスは、 アプリケーションまたはプラグインの ``Mailer\Preview``
+名前空間に存在し、 ``Preview`` を使用する必要があります。
+
+独自のパネルを開発する
+======================
+
+アプリケーションのデバッグを補助するための DebugKit の独自のカスタムパネルを
+作成することができます。
+
+パネルクラスを作成する
+----------------------
+
+パネルクラスは単に **src/Panel** ディレクトリーに設置してください。ファイル名はクラス名と
+一致する必要があります。 つまり ``MyCustomPanel`` クラスは
+**src/Panel/MyCustomPanel.php** というファイル名であることを想定しています。 ::
+
+ namespace App\Panel;
+
+ use DebugKit\DebugPanel;
+
+ /**
+ * My Custom Panel
+ */
+ class MyCustomPanel extends DebugPanel
+ {
+ ...
+ }
+
+カスタムパネルは ``DebugPanel`` クラスを拡張する必要があることに注意してください。
+
+コールバック
+------------
+
+デフォルトではパネルオブジェクトには、現在のリクエストをフックすることができる
+2つのコールバックがあります。パネルは ``Controller.initialize`` と
+``Controller.shutdown`` のイベントを取得します。もしパネルが追加のイベントを
+取得したい場合は、 ``implementedEvents()`` メソッドを使用し、
+パネルが必要とするすべてのイベントを定義できます。
+
+どのようにパネルを構築するかについてのいくつかの例として、ビルトインのパネルを参照してください。
+
+パネルの構成要素
+----------------
+
+各パネルはパネルのコンテンツを描画するためのビューエレメントがあることを想定しています。
+エレメント名はアンダースコアー区切りのクラス名である必要があります。
+たとえば、 ``SessionPanel`` は **session_panel.ctp** という名前のエレメントを持ちます。
+また、SqllogPanelは **sqllog_panel.ctp** という名前のエレメントを持ちます。
+これらのエレメントは **src/Template/Element** ディレクトリーのルートに設置する必要があります。
+
+カスタムのタイトルとエレメント
+------------------------------
+
+パネルは慣例を元にそのタイトルとエレメント名を補足します。もしカスタムのタイトルやエレメント名を
+付けたい場合は、パネルの振る舞いをカスタムするメソッドを定義することができます。
+
+- ``title()`` - ツールバー上に表示されるタイトルを設定します
+- ``elementName()`` - 与えられたパネルがどのエレメントを使用するかを設定します
+
+パネルフックメソッド
+--------------------
+
+また、パネルの動作や表示方法をカスタムするために以下のフックメソッドを実装することができます。
+
+* ``shutdown(Event $event)`` このメソッドは通常はパネルのデータの収集と準備を行います。
+* ``summary()`` パネルが折りたたまれている時に表示されるサマリーデータの文字列を
+ 返すことができます。多くの場合、これは件数や短いサマリー情報です。
+* ``data()`` エレメントのコンテキストで使用されるパネルのデータを返します。
+ このフックメソッドは ``shutdown()`` で収集されるデータを更に操作することができます。
+ このメソッドはシリアライズ化可能なデータを **必ず** 返す必要があります。
+
+他のプラグインのパネル
+----------------------
+
+パネルはひとつの小さな違いを除き、`plugins `_
+とほぼ同じ動作を提供します。レンダリング時にパネルのエレメントを配置できるように、
+``public $plugin`` にプラグインディレクトリーの名前を必ずセットする必要があります。 ::
+
+ namespace MyPlugin\Panel;
+
+ use DebugKit\DebugPanel;
+
+ class MyCustomPanel extends DebugPanel
+ {
+ public $plugin = 'MyPlugin';
+ ...
+ }
+
+プラグインやアプリケーションパネルを使用するには、アプリケーションの DebugKit の設定を
+更新します。 ::
+
+ // src/Application.php の bootstrap() メソッドの中に追加
+ Configure::write('DebugKit.panels', ['App', 'MyPlugin.MyCustom']);
+ $this->addPlugin('DebugKit', ['bootstrap' => true]);
+
+上記は、すべてのデフォルトのパネルと同じように ``AppPanel`` と ``MyPlugin`` の
+``MyCustomPanel`` パネルを読みこみます。
+
+ヘルパー関数
+================
+
+* ``sql()`` ORM クエリーから SQL をダンプします。
+* ``sqld()`` ORM クエリーから SQL をダンプして終了します。
diff --git a/app/vendor/cakephp/debug_kit/docs/pt/conf.py b/app/vendor/cakephp/debug_kit/docs/pt/conf.py
new file mode 100644
index 000000000..9e22cb017
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/pt/conf.py
@@ -0,0 +1,9 @@
+import sys, os
+
+# Append the top level directory of the docs, so we can import from the config dir.
+sys.path.insert(0, os.path.abspath('..'))
+
+# Pull in all the configuration options defined in the global config file..
+from config.all import *
+
+language = 'pt'
diff --git a/app/vendor/cakephp/debug_kit/docs/pt/contents.rst b/app/vendor/cakephp/debug_kit/docs/pt/contents.rst
new file mode 100644
index 000000000..423e20aa4
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/pt/contents.rst
@@ -0,0 +1,5 @@
+.. toctree::
+ :maxdepth: 2
+ :caption: CakePHP DebugKit
+
+ /index
diff --git a/app/vendor/cakephp/debug_kit/docs/pt/index.rst b/app/vendor/cakephp/debug_kit/docs/pt/index.rst
new file mode 100644
index 000000000..d73d860c6
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/docs/pt/index.rst
@@ -0,0 +1,216 @@
+Debug Kit
+#########
+
+DebugKit é um plugin suportado pelo time principal do CakePHP que oferece uma
+barra de ferramentas para auxiliar na depuração de aplicações do CakePHP.
+
+Instalação
+==========
+
+Por padrão o DebugKit é instalado com o esqueleto padrão da aplicação. Se
+você o removeu e gostaria de reinstalá-lo, você pode executar o seguinte comando
+a partir do diretório raiz da aplicação
+(onde o arquivo composer.json está localizado)::
+
+ php composer.phar require --dev cakephp/debug_kit "~3.0"
+
+Então, você precisará habilitar o plugin ao executar o seguinte comando::
+
+ bin/cake plugin load DebugKit
+
+Armazenamento do DebugKit
+=========================
+
+Por padrão, o DebugKit usa um pequeno banco de dados SQLite no diretório
+``/tmp`` de sua aplicação para armazenar os dados referentes ao painel
+de informações. Se você quiser que o DebugKit armazene seus dados em outro
+lugar, é necessário configurar uma nova conexão com o nome ``debug_kit`` .
+
+Configuração do banco de dados
+------------------------------
+
+Como informado anteriormente, por padrão, o DebugKit armazenará os dados do
+painel em um banco de dados SQLite no diretório ``/tmp`` de sua aplicação. Se
+você não puder instalar a extensão pdo_sqlite do PHP, você pode configurar o
+DebugKit para usar um banco de dados diferente ao definir uma conexão
+``debug_kit`` em seu arquivo **config/app.php**. Por exemplo::
+
+ /**
+ * A conexão debug_kit armazena meta-dados do DebugKit.
+ */
+ 'debug_kit' => [
+ 'className' => 'Cake\Database\Connection',
+ 'driver' => 'Cake\Database\Driver\Mysql',
+ 'persistent' => false,
+ 'host' => 'localhost',
+ //'port' => 'nonstandard_port_number',
+ 'username' => 'dbusername', // Your DB username here
+ 'password' => 'dbpassword', // Your DB password here
+ 'database' => 'debug_kit',
+ 'encoding' => 'utf8',
+ 'timezone' => 'UTC',
+ 'cacheMetadata' => true,
+ 'quoteIdentifiers' => false,
+ //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
+ ],
+
+Uso da barra de ferramentas
+===========================
+
+A barra de ferramentas do DebugKit é composta por vários painéis, que são
+exibidos ao clicar no ícone do CakePHP no canto inferior direito da janela do
+seu navegador. Uma vez que a barra de ferramentas é aberta, você deverá ver uma
+série de botões. Cada um desses botões se expande em um painel de informações
+relacionadas.
+
+Cada painel permite a você observar aspectos diferentes da sua aplicação:
+
+* **Cache** Exibe o uso de cache durante uma solicitação e limpa caches.
+* **Environment** Exibe variáveis de ambiente relacionadas com PHP + CakePHP.
+* **History** Exibe uma lista de requisições anteriores, e permite que você
+ carregue e veja dados da barra de ferramentas a partir de solicitações
+ anteriores.
+* **Include** Exibe os arquivos inclusos divididos por grupo.
+* **Log** Exibe todas as entradas feitas nos arquivos de log este pedido.
+* **Request** Exibe informações sobre a requisição atual, GET, POST, informações
+ sobre a rota atual do Cake e Cookies.
+* **Session** Exibe a informação atual da sessão.
+* **Sql Logs** Exibe logs SQL para cada conexão com o banco de dados.
+* **Timer** Exibe qualquer temporizador que fora definido durante a requisição
+ com ``DebugKit\DebugTimer``, e memória utilizada coletada com
+ ``DebugKit\DebugMemory``.
+* **Variables** Exibe variáveis de View definidas em um Controller.
+
+Tipicamente, um painel manipula a recolha e apresentação de um único tipo
+de informações como logs ou informações de requisições. Você pode optar por
+visualizar os painéis padrões da barra de ferramentas ou adicionar seus próprios
+painéis personalizados.
+
+Usando o painel History
+=======================
+
+O painel History é uma das características mais frequentemente confundidas do
+DebugKit. Ele oferece uma forma de visualizar os dados de requisições
+anteriores na barra de ferramentas, incluindo erros e redirecionamentos.
+
+.. figure:: /_static/img/history-panel.png
+ :alt: Screenshot do painel History no DebugKit.
+
+Como você pode ver, o painel contém uma lista de requisições. Na esquerda você
+pode ver um ponto marcando a requisição ativa. Clicar em qualquer requisição vai
+carregar os dados referentes a mesma no painel. Quando os dados são carregados,
+os títulos do painel vão sofrer uma transição para indicar que informações
+alternativos foram carregados.
+
+.. only:: html or epub
+
+ .. figure:: /_static/img/history-panel-use.gif
+ :alt: Video do painel History em ação.
+
+Desenvolvendo seus próprios painéis
+===================================
+
+Você pode criar seus próprios painéis customizados do DebugKit para ajudar
+na depuração de suas aplicações.
+
+Criando uma Panel Class
+-----------------------
+
+Panel Classes precisam ser colocadas no diretório **src/Panel**. O
+nome do arquivo deve combinar com o nome da classe, então a classe
+``MyCustomPanel`` deveria remeter ao nome de arquivo
+**src/Panel/MyCustomPanel.php**::
+
+ namespace App\Panel;
+
+ use DebugKit\DebugPanel;
+
+ /**
+ * My Custom Panel
+ */
+ class MyCustomPanel extends DebugPanel
+ {
+ ...
+ }
+
+Perceba que painéis customizados são necessários para extender a classe
+``DebugPanel``.
+
+Callbacks
+---------
+
+Por padrão objetos do painel possuem dois callbacks, permitindo-lhes acoplar-se
+na requisição atual. Painéis inscrevem-se aos eventos ``Controller.initialize``
+e ``Controller.shutdown``. Se o seu painel precisa inscrever-se a eventos
+adicionais, você pode usar o método ``implementedEvents`` para definir todos os
+eventos aos quais o seu painel possa precisar estar inscrito.
+
+Você deveria estudar os painéis nativos para absorver alguns exemplos de como
+construir painéis.
+
+Elementos do painel
+-------------------
+
+Cada painel deve ter um elemento view que renderiza o conteúdo do mesmo.
+O nome do elemento deve ser sublinhado e flexionado a partir do nome da classe.
+Por exemplo ``SessionPanel`` deve possuir um elemento nomeado
+**session_panel.ctp**, e SqllogPanel deve possuir um elemento nomeado
+**sqllog_panel.ctp**. Estes elementos devem estar localizados na raiz do seu
+diretório **src/Template/Element**.
+
+Títulos personalizados e Elementos
+----------------------------------
+
+Os painéis devem relacionar o seu título e o nome do elemento por convenção. No
+entanto, se você precisa escolher um nome de elemento personalizado ou título,
+você pode definir métodos para customizar o comportamento do seu painel:
+
+- ``title()`` - Configure o título que é exibido na barra de ferramentas.
+- ``elementName()`` - Configure qual elemento deve ser utilizada para um
+ determinado painel.
+
+Métodos de captura
+------------------
+
+Você também pode implementar os seguintes métodos para customizar como o seu
+painel se comporta e se aparenta:
+
+* ``shutdown(Event $event)`` Esse método coleta e prepara os dados para o
+ painel. Os dados são geralmente armazenados em ``$this->_data``.
+* ``summary()`` Este método retorna uma *string* de dados resumidos para serem
+ exibidos na *toolbar*, mesmo quando um painel está minimizado. Frequentemente,
+ é um contador ou um pequeno resumo de informações.
+* ``data()`` Este método retorna os dados do painel que serão usados como
+ contexto para o elemento. Você pode manipular os dados coletados no método
+ ``shutdown()``. Esse método **deve** retornar dados que podem ser
+ serializados.
+
+Painéis em outros plugins
+-------------------------
+
+Painéis disponibilizados por `plugins
+`_ funcionam quase que totalmente
+como outros plugins, com uma pequena diferença: Você deve definir ``public
+$plugin`` como o nome do diretório do plugin, com isso os elementos do painel
+poderão ser encontrados no momento de renderização::
+
+ namespace MyPlugin\Panel;
+
+ use DebugKit\DebugPanel;
+
+ class MyCustomPanel extends DebugPanel
+ {
+ public $plugin = 'MyPlugin';
+ ...
+ }
+
+Para usar um plugin ou painel da aplicação, atualize a configuração do DebugKit
+de sua aplicação para incluir o painel::
+
+ Configure::write(
+ 'DebugKit.panels',
+ array_merge(Configure::read('DebugKit.panels'), ['MyCustomPanel'])
+ );
+
+O código acima deve carregar todos os painéis padrão tanto como os outros
+painéis customizados do ``MyPlugin``.
diff --git a/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php b/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php
index 440e15110..3634e5579 100644
--- a/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php
+++ b/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php
@@ -75,7 +75,7 @@ public function init(array $config = [])
return true;
}
- $registry = new CacheRegistry;
+ $registry = new CacheRegistry();
$this->_engine = $registry->load('spies', $this->_config);
unset($registry);
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/ComposerController.php b/app/vendor/cakephp/debug_kit/src/Controller/ComposerController.php
index d1f72e230..481747418 100644
--- a/app/vendor/cakephp/debug_kit/src/Controller/ComposerController.php
+++ b/app/vendor/cakephp/debug_kit/src/Controller/ComposerController.php
@@ -13,10 +13,6 @@
*/
namespace DebugKit\Controller;
-use Cake\Controller\Controller;
-use Cake\Core\Configure;
-use Cake\Event\Event;
-use Cake\Http\Exception\NotFoundException;
use Cake\View\JsonView;
use Composer\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
@@ -25,9 +21,8 @@
/**
* Provides utility features need by the toolbar.
*/
-class ComposerController extends Controller
+class ComposerController extends DebugKitController
{
-
/**
* {@inheritDoc}
*/
@@ -38,20 +33,6 @@ public function initialize()
$this->viewBuilder()->setClassName(JsonView::class);
}
- /**
- * Before filter handler.
- *
- * @param \Cake\Event\Event $event The event.
- * @return void
- * @throws \Cake\Http\Exception\NotFoundException
- */
- public function beforeFilter(Event $event)
- {
- if (!Configure::read('debug')) {
- throw new NotFoundException();
- }
- }
-
/**
* Check outdated composer dependencies
*
@@ -65,7 +46,7 @@ public function checkDependencies()
$input = new ArrayInput([
'command' => 'outdated',
'--no-interaction' => true,
- '--direct' => (bool)$this->request->data('direct'),
+ '--direct' => filter_var($this->request->getData('direct'), FILTER_VALIDATE_BOOLEAN),
]);
$output = $this->executeComposerCommand($input);
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/DashboardController.php b/app/vendor/cakephp/debug_kit/src/Controller/DashboardController.php
new file mode 100644
index 000000000..079db5b21
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/src/Controller/DashboardController.php
@@ -0,0 +1,68 @@
+viewBuilder()->setLayout('dashboard');
+ }
+
+ /**
+ * Dashboard.
+ *
+ * @return void
+ * @throws \Cake\Network\Exception\NotFoundException
+ */
+ public function index()
+ {
+ $this->loadModel('DebugKit.Requests');
+
+ $data = [
+ 'driver' => get_class($this->Requests->getConnection()->getDriver()),
+ 'rows' => $this->Requests->find()->count(),
+ ];
+
+ $this->set('connection', $data);
+ }
+
+ /**
+ * Reset SQLite DB.
+ *
+ * @return \Cake\Http\Response
+ */
+ public function reset()
+ {
+ $this->request->allowMethod('post');
+ $this->loadModel('DebugKit.Requests');
+
+ $this->Requests->Panels->deleteAll('1=1');
+ $this->Requests->deleteAll('1=1');
+
+ return $this->redirect(['action' => 'index']);
+ }
+}
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php b/app/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php
new file mode 100644
index 000000000..fa70db79c
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/src/Controller/DebugKitController.php
@@ -0,0 +1,54 @@
+getRequest()->getAttribute('authorization');
+ if ($authorizationService instanceof \Authorization\AuthorizationService) {
+ if (Configure::read('DebugKit.ignoreAuthorization')) {
+ $authorizationService->skipAuthorization();
+ } else {
+ Log::info(
+ "Cake Authorization plugin is enabled. If you would like " .
+ "to force DebugKit to ignore it, set `DebugKit.ignoreAuthorization` " .
+ " Configure option to true."
+ );
+ }
+ }
+ }
+}
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php b/app/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php
index 849312653..31b22dc4f 100644
--- a/app/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php
+++ b/app/vendor/cakephp/debug_kit/src/Controller/MailPreviewController.php
@@ -14,9 +14,7 @@
namespace DebugKit\Controller;
use Cake\Collection\CollectionInterface;
-use Cake\Controller\Controller;
use Cake\Core\App;
-use Cake\Core\Configure;
use Cake\Core\Plugin as CorePlugin;
use Cake\Event\Event;
use Cake\Http\Exception\NotFoundException;
@@ -33,22 +31,8 @@
*
* @property \DebugKit\Model\Table\PanelsTable $Panels
*/
-class MailPreviewController extends Controller
+class MailPreviewController extends DebugKitController
{
- /**
- * Before filter callback.
- *
- * @param \Cake\Event\Event $event The beforeFilter event.
- * @return void
- * @throws \Cake\Http\Exception\NotFoundException
- */
- public function beforeFilter(Event $event)
- {
- if (!Configure::read('debug')) {
- throw new NotFoundException();
- }
- }
-
/**
* Before render handler.
*
@@ -150,7 +134,7 @@ protected function respondWithPart($email, $partType)
$part = $this->findPart($email, $partType);
if ($part === false) {
- throw new NotFoundException(__d('debug_kit', "Email part '{0}' not found in email", $partType));
+ throw new NotFoundException(__d('debug_kit', "Email part ''{0}'' not found in email", $partType));
}
$response = $this->response->withType($partType);
@@ -202,7 +186,7 @@ protected function getMailPreviewClasses()
$base = str_replace(".php", "", basename($file));
$class = App::className($plugin . $base, 'Mailer/Preview');
if ($class) {
- yield ['plugin' => trim($plugin, '.'), 'class' => new $class];
+ yield ['plugin' => trim($plugin, '.'), 'class' => new $class()];
}
}
});
@@ -269,7 +253,7 @@ protected function findPreview($previewName, $emailName, $plugin = null)
if (!$realClass) {
throw new NotFoundException("Mailer preview ${previewName} not found");
}
- $mailPreview = new $realClass;
+ $mailPreview = new $realClass();
$email = $mailPreview->find($emailName);
if (!$email) {
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php b/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php
index f93e82092..4cbe1b3ca 100644
--- a/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php
+++ b/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php
@@ -12,8 +12,6 @@
*/
namespace DebugKit\Controller;
-use Cake\Controller\Controller;
-use Cake\Core\Configure;
use Cake\Event\Event;
use Cake\Http\Exception\NotFoundException;
@@ -22,9 +20,8 @@
*
* @property \DebugKit\Model\Table\PanelsTable $Panels
*/
-class PanelsController extends Controller
+class PanelsController extends DebugKitController
{
-
/**
* components
*
@@ -32,21 +29,6 @@ class PanelsController extends Controller
*/
public $components = ['RequestHandler', 'Cookie'];
- /**
- * Before filter handler.
- *
- * @param \Cake\Event\Event $event The event.
- * @return void
- * @throws \Cake\Http\Exception\NotFoundException
- */
- public function beforeFilter(Event $event)
- {
- // TODO add config override.
- if (!Configure::read('debug')) {
- throw new NotFoundException();
- }
- }
-
/**
* Before render handler.
*
@@ -83,7 +65,7 @@ public function index($requestId = null)
}
$this->set([
'_serialize' => ['panels'],
- 'panels' => $panels
+ 'panels' => $panels,
]);
}
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/RequestsController.php b/app/vendor/cakephp/debug_kit/src/Controller/RequestsController.php
index 91134108c..df2d21fca 100644
--- a/app/vendor/cakephp/debug_kit/src/Controller/RequestsController.php
+++ b/app/vendor/cakephp/debug_kit/src/Controller/RequestsController.php
@@ -12,32 +12,24 @@
*/
namespace DebugKit\Controller;
-use Cake\Controller\Controller;
-use Cake\Core\Configure;
use Cake\Event\Event;
-use Cake\Http\Exception\NotFoundException;
/**
* Provides access to panel data.
*
* @property \DebugKit\Model\Table\RequestsTable $Requests
*/
-class RequestsController extends Controller
+class RequestsController extends DebugKitController
{
-
/**
* Before filter handler.
*
* @param \Cake\Event\Event $event The event.
* @return void
- * @throws \Cake\Http\Exception\NotFoundException
*/
public function beforeFilter(Event $event)
{
- // TODO add config override
- if (!Configure::read('debug')) {
- throw new NotFoundException();
- }
+ parent::beforeFilter($event);
$this->response = $this->response->withHeader('Content-Security-Policy', '');
}
diff --git a/app/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php b/app/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php
index b6412845a..aad2b1ad1 100644
--- a/app/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php
+++ b/app/vendor/cakephp/debug_kit/src/Controller/ToolbarController.php
@@ -13,17 +13,13 @@
namespace DebugKit\Controller;
use Cake\Cache\Cache;
-use Cake\Controller\Controller;
-use Cake\Core\Configure;
-use Cake\Event\Event;
use Cake\Http\Exception\NotFoundException;
/**
* Provides utility features need by the toolbar.
*/
-class ToolbarController extends Controller
+class ToolbarController extends DebugKitController
{
-
/**
* components
*
@@ -38,21 +34,6 @@ class ToolbarController extends Controller
*/
public $viewClass = 'Cake\View\JsonView';
- /**
- * Before filter handler.
- *
- * @param \Cake\Event\Event $event The event.
- * @return void
- * @throws \Cake\Http\Exception\NotFoundException
- */
- public function beforeFilter(Event $event)
- {
- // TODO add config override.
- if (!Configure::read('debug')) {
- throw new NotFoundException();
- }
- }
-
/**
* Clear a named cache.
*
diff --git a/app/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php b/app/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php
index f91082bd7..15fc9d8e8 100644
--- a/app/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php
+++ b/app/vendor/cakephp/debug_kit/src/Database/Log/DebugLog.php
@@ -166,7 +166,7 @@ public function log(LoggedQuery $query)
$this->_queries[] = [
'query' => $query->query,
'took' => $query->took,
- 'rows' => $query->numRows
+ 'rows' => $query->numRows,
];
}
diff --git a/app/vendor/cakephp/debug_kit/src/DebugInclude.php b/app/vendor/cakephp/debug_kit/src/DebugInclude.php
index af3f1c293..60964869d 100644
--- a/app/vendor/cakephp/debug_kit/src/DebugInclude.php
+++ b/app/vendor/cakephp/debug_kit/src/DebugInclude.php
@@ -48,7 +48,7 @@ class DebugInclude
'Auth', 'Cache', 'Collection', 'Config', 'Configure', 'Console', 'Component', 'Controller',
'Behavior', 'Database', 'Datasource', 'Model', 'Template', 'View', 'Utility',
'Network', 'Routing', 'I18n', 'Log', 'Error', 'Event', 'Form', 'Filesystem',
- 'ORM', 'Filter', 'Validation'
+ 'ORM', 'Filter', 'Validation',
];
/**
diff --git a/app/vendor/cakephp/debug_kit/src/DebugTimer.php b/app/vendor/cakephp/debug_kit/src/DebugTimer.php
index 6e28098d9..673a09c08 100644
--- a/app/vendor/cakephp/debug_kit/src/DebugTimer.php
+++ b/app/vendor/cakephp/debug_kit/src/DebugTimer.php
@@ -66,7 +66,7 @@ public static function start($name = null, $message = null)
self::$_timers[$name] = [
'start' => $start,
'message' => $message,
- 'named' => $named
+ 'named' => $named,
];
return true;
@@ -136,7 +136,7 @@ public static function getAll($clear = false)
'start' => 0,
'end' => $_end - $start,
'time' => round($_end - $start, 6),
- 'named' => null
+ 'named' => null,
];
foreach (self::$_timers as $name => $timer) {
if (!isset($timer['end'])) {
@@ -145,7 +145,7 @@ public static function getAll($clear = false)
$times[$name] = array_merge($timer, [
'start' => $timer['start'] - $start,
'end' => $timer['end'] - $start,
- 'time' => self::elapsedTime($name)
+ 'time' => self::elapsedTime($name),
]);
}
if ($clear) {
diff --git a/app/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php b/app/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php
index 28698b34b..5866c3504 100644
--- a/app/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php
+++ b/app/vendor/cakephp/debug_kit/src/Mailer/PreviewResult.php
@@ -47,8 +47,8 @@ protected function processMailer(Mailer $mailer, $method)
$prop->setAccessible(true);
$email = $prop->getValue($mailer);
- if (!$email->getTemplate()) {
- $email->setTemplate($method);
+ if (!$email->viewBuilder()->getTemplate()) {
+ $email->viewBuilder()->setTemplate($method);
}
$render = (new ReflectionClass($email))
diff --git a/app/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php b/app/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php
index 75a47d73b..5e84e24c3 100644
--- a/app/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php
+++ b/app/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php
@@ -68,7 +68,7 @@ public function send(Email $email)
$headers = $email->getHeaders(['from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc']);
$parts = [
'text' => $email->message(Email::MESSAGE_TEXT),
- 'html' => $email->message(Email::MESSAGE_HTML)
+ 'html' => $email->message(Email::MESSAGE_HTML),
];
$headers['Subject'] = $email->getOriginalSubject();
@@ -81,4 +81,61 @@ public function send(Email $email)
return $result;
}
+
+ /**
+ * Proxy unknown methods to the wrapped object
+ *
+ * @param string $method The method to call
+ * @param array $args The args to call $method with.
+ * @return mixed
+ */
+ public function __call($method, array $args)
+ {
+ return call_user_func_array([$this->originalTransport, $method], $args);
+ }
+
+ /**
+ * Proxy property reads to the wrapped object
+ *
+ * @param string $name The property to read.
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return $this->originalTransport->{$name};
+ }
+
+ /**
+ * Proxy property changes to the wrapped object
+ *
+ * @param string $name The property to read.
+ * @param mixed $value The property value.
+ * @return mixed
+ */
+ public function __set($name, $value)
+ {
+ return $this->originalTransport->{$name} = $value;
+ }
+
+ /**
+ * Proxy property changes to the wrapped object
+ *
+ * @param string $name The property to read.
+ * @return bool
+ */
+ public function __isset($name)
+ {
+ return isset($this->originalTransport->{$name});
+ }
+
+ /**
+ * Proxy property changes to the wrapped object
+ *
+ * @param string $name The property to delete.
+ * @return void
+ */
+ public function __unset($name)
+ {
+ unset($this->originalTransport->{$name});
+ }
}
diff --git a/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php b/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php
index b9ba8099f..5e92c3a58 100644
--- a/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php
+++ b/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php
@@ -38,6 +38,7 @@ class Panel extends Entity
* Over certain sizes PDO will return file handles.
* For backwards compatibility and consistency we smooth over that difference here.
*
+ * @param mixed $content Content
* @return string
*/
protected function _getContent($content)
diff --git a/app/vendor/cakephp/debug_kit/src/Model/Table/LazyTableTrait.php b/app/vendor/cakephp/debug_kit/src/Model/Table/LazyTableTrait.php
index ab2cfe2b9..418eee5c0 100644
--- a/app/vendor/cakephp/debug_kit/src/Model/Table/LazyTableTrait.php
+++ b/app/vendor/cakephp/debug_kit/src/Model/Table/LazyTableTrait.php
@@ -13,8 +13,6 @@
namespace DebugKit\Model\Table;
use Cake\Core\App;
-use Cake\Database\Connection;
-use Cake\Datasource\FixtureInterface;
use PDOException;
/**
@@ -27,7 +25,6 @@
*/
trait LazyTableTrait
{
-
/**
* Ensures the tables for the given fixtures exist in the schema.
*
@@ -39,7 +36,7 @@ trait LazyTableTrait
*/
public function ensureTables(array $fixtures)
{
- /* @var Connection $connection */
+ /** @var \Cake\Database\Connection $connection */
$connection = $this->getConnection();
$schema = $connection->getSchemaCollection();
@@ -54,17 +51,27 @@ public function ensureTables(array $fixtures)
}
}
- foreach ($fixtures as $name) {
- $class = App::className($name, 'Test/Fixture', 'Fixture');
- if ($class === false) {
- throw new \RuntimeException("Unknown fixture '$name'.");
+ try {
+ foreach ($fixtures as $name) {
+ $class = App::className($name, 'Test/Fixture', 'Fixture');
+ if ($class === false) {
+ throw new \RuntimeException("Unknown fixture '$name'.");
+ }
+ /** @var \Cake\Datasource\FixtureInterface $fixture */
+ $fixture = new $class($connection->configName());
+ if (in_array($fixture->table, $existing)) {
+ continue;
+ }
+ $fixture->create($connection);
}
- /* @var FixtureInterface $fixture */
- $fixture = new $class($connection->configName());
- if (in_array($fixture->table, $existing)) {
- continue;
+ } catch (PDOException $e) {
+ if (strpos($e->getMessage(), 'unable to open')) {
+ throw new RuntimeException(
+ 'Could not create a SQLite database. ' .
+ 'Ensure that your webserver has write access to the database file and folder it is in.'
+ );
}
- $fixture->create($connection);
+ throw $e;
}
}
}
diff --git a/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php b/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php
index 25e943f72..11b36bfac 100644
--- a/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php
+++ b/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php
@@ -30,7 +30,6 @@
*/
class PanelsTable extends Table
{
-
use LazyTableTrait;
/**
diff --git a/app/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php b/app/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php
index c30c5a2d4..ad82c3dc9 100644
--- a/app/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php
+++ b/app/vendor/cakephp/debug_kit/src/Model/Table/RequestsTable.php
@@ -13,6 +13,7 @@
namespace DebugKit\Model\Table;
use Cake\Core\Configure;
+use Cake\Database\Driver\Sqlite;
use Cake\ORM\Query;
use Cake\ORM\Table;
use DebugKit\Model\Entity\Request;
@@ -30,7 +31,6 @@
*/
class RequestsTable extends Table
{
-
use LazyTableTrait;
/**
@@ -46,8 +46,8 @@ public function initialize(array $config)
]);
$this->addBehavior('Timestamp', [
'events' => [
- 'Model.beforeSave' => ['requested_at' => 'new']
- ]
+ 'Model.beforeSave' => ['requested_at' => 'new'],
+ ],
]);
$this->ensureTables(['DebugKit.Requests', 'DebugKit.Panels']);
}
@@ -75,17 +75,28 @@ public function findRecent(Query $query, array $options)
->limit(10);
}
+ /**
+ * Check if garbage collection should be run
+ *
+ * @return bool
+ */
+ protected function shouldGc()
+ {
+ return rand(1, 100) === 100;
+ }
+
/**
* Garbage collect old request data.
*
- * Delete request data that is older than 2 weeks old.
+ * Delete request data that is older than latest 20 requests.
+ * You can use the `DebugKit.requestCount` config to change this limit.
* This method will only trigger periodically.
*
* @return void
*/
public function gc()
{
- if (time() % 100 !== 0) {
+ if (!$this->shouldGc()) {
return;
}
$noPurge = $this->find()
@@ -108,5 +119,10 @@ public function gc()
$statement = $query->execute();
$statement->closeCursor();
+
+ $conn = $this->getConnection();
+ if ($conn->getDriver() instanceof Sqlite) {
+ $conn->execute('VACUUM;');
+ }
}
}
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php b/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php
index cf951fdfc..ad4248acc 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/CachePanel.php
@@ -41,12 +41,14 @@ public function initialize()
$config = Cache::getConfig($name);
if (isset($config['className']) && $config['className'] instanceof DebugEngine) {
$instance = $config['className'];
- } else {
+ } elseif (isset($config['className'])) {
Cache::drop($name);
$instance = new DebugEngine($config);
Cache::setConfig($name, $instance);
}
- $this->_instances[$name] = $instance;
+ if (isset($instance)) {
+ $this->_instances[$name] = $instance;
+ }
}
}
@@ -63,7 +65,7 @@ public function data()
}
return [
- 'metrics' => $metrics
+ 'metrics' => $metrics,
];
}
}
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php
index 2689e0183..3765d7609 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/EnvironmentPanel.php
@@ -65,7 +65,7 @@ protected function _prepare()
'ROOT' => ROOT,
'TESTS' => TESTS,
'TMP' => TMP,
- 'WWW_ROOT' => WWW_ROOT
+ 'WWW_ROOT' => WWW_ROOT,
];
$hiddenCakeConstants = array_fill_keys(
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/LogPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/LogPanel.php
index a02631909..829744807 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/LogPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/LogPanel.php
@@ -45,7 +45,7 @@ public function initialize()
public function data()
{
return [
- 'logger' => Log::engine('debug_kit_log_panel')
+ 'logger' => Log::engine('debug_kit_log_panel'),
];
}
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/MailPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/MailPanel.php
index 8cd08e537..7aeb87ccc 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/MailPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/MailPanel.php
@@ -14,7 +14,7 @@
use ArrayObject;
use Cake\Core\App;
-use Cake\Mailer\Email;
+use Cake\Mailer\TransportFactory;
use DebugKit\DebugPanel;
use DebugKit\Mailer\Transport\DebugKitTransport;
use ReflectionClass;
@@ -39,12 +39,12 @@ class MailPanel extends DebugPanel
*/
public function initialize()
{
- $reflection = new ReflectionClass(Email::class);
- $property = $reflection->getProperty('_transportConfig');
+ $reflection = new ReflectionClass(TransportFactory::class);
+ $property = $reflection->getProperty('_config');
$property->setAccessible(true);
$configs = $property->getValue();
- $log = $this->emailLog = new ArrayObject;
+ $log = $this->emailLog = new ArrayObject();
foreach ($configs as $name => &$transport) {
if (is_object($transport)) {
@@ -73,7 +73,7 @@ public function initialize()
public function data()
{
return [
- 'emails' => isset($this->emailLog) ? $this->emailLog->getArrayCopy() : []
+ 'emails' => isset($this->emailLog) ? $this->emailLog->getArrayCopy() : [],
];
}
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php b/app/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php
index 8d9e2fcc5..8f8183b23 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/PanelRegistry.php
@@ -60,7 +60,7 @@ protected function _resolveClassName($class)
*/
protected function _throwMissingClassError($class, $plugin)
{
- throw new \RuntimeException(__d('debug_kit', "Unable to find '{0}' panel.", $class));
+ throw new \RuntimeException(__d('debug_kit', "Unable to find ''{0}'' panel.", $class));
}
/**
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php
index 766cb91ab..c2489e1d6 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/RequestPanel.php
@@ -22,7 +22,6 @@
*/
class RequestPanel extends DebugPanel
{
-
/**
* Data collection callback.
*
@@ -31,9 +30,9 @@ class RequestPanel extends DebugPanel
*/
public function shutdown(Event $event)
{
- /* @var Controller $controller */
+ /* @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
- $request = $controller->request;
+ $request = $controller->getRequest();
$this->_data = [
'params' => $request->getAttribute("params"),
'query' => $request->getQueryParams(),
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php
index a1ee0ae67..2b87cf913 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/RoutesPanel.php
@@ -27,16 +27,20 @@ class RoutesPanel extends DebugPanel
/**
* Get summary data for the routes panel.
*
- * @return int
+ * @return string
*/
public function summary()
{
$appClass = Configure::read('App.namespace') . '\Application';
if (class_exists($appClass, false) && !Router::$initialized) {
- return 0;
+ return '0';
}
- return count(Router::routes());
+ $routes = array_filter(Router::routes(), function ($route) {
+ return (!isset($routes->defaults['plugin'])) || $route->defaults['plugin'] !== 'DebugKit';
+ });
+
+ return (string)count($routes);
}
/**
@@ -47,9 +51,9 @@ public function summary()
*/
public function shutdown(Event $event)
{
+ /* @var \Cake\Controller\Controller|null $controller */
$controller = $event->getSubject();
- /* @var \Cake\Http\ServerRequest $request */
- $request = $controller ? $controller->request : null;
+ $request = $controller ? $controller->getRequest() : null;
$this->_data = [
'matchedRoute' => $request ? $request->getParam('_matchedRoute') : null,
];
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php
index 0c523ab3e..95c013dfb 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php
@@ -52,7 +52,7 @@ public function initialize()
continue;
}
$logger = null;
- if ($connection->logQueries()) {
+ if ($connection->isQueryLoggingEnabled()) {
$logger = $connection->getLogger();
}
@@ -63,12 +63,14 @@ public function initialize()
}
$logger = new DebugLog($logger, $name, $includeSchemaReflection);
- $connection->logQueries(true);
+ $connection->enableQueryLogging(true);
+
if (method_exists($connection, 'setLogger')) {
$connection->setLogger($logger);
} else {
$connection->logger($logger);
}
+
$this->_loggers[] = $logger;
}
}
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php
index c9546276f..d5fadbf0c 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/TimerPanel.php
@@ -32,7 +32,7 @@ public function implementedEvents()
{
$before = function ($name) {
return function () use ($name) {
- DebugTimer::start($name, __d('debug_kit', $name));
+ DebugTimer::start($name);
};
};
$after = function ($name) {
@@ -43,35 +43,35 @@ public function implementedEvents()
$both = function ($name) use ($before, $after) {
return [
['priority' => 0, 'callable' => $before('Event: ' . $name)],
- ['priority' => 999, 'callable' => $after('Event: ' . $name)]
+ ['priority' => 999, 'callable' => $after('Event: ' . $name)],
];
};
return [
'Controller.initialize' => [
['priority' => 0, 'callable' => function () {
- DebugMemory::record(__d('debug_kit', 'Controller initialization'));
+ DebugMemory::record('Controller initialization');
}],
['priority' => 0, 'callable' => $before('Event: Controller.initialize')],
- ['priority' => 999, 'callable' => $after('Event: Controller.initialize')]
+ ['priority' => 999, 'callable' => $after('Event: Controller.initialize')],
],
'Controller.startup' => [
['priority' => 0, 'callable' => $before('Event: Controller.startup')],
['priority' => 999, 'callable' => $after('Event: Controller.startup')],
['priority' => 999, 'callable' => function () {
- DebugMemory::record(__d('debug_kit', 'Controller action start'));
- DebugTimer::start(__d('debug_kit', 'Controller action'));
+ DebugMemory::record('Controller action start');
+ DebugTimer::start('Controller: action');
}],
],
'Controller.beforeRender' => [
['priority' => 0, 'callable' => function () {
- DebugTimer::stop(__d('debug_kit', 'Controller action'));
+ DebugTimer::stop('Controller: action');
}],
['priority' => 0, 'callable' => $before('Event: Controller.beforeRender')],
['priority' => 999, 'callable' => $after('Event: Controller.beforeRender')],
['priority' => 999, 'callable' => function () {
- DebugMemory::record(__d('debug_kit', 'View Render start'));
- DebugTimer::start(__d('debug_kit', 'View Render start'));
+ DebugMemory::record('View Render start');
+ DebugTimer::start('View: Render');
}],
],
'View.beforeRender' => $both('View.beforeRender'),
@@ -80,19 +80,19 @@ public function implementedEvents()
'View.afterLayout' => $both('View.afterLayout'),
'View.beforeRenderFile' => [
['priority' => 0, 'callable' => function ($event, $filename) {
- DebugTimer::start(__d('debug_kit', 'Render {0}', $filename));
+ DebugTimer::start('Render File: ' . $filename);
}],
],
'View.afterRenderFile' => [
['priority' => 0, 'callable' => function ($event, $filename) {
- DebugTimer::stop(__d('debug_kit', 'Render {0}', $filename));
+ DebugTimer::stop('Render File: ' . $filename);
}],
],
'Controller.shutdown' => [
['priority' => 0, 'callable' => $before('Event: Controller.shutdown')],
['priority' => 0, 'callable' => function () {
- DebugTimer::stop(__d('debug_kit', 'View Render start'));
- DebugMemory::record(__d('debug_kit', 'Controller shutdown'));
+ DebugTimer::stop('View: Render');
+ DebugMemory::record('Controller shutdown');
}],
['priority' => 999, 'callable' => $after('Event: Controller.shutdown')],
],
diff --git a/app/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php b/app/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php
index b83ced561..b161f0fd4 100644
--- a/app/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php
+++ b/app/vendor/cakephp/debug_kit/src/Panel/VariablesPanel.php
@@ -89,11 +89,13 @@ protected function _walkDebugInfo(callable $walker, $item)
*/
public function shutdown(Event $event)
{
+ /* @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
$errors = [];
$walker = function (&$item) use (&$walker) {
- if ($item instanceof Collection ||
+ if (
+ $item instanceof Collection ||
$item instanceof Query ||
$item instanceof ResultSet
) {
@@ -108,7 +110,8 @@ public function shutdown(Event $event)
} catch (InvalidArgumentException $e) {
$item = $this->_walkDebugInfo($walker, $item);
}
- } elseif ($item instanceof Closure ||
+ } elseif (
+ $item instanceof Closure ||
$item instanceof PDO ||
$item instanceof SimpleXMLElement
) {
@@ -126,17 +129,13 @@ public function shutdown(Event $event)
// Convert objects into using __debugInfo.
$item = $this->_walkDebugInfo($walker, $item);
} else {
- try {
- serialize($item);
- } catch (\Exception $e) {
- $item = __d('debug_kit', 'Unserializable object - {0}. Error: {1} in {2}, line {3}', get_class($item), $e->getMessage(), $e->getFile(), $e->getLine());
- }
+ $item = $this->trySerialize($item);
}
} elseif (is_resource($item)) {
$item = sprintf('[%s] %s', get_resource_type($item), $item);
}
- return $item;
+ return $this->trySerialize($item);
};
// Copy so viewVars is not mutated.
$vars = $controller->viewVars;
@@ -147,7 +146,7 @@ public function shutdown(Event $event)
if ($v instanceof EntityInterface) {
$errors[$k] = $this->_getErrors($v);
} elseif ($v instanceof Form) {
- $formError = $v->errors();
+ $formError = $v->getErrors();
if (!empty($formError)) {
$errors[$k] = $formError;
}
@@ -156,10 +155,31 @@ public function shutdown(Event $event)
$this->_data = [
'content' => $vars,
- 'errors' => $errors
+ 'errors' => $errors,
];
}
+ /**
+ * Try to serialize an item, provide an error message if not possible
+ *
+ * @param mixed $item Item to check
+ * @return mixed The $item if it is serializable, error message if not
+ */
+ protected function trySerialize($item)
+ {
+ try {
+ serialize($item);
+
+ return $item;
+ } catch (\Exception $e) {
+ if (is_object($item)) {
+ return __d('debug_kit', 'Unserializable object - {0}. Error: {1} in {2}, line {3}', get_class($item), $e->getMessage(), $e->getFile(), $e->getLine());
+ }
+
+ return __d('debug_kit', 'Unserializable Error: {1} in {2}, line {3}', $e->getMessage(), $e->getFile(), $e->getLine());
+ }
+ }
+
/**
* Get summary data for the variables panel.
*
diff --git a/app/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php b/app/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php
index c13e73876..5d898c6f9 100644
--- a/app/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php
+++ b/app/vendor/cakephp/debug_kit/src/Routing/Filter/DebugBarFilter.php
@@ -128,7 +128,7 @@ public function beforeDispatch(Event $event)
* Save the toolbar data.
*
* @param \Cake\Event\Event $event The afterDispatch event.
- * @return \Cake\Http\Response|null Modifed response or null
+ * @return \Psr\Http\Message\ResponseInterface|void Modified response or null
*/
public function afterDispatch(Event $event)
{
diff --git a/app/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php b/app/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php
index 725944bc3..0324688f2 100644
--- a/app/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php
+++ b/app/vendor/cakephp/debug_kit/src/Shell/BenchmarkShell.php
@@ -23,9 +23,6 @@
* functionally similar to Apache AB
*
* @since DebugKit 1.0
- * @todo Print/export time detail information
- * @todo Export/graphing of data to .dot format for graphviz visualization
- * @todo Make calculated results round to leading significant digit position of std dev.
*/
class BenchmarkShell extends Shell
{
@@ -75,20 +72,20 @@ protected function _results($times)
$this->out("");
$this->out(Text::insert(__d('debug_kit', 'Requests/Second: :rps req/sec'), [
- 'rps' => round($requests / $duration, 3)
+ 'rps' => round($requests / $duration, 3),
]));
$this->out(Text::insert(__d('debug_kit', 'Average request time: :average-time seconds'), [
- 'average-time' => round($duration / $requests, 3)
+ 'average-time' => round($duration / $requests, 3),
]));
$this->out(Text::insert(__d('debug_kit', 'Standard deviation of average request time: :std-dev'), [
- 'std-dev' => round($this->_deviation($times, true), 3)
+ 'std-dev' => round($this->_deviation($times, true), 3),
]));
$this->out(Text::insert(__d('debug_kit', 'Longest/shortest request: :longest sec/:shortest sec'), [
'longest' => round(max($times), 3),
- 'shortest' => round(min($times), 3)
+ 'shortest' => round(min($times), 3),
]));
$this->out("");
@@ -151,11 +148,11 @@ public function getOptionParser()
))
->addArgument('url', [
'help' => __d('debug_kit', 'The URL to request.'),
- 'required' => true
+ 'required' => true,
])
->addOption('n', [
'default' => 10,
- 'help' => __d('debug_kit', 'Number of iterations to perform.')
+ 'help' => __d('debug_kit', 'Number of iterations to perform.'),
])
->addOption('t', [
'default' => 100,
@@ -163,7 +160,7 @@ public function getOptionParser()
'debug_kit',
'Maximum total time for all iterations, in seconds.' .
'If a single iteration takes more than the timeout, only one request will be made'
- )
+ ),
])
->epilog(__d(
'debug_kit',
diff --git a/app/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php b/app/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php
index 1a4775701..812a768e7 100644
--- a/app/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php
+++ b/app/vendor/cakephp/debug_kit/src/Shell/WhitespaceShell.php
@@ -95,7 +95,7 @@ public function getOptionParser()
return $parser->addOption('path', [
'short' => 'p',
- 'help' => __d('debug_kit', 'Absolute path or relative to {0}.', 'APP')
+ 'help' => __d('debug_kit', 'Absolute path or relative to {0}.', 'APP'),
]);
}
}
diff --git a/app/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp b/app/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp
new file mode 100644
index 000000000..ee3566fd5
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/src/Template/Dashboard/index.ctp
@@ -0,0 +1,26 @@
+
+= __d('debug_kit', 'Debug Kit Dashboard') ?>
+
+= __d('debug_kit', 'Database') ?>
+
+ - = __d('debug_kit', 'Driver') ?>: = h($connection['driver']); ?>
+
+ - = __d('debug_kit', 'Requests') ?>: = $this->Number->format($connection['rows']) ?>
+
+
+
+ = $this->Form->postLink(
+ __d('debug_kit', 'Reset database'),
+ ['_method' => 'POST', 'action' => 'reset'],
+ ['confirm' => 'Are you sure?']
+ ); ?>
+
+
+Actions
+
+ - = $this->Html->link(__d('debug_kit', 'Mail Preview'), ['controller' => 'MailPreview']); ?>
+
diff --git a/app/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp b/app/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp
index f3191657a..63fceef8f 100644
--- a/app/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp
+++ b/app/vendor/cakephp/debug_kit/src/Template/Element/cache_panel.ctp
@@ -63,6 +63,7 @@ $(document).ready(function() {
var messageEl = el.parent().find('.inline-message');
var xhr = $.ajax({
+ headers: {'X-CSRF-TOKEN': '= $this->request->getParam('_csrfToken') ?>'},
url: baseUrl,
data: {name: name},
dataType: 'json',
diff --git a/app/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp b/app/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp
index 65a4326ee..33688ef94 100644
--- a/app/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp
+++ b/app/vendor/cakephp/debug_kit/src/Template/Element/packages_panel.ctp
@@ -123,6 +123,7 @@
showMessage(terminal, buildLoader());
var direct = $('.direct-dependency')[0].checked;
var xhr = $.ajax({
+ headers: {'X-CSRF-TOKEN': '= $this->request->getParam('_csrfToken') ?>'},
url: baseUrl,
data: {direct: direct},
dataType: 'json',
diff --git a/app/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp b/app/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp
index 2181a4181..3ca43365c 100644
--- a/app/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp
+++ b/app/vendor/cakephp/debug_kit/src/Template/Element/routes_panel.ctp
@@ -7,6 +7,9 @@ use Cake\Utility\Hash;
$routes = Cake\Routing\Router::routes();
?>
+
@@ -17,7 +20,15 @@ $routes = Cake\Routing\Router::routes();
-
+ template):
+ $class = 'highlighted';
+ elseif ($route->defaults['plugin'] === 'DebugKit'):
+ $class = 'debugkit-route hidden';
+ endif;
+ ?>
+
| = h(Hash::get($route->options, '_name', $route->getName())) ?> |
= h($route->template) ?> |
= json_encode($route->defaults, JSON_PRETTY_PRINT) ?> |
@@ -25,3 +36,13 @@ $routes = Cake\Routing\Router::routes();
+
+
diff --git a/app/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp b/app/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp
new file mode 100644
index 000000000..a4fd17b61
--- /dev/null
+++ b/app/vendor/cakephp/debug_kit/src/Template/Layout/dashboard.ctp
@@ -0,0 +1,13 @@
+extend('toolbar') ?>
+
+
+
+
+ = isset($title) ? h($title) : __d('debug_kit', 'DebugKit Dashboard') ?>
+
+
+
+
+ = $this->fetch('content'); ?>
+
+
diff --git a/app/vendor/cakephp/debug_kit/src/ToolbarService.php b/app/vendor/cakephp/debug_kit/src/ToolbarService.php
index ae58ce91a..570b885bf 100644
--- a/app/vendor/cakephp/debug_kit/src/ToolbarService.php
+++ b/app/vendor/cakephp/debug_kit/src/ToolbarService.php
@@ -64,7 +64,7 @@ class ToolbarService
'DebugKit.Deprecations' => true,
],
'forceEnable' => false,
- 'safeTld' => []
+ 'safeTld' => [],
];
/**
@@ -131,7 +131,7 @@ protected function isSuspiciouslyProduction()
}
$tld = end($host);
- $safeTopLevelDomains = ['localhost', 'dev', 'invalid', 'test', 'example', 'local'];
+ $safeTopLevelDomains = ['localhost', 'invalid', 'test', 'example', 'local'];
$safeTopLevelDomains = array_merge($safeTopLevelDomains, (array)$this->getConfig('safeTld'));
if (!in_array($tld, $safeTopLevelDomains, true) && !$this->getConfig('forceEnable')) {
@@ -208,7 +208,8 @@ public function saveData(ServerRequest $request, ResponseInterface $response)
{
// Skip debugkit requests and requestAction()
$path = $request->getUri()->getPath();
- if (strpos($path, 'debug_kit') !== false ||
+ if (
+ strpos($path, 'debug_kit') !== false ||
strpos($path, 'debug-kit') !== false ||
$request->is('requested')
) {
@@ -220,7 +221,7 @@ public function saveData(ServerRequest $request, ResponseInterface $response)
'method' => $request->getMethod(),
'status_code' => $response->getStatusCode(),
'requested_at' => $request->getEnv('REQUEST_TIME'),
- 'panels' => []
+ 'panels' => [],
];
/* @var \DebugKit\Model\Table\RequestsTable $requests */
$requests = TableRegistry::get('DebugKit.Requests');
@@ -260,7 +261,7 @@ public function getToolbarUrl()
$url = 'js/toolbar.js';
$filePaths = [
str_replace('/', DIRECTORY_SEPARATOR, WWW_ROOT . 'debug_kit/' . $url),
- str_replace('/', DIRECTORY_SEPARATOR, CorePlugin::path('DebugKit') . 'webroot/' . $url)
+ str_replace('/', DIRECTORY_SEPARATOR, CorePlugin::path('DebugKit') . 'webroot/' . $url),
];
$url = '/debug_kit/' . $url;
foreach ($filePaths as $filePath) {
diff --git a/app/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php b/app/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php
index d281e3c0a..a2213e6d8 100644
--- a/app/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php
+++ b/app/vendor/cakephp/debug_kit/src/View/Helper/CredentialsHelper.php
@@ -60,7 +60,7 @@ public function filter($in)
$link = $this->Html->tag('a', '******', [
'class' => 'filtered-credentials',
'title' => h($credentials),
- 'onclick' => "this.innerHTML = this.title"
+ 'onclick' => "this.innerHTML = this.title",
]);
return h($protocol) . $link . '@' . h($tail);
diff --git a/app/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php b/app/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php
index 34bdf58a5..c8db0f4a6 100644
--- a/app/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php
+++ b/app/vendor/cakephp/debug_kit/src/View/Helper/TidyHelper.php
@@ -50,7 +50,7 @@ class TidyHelper extends Helper
* Fudge the markup slightly so that the tag which is invalid is highlighted
*
* @param string $html ''
- * @param string &$out ''
+ * @param string $out ''
* @return array
*/
public function process($html = '', &$out = '')
@@ -73,6 +73,7 @@ public function process($html = '', &$out = '')
if (isset($markup[$line - 1])) {
$string .= h($markup[$line - 1]);
}
+ // phpcs:ignore
$string .= '' . h(@$markup[$line]) . '';
if (isset($markup[$line + 1])) {
$string .= h($markup[$line + 1]);
@@ -125,7 +126,7 @@ public function report($html = null)
* normalized string so that the error messages can be linked to the line that caused them.
*
* @param string $in ''
- * @param string &$out ''
+ * @param string $out ''
* @return string
*/
public function tidyErrors($in = '', &$out = '')
@@ -163,7 +164,7 @@ public function tidyErrors($in = '', &$out = '')
* exec method
*
* @param mixed $cmd ''
- * @param mixed &$out null
+ * @param mixed $out null
* @return bool True if successful
*/
protected function _exec($cmd, &$out = null)
diff --git a/app/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php b/app/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php
index 3a4d39339..cb8cff55b 100644
--- a/app/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php
+++ b/app/vendor/cakephp/debug_kit/src/View/Helper/ToolbarHelper.php
@@ -47,6 +47,7 @@ class ToolbarHelper extends Helper
* set sorting of values
*
* @param bool $sort Whether or not sort values by key
+ * @return void
*/
public function setSort($sort)
{
@@ -127,7 +128,8 @@ public function makeNeatArray($values, $openDepth = 0, $currentDepth = 0, $doubl
$value = ' - recursion';
}
- if ((
+ if (
+ (
$value instanceof ArrayAccess ||
$value instanceof Iterator ||
is_array($value) ||
diff --git a/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php b/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php
index 57486494f..f22f10a27 100644
--- a/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php
+++ b/app/vendor/cakephp/debug_kit/tests/Fixture/PanelsFixture.php
@@ -50,9 +50,9 @@ class PanelsFixture extends TestFixture
'request_id_fk' => [
'type' => 'foreign',
'columns' => ['request_id'],
- 'references' => ['requests', 'id']
- ]
- ]
+ 'references' => ['requests', 'id'],
+ ],
+ ],
];
/**
@@ -67,8 +67,8 @@ class PanelsFixture extends TestFixture
'panel' => 'DebugKit.Request',
'title' => 'Request',
'element' => 'DebugKit.request_panel',
- 'content' => 'a:5:{s:6:"params";a:5:{s:6:"plugin";N;s:10:"controller";s:5:"Tasks";s:6:"action";s:3:"add";s:4:"_ext";N;s:4:"pass";a:0:{}}s:5:"query";a:0:{}s:4:"data";a:0:{}s:6:"cookie";a:2:{s:14:"toolbarDisplay";s:4:"show";s:7:"CAKEPHP";s:26:"9pk8sa2ot6pclki9f4iakio560";}s:3:"get";a:0:{}}'
- ]
+ 'content' => 'a:5:{s:6:"params";a:5:{s:6:"plugin";N;s:10:"controller";s:5:"Tasks";s:6:"action";s:3:"add";s:4:"_ext";N;s:4:"pass";a:0:{}}s:5:"query";a:0:{}s:4:"data";a:0:{}s:6:"cookie";a:2:{s:14:"toolbarDisplay";s:4:"show";s:7:"CAKEPHP";s:26:"9pk8sa2ot6pclki9f4iakio560";}s:3:"get";a:0:{}}',
+ ],
];
/**
diff --git a/app/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php b/app/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php
index 2388f4f73..87e8c8dd8 100644
--- a/app/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php
+++ b/app/vendor/cakephp/debug_kit/tests/Fixture/RequestsFixture.php
@@ -44,7 +44,7 @@ class RequestsFixture extends TestFixture
'requested_at' => ['type' => 'datetime', 'null' => false],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id']],
- ]
+ ],
];
/**
@@ -58,8 +58,8 @@ class RequestsFixture extends TestFixture
'url' => '/tasks/add',
'content_type' => 'text/html',
'status_code' => 200,
- 'requested_at' => '2014-08-21 7:41:12'
- ]
+ 'requested_at' => '2014-08-21 7:41:12',
+ ],
];
/**
diff --git a/app/vendor/cakephp/debug_kit/webroot/css/toolbar.css b/app/vendor/cakephp/debug_kit/webroot/css/toolbar.css
index e4f218734..f113722ea 100644
--- a/app/vendor/cakephp/debug_kit/webroot/css/toolbar.css
+++ b/app/vendor/cakephp/debug_kit/webroot/css/toolbar.css
@@ -501,6 +501,7 @@ pre,
color: #fff;
border-radius: 4px;
box-shadow: 0 2px 0 #2a6496;
+ padding: 4px 10px;
}
.btn-primary:active {
box-shadow: none;
diff --git a/app/vendor/cakephp/debug_kit/webroot/js/toolbar.js b/app/vendor/cakephp/debug_kit/webroot/js/toolbar.js
index e0e5d863f..897b78797 100644
--- a/app/vendor/cakephp/debug_kit/webroot/js/toolbar.js
+++ b/app/vendor/cakephp/debug_kit/webroot/js/toolbar.js
@@ -92,11 +92,25 @@ if (elem) {
};
};
- // Bind on ready callback.
+ // Bind on ready callbacks to DOMContentLoaded (native js) and turbolinks:load
+ // Turbolinks replaces the body and merges the head of an HTML page.
+ // Since the body is already loaded (DOMContentLoaded), the event is not triggered.
if (doc.addEventListener) {
- doc.addEventListener('DOMContentLoaded', onReady, false);
- doc.addEventListener('DOMContentLoaded', proxyAjaxOpen, false);
- doc.addEventListener('DOMContentLoaded', proxyAjaxSend, false);
+ // This ensures that all event listeners get applied only once.
+ if (!window.__debugKitListenersApplied) {
+ // The DOMContentLoaded is for all pages that do not have Turbolinks
+ doc.addEventListener('DOMContentLoaded', onReady, false);
+ doc.addEventListener('DOMContentLoaded', proxyAjaxOpen, false);
+ doc.addEventListener('DOMContentLoaded', proxyAjaxSend, false);
+
+ // turbolinks:load is the alternative DOMContentLoaded Event of Turbolinks
+ // https://github.com/turbolinks/turbolinks
+ // https://github.com/cakephp/debug_kit/pull/664
+ doc.addEventListener('turbolinks:load', onReady, false);
+ doc.addEventListener('turbolinks:load', proxyAjaxOpen, false);
+ doc.addEventListener('turbolinks:load', proxyAjaxSend, false);
+ window.__debugKitListenersApplied = true;
+ }
} else {
throw new Error('Unable to add event listener for DebugKit. Please use a browser' +
'that supports addEventListener().');
diff --git a/app/vendor/cakephp/plugin-installer/.editorconfig b/app/vendor/cakephp/plugin-installer/.editorconfig
deleted file mode 100644
index 7b868624c..000000000
--- a/app/vendor/cakephp/plugin-installer/.editorconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-; This file is for unifying the coding style for different editors and IDEs.
-; More information at http://editorconfig.org
-
-root = true
-
-[*]
-indent_style = space
-indent_size = 4
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
diff --git a/app/vendor/cakephp/plugin-installer/.gitattributes b/app/vendor/cakephp/plugin-installer/.gitattributes
index 2e9e7319d..189d01683 100644
--- a/app/vendor/cakephp/plugin-installer/.gitattributes
+++ b/app/vendor/cakephp/plugin-installer/.gitattributes
@@ -2,3 +2,8 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
* text eol=lf
+
+# Remove files for archives generated using `git archive`
+.editorconfig export-ignore
+.travis.yml export-ignore
+phpunit.xml.dist export-ignore
diff --git a/app/vendor/cakephp/plugin-installer/.gitignore b/app/vendor/cakephp/plugin-installer/.gitignore
index 7602b69a2..1c9815dfd 100644
--- a/app/vendor/cakephp/plugin-installer/.gitignore
+++ b/app/vendor/cakephp/plugin-installer/.gitignore
@@ -1,2 +1,3 @@
/vendor
-/composer.lock
\ No newline at end of file
+/composer.lock
+.phpunit.result.cache
diff --git a/app/vendor/cakephp/plugin-installer/.travis.yml b/app/vendor/cakephp/plugin-installer/.travis.yml
deleted file mode 100644
index cbcbd21eb..000000000
--- a/app/vendor/cakephp/plugin-installer/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-language: php
-
-sudo: false
-
-php:
- - 5.5
- - 5.6
- - 7.0
- - 7.1
-
-matrix:
- include:
- - php: 7.1
- env: PHPCS=1
-
-before_script: composer install --prefer-dist --dev
-
-script:
- - sh -c "if [ '$PHPCS' != '1' ]; then vendor/bin/phpunit; fi"
- - sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p -n --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi"
-
-notifications:
- email: false
diff --git a/app/vendor/cakephp/plugin-installer/LICENSE.txt b/app/vendor/cakephp/plugin-installer/LICENSE.txt
index d0317668b..0a0a98c8e 100644
--- a/app/vendor/cakephp/plugin-installer/LICENSE.txt
+++ b/app/vendor/cakephp/plugin-installer/LICENSE.txt
@@ -1,7 +1,7 @@
The MIT License
CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org)
-Copyright (c) 2005-2015, Cake Software Foundation, Inc.
+Copyright (c) 2005-present, Cake Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
diff --git a/app/vendor/cakephp/plugin-installer/README.md b/app/vendor/cakephp/plugin-installer/README.md
index ce09309ae..7bcf3641e 100644
--- a/app/vendor/cakephp/plugin-installer/README.md
+++ b/app/vendor/cakephp/plugin-installer/README.md
@@ -1,5 +1,10 @@
# CakePHP Plugin Installer
+[](https://travis-ci.com/cakephp/plugin-installer)
+[](https://packagist.org/packages/cakephp/plugin-installer)
+[](https://packagist.org/packages/cakephp/plugin-installer/stats)
+[](LICENSE)
+
A composer installer for installing CakePHP 3.0+ plugins.
This installer ensures your application is aware of CakePHP plugins installed
diff --git a/app/vendor/cakephp/plugin-installer/composer.json b/app/vendor/cakephp/plugin-installer/composer.json
index 52fad1d3c..3a14a04cc 100644
--- a/app/vendor/cakephp/plugin-installer/composer.json
+++ b/app/vendor/cakephp/plugin-installer/composer.json
@@ -1,30 +1,39 @@
{
"name": "cakephp/plugin-installer",
"description": "A composer installer for CakePHP 3.0+ plugins.",
- "type": "composer-installer",
+ "type": "composer-plugin",
"license": "MIT",
"authors": [
{
"name": "CakePHP Community",
- "homepage": "http://cakephp.org"
+ "homepage": "https://cakephp.org"
}
],
+ "require": {
+ "php": ">=5.6.0",
+ "composer-plugin-api": "^1.0 || ^2.0"
+ },
"require-dev": {
- "composer/composer": "1.0.*@dev",
- "phpunit/phpunit": "^4.8|^5.7|^6.0",
- "cakephp/cakephp-codesniffer": "dev-master"
+ "cakephp/cakephp-codesniffer": "^3.3",
+ "composer/composer": "^2.0",
+ "phpunit/phpunit": "^5.7 || ^6.5 || ^8.5 || ^9.3"
},
"autoload": {
"psr-4": {
- "Cake\\Composer\\": "src"
+ "Cake\\Composer\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
- "Cake\\Test\\Composer\\": "tests"
+ "Cake\\Test\\TestCase\\Composer\\": "tests/TestCase/",
+ "Cake\\Test\\TestCase\\Composer\\Php56\\": "tests/php56/TestCase/"
}
},
"extra": {
- "class": "Cake\\Composer\\Installer\\PluginInstaller"
- }
+ "class": "Cake\\Composer\\Plugin"
+ },
+ "config": {
+ "sort-packages": true
+ },
+ "prefer-stable": true
}
diff --git a/app/vendor/cakephp/plugin-installer/phpunit.xml.dist b/app/vendor/cakephp/plugin-installer/phpunit.xml.dist
deleted file mode 100644
index 8ce8cf190..000000000
--- a/app/vendor/cakephp/plugin-installer/phpunit.xml.dist
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- tests/TestCase
-
-
-
-
\ No newline at end of file
diff --git a/app/vendor/cakephp/plugin-installer/src/Installer/PluginInstaller.php b/app/vendor/cakephp/plugin-installer/src/Installer/PluginInstaller.php
index 82c4e8092..f1fa998b6 100644
--- a/app/vendor/cakephp/plugin-installer/src/Installer/PluginInstaller.php
+++ b/app/vendor/cakephp/plugin-installer/src/Installer/PluginInstaller.php
@@ -1,84 +1,25 @@
checkUsage($composer);
- }
-
- /**
- * Check that the root composer.json file use the post-autoload-dump hook
- *
- * If not, warn the user they need to update their application's composer file.
- * Do nothing if the main project is not a project (if it's a plugin in development).
- *
- * @param Composer $composer object
- * @return void
- */
- public function checkUsage(Composer $composer)
- {
- if (static::$checkUsage === false) {
- return;
- }
- static::$checkUsage = false;
-
- $package = $composer->getPackage();
-
- if (!$package || $package->getType() !== 'project') {
- return;
- }
-
- $scripts = $composer->getPackage()->getScripts();
- $postAutoloadDump = 'Cake\Composer\Installer\PluginInstaller::postAutoloadDump';
- if (!isset($scripts['post-autoload-dump']) ||
- !in_array($postAutoloadDump, $scripts['post-autoload-dump'])
- ) {
- $this->warnUser(
- 'Action required!',
- 'The CakePHP plugin installer has been changed, please update your' .
- ' application composer.json file to add the post-autoload-dump hook.' .
- ' See the changes in https://github.com/cakephp/app/pull/216 for more' .
- ' info.'
- );
- }
- }
-
/**
* Warn the developer of action they need to take
*
* @param string $title Warning title
* @param string $text warning text
- *
+ * @param \Composer\IO\IOInterface $io IOInterface object
* @return void
*/
- public function warnUser($title, $text)
+ public static function warnUser($title, $text, $io)
{
$wrap = function ($text, $width = 75) {
return ' ' . str_pad($text, $width) . '';
@@ -99,7 +40,7 @@ public function warnUser($title, $text)
$messages = array_merge($messages, [$wrap(''), '', '']);
- $this->io->write($messages);
+ $io->write($messages);
}
/**
@@ -108,366 +49,29 @@ public function warnUser($title, $text)
* Recreates CakePHP's plugin path map, based on composer information
* and available app-plugins.
*
- * @param Event $event the composer event object
+ * @param \Composer\Script\Event $event the composer event object
* @return void
*/
public static function postAutoloadDump(Event $event)
{
- $composer = $event->getComposer();
- $config = $composer->getConfig();
-
- $vendorDir = realpath($config->get('vendor-dir'));
-
- $packages = $composer->getRepositoryManager()->getLocalRepository()->getPackages();
- $extra = $event->getComposer()->getPackage()->getExtra();
- if (empty($extra['plugin-paths'])) {
- $pluginsDir = dirname($vendorDir) . DIRECTORY_SEPARATOR . 'plugins';
- } else {
- $pluginsDir = $extra['plugin-paths'];
- }
-
- $plugins = static::determinePlugins($packages, $pluginsDir, $vendorDir);
-
- $configFile = static::_configFile($vendorDir);
- static::writeConfigFile($configFile, $plugins);
- }
-
- /**
- * Find all plugins available
- *
- * Add all composer packages of type cakephp-plugin, and all plugins located
- * in the plugins directory to a plugin-name indexed array of paths
- *
- * @param array $packages an array of \Composer\Package\PackageInterface objects
- * @param string|array $pluginsDir the path to the plugins dir
- * @param string $vendorDir the path to the vendor dir
- * @return array plugin-name indexed paths to plugins
- */
- public static function determinePlugins($packages, $pluginsDir = 'plugins', $vendorDir = 'vendor')
- {
- $plugins = [];
-
- foreach ($packages as $package) {
- if ($package->getType() !== 'cakephp-plugin') {
- continue;
- }
-
- $ns = static::primaryNamespace($package);
- $path = $vendorDir . DIRECTORY_SEPARATOR . $package->getPrettyName();
- $plugins[$ns] = $path;
- }
-
- foreach ((array)$pluginsDir as $path) {
- $path = static::fullpath($path, $vendorDir);
- if (is_dir($path)) {
- $dir = new \DirectoryIterator($path);
- foreach ($dir as $info) {
- if (!$info->isDir() || $info->isDot()) {
- continue;
- }
-
- $name = $info->getFilename();
- if ($name{0} === '.') {
- continue;
- }
-
- $plugins[$name] = $path . DIRECTORY_SEPARATOR . $name;
- }
- }
- }
-
- ksort($plugins);
-
- return $plugins;
- }
-
- /**
- * Turns relative paths in full paths.
- *
- * @param string $path Path
- * @param string $vendorDir The path to the vendor dir
- * @return string
- */
- protected static function fullpath($path, $vendorDir)
- {
- if (preg_match('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) {
- return rtrim($path, '/');
- }
-
- if (substr($path, 0, 2) === './') {
- $path = substr($path, 2);
- }
-
- return rtrim(dirname($vendorDir) . DIRECTORY_SEPARATOR . $path);
- }
-
- /**
- * Rewrite the config file with a complete list of plugins
- *
- * @param string $configFile the path to the config file
- * @param array $plugins of plugins
- * @param string|null $root The root directory. Defaults to a value generated from $configFile
- * @return void
- */
- public static function writeConfigFile($configFile, $plugins, $root = null)
- {
- $root = $root ?: dirname(dirname($configFile));
-
- $data = [];
- foreach ($plugins as $name => $pluginPath) {
- // Normalize to *nix paths.
- $pluginPath = str_replace('\\', '/', $pluginPath);
- $pluginPath .= '/';
-
- $pluginPath = str_replace(
- DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
- DIRECTORY_SEPARATOR,
- $pluginPath
- );
-
- // Namespaced plugins should use /
- $name = str_replace('\\', '/', $name);
-
- $data[] = sprintf(" '%s' => '%s'", $name, $pluginPath);
- }
-
- $data = implode(",\n", $data);
-
- $contents = <<<'PHP'
- [
-%s
- ]
-];
-PHP;
- $contents = sprintf($contents, $data);
-
- // Gross hacks to work around composer smashing `__FILE__` in this
- // PHP file when it runs the code through eval()
- $uppercase = function ($matches) {
- return strtoupper($matches[0]);
- };
- $contents = preg_replace_callback('/__file__/', $uppercase, $contents);
-
- $root = str_replace(
- DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
- DIRECTORY_SEPARATOR,
- $root
- );
-
- // Normalize to *nix paths.
- $root = str_replace('\\', '/', $root);
- $contents = str_replace('\'' . $root, '$baseDir . \'', $contents);
-
- file_put_contents($configFile, $contents);
- }
-
- /**
- * Path to the plugin config file
- *
- * @param string $vendorDir path to composer-vendor dir
- * @return string absolute file path
- */
- protected static function _configFile($vendorDir)
- {
- return $vendorDir . DIRECTORY_SEPARATOR . 'cakephp-plugins.php';
- }
-
- /**
- * Get the primary namespace for a plugin package.
- *
- * @param \Composer\Package\PackageInterface $package composer object
- * @return string The package's primary namespace.
- * @throws \RuntimeException When the package's primary namespace cannot be determined.
- */
- public static function primaryNamespace($package)
- {
- $primaryNs = null;
- $autoLoad = $package->getAutoload();
- foreach ($autoLoad as $type => $pathMap) {
- if ($type !== 'psr-4') {
- continue;
- }
- $count = count($pathMap);
-
- if ($count === 1) {
- $primaryNs = key($pathMap);
- break;
- }
-
- $matches = preg_grep('#^(\./)?src/?$#', $pathMap);
- if ($matches) {
- $primaryNs = key($matches);
- break;
- }
-
- foreach (['', '.'] as $path) {
- $key = array_search($path, $pathMap, true);
- if ($key !== false) {
- $primaryNs = $key;
- }
- }
- break;
- }
-
- if (!$primaryNs) {
- throw new RuntimeException(
- sprintf(
- "Unable to get primary namespace for package %s." .
- "\nEnsure you have added proper 'autoload' section to your plugin's config" .
- " as stated in README on https://github.com/cakephp/plugin-installer",
- $package->getName()
- )
- );
- }
-
- return trim($primaryNs, '\\');
- }
-
- /**
- * Decides if the installer supports the given type.
- *
- * This installer only supports package of type 'cakephp-plugin'.
- *
- * @return bool
- */
- public function supports($packageType)
- {
- return 'cakephp-plugin' === $packageType;
- }
-
- /**
- * Installs specific plugin.
- *
- * After the plugin is installed, app's `cakephp-plugins.php` config file is updated with
- * plugin namespace to path mapping.
- *
- * @param \Composer\Repository\InstalledRepositoryInterface $repo Repository in which to check.
- * @param \Composer\Package\PackageInterface $package Package instance.
- * @deprecated superceeded by the post-autoload-dump hook
- */
- public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- parent::install($repo, $package);
- $path = $this->getInstallPath($package);
- $ns = static::primaryNamespace($package);
- $this->updateConfig($ns, $path);
- }
-
- /**
- * Updates specific plugin.
- *
- * After the plugin is installed, app's `cakephp-plugins.php` config file is updated with
- * plugin namespace to path mapping.
- *
- * @param \Composer\Repository\InstalledRepositoryInterface $repo Repository in which to check.
- * @param \Composer\Package\PackageInterface $initial Already installed package version.
- * @param \Composer\Package\PackageInterface $target Updated version.
- * @deprecated superceeded by the post-autoload-dump hook
- *
- * @throws \InvalidArgumentException if $initial package is not installed
- */
- public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
- {
- parent::update($repo, $initial, $target);
-
- $ns = static::primaryNamespace($initial);
- $this->updateConfig($ns, null);
-
- $path = $this->getInstallPath($target);
- $ns = static::primaryNamespace($target);
- $this->updateConfig($ns, $path);
- }
-
- /**
- * Uninstalls specific package.
- *
- * @param \Composer\Repository\InstalledRepositoryInterface $repo Repository in which to check.
- * @param \Composer\Package\PackageInterface $package Package instance.
- * @deprecated superceeded by the post-autoload-dump hook
- */
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
- {
- parent::uninstall($repo, $package);
- $path = $this->getInstallPath($package);
- $ns = static::primaryNamespace($package);
- $this->updateConfig($ns, null);
- }
-
- /**
- * Update the plugin path for a given package.
- *
- * @param string $name The plugin name being installed.
- * @param string $path The path, the plugin is being installed into.
- */
- public function updateConfig($name, $path)
- {
- $name = str_replace('\\', '/', $name);
- $configFile = static::_configFile($this->vendorDir);
- $this->_ensureConfigFile($configFile);
-
- $return = include $configFile;
- if (is_array($return) && empty($config)) {
- $config = $return;
- }
- if (!isset($config)) {
- $this->io->write(
- 'ERROR - `vendor/cakephp-plugins.php` file is invalid. ' .
- 'Plugin path configuration not updated.'
- );
-
+ $scripts = $event->getComposer()->getPackage()->getScripts();
+ if (!isset($scripts['post-autoload-dump'])) {
return;
}
- if (!isset($config['plugins'])) {
- $config['plugins'] = [];
- }
- if ($path == null) {
- unset($config['plugins'][$name]);
- } else {
- $config['plugins'][$name] = $path;
- }
- $root = dirname($this->vendorDir);
- static::writeConfigFile($configFile, $config['plugins'], $root);
- }
- /**
- * Ensure that the vendor/cakephp-plugins.php file exists.
- *
- * If config/plugins.php is found - copy it to the vendor folder
- *
- * @param string $path the config file path.
- * @return void
- */
- protected function _ensureConfigFile($path)
- {
- if (file_exists($path)) {
- if ($this->io->isVerbose()) {
- $this->io->write('vendor/cakephp-plugins.php exists.');
- }
-
- return;
- }
-
- $oldPath = dirname(dirname($path)) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'plugins.php';
- if (file_exists($oldPath)) {
- copy($oldPath, $path);
- if ($this->io->isVerbose()) {
- $this->io->write('config/plugins.php found and copied to vendor/cakephp-plugins.php.');
- }
-
- return;
- }
-
- if (!is_dir(dirname($path))) {
- mkdir(dirname($path));
- }
- $root = dirname($this->vendorDir);
- static::writeConfigFile($path, [], $root);
-
- if ($this->io->isVerbose()) {
- $this->io->write('Created vendor/cakephp-plugins.php');
+ $postAutoloadDump = 'Cake\Composer\Installer\PluginInstaller::postAutoloadDump';
+ if (
+ $scripts['post-autoload-dump'] === $postAutoloadDump
+ || (is_array($scripts['post-autoload-dump'])
+ && in_array($postAutoloadDump, $scripts['post-autoload-dump'])
+ )
+ ) {
+ static::warnUser(
+ 'Action required!',
+ 'The CakePHP plugin installer v1.3+ no longer requires the "post-autoload-dump" hook.' .
+ ' Please update your app\'s composer.json file and remove usage of ' . $postAutoloadDump,
+ $event->getIO()
+ );
}
}
}
diff --git a/app/vendor/cakephp/plugin-installer/src/Plugin.php b/app/vendor/cakephp/plugin-installer/src/Plugin.php
new file mode 100644
index 000000000..3acf883f6
--- /dev/null
+++ b/app/vendor/cakephp/plugin-installer/src/Plugin.php
@@ -0,0 +1,270 @@
+ 'postAutoloadDump',
+ ];
+ }
+
+ /**
+ * Called whenever composer (re)generates the autoloader.
+ *
+ * Recreates CakePHP's plugin path map, based on composer information
+ * and available app plugins.
+ *
+ * @param \Composer\Script\Event $event Composer's event object.
+ * @return void
+ */
+ public function postAutoloadDump(Event $event)
+ {
+ $composer = $event->getComposer();
+ $config = $composer->getConfig();
+
+ $vendorDir = realpath($config->get('vendor-dir'));
+
+ $packages = $composer->getRepositoryManager()->getLocalRepository()->getPackages();
+ $extra = $event->getComposer()->getPackage()->getExtra();
+ if (empty($extra['plugin-paths'])) {
+ $pluginDirs = [dirname($vendorDir) . DIRECTORY_SEPARATOR . 'plugins'];
+ } else {
+ $pluginDirs = $extra['plugin-paths'];
+ }
+
+ $plugins = $this->findPlugins($packages, $pluginDirs, $vendorDir);
+
+ $configFile = $this->getConfigFilePath($vendorDir);
+ $this->writeConfigFile($configFile, $plugins);
+ }
+
+ /**
+ * Find all available plugins.
+ *
+ * Add all composer packages of type `cakephp-plugin`, and all plugins located
+ * in the plugins directory to a plugin-name indexed array of paths.
+ *
+ * @param \Composer\Package\PackageInterface[] $packages Array of \Composer\Package\PackageInterface objects.
+ * @param array $pluginDirs The path to the plugins dir.
+ * @param string $vendorDir The path to the vendor dir.
+ * @return array Plugin name indexed paths to plugins.
+ */
+ public function findPlugins(
+ array $packages,
+ array $pluginDirs = ['plugins'],
+ $vendorDir = 'vendor'
+ ) {
+ $plugins = [];
+
+ foreach ($packages as $package) {
+ if ($package->getType() !== 'cakephp-plugin') {
+ continue;
+ }
+
+ $ns = $this->getPrimaryNamespace($package);
+ $path = $vendorDir . DIRECTORY_SEPARATOR . $package->getPrettyName();
+ $plugins[$ns] = $path;
+ }
+
+ foreach ($pluginDirs as $path) {
+ $path = $this->getFullPath($path, $vendorDir);
+ if (is_dir($path)) {
+ $dir = new \DirectoryIterator($path);
+ foreach ($dir as $info) {
+ if (!$info->isDir() || $info->isDot()) {
+ continue;
+ }
+
+ $name = $info->getFilename();
+ if ($name[0] === '.') {
+ continue;
+ }
+
+ $plugins[$name] = $path . DIRECTORY_SEPARATOR . $name;
+ }
+ }
+ }
+
+ ksort($plugins);
+
+ return $plugins;
+ }
+
+ /**
+ * Turns relative paths in full paths.
+ *
+ * @param string $path Path.
+ * @param string $vendorDir The path to the vendor dir.
+ * @return string
+ */
+ public function getFullPath($path, $vendorDir)
+ {
+ if (preg_match('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) {
+ return rtrim($path, '/');
+ }
+
+ if (substr($path, 0, 2) === './') {
+ $path = substr($path, 2);
+ }
+
+ return rtrim(dirname($vendorDir) . DIRECTORY_SEPARATOR . $path);
+ }
+
+ /**
+ * Rewrite the config file with a complete list of plugins.
+ *
+ * @param string $configFile The path to the config file.
+ * @param array $plugins Array of plugins.
+ * @param string|null $root The root directory. Defaults to a value generated from `$configFile`.
+ * @return void
+ */
+ public function writeConfigFile($configFile, array $plugins, $root = null)
+ {
+ $root = $root ?: dirname(dirname($configFile));
+
+ $data = '';
+ foreach ($plugins as $name => $pluginPath) {
+ // Normalize to *nix paths.
+ $pluginPath = str_replace('\\', '/', $pluginPath);
+ $pluginPath .= '/';
+
+ $pluginPath = str_replace(
+ DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
+ DIRECTORY_SEPARATOR,
+ $pluginPath
+ );
+
+ // Namespaced plugins should use /
+ $name = str_replace('\\', '/', $name);
+
+ $data .= sprintf(" '%s' => '%s',\n", $name, $pluginPath);
+ }
+
+ $contents = <<<'PHP'
+ [
+%s ],
+];
+
+PHP;
+ $contents = sprintf($contents, $data);
+
+ // Gross hacks to work around composer smashing `__FILE__` in this
+ // PHP file when it runs the code through eval()
+ $uppercase = function ($matches) {
+ return strtoupper($matches[0]);
+ };
+ $contents = preg_replace_callback('/__file__/', $uppercase, $contents);
+
+ $root = str_replace(
+ DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
+ DIRECTORY_SEPARATOR,
+ $root
+ );
+
+ // Normalize to *nix paths.
+ $root = str_replace('\\', '/', $root);
+ $contents = str_replace('\'' . $root, '$baseDir . \'', $contents);
+
+ file_put_contents($configFile, $contents);
+ }
+
+ /**
+ * Path to the plugin config file.
+ *
+ * @param string $vendorDir Path to composer-vendor dir.
+ * @return string Absolute file path.
+ */
+ public function getConfigFilePath($vendorDir)
+ {
+ return $vendorDir . DIRECTORY_SEPARATOR . 'cakephp-plugins.php';
+ }
+
+ /**
+ * Get the primary namespace for a plugin package.
+ *
+ * @param \Composer\Package\PackageInterface $package Composer's package object.
+ * @return string The package's primary namespace.
+ * @throws \RuntimeException When the package's primary namespace cannot be determined.
+ */
+ public function getPrimaryNamespace(PackageInterface $package)
+ {
+ $primaryNs = null;
+ $autoLoad = $package->getAutoload();
+ foreach ($autoLoad as $type => $pathMap) {
+ if ($type !== 'psr-4') {
+ continue;
+ }
+ $count = count($pathMap);
+
+ if ($count === 1) {
+ $primaryNs = key($pathMap);
+ break;
+ }
+
+ $matches = preg_grep('#^(\./)?src/?$#', $pathMap);
+ if ($matches) {
+ $primaryNs = key($matches);
+ break;
+ }
+
+ foreach (['', '.'] as $path) {
+ $key = array_search($path, $pathMap, true);
+ if ($key !== false) {
+ $primaryNs = $key;
+ }
+ }
+ break;
+ }
+
+ if (!$primaryNs) {
+ throw new RuntimeException(
+ sprintf(
+ 'Unable to get primary namespace for package %s.' .
+ "\nEnsure you have added proper 'autoload' section to your plugin's config" .
+ ' as stated in README on https://github.com/cakephp/plugin-installer',
+ $package->getName()
+ )
+ );
+ }
+
+ return trim($primaryNs, '\\');
+ }
+}
diff --git a/app/vendor/cakephp/plugin-installer/tests/Installer/PluginInstaller.php b/app/vendor/cakephp/plugin-installer/tests/Installer/PluginInstaller.php
deleted file mode 100644
index 4d23f1bd6..000000000
--- a/app/vendor/cakephp/plugin-installer/tests/Installer/PluginInstaller.php
+++ /dev/null
@@ -1,25 +0,0 @@
-package = new Package('CamelCased', '1.0', '1.0');
- $this->package->setType('cakephp-plugin');
-
- $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'plugin-installer-test';
-
- foreach ($this->testDirs as $dir) {
- if (!is_dir($this->path . '/' . $dir)) {
- mkdir($this->path . '/' . $dir);
- }
- }
- $composer = new Composer();
- $config = $this->getMockBuilder('Composer\Config')->getMock();
- $config->expects($this->any())
- ->method('get')
- ->will($this->returnValue($this->path . '/vendor'));
- $composer->setConfig($config);
-
- $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
- $rm = new RepositoryManager(
- $this->io,
- $config
- );
- $composer->setRepositoryManager($rm);
-
- $this->installer = new PluginInstaller($this->io, $composer);
+ $this->composer = new Composer();
+ $this->io = $this->getMockBuilder(IOInterface::class)->getMock();
}
- public function tearDown()
+ public function testPostAutoloadDump()
{
- parent::tearDown();
- $dirs = array_reverse($this->testDirs);
-
- if (is_file($this->path . '/vendor/cakephp-plugins.php')) {
- unlink($this->path . '/vendor/cakephp-plugins.php');
- }
-
- foreach ($dirs as $dir) {
- if (is_dir($this->path . '/' . $dir)) {
- rmdir($this->path . '/' . $dir);
- }
- }
- }
-
- /**
- * Sanity test
- *
- * The test double should return a path to a test file, where
- * the containing folder
- *
- * @return void
- */
- public function testConfigFile()
- {
- $path = PluginInstaller::configFile("");
- $this->assertFileExists(dirname($path));
- }
-
- /**
- * Ensure that primary namespace detection works.
- *
- * @return void
- */
- public function testPrimaryNamespace()
- {
- $autoload = [
- 'psr-4' => [
- 'FOC\\Authenticate' => ''
- ]
- ];
- $this->package->setAutoload($autoload);
-
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('FOC\Authenticate', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'FOC\Acl\Test' => './tests',
- 'FOC\Acl' => ''
- ]
- ];
- $this->package->setAutoload($autoload);
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('FOC\Acl', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'Foo\Bar' => 'foo',
- 'Acme\Plugin' => './src'
- ]
- ];
- $this->package->setAutoload($autoload);
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('Acme\Plugin', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'Foo\Bar' => 'bar',
- 'Foo\\' => ''
- ]
- ];
- $this->package->setAutoload($autoload);
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('Foo', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'Foo\Bar' => 'bar',
- 'Foo' => '.'
- ]
- ];
- $this->package->setAutoload($autoload);
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('Foo', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'Acme\Foo\Bar' => 'bar',
- 'Acme\Foo\\' => ''
- ]
- ];
- $this->package->setAutoload($autoload);
- $ns = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('Acme\Foo', $ns);
-
- $autoload = [
- 'psr-4' => [
- 'Acme\Foo\Bar' => '',
- 'Acme\Foo' => 'src'
- ]
- ];
- $this->package->setAutoload($autoload);
- $name = PluginInstaller::primaryNamespace($this->package);
- $this->assertEquals('Acme\Foo', $name);
- }
-
- public function testDeterminePlugins()
- {
- $plugin1 = new Package('cakephp/the-thing', '1.0', '1.0');
- $plugin1->setType('cakephp-plugin');
- $plugin1->setAutoload([
- 'psr-4' => [
- 'TheThing' => 'src/'
- ]
- ]);
-
- $plugin2 = new Package('cakephp/princess', '1.0', '1.0');
- $plugin2->setType('cakephp-plugin');
- $plugin2->setAutoload([
- 'psr-4' => [
- 'Princess' => 'src/'
- ]
+ $rootPackage = new RootPackage('cakephp/app', '1.0', '1.0');
+ $rootPackage->setType('project');
+ $rootPackage->setScripts([
+ 'post-autoload-dump' => 'Cake\Composer\Installer\PluginInstaller::postAutoloadDump',
]);
- $packages = [
- $plugin1,
- new Package('SomethingElse', '1.0', '1.0'),
- $plugin2
- ];
-
- $return = PluginInstaller::determinePlugins(
- $packages,
- $this->path . '/doesnt-exist',
- $this->path . '/vendor'
- );
-
- $expected = [
- 'Princess' => $this->path . '/vendor/cakephp/princess',
- 'TheThing' => $this->path . '/vendor/cakephp/the-thing'
- ];
- $this->assertSame($expected, $return, 'Only composer-loaded plugins should be listed');
-
- $return = PluginInstaller::determinePlugins(
- $packages,
- $this->path . '/plugins',
- $this->path . '/vendor'
- );
-
- $expected = [
- 'Fee' => $this->path . '/plugins/Fee',
- 'Foe' => $this->path . '/plugins/Foe',
- 'Foo' => $this->path . '/plugins/Foo',
- 'Fum' => $this->path . '/plugins/Fum',
- 'Princess' => $this->path . '/vendor/cakephp/princess',
- 'TheThing' => $this->path . '/vendor/cakephp/the-thing'
- ];
- $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
-
- $return = PluginInstaller::determinePlugins(
- $packages,
- [$this->path . '/plugins', $this->path . '/app_plugins'],
- $this->path . '/vendor'
- );
-
- $expected = [
- 'Bar' => $this->path . '/app_plugins/Bar',
- 'Fee' => $this->path . '/plugins/Fee',
- 'Foe' => $this->path . '/plugins/Foe',
- 'Foo' => $this->path . '/plugins/Foo',
- 'Fum' => $this->path . '/plugins/Fum',
- 'Princess' => $this->path . '/vendor/cakephp/princess',
- 'TheThing' => $this->path . '/vendor/cakephp/the-thing'
- ];
- $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
- }
-
- public function testWriteConfigFile()
- {
- $plugins = [
- 'Fee' => $this->path . '/plugins/Fee',
- 'Foe' => $this->path . '/plugins/Foe',
- 'Foo' => $this->path . '/plugins/Foo',
- 'Fum' => $this->path . '/plugins/Fum',
- 'OddOneOut' => '/some/other/path',
- 'Princess' => $this->path . '/vendor/cakephp/princess',
- 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
- 'Vendor\Plugin' => $this->path . '/vendor/vendor/plugin'
- ];
-
- $path = $this->path . '/vendor/cakephp-plugins.php';
- PluginInstaller::writeConfigFile($path, $plugins);
-
- $this->assertFileExists($path);
- $contents = file_get_contents($path);
-
- $this->assertContains('assertContains('$baseDir = dirname(dirname(__FILE__));', $contents);
- $this->assertContains(
- "'Fee' => \$baseDir . '/plugins/Fee/'",
- $contents,
- 'paths should be relative for app-plugins'
- );
- $this->assertContains(
- "'Princess' => \$baseDir . '/vendor/cakephp/princess/'",
- $contents,
- 'paths should be relative for vendor-plugins'
- );
- $this->assertContains(
- "'OddOneOut' => '/some/other/path/'",
- $contents,
- 'paths should stay absolute if it\'s not under the application root'
- );
- $this->assertContains(
- "'Vendor/Plugin' => \$baseDir . '/vendor/vendor/plugin/'",
- $contents,
- 'Plugin namespaces should use forward slash'
- );
-
- // Ensure all plugin paths are slash terminated
- foreach ($plugins as &$plugin) {
- $plugin .= '/';
- }
- unset($plugin);
-
- $result = require $path;
- $expected = [
- 'plugins' => $plugins
- ];
- $expected['plugins']['Vendor/Plugin'] = $expected['plugins']['Vendor\Plugin'];
- unset($expected['plugins']['Vendor\Plugin']);
- $this->assertSame($expected, $result, 'The evaluated result should be the same as the input except for namespaced plugin');
- }
-
- public function testUpdateConfigNoConfigFile()
- {
- $this->installer->updateConfig('DebugKit', '/vendor/cakephp/DebugKit');
- $this->assertFileExists($this->path . '/vendor/cakephp-plugins.php');
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains("'plugins' =>", $contents);
- $this->assertContains("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
- }
-
- public function testUpdateConfigAddPathInvalidFile()
- {
- file_put_contents($this->path . '/vendor/cakephp-plugins.php', 'composer->setPackage($rootPackage);
$this->io->expects($this->once())
- ->method('write');
- $this->installer->updateConfig('DebugKit', '/vendor/cakephp/DebugKit');
- }
-
- public function testUpdateConfigAddPathFileExists()
- {
- file_put_contents(
- $this->path . '/vendor/cakephp-plugins.php',
- ' ["Bake" => "/some/path"]];'
- );
-
- $this->installer->updateConfig('DebugKit', '/vendor/cakephp/DebugKit');
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains("'plugins' =>", $contents);
- $this->assertContains("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
- $this->assertContains("'Bake' => '/some/path/'", $contents);
- }
-
- /**
- * testUpdateConfigAddRootPath
- *
- * @return void
- */
- public function testUpdateConfigAddRootPath()
- {
- file_put_contents(
- $this->path . '/vendor/cakephp-plugins.php',
- ' ["Bake" => "/some/path"]];'
- );
+ ->method('write');
- $this->installer->updateConfig('DebugKit', $this->path . '/vendor/cakephp/debugkit');
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains('$baseDir = dirname(dirname(__FILE__));', $contents);
- $this->assertContains("'DebugKit' => \$baseDir . '/vendor/cakephp/debugkit/'", $contents);
- $this->assertContains("'Bake' => '/some/path/'", $contents);
- }
-
- /**
- * testUpdateConfigAddPath
- *
- * @return void
- */
- public function testUpdateConfigAddPath()
- {
- file_put_contents(
- $this->path . '/vendor/cakephp-plugins.php',
- ' ["Bake" => "/some/path"]];'
- );
-
- $this->installer->updateConfig('DebugKit', '/vendor/cakephp/debugkit');
- $this->installer->updateConfig('ADmad\JwtAuth', '/vendor/admad/cakephp-jwt-auth');
-
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
- $this->assertContains("'Bake' => '/some/path/'", $contents);
- $this->assertContains("'ADmad/JwtAuth' => '/vendor/admad/cakephp-jwt-auth/'", $contents);
- }
-
- /**
- * test adding windows paths.
- *
- * @return void
- */
- public function testUpdateConfigAddPathWindows()
- {
- file_put_contents(
- $this->path . '/vendor/cakephp-plugins.php',
- ' ["Bake" => "/some/path"]];'
- );
-
- $this->installer->updateConfig('DebugKit', '\vendor\cakephp\debugkit');
-
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
- }
-
- /**
- * testUpdateConfigRemovePath
- *
- * @return void
- */
- public function testUpdateConfigRemovePath()
- {
- file_put_contents(
- $this->path . '/vendor/cakephp-plugins.php',
- ' ["Bake" => "/some/path"]];'
- );
+ $event = new Event('post-autoload-dump', $this->composer, $this->io);
- $this->installer->updateConfig('Bake', '');
- $contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
- $this->assertContains('assertContains("'plugins' =>", $contents);
- $this->assertNotContains("Bake", $contents);
+ PluginInstaller::postAutoloadDump($event);
}
}
diff --git a/app/vendor/cakephp/plugin-installer/tests/TestCase/PluginTest.php b/app/vendor/cakephp/plugin-installer/tests/TestCase/PluginTest.php
new file mode 100644
index 000000000..85e603135
--- /dev/null
+++ b/app/vendor/cakephp/plugin-installer/tests/TestCase/PluginTest.php
@@ -0,0 +1,334 @@
+package = new Package('cake/plugin', '1.0', '1.0');
+ $this->package->setType('cakephp-plugin');
+
+ $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'plugin-installer-test';
+
+ foreach ($this->testDirs as $dir) {
+ if (!is_dir($this->path . '/' . $dir)) {
+ mkdir($this->path . '/' . $dir);
+ }
+ }
+
+ $this->composer = new Composer();
+ $config = new Config();
+ $config->merge([
+ 'vendor-dir' => $this->path . '/vendor',
+ ]);
+
+ $this->composer->setConfig($config);
+
+ /** @var \Composer\IO\IOInterface&\PHPUnit\Framework\MockObject\MockObject $io */
+ $io = $this->getMockBuilder(IOInterface::class)->getMock();
+ $this->io = $io;
+
+ $httpDownloader = new HttpDownloader($this->io, $config);
+
+ $rm = new RepositoryManager(
+ $this->io,
+ $config,
+ $httpDownloader
+ );
+ $this->composer->setRepositoryManager($rm);
+
+ $this->plugin = new Plugin();
+ }
+
+ public function tearDown(): void
+ {
+ parent::tearDown();
+
+ $dirs = array_reverse($this->testDirs);
+
+ if (is_file($this->path . '/vendor/cakephp-plugins.php')) {
+ unlink($this->path . '/vendor/cakephp-plugins.php');
+ }
+
+ foreach ($dirs as $dir) {
+ if (is_dir($this->path . '/' . $dir)) {
+ rmdir($this->path . '/' . $dir);
+ }
+ }
+ }
+
+ public function testGetSubscribedEvents()
+ {
+ $expected = [
+ 'post-autoload-dump' => 'postAutoloadDump',
+ ];
+
+ $this->assertSame($expected, $this->plugin->getSubscribedEvents());
+ }
+
+ public function testGetConfigFilePath()
+ {
+ $path = $this->plugin->getConfigFilePath('');
+ $this->assertFileExists(dirname($path));
+ }
+
+ public function testGetPrimaryNamespace()
+ {
+ $autoload = [
+ 'psr-4' => [
+ 'FOC\\Authenticate' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('FOC\Authenticate', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'FOC\Acl\Test' => './tests',
+ 'FOC\Acl' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('FOC\Acl', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'foo',
+ 'Acme\Plugin' => './src',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Plugin', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'bar',
+ 'Foo\\' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'bar',
+ 'Foo' => '.',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Acme\Foo\Bar' => 'bar',
+ 'Acme\Foo\\' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Acme\Foo\Bar' => '',
+ 'Acme\Foo' => 'src',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $name = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Foo', $name);
+ }
+
+ public function testFindPlugins()
+ {
+ $plugin1 = new Package('cakephp/the-thing', '1.0', '1.0');
+ $plugin1->setType('cakephp-plugin');
+ $plugin1->setAutoload([
+ 'psr-4' => [
+ 'TheThing' => 'src/',
+ ],
+ ]);
+
+ $plugin2 = new Package('cakephp/princess', '1.0', '1.0');
+ $plugin2->setType('cakephp-plugin');
+ $plugin2->setAutoload([
+ 'psr-4' => [
+ 'Princess' => 'src/',
+ ],
+ ]);
+
+ $packages = [
+ $plugin1,
+ new Package('SomethingElse', '1.0', '1.0'),
+ $plugin2,
+ ];
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/doesnt-exist'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Only composer-loaded plugins should be listed');
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/plugins'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/plugins', $this->path . '/app_plugins'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Bar' => $this->path . '/app_plugins/Bar',
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
+ }
+
+ public function testWriteConfigFile()
+ {
+ $plugins = [
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'OddOneOut' => '/some/other/path',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ 'Vendor\Plugin' => $this->path . '/vendor/vendor/plugin',
+ ];
+
+ $path = $this->path . '/vendor/cakephp-plugins.php';
+ $this->plugin->writeConfigFile($path, $plugins);
+
+ $this->assertFileExists($path);
+ $contents = file_get_contents($path);
+
+ $this->assertStringContainsString('assertStringContainsString('$baseDir = dirname(dirname(__FILE__));', $contents);
+ $this->assertStringContainsString(
+ "'Fee' => \$baseDir . '/plugins/Fee/'",
+ $contents,
+ 'paths should be relative for app-plugins'
+ );
+ $this->assertStringContainsString(
+ "'Princess' => \$baseDir . '/vendor/cakephp/princess/'",
+ $contents,
+ 'paths should be relative for vendor-plugins'
+ );
+ $this->assertStringContainsString(
+ "'OddOneOut' => '/some/other/path/'",
+ $contents,
+ 'paths should stay absolute if it\'s not under the application root'
+ );
+ $this->assertStringContainsString(
+ "'Vendor/Plugin' => \$baseDir . '/vendor/vendor/plugin/'",
+ $contents,
+ 'Plugin namespaces should use forward slash'
+ );
+
+ // Ensure all plugin paths are slash terminated
+ foreach ($plugins as &$plugin) {
+ $plugin .= '/';
+ }
+ unset($plugin);
+
+ $result = require $path;
+ $expected = [
+ 'plugins' => $plugins,
+ ];
+ $expected['plugins']['Vendor/Plugin'] = $expected['plugins']['Vendor\Plugin'];
+ unset($expected['plugins']['Vendor\Plugin']);
+
+ $this->assertSame(
+ $expected,
+ $result,
+ 'The evaluated result should be the same as the input except for namespaced plugin'
+ );
+ }
+}
diff --git a/app/vendor/cakephp/plugin-installer/tests/bootstrap.php b/app/vendor/cakephp/plugin-installer/tests/bootstrap.php
deleted file mode 100644
index 9f349644c..000000000
--- a/app/vendor/cakephp/plugin-installer/tests/bootstrap.php
+++ /dev/null
@@ -1,4 +0,0 @@
-add('Cake\Test\TestCase\Composer', __DIR__ . 'TestCase');
diff --git a/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/Installer/PluginInstallerTest.php b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/Installer/PluginInstallerTest.php
new file mode 100644
index 000000000..92f548c7c
--- /dev/null
+++ b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/Installer/PluginInstallerTest.php
@@ -0,0 +1,42 @@
+composer = new Composer();
+ $this->io = $this->getMockBuilder(IOInterface::class)->getMock();
+ }
+
+ public function testPostAutoloadDump()
+ {
+ $rootPackage = new RootPackage('cakephp/app', '1.0', '1.0');
+ $rootPackage->setType('project');
+ $rootPackage->setScripts([
+ 'post-autoload-dump' => 'Cake\Composer\Installer\PluginInstaller::postAutoloadDump',
+ ]);
+
+ $this->composer->setPackage($rootPackage);
+ $this->io->expects($this->once())
+ ->method('write');
+
+ $event = new Event('post-autoload-dump', $this->composer, $this->io);
+
+ PluginInstaller::postAutoloadDump($event);
+ }
+}
diff --git a/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PHPUnitAssertionCompatTrait.php b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PHPUnitAssertionCompatTrait.php
new file mode 100644
index 000000000..d3c67acc5
--- /dev/null
+++ b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PHPUnitAssertionCompatTrait.php
@@ -0,0 +1,11 @@
+assertContains($needle, $haystack, $message);
+ }
+}
diff --git a/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PluginTest.php b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PluginTest.php
new file mode 100644
index 000000000..6c3c2ac28
--- /dev/null
+++ b/app/vendor/cakephp/plugin-installer/tests/php56/TestCase/PluginTest.php
@@ -0,0 +1,334 @@
+package = new Package('cake/plugin', '1.0', '1.0');
+ $this->package->setType('cakephp-plugin');
+
+ $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'plugin-installer-test';
+
+ foreach ($this->testDirs as $dir) {
+ if (!is_dir($this->path . '/' . $dir)) {
+ mkdir($this->path . '/' . $dir);
+ }
+ }
+
+ $this->composer = new Composer();
+ $config = new Config();
+ $config->merge([
+ 'vendor-dir' => $this->path . '/vendor',
+ ]);
+
+ $this->composer->setConfig($config);
+
+ /** @var \Composer\IO\IOInterface&\PHPUnit\Framework\MockObject\MockObject $io */
+ $io = $this->getMockBuilder(IOInterface::class)->getMock();
+ $this->io = $io;
+
+ $httpDownloader = new HttpDownloader($this->io, $config);
+
+ $rm = new RepositoryManager(
+ $this->io,
+ $config,
+ $httpDownloader
+ );
+ $this->composer->setRepositoryManager($rm);
+
+ $this->plugin = new Plugin();
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+
+ $dirs = array_reverse($this->testDirs);
+
+ if (is_file($this->path . '/vendor/cakephp-plugins.php')) {
+ unlink($this->path . '/vendor/cakephp-plugins.php');
+ }
+
+ foreach ($dirs as $dir) {
+ if (is_dir($this->path . '/' . $dir)) {
+ rmdir($this->path . '/' . $dir);
+ }
+ }
+ }
+
+ public function testGetSubscribedEvents()
+ {
+ $expected = [
+ 'post-autoload-dump' => 'postAutoloadDump',
+ ];
+
+ $this->assertSame($expected, $this->plugin->getSubscribedEvents());
+ }
+
+ public function testGetConfigFilePath()
+ {
+ $path = $this->plugin->getConfigFilePath('');
+ $this->assertFileExists(dirname($path));
+ }
+
+ public function testGetPrimaryNamespace()
+ {
+ $autoload = [
+ 'psr-4' => [
+ 'FOC\\Authenticate' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('FOC\Authenticate', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'FOC\Acl\Test' => './tests',
+ 'FOC\Acl' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('FOC\Acl', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'foo',
+ 'Acme\Plugin' => './src',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Plugin', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'bar',
+ 'Foo\\' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Foo\Bar' => 'bar',
+ 'Foo' => '.',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Acme\Foo\Bar' => 'bar',
+ 'Acme\Foo\\' => '',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $ns = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Foo', $ns);
+
+ $autoload = [
+ 'psr-4' => [
+ 'Acme\Foo\Bar' => '',
+ 'Acme\Foo' => 'src',
+ ],
+ ];
+ $this->package->setAutoload($autoload);
+ $name = $this->plugin->getPrimaryNamespace($this->package);
+ $this->assertEquals('Acme\Foo', $name);
+ }
+
+ public function testFindPlugins()
+ {
+ $plugin1 = new Package('cakephp/the-thing', '1.0', '1.0');
+ $plugin1->setType('cakephp-plugin');
+ $plugin1->setAutoload([
+ 'psr-4' => [
+ 'TheThing' => 'src/',
+ ],
+ ]);
+
+ $plugin2 = new Package('cakephp/princess', '1.0', '1.0');
+ $plugin2->setType('cakephp-plugin');
+ $plugin2->setAutoload([
+ 'psr-4' => [
+ 'Princess' => 'src/',
+ ],
+ ]);
+
+ $packages = [
+ $plugin1,
+ new Package('SomethingElse', '1.0', '1.0'),
+ $plugin2,
+ ];
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/doesnt-exist'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Only composer-loaded plugins should be listed');
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/plugins'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
+
+ $return = $this->plugin->findPlugins(
+ $packages,
+ [$this->path . '/plugins', $this->path . '/app_plugins'],
+ $this->path . '/vendor'
+ );
+
+ $expected = [
+ 'Bar' => $this->path . '/app_plugins/Bar',
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ ];
+ $this->assertSame($expected, $return, 'Composer and application plugins should be listed');
+ }
+
+ public function testWriteConfigFile()
+ {
+ $plugins = [
+ 'Fee' => $this->path . '/plugins/Fee',
+ 'Foe' => $this->path . '/plugins/Foe',
+ 'Foo' => $this->path . '/plugins/Foo',
+ 'Fum' => $this->path . '/plugins/Fum',
+ 'OddOneOut' => '/some/other/path',
+ 'Princess' => $this->path . '/vendor/cakephp/princess',
+ 'TheThing' => $this->path . '/vendor/cakephp/the-thing',
+ 'Vendor\Plugin' => $this->path . '/vendor/vendor/plugin',
+ ];
+
+ $path = $this->path . '/vendor/cakephp-plugins.php';
+ $this->plugin->writeConfigFile($path, $plugins);
+
+ $this->assertFileExists($path);
+ $contents = file_get_contents($path);
+
+ $this->assertStringContainsString('assertStringContainsString('$baseDir = dirname(dirname(__FILE__));', $contents);
+ $this->assertStringContainsString(
+ "'Fee' => \$baseDir . '/plugins/Fee/'",
+ $contents,
+ 'paths should be relative for app-plugins'
+ );
+ $this->assertStringContainsString(
+ "'Princess' => \$baseDir . '/vendor/cakephp/princess/'",
+ $contents,
+ 'paths should be relative for vendor-plugins'
+ );
+ $this->assertStringContainsString(
+ "'OddOneOut' => '/some/other/path/'",
+ $contents,
+ 'paths should stay absolute if it\'s not under the application root'
+ );
+ $this->assertStringContainsString(
+ "'Vendor/Plugin' => \$baseDir . '/vendor/vendor/plugin/'",
+ $contents,
+ 'Plugin namespaces should use forward slash'
+ );
+
+ // Ensure all plugin paths are slash terminated
+ foreach ($plugins as &$plugin) {
+ $plugin .= '/';
+ }
+ unset($plugin);
+
+ $result = require $path;
+ $expected = [
+ 'plugins' => $plugins,
+ ];
+ $expected['plugins']['Vendor/Plugin'] = $expected['plugins']['Vendor\Plugin'];
+ unset($expected['plugins']['Vendor\Plugin']);
+
+ $this->assertSame(
+ $expected,
+ $result,
+ 'The evaluated result should be the same as the input except for namespaced plugin'
+ );
+ }
+}
diff --git a/app/vendor/composer/ClassLoader.php b/app/vendor/composer/ClassLoader.php
index dc02dfb11..0cd6055d1 100644
--- a/app/vendor/composer/ClassLoader.php
+++ b/app/vendor/composer/ClassLoader.php
@@ -37,57 +37,130 @@
*
* @author Fabien Potencier
* @author Jordi Boggiano
- * @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 ?string */
+ private $vendorDir;
+
// PSR-4
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixLengthsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixDirsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr4 = array();
// PSR-0
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixesPsr0 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr0 = array();
+ /** @var bool */
private $useIncludePath = false;
+
+ /**
+ * @var string[]
+ * @psalm-var array
+ */
private $classMap = array();
+
+ /** @var bool */
private $classMapAuthoritative = false;
+
+ /**
+ * @var bool[]
+ * @psalm-var array
+ */
private $missingClasses = array();
+
+ /** @var ?string */
private $apcuPrefix;
+ /**
+ * @var self[]
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param ?string $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ /**
+ * @return 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[]
+ * @psalm-return array>
+ */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
+ /**
+ * @return string[] Array of classname => path
+ * @psalm-var array
+ */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param array $classMap Class to filename map
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
+ *
+ * @return void
*/
public function addClassMap(array $classMap)
{
@@ -102,9 +175,11 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param 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)
{
@@ -147,11 +222,13 @@ public function add($prefix, $paths, $prepend = false)
* 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 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)
{
@@ -195,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false)
* 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 string[]|string $paths The PSR-0 base directories
+ *
+ * @return void
*/
public function set($prefix, $paths)
{
@@ -211,10 +290,12 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths)
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
+ *
+ * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -256,6 +339,8 @@ public function getUseIncludePath()
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
+ *
+ * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -276,10 +361,12 @@ public function isClassMapAuthoritative()
* 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)
{
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -296,25 +383,44 @@ public function getApcuPrefix()
* 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)
{
@@ -323,6 +429,8 @@ public function loadClass($class)
return true;
}
+
+ return null;
}
/**
@@ -367,6 +475,21 @@ public function findFile($class)
return $file;
}
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return 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
@@ -377,7 +500,7 @@ private function findFileWithExtension($class, $ext)
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
- $search = $subPath.'\\';
+ $search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
@@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext)
* Scope isolated include.
*
* Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ * @private
*/
function includeFile($file)
{
diff --git a/app/vendor/composer/InstalledVersions.php b/app/vendor/composer/InstalledVersions.php
new file mode 100644
index 000000000..7c5502ca4
--- /dev/null
+++ b/app/vendor/composer/InstalledVersions.php
@@ -0,0 +1,337 @@
+
+ * Jordi Boggiano
+ *
+ * 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`
+ */
+class InstalledVersions
+{
+ private static $installed;
+ private static $canGetVendors;
+ 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
+ */
+ 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
+ */
+ 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 || empty($installed['versions'][$packageName]['dev_requirement']);
+ }
+ }
+
+ 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($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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ */
+ 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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}
+ */
+ 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}>
+ */
+ 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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ 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')) {
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ 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') {
+ self::$installed = require __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+ $installed[] = self::$installed;
+
+ return $installed;
+ }
+}
diff --git a/app/vendor/composer/autoload_classmap.php b/app/vendor/composer/autoload_classmap.php
index 389e969ff..7399327be 100644
--- a/app/vendor/composer/autoload_classmap.php
+++ b/app/vendor/composer/autoload_classmap.php
@@ -6,6 +6,11 @@
$baseDir = dirname($vendorDir);
return array(
+ 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Mobile_Detect' => $vendorDir . '/mobiledetect/mobiledetectlib/Mobile_Detect.php',
'SqlFormatter' => $vendorDir . '/jdorn/sql-formatter/lib/SqlFormatter.php',
+ 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+ 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
diff --git a/app/vendor/composer/autoload_files.php b/app/vendor/composer/autoload_files.php
index 912a95a82..806a8b15d 100644
--- a/app/vendor/composer/autoload_files.php
+++ b/app/vendor/composer/autoload_files.php
@@ -6,21 +6,33 @@
$baseDir = dirname($vendorDir);
return array(
+ 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'34122c0574b76bf21c9a8db62b5b9cf3' => $vendorDir . '/cakephp/chronos/src/carbon_compat.php',
- 'cf97c57bfe0f23854afd2f3818abb7a0' => $vendorDir . '/zendframework/zend-diactoros/src/functions/create_uploaded_file.php',
- '9bf37a3d0dad93e29cb4e1b1bfab04e9' => $vendorDir . '/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php',
- 'ce70dccb4bcc2efc6e94d2ee526e6972' => $vendorDir . '/zendframework/zend-diactoros/src/functions/marshal_method_from_sapi.php',
- 'f86420df471f14d568bfcb71e271b523' => $vendorDir . '/zendframework/zend-diactoros/src/functions/marshal_protocol_version_from_sapi.php',
- 'b87481e008a3700344428ae089e7f9e5' => $vendorDir . '/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php',
- '0b0974a5566a1077e4f2e111341112c1' => $vendorDir . '/zendframework/zend-diactoros/src/functions/normalize_server.php',
- '1ca3bc274755662169f9629d5412a1da' => $vendorDir . '/zendframework/zend-diactoros/src/functions/normalize_uploaded_files.php',
- '40360c0b9b437e69bcbb7f1349ce029e' => $vendorDir . '/zendframework/zend-diactoros/src/functions/parse_cookie_header.php',
+ 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
+ '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php',
+ '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php',
+ 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php',
+ '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php',
+ 'e6f3bc6883e449ab367280b34158c05b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php',
+ 'd59fbae42019aedf227094ac49a46f50' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php',
+ 'de95e0ac670b27c84ef8c5ac41fc1b34' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.php',
+ 'b6c2870932b0250c10334a86dcb33c7f' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php',
+ 'd02cf21124526632320d6f20b1bbf905' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php',
+ 'd919fc9d5ad52cfb7f322f7fe36458ab' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php',
+ 'e397f74f8af3b1e56166a6e99f216ee7' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php',
+ 'd154b49fab8e4da34fb553a2d644918c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php',
+ '9d3db23ca418094bcf0b641a0c9559ed' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php',
+ 'b0b88a3b89caae681462c58ff19a7059' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php',
+ 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php',
+ '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php',
+ '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php',
'c720f792236cd163ece8049879166850' => $vendorDir . '/cakephp/cakephp/src/Core/functions.php',
'ede59e3a405fb689cd1cebb7bb1db3fb' => $vendorDir . '/cakephp/cakephp/src/Collection/functions.php',
'90236b492da7ca2983a2ad6e33e4152e' => $vendorDir . '/cakephp/cakephp/src/I18n/functions.php',
'b1fc73705e1bec51cd2b20a32cf1c60a' => $vendorDir . '/cakephp/cakephp/src/Utility/bootstrap.php',
+ '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'bf9f5270ae66ac6fa0290b4bf47867b7' => $vendorDir . '/adodb/adodb-php/adodb.inc.php',
'801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
diff --git a/app/vendor/composer/autoload_namespaces.php b/app/vendor/composer/autoload_namespaces.php
index 237df62aa..0aa0e8ef9 100644
--- a/app/vendor/composer/autoload_namespaces.php
+++ b/app/vendor/composer/autoload_namespaces.php
@@ -9,7 +9,6 @@
'josegonzalez\\Dotenv' => array($vendorDir . '/josegonzalez/dotenv/src', $vendorDir . '/josegonzalez/dotenv/tests'),
'Umpirsky\\' => array($vendorDir . '/umpirsky/twig-php-function/src'),
'Twig_' => array($vendorDir . '/twig/twig/lib'),
- 'JakubOnderka\\PhpConsoleHighlighter' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'),
'Detection' => array($vendorDir . '/mobiledetect/mobiledetectlib/namespaced'),
'Aptoma' => array($vendorDir . '/aptoma/twig-markdown/src'),
);
diff --git a/app/vendor/composer/autoload_psr4.php b/app/vendor/composer/autoload_psr4.php
index 92a164ebc..f70ae87fb 100644
--- a/app/vendor/composer/autoload_psr4.php
+++ b/app/vendor/composer/autoload_psr4.php
@@ -6,10 +6,10 @@
$baseDir = dirname($vendorDir);
return array(
- 'Zend\\Diactoros\\' => array($vendorDir . '/zendframework/zend-diactoros/src'),
- 'XdgBaseDir\\' => array($vendorDir . '/dnoegel/php-xdg-base-dir/src'),
'WyriHaximus\\TwigView\\' => array($vendorDir . '/wyrihaximus/twig-view/src'),
'Twig\\' => array($vendorDir . '/twig/twig/src'),
+ 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
+ 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
@@ -22,6 +22,7 @@
'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'),
'Seld\\PharUtils\\' => array($vendorDir . '/seld/phar-utils/src'),
'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'),
+ 'React\\Promise\\' => array($vendorDir . '/react/promise/src'),
'Psy\\' => array($vendorDir . '/psy/psysh/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
@@ -30,9 +31,11 @@
'Phinx\\' => array($vendorDir . '/robmorgan/phinx/src/Phinx'),
'Migrations\\' => array($vendorDir . '/cakephp/migrations/src'),
'M1\\Env\\' => array($vendorDir . '/m1/env/src'),
+ 'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'),
+ 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'),
'JsonSchema\\' => array($vendorDir . '/justinrainbow/json-schema/src/JsonSchema'),
'Jasny\\Twig\\' => array($vendorDir . '/jasny/twig-extensions/src'),
- 'JakubOnderka\\PhpConsoleColor\\' => array($vendorDir . '/jakub-onderka/php-console-color/src'),
+ 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/event-manager/lib/Doctrine/Common'),
@@ -41,6 +44,7 @@
'Composer\\XdebugHandler\\' => array($vendorDir . '/composer/xdebug-handler/src'),
'Composer\\Spdx\\' => array($vendorDir . '/composer/spdx-licenses/src'),
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
+ 'Composer\\MetadataMinifier\\' => array($vendorDir . '/composer/metadata-minifier/src'),
'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
'Composer\\' => array($vendorDir . '/composer/composer/src/Composer'),
'Cake\\Test\\' => array($vendorDir . '/cakephp/cakephp/tests'),
diff --git a/app/vendor/composer/autoload_real.php b/app/vendor/composer/autoload_real.php
index b47ce4e77..54c6e7c9e 100644
--- a/app/vendor/composer/autoload_real.php
+++ b/app/vendor/composer/autoload_real.php
@@ -13,6 +13,9 @@ public static function loadClassLoader($class)
}
}
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
public static function getLoader()
{
if (null !== self::$loader) {
@@ -20,12 +23,12 @@ public static function getLoader()
}
spl_autoload_register(array('ComposerAutoloaderInit8d81387c26c532d7a48feda4036c56c7', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit8d81387c26c532d7a48feda4036c56c7', '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';
+ require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8d81387c26c532d7a48feda4036c56c7::getInitializer($loader));
} else {
diff --git a/app/vendor/composer/autoload_static.php b/app/vendor/composer/autoload_static.php
index c791906ba..a30258452 100644
--- a/app/vendor/composer/autoload_static.php
+++ b/app/vendor/composer/autoload_static.php
@@ -7,35 +7,39 @@
class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
{
public static $files = array (
+ 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'34122c0574b76bf21c9a8db62b5b9cf3' => __DIR__ . '/..' . '/cakephp/chronos/src/carbon_compat.php',
- 'cf97c57bfe0f23854afd2f3818abb7a0' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/create_uploaded_file.php',
- '9bf37a3d0dad93e29cb4e1b1bfab04e9' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php',
- 'ce70dccb4bcc2efc6e94d2ee526e6972' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/marshal_method_from_sapi.php',
- 'f86420df471f14d568bfcb71e271b523' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/marshal_protocol_version_from_sapi.php',
- 'b87481e008a3700344428ae089e7f9e5' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php',
- '0b0974a5566a1077e4f2e111341112c1' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/normalize_server.php',
- '1ca3bc274755662169f9629d5412a1da' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/normalize_uploaded_files.php',
- '40360c0b9b437e69bcbb7f1349ce029e' => __DIR__ . '/..' . '/zendframework/zend-diactoros/src/functions/parse_cookie_header.php',
+ 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
+ '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php',
+ '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php',
+ 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php',
+ '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php',
+ 'e6f3bc6883e449ab367280b34158c05b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php',
+ 'd59fbae42019aedf227094ac49a46f50' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php',
+ 'de95e0ac670b27c84ef8c5ac41fc1b34' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.php',
+ 'b6c2870932b0250c10334a86dcb33c7f' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php',
+ 'd02cf21124526632320d6f20b1bbf905' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php',
+ 'd919fc9d5ad52cfb7f322f7fe36458ab' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php',
+ 'e397f74f8af3b1e56166a6e99f216ee7' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php',
+ 'd154b49fab8e4da34fb553a2d644918c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php',
+ '9d3db23ca418094bcf0b641a0c9559ed' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php',
+ 'b0b88a3b89caae681462c58ff19a7059' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php',
+ 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php',
+ '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php',
+ '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php',
'c720f792236cd163ece8049879166850' => __DIR__ . '/..' . '/cakephp/cakephp/src/Core/functions.php',
'ede59e3a405fb689cd1cebb7bb1db3fb' => __DIR__ . '/..' . '/cakephp/cakephp/src/Collection/functions.php',
'90236b492da7ca2983a2ad6e33e4152e' => __DIR__ . '/..' . '/cakephp/cakephp/src/I18n/functions.php',
'b1fc73705e1bec51cd2b20a32cf1c60a' => __DIR__ . '/..' . '/cakephp/cakephp/src/Utility/bootstrap.php',
+ '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'bf9f5270ae66ac6fa0290b4bf47867b7' => __DIR__ . '/..' . '/adodb/adodb-php/adodb.inc.php',
'801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php',
);
public static $prefixLengthsPsr4 = array (
- 'Z' =>
- array (
- 'Zend\\Diactoros\\' => 15,
- ),
- 'X' =>
- array (
- 'XdgBaseDir\\' => 11,
- ),
'W' =>
array (
'WyriHaximus\\TwigView\\' => 21,
@@ -46,6 +50,8 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
),
'S' =>
array (
+ 'Symfony\\Polyfill\\Php80\\' => 23,
+ 'Symfony\\Polyfill\\Php72\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Polyfill\\Ctype\\' => 23,
'Symfony\\Component\\Yaml\\' => 23,
@@ -59,6 +65,10 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
'Seld\\PharUtils\\' => 15,
'Seld\\JsonLint\\' => 14,
),
+ 'R' =>
+ array (
+ 'React\\Promise\\' => 14,
+ ),
'P' =>
array (
'Psy\\' => 4,
@@ -73,14 +83,19 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
'Migrations\\' => 11,
'M1\\Env\\' => 7,
),
+ 'L' =>
+ array (
+ 'Laminas\\ZendFrameworkBridge\\' => 28,
+ 'Laminas\\Diactoros\\' => 18,
+ ),
'J' =>
array (
'JsonSchema\\' => 11,
'Jasny\\Twig\\' => 11,
- 'JakubOnderka\\PhpConsoleColor\\' => 29,
),
'D' =>
array (
+ 'Doctrine\\Deprecations\\' => 22,
'Doctrine\\DBAL\\' => 14,
'Doctrine\\Common\\Cache\\' => 22,
'Doctrine\\Common\\' => 16,
@@ -92,6 +107,7 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
'Composer\\XdebugHandler\\' => 23,
'Composer\\Spdx\\' => 14,
'Composer\\Semver\\' => 16,
+ 'Composer\\MetadataMinifier\\' => 26,
'Composer\\CaBundle\\' => 18,
'Composer\\' => 9,
'Cake\\Test\\' => 10,
@@ -114,14 +130,6 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
);
public static $prefixDirsPsr4 = array (
- 'Zend\\Diactoros\\' =>
- array (
- 0 => __DIR__ . '/..' . '/zendframework/zend-diactoros/src',
- ),
- 'XdgBaseDir\\' =>
- array (
- 0 => __DIR__ . '/..' . '/dnoegel/php-xdg-base-dir/src',
- ),
'WyriHaximus\\TwigView\\' =>
array (
0 => __DIR__ . '/..' . '/wyrihaximus/twig-view/src',
@@ -130,6 +138,14 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
array (
0 => __DIR__ . '/..' . '/twig/twig/src',
),
+ 'Symfony\\Polyfill\\Php80\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
+ ),
+ 'Symfony\\Polyfill\\Php72\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
+ ),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
@@ -178,6 +194,10 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
array (
0 => __DIR__ . '/..' . '/seld/jsonlint/src/Seld/JsonLint',
),
+ 'React\\Promise\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/react/promise/src',
+ ),
'Psy\\' =>
array (
0 => __DIR__ . '/..' . '/psy/psysh/src',
@@ -210,6 +230,14 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
array (
0 => __DIR__ . '/..' . '/m1/env/src',
),
+ 'Laminas\\ZendFrameworkBridge\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src',
+ ),
+ 'Laminas\\Diactoros\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/laminas/laminas-diactoros/src',
+ ),
'JsonSchema\\' =>
array (
0 => __DIR__ . '/..' . '/justinrainbow/json-schema/src/JsonSchema',
@@ -218,9 +246,9 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
array (
0 => __DIR__ . '/..' . '/jasny/twig-extensions/src',
),
- 'JakubOnderka\\PhpConsoleColor\\' =>
+ 'Doctrine\\Deprecations\\' =>
array (
- 0 => __DIR__ . '/..' . '/jakub-onderka/php-console-color/src',
+ 0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations',
),
'Doctrine\\DBAL\\' =>
array (
@@ -254,6 +282,10 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
array (
0 => __DIR__ . '/..' . '/composer/semver/src',
),
+ 'Composer\\MetadataMinifier\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/composer/metadata-minifier/src',
+ ),
'Composer\\CaBundle\\' =>
array (
0 => __DIR__ . '/..' . '/composer/ca-bundle/src',
@@ -331,13 +363,6 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
0 => __DIR__ . '/..' . '/twig/twig/lib',
),
),
- 'J' =>
- array (
- 'JakubOnderka\\PhpConsoleHighlighter' =>
- array (
- 0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src',
- ),
- ),
'D' =>
array (
'Detection' =>
@@ -355,8 +380,13 @@ class ComposerStaticInit8d81387c26c532d7a48feda4036c56c7
);
public static $classMap = array (
+ 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Mobile_Detect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/Mobile_Detect.php',
'SqlFormatter' => __DIR__ . '/..' . '/jdorn/sql-formatter/lib/SqlFormatter.php',
+ 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
+ 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
public static function getInitializer(ClassLoader $loader)
diff --git a/app/vendor/composer/ca-bundle/README.md b/app/vendor/composer/ca-bundle/README.md
index 04442f90b..d8205ec53 100644
--- a/app/vendor/composer/ca-bundle/README.md
+++ b/app/vendor/composer/ca-bundle/README.md
@@ -27,22 +27,22 @@ Requirements
Basic usage
-----------
-# `Composer\CaBundle\CaBundle`
+### `Composer\CaBundle\CaBundle`
- `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback
- `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file
-- `CaBundle::validateCaFile($filename)`: Validates a CA file using opensl_x509_parse only if it is safe to use
+- `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use
- `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse()
- `CaBundle::reset()`: Resets the static caches
-## To use with curl
+#### To use with curl
```php
$curl = curl_init("https://example.org/");
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
-if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathOrFile)))) {
+if (is_dir($caPathOrFile)) {
curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile);
} else {
curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile);
@@ -51,7 +51,7 @@ if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathO
$result = curl_exec($curl);
```
-## To use with php streams
+#### To use with php streams
```php
$opts = array(
@@ -61,7 +61,7 @@ $opts = array(
);
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
-if (is_dir($caPathOrFile) || (is_link($caPathOrFile) && is_dir(readlink($caPathOrFile)))) {
+if (is_dir($caPathOrFile)) {
$opts['ssl']['capath'] = $caPathOrFile;
} else {
$opts['ssl']['cafile'] = $caPathOrFile;
@@ -71,7 +71,7 @@ $context = stream_context_create($opts);
$result = file_get_contents('https://example.com', false, $context);
```
-## To use with Guzzle
+#### To use with Guzzle
```php
$client = new \GuzzleHttp\Client([
diff --git a/app/vendor/composer/ca-bundle/composer.json b/app/vendor/composer/ca-bundle/composer.json
index ca2a0d34d..5213e9763 100644
--- a/app/vendor/composer/ca-bundle/composer.json
+++ b/app/vendor/composer/ca-bundle/composer.json
@@ -24,12 +24,13 @@
"require": {
"ext-openssl": "*",
"ext-pcre": "*",
- "php": "^5.3.2 || ^7.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
+ "symfony/phpunit-bridge": "^4.2 || ^5",
+ "phpstan/phpstan": "^0.12.55",
"psr/log": "^1.0",
- "symfony/process": "^2.5 || ^3.0 || ^4.0"
+ "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0"
},
"autoload": {
"psr-4": {
@@ -43,12 +44,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-main": "1.x-dev"
}
},
- "config": {
- "platform": {
- "php": "5.3.9"
- }
+ "scripts": {
+ "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit",
+ "phpstan": "vendor/bin/phpstan analyse"
}
}
diff --git a/app/vendor/composer/ca-bundle/res/cacert.pem b/app/vendor/composer/ca-bundle/res/cacert.pem
index ee25bee11..264923b3e 100644
--- a/app/vendor/composer/ca-bundle/res/cacert.pem
+++ b/app/vendor/composer/ca-bundle/res/cacert.pem
@@ -1,7 +1,7 @@
##
## Bundle of CA Root Certificates
##
-## Certificate data from Mozilla as of: Wed Jun 20 03:12:06 2018 GMT
+## Certificate data from Mozilla as of: Tue May 25 03:12:05 2021 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
@@ -13,8 +13,8 @@
## an Apache+mod_ssl webserver for SSL client authentication.
## Just configure this file as the SSLCACertificateFile.
##
-## Conversion done with mk-ca-bundle.pl version 1.27.
-## SHA256: c80f571d9f4ebca4a91e0ad3a546f263153d71afffc845c6f8f52ce9d1a2e8ec
+## Conversion done with mk-ca-bundle.pl version 1.28.
+## SHA256: e292bd4e2d500c86df45b830d89417be5c42ee670408f1d2c454c63d8a782865
##
@@ -61,30 +61,6 @@ BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp
TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
-----END CERTIFICATE-----
-Verisign Class 3 Public Primary Certification Authority - G3
-============================================================
------BEGIN CERTIFICATE-----
-MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
-UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
-cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
-CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
-dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
-Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
-EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
-cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
-EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
-055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
-ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
-j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
-/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
-xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
-t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
------END CERTIFICATE-----
-
Entrust.net Premium 2048 Secure Server CA
=========================================
-----BEGIN CERTIFICATE-----
@@ -130,30 +106,6 @@ Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H
RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
-----END CERTIFICATE-----
-AddTrust External Root
-======================
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
-QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD
-VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw
-NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU
-cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg
-Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821
-+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw
-Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo
-aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy
-2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7
-7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P
-BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL
-VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk
-VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
-IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl
-j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355
-e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u
-G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
-
Entrust Root Certification Authority
====================================
-----BEGIN CERTIFICATE-----
@@ -180,109 +132,6 @@ W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0
tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8
-----END CERTIFICATE-----
-GeoTrust Global CA
-==================
------BEGIN CERTIFICATE-----
-MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK
-Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw
-MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j
-LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo
-BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet
-8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc
-T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU
-vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD
-AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk
-DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q
-zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4
-d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2
-mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p
-XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm
-Mw==
------END CERTIFICATE-----
-
-GeoTrust Universal CA
-=====================
------BEGIN CERTIFICATE-----
-MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
-R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1
-MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu
-Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
-ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t
-JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e
-RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs
-7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d
-8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V
-qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga
-Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB
-Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu
-KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08
-ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0
-XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB
-hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
-aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2
-qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL
-oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK
-xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF
-KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2
-DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK
-xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU
-p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI
-P/rmMuGNG2+k5o7Y+SlIis5z/iw=
------END CERTIFICATE-----
-
-GeoTrust Universal CA 2
-=======================
------BEGIN CERTIFICATE-----
-MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN
-R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0
-MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg
-SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA
-A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0
-DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17
-j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q
-JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a
-QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2
-WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP
-20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn
-ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC
-SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG
-8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2
-+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E
-BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z
-dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ
-4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+
-mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq
-A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg
-Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP
-pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d
-FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp
-gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm
-X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
------END CERTIFICATE-----
-
-Visa eCommerce Root
-===================
------BEGIN CERTIFICATE-----
-MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG
-EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug
-QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2
-WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm
-VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
-bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL
-F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b
-RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0
-TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI
-/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs
-GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG
-MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc
-CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW
-YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz
-zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu
-YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt
-398znM/jra6O1I7mT1GvFpLgXPYHDw==
------END CERTIFICATE-----
-
Comodo AAA Services root
========================
-----BEGIN CERTIFICATE-----
@@ -518,36 +367,6 @@ KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3
QBFGmh95DmK/D5fs4C8fF5Q=
-----END CERTIFICATE-----
-Taiwan GRCA
-===========
------BEGIN CERTIFICATE-----
-MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG
-EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X
-DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv
-dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD
-ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN
-w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5
-BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O
-1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO
-htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov
-J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7
-Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t
-B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB
-O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8
-lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV
-HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2
-09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ
-TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj
-Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2
-Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU
-D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz
-DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk
-Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk
-7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ
-CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy
-+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS
------END CERTIFICATE-----
-
DigiCert Assured ID Root CA
===========================
-----BEGIN CERTIFICATE-----
@@ -614,28 +433,6 @@ mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
-----END CERTIFICATE-----
-Certplus Class 2 Primary CA
-===========================
------BEGIN CERTIFICATE-----
-MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE
-BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN
-OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy
-dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
-ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR
-5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ
-Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO
-YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e
-e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME
-CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ
-YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t
-L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD
-P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R
-TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+
-7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW
-//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
-l7+ijrRU
------END CERTIFICATE-----
-
DST Root CA X3
==============
-----BEGIN CERTIFICATE-----
@@ -718,78 +515,6 @@ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub
DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
-----END CERTIFICATE-----
-GeoTrust Primary Certification Authority
-========================================
------BEGIN CERTIFICATE-----
-MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG
-EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD
-ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx
-CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ
-cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
-CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN
-b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9
-nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge
-RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt
-tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD
-AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI
-hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K
-Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN
-NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa
-Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG
-1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
------END CERTIFICATE-----
-
-thawte Primary Root CA
-======================
------BEGIN CERTIFICATE-----
-MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE
-BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
-aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3
-MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg
-SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv
-KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT
-FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs
-oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ
-1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc
-q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K
-aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p
-afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD
-VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF
-AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE
-uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
-xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89
-jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH
-z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==
------END CERTIFICATE-----
-
-VeriSign Class 3 Public Primary Certification Authority - G5
-============================================================
------BEGIN CERTIFICATE-----
-MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
-BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
-ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
-IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
-yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
-biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
-dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
-ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
-j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
-Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
-Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
-fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
-BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
-Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
-aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
-SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
-X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
-KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
-Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
-ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
------END CERTIFICATE-----
-
SecureTrust CA
==============
-----BEGIN CERTIFICATE-----
@@ -898,29 +623,6 @@ FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA
U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
-----END CERTIFICATE-----
-OISTE WISeKey Global Root GA CA
-===============================
------BEGIN CERTIFICATE-----
-MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE
-BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG
-A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH
-bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD
-VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw
-IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5
-IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9
-Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg
-Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD
-d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ
-/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R
-LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
-AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
-KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm
-MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4
-+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
-hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
-okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
------END CERTIFICATE-----
-
Certigna
========
-----BEGIN CERTIFICATE-----
@@ -943,28 +645,6 @@ PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY
WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
-----END CERTIFICATE-----
-Deutsche Telekom Root CA 2
-==========================
------BEGIN CERTIFICATE-----
-MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT
-RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG
-A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5
-MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G
-A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS
-b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5
-bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI
-KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY
-AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK
-Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV
-jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV
-HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr
-E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy
-zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8
-rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G
-dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
-Cm26OWMohpLzGITY+9HPBVZkVw==
------END CERTIFICATE-----
-
Cybertrust Global Root
======================
-----BEGIN CERTIFICATE-----
@@ -1038,136 +718,6 @@ vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz
TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD
-----END CERTIFICATE-----
-GeoTrust Primary Certification Authority - G3
-=============================================
------BEGIN CERTIFICATE-----
-MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE
-BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0
-IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy
-eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz
-NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo
-YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT
-LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j
-K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE
-c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C
-IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu
-dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr
-2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9
-cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE
-Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
-AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s
-t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt
------END CERTIFICATE-----
-
-thawte Primary Root CA - G2
-===========================
------BEGIN CERTIFICATE-----
-MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC
-VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu
-IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg
-Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV
-MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG
-b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt
-IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS
-LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5
-8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU
-mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN
-G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K
-rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
------END CERTIFICATE-----
-
-thawte Primary Root CA - G3
-===========================
------BEGIN CERTIFICATE-----
-MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE
-BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2
-aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv
-cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w
-ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
-d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD
-VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG
-A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At
-P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC
-+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY
-7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW
-vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ
-KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK
-A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
-t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC
-8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm
-er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=
------END CERTIFICATE-----
-
-GeoTrust Primary Certification Authority - G2
-=============================================
------BEGIN CERTIFICATE-----
-MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC
-VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu
-Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD
-ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1
-OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
-MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl
-b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG
-BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc
-KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD
-VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+
-EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m
-ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2
-npaqBA+K
------END CERTIFICATE-----
-
-VeriSign Universal Root Certification Authority
-===============================================
------BEGIN CERTIFICATE-----
-MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
-BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
-ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
-IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
-IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
-UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
-cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
-1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
-MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
-9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
-AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
-tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
-CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
-a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
-DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
-Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
-Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
-P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
-wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
-mJO37M2CYfE45k+XmCpajQ==
------END CERTIFICATE-----
-
-VeriSign Class 3 Public Primary Certification Authority - G4
-============================================================
------BEGIN CERTIFICATE-----
-MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
-VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
-b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
-ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
-YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
-MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
-cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
-b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
-IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
-Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
-rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
-/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
-HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
-Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
-A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
-AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
------END CERTIFICATE-----
-
NetLock Arany (Class Gold) Főtanúsítvány
========================================
-----BEGIN CERTIFICATE-----
@@ -1192,38 +742,6 @@ NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu
dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
-----END CERTIFICATE-----
-Staat der Nederlanden Root CA - G2
-==================================
------BEGIN CERTIFICATE-----
-MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE
-CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
-Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC
-TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l
-ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ
-5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn
-vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj
-CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil
-e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR
-OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI
-CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65
-48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi
-trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737
-qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB
-AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC
-ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV
-HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA
-A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz
-+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj
-f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN
-kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk
-CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF
-URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb
-CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h
-oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV
-IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm
-66+KAQ==
------END CERTIFICATE-----
-
Hongkong Post Root CA 1
=======================
-----BEGIN CERTIFICATE-----
@@ -1375,82 +893,6 @@ Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z
WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==
-----END CERTIFICATE-----
-Chambers of Commerce Root - 2008
-================================
------BEGIN CERTIFICATE-----
-MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD
-MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
-bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
-QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy
-Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl
-ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF
-EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl
-cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
-AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA
-XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj
-h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/
-ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk
-NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g
-D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331
-lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ
-0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj
-ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2
-EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI
-G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ
-BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh
-bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh
-bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC
-CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH
-AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1
-wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH
-3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU
-RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6
-M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1
-YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF
-9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK
-zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG
-nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
-OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ
------END CERTIFICATE-----
-
-Global Chambersign Root - 2008
-==============================
------BEGIN CERTIFICATE-----
-MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD
-MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
-bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
-QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx
-NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg
-Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ
-QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
-aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf
-VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf
-XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0
-ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB
-/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA
-TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M
-H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe
-Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF
-HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh
-wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB
-AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT
-BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE
-BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm
-aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm
-aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp
-1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0
-dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG
-/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6
-ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s
-dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg
-9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH
-foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du
-qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr
-P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq
-c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
-09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
------END CERTIFICATE-----
-
Go Daddy Root Certificate Authority - G2
========================================
-----BEGIN CERTIFICATE-----
@@ -1855,30 +1297,6 @@ P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw==
-----END CERTIFICATE-----
-EE Certification Centre Root CA
-===============================
------BEGIN CERTIFICATE-----
-MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG
-EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy
-dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw
-MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB
-UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy
-ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB
-DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM
-TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2
-rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw
-93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN
-P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T
-AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ
-MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF
-BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj
-xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM
-lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
-uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU
-3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM
-dcGWxZ0=
------END CERTIFICATE-----
-
D-TRUST Root Class 3 CA 2 2009
==============================
-----BEGIN CERTIFICATE-----
@@ -2441,36 +1859,6 @@ uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7
yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3
-----END CERTIFICATE-----
-Staat der Nederlanden Root CA - G3
-==================================
------BEGIN CERTIFICATE-----
-MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE
-CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
-Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC
-TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l
-ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y
-olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t
-x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy
-EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K
-Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur
-mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5
-1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp
-07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo
-FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE
-41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB
-AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu
-yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD
-U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq
-KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1
-v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA
-8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b
-8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r
-mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq
-1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI
-JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV
-tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk=
------END CERTIFICATE-----
-
Staat der Nederlanden EV Root CA
================================
-----BEGIN CERTIFICATE-----
@@ -2635,37 +2023,6 @@ kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C
ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su
-----END CERTIFICATE-----
-Certinomis - Root CA
-====================
------BEGIN CERTIFICATE-----
-MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UEChMK
-Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRpbm9taXMg
-LSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMzMTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIx
-EzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRD
-ZXJ0aW5vbWlzIC0gUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQos
-P5L2fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJflLieY6pOo
-d5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQVWZUKxkd8aRi5pwP5ynap
-z8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDFTKWrteoB4owuZH9kb/2jJZOLyKIOSY00
-8B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09x
-RLWtwHkziOC/7aOgFLScCbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE
-6OXWk6RiwsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJwx3t
-FvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SGm/lg0h9tkQPTYKbV
-PZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4F2iw4lNVYC2vPsKD2NkJK/DAZNuH
-i5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZngWVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGj
-YzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I
-6tNxIqSSaHh02TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF
-AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV
-WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw
-Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX
-lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ
-y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9
-Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng
-DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi
-I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM
-cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr
-hkIGuUE=
------END CERTIFICATE-----
-
OISTE WISeKey Global Root GB CA
===============================
-----BEGIN CERTIFICATE-----
@@ -2792,126 +2149,6 @@ GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn
dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR
-----END CERTIFICATE-----
-Certplus Root CA G1
-===================
------BEGIN CERTIFICATE-----
-MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUAMD4xCzAJBgNV
-BAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTAe
-Fw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhD
-ZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQAD
-ggIPADCCAgoCggIBANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHN
-r49aiZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt6kuJPKNx
-Qv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP0FG7Yn2ksYyy/yARujVj
-BYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTv
-LRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDEEW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2
-z4QTd28n6v+WZxcIbekN1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYfFkuPSi5YXHLtaW6uOrc
-4nBvCGrch2c0798wct3zyT8j/zXhviEpIDCB5BmlIOklynMxdCm+4kLV87ImZsdo/Rmz5yCTmehd
-4F6H50boJZwKKSTUzViGUkAksnsPmBIgJPaQbEfIDbsYIC7Z/fyL8inqh3SV4EJQeIQEQWGw9CEj
-jy3LKCHyamz0GqbFFLQ3ZU+V/YDI+HLlJWvEYLF7bY5KinPOWftwenMGE9nTdDckQQoRb5fc5+R+
-ob0V8rqHDz1oihYHAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0G
-A1UdDgQWBBSowcCbkahDFXxdBie0KlHYlwuBsTAfBgNVHSMEGDAWgBSowcCbkahDFXxdBie0KlHY
-lwuBsTANBgkqhkiG9w0BAQ0FAAOCAgEAnFZvAX7RvUz1isbwJh/k4DgYzDLDKTudQSk0YcbX8ACh
-66Ryj5QXvBMsdbRX7gp8CXrc1cqh0DQT+Hern+X+2B50ioUHj3/MeXrKls3N/U/7/SMNkPX0XtPG
-YX2eEeAC7gkE2Qfdpoq3DIMku4NQkv5gdRE+2J2winq14J2by5BSS7CTKtQ+FjPlnsZlFT5kOwQ/
-2wyPX1wdaR+v8+khjPPvl/aatxm2hHSco1S1cE5j2FddUyGbQJJD+tZ3VTNPZNX70Cxqjm0lpu+F
-6ALEUz65noe8zDUa3qHpimOHZR4RKttjd5cUvpoUmRGywO6wT/gUITJDT5+rosuoD6o7BlXGEilX
-CNQ314cnrUlZp5GrRHpejXDbl85IULFzk/bwg2D5zfHhMf1bfHEhYxQUqq/F3pN+aLHsIqKqkHWe
-tUNy6mSjhEv9DKgma3GX7lZjZuhCVPnHHd/Qj1vfyDBviP4NxDMcU6ij/UgQ8uQKTuEVV/xuZDDC
-VRHc6qnNSlSsKWNEz0pAoNZoWRsz+e86i9sgktxChL8Bq4fA1SCC28a5g4VCXA9DO2pJNdWY9BW/
-+mGBDAkgGNLQFwzLSABQ6XaCjGTXOqAHVcweMcDvOrRl++O/QmueD6i9a5jc2NvLi6Td11n0bt3+
-qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo=
------END CERTIFICATE-----
-
-Certplus Root CA G2
-===================
------BEGIN CERTIFICATE-----
-MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4xCzAJBgNVBAYT
-AkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjAeFw0x
-NDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0
-cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IA
-BM0PW1aC3/BFGtat93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uN
-Am8xIk0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0PAQH/BAQD
-AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMB8GA1Ud
-IwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqGSM49BAMDA2gAMGUCMHD+sAvZ94OX7PNV
-HdTcswYO/jOYnYs5kGuUIe22113WTNchp+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjl
-vPl5adytRSv3tjFzzAalU5ORGpOucGpnutee5WEaXw==
------END CERTIFICATE-----
-
-OpenTrust Root CA G1
-====================
------BEGIN CERTIFICATE-----
-MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59rY45nMA0GCSqGSIb3DQEBCwUAMEAxCzAJBgNV
-BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcx
-MB4XDTE0MDUyNjA4NDU1MFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoM
-CU9wZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzEwggIiMA0GCSqGSIb3DQEB
-AQUAA4ICDwAwggIKAoICAQD4eUbalsUwXopxAy1wpLuwxQjczeY1wICkES3d5oeuXT2R0odsN7fa
-Yp6bwiTXj/HbpqbfRm9RpnHLPhsxZ2L3EVs0J9V5ToybWL0iEA1cJwzdMOWo010hOHQX/uMftk87
-ay3bfWAfjH1MBcLrARYVmBSO0ZB3Ij/swjm4eTrwSSTilZHcYTSSjFR077F9jAHiOH3BX2pfJLKO
-YheteSCtqx234LSWSE9mQxAGFiQD4eCcjsZGT44ameGPuY4zbGneWK2gDqdkVBFpRGZPTBKnjix9
-xNRbxQA0MMHZmf4yzgeEtE7NCv82TWLxp2NX5Ntqp66/K7nJ5rInieV+mhxNaMbBGN4zK1FGSxyO
-9z0M+Yo0FMT7MzUj8czxKselu7Cizv5Ta01BG2Yospb6p64KTrk5M0ScdMGTHPjgniQlQ/GbI4Kq
-3ywgsNw2TgOzfALU5nsaqocTvz6hdLubDuHAk5/XpGbKuxs74zD0M1mKB3IDVedzagMxbm+WG+Oi
-n6+Sx+31QrclTDsTBM8clq8cIqPQqwWyTBIjUtz9GVsnnB47ev1CI9sjgBPwvFEVVJSmdz7QdFG9
-URQIOTfLHzSpMJ1ShC5VkLG631UAC9hWLbFJSXKAqWLXwPYYEQRVzXR7z2FwefR7LFxckvzluFqr
-TJOVoSfupb7PcSNCupt2LQIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
-/zAdBgNVHQ4EFgQUl0YhVyE12jZVx/PxN3DlCPaTKbYwHwYDVR0jBBgwFoAUl0YhVyE12jZVx/Px
-N3DlCPaTKbYwDQYJKoZIhvcNAQELBQADggIBAB3dAmB84DWn5ph76kTOZ0BP8pNuZtQ5iSas000E
-PLuHIT839HEl2ku6q5aCgZG27dmxpGWX4m9kWaSW7mDKHyP7Rbr/jyTwyqkxf3kfgLMtMrpkZ2Cv
-uVnN35pJ06iCsfmYlIrM4LvgBBuZYLFGZdwIorJGnkSI6pN+VxbSFXJfLkur1J1juONI5f6ELlgK
-n0Md/rcYkoZDSw6cMoYsYPXpSOqV7XAp8dUv/TW0V8/bhUiZucJvbI/NeJWsZCj9VrDDb8O+WVLh
-X4SPgPL0DTatdrOjteFkdjpY3H1PXlZs5VVZV6Xf8YpmMIzUUmI4d7S+KNfKNsSbBfD4Fdvb8e80
-nR14SohWZ25g/4/Ii+GOvUKpMwpZQhISKvqxnUOOBZuZ2mKtVzazHbYNeS2WuOvyDEsMpZTGMKcm
-GS3tTAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L9109S5zvE/
-bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/KyPu1svf0OnWZzsD2097+o
-4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJAwSQiumPv+i2tCqjI40cHLI5kqiPAlxA
-OXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj1oxx
------END CERTIFICATE-----
-
-OpenTrust Root CA G2
-====================
------BEGIN CERTIFICATE-----
-MIIFbzCCA1egAwIBAgISESChaRu/vbm9UpaPI+hIvyYRMA0GCSqGSIb3DQEBDQUAMEAxCzAJBgNV
-BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcy
-MB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoM
-CU9wZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzIwggIiMA0GCSqGSIb3DQEB
-AQUAA4ICDwAwggIKAoICAQDMtlelM5QQgTJT32F+D3Y5z1zCU3UdSXqWON2ic2rxb95eolq5cSG+
-Ntmh/LzubKh8NBpxGuga2F8ORAbtp+Dz0mEL4DKiltE48MLaARf85KxP6O6JHnSrT78eCbY2albz
-4e6WiWYkBuTNQjpK3eCasMSCRbP+yatcfD7J6xcvDH1urqWPyKwlCm/61UWY0jUJ9gNDlP7ZvyCV
-eYCYitmJNbtRG6Q3ffyZO6v/v6wNj0OxmXsWEH4db0fEFY8ElggGQgT4hNYdvJGmQr5J1WqIP7wt
-UdGejeBSzFfdNTVY27SPJIjki9/ca1TSgSuyzpJLHB9G+h3Ykst2Z7UJmQnlrBcUVXDGPKBWCgOz
-3GIZ38i1MH/1PCZ1Eb3XG7OHngevZXHloM8apwkQHZOJZlvoPGIytbU6bumFAYueQ4xncyhZW+vj
-3CzMpSZyYhK05pyDRPZRpOLAeiRXyg6lPzq1O4vldu5w5pLeFlwoW5cZJ5L+epJUzpM5ChaHvGOz
-9bGTXOBut9Dq+WIyiET7vycotjCVXRIouZW+j1MY5aIYFuJWpLIsEPUdN6b4t/bQWVyJ98LVtZR0
-0dX+G7bw5tYee9I8y6jj9RjzIR9u701oBnstXW5DiabA+aC/gh7PU3+06yzbXfZqfUAkBXKJOAGT
-y3HCOV0GEfZvePg3DTmEJwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
-/zAdBgNVHQ4EFgQUajn6QiL35okATV59M4PLuG53hq8wHwYDVR0jBBgwFoAUajn6QiL35okATV59
-M4PLuG53hq8wDQYJKoZIhvcNAQENBQADggIBAJjLq0A85TMCl38th6aP1F5Kr7ge57tx+4BkJamz
-Gj5oXScmp7oq4fBXgwpkTx4idBvpkF/wrM//T2h6OKQQbA2xx6R3gBi2oihEdqc0nXGEL8pZ0keI
-mUEiyTCYYW49qKgFbdEfwFFEVn8nNQLdXpgKQuswv42hm1GqO+qTRmTFAHneIWv2V6CG1wZy7HBG
-S4tz3aAhdT7cHcCP009zHIXZ/n9iyJVvttN7jLpTwm+bREx50B1ws9efAvSyB7DH5fitIw6mVskp
-EndI2S9G/Tvw/HRwkqWOOAgfZDC2t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ
-6e18CL13zSdkzJTaTkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97kr
-gCf2o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU3jg9CcCo
-SmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eAiN1nE28daCSLT7d0geX0
-YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14fWKGVyasvc0rQLW6aWQ9VGHgtPFGml4vm
-u7JwqkwR3v98KzfUetF3NI/n+UL3PIEMS1IK
------END CERTIFICATE-----
-
-OpenTrust Root CA G3
-====================
------BEGIN CERTIFICATE-----
-MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAxCzAJBgNVBAYT
-AkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEczMB4X
-DTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9w
-ZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQA
-IgNiAARK7liuTcpm3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5B
-ta1doYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4GA1UdDwEB
-/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAf
-BgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAKBggqhkjOPQQDAwNpADBmAjEAj6jcnboM
-BBf6Fek9LykBl7+BFjNAk2z8+e2AcG+qj9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta
-3U1fJAuwACEl74+nBCZx4nxp5V2a+EEfOzmTk51V6s2N8fvB
------END CERTIFICATE-----
-
ISRG Root X1
============
-----BEGIN CERTIFICATE-----
@@ -3048,37 +2285,6 @@ MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1
AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA==
-----END CERTIFICATE-----
-LuxTrust Global Root 2
-======================
------BEGIN CERTIFICATE-----
-MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQELBQAwRjELMAkG
-A1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNVBAMMFkx1eFRydXN0IEdsb2Jh
-bCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUwMzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEW
-MBQGA1UECgwNTHV4VHJ1c3QgUy5BLjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCC
-AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wm
-Kb3FibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTemhfY7RBi2
-xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1EMShduxq3sVs35a0VkBC
-wGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsnXpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm
-1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkm
-FRseTJIpgp7VkoGSQXAZ96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niF
-wpN6cj5mj5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4gDEa/
-a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+8kPREd8vZS9kzl8U
-ubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2jX5t/Lax5Gw5CMZdjpPuKadUiDTSQ
-MC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmHhFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB
-/zBCBgNVHSAEOzA5MDcGByuBKwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5
-Lmx1eHRydXN0Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT
-+Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQELBQADggIBAGoZ
-FO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9BzZAcg4atmpZ1gDlaCDdLnIN
-H2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTOjFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW
-7MM3LGVYvlcAGvI1+ut7MV3CwRI9loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIu
-ZY+kt9J/Z93I055cqqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWA
-VWe+2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/JEAdemrR
-TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt
-/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQfLSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc
-7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I
-iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
------END CERTIFICATE-----
-
TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1
=============================================
-----BEGIN CERTIFICATE-----
@@ -3312,3 +2518,621 @@ BBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe
N+vp1RPZytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mm
m7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg==
-----END CERTIFICATE-----
+
+GlobalSign Root CA - R6
+=======================
+-----BEGIN CERTIFICATE-----
+MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UECxMX
+R2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds
+b2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9i
+YWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs
+U2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQss
+grRIxutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1kZguSgMpE
+3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxDaNc9PIrFsmbVkJq3MQbF
+vuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJwLnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqM
+PKq0pPbzlUoSB239jLKJz9CgYXfIWHSw1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+
+azayOeSsJDa38O+2HBNXk7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05O
+WgtH8wY2SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/hbguy
+CLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4nWUx2OVvq+aWh2IMP
+0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpYrZxCRXluDocZXFSxZba/jJvcE+kN
+b7gu3GduyYsRtYQUigAZcIN5kZeR1BonvzceMgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQE
+AwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNV
+HSMEGDAWgBSubAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN
+nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGtIxg93eFyRJa0
+lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr6155wsTLxDKZmOMNOsIeDjHfrY
+BzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLjvUYAGm0CuiVdjaExUd1URhxN25mW7xocBFym
+Fe944Hn+Xds+qkxV/ZoVqW/hpvvfcDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr
+3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB1
+0jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfspA9MRf/T
+uTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+vJJUEeKgDu+6B5dpffItK
+oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t
+JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA=
+-----END CERTIFICATE-----
+
+OISTE WISeKey Global Root GC CA
+===============================
+-----BEGIN CERTIFICATE-----
+MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD
+SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo
+MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa
+Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL
+ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh
+bCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4nieUqjFqdr
+VCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4Wp2OQ0jnUsYd4XxiWD1Ab
+NTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd
+BgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7TrYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0E
+AwMDaAAwZQIwJsdpW9zV57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtk
+AjEA2zQgMgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9
+-----END CERTIFICATE-----
+
+GTS Root R1
+===========
+-----BEGIN CERTIFICATE-----
+MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG
+EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv
+b3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG
+A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIi
+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx
+9vaMf/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7r
+aKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnW
+r4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqM
+LnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly
+4cpk9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr
+06zqkUspzBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOORc92
+wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYWk70paDPvOmbsB4om
+3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+DVrNVjzRlwW5y0vtOUucxD/SVRNu
+JLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgFlQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
+VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEM
+BQADggIBADiWCu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1
+d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6ZXPYfcX3v73sv
+fuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZRgyFmxhE+885H7pwoHyXa/6xm
+ld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9b
+gsiG1eGZbYwE8na6SfZu6W0eX6DvJ4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq
+4BjFbkerQUIpm/ZgDdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWEr
+tXvM+SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyyF62ARPBo
+pY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9SQ98POyDGCBDTtWTurQ0
+sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdwsE3PYJ/HQcu51OyLemGhmW/HGY0dVHLql
+CFF1pkgl
+-----END CERTIFICATE-----
+
+GTS Root R2
+===========
+-----BEGIN CERTIFICATE-----
+MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG
+EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv
+b3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG
+A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIi
+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTuk
+k3LvCvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo
+7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWI
+m8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5Gm
+dFrS+LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbu
+ak7MkogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscsz
+cTJGr61K8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqjx5RW
+Ir9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsRnTKaG73Vululycsl
+aVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0kzCqgc7dGtxRcw1PcOnlthYhGXmy
+5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9OktwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
+VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEM
+BQADggIBALZp8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT
+vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiTz9D2PGcDFWEJ
++YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiApJiS4wGWAqoC7o87xdFtCjMw
+c3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvbpxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3Da
+WsYDQvTtN6LwG1BUSw7YhN4ZKJmBR64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5r
+n/WkhLx3+WuXrD5RRaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56Gtmwfu
+Nmsk0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC5AwiWVIQ
+7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiFizoHCBy69Y9Vmhh1fuXs
+gWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLnyOd/xCxgXS/Dr55FBcOEArf9LAhST4Ld
+o/DUhgkC
+-----END CERTIFICATE-----
+
+GTS Root R3
+===========
+-----BEGIN CERTIFICATE-----
+MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV
+UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg
+UjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE
+ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcq
+hkjOPQIBBgUrgQQAIgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUU
+Rout736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2ADDL24Cej
+QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTB8Sa6oC2uhYHP
+0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFukfCPAlaUs3L6JbyO5o91lAFJekazInXJ0
+glMLfalAvWhgxeG4VDvBNhcl2MG9AjEAnjWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOa
+KaqW04MjyaR7YbPMAuhd
+-----END CERTIFICATE-----
+
+GTS Root R4
+===========
+-----BEGIN CERTIFICATE-----
+MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV
+UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg
+UjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE
+ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcq
+hkjOPQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa
+6zzuhXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvRHYqj
+QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV
+2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0CMRw3J5QdCHojXohw0+WbhXRIjVhLfoI
+N+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11x
+zPKwTdb+mciUqXWi4w==
+-----END CERTIFICATE-----
+
+UCA Global G2 Root
+==================
+-----BEGIN CERTIFICATE-----
+MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYDVQQG
+EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9vdDAeFw0x
+NjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlU
+cnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
+MIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmT
+oni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzmVHqUwCoV
+8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/RVogvGjqNO7uCEeBHANBS
+h6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDcC/Vkw85DvG1xudLeJ1uK6NjGruFZfc8o
+LTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIjtm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/
+R+zvWr9LesGtOxdQXGLYD0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBe
+KW4bHAyvj5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6DlNaBa
+4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6iIis7nCs+dwp4wwc
+OxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznPO6Q0ibd5Ei9Hxeepl2n8pndntd97
+8XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
+BBYEFIHEjMz15DD/pQwIX4wVZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo
+5sOASD0Ee/ojL3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5
+1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl1qnN3e92mI0A
+Ds0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oUb3n09tDh05S60FdRvScFDcH9
+yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LVPtateJLbXDzz2K36uGt/xDYotgIVilQsnLAX
+c47QN6MUPJiVAAwpBVueSUmxX8fjy88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHo
+jhJi6IjMtX9Gl8CbEGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZk
+bxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI+Vg7RE+x
+ygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGyYiGqhkCyLmTTX8jjfhFn
+RR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1whnw0A==
+-----END CERTIFICATE-----
+
+UCA Extended Validation Root
+============================
+-----BEGIN CERTIFICATE-----
+MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG
+EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u
+IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G
+A1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIi
+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrs
+iWogD4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvSsPGP2KxF
+Rv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aopO2z6+I9tTcg1367r3CTu
+eUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dksHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR
+59mzLC52LqGj3n5qiAno8geK+LLNEOfic0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH
+0mK1lTnj8/FtDw5lhIpjVMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KR
+el7sFsLzKuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/TuDv
+B0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41Gsx2VYVdWf6/wFlth
+WG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs1+lvK9JKBZP8nm9rZ/+I8U6laUpS
+NwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQDfwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS
+3H5aBZ8eNJr34RQwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL
+BQADggIBADaNl8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR
+ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQVBcZEhrxH9cM
+aVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5c6sq1WnIeJEmMX3ixzDx/BR4
+dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb
++7lsq+KePRXBOy5nAliRn+/4Qh8st2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOW
+F3sGPjLtx7dCvHaj2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwi
+GpWOvpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2CxR9GUeOc
+GMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmxcmtpzyKEC2IPrNkZAJSi
+djzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbMfjKaiJUINlK73nZfdklJrX+9ZSCyycEr
+dhh2n1ax
+-----END CERTIFICATE-----
+
+Certigna Root CA
+================
+-----BEGIN CERTIFICATE-----
+MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAwWjELMAkGA1UE
+BhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAwMiA0ODE0NjMwODEwMDAzNjEZ
+MBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0xMzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjda
+MFoxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYz
+MDgxMDAwMzYxGTAXBgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4IC
+DwAwggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sOty3tRQgX
+stmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9MCiBtnyN6tMbaLOQdLNyz
+KNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPuI9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8
+JXrJhFwLrN1CTivngqIkicuQstDuI7pmTLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16
+XdG+RCYyKfHx9WzMfgIhC59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq
+4NYKpkDfePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3YzIoej
+wpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWTCo/1VTp2lc5ZmIoJ
+lXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1kJWumIWmbat10TWuXekG9qxf5kBdI
+jzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp/
+/TBt2dzhauH8XwIDAQABo4IBGjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
+HQYDVR0OBBYEFBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of
+1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczovL3d3d3cuY2Vy
+dGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilodHRwOi8vY3JsLmNlcnRpZ25h
+LmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYraHR0cDovL2NybC5kaGlteW90aXMuY29tL2Nl
+cnRpZ25hcm9vdGNhLmNybDANBgkqhkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOIt
+OoldaDgvUSILSo3L6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxP
+TGRGHVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH60BGM+RFq
+7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncBlA2c5uk5jR+mUYyZDDl3
+4bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdio2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd
+8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS
+6Cvu5zHbugRqh5jnxV/vfaci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaY
+tlu3zM63Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayhjWZS
+aX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde
+E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0=
+-----END CERTIFICATE-----
+
+emSign Root CA - G1
+===================
+-----BEGIN CERTIFICATE-----
+MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET
+MBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRl
+ZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgx
+ODMwMDBaMGcxCzAJBgNVBAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVk
+aHJhIFRlY2hub2xvZ2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIB
+IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQzf2N4aLTN
+LnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO8oG0x5ZOrRkVUkr+PHB1
+cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aqd7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHW
+DV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhMtTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ
+6DqS0hdW5TUaQBw+jSztOd9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrH
+hQIDAQABo0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQDAgEG
+MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31xPaOfG1vR2vjTnGs2
+vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjMwiI/aTvFthUvozXGaCocV685743Q
+NcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6dGNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q
++Mri/Tm3R7nrft8EI6/6nAYH6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeih
+U80Bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx
+iN66zB+Afko=
+-----END CERTIFICATE-----
+
+emSign ECC Root CA - G3
+=======================
+-----BEGIN CERTIFICATE-----
+MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG
+A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg
+MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4
+MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11
+ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g
+RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc
+58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr
+MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC
+AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D
+CBeQyh+KTOgNG3qxrdWBCUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7
+jHvrZQnD+JbNR6iC8hZVdyR+EhCVBCyj
+-----END CERTIFICATE-----
+
+emSign Root CA - C1
+===================
+-----BEGIN CERTIFICATE-----
+MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCVVMx
+EzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNp
+Z24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UE
+BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQD
+ExNlbVNpZ24gUm9vdCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+up
+ufGZBczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZHdPIWoU/
+Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH3DspVpNqs8FqOp099cGX
+OFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvHGPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4V
+I5b2P/AgNBbeCsbEBEV5f6f9vtKppa+cxSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleooms
+lMuoaJuvimUnzYnu3Yy1aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+
+XJGFehiqTbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQAD
+ggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87/kOXSTKZEhVb3xEp
+/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4kqNPEjE2NuLe/gDEo2APJ62gsIq1
+NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrGYQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9
+wC68AivTxEDkigcxHpvOJpkT+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQ
+BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI=
+-----END CERTIFICATE-----
+
+emSign ECC Root CA - C3
+=======================
+-----BEGIN CERTIFICATE-----
+MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG
+A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF
+Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE
+BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD
+ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd
+6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9
+SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA
+B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA
+MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU
+ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ==
+-----END CERTIFICATE-----
+
+Hongkong Post Root CA 3
+=======================
+-----BEGIN CERTIFICATE-----
+MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG
+A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQQK
+Ew1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25na29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2
+MDMwMjI5NDZaFw00MjA2MDMwMjI5NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtv
+bmcxEjAQBgNVBAcTCUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMX
+SG9uZ2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz
+iNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFOdem1p+/l6TWZ5Mwc50tf
+jTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mIVoBc+L0sPOFMV4i707mV78vH9toxdCim
+5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOe
+sL4jpNrcyCse2m5FHomY2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj
+0mRiikKYvLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+TtbNe/
+JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZbx39ri1UbSsUgYT2u
+y1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+l2oBlKN8W4UdKjk60FSh0Tlxnf0h
++bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YKTE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsG
+xVd7GYYKecsAyVKvQv83j+GjHno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwID
+AQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e
+i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEwDQYJKoZIhvcN
+AQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG7BJ8dNVI0lkUmcDrudHr9Egw
+W62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCkMpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWld
+y8joRTnU+kLBEUx3XZL7av9YROXrgZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov
++BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc
+eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw
+9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7
+nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY
+hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB
+60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq
+dBb9HxEGmpv0
+-----END CERTIFICATE-----
+
+Entrust Root Certification Authority - G4
+=========================================
+-----BEGIN CERTIFICATE-----
+MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAwgb4xCzAJBgNV
+BAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu
+bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1
+dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSAtIEc0MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYT
+AlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0
+L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhv
+cml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhv
+cml0eSAtIEc0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3D
+umSXbcr3DbVZwbPLqGgZ2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV
+3imz/f3ET+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j5pds
+8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAMC1rlLAHGVK/XqsEQ
+e9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73TDtTUXm6Hnmo9RR3RXRv06QqsYJn7
+ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNXwbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5X
+xNMhIWNlUpEbsZmOeX7m640A2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV
+7rtNOzK+mndmnqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8
+dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwlN4y6mACXi0mW
+Hv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNjc0kCAwEAAaNCMEAwDwYDVR0T
+AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9n
+MA0GCSqGSIb3DQEBCwUAA4ICAQAS5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4Q
+jbRaZIxowLByQzTSGwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht
+7LGrhFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/B7NTeLUK
+YvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uIAeV8KEsD+UmDfLJ/fOPt
+jqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbwH5Lk6rWS02FREAutp9lfx1/cH6NcjKF+
+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKW
+RGhXxNUzzxkvFMSUHHuk2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjA
+JOgc47OlIQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk5F6G
++TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPT
+kcpG2om3PVODLAgfi49T3f+sHw==
+-----END CERTIFICATE-----
+
+Microsoft ECC Root Certificate Authority 2017
+=============================================
+-----BEGIN CERTIFICATE-----
+MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV
+UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQgRUND
+IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4
+MjMxNjA0WjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw
+NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQ
+BgcqhkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZRogPZnZH6
+thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYbhGBKia/teQ87zvH2RPUB
+eMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTIy5lycFIM
++Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlf
+Xu5gKcs68tvWMoQZP3zVL8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaR
+eNtUjGUBiudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M=
+-----END CERTIFICATE-----
+
+Microsoft RSA Root Certificate Authority 2017
+=============================================
+-----BEGIN CERTIFICATE-----
+MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qvn9FszANBgkqhkiG9w0BAQwFADBlMQswCQYDVQQG
+EwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQg
+UlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjI1MTIyWhcNNDIw
+NzE4MjMwMDIzWjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
+MTYwNAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcw
+ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKW76UM4wplZEWCpW9R2LBifOZNt9GkMml
+7Xhqb0eRaPgnZ1AzHaGm++DlQ6OEAlcBXZxIQIJTELy/xztokLaCLeX0ZdDMbRnMlfl7rEqUrQ7e
+S0MdhweSE5CAg2Q1OQT85elss7YfUJQ4ZVBcF0a5toW1HLUX6NZFndiyJrDKxHBKrmCk3bPZ7Pw7
+1VdyvD/IybLeS2v4I2wDwAW9lcfNcztmgGTjGqwu+UcF8ga2m3P1eDNbx6H7JyqhtJqRjJHTOoI+
+dkC0zVJhUXAoP8XFWvLJjEm7FFtNyP9nTUwSlq31/niol4fX/V4ggNyhSyL71Imtus5Hl0dVe49F
+yGcohJUcaDDv70ngNXtk55iwlNpNhTs+VcQor1fznhPbRiefHqJeRIOkpcrVE7NLP8TjwuaGYaRS
+MLl6IE9vDzhTyzMMEyuP1pq9KsgtsRx9S1HKR9FIJ3Jdh+vVReZIZZ2vUpC6W6IYZVcSn2i51BVr
+lMRpIpj0M+Dt+VGOQVDJNE92kKz8OMHY4Xu54+OU4UZpyw4KUGsTuqwPN1q3ErWQgR5WrlcihtnJ
+0tHXUeOrO8ZV/R4O03QK0dqq6mm4lyiPSMQH+FJDOvTKVTUssKZqwJz58oHhEmrARdlns87/I6KJ
+ClTUFLkqqNfs+avNJVgyeY+QW5g5xAgGwax/Dj0ApQIDAQABo1QwUjAOBgNVHQ8BAf8EBAMCAYYw
+DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUCctZf4aycI8awznjwNnpv7tNsiMwEAYJKwYBBAGC
+NxUBBAMCAQAwDQYJKoZIhvcNAQEMBQADggIBAKyvPl3CEZaJjqPnktaXFbgToqZCLgLNFgVZJ8og
+6Lq46BrsTaiXVq5lQ7GPAJtSzVXNUzltYkyLDVt8LkS/gxCP81OCgMNPOsduET/m4xaRhPtthH80
+dK2Jp86519efhGSSvpWhrQlTM93uCupKUY5vVau6tZRGrox/2KJQJWVggEbbMwSubLWYdFQl3JPk
++ONVFT24bcMKpBLBaYVu32TxU5nhSnUgnZUP5NbcA/FZGOhHibJXWpS2qdgXKxdJ5XbLwVaZOjex
+/2kskZGT4d9Mozd2TaGf+G0eHdP67Pv0RR0Tbc/3WeUiJ3IrhvNXuzDtJE3cfVa7o7P4NHmJweDy
+AmH3pvwPuxwXC65B2Xy9J6P9LjrRk5Sxcx0ki69bIImtt2dmefU6xqaWM/5TkshGsRGRxpl/j8nW
+ZjEgQRCHLQzWwa80mMpkg/sTV9HB8Dx6jKXB/ZUhoHHBk2dxEuqPiAppGWSZI1b7rCoucL5mxAyE
+7+WL85MB+GqQk2dLsmijtWKP6T+MejteD+eMuMZ87zf9dOLITzNy4ZQ5bb0Sr74MTnB8G2+NszKT
+c0QWbej09+CVgI+WXTik9KveCjCHk9hNAHFiRSdLOkKEW39lt2c0Ui2cFmuqqNh7o0JMcccMyj6D
+5KbvtwEwXlGjefVwaaZBRA+GsCyRxj3qrg+E
+-----END CERTIFICATE-----
+
+e-Szigno Root CA 2017
+=====================
+-----BEGIN CERTIFICATE-----
+MIICQDCCAeWgAwIBAgIMAVRI7yH9l1kN9QQKMAoGCCqGSM49BAMCMHExCzAJBgNVBAYTAkhVMREw
+DwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUt
+MjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25vIFJvb3QgQ0EgMjAxNzAeFw0xNzA4MjIxMjA3MDZa
+Fw00MjA4MjIxMjA3MDZaMHExCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UE
+CgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3pp
+Z25vIFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtvxie+RJCx
+s1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+HWyx7xf58etqjYzBhMA8G
+A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSHERUI0arBeAyxr87GyZDv
+vzAEwDAfBgNVHSMEGDAWgBSHERUI0arBeAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEA
+tVfd14pVCzbhhkT61NlojbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxO
+svxyqltZ+efcMQ==
+-----END CERTIFICATE-----
+
+certSIGN Root CA G2
+===================
+-----BEGIN CERTIFICATE-----
+MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNVBAYTAlJPMRQw
+EgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjAeFw0xNzAy
+MDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJBgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lH
+TiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP
+ADCCAgoCggIBAMDFdRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+CjobXXo9X69MhWf05
+N0IwvlDqtg+piNguLWkh59E3GE59kdUWX2tbAMI5Qw02hVK5U2UPHULlj88F0+7cDBrZuIt4Imfk
+abBoxTzkbFpG583H+u/E7Eu9aqSs/cwoUe+StCmrqzWaTOTECMYmzPhpn+Sc8CnTXPnGFiWeI8Mg
+wT0PPzhAsP6CRDiqWhqKa2NYOLQV07YRaXseVO6MGiKscpc/I1mbySKEwQdPzH/iV8oScLumZfNp
+dWO9lfsbl83kqK/20U6o2YpxJM02PbyWxPFsqa7lzw1uKA2wDrXKUXt4FMMgL3/7FFXhEZn91Qqh
+ngLjYl/rNUssuHLoPj1PrCy7Lobio3aP5ZMqz6WryFyNSwb/EkaseMsUBzXgqd+L6a8VTxaJW732
+jcZZroiFDsGJ6x9nxUWO/203Nit4ZoORUSs9/1F3dmKh7Gc+PoGD4FapUB8fepmrY7+EF3fxDTvf
+95xhszWYijqy7DwaNz9+j5LP2RIUZNoQAhVB/0/E6xyjyfqZ90bp4RjZsbgyLcsUDFDYg2WD7rlc
+z8sFWkz6GZdr1l0T08JcVLwyc6B49fFtHsufpaafItzRUZ6CeWRgKRM+o/1Pcmqr4tTluCRVLERL
+iohEnMqE0yo7AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1Ud
+DgQWBBSCIS1mxteg4BXrzkwJd8RgnlRuAzANBgkqhkiG9w0BAQsFAAOCAgEAYN4auOfyYILVAzOB
+ywaK8SJJ6ejqkX/GM15oGQOGO0MBzwdw5AgeZYWR5hEit/UCI46uuR59H35s5r0l1ZUa8gWmr4UC
+b6741jH/JclKyMeKqdmfS0mbEVeZkkMR3rYzpMzXjWR91M08KCy0mpbqTfXERMQlqiCA2ClV9+BB
+/AYm/7k29UMUA2Z44RGx2iBfRgB4ACGlHgAoYXhvqAEBj500mv/0OJD7uNGzcgbJceaBxXntC6Z5
+8hMLnPddDnskk7RI24Zf3lCGeOdA5jGokHZwYa+cNywRtYK3qq4kNFtyDGkNzVmf9nGvnAvRCjj5
+BiKDUyUM/FHE5r7iOZULJK2v0ZXkltd0ZGtxTgI8qoXzIKNDOXZbbFD+mpwUHmUUihW9o4JFWklW
+atKcsWMy5WHgUyIOpwpJ6st+H6jiYoD2EEVSmAYY3qXNL3+q1Ok+CHLsIwMCPKaq2LxndD0UF/tU
+Sxfj03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZkPuXaTH4M
+NMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE1LlSVHJ7liXMvGnjSG4N
+0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MXQRBdJ3NghVdJIgc=
+-----END CERTIFICATE-----
+
+Trustwave Global Certification Authority
+========================================
+-----BEGIN CERTIFICATE-----
+MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJV
+UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2
+ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u
+IEF1dGhvcml0eTAeFw0xNzA4MjMxOTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJV
+UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2
+ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u
+IEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALldUShLPDeS0YLOvR29
+zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0XznswuvCAAJWX/NKSqIk4cXGIDtiLK0thAf
+LdZfVaITXdHG6wZWiYj+rDKd/VzDBcdu7oaJuogDnXIhhpCujwOl3J+IKMujkkkP7NAP4m1ET4Bq
+stTnoApTAbqOl5F2brz81Ws25kCI1nsvXwXoLG0R8+eyvpJETNKXpP7ScoFDB5zpET71ixpZfR9o
+WN0EACyW80OzfpgZdNmcc9kYvkHHNHnZ9GLCQ7mzJ7Aiy/k9UscwR7PJPrhq4ufogXBeQotPJqX+
+OsIgbrv4Fo7NDKm0G2x2EOFYeUY+VM6AqFcJNykbmROPDMjWLBz7BegIlT1lRtzuzWniTY+HKE40
+Cz7PFNm73bZQmq131BnW2hqIyE4bJ3XYsgjxroMwuREOzYfwhI0Vcnyh78zyiGG69Gm7DIwLdVcE
+uE4qFC49DxweMqZiNu5m4iK4BUBjECLzMx10coos9TkpoNPnG4CELcU9402x/RpvumUHO1jsQkUm
++9jaJXLE9gCxInm943xZYkqcBW89zubWR2OZxiRvchLIrH+QtAuRcOi35hYQcRfO3gZPSEF9NUqj
+ifLJS3tBEW1ntwiYTOURGa5CgNz7kAXU+FDKvuStx8KU1xad5hePrzb7AgMBAAGjQjBAMA8GA1Ud
+EwEB/wQFMAMBAf8wHQYDVR0OBBYEFJngGWcNYtt2s9o9uFvo/ULSMQ6HMA4GA1UdDwEB/wQEAwIB
+BjANBgkqhkiG9w0BAQsFAAOCAgEAmHNw4rDT7TnsTGDZqRKGFx6W0OhUKDtkLSGm+J1WE2pIPU/H
+PinbbViDVD2HfSMF1OQc3Og4ZYbFdada2zUFvXfeuyk3QAUHw5RSn8pk3fEbK9xGChACMf1KaA0H
+ZJDmHvUqoai7PF35owgLEQzxPy0QlG/+4jSHg9bP5Rs1bdID4bANqKCqRieCNqcVtgimQlRXtpla
+4gt5kNdXElE1GYhBaCXUNxeEFfsBctyV3lImIJgm4nb1J2/6ADtKYdkNy1GTKv0WBpanI5ojSP5R
+vbbEsLFUzt5sQa0WZ37b/TjNuThOssFgy50X31ieemKyJo90lZvkWx3SD92YHJtZuSPTMaCm/zjd
+zyBP6VhWOmfD0faZmZ26NraAL4hHT4a/RDqA5Dccprrql5gR0IRiR2Qequ5AvzSxnI9O4fKSTx+O
+856X3vOmeWqJcU9LJxdI/uz0UA9PSX3MReO9ekDFQdxhVicGaeVyQYHTtgGJoC86cnn+OjC/QezH
+Yj6RS8fZMXZC+fc8Y+wmjHMMfRod6qh8h6jCJ3zhM0EPz8/8AKAigJ5Kp28AsEFFtyLKaEjFQqKu
+3R3y4G5OBVixwJAWKqQ9EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP
+29FpHOTKyeC2nOnOcXHebD8WpHk=
+-----END CERTIFICATE-----
+
+Trustwave Global ECC P256 Certification Authority
+=================================================
+-----BEGIN CERTIFICATE-----
+MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYDVQQGEwJVUzER
+MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI
+b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYD
+VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy
+dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1
+NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABH77bOYj
+43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoNFWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqm
+P62jQzBBMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt
+0UrrdaVKEJmzsaGLSvcwCgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjz
+RM4q3wghDDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7
+-----END CERTIFICATE-----
+
+Trustwave Global ECC P384 Certification Authority
+=================================================
+-----BEGIN CERTIFICATE-----
+MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYDVQQGEwJVUzER
+MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI
+b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYD
+VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy
+dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4
+NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuBBAAiA2IABGvaDXU1CDFH
+Ba5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJj9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr
+/TklZvFe/oyujUF5nQlgziip04pt89ZF1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV
+HQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNn
+ADBkAjA3AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsCMGcl
+CrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVuSw==
+-----END CERTIFICATE-----
+
+NAVER Global Root Certification Authority
+=========================================
+-----BEGIN CERTIFICATE-----
+MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEMBQAwaTELMAkG
+A1UEBhMCS1IxJjAkBgNVBAoMHU5BVkVSIEJVU0lORVNTIFBMQVRGT1JNIENvcnAuMTIwMAYDVQQD
+DClOQVZFUiBHbG9iYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MTgwODU4
+NDJaFw0zNzA4MTgyMzU5NTlaMGkxCzAJBgNVBAYTAktSMSYwJAYDVQQKDB1OQVZFUiBCVVNJTkVT
+UyBQTEFURk9STSBDb3JwLjEyMDAGA1UEAwwpTkFWRVIgR2xvYmFsIFJvb3QgQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC21PGTXLVAiQqrDZBb
+UGOukJR0F0Vy1ntlWilLp1agS7gvQnXp2XskWjFlqxcX0TM62RHcQDaH38dq6SZeWYp34+hInDEW
++j6RscrJo+KfziFTowI2MMtSAuXaMl3Dxeb57hHHi8lEHoSTGEq0n+USZGnQJoViAbbJAh2+g1G7
+XNr4rRVqmfeSVPc0W+m/6imBEtRTkZazkVrd/pBzKPswRrXKCAfHcXLJZtM0l/aM9BhK4dA9WkW2
+aacp+yPOiNgSnABIqKYPszuSjXEOdMWLyEz59JuOuDxp7W87UC9Y7cSw0BwbagzivESq2M0UXZR4
+Yb8ObtoqvC8MC3GmsxY/nOb5zJ9TNeIDoKAYv7vxvvTWjIcNQvcGufFt7QSUqP620wbGQGHfnZ3z
+VHbOUzoBppJB7ASjjw2i1QnK1sua8e9DXcCrpUHPXFNwcMmIpi3Ua2FzUCaGYQ5fG8Ir4ozVu53B
+A0K6lNpfqbDKzE0K70dpAy8i+/Eozr9dUGWokG2zdLAIx6yo0es+nPxdGoMuK8u180SdOqcXYZai
+cdNwlhVNt0xz7hlcxVs+Qf6sdWA7G2POAN3aCJBitOUt7kinaxeZVL6HSuOpXgRM6xBtVNbv8ejy
+YhbLgGvtPe31HzClrkvJE+2KAQHJuFFYwGY6sWZLxNUxAmLpdIQM201GLQIDAQABo0IwQDAdBgNV
+HQ4EFgQU0p+I36HNLL3s9TsBAZMzJ7LrYEswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB
+Af8wDQYJKoZIhvcNAQEMBQADggIBADLKgLOdPVQG3dLSLvCkASELZ0jKbY7gyKoNqo0hV4/GPnrK
+21HUUrPUloSlWGB/5QuOH/XcChWB5Tu2tyIvCZwTFrFsDDUIbatjcu3cvuzHV+YwIHHW1xDBE1UB
+jCpD5EHxzzp6U5LOogMFDTjfArsQLtk70pt6wKGm+LUx5vR1yblTmXVHIloUFcd4G7ad6Qz4G3bx
+hYTeodoS76TiEJd6eN4MUZeoIUCLhr0N8F5OSza7OyAfikJW4Qsav3vQIkMsRIz75Sq0bBwcupTg
+E34h5prCy8VCZLQelHsIJchxzIdFV4XTnyliIoNRlwAYl3dqmJLJfGBs32x9SuRwTMKeuB330DTH
+D8z7p/8Dvq1wkNoL3chtl1+afwkyQf3NosxabUzyqkn+Zvjp2DXrDige7kgvOtB5CTh8piKCk5XQ
+A76+AqAF3SAi428diDRgxuYKuQl1C/AH6GmWNcf7I4GOODm4RStDeKLRLBT/DShycpWbXgnbiUSY
+qqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oG
+I/hGoiLtk/bdmuYqh7GYVPEi92tF4+KOdh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmg
+kpzNNIaRkPpkUZ3+/uul9XXeifdy
+-----END CERTIFICATE-----
+
+AC RAIZ FNMT-RCM SERVIDORES SEGUROS
+===================================
+-----BEGIN CERTIFICATE-----
+MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQswCQYDVQQGEwJF
+UzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgwFgYDVQRhDA9WQVRFUy1RMjgy
+NjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1SQ00gU0VSVklET1JFUyBTRUdVUk9TMB4XDTE4
+MTIyMDA5MzczM1oXDTQzMTIyMDA5MzczM1oweDELMAkGA1UEBhMCRVMxETAPBgNVBAoMCEZOTVQt
+UkNNMQ4wDAYDVQQLDAVDZXJlczEYMBYGA1UEYQwPVkFURVMtUTI4MjYwMDRKMSwwKgYDVQQDDCNB
+QyBSQUlaIEZOTVQtUkNNIFNFUlZJRE9SRVMgU0VHVVJPUzB2MBAGByqGSM49AgEGBSuBBAAiA2IA
+BPa6V1PIyqvfNkpSIeSX0oNnnvBlUdBeh8dHsVnyV0ebAAKTRBdp20LHsbI6GA60XYyzZl2hNPk2
+LEnb80b8s0RpRBNm/dfF/a82Tc4DTQdxz69qBdKiQ1oKUm8BA06Oi6NCMEAwDwYDVR0TAQH/BAUw
+AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAG5L++/EYZg8k/QQW6rcx/n0m5JMAoGCCqG
+SM49BAMDA2kAMGYCMQCuSuMrQMN0EfKVrRYj3k4MGuZdpSRea0R7/DjiT8ucRRcRTBQnJlU5dUoD
+zBOQn5ICMQD6SmxgiHPz7riYYqnOK8LZiqZwMR2vsJRM60/G49HzYqc8/5MuB1xJAWdpEgJyv+c=
+-----END CERTIFICATE-----
+
+GlobalSign Root R46
+===================
+-----BEGIN CERTIFICATE-----
+MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUAMEYxCzAJBgNV
+BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJv
+b3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAX
+BgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBSNDYwggIi
+MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCsrHQy6LNl5brtQyYdpokNRbopiLKkHWPd08Es
+CVeJOaFV6Wc0dwxu5FUdUiXSE2te4R2pt32JMl8Nnp8semNgQB+msLZ4j5lUlghYruQGvGIFAha/
+r6gjA7aUD7xubMLL1aa7DOn2wQL7Id5m3RerdELv8HQvJfTqa1VbkNud316HCkD7rRlr+/fKYIje
+2sGP1q7Vf9Q8g+7XFkyDRTNrJ9CG0Bwta/OrffGFqfUo0q3v84RLHIf8E6M6cqJaESvWJ3En7YEt
+bWaBkoe0G1h6zD8K+kZPTXhc+CtI4wSEy132tGqzZfxCnlEmIyDLPRT5ge1lFgBPGmSXZgjPjHvj
+K8Cd+RTyG/FWaha/LIWFzXg4mutCagI0GIMXTpRW+LaCtfOW3T3zvn8gdz57GSNrLNRyc0NXfeD4
+12lPFzYE+cCQYDdF3uYM2HSNrpyibXRdQr4G9dlkbgIQrImwTDsHTUB+JMWKmIJ5jqSngiCNI/on
+ccnfxkF0oE32kRbcRoxfKWMxWXEM2G/CtjJ9++ZdU6Z+Ffy7dXxd7Pj2Fxzsx2sZy/N78CsHpdls
+eVR2bJ0cpm4O6XkMqCNqo98bMDGfsVR7/mrLZqrcZdCinkqaByFrgY/bxFn63iLABJzjqls2k+g9
+vXqhnQt2sQvHnf3PmKgGwvgqo6GDoLclcqUC4wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYD
+VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA1yrc4GHqMywptWU4jaWSf8FmSwwDQYJKoZIhvcNAQEM
+BQADggIBAHx47PYCLLtbfpIrXTncvtgdokIzTfnvpCo7RGkerNlFo048p9gkUbJUHJNOxO97k4Vg
+JuoJSOD1u8fpaNK7ajFxzHmuEajwmf3lH7wvqMxX63bEIaZHU1VNaL8FpO7XJqti2kM3S+LGteWy
+gxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIkpnnpHs6i58FZFZ8d4kuaPp92
+CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRFFRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZm
+OUdkLG5NrmJ7v2B0GbhWrJKsFjLtrWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qq
+JZ4d16GLuc1CLgSkZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwye
+qiv5u+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP4vkYxboz
+nxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6N3ec592kD3ZDZopD8p/7
+DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3vouXsXgxT7PntgMTzlSdriVZzH81Xwj3
+QEUxeCp6
+-----END CERTIFICATE-----
+
+GlobalSign Root E46
+===================
+-----BEGIN CERTIFICATE-----
+MIICCzCCAZGgAwIBAgISEdK7ujNu1LzmJGjFDYQdmOhDMAoGCCqGSM49BAMDMEYxCzAJBgNVBAYT
+AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJvb3Qg
+RTQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNV
+BAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBFNDYwdjAQBgcq
+hkjOPQIBBgUrgQQAIgNiAAScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkB
+jtjqR+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGddyXqBPCCj
+QjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQxCpCPtsad0kRL
+gLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk
+vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+
+CAezNIm8BZ/3Hobui3A=
+-----END CERTIFICATE-----
diff --git a/app/vendor/composer/ca-bundle/src/CaBundle.php b/app/vendor/composer/ca-bundle/src/CaBundle.php
index 10bb87c8c..0109ba037 100644
--- a/app/vendor/composer/ca-bundle/src/CaBundle.php
+++ b/app/vendor/composer/ca-bundle/src/CaBundle.php
@@ -20,8 +20,11 @@
*/
class CaBundle
{
+ /** @var string|null */
private static $caPath;
+ /** @var array */
private static $caFileValidity = array();
+ /** @var bool|null */
private static $useOpensslParse;
/**
@@ -66,32 +69,20 @@ public static function getSystemCaRootBundlePath(LoggerInterface $logger = null)
if (self::$caPath !== null) {
return self::$caPath;
}
+ $caBundlePaths = array();
// If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that.
// This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
- $envCertFile = getenv('SSL_CERT_FILE');
- if ($envCertFile && is_readable($envCertFile) && static::validateCaFile($envCertFile, $logger)) {
- return self::$caPath = $envCertFile;
- }
+ $caBundlePaths[] = self::getEnvVariable('SSL_CERT_FILE');
// If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that.
// This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
- $envCertDir = getenv('SSL_CERT_DIR');
- if ($envCertDir && is_dir($envCertDir) && is_readable($envCertDir)) {
- return self::$caPath = $envCertDir;
- }
+ $caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR');
- $configured = ini_get('openssl.cafile');
- if ($configured && strlen($configured) > 0 && is_readable($configured) && static::validateCaFile($configured, $logger)) {
- return self::$caPath = $configured;
- }
-
- $configured = ini_get('openssl.capath');
- if ($configured && is_dir($configured) && is_readable($configured)) {
- return self::$caPath = $configured;
- }
+ $caBundlePaths[] = ini_get('openssl.cafile');
+ $caBundlePaths[] = ini_get('openssl.capath');
- $caBundlePaths = array(
+ $otherLocations = array(
'/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package)
'/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package)
'/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package)
@@ -103,17 +94,21 @@ public static function getSystemCaRootBundlePath(LoggerInterface $logger = null)
'/etc/ssl/cert.pem', // OpenBSD
'/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x
'/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package
+ '/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package
);
+ foreach($otherLocations as $location) {
+ $otherLocations[] = dirname($location);
+ }
+
+ $caBundlePaths = array_merge($caBundlePaths, $otherLocations);
+
foreach ($caBundlePaths as $caBundle) {
- if (@is_readable($caBundle) && static::validateCaFile($caBundle, $logger)) {
+ if ($caBundle && self::caFileUsable($caBundle, $logger)) {
return self::$caPath = $caBundle;
}
- }
- foreach ($caBundlePaths as $caBundle) {
- $caBundle = dirname($caBundle);
- if (@is_dir($caBundle) && glob($caBundle.'/*')) {
+ if ($caBundle && self::caDirUsable($caBundle)) {
return self::$caPath = $caBundle;
}
}
@@ -135,8 +130,13 @@ public static function getBundledCaBundlePath()
// cURL does not understand 'phar://' paths
// see https://github.com/composer/ca-bundle/issues/10
if (0 === strpos($caBundleFile, 'phar://')) {
+ $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-');
+ if (false === $tempCaBundleFile) {
+ throw new \RuntimeException('Could not create a temporary file to store the bundled CA file');
+ }
+
file_put_contents(
- $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'),
+ $tempCaBundleFile,
file_get_contents($caBundleFile)
);
@@ -180,8 +180,16 @@ public static function validateCaFile($filename, LoggerInterface $logger = null)
}
$isValid = !empty($contents);
+ } elseif (is_string($contents) && strlen($contents) > 0) {
+ $contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents);
+ if (null === $contents) {
+ // regex extraction failed
+ $isValid = false;
+ } else {
+ $isValid = (bool) openssl_x509_parse($contents);
+ }
} else {
- $isValid = (bool) openssl_x509_parse($contents);
+ $isValid = false;
}
if ($logger) {
@@ -216,7 +224,7 @@ public static function isOpensslParseSafe()
if (
(PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328)
|| (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423)
- || (PHP_VERSION_ID < 50600 && PHP_VERSION_ID >= 50507)
+ || PHP_VERSION_ID >= 50507
) {
// This version of PHP has the fix for CVE-2013-6420 applied.
return self::$useOpensslParse = true;
@@ -283,7 +291,8 @@ public static function isOpensslParseSafe()
$errorOutput = trim($process->getErrorOutput());
if (
- count($output) === 3
+ is_array($output)
+ && count($output) === 3
&& $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION)
&& $output[1] === 'string(27) "stefan.esser@sektioneins.de"'
&& $output[2] === 'int(-1)'
@@ -298,6 +307,7 @@ public static function isOpensslParseSafe()
/**
* Resets the static caches
+ * @return void
*/
public static function reset()
{
@@ -305,4 +315,39 @@ public static function reset()
self::$caPath = null;
self::$useOpensslParse = null;
}
+
+ /**
+ * @param string $name
+ * @return string|false
+ */
+ private static function getEnvVariable($name)
+ {
+ if (isset($_SERVER[$name])) {
+ return (string) $_SERVER[$name];
+ }
+
+ if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) {
+ return (string) $value;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param string|false $certFile
+ * @return bool
+ */
+ private static function caFileUsable($certFile, LoggerInterface $logger = null)
+ {
+ return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger);
+ }
+
+ /**
+ * @param string|false $certDir
+ * @return bool
+ */
+ private static function caDirUsable($certDir)
+ {
+ return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*');
+ }
}
diff --git a/app/vendor/composer/composer/.editorconfig b/app/vendor/composer/composer/.editorconfig
new file mode 100644
index 000000000..033f8a6da
--- /dev/null
+++ b/app/vendor/composer/composer/.editorconfig
@@ -0,0 +1,11 @@
+root = true
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.yml]
+indent_size = 2
diff --git a/app/vendor/composer/composer/.gitattributes b/app/vendor/composer/composer/.gitattributes
index 32378b23e..2ee43db45 100644
--- a/app/vendor/composer/composer/.gitattributes
+++ b/app/vendor/composer/composer/.gitattributes
@@ -2,7 +2,7 @@
* text=auto eol=lf
# These files are always considered text and should use LF.
-# See core.whitespace @ http://git-scm.com/docs/git-config for whitespace flags.
+# See core.whitespace @ https://git-scm.com/docs/git-config for whitespace flags.
*.php text eol=lf whitespace=blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4 diff=php
*.json text eol=lf whitespace=blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4
*.test text eol=lf whitespace=blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4
@@ -10,3 +10,9 @@
# Exclude non-essential files from dist
/tests export-ignore
+.github export-ignore
+.php_cs export-ignore
+.travis.yml export-ignore
+appveyor.yml export-ignore
+phpunit.xml.dist export-ignore
+/phpstan/ export-ignore
diff --git a/app/vendor/composer/composer/.github/CONTRIBUTING.md b/app/vendor/composer/composer/.github/CONTRIBUTING.md
deleted file mode 100644
index 5f85c6bd9..000000000
--- a/app/vendor/composer/composer/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,54 +0,0 @@
-Contributing to Composer
-========================
-
-Please note that this project is released with a
-[Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/).
-By participating in this project you agree to abide by its terms.
-
-Reporting Issues
-----------------
-
-When reporting issues, please try to be as descriptive as possible, and include
-as much relevant information as you can. A step by step guide on how to
-reproduce the issue will greatly increase the chances of your issue being
-resolved in a timely manner.
-
-For example, if you are experiencing a problem while running one of the
-commands, please provide full output of said command in very very verbose mode
-(`-vvv`, e.g. `composer install -vvv`).
-
-If your issue involves installing, updating or resolving dependencies, the
-chance of us being able to reproduce your issue will be much higher if you
-share your `composer.json` with us.
-
-Security Reports
-----------------
-
-Please send any sensitive issue to [security@packagist.org](mailto:security@packagist.org). Thanks!
-
-Installation from Source
-------------------------
-
-Prior to contributing to Composer, you must be able to run the test suite.
-To achieve this, you need to acquire the Composer source code:
-
-1. Run `git clone https://github.com/composer/composer.git`
-2. Download the [`composer.phar`](https://getcomposer.org/composer.phar) executable
-3. Run Composer to get the dependencies: `cd composer && php ../composer.phar install`
-
-You can run the test suite by executing `vendor/bin/phpunit` when inside the
-composer directory, and run Composer by executing the `bin/composer`. To test
-your modified Composer code against another project, run `php
-/path/to/composer/bin/composer` inside that project's directory.
-
-Contributing policy
--------------------
-
-Fork the project, create a feature branch, and send us a pull request.
-
-To ensure a consistent code base, you should make sure the code follows
-the [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/). You can also
-run [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with the
-configuration file that can be found in the project root directory.
-
-If you would like to help, take a look at the [list of open issues](https://github.com/composer/composer/issues).
diff --git a/app/vendor/composer/composer/.github/ISSUE_TEMPLATE.md b/app/vendor/composer/composer/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index bc180e8d3..000000000
--- a/app/vendor/composer/composer/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,25 +0,0 @@
-My `composer.json`:
-
-```json
-...replace me...
-```
-
-Output of `composer diagnose`:
-
-```
-...replace me...
-```
-
-When I run this command:
-
-```
-...replace me...
-```
-
-I get the following output:
-
-```
-...replace me...
-```
-
-And I expected this to happen:
diff --git a/app/vendor/composer/composer/.gitignore b/app/vendor/composer/composer/.gitignore
index f9d78df20..0b1fb77c0 100644
--- a/app/vendor/composer/composer/.gitignore
+++ b/app/vendor/composer/composer/.gitignore
@@ -4,8 +4,9 @@
/composer.phar
/vendor
/nbproject
+.phpunit.result.cache
phpunit.xml
.vagrant
Vagrantfile
.idea
-.php_cs.cache
\ No newline at end of file
+.php_cs.cache
diff --git a/app/vendor/composer/composer/.php_cs b/app/vendor/composer/composer/.php_cs
deleted file mode 100644
index ac954ab5e..000000000
--- a/app/vendor/composer/composer/.php_cs
+++ /dev/null
@@ -1,58 +0,0 @@
-
- Jordi Boggiano
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-EOF;
-
-$finder = PhpCsFixer\Finder::create()
- ->files()
- ->in(__DIR__.'/src')
- ->in(__DIR__.'/tests')
- ->name('*.php')
- ->notPath('Fixtures')
-;
-
-return PhpCsFixer\Config::create()
- ->setUsingCache(true)
- ->setRiskyAllowed(true)
- ->setRules(array(
- '@PSR2' => true,
- 'array_syntax' => array('syntax' => 'long'),
- 'binary_operator_spaces' => true,
- 'blank_line_before_statement' => array('statements' => array('declare', 'return')),
- 'cast_spaces' => array('space' => 'single'),
- 'header_comment' => array('header' => $header),
- 'include' => true,
- 'class_attributes_separation' => array('elements' => array('method')),
- 'no_blank_lines_after_class_opening' => true,
- 'no_blank_lines_after_phpdoc' => true,
- 'no_empty_statement' => true,
- 'no_extra_consecutive_blank_lines' => true,
- 'no_leading_import_slash' => true,
- 'no_leading_namespace_whitespace' => true,
- 'no_trailing_comma_in_singleline_array' => true,
- 'no_unused_imports' => true,
- 'no_whitespace_in_blank_line' => true,
- 'object_operator_without_whitespace' => true,
- 'phpdoc_align' => true,
- 'phpdoc_indent' => true,
- 'phpdoc_no_access' => true,
- 'phpdoc_no_package' => true,
- 'phpdoc_order' => true,
- 'phpdoc_scalar' => true,
- 'phpdoc_trim' => true,
- 'phpdoc_types' => true,
- 'psr0' => true,
- 'single_blank_line_before_namespace' => true,
- 'standardize_not_equals' => true,
- 'ternary_operator_spaces' => true,
- 'trailing_comma_in_multiline_array' => true,
- ))
- ->setFinder($finder)
-;
diff --git a/app/vendor/composer/composer/.travis.yml b/app/vendor/composer/composer/.travis.yml
deleted file mode 100644
index 16a3b073c..000000000
--- a/app/vendor/composer/composer/.travis.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-language: php
-
-sudo: false
-
-dist: trusty
-
-git:
- depth: 5
-
-cache:
- directories:
- - $HOME/.composer/cache
-
-addons:
- apt:
- packages:
- - parallel
-
-php:
- - 5.4
- - 5.5
- - 5.6
- - 7.0
- - 7.1
- - 7.2
- - nightly
-
-matrix:
- include:
- - php: 5.3
- dist: precise
- - php: 7.2
- env: deps=high
- fast_finish: true
- allow_failures:
- - php: nightly
-
-before_install:
- # disable xdebug if available
- - phpenv config-rm xdebug.ini || echo "xdebug not available"
- # disable default memory limit
- - export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- - echo memory_limit = -1 >> $INI
-
-install:
- # flags to pass to install
- - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"
- # update deps to latest in case of high deps build
- - if [ "$deps" == "high" ]; then composer config platform.php 7.2.4; composer update $flags; fi
- # install dependencies using system provided composer binary
- - composer install $flags
- # install dependencies using composer from source
- - bin/composer install $flags
-
-before_script:
- # make sure git tests do not complain about user/email not being set
- - git config --global user.name travis-ci
- - git config --global user.email travis@example.com
-
-script:
- # run test suite directories in parallel using GNU parallel
- - ls -d tests/Composer/Test/* | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);'
-
-before_deploy:
- - php -d phar.readonly=0 bin/compile
-
-deploy:
- provider: releases
- api_key: $GITHUB_TOKEN
- file: composer.phar
- skip_cleanup: true
- on:
- tags: true
- repo: composer/composer
- php: '7.1'
diff --git a/app/vendor/composer/composer/CHANGELOG.md b/app/vendor/composer/composer/CHANGELOG.md
index b5efd1683..1b5a194a0 100644
--- a/app/vendor/composer/composer/CHANGELOG.md
+++ b/app/vendor/composer/composer/CHANGELOG.md
@@ -1,3 +1,576 @@
+### [2.1.8] 2021-09-15
+
+ * Fixed regression in 2.1.7 when parsing classmaps in files containing invalid Unicode (#10102)
+
+### [2.1.7] 2021-09-14
+
+ * Added many type annotations internally, which may have an effect on CI/static analysis for people using Composer as a dependency. This work will continue in following releases
+ * Fixed regression in 2.1.6 when parsing classmaps with empty heredocs (#10067)
+ * Fixed regression in 2.1.6 where list command was not showing plugin commands (#10075)
+ * Fixed issue handling package updates where the package type changed (#10076)
+ * Fixed docker being detected as WSL when run inside WSL (#10094)
+
+### [2.1.6] 2021-08-19
+
+ * Updated internal PHAR signatures to be SHA512 instead of SHA1
+ * Fixed uncaught exception handler regression (#10022)
+ * Fixed more PHP 8.1 deprecation warnings (#10036, #10038, #10061)
+ * Fixed corrupted zips in the cache from blocking installs until a cache clear, the bad archives are now deleted automatically on first failure (#10028)
+ * Fixed URL sanitizer handling of new github tokens (#10048)
+ * Fixed issue finding classes with very long heredocs in classmap autoload (#10050)
+ * Fixed proc_open being required for simple installs from zip, as well as diagnose (#9253)
+ * Fixed path repository bug causing symlinks to be left behind after a package is uninstalled (#10023)
+ * Fixed issue in 7-zip support on windows with certain archives (#10058)
+ * Fixed bootstrapping process to avoid loading the composer.json and plugins until necessary, speeding things up slightly (#10064)
+ * Fixed lib-openssl detection on FreeBSD (#10046)
+ * Fixed support for `ircs://` protocol for support.irc composer.json entries
+
+### [2.1.5] 2021-07-23
+
+ * Fixed `create-project` creating a `php:` directory in the directory it was executed in (#10020, #10021)
+ * Fixed curl downloader to respect default_socket_timeout if it is bigger than our default 300s (#10018)
+
+### [2.1.4] 2021-07-22
+
+ * Fixed PHP 8.1 deprecation warnings (#10008)
+ * Fixed support for working within UNC/WSL paths on Windows (#9993)
+ * Fixed 7-zip support to also be looked up on Linux/macOS as 7z or 7zz (#9951)
+ * Fixed repositories' `only`/`exclude` properties to avoid matching names as sub-strings of full package names (#10001)
+ * Fixed open_basedir regression from #9855
+ * Fixed schema errors being reported incorrectly in some conditions (#9986)
+ * Fixed `archive` command not working with async archive extraction
+ * Fixed `init` command being able to generate an invalid composer.json (#9986)
+
+### [2.1.3] 2021-06-09
+
+ * Add "symlink" option for "bin-compat" config to force symlinking even on WSL/Windows (#9959)
+ * Fixed source binaries not being made executable when symlinks cannot be used (#9961)
+ * Fixed more deletion edge cases (#9955, #9956)
+ * Fixed `dump-autoload` command not dispatching scripts anymore, regressed in 2.1.2 (#9954)
+
+### [2.1.2] 2021-06-07
+
+ * Added `--dev` to `dump-autoload` command to allow force-dumping dev autoload rules even if dev requirements are not present (#9946)
+ * Fixed `--no-scripts` disabling events for plugins too instead of only disabling script handlers, using `--no-plugins` is the way to disable plugins (#9942)
+ * Fixed handling of deletions during package installs on some filesystems (#9945, #9947)
+ * Fixed undefined array access when using "@php " in a script handler (#9943)
+ * Fixed usage of InstalledVersions when loaded from composer/composer installed as a dependency and runtime Composer is v1 (#9937)
+
+### [2.1.1] 2021-06-04
+
+ * Fixed regression in autoload generation when --no-scripts is used (#9935)
+ * Fixed `outdated` color legend to have the right color in the right place (#9939)
+ * Fixed PCRE bug causing a previously valid pattern to fail to match (#9941)
+ * Fixed JsonFile::validateSchema regression when used as a library to validate custom schema files (#9938)
+
+### [2.1.0] 2021-06-03
+
+ * Fixed PHP 8.1 deprecation warning (#9932)
+ * Fixed env var handling when variables_order includes E and symfony/console 3.3.15+ is in use (#9930)
+
+### [2.1.0-RC1] 2021-06-02
+
+ * Bumped `composer-runtime-api` and `composer-plugin-api` to `2.1.0`
+ * UX Change: The default install method for packages is now always dist/zip, even for dev packages, added `--prefer-install=auto` if you want the old behavior (#9603)
+ * UX Change: Packages from `path` repositories which are symlinked in the vendor dir will always be updated in partial updates to avoid mistakes when the original composer.json changes but the symlinked package is not explicitly updated (#9765)
+ * Added `reinstall` command that takes one or more package names, including wildcard (`*`) support, and removes then reinstalls them in the exact same version they had (#9915)
+ * Added support for parallel package installs on Windows via [7-Zip](https://www.7-zip.org/) if it is installed (#9875)
+ * Added detection of invalid composer.lock files that do not fullfil the composer.json requirements to `validate` command (#9899)
+ * Added `InstalledVersions::getInstalledPackagesByType(string $type)` to retrieve installed plugins for example, [read more](https://getcomposer.org/doc/07-runtime.md#knowing-which-packages-of-a-given-type-are-installed) (#9699)
+ * Added `InstalledVersions::getInstalledPath(string $packageName)` to retrieve the install path of a given package, [read more](https://getcomposer.org/doc/07-runtime.md#knowing-the-path-in-which-a-package-is-installed) (#9699)
+ * Added flag to `InstalledVersions::isInstalled()` to allow excluding dev requirements from that check (#9682)
+ * Added support for PHP 8.1 enums in autoloader / classmap generation (#9670)
+ * Added support for using `@php binary-name foo` in scripts to refer to a binary without using its full path, but forcing to use the same PHP version as Composer used (#9726)
+ * Added `--format=json` support to the `fund` command (#9678)
+ * Added `--format=json` support to the `search` command (#9747)
+ * Added `COMPOSER_DEV_MODE` env var definition within the run-script command for compatibility (#9793)
+ * Added async uninstall of packages (#9618)
+ * Added color legend to `outdated` and `show --latest` commands (#9716)
+ * Added `secure-svn-domains` config option to mark secure svn:// hostnames and suppress warnings without disabling secure-http (#9872)
+ * Added `gitlab-protocol` config option to allow forcing `git` or `http` URLs for all gitlab repos loaded inline, instead of the default of git for private and http for public (#9401)
+ * Added generation of autoload rules in `init` command (#9829)
+ * Added source/dist validation in `validate` command
+ * Added automatic detection of WSL when generating binaries and use `bin-compat:full` implicitly (#9855)
+ * Added automatic detection of the --no-dev state for `dump-autoload` based on the last install run (#9714)
+ * Added warning/prompt to `require` command if requiring a package that already exists in require-dev or vice versa (#9542)
+ * Added information about package conflicts in the `why`/`why-not` commands (#9693)
+ * Removed version argument from `why` command as it was not needed (#9729)
+ * Fixed `why-not` command to always require a specific version as it is useless without (#9729)
+ * Fixed cache dir on macOS to follow OS guidelines, it is now in ~/Library/Caches/composer (#9898)
+ * Fixed composer.json JSON schema to avoid having name/description required by default (#9912)
+ * Fixed support for running inside WSL paths from a Windows PHP/Composer (#9861)
+ * Fixed InstalledVersions to include the original doc blocks when installed from a Composer phar file
+ * Fixed `require` command to use `*` as constraint for extensions bundled with PHP instead of duplicating the PHP constraint (#9483)
+ * Fixed `search` output to be aligned and avoid wrapped long lines to be more readable (#9455)
+ * Error output improvements for many cases (#9876, #9837, #9928, and some smaller improvements)
+
+### [2.0.14] 2021-05-21
+
+ * Updated composer/xdebug-handler to 2.0 which adds supports for Xdebug 3
+ * Fixed handling of inline-update-constraints with references or stability flags (#9847)
+ * Fixed async processes erroring in an unclear way when they failed to start (#9808)
+ * Fixed support for the upcoming Symfony 6.0 release when Composer is installed as a library (#9896)
+ * Fixed progress output missing newlines on PowerShell, and disable progress output by default when CI env var is present (#9621)
+ * Fixed support for Vagrant/VirtualBox filesystem slowness when installing binaries from packages (#9627)
+ * Fixed type annotations for the InstalledVersions class
+ * Deprecated InstalledVersions::getRawData in favor of InstalledVersions::getAllRawData (#9816)
+
+### [2.0.13] 2021-04-27
+
+ * Security: Fixed command injection vulnerability in HgDriver/HgDownloader and hardened other VCS drivers and downloaders (GHSA-h5h8-pc6h-jvvx / CVE-2021-29472)
+ * Fixed install step at the end of the init command to take new dependencies into account correctly
+ * Fixed `update --lock` listing updates which were not really happening (#9812)
+ * Fixed support for --no-dev combined with --locked in outdated and show commands (#9788)
+
+### [2.0.12] 2021-04-01
+
+ * Fixed support for new GitHub OAuth token format (#9757)
+ * Fixed support for Vagrant/VirtualBox filesystem slowness by adding short sleeps in some places (#9627)
+ * Fixed unclear error reporting when a package is in the lock file but not in the remote repositories (#9750)
+ * Fixed processes silently ignoring the CWD when it does not exist
+ * Fixed new Windows bin handling to avoid proxying phar files (#9742)
+ * Fixed issue extracting archives into paths that already exist, fixing problems with some custom installers (composer/installers#479)
+ * Fixed support for branch names starting with master/trunk/default (#9739)
+ * Fixed self-update to preserve phar file permissions on Windows (#9733)
+ * Fixed detection of hg version when localized (#9753)
+ * Fixed git execution failures to also include the stdout output (#9720)
+
+### [2.0.11] 2021-02-24
+
+ * Reverted "Fixed runtime autoloader registration (for plugins and script handlers) to prefer the project dependencies over the bundled Composer ones" as it caused more problems than expected
+
+### [2.0.10] 2021-02-23
+
+ * Added COMPOSER_MAX_PARALLEL_HTTP to let people set a lower amount of parallel requests if needed
+ * Fixed autoloader registration when plugins are loaded, which may impact plugins relying on this bug (if you use `symfony/flex` make sure you upgrade it to 1.12.2+ to fix `dump-env` issues)
+ * Fixed `exec` command suppressing output in some circumstances
+ * Fixed Windows/cmd.exe support for script handlers defined as `path/to/foo`, which are now rewritten internally to `path\to\foo` when needed
+ * Fixed bin handling on Windows for PHP scripts, to more closely match symlinks and allow `@php vendor/bin/foo` to work cross-platform
+ * Fixed Git for Windows/Git Bash not being detected correctly as an interactive shell (regression since 2.0.7)
+ * Fixed regression handling some private Bitbucket repository clones
+ * Fixed Ctrl-C/SIGINT handling during downloads to correctly abort as soon as possible
+ * Fixed runtime autoloader registration (for plugins and script handlers) to prefer the project dependencies over the bundled Composer ones
+ * Fixed numeric default branches being aliased as 9999999-dev internally. This alias now only applies to default branches being non-numeric (e.g. `dev-main`)
+ * Fixed support for older lib-sodium versions
+ * Fixed various minor issues
+
+### [2.0.9] 2021-01-27
+
+ * Added warning if the curl extension is not enabled as it significantly degrades performance
+ * Fixed InstalledVersions to report all packages when several vendor dirs are present in the same runtime
+ * Fixed download speed when downloading large files
+ * Fixed `archive` and path repo copies mishandling some .gitignore paths
+ * Fixed root package classes not being available to the plugins/scripts during the initial install
+ * Fixed cache writes to be atomic and better support multiple Composer processes running in parallel
+ * Fixed preg jit issues when `config` or `require` modifies large composer.json files
+ * Fixed compatibility with envs having open_basedir restrictions
+ * Fixed exclude-from-classmap causing regex issues when having too many paths
+ * Fixed compatibility issue with Symfony 4/5
+ * Several small performance and debug output improvements
+
+### [2.0.8] 2020-12-03
+
+ * Fixed packages with aliases not matching conflicts which match the alias
+ * Fixed invalid reports of uncommitted changes when using non-default remotes in vendor dir
+ * Fixed curl error handling edge cases
+ * Fixed cached git repositories becoming stale by having a `git gc` applied to them periodically
+ * Fixed issue initializing plugins when using dev packages
+ * Fixed update --lock / mirrors failing to update in some edge cases
+ * Fixed partial update with --with-dependencies failing in some edge cases with some nonsensical error
+
+### [2.0.7] 2020-11-13
+
+ * Fixed detection of TTY mode, made input non-interactive automatically if STDIN is not a TTY
+ * Fixed root aliases not being present in lock file if not required by anything else
+ * Fixed `remove` command requiring a lock file to be present
+ * Fixed `Composer\InstalledVersions` to always contain up to date data during installation
+ * Fixed `status` command breaking on slow networks
+ * Fixed order of POST_PACKAGE_* events to occur together once all installations of a package batch are done
+
+### [2.0.6] 2020-11-07
+
+ * Fixed regression in 2.0.5 dealing with custom installers which do not pass absolute paths
+
+### [2.0.5] 2020-11-06
+
+ * Disabled platform-check verification of extensions by default (now defaulting `php-only`), set platform-check to `true` if you want a complete check
+ * Improved platform-check handling of issue reporting
+ * Fixed platform-check to only check non-dev requires even if require-dev dependencies are installed
+ * Fixed issues dealing with custom installers which return trailing slashes in getInstallPath (ideally avoid doing this as there might be other issues left)
+ * Fixed issues when curl functions are disabled
+ * Fixed gitlab-domains/github-domains to make sure if they are overridden the default value remains present
+ * Fixed issues removing/upgrading packages from path repositories on Windows
+ * Fixed regression in 2.0.4 when handling of git@bitbucket.org URLs in vcs repositories
+ * Fixed issue running create-project in current directory on Windows
+
+### [2.0.4] 2020-10-30
+
+ * Fixed `check-platform-req` command not being clear on what packages are checked, and added a --lock flag to explicitly check the locked packages
+ * Fixed `config` & `create-project` adding of repositories to make sure they are prepended as order is much more important in Composer 2, also added a --append flag to `config` to restore the old behavior in the unlikely case this is needed
+ * Fixed curl downloader failing on old PHP releases or when using self-signed SSL certificates
+ * Fixed Bitbucket API authentication issue
+
+### [2.0.3] 2020-10-28
+
+ * Fixed bug in `outdated` command where dev packages with branch-aliases where always shown as being outdated
+ * Fixed issue in lock file interoperability with composer 1.x when using `dev-master as xxx` aliases
+ * Fixed new `--locked` option being missing from `outdated` command, for checking outdated packages directly from the lock file
+ * Fixed a few debug/error reporting strings
+
+### [2.0.2] 2020-10-25
+
+ * Fixed regression handling `composer show -s` in projects where no version can be guessed from VCS
+ * Fixed regression handling partial updates/`require` when a lock file was missing
+ * Fixed interop issue with plugins that need to update dist URLs of packages, [see docs](https://getcomposer.org/doc/articles/plugins.md#plugin-modifies-downloads) if you need this
+
+### [2.0.1] 2020-10-24
+
+ * Fixed crash on PHP8
+
+### [2.0.0] 2020-10-24
+
+ * Fixed proxy handling issues when combined with our new curl-based downloader
+ * Fixed solver bug resulting in endless loops in some cases
+ * Fixed solver output being extremely long due to learnt rules
+ * Fixed solver bug with multi literals
+ * Fixed a couple minor regressions
+
+### [2.0.0-RC2] 2020-10-14
+
+ * Breaking: Removed `OperationInterface::getReason` as the data was not accurate
+ * Added automatic removal of packages which are not required anymore whenever an update is done, this will purge packages previously left over by partial updates and `require`/`remove`
+ * Added shorthand aliases `-w` for `--with-dependencies` and `-W` for `--with-all-dependencies` on `update`/`require`/`remove` commands
+ * Added `COMPOSER_DEBUG_EVENTS=1` env var support for plugin authors to figure out which events are triggered when
+ * Added `setCustomCacheKey` to `PreFileDownloadEvent` and fixed a cache bug for integrations changing the processed url of package archives
+ * Added `Composer\Util\SyncHelper` for plugin authors to deal with async Promises more easily
+ * Added `$composer->getLoop()->getHttpDownloader()` to get access to the main HttpDownloader instance in plugins
+ * Added a non-zero exit code (2) and warning to `remove` command when a package to be removed could not be removed
+ * Added `--apcu-autoloader-prefix` (or `--apcu-prefix` for `dump-autoload` command) flag to let people use apcu autoloading in a deterministic output way if that is needed
+ * Fixed version guesser to look at remote branches as well as local ones
+ * Lots of minor bug fixes and improvements
+
+### [2.0.0-RC1] 2020-09-10
+
+ * Added more advanced filtering to avoid loading all versions of all referenced packages when resolving dependencies, which should reduce memory usage further in some cases
+ * Added support for many new `lib-*` packages in the platform repository and improved version detection for some `ext-*` and `lib-*` packages
+ * Added an `--ask` flag to `create-project` command to make Composer prompt for the install dir name, [useful for project install instructions](https://github.com/composer/composer/pull/9181)
+ * Added support for tar in artifact repositories
+ * Added a `cache-read-only` config option to make the cache usable in read only mode for containers and such
+ * Added better error reporting for a few more specific cases
+ * Added a new optional `available-package-patterns` attribute for v2-format Composer repositories, see [UPGRADE](UPGRADE-2.0.md) for details
+ * Fixed more PHP 8 compatibility issues
+ * Lots of minor bug fixes for regressions
+
+### [2.0.0-alpha3] 2020-08-03
+
+ * Breaking: Zip archives loaded by artifact repositories must now have a composer.json on top level, or a max of one folder on top level of the archive
+ * Added --no-dev support to `show` and `outdated` commands to skip dev requirements
+ * Added support for multiple --repository flags being passed into the `create-project` command, only useful in combination with `--add-repository` to persist them to composer.json
+ * Added a new optional `list` API endpoint for v2-format Composer repositories, see [UPGRADE](UPGRADE-2.0.md) for details
+ * Fixed `show -a` command not listing anything
+ * Fixed solver bug where it ended in a "Reached invalid decision id 0"
+ * Fixed updates of git-installed packages on windows
+ * Lots of minor bug fixes
+
+### [2.0.0-alpha2] 2020-06-24
+
+ * Added parallel installation of packages (requires OSX/Linux/WSL, and that `unzip` is present in PATH)
+ * Added optimization of constraints by compiling them to PHP code, which should reduce CPU time of updates
+ * Added handling of Ctrl-C on Windows for PHP 7.4+
+ * Added better support for default branch names other than `master`
+ * Added --format=summary flag to `license` command
+ * Fixed issue in platform check when requiring ext-zend-opcache
+ * Fixed inline aliases issues
+ * Fixed git integration issue when signatures are set to be shown by default
+
+### [2.0.0-alpha1] 2020-06-03
+
+ * Breaking: This is a major release and while we tried to keep things compatible for most users, you might want to have a look at the [UPGRADE](UPGRADE-2.0.md) guides
+ * Many CPU and memory performance improvements
+ * The update command is now much more deterministic as it does not take the already installed packages into account
+ * Package installation now performs all network operations first before doing any changes on disk, to reduce the chances of ending up with a partially updated vendor dir
+ * Partial updates and require/remove are now much faster as they only load the metadata required for the updated packages
+ * Added a [platform-check step](doc/07-runtime.md#platform-check) when vendor/autoload.php gets initialized which checks the current PHP version/extensions match what is expected and fails hard otherwise. Can be disabled with the platform-check config option
+ * Added a [`Composer\InstalledVersions`](doc/07-runtime.md#installed-versions) class which is autoloaded in every project and lets you check which packages/versions are present at runtime
+ * Added a `composer-runtime-api` virtual package which you can require (as e.g. `^2.0`) to ensure things like the InstalledVersions class above are present. It will effectively force people to use Composer 2.x to install your project
+ * Added support for parallel downloads of package metadata and zip files, this requires that the curl extension is present and we thus strongly recommend enabling curl
+ * Added much clearer dependency resolution error reporting for common error cases
+ * Added support for updating to a specific version with partial updates, as well as a [--with flag](doc/03-cli.md#update--u) to pass in temporary constraint overrides
+ * Added support for TTY mode on Linux/OSX/WSL so that script handlers now run in interactive mode
+ * Added `only`, `exclude` and `canonical` options to all repositories, see [repository priorities](https://getcomposer.org/repoprio) for details
+ * Added support for lib-zip platform package
+ * Added `pre-operations-exec` event to be fired before the packages get installed/upgraded/removed
+ * Added `pre-pool-create` event to be fired before the package pool for the dependency solver is created, which lets you modify the list of packages going in
+ * Added `post-file-download` event to be fired after package dist files are downloaded, which lets you do additional checks on the files
+ * Added --locked flag to `show` command to see the packages from the composer.lock file
+ * Added --unused flag to `remove` command to make sure any packages which are not needed anymore get removed
+ * Added --dry-run flag to `require` and `remove` commands
+ * Added --no-install flag to `update`, `require` and `remove` commands to disable the install step and only do the update step (composer.lock file update)
+ * Added --with-dependencies and --with-all-dependencies flag aliases to `require` and `remove` commands for consistency with `update`
+ * Added more info to `vendor/composer/installed.json`, a dev key stores whether dev requirements were installed, and every package now has an install-path key with its install location
+ * Added COMPOSER_DISABLE_NETWORK which if set makes Composer do its best to run offline. This can be useful when you have poor connectivity or to do benchmarking without network jitter
+ * Added --json and --merge flags to `config` command to allow editing complex `extra.*` values by using json as input
+ * Added confirmation prompt when running Composer as superuser in interactive mode
+ * Added --no-check-version to `validate` command to remove the warning in case the version is defined
+ * Added --ignore-platform-req (without s) to all commands supporting --ignore-platform-reqs, which accepts a package name so you can ignore only specific platform requirements
+ * Added support for wildcards (`*`) in classmap autoloader paths
+ * Added support for configuring GitLab deploy tokens in addition to private tokens, see [gitlab-token](doc/06-config.md#gitlab-token)
+ * Added support for package version guessing for require and init command to take all platform packages into account, not just php version
+ * Fixed package ordering when autoloading and especially when loading plugins, to make sure dependencies are loaded before their dependents
+ * Fixed suggest output being very spammy, it now is only one line long and shows more rarely
+ * Fixed conflict rules like e.g. >=5 from matching dev-master, as it is not normalized to 9999999-dev internally anymore
+
+### [1.10.22] 2021-04-27
+
+ * Security: Fixed command injection vulnerability in HgDriver/HgDownloader and hardened other VCS drivers and downloaders (GHSA-h5h8-pc6h-jvvx / CVE-2021-29472)
+
+### [1.10.21] 2021-04-01
+
+ * Fixed support for new GitHub OAuth token format
+ * Fixed processes silently ignoring the CWD when it does not exist
+
+### [1.10.20] 2021-01-27
+
+ * Fixed exclude-from-classmap causing regex issues when having too many paths
+ * Fixed compatibility issue with Symfony 4/5
+
+### [1.10.19] 2020-12-04
+
+ * Fixed regression on PHP 8.0
+
+### [1.10.18] 2020-12-03
+
+ * Allow installation on PHP 8.0
+
+### [1.10.17] 2020-10-30
+
+ * Fixed Bitbucket API authentication issue
+ * Fixed parsing of Composer 2 lock files breaking in some rare conditions
+
+### [1.10.16] 2020-10-24
+
+ * Added warning to `validate` command for cases where packages provide/replace a package that they also require
+ * Fixed JSON schema validation issue with PHPStorm
+ * Fixed symlink handling in `archive` command
+
+### [1.10.15] 2020-10-13
+
+ * Fixed path repo version guessing issue
+
+### [1.10.14] 2020-10-13
+
+ * Fixed version guesser to look at remote branches as well as local ones
+ * Fixed path repositories version guessing to handle edge cases where version is different from the VCS-guessed version
+ * Fixed COMPOSER env var causing issues when combined with the `global ` command
+ * Fixed a few issues dealing with PHP without openssl extension (not recommended at all but sometimes needed for testing)
+
+### [1.10.13] 2020-09-09
+
+ * Fixed regressions with old version validation
+ * Fixed invalid root aliases not being reported
+
+### [1.10.12] 2020-09-08
+
+ * Fixed regressions with old version validation
+
+### [1.10.11] 2020-09-08
+
+ * Fixed more PHP 8 compatibility issues
+ * Fixed regression in handling of CTRL-C when xdebug is loaded
+ * Fixed `status` handling of broken symlinks
+
+### [1.10.10] 2020-08-03
+
+ * Fixed `create-project` not triggering events while installing the root package
+ * Fixed PHP 8 compatibility issue
+ * Fixed `self-update` to avoid automatically upgrading to the next major version once it becomes stable
+
+### [1.10.9] 2020-07-16
+
+ * Fixed Bitbucket redirect loop when credentials are outdated
+ * Fixed GitLab auth prompt wording
+ * Fixed `self-update` handling of files requiring admin permissions to write to on Windows (it now does a UAC prompt)
+ * Fixed parsing issues in funding.yml files
+
+### [1.10.8] 2020-06-24
+
+ * Fixed compatibility issue with git being configured to show signatures by default
+ * Fixed discarding of local changes when updating packages to include untracked files
+ * Several minor fixes
+
+### [1.10.7] 2020-06-03
+
+ * Fixed PHP 8 deprecations
+ * Fixed detection of pcntl_signal being in disabled_functions when pcntl_async_signal is allowed
+
+### [1.10.6] 2020-05-06
+
+ * Fixed version guessing to take composer-runtime-api and composer-plugin-api requirements into account to avoid selecting packages which require Composer 2
+ * Fixed package name validation to allow several dashes following each other
+ * Fixed post-status-cmd script not firing when there were no changes to be displayed
+ * Fixed composer-runtime-api support on Composer 1.x, the package is now present as 1.0.0
+ * Fixed support for composer show --name-only --self
+ * Fixed detection of GitLab URLs when handling authentication in some cases
+
+### [1.10.5] 2020-04-10
+
+ * Fixed self-update on PHP <5.6, seriously please upgrade people, it's time
+ * Fixed 1.10.2 regression with PATH resolution in scripts
+
+### [1.10.4] 2020-04-09
+
+ * Fixed 1.10.2 regression in path symlinking with absolute path repos
+
+### [1.10.3] 2020-04-09
+
+ * Fixed invalid --2 flag warning in `self-update` when no channel is requested
+
+### [1.10.2] 2020-04-09
+
+ * Added --1 flag to `self-update` command which can be added to automated self-update runs to make sure it won't automatically jump to 2.0 once that is released
+ * Fixed path repository symlinks being made relative when the repo url is defined as absolute paths
+ * Fixed potential issues when using "composer ..." in scripts and composer/composer was also required in the project
+ * Fixed 1.10.0 regression when downloading GitHub archives from non-API URLs
+ * Fixed handling of malformed info in fund command
+ * Fixed Symfony5 compatibility issues in a few commands
+
+### [1.10.1] 2020-03-13
+
+ * Fixed path repository warning on empty path when using wildcards
+ * Fixed superfluous warnings when generating optimized autoloaders
+
+### [1.10.0] 2020-03-10
+
+ * Added `bearer` auth config to authenticate using `Authorization: Bearer ` headers
+ * Added `plugin-api-version` in composer.lock so third-party tools can know which Composer version was used to generate a lock file
+ * Fixed composer fund command and funding info parsing to be more useful
+ * Fixed issue where --no-dev autoload generation was excluding some packages which should not have been excluded
+ * Fixed 1.10-RC regression in create project's handling of absolute paths
+
+### [1.10.0-RC] 2020-02-14
+
+ * Breaking: `composer global exec ...` now executes the process in the current working directory instead of executing it in the global directory.
+ * Warning: Added a warning when class names are being loaded by a PSR-4 or PSR-0 rule only due to classmap optimization, but would not otherwise be autoloadable. Composer 2.0 will stop autoloading these classes so make sure you fix your autoload configs.
+ * Added new funding key to composer.json to describe ways your package's maintenance can be funded. This reads info from GitHub's FUNDING.yml by default so better configure it there so it shows on GitHub and Composer/Packagist
+ * Added `composer fund` command to show funding info of your dependencies
+ * Added support for --format=json output for show command when showing a single package
+ * Added support for configuring suggestions using config command, e.g. `composer config suggest.foo/bar some text`
+ * Added support for configuring fine-grained preferred-install using config command, e.g. `composer config preferred-install.foo/* dist`
+ * Added `@putenv` script handler to set environment variables from composer.json for following scripts
+ * Added `lock` option that can be set to false, in which case no composer.lock file will be generated
+ * Added --add-repository flag to create-project command which will persist the repo given in --repository into the composer.json of the package being installed
+ * Added support for IPv6 addresses in NO_PROXY
+ * Added package homepage display in the show command
+ * Added debug info about HTTP authentications
+ * Added Symfony 5 compatibility
+ * Added --fixed flag to require command to make it use a fixed constraint instead of a ^x.y constraint when adding the requirement
+ * Fixed exclude-from-classmap matching subsets of directories e.g. foo/ was excluding foobar/
+ * Fixed archive command to persist file permissions inside the zip files
+ * Fixed init/require command to avoid suggesting packages which are already selected in the search results
+ * Fixed create-project UX issues
+ * Fixed filemtime for `vendor/composer/*` files is now only changing when the files actually change
+ * Fixed issues detecting docker environment with an active open_basedir
+
+### [1.9.3] 2020-02-04
+
+ * Fixed GitHub deprecation of access_token query parameter, now using Authorization header
+
+### [1.9.2] 2020-01-14
+
+ * Fixed minor git driver bugs
+ * Fixed schema validation for version field to allow `dev-*` versions too
+ * Fixed external processes' output being formatted even though it should not
+ * Fixed issue with path repositories when trying to install feature branches
+
+### [1.9.1] 2019-11-01
+
+ * Fixed various credential handling issues with gitlab and github
+ * Fixed credentials being present in git remotes in Composer cache and vendor directory when not using SSH keys
+ * Fixed `composer why` not listing replacers as a reason something is present
+ * Fixed various PHP 7.4 compatibility issues
+ * Fixed root warnings always present in Docker containers, setting COMPOSER_ALLOW_SUPERUSER is not necessary anymore
+ * Fixed GitHub access tokens leaking into debug-verbosity output
+ * Fixed several edge case issues detecting GitHub, Bitbucket and GitLab repository types
+ * Fixed Composer asking if you want to use a composer.json in a parent directory when ran in non-interactive mode
+ * Fixed classmap autoloading issue finding classes located within a few non-PHP context blocks (?>...=`, see http://getcomposer.org/doc/01-basic-usage.md#package-versions
+ * Schema: Added a new `~` operator that should be preferred over `>=`, see https://getcomposer.org/doc/01-basic-usage.md#package-versions
* Schema: Version constraints ` | [naderman.de](http://naderman.de)
-- Jordi Boggiano | [GitHub](https://github.com/Seldaek) | [Twitter](https://twitter.com/seldaek) | | [seld.be](http://seld.be)
+- Nils Adermann | [GitHub](https://github.com/naderman) | [Twitter](https://twitter.com/naderman) | | [naderman.de](https://naderman.de)
+- Jordi Boggiano | [GitHub](https://github.com/Seldaek) | [Twitter](https://twitter.com/seldaek) | | [seld.be](https://seld.be)
See also the list of [contributors](https://github.com/composer/composer/contributors) who participated in this project.
@@ -53,7 +52,7 @@ Please send any sensitive issue to [security@packagist.org](mailto:security@pack
License
-------
-Composer is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
+Composer is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Acknowledgments
---------------
diff --git a/app/vendor/composer/composer/UPGRADE-2.0.md b/app/vendor/composer/composer/UPGRADE-2.0.md
new file mode 100644
index 000000000..3e5878ea3
--- /dev/null
+++ b/app/vendor/composer/composer/UPGRADE-2.0.md
@@ -0,0 +1,111 @@
+# Upgrade guides for Composer 1.x to 2.0
+
+## For composer CLI users
+
+- The new platform-check feature means that Composer checks the runtime PHP version and available extensions to ensure they match the project dependencies. If a mismatch is found, it exits with error details to make sure problems are not overlooked. To avoid issues when deploying to production it is recommended to run `composer check-platform-reqs` with the production PHP process as part of your build or deployment process.
+- If a package exists in a higher priority repository, it will now be entirely ignored in lower priority repositories. See [repository priorities](https://getcomposer.org/repoprio) for details.
+- Invalid PSR-0 / PSR-4 class configurations will not autoload anymore in optimized-autoloader mode, as per the warnings introduced in 1.10
+- On linux systems supporting the XDG Base Directory Specification, Composer will now prefer using XDG_CONFIG_DIR/composer over `~/.composer` if both are available (1.x used `~/.composer` first)
+- Package names now must comply to our [naming guidelines](doc/04-schema.md#name) or Composer will abort, as per the warnings introduced in 1.8.1
+- Deprecated --no-suggest flag as it is not needed anymore
+- PEAR support (repository, downloader, etc.) has been removed
+- `update` now lists changes to the lock file first (update step), and then the changes applied when installing the lock file to the vendor dir (install step)
+- `HTTPS_PROXY_REQUEST_FULLURI` if not specified will now default to false as this seems to work better in most environments
+- `dev-trunk`, `dev-master` and `dev-default` are no longer aliases for each other. The exact branch names are now preserved.
+
+## For integrators and plugin authors
+
+- composer-plugin-api has been bumped to 2.0.0 - you can detect which version of Composer you run via `PluginInterface::PLUGIN_API_VERSION`
+- `PluginInterface` added a deactivate (so plugin can stop whatever it is doing) and an uninstall (so the plugin can remove any files it created or do general cleanup) method.
+- Plugins implementing `EventSubscriberInterface` will be deregistered from the EventDispatcher automatically when being deactivated, nothing to do there.
+- `Pool` objects are now created via the `RepositorySet` class, you should use that in case you were using the `Pool` class directly.
+- Custom installers extending from LibraryInstaller should be aware that in Composer 2 it MAY return PromiseInterface instances when calling parent::install/update/uninstall/installCode/removeCode. See [composer/installers](https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb) for an example of how to handle this best.
+- The `Composer\Installer` class changed quite a bit internally, but the inputs are almost the same:
+ - `setAdditionalInstalledRepository` is now `setAdditionalFixedRepository`
+ - `setUpdateWhitelist` is now `setUpdateAllowList`
+ - `setWhitelistDependencies`, `setWhitelistTransitiveDependencies` and `setWhitelistAllDependencies` are now all rolled into `setUpdateAllowTransitiveDependencies` which takes one of the `Request::UPDATE_*` constants
+ - `setSkipSuggest` is gone
+- `vendor/composer/installed.json` format changed:
+ - packages are now wrapped into a `"packages"` top level key instead of the whole file being the package array
+ - packages now contain an `"installed-path"` key which lists where they were installed
+ - there is a top level `"dev"` key which stores whether dev requirements were installed or not
+- Removed `OperationInterface::getReason` as the data was not accurate. There is no replacement available.
+- `PreFileDownloadEvent` now receives an `HttpDownloader` instance instead of `RemoteFilesystem`, and that instance cannot be overridden by listeners anymore, you can however call setProcessedUrl or setCustomCacheKey.
+- `VersionSelector::findBestCandidate`'s third argument (phpVersion) was removed in favor of passing in a complete PlatformRepository instance into the constructor
+- `InitCommand::determineRequirements`'s fourth argument (phpVersion) should now receive a complete PlatformRepository instance or null if platform requirements are to be ignored
+- `IOInterface` now extends PSR-3's `LoggerInterface`, and has new `writeRaw` + `writeErrorRaw` methods
+- `RepositoryInterface` changes:
+ - A new `loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags)` function was added for use during pool building
+ - `search` now has a third `$type` argument
+ - A new `getRepoName()` function was added to describe the repository
+ - A new `getProviders()` function was added to list packages providing a given package's name
+- Removed `BaseRepository` abstract class
+- `DownloaderInterface` changes:
+ - `download` now receives a third `$prevPackage` argument for updates
+ - `download` should now only do network operations to prepare the package for installation but not actually install anything
+ - `prepare` (do user prompts or any checks which need to happen to make sure that install/update/remove will most likely succeed), `install` (should do the non-network part that `download` used to do) and `cleanup` (cleaning up anything that may be left over) were added as new steps in the package install flow
+ - All packages get first downloaded, then all together prepared, then all together installed/updated/uninstalled, then finally cleanup is called for all. Therefore for error recovery it is important to avoid failing during install/update/uninstall as much as possible, and risky things or user prompts should happen in the prepare step rather. In case of failure, cleanup() will be called so that changes can be undone as much as possible.
+- If you used `RemoteFilesystem` you probably should use `HttpDownloader` instead now
+- `PRE_DEPENDENCIES_SOLVING` and `POST_DEPENDENCIES_SOLVING` events have been removed, use the new `PRE_OPERATIONS_EXEC`, `PRE_POOL_CREATE` or other existing events instead or talk to us if you think you really need this. See below for more details.
+- The bundled composer/semver is now the 3.x range, see release notes for [2.0](https://github.com/composer/semver/releases/tag/2.0.0) and [3.0](https://github.com/composer/semver/releases/tag/3.0.0) for the minor breaking changes there
+- Run Composer with COMPOSER_DEBUG_EVENTS=1 set in the environment to show which events happen which might help you.
+
+### Detailed differences in event flow during dependency resolution, composer updates and installs
+
+#### Composer v1
+
+- Composer resolves dependencies (dispatching PRE/POST_DEPENDENCIES_SOLVING)
+- It then iterates over all packages one by one (dispatching PRE_PACKAGE_INSTALL/UPDATE/UNINSTALL, then PRE_FILE_DOWNLOAD if needed, then POST_PACKAGE_\*)
+- And finally writes the lock file at the end
+
+#### Composer v2
+
+The update and install process have been split up.
+
+Update does:
+
+- Composer resolves dependencies (dispatching PRE_POOL_CREATE)
+- It then writes the lock file and that's the end of the update
+
+Install then does:
+
+- Dispatches PRE_OPERATIONS_EXEC with the full list of operations to be executed
+- Downloads all the packages not in cache yet in parallel (dispatching PRE_FILE_DOWNLOAD for those not in cache yet)
+- It then iterates over all packages and executes updates/installs/uninstalls in parallel (dispatching PRE_PACKAGE_INSTALL/UPDATE/UNINSTALL then POST_PACKAGE_\* but one package started last may finish installing before another is done for example).
+
+## For Composer repository implementors
+
+Composer 2.0 adds support for a new Composer repository format.
+
+It is possible to build a repository which is compatible with both Composer v1 and v2, you keep everything you had and simply add the new fields in `packages.json`.
+
+Here are examples of the new values from packagist.org:
+
+### metadata-url
+
+`"metadata-url": "/p2/%package%.json",`
+
+This new metadata-url should serve all packages which are in the repository.
+
+- Whenever Composer looks for a package, it will replace `%package%` by the package name, and fetch that URL.
+- If dev stability is allowed for the package, it will also load the URL again with `$packageName~dev` (e.g. `/p2/foo/bar~dev.json` to look for `foo/bar`'s dev versions).
+- Caching is done via the use of If-Modified-Since header, so make sure you return Last-Modified headers and that they are accurate.
+- Any requested package which does not exist MUST return a 404 status code, which will indicate to Composer that this package does not exist in your repository. Make sure the 404 response is fast to avoid blocking Composer. Avoid redirects to alternative 404 pages.
+- The `foo/bar.json` and `foo/bar~dev.json` files containing package versions MUST contain only versions for the foo/bar package, as `{"packages":{"foo/bar":[ ... versions here ... ]}}`.
+- The array of versions can also optionally be minified using `Composer\Util\MetadataMinifier::minify()`. If you do that, you should add a `"minified": "composer/2.0"` key at the top level to indicate to Composer it must expand the version list back into the original data. See https://repo.packagist.org/p2/monolog/monolog.json for an example.
+
+If your repository only has a small number of packages, and you want to avoid the 404-requests, you can also specify an `"available-packages"` key in `packages.json` which should be an array with all the package names that your repository contain. Alternatively you can specify an `"available-package-patterns"` key which is an array of package name patterns (with `*` matching any string, e.g. `vendor/*` would make composer look up every matching package name in this repository).
+
+### providers-api
+
+`"providers-api": "https://packagist.org/providers/%package%.json",`
+
+The providers-api is optional, but if you implement it it should return packages which provide a given package name, but not the package which has that name. For example https://packagist.org/providers/monolog/monolog.json lists some package which have a "provide" rule for monolog/monolog, but it does not list monolog/monolog itself.
+
+### list
+
+This is also optional, it should accept an optional `?filter=xx` query param, which can contain `*` as wildcards matching any substring.
+
+It must return an array of package names as `{"packageNames": ["a/b", "c/d"]}`. See for example.
+
+It should return the names of package which names match the filter (or all names if no filter is present). Replace/provide rules should not be considered here.
diff --git a/app/vendor/composer/composer/appveyor.yml b/app/vendor/composer/composer/appveyor.yml
deleted file mode 100644
index 348b0778a..000000000
--- a/app/vendor/composer/composer/appveyor.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-build: false
-clone_depth: 5
-
-environment:
- PHP_CHOCO_VERSION: 7.2.0
- PHP_CACHE_DIR: C:\tools\php
-
-cache:
- - '%PHP_CACHE_DIR% -> appveyor.yml'
-
-init:
- - SET PATH=%PHP_CACHE_DIR%;%PATH%
- - SET COMPOSER_CACHE_DIR=%PHP_CACHE_DIR%
- - SET COMPOSER_NO_INTERACTION=1
- - SET PHP=0
- - SET ANSICON=121x90 (121x90)
-
-install:
- - IF EXIST %PHP_CACHE_DIR% (SET PHP=1)
- - IF %PHP%==0 cinst php -y --version %PHP_CHOCO_VERSION% --params "/InstallDir:%PHP_CACHE_DIR%"
- - IF %PHP%==0 cinst composer -y --ia "/DEV=%PHP_CACHE_DIR%"
- - php -v
- - IF %PHP%==0 (composer --version) ELSE (composer self-update)
- - cd %APPVEYOR_BUILD_FOLDER%
- - composer install --prefer-dist --no-progress
-
-test_script:
- - cd %APPVEYOR_BUILD_FOLDER%
- - vendor\bin\phpunit --colors=always
diff --git a/app/vendor/composer/composer/bin/compile b/app/vendor/composer/composer/bin/compile
index a2720a95d..f9156245f 100755
--- a/app/vendor/composer/composer/bin/compile
+++ b/app/vendor/composer/composer/bin/compile
@@ -20,7 +20,7 @@ require __DIR__.'/../src/bootstrap.php';
use Composer\Compiler;
error_reporting(-1);
-ini_set('display_errors', 1);
+ini_set('display_errors', '1');
try {
$compiler = new Compiler();
diff --git a/app/vendor/composer/composer/bin/composer b/app/vendor/composer/composer/bin/composer
index 7a80288b6..62c18974d 100755
--- a/app/vendor/composer/composer/bin/composer
+++ b/app/vendor/composer/composer/bin/composer
@@ -1,7 +1,7 @@
#!/usr/bin/env php
check();
unset($xdebug);
-if (function_exists('ini_set')) {
- @ini_set('display_errors', 1);
-
- $memoryInBytes = function ($value) {
- $unit = strtolower(substr($value, -1, 1));
- $value = (int) $value;
- switch($unit) {
- case 'g':
- $value *= 1024;
- // no break (cumulative multiplier)
- case 'm':
- $value *= 1024;
- // no break (cumulative multiplier)
- case 'k':
- $value *= 1024;
- }
+if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '4.0', '>=')) {
+ echo 'HHVM 4.0 has dropped support for Composer, please use PHP instead. Aborting.'.PHP_EOL;
+ exit(1);
+}
- return $value;
- };
+if (function_exists('ini_set')) {
+ @ini_set('display_errors', '1');
- $memoryLimit = trim(ini_get('memory_limit'));
- // Increase memory_limit if it is lower than 1.5GB
- if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1536) {
- @ini_set('memory_limit', '1536M');
- }
// Set user defined memory limit
if ($memoryLimit = getenv('COMPOSER_MEMORY_LIMIT')) {
@ini_set('memory_limit', $memoryLimit);
+ } else {
+ $memoryInBytes = function ($value) {
+ $unit = strtolower(substr($value, -1, 1));
+ $value = (int) $value;
+ switch($unit) {
+ case 'g':
+ $value *= 1024;
+ // no break (cumulative multiplier)
+ case 'm':
+ $value *= 1024;
+ // no break (cumulative multiplier)
+ case 'k':
+ $value *= 1024;
+ }
+
+ return $value;
+ };
+
+ $memoryLimit = trim(ini_get('memory_limit'));
+ // Increase memory_limit if it is lower than 1.5GB
+ if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1536) {
+ @ini_set('memory_limit', '1536M');
+ }
+ unset($memoryInBytes);
}
- unset($memoryInBytes, $memoryLimit);
+ unset($memoryLimit);
}
-putenv('COMPOSER_BINARY='.realpath($_SERVER['argv'][0]));
+Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0]));
+
+ErrorHandler::register();
// run the command application
$application = new Application();
diff --git a/app/vendor/composer/composer/composer.json b/app/vendor/composer/composer/composer.json
index 91da0ec60..9225f2e5f 100644
--- a/app/vendor/composer/composer/composer.json
+++ b/app/vendor/composer/composer/composer.json
@@ -1,7 +1,7 @@
{
"name": "composer/composer",
"type": "library",
- "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.",
+ "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.",
"keywords": [
"package",
"dependency",
@@ -13,35 +13,34 @@
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de"
+ "homepage": "https://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
+ "homepage": "https://seld.be"
}
],
"require": {
- "php": "^5.3.2 || ^7.0",
+ "php": "^5.3.2 || ^7.0 || ^8.0",
"composer/ca-bundle": "^1.0",
- "composer/semver": "^1.0",
+ "composer/metadata-minifier": "^1.0",
+ "composer/semver": "^3.0",
"composer/spdx-licenses": "^1.2",
- "composer/xdebug-handler": "^1.1",
- "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0",
+ "composer/xdebug-handler": "^2.0",
+ "justinrainbow/json-schema": "^5.2.11",
"psr/log": "^1.0",
"seld/jsonlint": "^1.4",
"seld/phar-utils": "^1.0",
- "symfony/console": "^2.7 || ^3.0 || ^4.0",
- "symfony/filesystem": "^2.7 || ^3.0 || ^4.0",
- "symfony/finder": "^2.7 || ^3.0 || ^4.0",
- "symfony/process": "^2.7 || ^3.0 || ^4.0"
- },
- "conflict": {
- "symfony/console": "2.8.38"
+ "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
+ "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
+ "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
+ "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
+ "react/promise": "^1.2 || ^2.7"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7",
- "phpunit/phpunit-mock-objects": "^2.3 || ^3.0"
+ "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0",
+ "phpspec/prophecy": "^1.10"
},
"suggest": {
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
@@ -51,11 +50,12 @@
"config": {
"platform": {
"php": "5.3.9"
- }
+ },
+ "platform-check": false
},
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "2.1-dev"
}
},
"autoload": {
@@ -65,17 +65,36 @@
},
"autoload-dev": {
"psr-4": {
- "Composer\\Test\\": "tests/Composer/Test"
- }
+ "Composer\\Test\\": "tests/Composer/Test",
+ "Composer\\PHPStanRules\\": "phpstan/Rules/src",
+ "Composer\\PHPStanRulesTests\\": "phpstan/Rules/tests"
+ },
+ "classmap": [
+ "phpstan/Rules/tests/data"
+ ]
},
"bin": [
"bin/composer"
],
"scripts": {
- "test": "phpunit"
+ "compile": "@php -dphar.readonly=0 bin/compile",
+ "test": "simple-phpunit",
+ "phpstan-setup": [
+ "@composer config platform --unset",
+ "@php composer.phar update",
+ "@composer require --dev phpstan/phpstan:^0.12.93 phpstan/phpstan-phpunit:^0.12.17 phpunit/phpunit:^7.5.20 --with-all-dependencies",
+ "git checkout composer.json composer.lock"
+ ],
+ "phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
+ },
+ "scripts-descriptions": {
+ "compile": "Compile composer.phar",
+ "test": "Run all tests",
+ "phpstan-setup": "Prepare environment to run PHPStan locally (must be run with PHP7.4)",
+ "phpstan": "Runs PHPStan (after phpstan-setup was executed, must be run with PHP7.4)"
},
"support": {
"issues": "https://github.com/composer/composer/issues",
- "irc": "irc://irc.freenode.org/composer"
+ "irc": "ircs://irc.libera.chat:6697/composer"
}
}
diff --git a/app/vendor/composer/composer/composer.lock b/app/vendor/composer/composer/composer.lock
index 690aca23e..b953e70c9 100644
--- a/app/vendor/composer/composer/composer.lock
+++ b/app/vendor/composer/composer/composer.lock
@@ -4,36 +4,37 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5c554bae92a73c12f7797833fd44e946",
+ "content-hash": "dfe550a024c0c2bb0784765e457968af",
"packages": [
{
"name": "composer/ca-bundle",
- "version": "1.1.2",
+ "version": "1.2.10",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0"
+ "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0",
- "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8",
+ "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-pcre": "*",
- "php": "^5.3.2 || ^7.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
+ "phpstan/phpstan": "^0.12.55",
"psr/log": "^1.0",
- "symfony/process": "^2.5 || ^3.0 || ^4.0"
+ "symfony/phpunit-bridge": "^4.2 || ^5",
+ "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-main": "1.x-dev"
}
},
"autoload": {
@@ -60,33 +61,121 @@
"ssl",
"tls"
],
- "time": "2018-08-08T08:57:40+00:00"
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/ca-bundle/issues",
+ "source": "https://github.com/composer/ca-bundle/tree/1.2.10"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-06-07T13:58:28+00:00"
+ },
+ {
+ "name": "composer/metadata-minifier",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/metadata-minifier.git",
+ "reference": "c549d23829536f0d0e984aaabbf02af91f443207"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207",
+ "reference": "c549d23829536f0d0e984aaabbf02af91f443207",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "composer/composer": "^2",
+ "phpstan/phpstan": "^0.12.55",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\MetadataMinifier\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Small utility library that handles metadata minification and expansion.",
+ "keywords": [
+ "composer",
+ "compression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/metadata-minifier/issues",
+ "source": "https://github.com/composer/metadata-minifier/tree/1.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-04-07T13:37:33+00:00"
},
{
"name": "composer/semver",
- "version": "1.4.2",
+ "version": "3.2.5",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573"
+ "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573",
- "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573",
+ "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9",
+ "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5",
- "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
+ "phpstan/phpstan": "^0.12.54",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-main": "3.x-dev"
}
},
"autoload": {
@@ -122,33 +211,51 @@
"validation",
"versioning"
],
- "time": "2016-08-30T16:08:34+00:00"
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/semver/issues",
+ "source": "https://github.com/composer/semver/tree/3.2.5"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-05-24T12:41:47+00:00"
},
{
"name": "composer/spdx-licenses",
- "version": "1.4.0",
+ "version": "1.5.5",
"source": {
"type": "git",
"url": "https://github.com/composer/spdx-licenses.git",
- "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b"
+ "reference": "de30328a7af8680efdc03e396aad24befd513200"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b",
- "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b",
+ "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200",
+ "reference": "de30328a7af8680efdc03e396aad24befd513200",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
- "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-main": "1.x-dev"
}
},
"autoload": {
@@ -183,28 +290,48 @@
"spdx",
"validator"
],
- "time": "2018-04-30T10:33:04+00:00"
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/spdx-licenses/issues",
+ "source": "https://github.com/composer/spdx-licenses/tree/1.5.5"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-12-03T16:04:16+00:00"
},
{
"name": "composer/xdebug-handler",
- "version": "1.2.0",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "e1809da56ce1bd1b547a752936817341ac244d8e"
+ "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/e1809da56ce1bd1b547a752936817341ac244d8e",
- "reference": "e1809da56ce1bd1b547a752936817341ac244d8e",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339",
+ "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0",
- "psr/log": "^1.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ "phpstan/phpstan": "^0.12.55",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
"autoload": {
@@ -222,32 +349,51 @@
"email": "john-stevenson@blueyonder.co.uk"
}
],
- "description": "Restarts a process without xdebug.",
+ "description": "Restarts a process without Xdebug.",
"keywords": [
"Xdebug",
"performance"
],
- "time": "2018-08-16T10:54:23+00:00"
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/xdebug-handler/issues",
+ "source": "https://github.com/composer/xdebug-handler/tree/2.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-07-31T17:03:58+00:00"
},
{
"name": "justinrainbow/json-schema",
- "version": "5.2.7",
+ "version": "5.2.11",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
- "reference": "8560d4314577199ba51bf2032f02cd1315587c23"
+ "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23",
- "reference": "8560d4314577199ba51bf2032f02cd1315587c23",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa",
+ "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "^2.1",
+ "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35"
},
@@ -293,20 +439,24 @@
"json",
"schema"
],
- "time": "2018-02-14T22:26:30+00:00"
+ "support": {
+ "issues": "https://github.com/justinrainbow/json-schema/issues",
+ "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11"
+ },
+ "time": "2021-07-22T09:24:00+00:00"
},
{
"name": "psr/log",
- "version": "1.0.2",
+ "version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
@@ -315,7 +465,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -330,7 +480,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
@@ -340,24 +490,75 @@
"psr",
"psr-3"
],
- "time": "2016-10-10T12:19:37+00:00"
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/1.1.4"
+ },
+ "time": "2021-05-03T11:20:27+00:00"
+ },
+ {
+ "name": "react/promise",
+ "version": "v1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "eefff597e67ff66b719f8171480add3c91474a1e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/eefff597e67ff66b719f8171480add3c91474a1e",
+ "reference": "eefff597e67ff66b719f8171480add3c91474a1e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "React\\Promise": "src/"
+ },
+ "files": [
+ "src/React/Promise/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com"
+ }
+ ],
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
+ "support": {
+ "issues": "https://github.com/reactphp/promise/issues",
+ "source": "https://github.com/reactphp/promise/tree/1.0"
+ },
+ "time": "2016-03-07T13:46:50+00:00"
},
{
"name": "seld/jsonlint",
- "version": "1.7.1",
+ "version": "1.8.3",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/jsonlint.git",
- "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38"
+ "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38",
- "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38",
+ "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57",
+ "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57",
"shasum": ""
},
"require": {
- "php": "^5.3 || ^7.0"
+ "php": "^5.3 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
@@ -389,20 +590,34 @@
"parser",
"validator"
],
- "time": "2018-01-24T12:46:19+00:00"
+ "support": {
+ "issues": "https://github.com/Seldaek/jsonlint/issues",
+ "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/Seldaek",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-11-11T09:19:24+00:00"
},
{
"name": "seld/phar-utils",
- "version": "1.0.1",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/phar-utils.git",
- "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a"
+ "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a",
- "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a",
+ "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0",
+ "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0",
"shasum": ""
},
"require": {
@@ -431,22 +646,26 @@
],
"description": "PHAR file format utilities, for when PHP phars you up",
"keywords": [
- "phra"
+ "phar"
],
- "time": "2015-10-13T18:44:15+00:00"
+ "support": {
+ "issues": "https://github.com/Seldaek/phar-utils/issues",
+ "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2"
+ },
+ "time": "2021-08-19T21:01:38+00:00"
},
{
"name": "symfony/console",
- "version": "v2.8.43",
+ "version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "42a0adc7dd656ca2e360285eb6d822df9ce0b160"
+ "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/42a0adc7dd656ca2e360285eb6d822df9ce0b160",
- "reference": "42a0adc7dd656ca2e360285eb6d822df9ce0b160",
+ "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12",
+ "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12",
"shasum": ""
},
"require": {
@@ -494,20 +713,23 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-07-09T12:58:09+00:00"
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v2.8.52"
+ },
+ "time": "2018-11-20T15:55:20+00:00"
},
{
"name": "symfony/debug",
- "version": "v2.8.43",
+ "version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "a26ddce7fe4e884097d72435653bc7e703411f26"
+ "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/a26ddce7fe4e884097d72435653bc7e703411f26",
- "reference": "a26ddce7fe4e884097d72435653bc7e703411f26",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0",
+ "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0",
"shasum": ""
},
"require": {
@@ -551,20 +773,23 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2018-06-22T15:01:26+00:00"
+ "support": {
+ "source": "https://github.com/symfony/debug/tree/v2.8.50"
+ },
+ "time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v2.8.43",
+ "version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "5cfc856c5b665ef5de0df796e98c54bef0fe595b"
+ "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/5cfc856c5b665ef5de0df796e98c54bef0fe595b",
- "reference": "5cfc856c5b665ef5de0df796e98c54bef0fe595b",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/7ae46872dad09dffb7fe1e93a0937097339d0080",
+ "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080",
"shasum": ""
},
"require": {
@@ -601,20 +826,23 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2018-07-09T13:24:25+00:00"
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v2.8.52"
+ },
+ "time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/finder",
- "version": "v2.8.43",
+ "version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "995cd7c28a0778cece02e2133b4d813dc509dfc3"
+ "reference": "1444eac52273e345d9b95129bf914639305a9ba4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/995cd7c28a0778cece02e2133b4d813dc509dfc3",
- "reference": "995cd7c28a0778cece02e2133b4d813dc509dfc3",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4",
+ "reference": "1444eac52273e345d9b95129bf914639305a9ba4",
"shasum": ""
},
"require": {
@@ -650,29 +878,39 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2018-06-19T11:07:17+00:00"
+ "support": {
+ "source": "https://github.com/symfony/finder/tree/v2.8.50"
+ },
+ "time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.8.0",
+ "version": "v1.19.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
+ "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
- "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b",
+ "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-main": "1.19-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -688,13 +926,13 @@
"MIT"
],
"authors": [
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- },
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
@@ -705,20 +943,37 @@
"polyfill",
"portable"
],
- "time": "2018-04-30T19:57:29+00:00"
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-10-23T09:01:57+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.8.0",
+ "version": "v1.19.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "3296adf6a6454a050679cde90f95350ad604b171"
+ "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
- "reference": "3296adf6a6454a050679cde90f95350ad604b171",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce",
+ "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce",
"shasum": ""
},
"require": {
@@ -730,7 +985,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8-dev"
+ "dev-main": "1.19-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -764,20 +1023,37 @@
"portable",
"shim"
],
- "time": "2018-04-26T10:06:28+00:00"
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-10-23T09:01:57+00:00"
},
{
"name": "symfony/process",
- "version": "v2.8.43",
+ "version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "542d88b350c42750fdc14e73860ee96dd423e95d"
+ "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/542d88b350c42750fdc14e73860ee96dd423e95d",
- "reference": "542d88b350c42750fdc14e73860ee96dd423e95d",
+ "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8",
+ "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8",
"shasum": ""
},
"require": {
@@ -813,7 +1089,10 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2018-05-27T07:40:52+00:00"
+ "support": {
+ "source": "https://github.com/symfony/process/tree/v2.8.50"
+ },
+ "time": "2018-11-11T11:18:13+00:00"
}
],
"packages-dev": [
@@ -869,6 +1148,10 @@
"constructor",
"instantiate"
],
+ "support": {
+ "issues": "https://github.com/doctrine/instantiator/issues",
+ "source": "https://github.com/doctrine/instantiator/tree/master"
+ },
"time": "2015-06-14T21:17:01+00:00"
},
{
@@ -918,42 +1201,46 @@
"email": "mike.vanriel@naenius.com"
}
],
+ "support": {
+ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x"
+ },
"time": "2016-01-25T08:17:30+00:00"
},
{
"name": "phpspec/prophecy",
- "version": "1.7.6",
+ "version": "v1.10.3",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
+ "reference": "451c3cd1418cf640de218914901e51b064abb093"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
- "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
+ "reference": "451c3cd1418cf640de218914901e51b064abb093",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
- "sebastian/comparator": "^1.1|^2.0|^3.0",
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
+ "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
},
"require-dev": {
- "phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ "phpspec/phpspec": "^2.5 || ^3.2",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7.x-dev"
+ "dev-master": "1.10.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Prophecy\\": "src/"
+ "psr-4": {
+ "Prophecy\\": "src/Prophecy"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -981,43 +1268,38 @@
"spy",
"stub"
],
- "time": "2018-04-18T13:57:24+00:00"
+ "support": {
+ "issues": "https://github.com/phpspec/prophecy/issues",
+ "source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
+ },
+ "time": "2020-03-05T15:02:03+00:00"
},
{
- "name": "phpunit/php-code-coverage",
- "version": "2.2.4",
+ "name": "sebastian/comparator",
+ "version": "1.2.4",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
- "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
- "phpunit/php-file-iterator": "~1.3",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-token-stream": "~1.3",
- "sebastian/environment": "^1.3.2",
- "sebastian/version": "~1.0"
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2 || ~2.0"
},
"require-dev": {
- "ext-xdebug": ">=2.1.4",
- "phpunit/phpunit": "~4"
- },
- "suggest": {
- "ext-dom": "*",
- "ext-xdebug": ">=2.2.1",
- "ext-xmlwriter": "*"
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -1030,42 +1312,60 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
}
],
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
- "coverage",
- "testing",
- "xunit"
+ "comparator",
+ "compare",
+ "equality"
],
- "time": "2015-10-06T15:47:00+00:00"
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/1.2"
+ },
+ "time": "2017-01-29T09:50:25+00:00"
},
{
- "name": "phpunit/php-file-iterator",
- "version": "1.4.5",
+ "name": "sebastian/diff",
+ "version": "1.4.3",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.4.x-dev"
+ "dev-master": "1.4-dev"
}
},
"autoload": {
@@ -1078,38 +1378,54 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
}
],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
- "filesystem",
- "iterator"
+ "diff"
],
- "time": "2017-11-27T13:52:08+00:00"
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/1.4"
+ },
+ "time": "2017-05-22T07:24:03+00:00"
},
{
- "name": "phpunit/php-text-template",
- "version": "1.2.1",
+ "name": "sebastian/exporter",
+ "version": "2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~2.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -1120,437 +1436,63 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
}
],
- "description": "Simple template engine.",
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
- "template"
+ "export",
+ "exporter"
],
- "time": "2015-06-21T13:50:34+00:00"
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/master"
+ },
+ "time": "2016-11-19T08:54:04+00:00"
},
{
- "name": "phpunit/php-timer",
- "version": "1.0.9",
+ "name": "sebastian/recursion-context",
+ "version": "2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0"
+ "php": ">=5.3.3"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ "phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "Utility class for timing",
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
- "keywords": [
- "timer"
- ],
- "time": "2017-02-26T11:10:40+00:00"
- },
- {
- "name": "phpunit/php-token-stream",
- "version": "1.4.12",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
- "shasum": ""
- },
- "require": {
- "ext-tokenizer": "*",
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.2"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Wrapper around PHP's tokenizer extension.",
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
- "keywords": [
- "tokenizer"
- ],
- "time": "2017-12-04T08:55:13+00:00"
- },
- {
- "name": "phpunit/phpunit",
- "version": "4.8.36",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-json": "*",
- "ext-pcre": "*",
- "ext-reflection": "*",
- "ext-spl": "*",
- "php": ">=5.3.3",
- "phpspec/prophecy": "^1.3.1",
- "phpunit/php-code-coverage": "~2.1",
- "phpunit/php-file-iterator": "~1.4",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-timer": "^1.0.6",
- "phpunit/phpunit-mock-objects": "~2.3",
- "sebastian/comparator": "~1.2.2",
- "sebastian/diff": "~1.2",
- "sebastian/environment": "~1.3",
- "sebastian/exporter": "~1.2",
- "sebastian/global-state": "~1.0",
- "sebastian/version": "~1.0",
- "symfony/yaml": "~2.1|~3.0"
- },
- "suggest": {
- "phpunit/php-invoker": "~1.1"
- },
- "bin": [
- "phpunit"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.8.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "The PHP Unit Testing framework.",
- "homepage": "https://phpunit.de/",
- "keywords": [
- "phpunit",
- "testing",
- "xunit"
- ],
- "time": "2017-06-21T08:07:12+00:00"
- },
- {
- "name": "phpunit/phpunit-mock-objects",
- "version": "2.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
- "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "^1.0.2",
- "php": ">=5.3.3",
- "phpunit/php-text-template": "~1.2",
- "sebastian/exporter": "~1.2"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "suggest": {
- "ext-soap": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "Mock Object library for PHPUnit",
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
- "keywords": [
- "mock",
- "xunit"
- ],
- "time": "2015-10-02T06:51:40+00:00"
- },
- {
- "name": "sebastian/comparator",
- "version": "1.2.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3",
- "sebastian/diff": "~1.2",
- "sebastian/exporter": "~1.2 || ~2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.2.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides the functionality to compare PHP values for equality",
- "homepage": "http://www.github.com/sebastianbergmann/comparator",
- "keywords": [
- "comparator",
- "compare",
- "equality"
- ],
- "time": "2017-01-29T09:50:25+00:00"
- },
- {
- "name": "sebastian/diff",
- "version": "1.4.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
- "shasum": ""
- },
- "require": {
- "php": "^5.3.3 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Diff implementation",
- "homepage": "https://github.com/sebastianbergmann/diff",
- "keywords": [
- "diff"
- ],
- "time": "2017-05-22T07:24:03+00:00"
- },
- {
- "name": "sebastian/environment",
- "version": "1.3.8",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
- "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
- "shasum": ""
- },
- "require": {
- "php": "^5.3.3 || ^7.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8 || ^5.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
- "keywords": [
- "Xdebug",
- "environment",
- "hhvm"
- ],
- "time": "2016-08-18T05:49:44+00:00"
- },
- {
- "name": "sebastian/exporter",
- "version": "1.2.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
- "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3",
- "sebastian/recursion-context": "~1.0"
- },
- "require-dev": {
- "ext-mbstring": "*",
- "phpunit/phpunit": "~4.4"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -1567,14 +1509,6 @@
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- },
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
@@ -1584,180 +1518,56 @@
"email": "aharvey@php.net"
}
],
- "description": "Provides the functionality to export PHP variables for visualization",
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
- "keywords": [
- "export",
- "exporter"
- ],
- "time": "2016-06-17T09:04:28+00:00"
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/master"
+ },
+ "time": "2016-11-19T07:33:16+00:00"
},
{
- "name": "sebastian/global-state",
- "version": "1.1.1",
+ "name": "symfony/phpunit-bridge",
+ "version": "v4.2.12",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ "url": "https://github.com/symfony/phpunit-bridge.git",
+ "reference": "80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7",
+ "reference": "80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "phpunit/phpunit": "~4.2"
+ "conflict": {
+ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"suggest": {
- "ext-uopz": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
+ "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
},
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
- "keywords": [
- "global state"
+ "bin": [
+ "bin/simple-phpunit"
],
- "time": "2015-10-12T03:26:01+00:00"
- },
- {
- "name": "sebastian/recursion-context",
- "version": "1.0.5",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
- "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "type": "library",
+ "type": "symfony-bridge",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
+ "dev-master": "4.2-dev"
},
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- }
- ],
- "description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2016-10-03T07:41:43+00:00"
- },
- {
- "name": "sebastian/version",
- "version": "1.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
- "shasum": ""
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2015-06-21T13:59:46+00:00"
- },
- {
- "name": "symfony/yaml",
- "version": "v2.8.43",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff",
- "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9",
- "symfony/polyfill-ctype": "~1.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.8-dev"
+ "thanks": {
+ "name": "phpunit/phpunit",
+ "url": "https://github.com/sebastianbergmann/phpunit"
}
},
"autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
"psr-4": {
- "Symfony\\Component\\Yaml\\": ""
+ "Symfony\\Bridge\\PhpUnit\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -1769,17 +1579,20 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Yaml Component",
+ "description": "Symfony PHPUnit Bridge",
"homepage": "https://symfony.com",
- "time": "2018-05-01T22:52:40+00:00"
+ "support": {
+ "source": "https://github.com/symfony/phpunit-bridge/tree/4.2"
+ },
+ "time": "2019-07-05T06:33:37+00:00"
}
],
"aliases": [],
@@ -1788,10 +1601,11 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": "^5.3.2 || ^7.0"
+ "php": "^5.3.2 || ^7.0 || ^8.0"
},
"platform-dev": [],
"platform-overrides": {
"php": "5.3.9"
- }
+ },
+ "plugin-api-version": "2.1.0"
}
diff --git a/app/vendor/composer/composer/doc/00-intro.md b/app/vendor/composer/composer/doc/00-intro.md
index 046fea8fe..8afd60090 100644
--- a/app/vendor/composer/composer/doc/00-intro.md
+++ b/app/vendor/composer/composer/doc/00-intro.md
@@ -9,7 +9,7 @@ for you.
Composer is **not** a package manager in the same sense as Yum or Apt are. Yes,
it deals with "packages" or libraries, but it manages them on a per-project
basis, installing them in a directory (e.g. `vendor`) inside your project. By
-default it does not install anything globally. Thus, it is a dependency
+default, it does not install anything globally. Thus, it is a dependency
manager. It does however support a "global" project for convenience via the
[global](03-cli.md#global) command.
@@ -19,13 +19,14 @@ This idea is not new and Composer is strongly inspired by node's
Suppose:
1. You have a project that depends on a number of libraries.
-1. Some of those libraries depend on other libraries.
+2. Some of those libraries depend on other libraries.
Composer:
1. Enables you to declare the libraries you depend on.
-1. Finds out which versions of which packages can and need to be installed, and
+2. Finds out which versions of which packages can and need to be installed, and
installs them (meaning it downloads them into your project).
+3. You can update all your dependencies in one command.
See the [Basic usage](01-basic-usage.md) chapter for more details on declaring
dependencies.
@@ -36,18 +37,18 @@ Composer requires PHP 5.3.2+ to run. A few sensitive php settings and compile
flags are also required, but when using the installer you will be warned about
any incompatibilities.
-To install packages from sources instead of simple zip archives, you will need
+To install packages from sources instead of plain zip archives, you will need
git, svn, fossil or hg depending on how the package is version-controlled.
Composer is multi-platform and we strive to make it run equally well on Windows,
-Linux and OSX.
+Linux and macOS.
-## Installation - Linux / Unix / OSX
+## Installation - Linux / Unix / macOS
### Downloading the Composer Executable
Composer offers a convenient installer that you can execute directly from the
-commandline. Feel free to [download this file](https://getcomposer.org/installer)
+command line. Feel free to [download this file](https://getcomposer.org/installer)
or review it on [GitHub](https://github.com/composer/getcomposer.org/blob/master/web/installer)
if you wish to know more about the inner workings of the installer. The source
is plain PHP.
@@ -57,7 +58,7 @@ project, or globally as a system wide executable.
#### Locally
-To install Composer locally, run the installer in your project directory. See
+To install Composer locally, run the installer in your project directory. See
[the Download page](https://getcomposer.org/download/) for instructions.
The installer will check a few PHP settings and then download `composer.phar`
@@ -82,7 +83,7 @@ Now run `php bin/composer` in order to run Composer.
#### Globally
You can place the Composer PHAR anywhere you wish. If you put it in a directory
-that is part of your `PATH`, you can access it globally. On unixy systems you
+that is part of your `PATH`, you can access it globally. On Unix systems you
can even make it executable and invoke it without directly using the `php`
interpreter.
@@ -100,13 +101,14 @@ Linux distributions.
> **Note:** If the above fails due to permissions, you may need to run it again
> with sudo.
-> **Note:** On some versions of OSX the `/usr` directory does not exist by
+> **Note:** On some versions of macOS the `/usr` directory does not exist by
> default. If you receive the error "/usr/local/bin/composer: No such file or
> directory" then you must create the directory manually before proceeding:
> `mkdir -p /usr/local/bin`.
> **Note:** For information on changing your PATH, please read the
-> [Wikipedia article](https://en.wikipedia.org/wiki/PATH_(variable)) and/or use Google.
+> [Wikipedia article](https://en.wikipedia.org/wiki/PATH_(variable)) and/or use
+> your search engine of choice.
Now run `composer` in order to run Composer instead of `php composer.phar`.
@@ -132,25 +134,33 @@ to download `composer.phar`.
Create a new `composer.bat` file alongside `composer.phar`:
+Using cmd.exe:
+
+```sh
+C:\bin> echo @php "%~dp0composer.phar" %*>composer.bat
+```
+
+Using PowerShell:
+
```sh
-C:\bin>echo @php "%~dp0composer.phar" %*>composer.bat
+PS C:\bin> Set-Content composer.bat '@php "%~dp0composer.phar" %*'
```
Add the directory to your PATH environment variable if it isn't already.
For information on changing your PATH variable, please see
[this article](https://www.computerhope.com/issues/ch000549.htm) and/or
-use Google.
+use your search engine of choice.
Close your current terminal. Test usage with a new terminal:
```sh
C:\Users\username>composer -V
-Composer version 1.0.0 2016-01-10 20:34:53
+Composer version 2.0.12 2021-04-01 10:14:59
```
## Using Composer
Now that you've installed Composer, you are ready to use it! Head on over to the
-next chapter for a short and simple demonstration.
+next chapter for a short demonstration.
[Basic usage](01-basic-usage.md) →
diff --git a/app/vendor/composer/composer/doc/01-basic-usage.md b/app/vendor/composer/composer/doc/01-basic-usage.md
index ffcb1589e..4ccc50965 100644
--- a/app/vendor/composer/composer/doc/01-basic-usage.md
+++ b/app/vendor/composer/composer/doc/01-basic-usage.md
@@ -9,22 +9,25 @@ a logging library. If you have not yet installed Composer, refer to the
> **Note:** for the sake of simplicity, this introduction will assume you
> have performed a [local](00-intro.md#locally) install of Composer.
-## `composer.json`: Project Setup
+## `composer.json`: Project setup
To start using Composer in your project, all you need is a `composer.json`
file. This file describes the dependencies of your project and may contain
-other metadata as well.
+other metadata as well. It typically should go in the top-most directory of
+your project/VCS repository. You can technically run Composer anywhere but
+if you want to publish a package to Packagist.org, it will have to be able
+to find the file at the top of your VCS repository.
-### The `require` Key
+### The `require` key
-The first (and often only) thing you specify in `composer.json` is the
-[`require`](04-schema.md#require) key. You are simply telling Composer which
+The first thing you specify in `composer.json` is the
+[`require`](04-schema.md#require) key. You are telling Composer which
packages your project depends on.
```json
{
"require": {
- "monolog/monolog": "1.0.*"
+ "monolog/monolog": "2.0.*"
}
}
```
@@ -35,13 +38,13 @@ As you can see, [`require`](04-schema.md#require) takes an object that maps
Composer uses this information to search for the right set of files in package
"repositories" that you register using the [`repositories`](04-schema.md#repositories)
-key, or in Packagist, the default package repository. In the above example,
-since no other repository has been registered in the `composer.json` file, it is
-assumed that the `monolog/monolog` package is registered on Packagist. (See more
-about Packagist [below](#packagist), or read more about repositories
-[here](05-repositories.md)).
+key, or in [Packagist.org](https://packagist.org), the default package repository.
+In the above example, since no other repository has been registered in the
+`composer.json` file, it is assumed that the `monolog/monolog` package is registered
+on Packagist.org. (See more about Packagist [below](#packagist), or read more
+about repositories [here](05-repositories.md)).
-### Package Names
+### Package names
The package name consists of a vendor name and the project's name. Often these
will be identical - the vendor name only exists to prevent naming clashes. For
@@ -53,12 +56,12 @@ Read more about publishing packages and package naming [here](02-libraries.md).
you to require certain versions of server software. See
[platform packages](#platform-packages) below.)
-### Package Version Constraints
+### Package version constraints
In our example, we are requesting the Monolog package with the version constraint
-[`1.0.*`](https://semver.mwl.be/#?package=monolog%2Fmonolog&version=1.0.*).
-This means any version in the `1.0` development branch, or any version that is
-greater than or equal to 1.0 and less than 1.1 (`>=1.0 <1.1`).
+[`2.0.*`](https://semver.mwl.be/#?package=monolog%2Fmonolog&version=2.0.*).
+This means any version in the `2.0` development branch, or any version that is
+greater than or equal to 2.0 and less than 2.1 (`>=2.0 <2.1`).
Please read [versions](articles/versions.md) for more in-depth information on
versions, how versions relate to each other, and on version constraints.
@@ -68,58 +71,69 @@ versions, how versions relate to each other, and on version constraints.
> and searches for it in any repositories that you have registered using the
> [`repositories`](04-schema.md#repositories) key. If you have not registered
> any extra repositories, or it does not find a package with that name in the
-> repositories you have specified, it falls back to Packagist (more [below](#packagist)).
+> repositories you have specified, it falls back to Packagist.org (more [below](#packagist)).
>
-> When Composer finds the right package, either in Packagist or in a repo you have specified,
+> When Composer finds the right package, either in Packagist.org or in a repo you have specified,
> it then uses the versioning features of the package's VCS (i.e., branches and tags)
> to attempt to find the best match for the version constraint you have specified. Be sure to read
> about versions and package resolution in the [versions article](articles/versions.md).
> **Note:** If you are trying to require a package but Composer throws an error
> regarding package stability, the version you have specified may not meet your
-> default minimum stability requirements. By default only stable releases are taken
+> default minimum stability requirements. By default, only stable releases are taken
> into consideration when searching for valid package versions in your VCS.
>
> You might run into this if you are trying to require dev, alpha, beta, or RC
> versions of a package. Read more about stability flags and the `minimum-stability`
> key on the [schema page](04-schema.md).
-## Installing Dependencies
+## Installing dependencies
-To install the defined dependencies for your project, run the
-[`install`](03-cli.md#install) command.
+To initially install the defined dependencies for your project, you should run the
+[`update`](03-cli.md#update-u) command.
```sh
-php composer.phar install
+php composer.phar update
```
-When you run this command, one of two things may happen:
+This will make Composer do two things:
-### Installing Without `composer.lock`
-
-If you have never run the command before and there is also no `composer.lock` file present,
-Composer simply resolves all dependencies listed in your `composer.json` file and downloads
-the latest version of their files into the `vendor` directory in your project. (The `vendor`
-directory is the conventional location for all third-party code in a project). In our
-example from above, you would end up with the Monolog source files in
-`vendor/monolog/monolog/`. If Monolog listed any dependencies, those would also be in
-folders under `vendor/`.
+- It resolves all dependencies listed in your `composer.json` file and writes all of the
+ packages and their exact versions to the `composer.lock` file, locking the project to
+ those specific versions. You should commit the `composer.lock` file to your project repo
+ so that all people working on the project are locked to the same versions of dependencies
+ (more below). This is the main role of the `update` command.
+- It then implicitly runs the [`install`](03-cli.md#install-i) command. This will download
+ the dependencies' files into the `vendor` directory in your project. (The `vendor`
+ directory is the conventional location for all third-party code in a project). In our
+ example from above, you would end up with the Monolog source files in
+ `vendor/monolog/monolog/`. As Monolog has a dependency on `psr/log`, that package's files
+ can also be found inside `vendor/`.
> **Tip:** If you are using git for your project, you probably want to add
> `vendor` in your `.gitignore`. You really don't want to add all of that
> third-party code to your versioned repository.
-When Composer has finished installing, it writes all of the packages and the exact versions
-of them that it downloaded to the `composer.lock` file, locking the project to those specific
-versions. You should commit the `composer.lock` file to your project repo so that all people
-working on the project are locked to the same versions of dependencies (more below).
+### Commit your `composer.lock` file to version control
+
+Committing this file to version control is important because it will cause anyone
+who sets up the project to use the exact same
+versions of the dependencies that you are using. Your CI server, production
+machines, other developers in your team, everything and everyone runs on the
+same dependencies, which mitigates the potential for bugs affecting only some
+parts of the deployments. Even if you develop alone, in six months when
+reinstalling the project you can feel confident the dependencies installed are
+still working even if your dependencies released many new versions since then.
+(See note below about using the `update` command.)
+
+> **Note:** For libraries it is not necessary to commit the lock
+> file, see also: [Libraries - Lock file](02-libraries.md#lock-file).
-### Installing With `composer.lock`
+### Installing from `composer.lock`
-This brings us to the second scenario. If there is already a `composer.lock` file as well as a
-`composer.json` file when you run `composer install`, it means either you ran the
-`install` command before, or someone else on the project ran the `install` command and
-committed the `composer.lock` file to the project (which is good).
+If there is already a `composer.lock` file in the project folder, it means either
+you ran the `update` command before, or someone else on the project ran the `update`
+command and committed the `composer.lock` file to the project (which is good).
Either way, running `install` when a `composer.lock` file is present resolves and installs
all dependencies that you listed in `composer.json`, but Composer uses the exact versions listed
@@ -130,26 +144,21 @@ working on your project. As a result you will have all dependencies requested by
the file was created). This is by design, it ensures that your project does not break because of
unexpected changes in dependencies.
-### Commit Your `composer.lock` File to Version Control
+So after fetching new changes from your VCS repository it is recommended to run
+a Composer `install` to make sure the vendor directory is up in sync with your
+`composer.lock` file.
-Committing this file to VC is important because it will cause anyone who sets
-up the project to use the exact same
-versions of the dependencies that you are using. Your CI server, production
-machines, other developers in your team, everything and everyone runs on the
-same dependencies, which mitigates the potential for bugs affecting only some
-parts of the deployments. Even if you develop alone, in six months when
-reinstalling the project you can feel confident the dependencies installed are
-still working even if your dependencies released many new versions since then.
-(See note below about using the `update` command.)
+```sh
+php composer.phar install
+```
-## Updating Dependencies to their Latest Versions
+## Updating dependencies to their latest versions
As mentioned above, the `composer.lock` file prevents you from automatically getting
the latest versions of your dependencies. To update to the latest versions, use the
-[`update`](03-cli.md#update) command. This will fetch the latest matching
+[`update`](03-cli.md#update-u) command. This will fetch the latest matching
versions (according to your `composer.json` file) and update the lock file
-with the new versions. (This is equivalent to deleting the `composer.lock` file
-and running `install` again.)
+with the new versions.
```sh
php composer.phar update
@@ -159,24 +168,21 @@ php composer.phar update
> if the `composer.lock` has not been updated since changes were made to the
> `composer.json` that might affect dependency resolution.
-If you only want to install or update one dependency, you can whitelist them:
+If you only want to install, upgrade or remove one dependency, you can explicitly list it as an argument:
```sh
php composer.phar update monolog/monolog [...]
```
-> **Note:** For libraries it is not necessary to commit the lock
-> file, see also: [Libraries - Lock file](02-libraries.md#lock-file).
-
## Packagist
-[Packagist](https://packagist.org/) is the main Composer repository. A Composer
+[Packagist.org](https://packagist.org/) is the main Composer repository. A Composer
repository is basically a package source: a place where you can get packages
from. Packagist aims to be the central repository that everybody uses. This
means that you can automatically `require` any package that is available there,
without further specifying where Composer should look for the package.
-If you go to the [Packagist website](https://packagist.org/) (packagist.org),
+If you go to the [Packagist.org website](https://packagist.org/),
you can browse and search for packages.
Any open source project using Composer is recommended to publish their packages
@@ -211,7 +217,7 @@ available platform packages.
## Autoloading
For libraries that specify autoload information, Composer generates a
-`vendor/autoload.php` file. You can simply include this file and start
+`vendor/autoload.php` file. You can include this file and start
using the classes that those libraries provide without any extra work:
```php
@@ -219,7 +225,7 @@ require __DIR__ . '/vendor/autoload.php';
$log = new Monolog\Logger('name');
$log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING));
-$log->addWarning('Foo');
+$log->warning('Foo');
```
You can even add your own code to the autoloader by adding an
@@ -233,7 +239,7 @@ You can even add your own code to the autoloader by adding an
}
```
-Composer will register a [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloader
+Composer will register a [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloader
for the `Acme` namespace.
You define a mapping from namespaces to directories. The `src` directory would
@@ -241,8 +247,15 @@ be in your project root, on the same level as `vendor` directory is. An example
filename would be `src/Foo.php` containing an `Acme\Foo` class.
After adding the [`autoload`](04-schema.md#autoload) field, you have to re-run
-[`dump-autoload`](03-cli.md#dump-autoload) to re-generate the
-`vendor/autoload.php` file.
+this command:
+
+```sh
+php composer.phar dump-autoload
+```
+
+This command will re-generate the `vendor/autoload.php` file.
+See the [`dump-autoload`](03-cli.md#dump-autoload-dumpautoload-) section for
+more information.
Including that file will also return the autoloader instance, so you can store
the return value of the include call in a variable and add more namespaces.
diff --git a/app/vendor/composer/composer/doc/02-libraries.md b/app/vendor/composer/composer/doc/02-libraries.md
index e59f505dd..c731f105d 100644
--- a/app/vendor/composer/composer/doc/02-libraries.md
+++ b/app/vendor/composer/composer/doc/02-libraries.md
@@ -26,14 +26,14 @@ In this case the project name is `acme/hello-world`, where `acme` is the vendor
name. Supplying a vendor name is mandatory.
> **Note:** If you don't know what to use as a vendor name, your GitHub
-> username is usually a good bet. While package names are case insensitive, the
-> convention is all lowercase and dashes for word separation.
+> username is usually a good bet. Package names must be lowercase, and the
+> convention is to use dashes for word separation.
## Library Versioning
In the vast majority of cases, you will be maintaining your library using some
sort of version control system like git, svn, hg or fossil. In these cases,
-Composer infers versions from your VCS and you **should not** specify a version
+Composer infers versions from your VCS, and you **should not** specify a version
in your `composer.json` file. (See the [Versions article](articles/versions.md)
to learn about how Composer uses VCS branches and tags to resolve version
constraints.)
@@ -54,7 +54,7 @@ file:
### VCS Versioning
Composer uses your VCS's branch and tag features to resolve the version
-constraints you specify in your `require` field to specific sets of files.
+constraints you specify in your [`require`](04-schema.md#require) field to specific sets of files.
When determining valid available versions, Composer looks at all of your tags
and branches and translates their names into an internal list of options that
it then matches against the version constraint you provided.
@@ -69,7 +69,7 @@ can help your team to always test against the same dependency versions.
However, this lock file will not have any effect on other projects that depend
on it. It only has an effect on the main project.
-If you do not want to commit the lock file and you are using git, add it to
+If you do not want to commit the lock file, and you are using git, add it to
the `.gitignore`.
## Publishing to a VCS
@@ -142,9 +142,9 @@ Packagist is available automatically through Composer. Since
can depend on it without having to specify any additional repositories.
If we wanted to share `hello-world` with the world, we would publish it on
-Packagist as well. Doing so is really easy.
+Packagist as well.
-You simply visit [Packagist](https://packagist.org) and hit the "Submit"
+You visit [Packagist](https://packagist.org) and hit the "Submit"
button. This will prompt you to sign up if you haven't already, and then
allows you to submit the URL to your VCS repository, at which point Packagist
will start crawling it. Once it is done, your package will be available to
diff --git a/app/vendor/composer/composer/doc/03-cli.md b/app/vendor/composer/composer/doc/03-cli.md
index 0b46e04f5..c35eabb61 100644
--- a/app/vendor/composer/composer/doc/03-cli.md
+++ b/app/vendor/composer/composer/doc/03-cli.md
@@ -3,7 +3,7 @@
You've already learned how to use the command-line interface to do some
things. This chapter documents all the available commands.
-To get help from the command-line, simply call `composer` or `composer list`
+To get help from the command-line, call `composer` or `composer list`
to see the complete list of commands, then `--help` combined with any of those
can give you more information.
@@ -22,6 +22,8 @@ The following options are available with every command:
* **--quiet (-q):** Do not output any message.
* **--no-interaction (-n):** Do not ask any interactive question.
* **--no-plugins:** Disables plugins.
+* **--no-cache:** Disables the use of the cache directory. Same as setting the COMPOSER_CACHE_DIR
+ env var to /dev/null (or NUL on Windows).
* **--working-dir (-d):** If specified, use the given directory as working directory.
* **--profile:** Display timing and memory usage information
* **--ansi:** Force ANSI output.
@@ -37,8 +39,7 @@ The following options are available with every command:
## init
In the [Libraries](02-libraries.md) chapter we looked at how to create a
-`composer.json` by hand. There is also an `init` command available that makes
-it a bit easier to do this.
+`composer.json` by hand. There is also an `init` command available to do this.
When you run the command it will interactively ask you to fill in the fields,
while using some smart defaults.
@@ -64,6 +65,7 @@ php composer.phar init
the list of requires. Every repository can be either an HTTP URL pointing
to a `composer` repository or a JSON string which similar to what the
[repositories](04-schema.md#repositories) key accepts.
+* **--autoload (-a):** Add a PSR-4 autoload mapping to the composer.json. Automatically maps your package's namespace to the provided directory. (Expects a relative path, e.g. src/) See also [PSR-4 autoload](04-schema.md#psr-4).
## install / i
@@ -83,17 +85,14 @@ resolution.
### Options
-* **--prefer-source:** There are two ways of downloading a package: `source`
- and `dist`. For stable versions Composer will use the `dist` by default.
- The `source` is a version control repository. If `--prefer-source` is
- enabled, Composer will install from `source` if there is one. This is
- useful if you want to make a bugfix to a project and get a local git
- clone of the dependency directly.
-* **--prefer-dist:** Reverse of `--prefer-source`, Composer will install
- from `dist` if possible. This can speed up installs substantially on build
- servers and other use cases where you typically do not run updates of the
- vendors. It is also a way to circumvent problems with git if you do not
- have a proper setup.
+* **--prefer-install:** There are two ways of downloading a package: `source`
+ and `dist`. Composer uses `dist` by default. If you pass
+ `--prefer-install=source` (or `--prefer-source`) Composer will install from
+ `source` if there is one. This is useful if you want to make a bugfix to a
+ project and get a local git clone of the dependency directly.
+ To get the legacy behavior where Composer use `source` automatically for dev
+ versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install).
+ Passing this flag will override the config value.
* **--dry-run:** If you want to run through an installation without actually
installing a package, you can use `--dry-run`. This will simulate the
installation and show you what would happen.
@@ -104,16 +103,21 @@ resolution.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters.
-* **--no-suggest:** Skips suggested packages in the output.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
autoloader. This is recommended especially for production, but can take
a bit of time to run so it is currently not done by default.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes.
-* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
- requirements and force the installation even if the local machine does not
- fulfill these. See also the [`platform`](06-config.md#platform) config option.
+* **--apcu-autoloader-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu-autoloader`.
+* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and force the installation even if the local machine does
+ not fulfill these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
+ `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
+ does not fulfill it.
## update / u
@@ -138,40 +142,75 @@ php composer.phar update vendor/package vendor/package2
You can also use wildcards to update a bunch of packages at once:
```sh
-php composer.phar update vendor/*
+php composer.phar update "vendor/*"
```
+
+If you want to downgrade a package to a specific version without changing your
+composer.json you can use `--with` and provide a custom version constraint:
+
+```sh
+php composer.phar update --with vendor/package:2.0.1
+```
+
+The custom constraint has to be a subset of the existing constraint you have,
+and this feature is only available for your root package dependencies.
+
+If you only want to update the package(s) for which you provide custom constraints
+using `--with`, you can skip `--with` and just use constraints with the partial
+update syntax:
+
+```sh
+php composer.phar update vendor/package:2.0.1 vendor/package2:3.0.*
+```
+
+
### Options
-* **--prefer-source:** Install packages from `source` when available.
-* **--prefer-dist:** Install packages from `dist` when available.
+* **--prefer-install:** There are two ways of downloading a package: `source`
+ and `dist`. Composer uses `dist` by default. If you pass
+ `--prefer-install=source` (or `--prefer-source`) Composer will install from
+ `source` if there is one. This is useful if you want to make a bugfix to a
+ project and get a local git clone of the dependency directly.
+ To get the legacy behavior where Composer use `source` automatically for dev
+ versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install).
+ Passing this flag will override the config value.
* **--dry-run:** Simulate the command without actually doing anything.
* **--dev:** Install packages listed in `require-dev` (this is the default behavior).
* **--no-dev:** Skip installing packages listed in `require-dev`. The autoloader generation skips the `autoload-dev` rules.
+* **--no-install:** Does not run the install step after updating the composer.lock file.
* **--lock:** Only updates the lock file hash to suppress warning about the
lock file being out of date.
+* **--with:** Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0
* **--no-autoloader:** Skips autoloader generation.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters.
-* **--no-suggest:** Skips suggested packages in the output.
-* **--with-dependencies:** Add also dependencies of whitelisted packages to the whitelist, except those that are root requirements.
-* **--with-all-dependencies:** Add also all dependencies of whitelisted packages to the whitelist, including those that are root requirements.
+* **--with-dependencies (-w):** Update also dependencies of packages in the argument list, except those which are root requirements.
+* **--with-all-dependencies (-W):** Update also dependencies of packages in the argument list, including those which are root requirements.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
autoloader. This is recommended especially for production, but can take
- a bit of time to run so it is currently not done by default.
+ a bit of time to run, so it is currently not done by default.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes.
-* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
- requirements and force the installation even if the local machine does not
- fulfill these. See also the [`platform`](06-config.md#platform) config option.
+* **--apcu-autoloader-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu-autoloader`.
+* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and force the installation even if the local machine does
+ not fulfill these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
+ `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
+ does not fulfill it.
* **--prefer-stable:** Prefer stable versions of dependencies.
* **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal
versions of requirements, generally used with `--prefer-stable`.
* **--interactive:** Interactive interface with autocompletion to select the packages to update.
* **--root-reqs:** Restricts the update to your first degree dependencies.
+Specifying one of the words `mirrors`, `lock`, or `nothing` as an argument has the same effect as specifying the option `--lock`, for example `composer update mirrors` is exactly the same as `composer update --lock`.
+
## require
The `require` command adds new packages to the `composer.json` file from
@@ -188,7 +227,7 @@ If you do not want to choose requirements interactively, you can pass them
to the command.
```sh
-php composer.phar require vendor/package:2.* vendor/package2:dev-master
+php composer.phar require "vendor/package:2.*" vendor/package2:dev-master
```
If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of matches to require.
@@ -196,29 +235,42 @@ If you do not specify a package, composer will prompt you to search for a packag
### Options
* **--dev:** Add packages to `require-dev`.
-* **--prefer-source:** Install packages from `source` when available.
-* **--prefer-dist:** Install packages from `dist` when available.
+* **--dry-run:** Simulate the command without actually doing anything.
+* **--prefer-install:** There are two ways of downloading a package: `source`
+ and `dist`. Composer uses `dist` by default. If you pass
+ `--prefer-install=source` (or `--prefer-source`) Composer will install from
+ `source` if there is one. This is useful if you want to make a bugfix to a
+ project and get a local git clone of the dependency directly.
+ To get the legacy behavior where Composer use `source` automatically for dev
+ versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install).
+ Passing this flag will override the config value.
* **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters.
-* **--no-suggest:** Skips suggested packages in the output.
-* **--no-update:** Disables the automatic update of the dependencies.
+* **--no-update:** Disables the automatic update of the dependencies (implies --no-install).
+* **--no-install:** Does not run the install step after updating the composer.lock file.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--update-no-dev:** Run the dependency update with the `--no-dev` option.
-* **--update-with-dependencies:** Also update dependencies of the newly required packages, except those that are root requirements.
-* **--update-with-all-dependencies:** Also update dependencies of the newly required packages, including those that are root requirements.
-* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
- requirements and force the installation even if the local machine does not
- fulfill these. See also the [`platform`](06-config.md#platform) config option.
+* **--update-with-dependencies (-w):** Also update dependencies of the newly required packages, except those that are root requirements.
+* **--update-with-all-dependencies (-W):** Also update dependencies of the newly required packages, including those that are root requirements.
+* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and force the installation even if the local machine does
+ not fulfill these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
+ `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
+ does not fulfill it.
* **--prefer-stable:** Prefer stable versions of dependencies.
* **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal
versions of requirements, generally used with `--prefer-stable`.
* **--sort-packages:** Keep packages sorted in `composer.json`.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to
get a faster autoloader. This is recommended especially for production, but
- can take a bit of time to run so it is currently not done by default.
+ can take a bit of time to run, so it is currently not done by default.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes.
+* **--apcu-autoloader-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu-autoloader`.
## remove
@@ -234,21 +286,79 @@ uninstalled.
### Options
* **--dev:** Remove packages from `require-dev`.
+* **--dry-run:** Simulate the command without actually doing anything.
* **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters.
-* **--no-update:** Disables the automatic update of the dependencies.
+* **--no-update:** Disables the automatic update of the dependencies (implies --no-install).
+* **--no-install:** Does not run the install step after updating the composer.lock file.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--update-no-dev:** Run the dependency update with the --no-dev option.
-* **--update-with-dependencies:** Also update dependencies of the removed packages.
-* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
- requirements and force the installation even if the local machine does not
- fulfill these. See also the [`platform`](06-config.md#platform) config option.
+* **--update-with-dependencies (-w):** Also update dependencies of the removed packages.
+ (Deprecated, is now default behavior)
+* **--update-with-all-dependencies (-W):** Allows all inherited dependencies to be updated,
+ including those that are root requirements.
+* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and force the installation even if the local machine does
+ not fulfill these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
+ `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
+ does not fulfill it.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to
get a faster autoloader. This is recommended especially for production, but
can take a bit of time to run so it is currently not done by default.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes.
+* **--apcu-autoloader-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu-autoloader`.
+
+## reinstall
+
+The `reinstall` command looks up installed packages by name,
+uninstalls them and reinstalls them. This lets you do a clean install
+of a package if you messed with its files, or if you wish to change
+the installation type using --prefer-install.
+
+```sh
+php composer.phar reinstall acme/foo acme/bar
+```
+
+You can specify more than one package name to reinstall, or use a
+wildcard to select several packages at once:
+
+```sh
+php composer.phar reinstall "acme/*"
+```
+
+### Options
+
+* **--prefer-install:** There are two ways of downloading a package: `source`
+ and `dist`. Composer uses `dist` by default. If you pass
+ `--prefer-install=source` (or `--prefer-source`) Composer will install from
+ `source` if there is one. This is useful if you want to make a bugfix to a
+ project and get a local git clone of the dependency directly.
+ To get the legacy behavior where Composer use `source` automatically for dev
+ versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install).
+ Passing this flag will override the config value.
+* **--no-autoloader:** Skips autoloader generation.
+* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
+* **--no-progress:** Removes the progress display that can mess with some
+ terminals or scripts which don't handle backspace characters.
+* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
+ autoloader. This is recommended especially for production, but can take
+ a bit of time to run so it is currently not done by default.
+* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
+ Implicitly enables `--optimize-autoloader`.
+* **--apcu-autoloader:** Use APCu to cache found/not-found classes.
+* **--apcu-autoloader-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu-autoloader`.
+* **--ignore-platform-reqs:** ignore all platform requirements. This only
+ has an effect in the context of the autoloader generation for the
+ reinstall command.
+* **--ignore-platform-req:** ignore a specific platform requirement. This only
+ has an effect in the context of the autoloader generation for the
+ reinstall command.
## check-platform-reqs
@@ -257,6 +367,10 @@ match the platform requirements of the installed packages. This can be used
to verify that a production server has all the extensions needed to run a
project after installing it for example.
+Unlike update/install, this command will ignore config.platform settings and
+check the real platform packages so you can be certain you have the required
+platform dependencies.
+
## global
The global command allows you to run other commands like `install`, `remove`, `require`
@@ -289,8 +403,8 @@ php composer.phar global update
## search
The search command allows you to search through the current project's package
-repositories. Usually this will be packagist. You simply pass it the
-terms you want to search for.
+repositories. Usually this will be packagist. You pass it the terms you want
+to search for.
```sh
php composer.phar search monolog
@@ -302,6 +416,11 @@ You can also search for more than one term by passing multiple arguments.
* **--only-name (-N):** Search only in name.
* **--type (-t):** Search for a specific package type.
+* **--format (-f):** Lets you pick between text (default) or json output format.
+ Note that in the json, only the name and description keys are guaranteed to be
+ present. The rest (`url`, `repository`, `downloads` and `favers`) are available
+ for Packagist.org search results and other repositories may return more or less
+ data.
## show
@@ -352,6 +471,7 @@ php composer.phar show monolog/monolog 1.0.2
* **--all :** List all packages available in all your repositories.
* **--installed (-i):** List the packages that are installed (this is enabled by default, and deprecated).
+* **--locked:** List the locked packages from composer.lock.
* **--platform (-p):** List only platform packages (php & extensions).
* **--available (-a):** List available packages only.
* **--self (-s):** List the root package info.
@@ -360,6 +480,7 @@ php composer.phar show monolog/monolog 1.0.2
* **--tree (-t):** List your dependencies as a tree. If you pass a package name it will show the dependency tree for that package.
* **--latest (-l):** List all installed packages including their latest version.
* **--outdated (-o):** Implies --latest, but this lists *only* packages that have a newer version available.
+* **--no-dev:** Filters dev dependencies from the package list.
* **--minor-only (-m):** Use with --latest. Only shows packages that have minor SemVer-compatible updates.
* **--direct (-D):** Restricts the list of packages to your direct dependencies.
* **--strict:** Return a non-zero exit code when there are outdated packages.
@@ -374,7 +495,7 @@ including their current and latest versions. This is basically an alias for
The color coding is as such:
- **green (=)**: Dependency is in the latest version and is up to date.
-- **yellow (~)**: Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade when
+- **yellow (`~`)**: Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade when
you can but it may involve work.
- **red (!)**: Dependency has a new version that is semver-compatible and you should upgrade it.
@@ -385,6 +506,8 @@ The color coding is as such:
* **--strict:** Returns non-zero exit code if any package is outdated.
* **--minor-only (-m):** Only shows packages that have minor SemVer-compatible updates.
* **--format (-f):** Lets you pick between text (default) or json output format.
+* **--no-dev:** Do not show outdated dev dependencies.
+* **--locked:** Shows updates for packages from the lock file, regardless of what is currently in vendor dir.
## browse / home
@@ -402,18 +525,30 @@ Lists all packages suggested by currently installed set of packages. You can
optionally pass one or multiple package names in the format of `vendor/package`
to limit output to suggestions made by those packages only.
-Use the `--by-package` or `--by-suggestion` flags to group the output by
+Use the `--by-package` (default) or `--by-suggestion` flags to group the output by
the package offering the suggestions or the suggested packages respectively.
-Use the `--verbose (-v)` flag to display the suggesting package and the suggestion reason.
-This implies `--by-package --by-suggestion`, showing both lists.
+If you only want a list of suggested package names, use `--list`.
### Options
-* **--by-package:** Groups output by suggesting package.
+* **--by-package:** Groups output by suggesting package (default).
* **--by-suggestion:** Groups output by suggested package.
+* **--all:** Show suggestions from all dependencies, including transitive ones (by
+ default only direct dependencies' suggestions are shown).
+* **--list:** Show only list of suggested package names.
* **--no-dev:** Excludes suggestions from `require-dev` packages.
+## fund
+
+Discover how to help fund the maintenance of your dependencies. This lists
+all funding links from the installed dependencies. Use `--format=json` to
+get machine-readable output.
+
+### Options
+
+* **--format (-f):** Lets you pick between text (default) or json output format.
+
## depends (why)
The `depends` command tells you which other packages depend on a certain
@@ -491,7 +626,7 @@ php composer.phar validate
### Options
-* **--no-check-all:** Do not emit a warning if requirements in `composer.json` use unbound version constraints.
+* **--no-check-all:** Do not emit a warning if requirements in `composer.json` use unbound or overly strict version constraints.
* **--no-check-lock:** Do not emit an error if `composer.lock` exists and is not up to date.
* **--no-check-publish:** Do not emit an error if `composer.json` is unsuitable for publishing as a package on Packagist but is otherwise valid.
* **--with-dependencies:** Also validate the composer.json of all installed dependencies.
@@ -527,7 +662,7 @@ command. It will replace your `composer.phar` with the latest version.
php composer.phar self-update
```
-If you would like to instead update to a specific release simply specify it:
+If you would like to instead update to a specific release specify it:
```sh
php composer.phar self-update 1.0.0-alpha7
@@ -540,6 +675,9 @@ you may have to run the command with `root` privileges
sudo -H composer self-update
```
+If Composer was not installed as a PHAR, this command is not available.
+(This is sometimes the case when Composer was installed by an operating system package manager.)
+
### Options
* **--rollback (-r):** Rollback to the last version you had installed.
@@ -550,6 +688,9 @@ sudo -H composer self-update
* **--stable:** Force an update to the stable channel.
* **--preview:** Force an update to the preview channel.
* **--snapshot:** Force an update to the snapshot channel.
+* **--1:** Force an update to the stable channel, but only use 1.x versions
+* **--2:** Force an update to the stable channel, but only use 2.x versions
+* **--set-channel-only:** Only store the channel as the default one and then exit
## config
@@ -591,8 +732,10 @@ See the [Config](06-config.md) chapter for valid configuration options.
option this lists the global configuration only.
* **--file="..." (-f):** Operate on a specific file instead of composer.json. Note
that this cannot be used in conjunction with the `--global` option.
-* **--absolute:** Returns absolute paths when fetching *-dir config values
+* **--absolute:** Returns absolute paths when fetching `*-dir` config values
instead of relative.
+* **--json:** JSON decode the setting value, to be used with `extra.*` keys.
+* **--merge:** Merge the setting value with the current value, to be used with `extra.*` keys in combination with `--json`.
### Modifying Repositories
@@ -621,6 +764,13 @@ php composer.phar config extra.foo.bar value
The dots indicate array nesting, a max depth of 3 levels is allowed though. The above
would set `"extra": { "foo": { "bar": "value" } }`.
+If you have a complex value to add/modify, you can use the `--json` and `--merge` flags
+to edit extra fields as json:
+
+```sh
+php composer.phar config --json extra.foo.bar '{"baz": true, "qux": []}'
+```
+
## create-project
You can use Composer to create new projects from an existing package. This is
@@ -641,7 +791,7 @@ provide a version as third argument, otherwise the latest version is used.
If the directory does not currently exist, it will be created during installation.
```sh
-php composer.phar create-project doctrine/orm path 2.2.*
+php composer.phar create-project doctrine/orm path "2.2.*"
```
It is also possible to run the command without params in a directory with an
@@ -652,13 +802,21 @@ By default the command checks for the packages on packagist.org.
### Options
* **--stability (-s):** Minimum stability of package. Defaults to `stable`.
-* **--prefer-source:** Install packages from `source` when available.
-* **--prefer-dist:** Install packages from `dist` when available.
+* **--prefer-install:** There are two ways of downloading a package: `source`
+ and `dist`. Composer uses `dist` by default. If you pass
+ `--prefer-install=source` (or `--prefer-source`) Composer will install from
+ `source` if there is one. This is useful if you want to make a bugfix to a
+ project and get a local git clone of the dependency directly.
+ To get the legacy behavior where Composer use `source` automatically for dev
+ versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install).
+ Passing this flag will override the config value.
* **--repository:** Provide a custom repository to search for the package,
which will be used instead of packagist. Can be either an HTTP URL pointing
to a `composer` repository, a path to a local `packages.json` file, or a
JSON string which similar to what the [repositories](04-schema.md#repositories)
- key accepts.
+ key accepts. You can use this multiple times to configure multiple repositories.
+* **--add-repository:** Add the custom repository in the composer.json. If a lock
+ file is present it will be deleted and an update will be run instead of install.
* **--dev:** Install packages listed in `require-dev`.
* **--no-dev:** Disables installation of require-dev packages.
* **--no-scripts:** Disables the execution of the scripts defined in the root
@@ -673,9 +831,14 @@ By default the command checks for the packages on packagist.org.
mode.
* **--remove-vcs:** Force-remove the VCS metadata without prompting.
* **--no-install:** Disables installation of the vendors.
-* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
- requirements and force the installation even if the local machine does not
- fulfill these.
+* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and force the installation even if the local machine does
+ not fulfill these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement(`php`,
+ `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine
+ does not fulfill it.
+* **--ask:** Ask user to provide target directory for new project.
## dump-autoload (dumpautoload)
@@ -694,24 +857,34 @@ performance.
* **--no-scripts:** Skips the execution of all scripts defined in `composer.json` file.
* **--optimize (-o):** Convert PSR-0/4 autoloading to classmap to get a faster
autoloader. This is recommended especially for production, but can take
- a bit of time to run so it is currently not done by default.
+ a bit of time to run, so it is currently not done by default.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize`.
* **--apcu:** Use APCu to cache found/not-found classes.
-* **--no-dev:** Disables autoload-dev rules.
-
-## clear-cache (clearcache)
+* **--apcu-prefix:** Use a custom prefix for the APCu autoloader cache.
+ Implicitly enables `--apcu`.
+* **--no-dev:** Disables autoload-dev rules. Composer will by default infer this
+ automatically according to the last `install` or `update` `--no-dev` state.
+* **--dev:** Enables autoload-dev rules. Composer will by default infer this
+ automatically according to the last `install` or `update` `--no-dev` state.
+* **--ignore-platform-reqs:** ignore all `php`, `hhvm`, `lib-*` and `ext-*`
+ requirements and skip the [platform check](07-runtime.md#platform-check) for these.
+ See also the [`platform`](06-config.md#platform) config option.
+* **--ignore-platform-req:** ignore a specific platform requirement (`php`, `hhvm`,
+ `lib-*` and `ext-*`) and skip the [platform check](07-runtime.md#platform-check) for it.
+
+## clear-cache / clearcache / cc
Deletes all content from Composer's cache directories.
## licenses
Lists the name, version and license of every package installed. Use
-`--format=json` to get machine readable output.
+`--format=json` to get machine-readable output.
### Options
-* **--format:** Format of the output: text or json (default: "text")
+* **--format:** Format of the output: text, json or summary (default: "text")
* **--no-dev:** Remove dev dependencies from the output
## run-script
@@ -796,58 +969,49 @@ COMPOSER=composer-other.json php composer.phar install
The generated lock file will use the same name: `composer-other.lock` in this example.
-### COMPOSER_ROOT_VERSION
+### COMPOSER_ALLOW_SUPERUSER
-By setting this var you can specify the version of the root package, if it can
-not be guessed from VCS info and is not present in `composer.json`.
+If set to 1, this env disables the warning about running commands as root/super user.
+It also disables automatic clearing of sudo sessions, so you should really only set this
+if you use Composer as super user at all times like in docker containers.
-### COMPOSER_VENDOR_DIR
+### COMPOSER_ALLOW_XDEBUG
-By setting this var you can make Composer install the dependencies into a
-directory other than `vendor`.
+If set to 1, this env allows running Composer when the Xdebug extension is enabled, without restarting PHP without it.
+
+### COMPOSER_AUTH
+
+The `COMPOSER_AUTH` var allows you to set up authentication as an environment variable.
+The contents of the variable should be a JSON formatted object containing [http-basic,
+github-oauth, bitbucket-oauth, ... objects as needed](articles/authentication-for-private-packages.md),
+and following the
+[spec from the config](06-config.md).
### COMPOSER_BIN_DIR
By setting this option you can change the `bin` ([Vendor Binaries](articles/vendor-binaries.md))
directory to something other than `vendor/bin`.
-### http_proxy or HTTP_PROXY
-
-If you are using Composer from behind an HTTP proxy, you can use the standard
-`http_proxy` or `HTTP_PROXY` env vars. Simply set it to the URL of your proxy.
-Many operating systems already set this variable for you.
+### COMPOSER_CACHE_DIR
-Using `http_proxy` (lowercased) or even defining both might be preferable since
-some tools like git or curl will only use the lower-cased `http_proxy` version.
-Alternatively you can also define the git proxy using
-`git config --global http.proxy `.
+The `COMPOSER_CACHE_DIR` var allows you to change the Composer cache directory,
+which is also configurable via the [`cache-dir`](06-config.md#cache-dir) option.
-If you are using Composer in a non-CLI context (i.e. integration into a CMS or
-similar use case), and need to support proxies, please provide the `CGI_HTTP_PROXY`
-environment variable instead. See [httpoxy.org](https://httpoxy.org/) for further
-details.
+By default, it points to `$COMPOSER_HOME/cache` on \*nix and macOS, and
+`C:\Users\\AppData\Local\Composer` (or `%LOCALAPPDATA%/Composer`) on Windows.
-### no_proxy or NO_PROXY
+### COMPOSER_CAFILE
-If you are behind a proxy and would like to disable it for certain domains, you
-can use the `no_proxy` or `NO_PROXY` env var. Simply set it to a comma separated list of
-domains the proxy should *not* be used for.
+By setting this environmental value, you can set a path to a certificate bundle
+file to be used during SSL/TLS peer verification.
-The env var accepts domains, IP addresses, and IP address blocks in CIDR
-notation. You can restrict the filter to a particular port (e.g. `:80`). You
-can also set it to `*` to ignore the proxy for all HTTP requests.
+### COMPOSER_DISABLE_XDEBUG_WARN
-### HTTP_PROXY_REQUEST_FULLURI
+If set to 1, this env suppresses a warning when Composer is running with the Xdebug extension enabled.
-If you use a proxy but it does not support the request_fulluri flag, then you
-should set this env var to `false` or `0` to prevent Composer from setting the
-request_fulluri option.
-
-### HTTPS_PROXY_REQUEST_FULLURI
+### COMPOSER_DISCARD_CHANGES
-If you use a proxy but it does not support the request_fulluri flag for HTTPS
-requests, then you should set this env var to `false` or `0` to prevent Composer
-from setting the request_fulluri option.
+This env var controls the [`discard-changes`](06-config.md#discard-changes) config option.
### COMPOSER_HOME
@@ -855,10 +1019,12 @@ The `COMPOSER_HOME` var allows you to change the Composer home directory. This
is a hidden, global (per-user on the machine) directory that is shared between
all projects.
-By default it points to `C:\Users\\AppData\Roaming\Composer` on Windows
-and `/Users//.composer` on OSX. On *nix systems that follow the [XDG Base
+Use `composer config --global home` to see the location of the home directory.
+
+By default, it points to `C:\Users\\AppData\Roaming\Composer` on Windows
+and `/Users//.composer` on macOS. On \*nix systems that follow the [XDG Base
Directory Specifications](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html),
-it points to `$XDG_CONFIG_HOME/composer`. On other *nix systems, it points to
+it points to `$XDG_CONFIG_HOME/composer`. On other \*nix systems, it points to
`/home//.composer`.
#### COMPOSER_HOME/config.json
@@ -873,59 +1039,110 @@ This file allows you to set [repositories](05-repositories.md) and
In case global configuration matches _local_ configuration, the _local_
configuration in the project's `composer.json` always wins.
-### COMPOSER_CACHE_DIR
+### COMPOSER_HTACCESS_PROTECT
-The `COMPOSER_CACHE_DIR` var allows you to change the Composer cache directory,
-which is also configurable via the [`cache-dir`](06-config.md#cache-dir) option.
+Defaults to `1`. If set to `0`, Composer will not create `.htaccess` files in the
+composer home, cache, and data directories.
-By default it points to `$COMPOSER_HOME/cache` on \*nix and OSX, and
-`C:\Users\\AppData\Local\Composer` (or `%LOCALAPPDATA%/Composer`) on Windows.
+### COMPOSER_MEMORY_LIMIT
+
+If set, the value is used as php's memory_limit.
+
+### COMPOSER_MIRROR_PATH_REPOS
+
+If set to 1, this env changes the default path repository strategy to `mirror` instead
+of `symlink`. As it is the default strategy being set it can still be overwritten by
+repository options.
+
+### COMPOSER_NO_INTERACTION
+
+If set to 1, this env var will make Composer behave as if you passed the
+`--no-interaction` flag to every command. This can be set on build boxes/CI.
### COMPOSER_PROCESS_TIMEOUT
This env var controls the time Composer waits for commands (such as git
commands) to finish executing. The default value is 300 seconds (5 minutes).
-### COMPOSER_CAFILE
+### COMPOSER_ROOT_VERSION
-By setting this environmental value, you can set a path to a certificate bundle
-file to be used during SSL/TLS peer verification.
+By setting this var you can specify the version of the root package, if it
+cannot be guessed from VCS info and is not present in `composer.json`.
-### COMPOSER_AUTH
+### COMPOSER_VENDOR_DIR
-The `COMPOSER_AUTH` var allows you to set up authentication as an environment variable.
-The contents of the variable should be a JSON formatted object containing http-basic,
-github-oauth, bitbucket-oauth, ... objects as needed, and following the
-[spec from the config](06-config.md#gitlab-oauth).
+By setting this var you can make Composer install the dependencies into a
+directory other than `vendor`.
-### COMPOSER_DISCARD_CHANGES
+### COMPOSER_RUNTIME_ENV
-This env var controls the [`discard-changes`](06-config.md#discard-changes) config option.
+This lets you hint under which environment Composer is running, which can help Composer
+work around some environment specific issues. The only value currently supported is
+`virtualbox`, which then enables some short `sleep()` calls to wait for the filesystem
+to have written files properly before we attempt reading them. You can set the
+environment variable if you use Vagrant or VirtualBox and experience issues with files not
+being found during installation even though they should be present.
-### COMPOSER_NO_INTERACTION
+### http_proxy or HTTP_PROXY
-If set to 1, this env var will make Composer behave as if you passed the
-`--no-interaction` flag to every command. This can be set on build boxes/CI.
+If you are using Composer from behind an HTTP proxy, you can use the standard
+`http_proxy` or `HTTP_PROXY` env vars. Set it to the URL of your proxy.
+Many operating systems already set this variable for you.
-### COMPOSER_ALLOW_SUPERUSER
+Using `http_proxy` (lowercased) or even defining both might be preferable since
+some tools like git or curl will only use the lower-cased `http_proxy` version.
+Alternatively you can also define the git proxy using
+`git config --global http.proxy `.
-If set to 1, this env disables the warning about running commands as root/super user.
-It also disables automatic clearing of sudo sessions, so you should really only set this
-if you use Composer as super user at all times like in docker containers.
+If you are using Composer in a non-CLI context (i.e. integration into a CMS or
+similar use case), and need to support proxies, please provide the `CGI_HTTP_PROXY`
+environment variable instead. See [httpoxy.org](https://httpoxy.org/) for further
+details.
-### COMPOSER_MEMORY_LIMIT
+### COMPOSER_MAX_PARALLEL_HTTP
-If set, the value is used as php's memory_limit.
+Set to an integer to configure how many files can be downloaded in parallel. This
+defaults to 12 and must be between 1 and 50. If your proxy has issues with
+concurrency maybe you want to lower this. Increasing it should generally not result
+in performance gains.
-### COMPOSER_MIRROR_PATH_REPOS
+### HTTP_PROXY_REQUEST_FULLURI
-If set to 1, this env changes the default path repository strategy to `mirror` instead
-of `symlink`. As it is the default strategy being set it can still be overwritten by
-repository options.
+If you use a proxy, but it does not support the request_fulluri flag, then you
+should set this env var to `false` or `0` to prevent Composer from setting the
+request_fulluri option.
-### COMPOSER_HTACCESS_PROTECT
+### HTTPS_PROXY_REQUEST_FULLURI
-Defaults to `1`. If set to `0`, Composer will not create `.htaccess` files in the
-composer home, cache, and data directories.
+If you use a proxy, but it does not support the request_fulluri flag for HTTPS
+requests, then you should set this env var to `false` or `0` to prevent Composer
+from setting the request_fulluri option.
+
+### COMPOSER_SELF_UPDATE_TARGET
+
+If set, makes the self-update command write the new Composer phar file into that path instead of overwriting itself. Useful for updating Composer on read-only filesystem.
+
+### no_proxy or NO_PROXY
+
+If you are behind a proxy and would like to disable it for certain domains, you
+can use the `no_proxy` or `NO_PROXY` env var. Set it to a comma separated list of
+domains the proxy should *not* be used for.
+
+The env var accepts domains, IP addresses, and IP address blocks in CIDR
+notation. You can restrict the filter to a particular port (e.g. `:80`). You
+can also set it to `*` to ignore the proxy for all HTTP requests.
+
+### COMPOSER_DISABLE_NETWORK
+
+If set to `1`, disables network access (best effort). This can be used for debugging or
+to run Composer on a plane or a starship with poor connectivity.
+
+If set to `prime`, GitHub VCS repositories will prime the cache, so it can then be used
+fully offline with `1`.
+
+### COMPOSER_DEBUG_EVENTS
+
+If set to `1`, outputs information about events being dispatched, which can be
+useful for plugin authors to identify what is firing when exactly.
← [Libraries](02-libraries.md) | [Schema](04-schema.md) →
diff --git a/app/vendor/composer/composer/doc/04-schema.md b/app/vendor/composer/composer/doc/04-schema.md
index 42addb10f..849e5ee68 100644
--- a/app/vendor/composer/composer/doc/04-schema.md
+++ b/app/vendor/composer/composer/doc/04-schema.md
@@ -1,10 +1,10 @@
-# The composer.json Schema
+# The composer.json schema
This chapter will explain all of the fields available in `composer.json`.
## JSON schema
-We have a [JSON schema](http://json-schema.org) that documents the format and
+We have a [JSON schema](https://json-schema.org) that documents the format and
can also be used to validate your `composer.json`. In fact, it is used by the
`validate` command. You can find it at: https://getcomposer.org/schema.json
@@ -34,12 +34,12 @@ separated by `/`. Examples:
* monolog/monolog
* igorw/event-source
-The name can contain any character, including white spaces, and it's case
-insensitive (`foo/bar` and `Foo/Bar` are considered the same package). In order
-to simplify its installation, it's recommended to define a short and lowercase
-name that doesn't include non-alphanumeric characters or white spaces.
+The name must be lowercased and consist of words separated by `-`, `.` or `_`.
+The complete name should match `^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$`.
-Required for published packages (libraries).
+The `name` property is required for published packages (libraries).
+
+> **Note:** Before Composer version 2.0, a name could contain any character, including white spaces.
### description
@@ -88,7 +88,7 @@ installer capable of installing packages of that type.
Out of the box, Composer supports four types:
-- **library:** This is the default. It will simply copy the files to `vendor`.
+- **library:** This is the default. It will copy the files to `vendor`.
- **project:** This denotes a project rather than a library. For example
application shells like the [Symfony standard edition](https://github.com/symfony/symfony-standard),
CMSs like the [SilverStripe installer](https://github.com/silverstripe/silverstripe-installer)
@@ -123,7 +123,7 @@ Optional.
### homepage
-An URL to the website of the project.
+A URL to the website of the project.
Optional.
@@ -160,7 +160,7 @@ The recommended notation for the most common licenses is (alphabetical):
Optional, but it is highly recommended to supply this. More identifiers are
listed at the [SPDX Open Source License Registry](https://spdx.org/licenses/).
-For closed-source software, you may use `"proprietary"` as the license identifier.
+> **Note:** For closed-source software, you may use `"proprietary"` as the license identifier.
An Example:
@@ -184,7 +184,7 @@ An Example for disjunctive licenses:
}
```
-Alternatively they can be separated with "or" and enclosed in parenthesis;
+Alternatively they can be separated with "or" and enclosed in parentheses;
```json
{
@@ -192,8 +192,8 @@ Alternatively they can be separated with "or" and enclosed in parenthesis;
}
```
-Similarly when multiple licenses need to be applied ("conjunctive license"),
-they should be separated with "and" and enclosed in parenthesis.
+Similarly, when multiple licenses need to be applied ("conjunctive license"),
+they should be separated with "and" and enclosed in parentheses.
### authors
@@ -214,7 +214,7 @@ An example:
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de",
+ "homepage": "https://www.naderman.de",
"role": "Developer"
},
{
@@ -243,6 +243,7 @@ Support information includes the following:
* **source:** URL to browse or download the sources.
* **docs:** URL to the documentation.
* **rss:** URL to the RSS feed.
+* **chat:** URL to the chat channel.
An example:
@@ -257,6 +258,39 @@ An example:
Optional.
+### funding
+
+A list of URLs to provide funding to the package authors for maintenance and
+development of new functionality.
+
+Each entry consists of the following
+
+* **type:** The type of funding, or the platform through which funding can be provided, e.g. patreon, opencollective, tidelift or github.
+* **url:** URL to a website with details, and a way to fund the package.
+
+An example:
+
+```json
+{
+ "funding": [
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/phpdoctrine"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/subscription/pkg/packagist-doctrine_doctrine-bundle"
+ },
+ {
+ "type": "other",
+ "url": "https://www.doctrine-project.org/sponsorship.html"
+ }
+ ]
+}
+```
+
+Optional.
+
### Package links
All of the following take an object which maps package names to
@@ -275,10 +309,11 @@ Example:
All links are optional fields.
-`require` and `require-dev` additionally support stability flags ([root-only](04-schema.md#root-package)).
+`require` and `require-dev` additionally support _stability flags_ ([root-only](04-schema.md#root-package)).
+They take the form "_constraint_@_stability flag_".
These allow you to further restrict or expand the stability of a package beyond
the scope of the [minimum-stability](#minimum-stability) setting. You can apply
-them to a constraint, or apply them to an empty constraint if you want to
+them to a constraint, or apply them to an empty _constraint_ if you want to
allow unstable packages of a dependency for example.
Example:
@@ -347,7 +382,7 @@ Example:
```json
{
"require" : {
- "php" : "^5.5 || ^7.0",
+ "php" : ">=7.4",
"ext-mbstring": "*"
}
}
@@ -366,19 +401,19 @@ Example:
#### require
-Lists packages required by this package. The package will not be installed
+Map of packages required by this package. The package will not be installed
unless those requirements can be met.
#### require-dev ([root-only](04-schema.md#root-package))
-Lists packages required for developing this package, or running
+Map of packages required for developing this package, or running
tests, etc. The dev requirements of the root package are installed by default.
Both `install` or `update` support the `--no-dev` option that prevents dev
dependencies from being installed.
#### conflict
-Lists packages that conflict with this version of this package. They
+Map of packages that conflict with this version of this package. They
will not be allowed to be installed together with your package.
Note that when specifying ranges like `<1.0 >=1.1` in a `conflict` link,
@@ -388,7 +423,7 @@ probably want to go for `<1.0 || >=1.1` in this case.
#### replace
-Lists packages that are replaced by this package. This allows you to fork a
+Map of packages that are replaced by this package. This allows you to fork a
package, publish it under a different name with its own version numbers, while
packages requiring the original package continue to work with your fork because
it replaces the original package.
@@ -406,10 +441,18 @@ that exact version, and not any other version, which would be incorrect.
#### provide
-List of other packages that are provided by this package. This is mostly
-useful for common interfaces. A package could depend on some virtual
-`logger` package, any library that implements this logger interface would
-simply list it in `provide`.
+Map of packages that are provided by this package. This is mostly
+useful for implementations of common interfaces. A package could depend on
+some virtual package e.g. `psr/logger-implementation`, any library that implements
+this logger interface would list it in `provide`. Implementors can then
+be [found on Packagist.org](https://packagist.org/providers/psr/log-implementation).
+
+Using `provide` with the name of an actual package rather than a virtual one
+implies that the code of that package is also shipped, in which case `replace`
+is generally a better choice. A common convention for packages providing an
+interface and relying on other packages to provide an implementation (for
+instance the PSR interfaces) is to use a `-implementation` suffix for the
+name of the virtual package corresponding to the interface package.
#### suggest
@@ -436,7 +479,7 @@ Example:
Autoload mapping for a PHP autoloader.
-[`PSR-4`](http://www.php-fig.org/psr/psr-4/) and [`PSR-0`](http://www.php-fig.org/psr/psr-0/)
+[`PSR-4`](https://www.php-fig.org/psr/psr-4/) and [`PSR-0`](http://www.php-fig.org/psr/psr-0/)
autoloading, `classmap` generation and `files` includes are supported.
PSR-4 is the recommended way since it offers greater ease of use (no need
@@ -575,6 +618,18 @@ Example:
}
```
+Wildcards (`*`) are also supported in a classmap paths, and expand to match any directory name:
+
+Example:
+
+```json
+{
+ "autoload": {
+ "classmap": ["src/addons/*/lib/", "3rd-party/*", "Something.php"]
+ }
+}
+```
+
#### Files
If you want to require certain files explicitly on every request then you can use
@@ -728,15 +783,13 @@ ignored.
The following repository types are supported:
-* **composer:** A Composer repository is simply a `packages.json` file served
+* **composer:** A Composer repository is a `packages.json` file served
via the network (HTTP, FTP, SSH), that contains a list of `composer.json`
objects with additional `dist` and/or `source` information. The `packages.json`
file is loaded using a PHP stream. You can set extra options on that stream
using the `options` parameter.
* **vcs:** The version control system repository can fetch packages from git,
svn, fossil and hg repositories.
-* **pear:** With this you can import any pear repository into your Composer
- project.
* **package:** If you depend on a project that does not have any support for
composer whatsoever you can define the package inline using a `package`
repository. You basically inline the `composer.json` object.
@@ -765,10 +818,6 @@ Example:
"type": "vcs",
"url": "https://github.com/Seldaek/monolog"
},
- {
- "type": "pear",
- "url": "https://pear2.php.net"
- },
{
"type": "package",
"package": {
@@ -848,6 +897,21 @@ A set of options for creating package archives.
The following options are supported:
+* **name:** Allows configuring base name for archive.
+ By default (if not configured, and `--file` is not passed as command-line argument),
+ `preg_replace('#[^a-z0-9-_]#i', '-', name)` is used.
+
+Example:
+
+```json
+{
+ "name": "org/strangeName",
+ "archive": {
+ "name": "Strange_name"
+ }
+}
+```
+
* **exclude:** Allows configuring a list of patterns for excluded paths. The
pattern syntax matches .gitignore files. A leading exclamation mark (!) will
result in any matching files to be included even if a previous pattern
@@ -878,7 +942,7 @@ It can be boolean or a package name/URL pointing to a recommended alternative.
Examples:
Use `"abandoned": true` to indicates this package is abandoned.
-Use `"abandoned": "monolog/monolog"` to indicates this package is abandoned and the
+Use `"abandoned": "monolog/monolog"` to indicates this package is abandoned, and the
recommended alternative is `monolog/monolog`.
Defaults to false.
@@ -893,7 +957,7 @@ that will NOT be handled as feature branches. This is an array of strings.
If you have non-numeric branch names, for example like "latest", "current", "latest-stable"
or something, that do not look like a version number, then Composer handles such branches
as feature branches. This means it searches for parent branches, that look like a version
-or ends at special branches (like master) and the root package version number becomes the
+or ends at special branches (like master), and the root package version number becomes the
version of the parent branch or at least master or something.
To handle non-numeric named branches as versions instead of searching for a parent branch
diff --git a/app/vendor/composer/composer/doc/05-repositories.md b/app/vendor/composer/composer/doc/05-repositories.md
index 9706a07e0..f8a68fa30 100644
--- a/app/vendor/composer/composer/doc/05-repositories.md
+++ b/app/vendor/composer/composer/doc/05-repositories.md
@@ -6,7 +6,7 @@ of repositories are available, and how they work.
## Concepts
Before we look at the different types of repositories that exist, we need to
-understand some of the basic concepts that Composer is built on.
+understand some basic concepts that Composer is built on.
### Package
@@ -41,7 +41,7 @@ be preferred.
A repository is a package source. It's a list of packages/versions. Composer
will look in all your repositories to find the packages your project requires.
-By default only the Packagist repository is registered in Composer. You can
+By default, only the Packagist.org repository is registered in Composer. You can
add more repositories to your project by declaring them in `composer.json`.
Repositories are only available to the root package and the repositories
@@ -49,6 +49,12 @@ defined in your dependencies will not be loaded. Read the
[FAQ entry](faqs/why-can't-composer-load-repositories-recursively.md) if you
want to learn why.
+When resolving dependencies, packages are looked up from repositories from
+top to bottom, and by default, as soon as a package is found in one, Composer
+stops looking in other repositories. Read the
+[repository priorities](articles/repository-priorities.md) article for more
+details and to see how to change this behavior.
+
## Types
### Composer
@@ -62,6 +68,17 @@ In the case of packagist, that file is located at `/packages.json`, so the URL o
the repository would be `repo.packagist.org`. For `example.org/packages.json` the
repository URL would be `example.org`.
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org"
+ }
+ ]
+}
+```
+
#### packages
The only required field is `packages`. The JSON structure is as follows:
@@ -105,7 +122,7 @@ It may include any of the other fields specified in the [schema](04-schema.md).
The `notify-batch` field allows you to specify a URL that will be called
every time a user installs a package. The URL can be either an absolute path
-(that will use the same domain as the repository) or a fully qualified URL.
+(that will use the same domain as the repository), or a fully qualified URL.
An example value:
@@ -132,6 +149,102 @@ number.
This field is optional.
+### metadata-url, available-packages and available-package-patterns
+
+The `metadata-url` field allows you to provide a URL template to serve all
+packages which are in the repository. It must contain the placeholder
+`%package%`.
+
+This field is new in Composer v2, and is prioritised over the
+`provider-includes` and `providers-url` fields if both are present.
+For compatibility with both Composer v1 and v2 you ideally want
+to provide both. New repository implementations may only need to
+support v2 however.
+
+An example:
+
+```json
+{
+ "metadata-url": "/p2/%package%.json"
+}
+```
+
+Whenever Composer looks for a package, it will replace `%package%` by the
+package name, and fetch that URL. If dev stability is allowed for the package,
+it will also load the URL again with `$packageName~dev` (e.g.
+`/p2/foo/bar~dev.json` to look for `foo/bar`'s dev versions).
+
+The `foo/bar.json` and `foo/bar~dev.json` files containing package versions
+MUST contain only versions for the foo/bar package, as
+`{"packages":{"foo/bar":[ ... versions here ... ]}}`.
+
+Caching is done via the use of If-Modified-Since header, so make sure you
+return Last-Modified headers and that they are accurate.
+
+The array of versions can also optionally be minified using
+`Composer\MetadataMinifier\MetadataMinifier::minify()` from
+[composer/metadata-minifier](https://packagist.org/packages/composer/metadata-minifier).
+If you do that, you should add a `"minified": "composer/2.0"` key
+at the top level to indicate to Composer it must expand the version
+list back into the original data. See
+https://repo.packagist.org/p2/monolog/monolog.json for an example.
+
+Any requested package which does not exist MUST return a 404 status code,
+which will indicate to Composer that this package does not exist in your
+repository. Make sure the 404 response is fast to avoid blocking Composer.
+Avoid redirects to alternative 404 pages.
+
+If your repository only has a small number of packages, and you want to avoid
+the 404-requests, you can also specify an `"available-packages"` key in
+`packages.json` which should be an array with all the package names that your
+repository contain. Alternatively you can specify an
+`"available-package-patterns"` key which is an array of package name patterns
+(with `*` matching any string, e.g. `vendor/*` would make composer look up
+every matching package name in this repository).
+
+This field is optional.
+
+### providers-api
+
+The `providers-api` field allows you to provide a URL template to serve all
+packages which provide a given package name, but not the package which has
+that name. It must contain the placeholder `%package%`.
+
+For example https://packagist.org/providers/monolog/monolog.json lists some
+package which have a "provide" rule for monolog/monolog, but it does not list
+monolog/monolog itself.
+
+```json
+{
+ "providers-api": "https://packagist.org/providers/%package%.json",
+}
+```
+
+This field is optional.
+
+### list
+
+The `list` field allows you to return the names of packages which match a
+given field (or all names if no filter is present). It should accept an
+optional `?filter=xx` query param, which can contain `*` as wildcards matching
+any substring.
+
+Replace/provide rules should not be considered here.
+
+It must return an array of package names:
+```json
+{
+ "packageNames": [
+ "a/b",
+ "c/d"
+ ]
+}
+```
+
+See for example.
+
+This field is optional.
+
#### provider-includes and providers-url
The `provider-includes` field allows you to list a set of files that list
@@ -142,6 +255,9 @@ The `providers-url` describes how provider files are found on the server. It
is an absolute path from the repository root. It must contain the placeholders
`%package%` and `%hash%`.
+These fields are used by Composer v1, or if your repository does not have the
+`metadata-url` field set.
+
An example:
```json
@@ -200,9 +316,9 @@ from these systems.
There are a few use cases for this. The most common one is maintaining your
own fork of a third party library. If you are using a certain library for your
-project and you decide to change something in the library, you will want your
+project, and you decide to change something in the library, you will want your
project to use the patched version. If the library is on GitHub (this is the
-case most of the time), you can simply fork it there and push your changes to
+case most of the time), you can fork it there and push your changes to
your fork. After that you update the project's `composer.json`. All you have
to do is add your fork as a repository and update the version constraint to
point to your custom branch. In `composer.json`, you should prefix your custom
@@ -299,23 +415,10 @@ Please note:
#### BitBucket Driver Configuration
-The BitBucket driver uses OAuth to access your private repositories via the BitBucket REST APIs and you will need to create an OAuth consumer to use the driver, please refer to [Atlassian's Documentation](https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html). You will need to fill the callback url with something to satisfy BitBucket, but the address does not need to go anywhere and is not used by Composer.
+> **Note that the repository endpoint for BitBucket needs to be https rather than git.**
-After creating an OAuth consumer in the BitBucket control panel, you need to setup your auth.json file with
-the credentials like this (more info [here](https://getcomposer.org/doc/06-config.md#bitbucket-oauth)):
-```json
-{
- "bitbucket-oauth": {
- "bitbucket.org": {
- "consumer-key": "myKey",
- "consumer-secret": "mySecret"
- }
- }
-}
-```
-**Note that the repository endpoint needs to be https rather than git.**
-
-Alternatively if you prefer not to have your OAuth credentials on your filesystem you may export the ```bitbucket-oauth``` block above to the [COMPOSER_AUTH](https://getcomposer.org/doc/03-cli.md#composer-auth) environment variable instead.
+After setting up your bitbucket repository, you will also need to
+[set up authentication](articles/authentication-for-private-packages.md#bitbucket-oauth).
#### Subversion Options
@@ -378,92 +481,6 @@ for this server will be overwritten. To change this behavior by setting the
}
```
-### PEAR
-
-It is possible to install packages from any PEAR channel by using the `pear`
-repository. Composer will prefix all package names with `pear-{channelName}/`
-to avoid conflicts. All packages are also aliased with prefix
-`pear-{channelAlias}/`.
-
-Example using `pear2.php.net`:
-
-```json
-{
- "repositories": [
- {
- "type": "pear",
- "url": "https://pear2.php.net"
- }
- ],
- "require": {
- "pear-pear2.php.net/PEAR2_Text_Markdown": "*",
- "pear-pear2/PEAR2_HTTP_Request": "*"
- }
-}
-```
-
-In this case the short name of the channel is `pear2`, so the
-`PEAR2_HTTP_Request` package name becomes `pear-pear2/PEAR2_HTTP_Request`.
-
-> **Note:** The `pear` repository requires doing quite a few requests per
-> package, so this may considerably slow down the installation process.
-
-#### Custom vendor alias
-
-It is possible to alias PEAR channel packages with a custom vendor name.
-
-Example:
-
-Suppose you have a private PEAR repository and wish to use Composer to
-incorporate dependencies from a VCS. Your PEAR repository contains the
-following packages:
-
- * `BasePackage`
- * `IntermediatePackage`, which depends on `BasePackage`
- * `TopLevelPackage1` and `TopLevelPackage2` which both depend
- on `IntermediatePackage`
-
-Without a vendor alias, Composer will use the PEAR channel name as the
-vendor portion of the package name:
-
- * `pear-pear.foobar.repo/BasePackage`
- * `pear-pear.foobar.repo/IntermediatePackage`
- * `pear-pear.foobar.repo/TopLevelPackage1`
- * `pear-pear.foobar.repo/TopLevelPackage2`
-
-Suppose at a later time you wish to migrate your PEAR packages to a
-Composer repository and naming scheme, and adopt the vendor name of `foobar`.
-Projects using your PEAR packages would not see the updated packages, since
-they have a different vendor name (`foobar/IntermediatePackage` vs
-`pear-pear.foobar.repo/IntermediatePackage`).
-
-By specifying `vendor-alias` for the PEAR repository from the start, you can
-avoid this scenario and future-proof your package names.
-
-To illustrate, the following example would get the `BasePackage`,
-`TopLevelPackage1`, and `TopLevelPackage2` packages from your PEAR repository
-and `IntermediatePackage` from a Github repository:
-
-```json
-{
- "repositories": [
- {
- "type": "git",
- "url": "https://github.com/foobar/intermediate.git"
- },
- {
- "type": "pear",
- "url": "http://pear.foobar.repo",
- "vendor-alias": "foobar"
- }
- ],
- "require": {
- "foobar/TopLevelPackage1": "*",
- "foobar/TopLevelPackage2": "*"
- }
-}
-```
-
### Package
If you want to use a project that does not support Composer through any of the
@@ -506,7 +523,7 @@ Here is an example for the smarty template engine:
}
```
-Typically you would leave the source part off, as you don't really need it.
+Typically, you would leave the source part off, as you don't really need it.
> **Note**: This repository type has a few limitations and should be avoided
> whenever possible:
@@ -576,17 +593,17 @@ package repository definitions. It will fetch all the packages that are
`require`d and dump a `packages.json` that is your `composer` repository.
Check [the satis GitHub repository](https://github.com/composer/satis) and
-the [Satis article](articles/handling-private-packages-with-satis.md) for more
+the [handling private packages article](articles/handling-private-packages.md) for more
information.
### Artifact
There are some cases, when there is no ability to have one of the previously
-mentioned repository types online, even the VCS one. Typical example could be
-cross-organisation library exchange through built artifacts. Of course, most
-of the times they are private. To simplify maintenance, one can simply use a
-repository of type `artifact` with a folder containing ZIP archives of those
-private packages:
+mentioned repository types online, even the VCS one. A typical example could be
+cross-organisation library exchange through build artifacts. Of course, most
+of the time these are private. To use these archives as-is, one can use a
+repository of type `artifact` with a folder containing ZIP or TAR archives of
+those private packages:
```json
{
@@ -626,12 +643,14 @@ especially useful when dealing with monolithic repositories.
For instance, if you have the following directory structure in your repository:
```
-- apps
-\_ my-app
- \_ composer.json
-- packages
-\_ my-package
- \_ composer.json
+...
+├── apps
+│ └── my-app
+│ └── composer.json
+├── packages
+│ └── my-package
+│ └── composer.json
+...
```
Then, to add the package `my/package` as a dependency, in your
@@ -656,8 +675,28 @@ the branch or tag that is currently checked out. Otherwise, the version should
be explicitly defined in the package's `composer.json` file. If the version
cannot be resolved by these means, it is assumed to be `dev-master`.
+When the version cannot be inferred from the local VCS repository, or when you
+want to override the version, you can use the `versions` option when declaring
+the repository:
+
+```json
+{
+ "repositories": [
+ {
+ "type": "path",
+ "url": "../../packages/my-package",
+ "options": {
+ "versions": {
+ "my/package": "4.2-dev"
+ }
+ }
+ }
+ ]
+}
+```
+
The local package will be symlinked if possible, in which case the output in
-the console will read `Symlinked from ../../packages/my-package`. If symlinking
+the console will read `Symlinking from ../../packages/my-package`. If symlinking
is _not_ possible the package will be copied. In that case, the console will
output `Mirrored from ../../packages/my-package`.
@@ -666,6 +705,10 @@ Instead of default fallback strategy you can force to use symlink with
mirroring can be useful when deploying or generating package from a
monolithic repository.
+> **Note:** On Windows, directory symlinks are implemented using NTFS junctions
+> because they can be created by non-admin users. Mirroring will always be used
+> on versions below Windows 7 or if `proc_open` has been disabled.
+
```json
{
"repositories": [
@@ -686,8 +729,8 @@ variables are parsed in both Windows and Linux/Mac notations. For example
`/home//git/mypackage`, equivalent to `$HOME/git/mypackage` or
`%USERPROFILE%/git/mypackage`.
-> **Note:** Repository paths can also contain wildcards like ``*`` and ``?``.
-> For details, see the [PHP glob function](http://php.net/glob).
+> **Note:** Repository paths can also contain wildcards like `*` and `?`.
+> For details, see the [PHP glob function](https://php.net/glob).
## Disabling Packagist.org
diff --git a/app/vendor/composer/composer/doc/06-config.md b/app/vendor/composer/composer/doc/06-config.md
index 87ffb02a0..dffff2104 100644
--- a/app/vendor/composer/composer/doc/06-config.md
+++ b/app/vendor/composer/composer/doc/06-config.md
@@ -5,10 +5,25 @@ This chapter will describe the `config` section of the `composer.json`
## process-timeout
-Defaults to `300`. The duration processes like git clones can run before
+The timeout in seconds for process executions, defaults to 300 (5mins).
+The duration processes like git clones can run before
Composer assumes they died out. You may need to make this higher if you have a
slow connection or huge vendors.
+To disable the process timeout on a custom command under `scripts`, a static
+helper is available:
+
+```json
+{
+ "scripts": {
+ "test": [
+ "Composer\\Config::disableProcessTimeout",
+ "phpunit"
+ ]
+ }
+}
+```
+
## use-include-path
Defaults to `false`. If `true`, the Composer autoloader will also look for classes
@@ -16,7 +31,7 @@ in the PHP include path.
## preferred-install
-Defaults to `auto` and can be any of `source`, `dist` or `auto`. This option
+Defaults to `dist` and can be any of `source`, `dist` or `auto`. This option
allows you to set the install method Composer will prefer to use. Can
optionally be a hash of patterns for more granular install preferences.
@@ -33,6 +48,16 @@ optionally be a hash of patterns for more granular install preferences.
}
```
+- `source` means Composer will install packages from their `source` if there
+ is one. This is typically a git clone or equivalent checkout of the version
+ control system the package uses. This is useful if you want to make a bugfix
+ to a project and get a local git clone of the dependency directly.
+- `auto` is the legacy behavior where Composer uses `source` automatically
+ for dev versions, and `dist` otherwise.
+- `dist` (the default as of Composer 2.1) means Composer installs from `dist`,
+ where possible. This is typically a zip file download, which is faster than
+ cloning the entire repository.
+
> **Note:** Order matters. More specific patterns should be earlier than
> more relaxed patterns. When mixing the string notation with the hash
> configuration in global and package configurations the string notation
@@ -57,32 +82,55 @@ URL.
A list of domain names and oauth keys. For example using `{"github.com":
"oauthtoken"}` as the value of this option will use `oauthtoken` to access
private repositories on github and to circumvent the low IP-based rate limiting
-of their API. [Read
-more](articles/troubleshooting.md#api-rate-limit-and-oauth-tokens) on how to get
-an OAuth token for GitHub.
+of their API. Composer may prompt for credentials when needed, but these can also be
+manually set. Read more on how to get an OAuth token for GitHub and cli syntax
+[here](articles/authentication-for-private-packages.md#github-oauth).
+
+## gitlab-domains
+
+Defaults to `["gitlab.com"]`. A list of domains of GitLab servers.
+This is used if you use the `gitlab` repository type.
## gitlab-oauth
A list of domain names and oauth keys. For example using `{"gitlab.com":
"oauthtoken"}` as the value of this option will use `oauthtoken` to access
-private repositories on gitlab. Please note: If the package is not hosted at
-gitlab.com the domain names must be also specified with the
+private repositories on gitlab. Please note: If the package is not hosted at
+gitlab.com the domain names must be also specified with the
[`gitlab-domains`](06-config.md#gitlab-domains) option.
+Further info can also be found [here](articles/authentication-for-private-packages.md#gitlab-oauth)
## gitlab-token
-A list of domain names and private tokens. For example using `{"gitlab.com":
+A list of domain names and private tokens. Private token can be either simple
+string, or array with username and token. For example using `{"gitlab.com":
"privatetoken"}` as the value of this option will use `privatetoken` to access
-private repositories on gitlab. Please note: If the package is not hosted at
-gitlab.com the domain names must be also specified with the
-[`gitlab-domains`](06-config.md#gitlab-domains) option.
+private repositories on gitlab. Using `{"gitlab.com": {"username": "gitlabuser",
+ "token": "privatetoken"}}` will use both username and token for gitlab deploy
+token functionality (https://docs.gitlab.com/ee/user/project/deploy_tokens/)
+Please note: If the package is not hosted at
+gitlab.com the domain names must be also specified with the
+[`gitlab-domains`](06-config.md#gitlab-domains) option. The token must have
+`api` or `read_api` scope.
+Further info can also be found [here](articles/authentication-for-private-packages.md#gitlab-token)
+
+## gitlab-protocol
+
+A protocol to force use of when creating a repository URL for the `source`
+value of the package metadata. One of `git` or `http`. (`https` is treated
+as a synonym for `http`.) Helpful when working with projects referencing
+private repositories which will later be cloned in GitLab CI jobs with a
+[GitLab CI_JOB_TOKEN](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-reference)
+using HTTP basic auth. By default, Composer will generate a git-over-SSH
+URL for private repositories and HTTP(S) only for public.
## disable-tls
Defaults to `false`. If set to true all HTTPS URLs will be tried with HTTP
instead and no network level encryption is performed. Enabling this is a
security risk and is NOT recommended. The better way is to enable the
-php_openssl extension in php.ini.
+php_openssl extension in php.ini. Enabling this will implicitly disable the
+`secure-http` option.
## secure-http
@@ -94,8 +142,8 @@ get a free SSL certificate is generally a better alternative.
## bitbucket-oauth
A list of domain names and consumers. For example using `{"bitbucket.org":
-{"consumer-key": "myKey", "consumer-secret": "mySecret"}}`. [Read](https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html)
-how to set up a consumer on Bitbucket.
+{"consumer-key": "myKey", "consumer-secret": "mySecret"}}`.
+Read more [here](articles/authentication-for-private-packages.md#bitbucket-oauth).
## cafile
@@ -114,11 +162,13 @@ capath must be a correctly hashed certificate directory.
A list of domain names and username/passwords to authenticate against them. For
example using `{"example.org": {"username": "alice", "password": "foo"}}` as the
value of this option will let Composer authenticate against example.org.
+More info can be found [here](articles/authentication-for-private-packages.md#http-basic).
+
+## bearer
-> **Note:** Authentication-related config options like `http-basic` and
-> `github-oauth` can also be specified inside a `auth.json` file that goes
-> besides your `composer.json`. That way you can gitignore it and every
-> developer can place their own credentials in there.
+A list of domain names and tokens to authenticate against them. For example using
+`{"example.org": "foo"}` as the value of this option will let Composer authenticate
+against example.org using an `Authorization: Bearer foo` header.
## platform
@@ -126,6 +176,21 @@ Lets you fake platform packages (PHP and extensions) so that you can emulate a
production env or define your target platform in the config. Example: `{"php":
"7.0.3", "ext-something": "4.0.3"}`.
+This will make sure that no package requiring more than PHP 7.0.3 can be installed
+regardless of the actual PHP version you run locally. However it also means
+the dependencies are not checked correctly anymore, if you run PHP 5.6 it will
+install fine as it assumes 7.0.3, but then it will fail at runtime.
+
+Therefore if you use this it is recommended, and safer, to also run the
+[`check-platform-reqs`](03-cli.md#check-platform-reqs) command as part of your
+deployment strategy.
+
+If a dependency requires some extension that you do not have installed locally
+you may ignore it instead by passing `--ignore-platform-req=ext-foo` to `update`,
+`install` or `require`. In the long run though you should install required
+extensions as if you ignore one now and a new package you add a month later also
+requires it, you may introduce issues in production unknowingly.
+
## vendor-dir
Defaults to `vendor`. You can install dependencies into a different directory if
@@ -148,9 +213,10 @@ versions. See also [COMPOSER_HOME](03-cli.md#composer-home).
## cache-dir
Defaults to `C:\Users\\AppData\Local\Composer` on Windows,
-`$XDG_CACHE_HOME/composer` on unix systems that follow the XDG Base Directory
-Specifications, and `$home/cache` on other unix systems. Stores all the caches
-used by Composer. See also [COMPOSER_HOME](03-cli.md#composer-home).
+`/Users//Library/Caches/composer` on macOS, `$XDG_CACHE_HOME/composer`
+on unix systems that follow the XDG Base Directory Specifications, and
+`$home/cache` on other unix systems. Stores all the caches used by Composer.
+See also [COMPOSER_HOME](03-cli.md#composer-home).
## cache-files-dir
@@ -168,26 +234,31 @@ metadata for the `git`/`hg` types and to speed up installs.
## cache-files-ttl
-Defaults to `15552000` (6 months). Composer caches all dist (zip, tar, ..)
+Defaults to `15552000` (6 months). Composer caches all dist (zip, tar, ...)
packages that it downloads. Those are purged after six months of being unused by
default. This option allows you to tweak this duration (in seconds) or disable
it completely by setting it to 0.
## cache-files-maxsize
-Defaults to `300MiB`. Composer caches all dist (zip, tar, ..) packages that it
+Defaults to `300MiB`. Composer caches all dist (zip, tar, ...) packages that it
downloads. When the garbage collection is periodically ran, this is the maximum
size the cache will be able to use. Older (less used) files will be removed
first until the cache fits.
+## cache-read-only
+
+Defaults to `false`. Whether to use the Composer cache in read-only mode.
+
## bin-compat
Defaults to `auto`. Determines the compatibility of the binaries to be installed.
-If it is `auto` then Composer only installs .bat proxy files when on Windows. If
+If it is `auto` then Composer only installs .bat proxy files when on Windows or WSL. If
set to `full` then both .bat files for Windows and scripts for Unix-based
operating systems will be installed for each binary. This is mainly useful if you
-run Composer inside a linux VM but still want the .bat proxies available for use
-in the Windows host OS.
+run Composer inside a linux VM but still want the `.bat` proxies available for use
+in the Windows host OS. If set to `symlink` Composer will always symlink even on
+Windows/WSL.
## prepend-autoloader
@@ -229,16 +300,19 @@ used for GitHub Enterprise setups.
Defaults to `true`. If `false`, the OAuth tokens created to access the
github API will have a date instead of the machine hostname.
-## gitlab-domains
+## use-github-api
-Defaults to `["gitlab.com"]`. A list of domains of GitLab servers.
-This is used if you use the `gitlab` repository type.
+Defaults to `true`. Similar to the `no-api` key on a specific repository,
+setting `use-github-api` to `false` will define the global behavior for all
+GitHub repositories to clone the repository as it would with any other git
+repository instead of using the GitHub API. But unlike using the `git`
+driver directly, Composer will still attempt to use GitHub's zip files.
## notify-on-install
Defaults to `true`. Composer allows repositories to define a notification URL,
so that they get notified whenever a package from that repository is installed.
-This option allows you to disable that behaviour.
+This option allows you to disable that behavior.
## discard-changes
@@ -250,14 +324,12 @@ scripts if you tend to have modified vendors.
## archive-format
-Defaults to `tar`. Composer allows you to add a default archive format when the
-workflow needs to create a dedicated archiving format.
+Defaults to `tar`. Overrides the default format used by the archive command.
## archive-dir
-Defaults to `.`. Composer allows you to add a default archive directory when the
-workflow needs to create a dedicated archiving format. Or for easier development
-between modules.
+Defaults to `.`. Default destination for archives created by the archive
+command.
Example:
@@ -274,4 +346,23 @@ Example:
Defaults to `true`. If set to `false`, Composer will not create `.htaccess` files
in the composer home, cache, and data directories.
-← [Repositories](05-repositories.md) | [Community](07-community.md) →
+## lock
+
+Defaults to `true`. If set to `false`, Composer will not create a `composer.lock`
+file.
+
+## platform-check
+
+Defaults to `php-only` which only checks the PHP version. Set to `true` to also
+check the presence of extension. If set to `false`, Composer will not create and
+require a `platform_check.php` file as part of the autoloader bootstrap.
+
+## secure-svn-domains
+
+Defaults to `[]`. Lists domains which should be trusted/marked as using a secure
+Subversion/SVN transport. By default svn:// protocol is seen as insecure and will
+throw, but you can set this config option to `["example.org"]` to allow using svn
+URLs on that hostname. This is a better/safer alternative to disabling `secure-http`
+altogether.
+
+← [Repositories](05-repositories.md) | [Runtime](07-runtime.md) →
diff --git a/app/vendor/composer/composer/doc/07-community.md b/app/vendor/composer/composer/doc/07-community.md
deleted file mode 100644
index 4296f90cd..000000000
--- a/app/vendor/composer/composer/doc/07-community.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Community
-
-There are many people using Composer already, and quite a few of them are
-contributing.
-
-## Contributing
-
-If you would like to contribute to Composer, please read the
-[README](https://github.com/composer/composer) and
-[CONTRIBUTING](https://github.com/composer/composer/blob/master/.github/CONTRIBUTING.md)
-documents.
-
-The most important guidelines are described as follows:
-
-> All code contributions - including those of people having commit access - must
-> go through a pull request and approved by a core developer before being
-> merged. This is to ensure proper review of all the code.
->
-> Fork the project, create a feature branch, and send us a pull request.
->
-> To ensure a consistent code base, you should make sure the code follows
-> the [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/).
-
-## IRC / mailing list
-
-Mailing lists for [user support](https://groups.google.com/group/composer-users) and
-[development](https://groups.google.com/group/composer-dev).
-
-IRC channels are on irc.freenode.org: [#composer](irc://irc.freenode.org/composer)
-for users and [#composer-dev](irc://irc.freenode.org/composer-dev) for development.
-
-Stack Overflow has a growing collection of
-[Composer related questions](https://stackoverflow.com/questions/tagged/composer-php).
-
-← [Config](06-config.md)
diff --git a/app/vendor/composer/composer/doc/07-runtime.md b/app/vendor/composer/composer/doc/07-runtime.md
new file mode 100644
index 000000000..3e345ad38
--- /dev/null
+++ b/app/vendor/composer/composer/doc/07-runtime.md
@@ -0,0 +1,155 @@
+# Runtime Composer utilities
+
+While Composer is mostly used around your project to install its dependencies,
+there are a few things which are made available to you at runtime.
+
+If you need to rely on some of these in a specific version, you can require
+the `composer-runtime-api` package.
+
+## Autoload
+
+The autoloader is the most used one, and is already covered in our
+[basic usage guide](01-basic-usage.md#autoloading). It is available in all
+Composer versions.
+
+## Installed versions
+
+composer-runtime-api 2.0 introduced a new `Composer\InstalledVersions` class which offers
+a few static methods to inspect which versions are currently installed. This is
+automatically available to your code as long as you include the Composer autoloader.
+
+The main use cases for this class are the following:
+
+### Knowing whether package X (or virtual package) is present
+
+```php
+\Composer\InstalledVersions::isInstalled('vendor/package'); // returns bool
+\Composer\InstalledVersions::isInstalled('psr/log-implementation'); // returns bool
+```
+
+As of Composer 2.1, you may also check if something was installed via require-dev or not by
+passing false as second argument:
+
+```php
+\Composer\InstalledVersions::isInstalled('vendor/package'); // returns true assuming this package is installed
+\Composer\InstalledVersions::isInstalled('vendor/package', false); // returns true if vendor/package is in require, false if in require-dev
+```
+
+Note that this can not be used to check whether platform packages are installed.
+
+### Knowing whether package X is installed in version Y
+
+> **Note:** To use this, your package must require `"composer/semver": "^3.0"`.
+
+```php
+use Composer\Semver\VersionParser;
+
+\Composer\InstalledVersions::satisfies(new VersionParser, 'vendor/package', '2.0.*');
+\Composer\InstalledVersions::satisfies(new VersionParser, 'psr/log-implementation', '^1.0');
+```
+
+This will return true if e.g. vendor/package is installed in a version matching
+`2.0.*`, but also if the given package name is replaced or provided by some other
+package.
+
+### Knowing the version of package X
+
+> **Note:** This will return `null` if the package name you ask for is not itself installed
+> but merely provided or replaced by another package. We therefore recommend using satisfies()
+> in library code at least. In application code you have a bit more control and it is less
+> important.
+
+```php
+// returns a normalized version (e.g. 1.2.3.0) if vendor/package is installed,
+// or null if it is provided/replaced,
+// or throws OutOfBoundsException if the package is not installed at all
+\Composer\InstalledVersions::getVersion('vendor/package');
+```
+
+```php
+// returns the original version (e.g. v1.2.3) if vendor/package is installed,
+// or null if it is provided/replaced,
+// or throws OutOfBoundsException if the package is not installed at all
+\Composer\InstalledVersions::getPrettyVersion('vendor/package');
+```
+
+```php
+// returns the package dist or source reference (e.g. a git commit hash) if vendor/package is installed,
+// or null if it is provided/replaced,
+// or throws OutOfBoundsException if the package is not installed at all
+\Composer\InstalledVersions::getReference('vendor/package');
+```
+
+### Knowing a package's own installed version
+
+If you are only interested in getting a package's own version, e.g. in the source of acme/foo you want
+to know which version acme/foo is currently running to display that to the user, then it is
+acceptable to use getVersion/getPrettyVersion/getReference.
+
+The warning in the section above does not apply in this case as you are sure the package is present
+and not being replaced if your code is running.
+
+It is nonetheless a good idea to make sure you handle the `null` return value as gracefully as
+possible for safety.
+
+----
+
+A few other methods are available for more complex usages, please refer to the
+source/docblocks of [the class itself](https://github.com/composer/composer/blob/master/src/Composer/InstalledVersions.php).
+
+### Knowing the path in which a package is installed
+
+The `getInstallPath` method to retrieve a package's absolute install path.
+
+```php
+// returns an absolute path to the package installation location if vendor/package is installed,
+// or null if it is provided/replaced, or the package is a metapackage
+// or throws OutOfBoundsException if the package is not installed at all
+\Composer\InstalledVersions::getInstallPath('vendor/package');
+```
+
+> Available as of Composer 2.1 (i.e. `composer-runtime-api ^2.1`)
+
+### Knowing which packages of a given type are installed
+
+The `getInstalledPackagesByType` method accepts a package type (e.g. foo-plugin) and lists
+the packages of that type which are installed. You can then use the methods above to retrieve
+more information about each package if needed.
+
+This method should alleviate the need for custom installers placing plugins in a specific path
+instead of leaving them in the vendor dir. You can then find plugins to initialize at runtime
+via InstalledVersions, including their paths via getInstallPath if needed.
+
+```php
+\Composer\InstalledVersions::getInstalledPackagesByType('foo-plugin');
+```
+
+> Available as of Composer 2.1 (i.e. `composer-runtime-api ^2.1`)
+
+## Platform check
+
+composer-runtime-api 2.0 introduced a new `vendor/composer/platform_check.php` file, which
+is included automatically when you include the Composer autoloader.
+
+It verifies that platform requirements (i.e. php and php extensions) are fulfilled
+by the PHP process currently running. If the requirements are not met, the script
+prints a warning with the missing requirements and exits with code 104.
+
+To avoid an unexpected white page of death with some obscure PHP extension warning in
+production, you can run `composer check-platform-reqs` as part of your
+deployment/build and if that returns a non-0 code you should abort.
+
+The default value is `php-only` which only checks the PHP version.
+
+If you for some reason do not want to use this safety check, and would rather
+risk runtime errors when your code executes, you can disable this by setting the
+[`platform-check`](06-config.md#platform-check) config option to `false`.
+
+If you want the check to include verifying the presence of PHP extensions,
+set the config option to `true`. `ext-*` requirements will then be verified
+but for performance reasons Composer only checks the extension is present,
+not its exact version.
+
+`lib-*` requirements are never supported/checked by the platform check feature.
+
+← [Config](06-config.md) | [Community](08-community.md) →
diff --git a/app/vendor/composer/composer/doc/08-community.md b/app/vendor/composer/composer/doc/08-community.md
new file mode 100644
index 000000000..7c48a94a8
--- /dev/null
+++ b/app/vendor/composer/composer/doc/08-community.md
@@ -0,0 +1,36 @@
+# Community
+
+There are many people using Composer already, and quite a few of them are
+contributing.
+
+## Contributing
+
+If you would like to contribute to Composer, please read the
+[README](https://github.com/composer/composer) and
+[CONTRIBUTING](https://github.com/composer/composer/blob/master/.github/CONTRIBUTING.md)
+documents.
+
+The most important guidelines are described as follows:
+
+> All code contributions - including those of people having commit access - must
+> go through a pull request and approved by a core developer before being
+> merged. This is to ensure proper review of all the code.
+>
+> Fork the project, create a feature branch, and send us a pull request.
+>
+> To ensure a consistent code base, you should make sure the code follows
+> the [PSR-2 Coding Standards](https://www.php-fig.org/psr/psr-2/).
+
+## Support
+
+The IRC channel is on irc.libera.chat: [#composer](ircs://irc.libera.chat:6697/composer).
+
+[Stack Overflow](https://stackoverflow.com/questions/tagged/composer-php) and
+[GitHub Discussions](https://github.com/composer/composer/discussions) both have a
+collection of Composer related questions.
+
+For paid support, we do provide Composer-related support via chat and email to
+[Private Packagist](https://packagist.com) customers.
+
+
+← [Config](07-runtime.md)
diff --git a/app/vendor/composer/composer/doc/articles/aliases.md b/app/vendor/composer/composer/doc/articles/aliases.md
index 98a6d1335..c03ec52f2 100644
--- a/app/vendor/composer/composer/doc/articles/aliases.md
+++ b/app/vendor/composer/composer/doc/articles/aliases.md
@@ -89,6 +89,12 @@ Add this to your project's root `composer.json`:
}
```
+Or let composer add it for you with:
+
+```
+php composer.phar require monolog/monolog:"dev-bugfix as 1.0.x-dev"
+```
+
That will fetch the `dev-bugfix` version of `monolog/monolog` from your GitHub
and alias it to `1.0.x-dev`.
@@ -101,5 +107,5 @@ and alias it to `1.0.x-dev`.
> inline-aliased again in A's `composer.json`.
> **Note:** Inline aliasing should be avoided, especially for published
-> packages/libraries. If you found a bug, try and get your fix merged upstream.
+> packages/libraries. If you found a bug, try to get your fix merged upstream.
> This helps to avoid issues for users of your package.
diff --git a/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md b/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md
new file mode 100644
index 000000000..bbc21ee0d
--- /dev/null
+++ b/app/vendor/composer/composer/doc/articles/authentication-for-private-packages.md
@@ -0,0 +1,301 @@
+
+
+# Authentication for privately hosted packages and repositories
+
+Your [private package server](handling-private-packages.md) or version control system is probably secured with one
+or more authentication options. In order to allow your project to have access to these
+packages and repositories you will have to tell Composer how to authenticate with the server that hosts them.
+
+# Authentication principles
+
+Whenever Composer encounters a protected Composer repository it will try to authenticate
+using already defined credentials first. When none of those credentials apply it will prompt
+for credentials and save them (or a token if Composer is able to retrieve one).
+
+|type|Generated by Prompt?|
+|---|---|
+|[http-basic](#http-basic)|yes|
+|[Inline http-basic](#inline-http-basic)|no|
+|[Custom header](#custom-token-authentication)|no|
+|[gitlab-oauth](#gitlab-oauth)|yes|
+|[gitlab-token](#gitlab-token)|yes|
+|[github-oauth](#github-oauth)|yes|
+|[bitbucket-oauth](#bitbucket-oauth)|yes|
+
+Sometimes automatic authentication is not possible, or you may want to predefine
+authentication credentials.
+
+Credentials can be stored on 3 different places; in an `auth.json` for the project, a global
+`auth.json` or in the `composer.json` itself.
+
+## Authentication in auth.json per project
+
+In this authentication storage method, an `auth.json` file will be present in the same folder
+as the projects' `composer.json` file. You can either create and edit this file using the
+command line or manually edit or create it.
+
+> **Note: Make sure the `auth.json` file is in `.gitignore`** to avoid
+> leaking credentials into your git history.
+
+## Global authentication credentials
+
+If you don't want to supply credentials for every project you work on, storing your credentials
+globally might be a better idea. These credentials are stored in a global `auth.json` in your
+Composer home directory.
+
+### Command line global credential editing
+
+For all authentication methods it is possible to edit them using the command line;
+ - [http-basic](#command-line-http-basic)
+ - [Inline http-basic](#command-line-inline-http-basic)
+ - [gitlab-oauth](#command-line-gitlab-oauth)
+ - [gitlab-token](#command-line-gitlab-token)
+ - [github-oauth](#command-line-github-oauth)
+ - [bitbucket-oauth](#command-line-bitbucket-oauth)
+
+### Manually editing global authentication credentials
+
+> **Note:** It is not recommended to manually edit your authentication options as this might
+> result in invalid json. Instead preferably use [the command line](#command-line-global-credential-editing).
+
+To manually edit it, run:
+
+```sh
+composer config --global --editor [--auth]
+```
+
+For specific authentication implementations, see their sections;
+ - [http-basic](#manual-http-basic)
+ - [Inline http-basic](#manual-inline-http-basic)
+ - [custom header](#manual-custom-token-authentication)
+ - [gitlab-oauth](#manual-gitlab-oauth)
+ - [gitlab-token](#manual-gitlab-token)
+ - [github-oauth](#manual-github-oauth)
+ - [bitbucket-oauth](#manual-bitbucket-oauth)
+
+Manually editing this file instead of using the command line may result in invalid json errors.
+To fix this you need to open the file in an editor and fix the error. To find the location of
+your global `auth.json`, execute:
+
+```sh
+composer config --global home
+```
+
+The folder will contain your global `auth.json` if it exists.
+
+You can open this file in your favorite editor and fix the error.
+
+## Authentication in composer.json file itself
+
+> **Note:** **This is not recommended** as these credentials are visible
+> to anyone who has access to the composer.json, either when it is shared through
+> a version control system like git or when an attacker gains (read) access to
+> your production server files.
+
+It is also possible to add credentials to a `composer.json` on a per-project basis in the `config`
+section or directly in the repository definition.
+
+## Authentication using the COMPOSER_AUTH environment variable
+
+> **Note:** Using the command line environment variable method also has security implications.
+> These credentials will most likely be stored in memory,
+> and on be persisted to a file like `~/.bash_history`(linux) or `ConsoleHost_history.txt`
+> (PowerShell on Windows) when closing a session.
+
+The final option to supply Composer with credentials is to use the `COMPOSER_AUTH` environment variable.
+These variables can be either passed as command line variables or set in actual environment variables.
+Read more about the usage of this environment variable [here](../03-cli.md#composer-auth).
+
+# Authentication methods
+
+## http-basic
+
+### Command line http-basic
+
+```sh
+composer config [--global] http-basic.example.org username password
+```
+
+### Manual http-basic
+
+```sh
+composer config [--global] --editor --auth
+```
+
+```json
+{
+ "http-basic": {
+ "example.org": {
+ "username": "username",
+ "password": "password"
+ }
+ }
+}
+```
+
+## Inline http-basic
+
+For the inline http-basic authentication method the credentials are not stored in a separate
+`auth.json` in the project or globally, but in the `composer.json` or global configuration
+in the same place where the Composer repository definition is defined.
+
+Make sure that the username and password are encoded according to [RFC 3986](http://www.faqs.org/rfcs/rfc3986.html) (2.1. Percent-Encoding).
+If the username e.g. is an email address it needs to be passed as `name%40example.com`.
+
+### Command line inline http-basic
+
+```sh
+composer config [--global] repositories composer.unique-name https://username:password@repo.example.org
+```
+
+### Manual inline http-basic
+
+```sh
+composer config [--global] --editor
+```
+
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://username:password@example.org"
+ }
+ ]
+}
+```
+
+## Custom token authentication
+
+### Manual custom token authentication
+
+```sh
+composer config [--global] --editor
+```
+
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "options": {
+ "http": {
+ "header": [
+ "API-TOKEN: YOUR-API-TOKEN"
+ ]
+ }
+ }
+ }
+ ]
+}
+```
+
+## gitlab-oauth
+
+> **Note:** For the gitlab authentication to work on private gitlab instances, the
+> [`gitlab-domains`](../06-config.md#gitlab-domains) section should also contain the url.
+
+### Command line gitlab-oauth
+
+```sh
+composer config [--global] gitlab-oauth.example.org token
+```
+
+### Manual gitlab-oauth
+
+```sh
+composer config [--global] --editor --auth
+```
+
+```json
+{
+ "gitlab-oauth": {
+ "example.org": "token"
+ }
+}
+```
+
+## gitlab-token
+
+> **Note:** For the gitlab authentication to work on private gitlab instances, the
+> [`gitlab-domains`](../06-config.md#gitlab-domains) section should also contain the url.
+
+To create a new access token, go to your [access tokens section on GitLab](https://gitlab.com/-/profile/personal_access_tokens)
+(or the equivalent URL on your private instance) and create a new token. See also [the GitLab access token documentation](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) for more informations.
+
+When creating a gitlab token manually, make sure it has either the `read_api` or `api` scope.
+
+### Command line gitlab-token
+
+```sh
+composer config [--global] gitlab-token.example.org token
+```
+
+### Manual gitlab-token
+
+```sh
+composer config [--global] --editor --auth
+```
+
+```json
+{
+ "gitlab-token": {
+ "example.org": "token"
+ }
+}
+```
+
+## github-oauth
+
+To create a new access token, head to your [token settings section on Github](https://github.com/settings/tokens) and [generate a new token](https://github.com/settings/tokens/new). For public repositories when rate limited, the `public_repo` scope is required, for private repositories the `repo:status` scope is needed.
+Read more about it [here](https://github.com/blog/1509-personal-api-tokens).
+
+### Command line github-oauth
+
+```sh
+composer config [--global] github-oauth.github.com token
+```
+
+### Manual github-oauth
+
+```sh
+composer config [--global] --editor --auth
+```
+
+```json
+{
+ "github-oauth": {
+ "github.com": "token"
+ }
+}
+```
+
+## bitbucket-oauth
+
+The BitBucket driver uses OAuth to access your private repositories via the BitBucket REST APIs, and you will need to create an OAuth consumer to use the driver, please refer to [Atlassian's Documentation](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/). You will need to fill the callback url with something to satisfy BitBucket, but the address does not need to go anywhere and is not used by Composer.
+
+### Command line bitbucket-oauth
+
+```sh
+composer config [--global] bitbucket-oauth.bitbucket.org consumer-key consumer-secret
+```
+
+### Manual bitbucket-oauth
+
+```sh
+composer config [--global] --editor --auth
+```
+
+```json
+{
+ "bitbucket-oauth": {
+ "bitbucket.org": {
+ "consumer-key": "key",
+ "consumer-secret": "secret"
+ }
+ }
+}
+```
diff --git a/app/vendor/composer/composer/doc/articles/autoloader-optimization.md b/app/vendor/composer/composer/doc/articles/autoloader-optimization.md
index 41bd4a6cb..07a0739bf 100644
--- a/app/vendor/composer/composer/doc/articles/autoloader-optimization.md
+++ b/app/vendor/composer/composer/doc/articles/autoloader-optimization.md
@@ -2,7 +2,7 @@
tagline: How to reduce the performance impact of the autoloader
-->
-# Autoloader Optimization
+# Autoloader optimization
By default, the Composer autoloader runs relatively fast. However, due to the way
PSR-4 and PSR-0 autoloading rules are set up, it needs to check the filesystem
@@ -12,7 +12,7 @@ it can immediately be discovered/used without having to rebuild the autoloader
configuration.
The problem however is in production you generally want things to happen as fast
-as possible, as you can simply rebuild the configuration every time you deploy and
+as possible, as you can rebuild the configuration every time you deploy and
new classes do not appear at random between deploys.
For this reason, Composer offers a few strategies to optimize the autoloader.
@@ -48,7 +48,7 @@ There are no real trade-offs with this method. It should always be enabled in
production.
The only issue is it does not keep track of autoload misses (i.e. when
-it can not find a given class), so those fallback to PSR-4 rules and can still
+it cannot find a given class), so those fallback to PSR-4 rules and can still
result in slow filesystem checks. To solve this issue two Level 2 optimization
options exist, and you can decide to enable either if you have a lot of
class_exists checks that are done for classes that do not exist in your project.
@@ -67,7 +67,7 @@ There are a few options to enable this:
Enabling this automatically enables Level 1 class map optimizations.
-This option is very simple, it says that if something is not found in the classmap,
+This option says that if something is not found in the classmap,
then it does not exist and the autoloader should not attempt to look on the
filesystem according to PSR-4 rules.
@@ -78,7 +78,7 @@ also means that in case a class is generated at runtime for some reason, it will
not be allowed to be autoloaded. If your project or any of your dependencies does that
then you might experience "class not found" issues in production. Enable this with care.
-> Note: This can not be combined with Level 2/B optimizations. You have to choose one as
+> Note: This cannot be combined with Level 2/B optimizations. You have to choose one as
> they address the same issue in different ways.
## Optimization Level 2/B: APCu cache
@@ -97,15 +97,15 @@ This option adds an APCu cache as a fallback for the class map. It will not
automatically generate the class map though, so you should still enable Level 1
optimizations manually if you so desire.
-Whether a class is found or not, that fact is always cached in APCu so it can be
+Whether a class is found or not, that fact is always cached in APCu, so it can be
returned quickly on the next request.
### Trade-offs
This option requires APCu which may or may not be available to you. It also
-uses APCu memory for autoloading purposes, but it is safe to use and can not
+uses APCu memory for autoloading purposes, but it is safe to use and cannot
result in classes not being found like the authoritative class map
optimization above.
-> Note: This can not be combined with Level 2/A optimizations. You have to choose one as
+> Note: This cannot be combined with Level 2/A optimizations. You have to choose one as
> they address the same issue in different ways.
diff --git a/app/vendor/composer/composer/doc/articles/custom-installers.md b/app/vendor/composer/composer/doc/articles/custom-installers.md
index 791c04956..9c0ee2b65 100644
--- a/app/vendor/composer/composer/doc/articles/custom-installers.md
+++ b/app/vendor/composer/composer/doc/articles/custom-installers.md
@@ -6,7 +6,7 @@
## Synopsis
-At times it may be necessary for a package to require additional actions during
+At times, it may be necessary for a package to require additional actions during
installation, such as installing packages outside of the default `vendor`
library.
@@ -149,6 +149,7 @@ source for the exact signature):
when the package needs to be removed.
* **getInstallPath()**, this method should return the location where the
package is to be installed, _relative from the location of composer.json._
+ The path _must not end with a slash._
Example:
@@ -189,7 +190,7 @@ class TemplateInstaller extends LibraryInstaller
}
```
-The example demonstrates that it is quite simple to extend the
+The example demonstrates that it is possible to extend the
[`Composer\Installer\LibraryInstaller`][5] class to strip a prefix
(`phpdocumentor/template-`) and use the remaining part to assemble a completely
different installation path.
diff --git a/app/vendor/composer/composer/doc/articles/handling-private-packages-with-satis.md b/app/vendor/composer/composer/doc/articles/handling-private-packages-with-satis.md
deleted file mode 100644
index cdf31f6e4..000000000
--- a/app/vendor/composer/composer/doc/articles/handling-private-packages-with-satis.md
+++ /dev/null
@@ -1,343 +0,0 @@
-
-
-# Handling private packages
-
-# Private Packagist
-
-[Private Packagist](https://packagist.com) is a commercial package hosting product
-offering professional support and web based management of private and public packages,
-and granular access permissions. Private Packagist provides mirroring for packages' zip
-files which makes installs faster and independent from third party systems - e.g.
-you can deploy even if GitHub is down because your zip files are mirrored.
-
-Private Packagist is available as a hosted SaaS solution or as an on-premise self-hosted
-package, providing an easy interactive set up experience.
-
-Some of Private Packagist's revenue is used to pay for Composer and Packagist.org
-development and hosting so using it is a good way to support the maintenance of
-these open source projects financially. You can find more information about how to
-set up your own package archive on [Packagist.com](https://packagist.com).
-
-# Satis
-
-Satis on the other hand is open source but only a static `composer` repository
-generator. It is a bit like an ultra-lightweight, static file-based version of
-packagist and can be used to host the metadata of your company's private
-packages, or your own. You can get it from
-[GitHub](https://github.com/composer/satis) or install via CLI:
-
- php composer.phar create-project composer/satis --stability=dev --keep-vcs
-
-## Setup
-
-For example let's assume you have a few packages you want to reuse across your
-company but don't really want to open-source. You would first define a Satis
-configuration: a json file with an arbitrary name that lists your curated
-[repositories](../05-repositories.md).
-
-Here is an example configuration, you see that it holds a few VCS repositories,
-but those could be any types of [repositories](../05-repositories.md). Then it
-uses `"require-all": true` which selects all versions of all packages in the
-repositories you defined.
-
-The default file Satis looks for is `satis.json` in the root of the repository.
-
-```json
-{
- "name": "My Repository",
- "homepage": "http://packages.example.org",
- "repositories": [
- { "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
- { "type": "vcs", "url": "http://svn.example.org/private/repo" },
- { "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
- ],
- "require-all": true
-}
-```
-
-If you want to cherry pick which packages you want, you can list all the
-packages you want to have in your satis repository inside the classic composer
-`require` key, using a `"*"` constraint to make sure all versions are selected,
-or another constraint if you want really specific versions.
-
-```json
-{
- "repositories": [
- { "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
- { "type": "vcs", "url": "http://svn.example.org/private/repo" },
- { "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
- ],
- "require": {
- "company/package": "*",
- "company/package2": "*",
- "company/package3": "2.0.0"
- }
-}
-```
-
-Once you've done this, you run:
-
- php bin/satis build
-
-When you ironed out that process, what you would typically do is run this
-command as a cron job on a server. It would then update all your package info
-much like Packagist does.
-
-Note that if your private packages are hosted on GitHub, your server should
-have an ssh key that gives it access to those packages, and then you should add
-the `--no-interaction` (or `-n`) flag to the command to make sure it falls back
-to ssh key authentication instead of prompting for a password. This is also a
-good trick for continuous integration servers.
-
-Set up a virtual-host that points to that `web/` directory, let's say it is
-`packages.example.org`. Alternatively, with PHP >= 5.4.0, you can use the
-built-in CLI server `php -S localhost:port -t satis-output-dir/` for a
-temporary solution.
-
-### Partial Updates
-
-You can tell Satis to selectively update only particular packages or process
-only a repository with a given URL. This cuts down the time it takes to rebuild
-the `package.json` file and is helpful if you use (custom) webhooks to trigger
-rebuilds whenever code is pushed into one of your repositories.
-
-To rebuild only particular packages, pass the package names on the command line
-like so:
-
- php bin/satis build satis.json web/ this/package that/other-package
-
-Note that this will still need to pull and scan all of your VCS repositories
-because any VCS repository might contain (on any branch) one of the selected
-packages.
-
-If you want to scan only a single repository and update all packages found in
-it, pass the VCS repository URL as an optional argument:
-
- php bin/satis build --repository-url https://only.my/repo.git satis.json web/
-
-## Usage
-
-In your projects all you need to add now is your own composer repository using
-the `packages.example.org` as URL, then you can require your private packages
-and everything should work smoothly. You don't need to copy all your
-repositories in every project anymore. Only that one unique repository that
-will update itself.
-
-```json
-{
- "repositories": [ { "type": "composer", "url": "http://packages.example.org/" } ],
- "require": {
- "company/package": "1.2.0",
- "company/package2": "1.5.2",
- "company/package3": "dev-master"
- }
-}
-```
-
-### Security
-
-To secure your private repository you can host it over SSH or SSL using a client
-certificate. In your project you can use the `options` parameter to specify the
-connection options for the server.
-
-Example using a custom repository using SSH (requires the SSH2 PECL extension):
-
-```json
-{
- "repositories": [{
- "type": "composer",
- "url": "ssh2.sftp://example.org",
- "options": {
- "ssh2": {
- "username": "composer",
- "pubkey_file": "/home/composer/.ssh/id_rsa.pub",
- "privkey_file": "/home/composer/.ssh/id_rsa"
- }
- }
- }]
-}
-```
-
-> **Tip:** See [ssh2 context options] for more information.
-
-Example using SSL/TLS (HTTPS) using a client certificate:
-
-```json
-{
- "repositories": [{
- "type": "composer",
- "url": "https://example.org",
- "options": {
- "ssl": {
- "local_cert": "/home/composer/.ssl/composer.pem"
- }
- }
- }]
-}
-```
-
-> **Tip:** See [ssl context options] for more information.
-
-Example using a custom HTTP Header field for token authentication:
-
-```json
-{
- "repositories": [{
- "type": "composer",
- "url": "https://example.org",
- "options": {
- "http": {
- "header": [
- "API-TOKEN: YOUR-API-TOKEN"
- ]
- }
- }
- }]
-}
-```
-
-### Authentication
-
-When your private repositories are password protected, you can store the
-authentication details permanently. The first time Composer needs to
-authenticate against some domain it will prompt you for a username/password and
-then you will be asked whether you want to store it.
-
-The storage can be done either globally in the `COMPOSER_HOME/auth.json` file
-(`COMPOSER_HOME` defaults to `~/.composer` or `%APPDATA%/Composer` on Windows)
-or also in the project directory directly sitting besides your composer.json.
-
-You can also configure these by hand using the config command if you need to
-configure a production machine to be able to run non-interactive installs. For
-example to enter credentials for example.org one could type:
-
- composer config http-basic.example.org username password
-
-That will store it in the current directory's auth.json, but if you want it
-available globally you can use the `--global` (`-g`) flag.
-
-### Downloads
-
-When GitHub, GitLab or BitBucket repositories are mirrored on your local satis, the
-build process will include the location of the downloads these platforms make
-available. This means that the repository and your setup depend on the
-availability of these services.
-
-At the same time, this implies that all code which is hosted somewhere else (on
-another service or for example in Subversion) will not have downloads available
-and thus installations usually take a lot longer.
-
-To enable your satis installation to create downloads for all (Git, Mercurial
-and Subversion) your packages, add the following to your `satis.json`:
-
-``` json
-{
- "archive": {
- "directory": "dist",
- "format": "tar",
- "prefix-url": "https://amazing.cdn.example.org",
- "skip-dev": true
- }
-}
-```
-
-#### Options explained
-
- * `directory`: required, the location of the dist files (inside the
- `output-dir`)
- * `format`: optional, `zip` (default) or `tar`
- * `prefix-url`: optional, location of the downloads, homepage (from
- `satis.json`) followed by `directory` by default
- * `skip-dev`: optional, `false` by default, when enabled (`true`) satis will
- not create downloads for branches
- * `absolute-directory`: optional, a _local_ directory where the dist files are
- dumped instead of `output-dir`/`directory`
- * `whitelist`: optional, if set as a list of package names, satis will only
- dump the dist files of these packages
- * `blacklist`: optional, if set as a list of package names, satis will not
- dump the dist files of these packages
- * `checksum`: optional, `true` by default, when disabled (`false`) satis will
- not provide the sha1 checksum for the dist files
-
-Once enabled, all downloads (include those from GitHub and BitBucket) will be
-replaced with a _local_ version.
-
-#### prefix-url
-
-Prefixing the URL with another host is especially helpful if the downloads end
-up in a private Amazon S3 bucket or on a CDN host. A CDN would drastically
-improve download times and therefore package installation.
-
-Example: A `prefix-url` of `https://my-bucket.s3.amazonaws.com` (and
-`directory` set to `dist`) creates download URLs which look like the following:
-`https://my-bucket.s3.amazonaws.com/dist/vendor-package-version-ref.zip`.
-
-### Web outputs
-
- * `output-html`: optional, `true` by default, when disabled (`false`) satis
- will not generate the `output-dir`/index.html page.
- * `twig-template`: optional, a path to a personalized [Twig] template for
- the `output-dir`/index.html page.
-
-### Abandoned packages
-
-To enable your satis installation to indicate that some packages are abandoned,
-add the following to your `satis.json`:
-
-```json
-{
- "abandoned": {
- "company/package": true,
- "company/package2": "company/newpackage"
- }
-}
-```
-
-The `true` value indicates that the package is truly abandoned while the
-`"company/newpackage"` value specifies that the package is replaced by the
-`company/newpackage` package.
-
-Note that all packages set as abandoned in their own `composer.json` file will
-be marked abandoned as well.
-
-### Resolving dependencies
-
-It is possible to make satis automatically resolve and add all dependencies for
-your projects. This can be used with the Downloads functionality to have a
-complete local mirror of packages. Add the following to your `satis.json`:
-
-```json
-{
- "require-dependencies": true,
- "require-dev-dependencies": true
-}
-```
-
-When searching for packages, satis will attempt to resolve all the required
-packages from the listed repositories. Therefore, if you are requiring a
-package from Packagist, you will need to define it in your `satis.json`.
-
-Dev dependencies are packaged only if the `require-dev-dependencies` parameter
-is set to true.
-
-### Other options
-
- * `providers`: optional, `false` by default, when enabled (`true`) each
- package will be dumped into a separate include file which will be only
- loaded by composer when the package is really required. Speeds up composer
- handling for repositories with huge number of packages like f.i. packagist.
- * `output-dir`: optional, defines where to output the repository files if not
- provided as an argument when calling the `build` command.
- * `config`: optional, lets you define all config options from composer, except
- `archive-format` and `archive-dir` as the configuration is done through
- [archive](#downloads) instead. See docs on [config schema] for more details.
- * `notify-batch`: optional, specify a URL that will be called every time a
- user installs a package. See [notify-batch].
-
-[ssh2 context options]: https://secure.php.net/manual/en/wrappers.ssh2.php#refsect1-wrappers.ssh2-options
-[ssl context options]: https://secure.php.net/manual/en/context.ssl.php
-[Twig]: https://twig.sensiolabs.org/
-[config schema]: https://getcomposer.org/doc/04-schema.md#config
-[notify-batch]: https://getcomposer.org/doc/05-repositories.md#notify-batch
diff --git a/app/vendor/composer/composer/doc/articles/handling-private-packages.md b/app/vendor/composer/composer/doc/articles/handling-private-packages.md
new file mode 100644
index 000000000..6dd0b8ee9
--- /dev/null
+++ b/app/vendor/composer/composer/doc/articles/handling-private-packages.md
@@ -0,0 +1,340 @@
+
+
+# Handling private packages
+
+# Private Packagist
+
+[Private Packagist](https://packagist.com) is a commercial package hosting product
+offering professional support and web based management of private and public packages,
+and granular access permissions. Private Packagist provides mirroring for packages' zip
+files which makes installs faster and independent from third party systems - e.g.
+you can deploy even if GitHub is down because your zip files are mirrored.
+
+Private Packagist is available as a hosted SaaS solution or as an on-premise self-hosted
+package, providing an interactive set up experience.
+
+Some of Private Packagist's revenue is used to pay for Composer and Packagist.org
+development and hosting so using it is a good way to support the maintenance of
+these open source projects financially. You can find more information about how to
+set up your own package archive on [Packagist.com](https://packagist.com).
+
+# Satis
+
+Satis on the other hand is open source but only a static `composer` repository
+generator. It is a bit like an ultra-lightweight, static file-based version of
+packagist and can be used to host the metadata of your company's private
+packages, or your own. You can get it from
+[GitHub](https://github.com/composer/satis) or install via CLI:
+
+ php composer.phar create-project composer/satis --stability=dev --keep-vcs
+
+## Setup
+
+For example let's assume you have a few packages you want to reuse across your
+company but don't really want to open-source. You would first define a Satis
+configuration: a json file with an arbitrary name that lists your curated
+[repositories](../05-repositories.md).
+
+Here is an example configuration, you see that it holds a few VCS repositories,
+but those could be any types of [repositories](../05-repositories.md). Then it
+uses `"require-all": true` which selects all versions of all packages in the
+repositories you defined.
+
+The default file Satis looks for is `satis.json` in the root of the repository.
+
+```json
+{
+ "name": "My Repository",
+ "homepage": "http://packages.example.org",
+ "repositories": [
+ { "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
+ { "type": "vcs", "url": "http://svn.example.org/private/repo" },
+ { "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
+ ],
+ "require-all": true
+}
+```
+
+If you want to cherry pick which packages you want, you can list all the
+packages you want to have in your satis repository inside the classic composer
+`require` key, using a `"*"` constraint to make sure all versions are selected,
+or another constraint if you want really specific versions.
+
+```json
+{
+ "repositories": [
+ { "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
+ { "type": "vcs", "url": "http://svn.example.org/private/repo" },
+ { "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
+ ],
+ "require": {
+ "company/package": "*",
+ "company/package2": "*",
+ "company/package3": "2.0.0"
+ }
+}
+```
+
+Once you've done this, you run:
+
+ php bin/satis build
+
+When you ironed out that process, what you would typically do is run this
+command as a cron job on a server. It would then update all your package info
+much like Packagist does.
+
+Note that if your private packages are hosted on GitHub, your server should
+have an ssh key that gives it access to those packages, and then you should add
+the `--no-interaction` (or `-n`) flag to the command to make sure it falls back
+to ssh key authentication instead of prompting for a password. This is also a
+good trick for continuous integration servers.
+
+Set up a virtual-host that points to that `web/` directory, let's say it is
+`packages.example.org`. Alternatively, with PHP >= 5.4.0, you can use the
+built-in CLI server `php -S localhost:port -t satis-output-dir/` for a
+temporary solution.
+
+### Partial Updates
+
+You can tell Satis to selectively update only particular packages or process
+only a repository with a given URL. This cuts down the time it takes to rebuild
+the `package.json` file and is helpful if you use (custom) webhooks to trigger
+rebuilds whenever code is pushed into one of your repositories.
+
+To rebuild only particular packages, pass the package names on the command line
+like so:
+
+ php bin/satis build satis.json web/ this/package that/other-package
+
+Note that this will still need to pull and scan all of your VCS repositories
+because any VCS repository might contain (on any branch) one of the selected
+packages.
+
+If you want to scan only the selected package and not all VCS repositories you need
+to declare a *name* for all your package (this only work on VCS repositories type) :
+
+```json
+{
+ "repositories": [
+ { "name": "company/privaterepo", "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
+ { "name": "private/repo", "type": "vcs", "url": "http://svn.example.org/private/repo" },
+ { "name": "mycompany/privaterepo2", "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
+ ]
+}
+```
+
+If you want to scan only a single repository and update all packages found in
+it, pass the VCS repository URL as an optional argument:
+
+ php bin/satis build --repository-url https://only.my/repo.git satis.json web/
+
+## Usage
+
+In your projects all you need to add now is your own composer repository using
+the `packages.example.org` as URL, then you can require your private packages
+and everything should work smoothly. You don't need to copy all your
+repositories in every project anymore. Only that one unique repository that
+will update itself.
+
+```json
+{
+ "repositories": [ { "type": "composer", "url": "http://packages.example.org/" } ],
+ "require": {
+ "company/package": "1.2.0",
+ "company/package2": "1.5.2",
+ "company/package3": "dev-master"
+ }
+}
+```
+
+### Security
+
+To secure your private repository you can host it over SSH or SSL using a client
+certificate. In your project you can use the `options` parameter to specify the
+connection options for the server.
+
+Example using a custom repository using SSH (requires the SSH2 PECL extension):
+
+```json
+{
+ "repositories": [{
+ "type": "composer",
+ "url": "ssh2.sftp://example.org",
+ "options": {
+ "ssh2": {
+ "username": "composer",
+ "pubkey_file": "/home/composer/.ssh/id_rsa.pub",
+ "privkey_file": "/home/composer/.ssh/id_rsa"
+ }
+ }
+ }]
+}
+```
+
+> **Tip:** See [ssh2 context options] for more information.
+
+Example using SSL/TLS (HTTPS) using a client certificate:
+
+```json
+{
+ "repositories": [{
+ "type": "composer",
+ "url": "https://example.org",
+ "options": {
+ "ssl": {
+ "local_cert": "/home/composer/.ssl/composer.pem"
+ }
+ }
+ }]
+}
+```
+
+> **Tip:** See [ssl context options] for more information.
+
+Example using a custom HTTP Header field for token authentication:
+
+```json
+{
+ "repositories": [{
+ "type": "composer",
+ "url": "https://example.org",
+ "options": {
+ "http": {
+ "header": [
+ "API-TOKEN: YOUR-API-TOKEN"
+ ]
+ }
+ }
+ }]
+}
+```
+
+### Authentication
+
+Authentication can be handled in [several different ways](authentication-for-private-packages.md).
+
+### Downloads
+
+When GitHub, GitLab or BitBucket repositories are mirrored on your local satis, the
+build process will include the location of the downloads these platforms make
+available. This means that the repository and your setup depend on the
+availability of these services.
+
+At the same time, this implies that all code which is hosted somewhere else (on
+another service or for example in Subversion) will not have downloads available
+and thus installations usually take a lot longer.
+
+To enable your satis installation to create downloads for all (Git, Mercurial
+and Subversion) your packages, add the following to your `satis.json`:
+
+``` json
+{
+ "archive": {
+ "directory": "dist",
+ "format": "tar",
+ "prefix-url": "https://amazing.cdn.example.org",
+ "skip-dev": true
+ }
+}
+```
+
+#### Options explained
+
+ * `directory`: required, the location of the dist files (inside the
+ `output-dir`)
+ * `format`: optional, `zip` (default) or `tar`
+ * `prefix-url`: optional, location of the downloads, homepage (from
+ `satis.json`) followed by `directory` by default
+ * `skip-dev`: optional, `false` by default, when enabled (`true`) satis will
+ not create downloads for branches
+ * `absolute-directory`: optional, a _local_ directory where the dist files are
+ dumped instead of `output-dir`/`directory`
+ * `whitelist`: optional, if set as a list of package names, satis will only
+ dump the dist files of these packages
+ * `blacklist`: optional, if set as a list of package names, satis will not
+ dump the dist files of these packages
+ * `checksum`: optional, `true` by default, when disabled (`false`) satis will
+ not provide the sha1 checksum for the dist files
+
+Once enabled, all downloads (include those from GitHub and BitBucket) will be
+replaced with a _local_ version.
+
+#### prefix-url
+
+Prefixing the URL with another host is especially helpful if the downloads end
+up in a private Amazon S3 bucket or on a CDN host. A CDN would drastically
+improve download times and therefore package installation.
+
+Example: A `prefix-url` of `https://my-bucket.s3.amazonaws.com` (and
+`directory` set to `dist`) creates download URLs which look like the following:
+`https://my-bucket.s3.amazonaws.com/dist/vendor-package-version-ref.zip`.
+
+### Web outputs
+
+ * `output-html`: optional, `true` by default, when disabled (`false`) satis
+ will not generate the `output-dir`/index.html page.
+ * `twig-template`: optional, a path to a personalized [Twig] template for
+ the `output-dir`/index.html page.
+
+### Abandoned packages
+
+To enable your satis installation to indicate that some packages are abandoned,
+add the following to your `satis.json`:
+
+```json
+{
+ "abandoned": {
+ "company/package": true,
+ "company/package2": "company/newpackage"
+ }
+}
+```
+
+The `true` value indicates that the package is truly abandoned while the
+`"company/newpackage"` value specifies that the package is replaced by the
+`company/newpackage` package.
+
+Note that all packages set as abandoned in their own `composer.json` file will
+be marked abandoned as well.
+
+### Resolving dependencies
+
+It is possible to make satis automatically resolve and add all dependencies for
+your projects. This can be used with the Downloads functionality to have a
+complete local mirror of packages. Add the following to your `satis.json`:
+
+```json
+{
+ "require-dependencies": true,
+ "require-dev-dependencies": true
+}
+```
+
+When searching for packages, satis will attempt to resolve all the required
+packages from the listed repositories. Therefore, if you are requiring a
+package from Packagist, you will need to define it in your `satis.json`.
+
+Dev dependencies are packaged only if the `require-dev-dependencies` parameter
+is set to true.
+
+### Other options
+
+ * `providers`: optional, `false` by default, when enabled (`true`) each
+ package will be dumped into a separate include file which will be only
+ loaded by composer when the package is really required. Speeds up composer
+ handling for repositories with huge number of packages like f.i. packagist.
+ * `output-dir`: optional, defines where to output the repository files if not
+ provided as an argument when calling the `build` command.
+ * `config`: optional, lets you define all config options from composer, except
+ `archive-format` and `archive-dir` as the configuration is done through
+ [archive](#downloads) instead. See docs on [config schema] for more details.
+ * `notify-batch`: optional, specify a URL that will be called every time a
+ user installs a package. See [notify-batch].
+
+[ssh2 context options]: https://secure.php.net/manual/en/wrappers.ssh2.php#refsect1-wrappers.ssh2-options
+[ssl context options]: https://secure.php.net/manual/en/context.ssl.php
+[Twig]: https://twig.sensiolabs.org/
+[config schema]: https://getcomposer.org/doc/04-schema.md#config
+[notify-batch]: https://getcomposer.org/doc/05-repositories.md#notify-batch
diff --git a/app/vendor/composer/composer/doc/articles/http-basic-authentication.md b/app/vendor/composer/composer/doc/articles/http-basic-authentication.md
deleted file mode 100644
index 7284e1c03..000000000
--- a/app/vendor/composer/composer/doc/articles/http-basic-authentication.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-# HTTP basic authentication
-
-Your [Satis or Toran Proxy](handling-private-packages-with-satis.md) server
-could be secured with http basic authentication. In order to allow your project
-to have access to these packages you will have to tell composer how to
-authenticate with your credentials.
-
-The simplest way to provide your credentials is providing your set
-of credentials inline with the repository specification such as:
-
-```json
-{
- "repositories": [
- {
- "type": "composer",
- "url": "https://extremely:secret@repo.example.org"
- }
- ]
-}
-```
-
-This will basically teach composer how to authenticate automatically
-when reading packages from the provided composer repository.
-
-This does not work for everybody especially when you don't want to
-hard code your credentials into your composer.json. There is a second
-way to provide these details and it is via interaction. If you don't
-provide the authentication credentials composer will prompt you upon
-connection to enter the username and password.
-
-The third way if you want to pre-configure it is via an `auth.json` file
-located in your `COMPOSER_HOME` or besides your `composer.json`.
-
-The file should contain a set of hostnames followed each with their own
-username/password pairs, for example:
-
-```json
-{
- "http-basic": {
- "repo.example1.org": {
- "username": "my-username1",
- "password": "my-secret-password1"
- },
- "repo.example2.org": {
- "username": "my-username2",
- "password": "my-secret-password2"
- }
- }
-}
-```
-
-The main advantage of the auth.json file is that it can be gitignored so
-that every developer in your team can place their own credentials in there,
-which makes revocation of credentials much easier than if you all share the
-same.
diff --git a/app/vendor/composer/composer/doc/articles/plugins.md b/app/vendor/composer/composer/doc/articles/plugins.md
index 228cbac9e..df374405b 100644
--- a/app/vendor/composer/composer/doc/articles/plugins.md
+++ b/app/vendor/composer/composer/doc/articles/plugins.md
@@ -9,7 +9,7 @@
You may wish to alter or expand Composer's functionality with your own. For
example if your environment poses special requirements on the behaviour of
Composer which do not apply to the majority of its users or if you wish to
-accomplish something with composer in a way that is not desired by most users.
+accomplish something with Composer in a way that is not desired by most users.
In these cases you could consider creating a plugin to handle your
specific logic.
@@ -30,21 +30,29 @@ requirements:
multiple plugins, this can be array of class names.
3. You must require the special package called `composer-plugin-api`
to define which Plugin API versions your plugin is compatible with.
+ Requiring this package doesn't actually include any extra dependencies,
+ it only specifies which version of the plugin API to use.
+
+> **Note:** When developing a plugin, although not required, it's useful to add
+> a require-dev dependency on `composer/composer` to have IDE auto completion on Composer classes.
The required version of the `composer-plugin-api` follows the same [rules][7]
as a normal package's.
-The current composer plugin API version is 1.1.0.
+The current Composer plugin API version is `2.1.0`.
An example of a valid plugin `composer.json` file (with the autoloading
-part omitted):
+part omitted and an optional require-dev dependency on `composer/composer` for IDE auto completion):
```json
{
"name": "my/plugin-package",
"type": "composer-plugin",
"require": {
- "composer-plugin-api": "^1.1"
+ "composer-plugin-api": "^2.0"
+ },
+ "require-dev": {
+ "composer/composer": "^2.0"
},
"extra": {
"class": "My\\Plugin"
@@ -94,6 +102,10 @@ and have it return an array. The array key must be the
[event name](https://getcomposer.org/doc/articles/scripts.md#event-names)
and the value is the name of the method in this class to be called.
+> **Note:** If you don't know which event to listen to, you can run a Composer
+> command with the COMPOSER_DEBUG_EVENTS=1 environment variable set, which might
+> help you identify what event you are looking for.
+
```php
public static function getSubscribedEvents()
{
@@ -161,6 +173,14 @@ class AwsPlugin implements PluginInterface, EventSubscriberInterface
$this->io = $io;
}
+ public function deactivate(Composer $composer, IOInterface $io)
+ {
+ }
+
+ public function uninstall(Composer $composer, IOInterface $io)
+ {
+ }
+
public static function getSubscribedEvents()
{
return array(
@@ -175,9 +195,7 @@ class AwsPlugin implements PluginInterface, EventSubscriberInterface
$protocol = parse_url($event->getProcessedUrl(), PHP_URL_SCHEME);
if ($protocol === 's3') {
- $awsClient = new AwsClient($this->io, $this->composer->getConfig());
- $s3RemoteFilesystem = new S3RemoteFilesystem($this->io, $event->getRemoteFilesystem()->getOptions(), $awsClient);
- $event->setRemoteFilesystem($s3RemoteFilesystem);
+ // ...
}
}
}
@@ -223,7 +241,7 @@ class Plugin implements PluginInterface, Capable
### Command provider
The [`Composer\Plugin\Capability\CommandProvider`][9] capability allows to register
-additional commands for Composer :
+additional commands for Composer:
```php
_Composer commands are based on the [Symfony Console Component][10]._
+## Running plugins manually
+
+Plugins for an event can be run manually by the `run-script` command. This works the same way as
+[running scripts manually](scripts.md#running-scripts-manually).
+
## Using Plugins
Plugin packages are automatically loaded as soon as they are installed and will
-be loaded when composer starts up if they are found in the current project's
+be loaded when Composer starts up if they are found in the current project's
list of installed packages. Additionally all plugin packages installed in the
-`COMPOSER_HOME` directory using the composer global command are loaded before
+`COMPOSER_HOME` directory using the Composer global command are loaded before
local project plugins are loaded.
-> You may pass the `--no-plugins` option to composer commands to disable all
+> You may pass the `--no-plugins` option to Composer commands to disable all
> installed plugins. This may be particularly helpful if any of the plugins
> causes errors and you wish to update or uninstall it.
+## Plugin Helpers
+
+As of Composer 2, due to the fact that DownloaderInterface can sometimes return Promises
+and have been split up in more steps than they used to, we provide a [SyncHelper][11]
+to make downloading and installing packages easier.
+
+## Plugin Extra Attributes
+
+A few special plugin capabilities can be unlocked using extra attributes in the plugin's composer.json.
+
+### class
+
+[See above](#plugin-package) for an explanation of the class attribute and how it works.
+
+### plugin-modifies-downloads
+
+Some special plugins need to update package download URLs before they get downloaded.
+
+As of Composer 2.0, all packages are downloaded before they get installed. This means
+on the first installation, your plugin is not yet installed when the download occurs,
+and it does not get a chance to update the URLs on time.
+
+Specifying `{"extra": {"plugin-modifies-downloads": true}}` in your composer.json will
+hint to Composer that the plugin should be installed on its own before proceeding with
+the rest of the package downloads. This slightly slows down the overall installation
+process however, so do not use it in plugins which do not absolutely require it.
+
[1]: ../04-schema.md#type
[2]: ../04-schema.md#extra
[3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php
@@ -283,3 +333,4 @@ local project plugins are loaded.
[8]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/Capable.php
[9]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/Capability/CommandProvider.php
[10]: https://symfony.com/doc/current/components/console.html
+[11]: https://github.com/composer/composer/blob/master/src/Composer/Util/SyncHelper.php
diff --git a/app/vendor/composer/composer/doc/articles/repository-priorities.md b/app/vendor/composer/composer/doc/articles/repository-priorities.md
new file mode 100644
index 000000000..e0053a80b
--- /dev/null
+++ b/app/vendor/composer/composer/doc/articles/repository-priorities.md
@@ -0,0 +1,95 @@
+
+
+# Repository priorities
+
+## Canonical repositories
+
+When Composer resolves dependencies, it will look up a given package in the
+topmost repository. If that repository does not contain the package, it
+goes on to the next one, until one repository contains it and the process ends.
+
+Canonical repositories are better for a few reasons:
+
+- Performance wise, it is more efficient to stop looking for a package once it
+has been found somewhere. It also avoids loading duplicate packages in case
+the same package is present in several of your repositories.
+- Security wise, it is safer to treat them canonically as it means that packages you
+expect to come from your most important repositories will never be loaded from
+another repository instead. Let's
+say you have a private repository which is not canonical, and you require your
+private package `foo/bar ^2.0` for example. Now if someone publishes
+`foo/bar 2.999` to packagist.org, suddenly Composer will pick that package as it
+has a higher version than your latest release (say 2.4.3), and you end up installing
+something you may not have meant to. If the private repository is canonical
+however, that 2.999 version from packagist.org will not be considered at all.
+
+There are however a few cases where you may want to specifically load some packages
+from a given repository, but not all. Or you may want a given repository to not be
+canonical, and to be only preferred if it has higher package versions than the
+repositories defined below.
+
+## Default behavior
+
+By default in Composer 2.x all repositories are canonical. Composer 1.x treated
+all repositories as non-canonical.
+
+Another default is that the packagist.org repository is always added implicitly
+as the last repository, unless you [disable it](../05-repositories.md#disabling-packagist-org).
+
+## Making repositories non-canonical
+
+You can add the canonical option to any repository to disable this default behavior
+and make sure Composer keeps looking in other repositories, even if that repository
+contains a given package.
+
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "canonical": false
+ }
+ ]
+}
+```
+
+## Filtering packages
+
+You can also filter packages which a repository will be able to load, either by
+selecting which ones you want, or by excluding those you do not want.
+
+For example here we want to pick only the package `foo/bar` and all the packages from
+`some-vendor/` from this composer repository.
+
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "only": ["foo/bar", "some-vendor/*"]
+ }
+ ]
+}
+```
+
+And in this other example we exclude `toy/package` from a repository, which
+we may not want to load in this project.
+
+```json
+{
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "exclude": ["toy/package"]
+ }
+ ]
+}
+```
+
+Both `only` and `exclude` should be arrays of package names, which can also
+contain wildcards (`*`) which will match any characters.
diff --git a/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md b/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md
new file mode 100644
index 000000000..2ee30a6d1
--- /dev/null
+++ b/app/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md
@@ -0,0 +1,62 @@
+
+
+# Resolving merge conflicts
+
+When working as a team on the same Composer project, you will eventually run into a scenario
+where multiple people added, updated or removed something in the `composer.json` and
+`composer.lock` files in multiple branches. When those branches are eventually merged
+together, you will get merge conflicts. Resolving these merge conflicts is not as straight
+forward as on other files, especially not regarding the `composer.lock` file.
+
+> **Note:** It might not immediately be obvious why text based merging is not possible for
+> lock files, so let's imagine the following example where we want to merge two branches;
+>
+> - Branch 1 has added package A which requires package B. Package B is locked at version `1.0.0`.
+> - Branch 2 has added package C which conflicts with all versions below `1.2.0` of package B.
+>
+> A text based merge would result in package A version `1.0.0`, package B version `1.0.0`
+> and package C version `1.0.0`. This is an invalid result, as the conflict of package C
+> was not considered and would require an upgrade of package B.
+
+## 1. Reapplying changes
+
+The safest method to merge Composer files is to accept the version from one branch and apply
+the changes from the other branch.
+
+An example where we have two branches:
+
+1. Package 'A' has been added
+2. Package 'B' has been removed and package 'C' is added.
+
+To resolve the conflict when we merge these two branches:
+
+- We choose the branch that has the most changes, and accept the `composer.json` and `composer.lock`
+ files from that branch. In this case, we choose the composer files from branch 2.
+- We reapply the changes from the other branch (branch 1). In this case we have to run
+ ```composer require package/A``` again.
+
+## 2. Validating your merged files
+
+Before committing, make sure the resulting `composer.json` and `composer.lock` files are valid.
+To do this, run the following commands:
+
+```sh
+composer validate
+composer install [--dry-run]
+```
+
+## Important considerations
+
+Keep in mind that whenever merge conflicts occur on the lock file, the information about the exact version
+new packages were locked on for one of the branches gets lost. When package A in branch 1 is constrained
+as `^1.2.0` and locked as `1.2.0`, it might get updated when branch 2 is used as baseline and a new
+`composer require package/A:^1.2.0` is executed, as that will use the most recent version that the
+constraint allows when possible. There might be a version 1.3.0 for that package available by now, which
+will now be used instead.
+
+Choosing the correct [version constraints](../articles/versions.md) and making sure the packages adhere
+to [semantic versioning](https://semver.org/) when using
+[next significant release operators](versions.md#next-significant-release-operators) should make sure
+that merging branches does not break anything by accidentally updating a dependency.
diff --git a/app/vendor/composer/composer/doc/articles/scripts.md b/app/vendor/composer/composer/doc/articles/scripts.md
index 79ea01519..ae43f26a0 100644
--- a/app/vendor/composer/composer/doc/articles/scripts.md
+++ b/app/vendor/composer/composer/doc/articles/scripts.md
@@ -29,6 +29,7 @@ Composer fires the following named events during its execution process:
the `install` command is executed without a lock file present.
- **post-update-cmd**: occurs after the `update` command has been executed, or
after the `install` command has been executed without a lock file present.
+- **pre-status-cmd**: occurs before the `status` command is executed.
- **post-status-cmd**: occurs after the `status` command has been executed.
- **pre-archive-cmd**: occurs before the `archive` command is executed.
- **post-archive-cmd**: occurs after the `archive` command has been executed.
@@ -37,14 +38,15 @@ Composer fires the following named events during its execution process:
- **post-autoload-dump**: occurs after the autoloader has been dumped, either
during `install`/`update`, or via the `dump-autoload` command.
- **post-root-package-install**: occurs after the root package has been
- installed, during the `create-project` command.
+ installed during the `create-project` command (but before its
+ dependencies are installed).
- **post-create-project-cmd**: occurs after the `create-project` command has
been executed.
### Installer Events
-- **pre-dependencies-solving**: occurs before the dependencies are resolved.
-- **post-dependencies-solving**: occurs after the dependencies have been resolved.
+- **pre-operations-exec**: occurs before the install/upgrade/.. operations
+ are executed when installing a lock file.
### Package Events
@@ -61,11 +63,15 @@ Composer fires the following named events during its execution process:
- **command**: occurs before any Composer Command is executed on the CLI. It
provides you with access to the input and output objects of the program.
- **pre-file-download**: occurs before files are downloaded and allows
- you to manipulate the `RemoteFilesystem` object prior to downloading files
+ you to manipulate the `HttpDownloader` object prior to downloading files
based on the URL to be downloaded.
+- **post-file-download**: occurs after package dist files are downloaded and
+ allows you to perform additional checks on the file if required.
- **pre-command-run**: occurs before a command is executed and allows you to
manipulate the `InputInterface` object's options and arguments to tweak
a command's behavior.
+- **pre-pool-create**: occurs before the Pool of packages is created, and lets
+ you filter the list of packages which is going to enter the Solver.
> **Note:** Composer makes no assumptions about the state of your dependencies
> prior to `install` or `update`. Therefore, you should not specify scripts
@@ -156,10 +162,11 @@ class MyClass
}
```
-**Note:** During a composer install or update process, a variable named
+**Note:** During a Composer `install` or `update` command run, a variable named
`COMPOSER_DEV_MODE` will be added to the environment. If the command was run
with the `--no-dev` flag, this variable will be set to 0, otherwise it will be
-set to 1.
+set to 1. The variable is also available while `dump-autoload` runs, and it
+will be set to same as the last `install` or `update` was run in.
## Event classes
@@ -171,14 +178,15 @@ Depending on the [script types](#event-names) you will get various event
subclasses containing various getters with relevant data and associated
objects:
-- Base class: [`Composer\EventDispatcher\Event`](https://getcomposer.org/apidoc/master/Composer/EventDispatcher/Event.html)
-- Command Events: [`Composer\Script\Event`](https://getcomposer.org/apidoc/master/Composer/Script/Event.html)
-- Installer Events: [`Composer\Installer\InstallerEvent`](https://getcomposer.org/apidoc/master/Composer/Installer/InstallerEvent.html)
-- Package Events: [`Composer\Installer\PackageEvent`](https://getcomposer.org/apidoc/master/Composer/Installer/PackageEvent.html)
+- Base class: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php)
+- Command Events: [`Composer\Script\Event`](https://github.com/composer/composer/blob/master/src/Composer/Script/Event.php)
+- Installer Events: [`Composer\Installer\InstallerEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallerEvent.php)
+- Package Events: [`Composer\Installer\PackageEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/PackageEvent.php)
- Plugin Events:
- - init: [`Composer\EventDispatcher\Event`](https://getcomposer.org/apidoc/master/Composer/EventDispatcher/Event.html)
- - command: [`Composer\Plugin\CommandEvent`](https://getcomposer.org/apidoc/master/Composer/Plugin/CommandEvent.html)
- - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://getcomposer.org/apidoc/master/Composer/Plugin/PreFileDownloadEvent.html)
+ - init: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php)
+ - command: [`Composer\Plugin\CommandEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/CommandEvent.php)
+ - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PreFileDownloadEvent.php)
+ - post-file-download: [`Composer\Plugin\PostFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PostFileDownloadEvent.php)
## Running scripts manually
@@ -189,7 +197,7 @@ composer run-script [--dev] [--no-dev] script
```
For example `composer run-script post-install-cmd` will run any
-**post-install-cmd** scripts that have been defined.
+**post-install-cmd** scripts and [plugins](plugins.md) that have been defined.
You can also give additional arguments to the script handler by appending `--`
followed by the handler arguments. e.g.
@@ -202,7 +210,7 @@ and can be retrieved as an array via `$event->getArguments()` by PHP handlers.
If you add custom scripts that do not fit one of the predefined event name
above, you can either run them with run-script or also run them as native
Composer commands. For example the handler defined below is executable by
-simply running `composer test`:
+running `composer test`:
```json
{
@@ -218,9 +226,59 @@ to the `phpunit` script.
> **Note:** Before executing scripts, Composer's bin-dir is temporarily pushed
> on top of the PATH environment variable so that binaries of dependencies
-> are easily accessible. In this example no matter if the `phpunit` binary is
+> are directly accessible. In this example no matter if the `phpunit` binary is
> actually in `vendor/bin/phpunit` or `bin/phpunit` it will be found and executed.
+Although Composer is not intended to manage long-running processes and other
+such aspects of PHP projects, it can sometimes be handy to disable the process
+timeout on custom commands. This timeout defaults to 300 seconds and can be
+overridden in a variety of ways depending on the desired effect:
+
+- disable it for all commands using the config key `process-timeout`,
+- disable it for the current or future invocations of composer using the
+ environment variable `COMPOSER_PROCESS_TIMEOUT`,
+- for a specific invocation using the `--timeout` flag of the `run-script` command,
+- using a static helper for specific scripts.
+
+To disable the timeout for specific scripts with the static helper directly in
+composer.json:
+
+```json
+{
+ "scripts": {
+ "test": [
+ "Composer\\Config::disableProcessTimeout",
+ "phpunit"
+ ]
+ }
+}
+```
+
+To disable the timeout for every script on a given project, you can use the
+composer.json configuration:
+
+```json
+{
+ "config": {
+ "process-timeout": 0
+ }
+}
+```
+
+It's also possible to set the global environment variable to disable the timeout
+of all following scripts in the current terminal environment:
+
+```
+export COMPOSER_PROCESS_TIMEOUT=0
+```
+
+To disable the timeout of a single script call, you must use the `run-script` composer
+command and specify the `--timeout` parameter:
+
+```
+composer run-script --timeout=0 test
+```
+
## Referencing scripts
To enable script re-use and avoid duplicates, you can call a script from another
@@ -238,6 +296,17 @@ one by prefixing the command name with `@`:
}
```
+You can also refer a script and pass it new arguments:
+
+```json
+{
+ "scripts": {
+ "tests": "phpunit",
+ "testsVerbose": "@tests -vvv"
+ }
+}
+```
+
## Calling Composer commands
To call Composer commands, you can use `@composer` which will automatically
@@ -278,6 +347,24 @@ One limitation of this is that you can not call multiple commands in
a row like `@php install && @php foo`. You must split them up in a
JSON array of commands.
+You can also call a shell/bash script, which will have the path to
+the PHP executable available in it as a `PHP_BINARY` env var.
+
+## Setting environment variables
+
+To set an environment variable in a cross-platform way, you can use `@putenv`:
+
+```json
+{
+ "scripts": {
+ "install-phpstan": [
+ "@putenv COMPOSER=phpstan-composer.json",
+ "composer install --prefer-dist"
+ ]
+ }
+}
+```
+
## Custom descriptions.
You can set custom script descriptions with the following in your `composer.json`:
@@ -290,4 +377,7 @@ You can set custom script descriptions with the following in your `composer.json
}
```
+The descriptions are used in `composer list` or `composer run -l` commands to
+describe what the scripts do when the command is run.
+
> **Note:** You can only set custom descriptions of custom commands.
diff --git a/app/vendor/composer/composer/doc/articles/troubleshooting.md b/app/vendor/composer/composer/doc/articles/troubleshooting.md
index d0a64506f..669d4ce55 100644
--- a/app/vendor/composer/composer/doc/articles/troubleshooting.md
+++ b/app/vendor/composer/composer/doc/articles/troubleshooting.md
@@ -7,22 +7,22 @@ This is a list of common pitfalls on using Composer, and how to avoid them.
## General
-1. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check
- for common problems. If it all checks out, proceed to the next steps.
-
-2. When facing any kind of problems using Composer, be sure to **work with the
+1. When facing any kind of problems using Composer, be sure to **work with the
latest version**. See [self-update](../03-cli.md#self-update) for details.
+
+2. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check
+ for common problems. If it all checks out, proceed to the next steps.
3. Make sure you have no problems with your setup by running the installer's
checks via `curl -sS https://getcomposer.org/installer | php -- --check`.
-4. Ensure you're **installing vendors straight from your `composer.json`** via
+4. Try clearing Composer's cache by running `composer clear-cache`.
+
+5. Ensure you're **installing vendors straight from your `composer.json`** via
`rm -rf vendor && composer update -v` when troubleshooting, excluding any
possible interferences with existing vendor installations or `composer.lock`
entries.
-5. Try clearing Composer's cache by running `composer clear-cache`.
-
## Package not found
1. Double-check you **don't have typos** in your `composer.json` or repository
@@ -47,32 +47,39 @@ This is a list of common pitfalls on using Composer, and how to avoid them.
In this case add the `--with-dependencies` argument **or** add all dependencies which
need an update to the command.
-## Package not found on travis-ci.org
+## Dependencies on the root package
-1. Check the ["Package not found"](#package-not-found) item above.
+When your root package depends on a package which ends up depending (directly or
+indirectly) back on the root package itself, issues can occur in two cases:
-2. If the package tested is a dependency of one of its dependencies (cyclic
- dependency), the problem might be that Composer is not able to detect the version
- of the package properly. If it is a git clone it is generally alright and Composer
- will detect the version of the current branch, but travis does shallow clones so
- that process can fail when testing pull requests and feature branches in general.
+1. During development, if you are on a branch like `dev-main` and the branch has no
+ [branch-alias](aliases.md#branch-alias) defined, and the dependency on the root package
+ requires version `^2.0` for example, the `dev-main` version will not satisfy it.
+ The best solution here is to make sure you first define a branch alias.
+
+2. In CI (Continuous Integration) runs, the problem might be that Composer is not able
+ to detect the version of the root package properly. If it is a git clone it is
+ generally alright and Composer will detect the version of the current branch,
+ but some CIs do shallow clones so that process can fail when testing pull requests
+ and feature branches. In these cases the branch alias may then not be recognized.
The best solution is to define the version you are on via an environment variable
- called COMPOSER_ROOT_VERSION. You set it to `dev-master` for example to define
- the root package's version as `dev-master`.
- Use: `before_script: COMPOSER_ROOT_VERSION=dev-master composer install` to export
- the variable for the call to composer.
+ called COMPOSER_ROOT_VERSION. You set it to `dev-main` for example to define
+ the root package's version as `dev-main`.
+ Use for example: `COMPOSER_ROOT_VERSION=dev-main composer install` to export
+ the variable only for the call to composer, or you can define it globally in the
+ CI env vars.
## Package not found in a Jenkins-build
1. Check the ["Package not found"](#package-not-found) item above.
-2. Reason for failing is similar to the problem which can occur on travis-ci.org: The
- git-clone / checkout within Jenkins leaves the branch in a "detached HEAD"-state. As
- a result, Composer is not able to identify the version of the current checked out branch
- and may not be able to resolve a cyclic dependency. To solve this problem, you can use
- the "Additional Behaviours" -> "Check out to specific local branch" in your Git-settings
- for your Jenkins-job, where your "local branch" shall be the same branch as you are
- checking out. Using this, the checkout will not be in detached state any more and cyclic
- dependency is recognized correctly.
+
+2. The git-clone / checkout within Jenkins leaves the branch in a "detached HEAD"-state. As
+ a result, Composer may not able to identify the version of the current checked out branch
+ and may not be able to resolve a [dependency on the root package](#dependencies-on-the-root-package).
+ To solve this problem, you can use the "Additional Behaviours" -> "Check out to specific local
+ branch" in your Git-settings for your Jenkins-job, where your "local branch" shall be the same
+ branch as you are checking out. Using this, the checkout will not be in detached state any more
+ and the dependency on the root package should become satisfied.
## I have a dependency which contains a "repositories" definition in its composer.json, but it seems to be ignored.
@@ -156,10 +163,10 @@ This issue can also happen on cPanel instances, when the shell fork bomb protect
## Xdebug impact on Composer
-To improve performance when the xdebug extension is enabled, Composer automatically restarts PHP without it.
+To improve performance when the Xdebug extension is enabled, Composer automatically restarts PHP without it.
You can override this behavior by using an environment variable: `COMPOSER_ALLOW_XDEBUG=1`.
-Composer will always show a warning if xdebug is being used, but you can override this with an environment variable:
+Composer will always show a warning if Xdebug is being used, but you can override this with an environment variable:
`COMPOSER_DISABLE_XDEBUG_WARN=1`. If you see this warning unexpectedly, then the restart process has failed:
please report this [issue](https://github.com/composer/composer/issues).
@@ -177,12 +184,7 @@ Because of GitHub's rate limits on their API it can happen that Composer prompts
for authentication asking your username and password so it can go ahead with its work.
If you would prefer not to provide your GitHub credentials to Composer you can
-manually create a token using the following procedure:
-
-1. [Create](https://github.com/settings/tokens) an OAuth token on GitHub.
-[Read more](https://github.com/blog/1509-personal-api-tokens) on this.
-
-2. Add it to the configuration running `composer config -g github-oauth.github.com `
+manually create a token using the [procedure documented here](authentication-for-private-packages.md#github-oauth).
Now Composer should install/update without asking for authentication.
@@ -207,10 +209,24 @@ To enable the swap you can use for example:
```sh
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
+/bin/chmod 0600 /var/swap.1
/sbin/swapon /var/swap.1
```
You can make a permanent swap file following this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04).
+## proc_open(): failed to open stream errors (Windows)
+
+If composer shows proc_open(NUL) errors on Windows:
+
+`proc_open(NUL): failed to open stream: No such file or directory`
+
+This could be happening because you are working in a _OneDrive_ directory and
+using a version of PHP that does not support the file system semantics of this
+service. The issue was fixed in PHP 7.2.23 and 7.3.10.
+
+Alternatively it could be because the Windows Null Service is not enabled. For
+more information, see this [issue](https://github.com/composer/composer/issues/7186#issuecomment-373134916).
+
## Degraded Mode
Due to some intermittent issues on Travis and other systems, we introduced a
diff --git a/app/vendor/composer/composer/doc/articles/versions.md b/app/vendor/composer/composer/doc/articles/versions.md
index c1fb25551..47f1f8910 100644
--- a/app/vendor/composer/composer/doc/articles/versions.md
+++ b/app/vendor/composer/composer/doc/articles/versions.md
@@ -18,7 +18,7 @@ In Composer, what's often referred to casually as a version -- that is,
the string that follows the package name in a require line (e.g., `~1.1` or
`1.2.*`) -- is actually more specifically a version constraint. Composer
uses version constraints to figure out which refs in a VCS it should be
-checking out (or simply to verify that a given library is acceptable in
+checking out (or to verify that a given library is acceptable in
the case of a statically-maintained library with a `version` specification
in `composer.json`).
@@ -32,7 +32,7 @@ repository:*
v1
v2
my-feature
-nother-feature
+another-feature
~/my-library$ git tag
v1.0
@@ -54,7 +54,7 @@ v2.0.2
Normally, Composer deals with tags (as opposed to branches -- if you don't
know what this means, read up on
-[version control systems](https://en.wikipedia.org/wiki/Version_control#Common_vocabulary)).
+[version control systems](https://en.wikipedia.org/wiki/Version_control#Common_terminology)).
When you write a version constraint, it may reference a specific tag (e.g.,
`1.1`) or it may reference a valid range of tags (e.g., `>=1.1 <2.0`, or
`~4.0`). To resolve these constraints, Composer first asks the VCS to list
@@ -80,6 +80,19 @@ In the above example, if you wanted to check out the `my-feature` branch, you wo
When branch names look like versions, we have to clarify for composer that we're trying to check out a branch and not a tag. In the above example, we have two version branches: `v1` and `v2`. To get Composer to check out one of these branches, you must specify a version constraint that looks like this: `v1.x-dev`. The `.x` is an arbitrary string that Composer requires to tell it that we're talking about the `v1` branch and not a `v1` tag (alternatively, you can name the branch `v1.x` instead of `v1`). In the case of a branch with a version-like name (`v1`, in this case), you append `-dev` as a suffix, rather than using `dev-` as a prefix.
+### Stabilities
+
+Composer recognizes the following stabilities (in order of stability): dev,
+alpha, beta, RC, and stable where RC stands for release candidate. The stability
+of a version is defined by its suffix e.g version `v1.1-BETA` has a stability of
+`beta` and `v1.1-RC1` has a stability of `RC`. If such a suffix is missing
+e.g. version `v1.1` then Composer considers that version `stable`. In addition
+to that Composer automatically adds a `-dev` suffix to all numeric branches and
+prefixes all other branches imported from a VCS repository with `dev-`. In both
+cases the stability `dev` gets assigned.
+
+Keeping this in mind will help you in the next section.
+
### Minimum Stability
There's one more thing that will affect which files are checked out of a library's VCS and added to your project: Composer allows you to specify stability constraints to limit which tags are considered valid. In the above example, note that the library released a beta and two release candidates for version `1.1` before the final official release. To receive these versions when running `composer install` or `composer update`, we have to explicitly tell Composer that we are ok with release candidates and beta releases (and alpha releases, if we want those). This can be done using either a project-wide `minimum-stability` value in `composer.json` or using "stability flags" in version constraints. Read more on the [schema page](../04-schema.md#minimum-stability).
@@ -111,13 +124,18 @@ will be treated as a **logical OR**. AND has higher precedence than OR.
> unexpectedly installing versions that break backwards compatibility.
> Consider using the [caret](#caret-version-range-) operator instead for safety.
+
+> **Note:** In older versions of Composer the single pipe (`|`) was the
+> recommended alternative to the **logical OR**. Thus for backwards compatibility
+> the single pipe (`|`) will still be treated as a **logical OR**.
+
Examples:
* `>=1.0`
* `>=1.0 <2.0`
* `>=1.0 <1.1 || >=1.2`
-### Hyphenated Version Range ( - )
+### Hyphenated Version Range (` - `)
Inclusive set of versions. Partial versions on the right include are completed
with a wildcard. For example `1.0 - 2.0` is equivalent to `>=1.0.0 <2.1` as the
@@ -126,7 +144,7 @@ with a wildcard. For example `1.0 - 2.0` is equivalent to `>=1.0.0 <2.1` as the
Example: `1.0 - 2.0`
-### Wildcard Version Range (.*)
+### Wildcard Version Range (`.*`)
You can specify a pattern with a `*` wildcard. `1.0.*` is the equivalent of
`>=1.0 <1.1`.
@@ -135,7 +153,7 @@ Example: `1.0.*`
## Next Significant Release Operators
-### Tilde Version Range (~)
+### Tilde Version Range (`~`)
The `~` operator is best explained by example: `~1.2` is equivalent to
`>=1.2 <2.0.0`, while `~1.2.3` is equivalent to `>=1.2.3 <1.3.0`. As you can see
@@ -157,9 +175,9 @@ Example: `~1.2`
> it will not allow the major number to increase trying to keep backwards
> compatibility.
-### Caret Version Range (^)
+### Caret Version Range (`^`)
-The `^` operator behaves very similarly but it sticks closer to semantic
+The `^` operator behaves very similarly, but it sticks closer to semantic
versioning, and will always allow non-breaking updates. For example `^1.2.3`
is equivalent to `>=1.2.3 <2.0.0` as none of the releases until 2.0 should
break backwards compatibility. For pre-1.0 versions it also acts with safety
@@ -201,7 +219,7 @@ setting. All available stability flags are listed on the minimum-stability
section of the [schema page](../04-schema.md#minimum-stability).
## Summary
-```json
+```jsonc
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2
diff --git a/app/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md b/app/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md
index 20a2e83ae..986fd5ec8 100644
--- a/app/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md
+++ b/app/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md
@@ -6,7 +6,8 @@ the default `vendor` folder by using
[composer/installers](https://github.com/composer/installers).
If you are a **package author** and want your package installed to a custom
-directory, simply require `composer/installers` and set the appropriate `type`.
+directory, require `composer/installers` and set the appropriate `type`.
+Specifying the package type, will override the default installer path.
This is common if your package is intended for a specific framework such as
CakePHP, Drupal or WordPress. Here is an example composer.json file for a
WordPress theme:
@@ -30,20 +31,24 @@ As a **package consumer** you can set or override the install path for a package
that requires composer/installers by configuring the `installer-paths` extra. A
useful example would be for a Drupal multisite setup where the package should be
installed into your sites subdirectory. Here we are overriding the install path
-for a module that uses composer/installers:
+for a module that uses composer/installers, as well as putting all packages of type
+`drupal-theme` into a themes folder:
```json
{
"extra": {
"installer-paths": {
- "sites/example.com/modules/{$name}": ["vendor/package"]
+ "sites/example.com/modules/{$name}": ["vendor/package"],
+ "sites/example.com/themes/{$name}": ["type:drupal-theme"]
}
}
}
```
Now the package would be installed to your folder location, rather than the default
-composer/installers determined location.
+composer/installers determined location. In addition, `installer-paths` is
+order-dependent, which means moving a package by name should come before the installer
+path of a `type:*` that matches the same package.
> **Note:** You cannot use this to change the path of any package. This is only
> applicable to packages that require `composer/installers` and use a custom type
diff --git a/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md b/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md
index 02ca21d2b..6299b6d40 100644
--- a/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md
+++ b/app/vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md
@@ -1,7 +1,7 @@
# How do I install Composer programmatically?
As noted on the download page, the installer script contains a
-signature which changes when the installer code changes and as such
+checksum which changes when the installer code changes and as such
it should not be relied upon in the long term.
An alternative is to use this script which only works with UNIX utilities:
@@ -9,13 +9,13 @@ An alternative is to use this script which only works with UNIX utilities:
```bash
#!/bin/sh
-EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
+EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
-ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")"
+ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
-if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
+if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
- >&2 echo 'ERROR: Invalid installer signature'
+ >&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
@@ -35,7 +35,7 @@ give it uniqueness and authenticity as long as you can trust the GitHub servers.
For example:
```bash
-wget https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer -O - -q | php -- --quiet
+wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet
```
You may replace the commit hash by whatever the last commit hash is on
diff --git a/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md b/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
index 14da5f5e3..67d4133d4 100644
--- a/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
+++ b/app/vendor/composer/composer/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
@@ -25,7 +25,7 @@ If you really feel like you must do this, you have a few options:
3. Remove the `.git` directory of every dependency after the installation, then
you can add them to your git repo. You can do that with `rm -rf vendor/**/.git`
in ZSH or `find vendor/ -type d -name ".git" -exec rm -rf {} \;` in Bash.
- but this means you will have to delete those dependencies from disk before
+ But this means you will have to delete those dependencies from disk before
running composer update.
4. Add a .gitignore rule (`/vendor/**/.git`) to ignore all the vendor `.git` folders.
This approach does not require that you delete dependencies from disk prior to
diff --git a/app/vendor/composer/composer/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md b/app/vendor/composer/composer/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md
index 9aef970f9..2039fa81b 100644
--- a/app/vendor/composer/composer/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md
+++ b/app/vendor/composer/composer/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md
@@ -5,7 +5,7 @@ A version constraint without an upper bound such as `*`, `>=3.4` or
This includes major versions breaking backward compatibility.
Once a release of your package is tagged, you cannot tweak its dependencies
-anymore in case a dependency breaks BC - you have to do a new release but the
+anymore in case a dependency breaks BC - you have to do a new release, but the
previous one stays broken.
The only good alternative is to define an upper bound on your constraints,
@@ -16,6 +16,6 @@ For example instead of using `>=3.4` you should use `~3.4` which allows all
versions up to `3.999` but does not include `4.0` and above. The `^` operator
works very well with libraries following [semantic versioning](https://semver.org).
-**Note:** As a package maintainer, you can make the life of your users easier
+**Note:** As a package maintainer, you can help your users
by providing an [alias version](../articles/aliases.md) for your development
branch to allow it to match bound constraints.
diff --git a/app/vendor/composer/composer/doc/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md b/app/vendor/composer/composer/doc/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md
index f4aa5b157..12927fbfa 100644
--- a/app/vendor/composer/composer/doc/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md
+++ b/app/vendor/composer/composer/doc/faqs/why-are-version-constraints-combining-comparisons-and-wildcards-a-bad-idea.md
@@ -17,5 +17,5 @@ of a package in version 3.0.0 or not. Should it match because you asked for
`>=2` or should it not match because you asked for a `2.*`?
For this reason, Composer throws an error and says that this is invalid.
-The easy way to fix it is to think about what you really mean, and use only
-one of those rules.
\ No newline at end of file
+The way to fix it is to think about what you really mean, and use only
+one of those rules.
diff --git a/app/vendor/composer/composer/doc/faqs/why-can't-composer-load-repositories-recursively.md b/app/vendor/composer/composer/doc/faqs/why-can't-composer-load-repositories-recursively.md
index efcd00772..1dff52c40 100644
--- a/app/vendor/composer/composer/doc/faqs/why-can't-composer-load-repositories-recursively.md
+++ b/app/vendor/composer/composer/doc/faqs/why-can't-composer-load-repositories-recursively.md
@@ -15,7 +15,7 @@ associated with inline VCS repositories.
There are three ways the dependency solver could work with custom repositories:
- Fetch the repositories of root package, get all the packages from the defined
-repositories, resolve requirements. This is the current state and it works well
+repositories, then resolve requirements. This is the current state and it works well
except for the limitation of not loading repositories recursively.
- Fetch the repositories of root package, while initializing packages from the
@@ -24,7 +24,7 @@ their package's packages, etc, then resolve requirements. It could work, but it
slows down the initialization a lot since VCS repos can each take a few seconds,
and it could end up in a completely broken state since many versions of a package
could define the same packages inside a package repository, but with different
-dist/source. There are many many ways this could go wrong.
+dist/source. There are many ways this could go wrong.
- Fetch the repositories of root package, then fetch the repositories of the
first level dependencies, then fetch the repositories of their dependencies, etc,
diff --git a/app/vendor/composer/composer/doc/fixtures/fixtures.md b/app/vendor/composer/composer/doc/fixtures/fixtures.md
index d67edb220..051d5aad3 100644
--- a/app/vendor/composer/composer/doc/fixtures/fixtures.md
+++ b/app/vendor/composer/composer/doc/fixtures/fixtures.md
@@ -4,7 +4,7 @@ This directory contains some examples of what `composer` type repositories can
look like. They serve as illustrating examples accompanying the docs, but can
also be used as (initial) fixtures for tests.
-* `repo-composer-plain` is a simple, plain `packages.json` file
+* `repo-composer-plain` is a basic, plain `packages.json` file
* `repo-composer-with-includes` uses the `includes` mechanism
* `repo-composer-with-providers` uses the `providers` mechanism
@@ -12,11 +12,10 @@ also be used as (initial) fixtures for tests.
All these repositories contain the following packages.
-* `foo/bar` versions 1.0.0, 1.0.1 and 1.1.0; dev-default and 1.0.x-dev branches.
- On dev-default and in 1.1.0, `bar/baz` ~1.0 is required.
-* `qux/quux` only has a dev-default branch. It `replace`s `gar/nix`.
-* `gar/nix` has a 1.0.0 version and a dev-default branch. It is being replaced
+* `foo/bar` versions `1.0.0`, `1.0.1` and `1.1.0`; `dev-default` and `1.0.x-dev` branches.
+ On `dev-default` and in `1.1.0`, `bar/baz` `~1.0` is required.
+* `qux/quux` only has a `dev-default` branch. It `replace`s `gar/nix`.
+* `gar/nix` has a `1.0.0` version and a `dev-default` branch. It is being replaced
by `qux/quux`.
-* `bar/baz` has a 1.0.0 version and 1.0.x-dev as well as dev-default branches.
- Additionally, 1.1.x-dev is a branch alias for dev-default.
-
+* `bar/baz` has a `1.0.0` version and `1.0.x-dev` as well as `dev-default` branches.
+ Additionally, `1.1.x-dev` is a branch alias for `dev-default`.
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/bar/baz$923363b3c22e73abb2e3fd891c8156dd4d0821a97fd3e428bc910833e3e46dbe.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/bar/baz$923363b3c22e73abb2e3fd891c8156dd4d0821a97fd3e428bc910833e3e46dbe.json
index 94a43b019..77739fece 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/bar/baz$923363b3c22e73abb2e3fd891c8156dd4d0821a97fd3e428bc910833e3e46dbe.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/bar/baz$923363b3c22e73abb2e3fd891c8156dd4d0821a97fd3e428bc910833e3e46dbe.json
@@ -47,4 +47,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/foo/bar$4baabb3303afa3e34a4d3af18fb138e5f3b79029c1f8d9ab5b477ea15776ba0a.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/foo/bar$4baabb3303afa3e34a4d3af18fb138e5f3b79029c1f8d9ab5b477ea15776ba0a.json
index 7dc7cc91e..378b04003 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/foo/bar$4baabb3303afa3e34a4d3af18fb138e5f3b79029c1f8d9ab5b477ea15776ba0a.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/foo/bar$4baabb3303afa3e34a4d3af18fb138e5f3b79029c1f8d9ab5b477ea15776ba0a.json
@@ -74,4 +74,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/gar/nix$5d210670cb46c8364c8e3fb449967b9bea558b971e5b082f330ae4f1d484c321.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/gar/nix$5d210670cb46c8364c8e3fb449967b9bea558b971e5b082f330ae4f1d484c321.json
index 512b8d882..68e399351 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/gar/nix$5d210670cb46c8364c8e3fb449967b9bea558b971e5b082f330ae4f1d484c321.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/gar/nix$5d210670cb46c8364c8e3fb449967b9bea558b971e5b082f330ae4f1d484c321.json
@@ -47,4 +47,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/provider-active$1893a061e579543822389ecd12d791c612db0c05e22d90e9286e233cacd86ed8.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/provider-active$1893a061e579543822389ecd12d791c612db0c05e22d90e9286e233cacd86ed8.json
index b82eb418e..6c45294f8 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/provider-active$1893a061e579543822389ecd12d791c612db0c05e22d90e9286e233cacd86ed8.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/provider-active$1893a061e579543822389ecd12d791c612db0c05e22d90e9286e233cacd86ed8.json
@@ -13,4 +13,4 @@
"sha256": "c142d1a07ca354be46b613f59f1d601923a5a00ccc5fcce50a77ecdd461eb72d"
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/qux/quux$c142d1a07ca354be46b613f59f1d601923a5a00ccc5fcce50a77ecdd461eb72d.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/qux/quux$c142d1a07ca354be46b613f59f1d601923a5a00ccc5fcce50a77ecdd461eb72d.json
index 014187206..dc1b84dce 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/qux/quux$c142d1a07ca354be46b613f59f1d601923a5a00ccc5fcce50a77ecdd461eb72d.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/p/qux/quux$c142d1a07ca354be46b613f59f1d601923a5a00ccc5fcce50a77ecdd461eb72d.json
@@ -19,4 +19,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/packages.json b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/packages.json
index 65968a861..35fd6e30b 100644
--- a/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/packages.json
+++ b/app/vendor/composer/composer/doc/fixtures/repo-composer-with-providers/packages.json
@@ -6,4 +6,4 @@
"sha256": "1893a061e579543822389ecd12d791c612db0c05e22d90e9286e233cacd86ed8"
}
}
-}
\ No newline at end of file
+}
diff --git a/app/vendor/composer/composer/phpunit.xml.dist b/app/vendor/composer/composer/phpunit.xml.dist
deleted file mode 100644
index 4c6749521..000000000
--- a/app/vendor/composer/composer/phpunit.xml.dist
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- ./tests/Composer/
-
-
-
-
-
- slow
- legacy
-
-
-
-
-
- ./src/Composer/
-
- ./src/Composer/Autoload/ClassLoader.php
-
-
-
-
diff --git a/app/vendor/composer/composer/res/composer-repository-schema.json b/app/vendor/composer/composer/res/composer-repository-schema.json
index 914d8e22a..adcc299d6 100644
--- a/app/vendor/composer/composer/res/composer-repository-schema.json
+++ b/app/vendor/composer/composer/res/composer-repository-schema.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json-schema.org/draft-04/schema#",
+ "$schema": "https://json-schema.org/draft-04/schema#",
"description": "A representation of packages metadata.",
"type": "object",
"oneOf": [
diff --git a/app/vendor/composer/composer/res/composer-schema.json b/app/vendor/composer/composer/res/composer-schema.json
index 2ff405f1e..bb86996e7 100644
--- a/app/vendor/composer/composer/res/composer-schema.json
+++ b/app/vendor/composer/composer/res/composer-schema.json
@@ -1,17 +1,17 @@
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "name": "Package",
+ "$schema": "https://json-schema.org/draft-04/schema#",
+ "title": "Package",
"type": "object",
- "additionalProperties": false,
- "required": [ "name", "description" ],
"properties": {
"name": {
"type": "string",
- "description": "Package name, including 'vendor-name/' prefix."
+ "description": "Package name, including 'vendor-name/' prefix.",
+ "pattern": "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$"
},
"type": {
"description": "Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
- "type": "string"
+ "type": "string",
+ "pattern": "^[a-z0-9-]+$"
},
"target-dir": {
"description": "DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.",
@@ -39,7 +39,8 @@
},
"version": {
"type": "string",
- "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes."
+ "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes.",
+ "pattern": "^v?\\d+(\\.\\d+){0,3}|^dev-"
},
"time": {
"type": "string",
@@ -138,7 +139,20 @@
"gitlab-token": {
"type": "object",
"description": "A hash of domain name => gitlab private tokens, typically {\"gitlab.com\":\"\"}.",
- "additionalProperties": true
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "gitlab-protocol": {
+ "enum": ["git", "http", "https"],
+ "description": "A protocol to force use of when creating a repository URL for the `source` value of the package metadata. One of `git` or `http`. By default, Composer will generate a git URL for private repositories and http one for public repos."
+ },
+ "bearer": {
+ "type": "object",
+ "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"\"}.",
+ "additionalProperties": {
+ "type": "string"
+ }
},
"disable-tls": {
"type": "boolean",
@@ -148,6 +162,13 @@
"type": "boolean",
"description": "Defaults to `true`. If set to true only HTTPS URLs are allowed to be downloaded via Composer. If you really absolutely need HTTP access to something then you can disable it, but using \"Let's Encrypt\" to get a free SSL certificate is generally a better alternative."
},
+ "secure-svn-domains": {
+ "type": "array",
+ "description": "A list of domains which should be trusted/marked as using a secure Subversion/SVN transport. By default svn:// protocol is seen as insecure and will throw. This is a better/safer alternative to disabling `secure-http` altogether.",
+ "items": {
+ "type": "string"
+ }
+ },
"cafile": {
"type": "string",
"description": "A way to set the path to the openssl CA file. In PHP 5.6+ you should rather set this via openssl.cafile in php.ini, although PHP 5.6+ should be able to detect your system CA file automatically."
@@ -225,9 +246,13 @@
"type": ["string", "integer"],
"description": "The cache max size for the files cache, defaults to \"300MiB\"."
},
+ "cache-read-only": {
+ "type": ["boolean"],
+ "description": "Whether to use the Composer cache in read-only mode."
+ },
"bin-compat": {
- "enum": ["auto", "full"],
- "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed) and can be \"full\" (compatible with both Windows and Unix-based systems)."
+ "enum": ["auto", "full", "symlink"],
+ "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed), can be \"full\" (compatible with both Windows and Unix-based systems) and \"symlink\" (symlink also for WSL)."
},
"discard-changes": {
"type": ["string", "boolean"],
@@ -271,6 +296,10 @@
"type": "string"
}
},
+ "use-github-api": {
+ "type": "boolean",
+ "description": "Defaults to true. If set to false, globally disables the use of the GitHub API for all GitHub repositories and clones the repository as it would for any other repository."
+ },
"archive-format": {
"type": "string",
"description": "The default archiving format when not provided on cli, defaults to \"tar\"."
@@ -286,6 +315,14 @@
"sort-packages": {
"type": "boolean",
"description": "Defaults to false. If set to true, Composer will sort packages when adding/updating a new dependency."
+ },
+ "lock": {
+ "type": "boolean",
+ "description": "Defaults to true. If set to false, Composer will not create a composer.lock file."
+ },
+ "platform-check": {
+ "type": ["boolean", "string"],
+ "description": "Defaults to \"php-only\" which checks only the PHP version. Setting to true will also check the presence of required PHP extensions. If set to false, Composer will not create and require a platform_check.php file as part of the autoloader bootstrap."
}
}
},
@@ -323,7 +360,7 @@
},
"classmap": {
"type": "array",
- "description": "This is an array of directories that contain classes to be included in the class-map generation process."
+ "description": "This is an array of paths that contain classes to be included in the class-map generation process."
},
"files": {
"type": "array",
@@ -335,6 +372,10 @@
"type": ["object"],
"description": "Options for creating package archives for distribution.",
"properties": {
+ "name": {
+ "type": "string",
+ "description": "A base name for archive."
+ },
"exclude": {
"type": "array",
"description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark."
@@ -345,13 +386,13 @@
"type": ["object", "array"],
"description": "A set of additional repositories where packages can be found.",
"additionalProperties": {
- "oneOf": [
+ "anyOf": [
{ "$ref": "#/definitions/repository" },
{ "type": "boolean", "enum": [false] }
]
},
"items": {
- "oneOf": [
+ "anyOf": [
{ "$ref": "#/definitions/repository" },
{
"type": "object",
@@ -365,7 +406,7 @@
"minimum-stability": {
"type": ["string"],
"description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.",
- "pattern": "^dev|alpha|beta|rc|RC|stable$"
+ "enum": ["dev", "alpha", "beta", "rc", "RC", "stable"]
},
"prefer-stable": {
"type": ["boolean"],
@@ -490,6 +531,11 @@
"description": "IRC channel for support, as irc://server/channel.",
"format": "uri"
},
+ "chat": {
+ "type": "string",
+ "description": "URL to the support chat.",
+ "format": "uri"
+ },
"source": {
"type": "string",
"description": "URL to browse or download the sources.",
@@ -507,6 +553,24 @@
}
}
},
+ "funding": {
+ "type": "array",
+ "description": "A list of options to fund the development and maintenance of the package.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of funding or platform through which funding is possible."
+ },
+ "url": {
+ "type": "string",
+ "description": "URL to a website with details on funding and a way to fund the package.",
+ "format": "uri"
+ }
+ }
+ }
+ },
"non-feature-branches": {
"type": ["array"],
"description": "A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.",
@@ -514,6 +578,10 @@
"type": "string"
}
},
+ "default-branch": {
+ "type": ["boolean"],
+ "description": "Internal use only, do not specify this in composer.json. Indicates whether this version is the default branch of the linked VCS repository. Defaults to false."
+ },
"abandoned": {
"type": ["boolean", "string"],
"description": "Indicates whether this package has been abandoned, it can be boolean or a package name/URL pointing to a recommended alternative. Defaults to false."
@@ -579,7 +647,7 @@
},
"classmap": {
"type": "array",
- "description": "This is an array of directories that contain classes to be included in the class-map generation process."
+ "description": "This is an array of paths that contain classes to be included in the class-map generation process."
},
"files": {
"type": "array",
@@ -593,7 +661,7 @@
},
"repository": {
"type": "object",
- "oneOf": [
+ "anyOf": [
{ "$ref": "#/definitions/composer-repository" },
{ "$ref": "#/definitions/vcs-repository" },
{ "$ref": "#/definitions/path-repository" },
@@ -608,6 +676,19 @@
"properties": {
"type": { "type": "string", "enum": ["composer"] },
"url": { "type": "string" },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"options": {
"type": "object",
"additionalProperties": true
@@ -622,6 +703,19 @@
"properties": {
"type": { "type": "string", "enum": ["vcs", "github", "git", "gitlab", "git-bitbucket", "hg", "hg-bitbucket", "fossil", "perforce", "svn"] },
"url": { "type": "string" },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"no-api": { "type": "boolean" },
"secure-http": { "type": "boolean" },
"svn-cache-credentials": { "type": "boolean" },
@@ -642,6 +736,19 @@
"properties": {
"type": { "type": "string", "enum": ["path"] },
"url": { "type": "string" },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"options": {
"type": "object",
"properties": {
@@ -656,7 +763,20 @@
"required": ["type", "url"],
"properties": {
"type": { "type": "string", "enum": ["artifact"] },
- "url": { "type": "string" }
+ "url": { "type": "string" },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
}
},
"pear-repository": {
@@ -665,6 +785,19 @@
"properties": {
"type": { "type": "string", "enum": ["pear"] },
"url": { "type": "string" },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"vendor-alias": { "type": "string" }
}
},
@@ -673,6 +806,19 @@
"required": ["type", "package"],
"properties": {
"type": { "type": "string", "enum": ["package"] },
+ "canonical": { "type": "boolean" },
+ "only": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"package": {
"oneOf": [
{ "$ref": "#/definitions/inline-package" },
diff --git a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
index d54f3d6f6..47c888ab7 100644
--- a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
+++ b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
@@ -18,9 +18,16 @@
use Composer\IO\IOInterface;
use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
+use Composer\Package\RootPackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
+use Composer\Repository\PlatformRepository;
+use Composer\Semver\Constraint\Bound;
+use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Util\Filesystem;
+use Composer\Util\Platform;
use Composer\Script\ScriptEvents;
+use Composer\Util\PackageSorter;
+use Composer\Json\JsonFile;
/**
* @author Igor Wiedler
@@ -34,14 +41,14 @@ class AutoloadGenerator
private $eventDispatcher;
/**
- * @var IOInterface
+ * @var ?IOInterface
*/
private $io;
/**
- * @var bool
+ * @var ?bool
*/
- private $devMode = false;
+ private $devMode = null;
/**
* @var bool
@@ -53,11 +60,21 @@ class AutoloadGenerator
*/
private $apcu = false;
+ /**
+ * @var string|null
+ */
+ private $apcuPrefix;
+
/**
* @var bool
*/
private $runScripts = false;
+ /**
+ * @var bool|array
+ */
+ private $ignorePlatformReqs = false;
+
public function __construct(EventDispatcher $eventDispatcher, IOInterface $io = null)
{
$this->eventDispatcher = $eventDispatcher;
@@ -83,11 +100,13 @@ public function setClassMapAuthoritative($classMapAuthoritative)
/**
* Whether or not generated autoloader considers APCu caching.
*
- * @param bool $apcu
+ * @param bool $apcu
+ * @param string|null $apcuPrefix
*/
- public function setApcu($apcu)
+ public function setApcu($apcu, $apcuPrefix = null)
{
$this->apcu = (bool) $apcu;
+ $this->apcuPrefix = $apcuPrefix !== null ? (string) $apcuPrefix : $apcuPrefix;
}
/**
@@ -100,15 +119,55 @@ public function setRunScripts($runScripts = true)
$this->runScripts = (bool) $runScripts;
}
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')
+ /**
+ * Sets whether platform requirements should be ignored
+ *
+ * If this is set to true, the platform check file will not be generated
+ * If this is set to false, the platform check file will be generated with all requirements
+ * If this is set to string[], those packages will be ignored from the platform check file
+ *
+ * @param array|bool $ignorePlatformReqs
+ */
+ public function setIgnorePlatformRequirements($ignorePlatformReqs)
+ {
+ if (is_array($ignorePlatformReqs)) {
+ $this->ignorePlatformReqs = array_filter($ignorePlatformReqs, function ($req) {
+ return PlatformRepository::isPlatformPackage($req);
+ });
+ } else {
+ $this->ignorePlatformReqs = (bool) $ignorePlatformReqs;
+ }
+ }
+
+ public function dump(Config $config, InstalledRepositoryInterface $localRepo, RootPackageInterface $rootPackage, InstallationManager $installationManager, $targetDir, $scanPsrPackages = false, $suffix = '')
{
if ($this->classMapAuthoritative) {
- // Force scanPsr0Packages when classmap is authoritative
- $scanPsr0Packages = true;
+ // Force scanPsrPackages when classmap is authoritative
+ $scanPsrPackages = true;
+ }
+
+ // auto-set devMode based on whether dev dependencies are installed or not
+ if (null === $this->devMode) {
+ // we assume no-dev mode if no vendor dir is present or it is too old to contain dev information
+ $this->devMode = false;
+
+ $installedJson = new JsonFile($config->get('vendor-dir').'/composer/installed.json');
+ if ($installedJson->exists()) {
+ $installedJson = $installedJson->read();
+ if (isset($installedJson['dev'])) {
+ $this->devMode = $installedJson['dev'];
+ }
+ }
}
+
if ($this->runScripts) {
+ // set COMPOSER_DEV_MODE in case not set yet so it is available in the dump-autoload event listeners
+ if (!isset($_SERVER['COMPOSER_DEV_MODE'])) {
+ Platform::putEnv('COMPOSER_DEV_MODE', $this->devMode ? '1' : '0');
+ }
+
$this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode, array(), array(
- 'optimize' => (bool) $scanPsr0Packages,
+ 'optimize' => (bool) $scanPsrPackages,
));
}
@@ -156,8 +215,16 @@ public function dump(Config $config, InstalledRepositoryInterface $localRepo, Pa
EOF;
// Collect information from all packages.
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage, $this->devMode === false);
+ $devPackageNames = $localRepo->getDevPackageNames();
+ $packageMap = $this->buildPackageMap($installationManager, $rootPackage, $localRepo->getCanonicalPackages());
+ if ($this->devMode) {
+ // if dev mode is enabled, then we do not filter any dev packages out so disable this entirely
+ $filteredDevPackages = false;
+ } else {
+ // if the list of dev package names is available we use that straight, otherwise pass true which means use legacy algo to figure them out
+ $filteredDevPackages = $devPackageNames ?: true;
+ }
+ $autoloads = $this->parseAutoloads($packageMap, $rootPackage, $filteredDevPackages);
// Process the 'psr-0' base directories.
foreach ($autoloads['psr-0'] as $namespace => $paths) {
@@ -197,9 +264,9 @@ public function dump(Config $config, InstalledRepositoryInterface $localRepo, Pa
// add custom psr-0 autoloading if the root package has a target dir
$targetDirLoader = null;
- $mainAutoload = $mainPackage->getAutoload();
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
- $levels = substr_count($filesystem->normalizePath($mainPackage->getTargetDir()), '/') + 1;
+ $mainAutoload = $rootPackage->getAutoload();
+ if ($rootPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
+ $levels = substr_count($filesystem->normalizePath($rootPackage->getTargetDir()), '/') + 1;
$prefixes = implode(', ', array_map(function ($prefix) {
return var_export($prefix, true);
}, array_keys($mainAutoload['psr-0'])));
@@ -228,18 +295,23 @@ public static function autoload(\$class)
EOF;
}
- $blacklist = null;
+ $excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) {
- $blacklist = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
+ $excluded = $autoloads['exclude-from-classmap'];
}
- // flatten array
$classMap = array();
- if ($scanPsr0Packages) {
+ $ambiguousClasses = array();
+ $scannedFiles = array();
+ foreach ($autoloads['classmap'] as $dir) {
+ $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, null, null, $classMap, $ambiguousClasses, $scannedFiles);
+ }
+
+ if ($scanPsrPackages) {
$namespacesToScan = array();
// Scan the PSR-0/4 directories for class files, and add them to the class map
- foreach (array('psr-0', 'psr-4') as $psrType) {
+ foreach (array('psr-4', 'psr-0') as $psrType) {
foreach ($autoloads[$psrType] as $namespace => $paths) {
$namespacesToScan[$namespace][] = array('paths' => $paths, 'type' => $psrType);
}
@@ -255,17 +327,22 @@ public static function autoload(\$class)
continue;
}
- $namespaceFilter = $namespace === '' ? null : $namespace;
- $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $classMap);
+ $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespace, $group['type'], $classMap, $ambiguousClasses, $scannedFiles);
}
}
}
}
- foreach ($autoloads['classmap'] as $dir) {
- $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, $classMap);
+ foreach ($ambiguousClasses as $className => $ambigiousPaths) {
+ $cleanPath = str_replace(array('$vendorDir . \'', '$baseDir . \'', "',\n"), array($vendorPath, $basePath, ''), $classMap[$className]);
+
+ $this->io->writeError(
+ 'Warning: Ambiguous class resolution, "'.$className.'"'.
+ ' was found '. (count($ambigiousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.'
+ );
}
+ $classMap['Composer\\InstalledVersions'] = "\$vendorDir . '/composer/InstalledVersions.php',\n";
ksort($classMap);
foreach ($classMap as $class => $code) {
$classmapFile .= ' '.var_export($class, true).' => '.$code;
@@ -273,7 +350,7 @@ public static function autoload(\$class)
$classmapFile .= ");\n";
if (!$suffix) {
- if (!$config->get('autoloader-suffix') && is_readable($vendorPath.'/autoload.php')) {
+ if (!$config->get('autoloader-suffix') && Filesystem::isReadable($vendorPath.'/autoload.php')) {
$content = file_get_contents($vendorPath.'/autoload.php');
if (preg_match('{ComposerAutoloaderInit([^:\s]+)::}', $content, $match)) {
$suffix = $match[1];
@@ -285,61 +362,99 @@ public static function autoload(\$class)
}
}
- file_put_contents($targetDir.'/autoload_namespaces.php', $namespacesFile);
- file_put_contents($targetDir.'/autoload_psr4.php', $psr4File);
- file_put_contents($targetDir.'/autoload_classmap.php', $classmapFile);
+ $filesystem->filePutContentsIfModified($targetDir.'/autoload_namespaces.php', $namespacesFile);
+ $filesystem->filePutContentsIfModified($targetDir.'/autoload_psr4.php', $psr4File);
+ $filesystem->filePutContentsIfModified($targetDir.'/autoload_classmap.php', $classmapFile);
$includePathFilePath = $targetDir.'/include_paths.php';
if ($includePathFileContents = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
- file_put_contents($includePathFilePath, $includePathFileContents);
+ $filesystem->filePutContentsIfModified($includePathFilePath, $includePathFileContents);
} elseif (file_exists($includePathFilePath)) {
unlink($includePathFilePath);
}
$includeFilesFilePath = $targetDir.'/autoload_files.php';
if ($includeFilesFileContents = $this->getIncludeFilesFile($autoloads['files'], $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
- file_put_contents($includeFilesFilePath, $includeFilesFileContents);
+ $filesystem->filePutContentsIfModified($includeFilesFilePath, $includeFilesFileContents);
} elseif (file_exists($includeFilesFilePath)) {
unlink($includeFilesFilePath);
}
- file_put_contents($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath, $staticPhpVersion));
- file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
- file_put_contents($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion));
+ $filesystem->filePutContentsIfModified($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath, $staticPhpVersion));
+ $checkPlatform = $config->get('platform-check') && $this->ignorePlatformReqs !== true;
+ $platformCheckContent = null;
+ if ($checkPlatform) {
+ $platformCheckContent = $this->getPlatformCheck($packageMap, $this->ignorePlatformReqs ?: array(), $config->get('platform-check'), $devPackageNames);
+ if (null === $platformCheckContent) {
+ $checkPlatform = false;
+ }
+ }
+ if ($checkPlatform) {
+ $filesystem->filePutContentsIfModified($targetDir.'/platform_check.php', $platformCheckContent);
+ } elseif (file_exists($targetDir.'/platform_check.php')) {
+ unlink($targetDir.'/platform_check.php');
+ }
+ $filesystem->filePutContentsIfModified($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
+ $filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform));
- $this->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
- $this->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
+ $filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
+ $filesystem->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
if ($this->runScripts) {
$this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array(
- 'optimize' => (bool) $scanPsr0Packages,
+ 'optimize' => (bool) $scanPsrPackages,
));
}
+
+ return count($classMap);
}
- private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, array $classMap = array())
+ private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles)
{
- foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter) as $class => $path) {
+ foreach ($this->generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, true, $scannedFiles) as $class => $path) {
$pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n";
if (!isset($classMap[$class])) {
$classMap[$class] = $pathCode;
} elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) {
- $this->io->writeError(
- 'Warning: Ambiguous class resolution, "'.$class.'"'.
- ' was found in both "'.str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$class]).'" and "'.$path.'", the first will be used.'
- );
+ $ambiguousClasses[$class][] = $path;
}
}
return $classMap;
}
- private function generateClassMap($dir, $blacklist = null, $namespaceFilter = null, $showAmbiguousWarning = true)
+ /**
+ * @param ?array $excluded
+ */
+ private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, $showAmbiguousWarning, array &$scannedFiles)
{
- return ClassMapGenerator::createMap($dir, $blacklist, $showAmbiguousWarning ? $this->io : null, $namespaceFilter);
+ if ($excluded) {
+ // filter excluded patterns here to only use those matching $dir
+ // exclude-from-classmap patterns are all realpath'd so we can only filter them if $dir exists so that realpath($dir) will work
+ // if $dir does not exist, it should anyway not find anything there so no trouble
+ if (file_exists($dir)) {
+ // transform $dir in the same way that exclude-from-classmap patterns are transformed so we can match them against each other
+ $dirMatch = preg_quote(strtr(realpath($dir), '\\', '/'));
+ foreach ($excluded as $index => $pattern) {
+ // extract the constant string prefix of the pattern here, until we reach a non-escaped regex special character
+ $pattern = preg_replace('{^(([^.+*?\[^\]$(){}=!<>|:\\\\#-]+|\\\\[.+*?\[^\]$(){}=!<>|:#-])*).*}', '$1', $pattern);
+ // if the pattern is not a subset or superset of $dir, it is unrelated and we skip it
+ if (0 !== strpos($pattern, $dirMatch) && 0 !== strpos($dirMatch, $pattern)) {
+ unset($excluded[$index]);
+ }
+ }
+ }
+
+ $excluded = $excluded ? '{(' . implode('|', $excluded) . ')}' : null;
+ }
+
+ return ClassMapGenerator::createMap($dir, $excluded, $showAmbiguousWarning ? $this->io : null, $namespaceFilter, $autoloadType, $scannedFiles);
}
- public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
+ /**
+ * @param RootPackageInterface $rootPackage
+ */
+ public function buildPackageMap(InstallationManager $installationManager, PackageInterface $rootPackage, array $packages)
{
// build package => install path map
- $packageMap = array(array($mainPackage, ''));
+ $packageMap = array(array($rootPackage, ''));
foreach ($packages as $package) {
if ($package instanceof AliasPackage) {
@@ -381,26 +496,30 @@ protected function validatePackage(PackageInterface $package)
/**
* Compiles an ordered list of namespace => path mappings
*
- * @param array $packageMap array of array(package, installDir-relative-to-composer.json)
- * @param PackageInterface $mainPackage root package instance
- * @param bool $filterOutRequireDevPackages whether to filter out require-dev packages
- * @return array array('psr-0' => array('Ns\\Foo' => array('installDir')))
+ * @param array $packageMap array of array(package, installDir-relative-to-composer.json)
+ * @param RootPackageInterface $rootPackage root package instance
+ * @param bool|string[] $filteredDevPackages If an array, the list of packages that must be removed. If bool, whether to filter out require-dev packages
+ * @return array array('psr-0' => array('Ns\\Foo' => array('installDir')))
*/
- public function parseAutoloads(array $packageMap, PackageInterface $mainPackage, $filterOutRequireDevPackages = false)
+ public function parseAutoloads(array $packageMap, PackageInterface $rootPackage, $filteredDevPackages = false)
{
- $mainPackageMap = array_shift($packageMap);
- if ($filterOutRequireDevPackages) {
- $packageMap = $this->filterPackageMap($packageMap, $mainPackage);
+ $rootPackageMap = array_shift($packageMap);
+ if (is_array($filteredDevPackages)) {
+ $packageMap = array_filter($packageMap, function ($item) use ($filteredDevPackages) {
+ return !in_array($item[0]->getName(), $filteredDevPackages, true);
+ });
+ } elseif ($filteredDevPackages) {
+ $packageMap = $this->filterPackageMap($packageMap, $rootPackage);
}
$sortedPackageMap = $this->sortPackageMap($packageMap);
- $sortedPackageMap[] = $mainPackageMap;
- array_unshift($packageMap, $mainPackageMap);
+ $sortedPackageMap[] = $rootPackageMap;
+ array_unshift($packageMap, $rootPackageMap);
- $psr0 = $this->parseAutoloadsType($packageMap, 'psr-0', $mainPackage);
- $psr4 = $this->parseAutoloadsType($packageMap, 'psr-4', $mainPackage);
- $classmap = $this->parseAutoloadsType(array_reverse($sortedPackageMap), 'classmap', $mainPackage);
- $files = $this->parseAutoloadsType($sortedPackageMap, 'files', $mainPackage);
- $exclude = $this->parseAutoloadsType($sortedPackageMap, 'exclude-from-classmap', $mainPackage);
+ $psr0 = $this->parseAutoloadsType($packageMap, 'psr-0', $rootPackage);
+ $psr4 = $this->parseAutoloadsType($packageMap, 'psr-4', $rootPackage);
+ $classmap = $this->parseAutoloadsType(array_reverse($sortedPackageMap), 'classmap', $rootPackage);
+ $files = $this->parseAutoloadsType($sortedPackageMap, 'files', $rootPackage);
+ $exclude = $this->parseAutoloadsType($sortedPackageMap, 'exclude-from-classmap', $rootPackage);
krsort($psr0);
krsort($psr4);
@@ -420,9 +539,9 @@ public function parseAutoloads(array $packageMap, PackageInterface $mainPackage,
* @param array $autoloads see parseAutoloads return value
* @return ClassLoader
*/
- public function createLoader(array $autoloads)
+ public function createLoader(array $autoloads, $vendorDir = null)
{
- $loader = new ClassLoader();
+ $loader = new ClassLoader($vendorDir);
if (isset($autoloads['psr-0'])) {
foreach ($autoloads['psr-0'] as $namespace => $path) {
@@ -437,14 +556,15 @@ public function createLoader(array $autoloads)
}
if (isset($autoloads['classmap'])) {
- $blacklist = null;
+ $excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) {
- $blacklist = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
+ $excluded = $autoloads['exclude-from-classmap'];
}
+ $scannedFiles = array();
foreach ($autoloads['classmap'] as $dir) {
try {
- $loader->addClassMap($this->generateClassMap($dir, $blacklist, null, false));
+ $loader->addClassMap($this->generateClassMap($dir, $excluded, null, null, false, $scannedFiles));
} catch (\RuntimeException $e) {
$this->io->writeError(''.$e->getMessage().'');
}
@@ -543,11 +663,163 @@ protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $
}
}
- if (preg_match('/\.phar.+$/', $path)) {
+ if (strpos($path, '.phar') !== false) {
$baseDir = "'phar://' . " . $baseDir;
}
- return $baseDir . (($path !== false) ? var_export($path, true) : "");
+ return $baseDir . var_export($path, true);
+ }
+
+ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs, $checkPlatform, array $devPackageNames)
+ {
+ $lowestPhpVersion = Bound::zero();
+ $requiredExtensions = array();
+ $extensionProviders = array();
+
+ foreach ($packageMap as $item) {
+ $package = $item[0];
+ foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) {
+ if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
+ $extensionProviders[$match[1]][] = $link->getConstraint() ?: new MatchAllConstraint();
+ }
+ }
+ }
+
+ foreach ($packageMap as $item) {
+ $package = $item[0];
+ // skip dev dependencies platform requirements as platform-check really should only be a production safeguard
+ if (in_array($package->getName(), $devPackageNames, true)) {
+ continue;
+ }
+
+ foreach ($package->getRequires() as $link) {
+ if (in_array($link->getTarget(), $ignorePlatformReqs, true)) {
+ continue;
+ }
+
+ if ('php' === $link->getTarget() && ($constraint = $link->getConstraint())) {
+ if ($constraint->getLowerBound()->compareTo($lowestPhpVersion, '>')) {
+ $lowestPhpVersion = $constraint->getLowerBound();
+ }
+ }
+
+ if ($checkPlatform === true && preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
+ // skip extension checks if they have a valid provider/replacer
+ if (isset($extensionProviders[$match[1]])) {
+ foreach ($extensionProviders[$match[1]] as $provided) {
+ if (!$link->getConstraint() || $provided->matches($link->getConstraint())) {
+ continue 2;
+ }
+ }
+ }
+
+ if ($match[1] === 'zend-opcache') {
+ $match[1] = 'zend opcache';
+ }
+
+ $extension = var_export($match[1], true);
+ if ($match[1] === 'pcntl' || $match[1] === 'readline') {
+ $requiredExtensions[$extension] = "PHP_SAPI !== 'cli' || extension_loaded($extension) || \$missingExtensions[] = $extension;\n";
+ } else {
+ $requiredExtensions[$extension] = "extension_loaded($extension) || \$missingExtensions[] = $extension;\n";
+ }
+ }
+ }
+ }
+
+ ksort($requiredExtensions);
+
+ $formatToPhpVersionId = function (Bound $bound) {
+ if ($bound->isZero()) {
+ return 0;
+ }
+
+ if ($bound->isPositiveInfinity()) {
+ return 99999;
+ }
+
+ $version = str_replace('-', '.', $bound->getVersion());
+ $chunks = array_map('intval', explode('.', $version));
+
+ return $chunks[0] * 10000 + $chunks[1] * 100 + $chunks[2];
+ };
+
+ $formatToHumanReadable = function (Bound $bound) {
+ if ($bound->isZero()) {
+ return 0;
+ }
+
+ if ($bound->isPositiveInfinity()) {
+ return 99999;
+ }
+
+ $version = str_replace('-', '.', $bound->getVersion());
+ $chunks = explode('.', $version);
+ $chunks = array_slice($chunks, 0, 3);
+
+ return implode('.', $chunks);
+ };
+
+ $requiredPhp = '';
+ $requiredPhpError = '';
+ if (!$lowestPhpVersion->isZero()) {
+ $operator = $lowestPhpVersion->isInclusive() ? '>=' : '>';
+ $requiredPhp = 'PHP_VERSION_ID '.$operator.' '.$formatToPhpVersionId($lowestPhpVersion);
+ $requiredPhpError = '"'.$operator.' '.$formatToHumanReadable($lowestPhpVersion).'"';
+ }
+
+ if ($requiredPhp) {
+ $requiredPhp = <<= $staticPhpVersion && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if (\$useStaticLoader) {
- require_once __DIR__ . '/autoload_static.php';
+ require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader));
} else {
@@ -658,9 +945,9 @@ public static function getLoader()
}
if ($this->apcu) {
- $apcuPrefix = substr(base64_encode(md5(uniqid('', true), true)), 0, -3);
+ $apcuPrefix = var_export(($this->apcuPrefix !== null ? $this->apcuPrefix : substr(base64_encode(md5(uniqid('', true), true)), 0, -3)), true);
$file .= <<setApcuPrefix('$apcuPrefix');
+ \$loader->setApcuPrefix($apcuPrefix);
APCU;
}
@@ -767,10 +1054,14 @@ class ComposerStaticInit$suffix
$filesystem = new Filesystem();
$vendorPathCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/";
+ $vendorPharPathCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/";
$appBaseDirCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/";
+ $appBaseDirPharCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/";
$absoluteVendorPathCode = ' => ' . substr(var_export(rtrim($vendorDir, '\\/') . '/', true), 0, -1);
+ $absoluteVendorPharPathCode = ' => ' . substr(var_export(rtrim('phar://' . $vendorDir, '\\/') . '/', true), 0, -1);
$absoluteAppBaseDirCode = ' => ' . substr(var_export(rtrim($baseDir, '\\/') . '/', true), 0, -1);
+ $absoluteAppBaseDirPharCode = ' => ' . substr(var_export(rtrim('phar://' . $baseDir, '\\/') . '/', true), 0, -1);
$initializer = '';
$prefix = "\0Composer\Autoload\ClassLoader\0";
@@ -793,9 +1084,15 @@ class ComposerStaticInit$suffix
// See https://bugs.php.net/68057
$staticPhpVersion = 70000;
}
- $value = var_export($value, true);
- $value = str_replace($absoluteVendorPathCode, $vendorPathCode, $value);
- $value = str_replace($absoluteAppBaseDirCode, $appBaseDirCode, $value);
+ $value = strtr(
+ var_export($value, true),
+ array(
+ $absoluteVendorPathCode => $vendorPathCode,
+ $absoluteVendorPharPathCode => $vendorPharPathCode,
+ $absoluteAppBaseDirCode => $appBaseDirCode,
+ $absoluteAppBaseDirPharCode => $appBaseDirPharCode,
+ )
+ );
$value = ltrim(preg_replace('/^ */m', ' $0$0', $value));
$file .= sprintf(" public static $%s = %s;\n\n", $prop, $value);
@@ -816,7 +1113,7 @@ public static function getInitializer(ClassLoader \$loader)
INITIALIZER;
}
- protected function parseAutoloadsType(array $packageMap, $type, PackageInterface $mainPackage)
+ protected function parseAutoloadsType(array $packageMap, $type, RootPackageInterface $rootPackage)
{
$autoloads = array();
@@ -824,7 +1121,7 @@ protected function parseAutoloadsType(array $packageMap, $type, PackageInterface
list($package, $installPath) = $item;
$autoload = $package->getAutoload();
- if ($this->devMode && $package === $mainPackage) {
+ if ($this->devMode && $package === $rootPackage) {
$autoload = array_merge_recursive($autoload, $package->getDevAutoload());
}
@@ -832,15 +1129,15 @@ protected function parseAutoloadsType(array $packageMap, $type, PackageInterface
if (!isset($autoload[$type]) || !is_array($autoload[$type])) {
continue;
}
- if (null !== $package->getTargetDir() && $package !== $mainPackage) {
+ if (null !== $package->getTargetDir() && $package !== $rootPackage) {
$installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
}
foreach ($autoload[$type] as $namespace => $paths) {
foreach ((array) $paths as $path) {
- if (($type === 'files' || $type === 'classmap' || $type === 'exclude-from-classmap') && $package->getTargetDir() && !is_readable($installPath.'/'.$path)) {
+ if (($type === 'files' || $type === 'classmap' || $type === 'exclude-from-classmap') && $package->getTargetDir() && !Filesystem::isReadable($installPath.'/'.$path)) {
// remove target-dir from file paths of the root package
- if ($package === $mainPackage) {
+ if ($package === $rootPackage) {
$targetDir = str_replace('\\', '[\\\\/]', preg_quote(str_replace(array('/', '\\'), '', $package->getTargetDir())));
$path = ltrim(preg_replace('{^'.$targetDir.'}', '', ltrim($path, '\\/')), '\\/');
} else {
@@ -854,8 +1151,7 @@ protected function parseAutoloadsType(array $packageMap, $type, PackageInterface
$path = preg_replace('{/+}', '/', preg_quote(trim(strtr($path, '\\', '/'), '/')));
// add support for wildcards * and **
- $path = str_replace('\\*\\*', '.+?', $path);
- $path = str_replace('\\*', '[^/]+?', $path);
+ $path = strtr($path, array('\\*\\*' => '.+?', '\\*' => '[^/]+?'));
// add support for up-level relative paths
$updir = null;
@@ -876,7 +1172,7 @@ function ($matches) use (&$updir) {
}
$resolvedPath = realpath($installPath . '/' . $updir);
- $autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path;
+ $autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path . '($|/)';
continue;
}
@@ -885,7 +1181,8 @@ function ($matches) use (&$updir) {
if ($type === 'files') {
$autoloads[$this->getFileIdentifier($package, $path)] = $relativePath;
continue;
- } elseif ($type === 'classmap') {
+ }
+ if ($type === 'classmap') {
$autoloads[] = $relativePath;
continue;
}
@@ -906,24 +1203,31 @@ protected function getFileIdentifier(PackageInterface $package, $path)
/**
* Filters out dev-dependencies
*
- * @param array $packageMap
- * @param PackageInterface $mainPackage
+ * @param array $packageMap
+ * @param RootPackageInterface $rootPackage
* @return array
*/
- protected function filterPackageMap(array $packageMap, PackageInterface $mainPackage)
+ protected function filterPackageMap(array $packageMap, RootPackageInterface $rootPackage)
{
$packages = array();
$include = array();
+ $replacedBy = array();
foreach ($packageMap as $item) {
$package = $item[0];
$name = $package->getName();
$packages[$name] = $package;
+ foreach ($package->getReplaces() as $replace) {
+ $replacedBy[$replace->getTarget()] = $name;
+ }
}
- $add = function (PackageInterface $package) use (&$add, $packages, &$include) {
+ $add = function (PackageInterface $package) use (&$add, $packages, &$include, $replacedBy) {
foreach ($package->getRequires() as $link) {
$target = $link->getTarget();
+ if (isset($replacedBy[$target])) {
+ $target = $replacedBy[$target];
+ }
if (!isset($include[$target])) {
$include[$target] = true;
if (isset($packages[$target])) {
@@ -932,15 +1236,19 @@ protected function filterPackageMap(array $packageMap, PackageInterface $mainPac
}
}
};
- $add($mainPackage);
+ $add($rootPackage);
return array_filter(
$packageMap,
function ($item) use ($include) {
$package = $item[0];
- $name = $package->getName();
+ foreach ($package->getNames() as $name) {
+ if (isset($include[$name])) {
+ return true;
+ }
+ }
- return isset($include[$name]);
+ return false;
}
);
}
@@ -957,99 +1265,23 @@ protected function sortPackageMap(array $packageMap)
{
$packages = array();
$paths = array();
- $usageList = array();
foreach ($packageMap as $item) {
list($package, $path) = $item;
$name = $package->getName();
$packages[$name] = $package;
$paths[$name] = $path;
-
- foreach (array_merge($package->getRequires(), $package->getDevRequires()) as $link) {
- $target = $link->getTarget();
- $usageList[$target][] = $name;
- }
}
- $computing = array();
- $computed = array();
- $computeImportance = function ($name) use (&$computeImportance, &$computing, &$computed, $usageList) {
- // reusing computed importance
- if (isset($computed[$name])) {
- return $computed[$name];
- }
-
- // canceling circular dependency
- if (isset($computing[$name])) {
- return 0;
- }
-
- $computing[$name] = true;
- $weight = 0;
-
- if (isset($usageList[$name])) {
- foreach ($usageList[$name] as $user) {
- $weight -= 1 - $computeImportance($user);
- }
- }
-
- unset($computing[$name]);
- $computed[$name] = $weight;
-
- return $weight;
- };
-
- $weightList = array();
-
- foreach ($packages as $name => $package) {
- $weight = $computeImportance($name);
- $weightList[$name] = $weight;
- }
-
- $stable_sort = function (&$array) {
- static $transform, $restore;
-
- $i = 0;
-
- if (!$transform) {
- $transform = function (&$v, $k) use (&$i) {
- $v = array($v, ++$i, $k, $v);
- };
-
- $restore = function (&$v, $k) {
- $v = $v[3];
- };
- }
-
- array_walk($array, $transform);
- asort($array);
- array_walk($array, $restore);
- };
-
- $stable_sort($weightList);
+ $sortedPackages = PackageSorter::sortPackages($packages);
$sortedPackageMap = array();
- foreach (array_keys($weightList) as $name) {
+ foreach ($sortedPackages as $package) {
+ $name = $package->getName();
$sortedPackageMap[] = array($packages[$name], $paths[$name]);
}
return $sortedPackageMap;
}
-
- /**
- * Copy file using stream_copy_to_stream to work around https://bugs.php.net/bug.php?id=6463
- *
- * @param string $source
- * @param string $target
- */
- protected function safeCopy($source, $target)
- {
- $source = fopen($source, 'r');
- $target = fopen($target, 'w+');
-
- stream_copy_to_stream($source, $target);
- fclose($source);
- fclose($target);
- }
}
diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php
index 95f7e0978..0cd6055d1 100644
--- a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php
+++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php
@@ -37,57 +37,130 @@
*
* @author Fabien Potencier
* @author Jordi Boggiano
- * @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 ?string */
+ private $vendorDir;
+
// PSR-4
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixLengthsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixDirsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr4 = array();
// PSR-0
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
private $prefixesPsr0 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
private $fallbackDirsPsr0 = array();
+ /** @var bool */
private $useIncludePath = false;
+
+ /**
+ * @var string[]
+ * @psalm-var array
+ */
private $classMap = array();
+
+ /** @var bool */
private $classMapAuthoritative = false;
+
+ /**
+ * @var bool[]
+ * @psalm-var array
+ */
private $missingClasses = array();
+
+ /** @var ?string */
private $apcuPrefix;
+ /**
+ * @var self[]
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param ?string $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ /**
+ * @return 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[]
+ * @psalm-return array>
+ */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
+ /**
+ * @return string[] Array of classname => path
+ * @psalm-var array
+ */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param array $classMap Class to filename map
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
+ *
+ * @return void
*/
public function addClassMap(array $classMap)
{
@@ -102,9 +175,11 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param 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)
{
@@ -147,11 +222,13 @@ public function add($prefix, $paths, $prepend = false)
* 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 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)
{
@@ -195,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false)
* 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 string[]|string $paths The PSR-0 base directories
+ *
+ * @return void
*/
public function set($prefix, $paths)
{
@@ -211,10 +290,12 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
+ *
+ * @return void
*/
public function setPsr4($prefix, $paths)
{
@@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths)
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
+ *
+ * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -256,6 +339,8 @@ public function getUseIncludePath()
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
+ *
+ * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -276,10 +361,12 @@ public function isClassMapAuthoritative()
* 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)
{
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -296,25 +383,44 @@ public function getApcuPrefix()
* 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)
{
@@ -323,6 +429,8 @@ public function loadClass($class)
return true;
}
+
+ return null;
}
/**
@@ -367,6 +475,21 @@ public function findFile($class)
return $file;
}
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return 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
@@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext)
* Scope isolated include.
*
* Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ * @private
*/
function includeFile($file)
{
diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php
index 5d937433b..dfe255a54 100644
--- a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php
+++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php
@@ -33,8 +33,8 @@ class ClassMapGenerator
/**
* Generate a class map file
*
- * @param \Traversable $dirs Directories or a single path to search in
- * @param string $file The name of the class map file
+ * @param \Traversable|array $dirs Directories or a single path to search in
+ * @param string $file The name of the class map file
*/
public static function dump($dirs, $file)
{
@@ -50,20 +50,22 @@ public static function dump($dirs, $file)
/**
* Iterate over all files in the given directory searching for classes
*
- * @param \Iterator|string $path The path to search in or an iterator
- * @param string $blacklist Regex that matches against the file path that exclude from the classmap.
- * @param IOInterface $io IO object
- * @param string $namespace Optional namespace prefix to filter by
+ * @param \Traversable|string|array $path The path to search in or an iterator
+ * @param string $excluded Regex that matches file paths to be excluded from the classmap
+ * @param ?IOInterface $io IO object
+ * @param ?string $namespace Optional namespace prefix to filter by
+ * @param ?string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules
*
* @throws \RuntimeException When the path is neither an existing file nor directory
* @return array A class map array
*/
- public static function createMap($path, $blacklist = null, IOInterface $io = null, $namespace = null)
+ public static function createMap($path, $excluded = null, IOInterface $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = array())
{
+ $basePath = $path;
if (is_string($path)) {
if (is_file($path)) {
$path = array(new \SplFileInfo($path));
- } elseif (is_dir($path)) {
+ } elseif (is_dir($path) || strpos($path, '*') !== false) {
$path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path);
} else {
throw new \RuntimeException(
@@ -71,6 +73,8 @@ public static function createMap($path, $blacklist = null, IOInterface $io = nul
'" which does not appear to be a file nor a folder'
);
}
+ } elseif (null !== $autoloadType) {
+ throw new \RuntimeException('Path must be a string when specifying an autoload type');
}
$map = array();
@@ -90,20 +94,39 @@ public static function createMap($path, $blacklist = null, IOInterface $io = nul
$filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath);
}
- // check the realpath of the file against the blacklist as the path might be a symlink and the blacklist is realpath'd so symlink are resolved
- if ($blacklist && preg_match($blacklist, strtr(realpath($filePath), '\\', '/'))) {
+ $realPath = realpath($filePath);
+
+ // if a list of scanned files is given, avoid scanning twice the same file to save cycles and avoid generating warnings
+ // in case a PSR-0/4 declaration follows another more specific one, or a classmap declaration, which covered this file already
+ if (isset($scannedFiles[$realPath])) {
+ continue;
+ }
+
+ // check the realpath of the file against the excluded paths as the path might be a symlink and the excluded path is realpath'd so symlink are resolved
+ if ($excluded && preg_match($excluded, strtr($realPath, '\\', '/'))) {
continue;
}
// check non-realpath of file for directories symlink in project dir
- if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) {
+ if ($excluded && preg_match($excluded, strtr($filePath, '\\', '/'))) {
continue;
}
$classes = self::findClasses($filePath);
+ if (null !== $autoloadType) {
+ $classes = self::filterByNamespace($classes, $filePath, $namespace, $autoloadType, $basePath, $io);
+
+ // if no valid class was found in the file then we do not mark it as scanned as it might still be matched by another rule later
+ if ($classes) {
+ $scannedFiles[$realPath] = true;
+ }
+ } else {
+ // classmap autoload rules always collect all classes so for these we definitely do not want to scan again
+ $scannedFiles[$realPath] = true;
+ }
foreach ($classes as $class) {
// skip classes not within the given namespace prefix
- if (null !== $namespace && 0 !== strpos($class, $namespace)) {
+ if (null === $autoloadType && null !== $namespace && '' !== $namespace && 0 !== strpos($class, $namespace)) {
continue;
}
@@ -121,6 +144,67 @@ public static function createMap($path, $blacklist = null, IOInterface $io = nul
return $map;
}
+ /**
+ * Remove classes which could not have been loaded by namespace autoloaders
+ *
+ * @param array $classes found classes in given file
+ * @param string $filePath current file
+ * @param string $baseNamespace prefix of given autoload mapping
+ * @param string $namespaceType psr-0|psr-4
+ * @param string $basePath root directory of given autoload mapping
+ * @param ?IOInterface $io IO object
+ * @return array valid classes
+ */
+ private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io)
+ {
+ $validClasses = array();
+ $rejectedClasses = array();
+
+ $realSubPath = substr($filePath, strlen($basePath) + 1);
+ $realSubPath = substr($realSubPath, 0, strrpos($realSubPath, '.'));
+
+ foreach ($classes as $class) {
+ // silently skip if ns doesn't have common root
+ if ('' !== $baseNamespace && 0 !== strpos($class, $baseNamespace)) {
+ continue;
+ }
+ // transform class name to file path and validate
+ if ('psr-0' === $namespaceType) {
+ $namespaceLength = strrpos($class, '\\');
+ if (false !== $namespaceLength) {
+ $namespace = substr($class, 0, $namespaceLength + 1);
+ $className = substr($class, $namespaceLength + 1);
+ $subPath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace)
+ . str_replace('_', DIRECTORY_SEPARATOR, $className);
+ } else {
+ $subPath = str_replace('_', DIRECTORY_SEPARATOR, $class);
+ }
+ } elseif ('psr-4' === $namespaceType) {
+ $subNamespace = ('' !== $baseNamespace) ? substr($class, strlen($baseNamespace)) : $class;
+ $subPath = str_replace('\\', DIRECTORY_SEPARATOR, $subNamespace);
+ } else {
+ throw new \RuntimeException("namespaceType must be psr-0 or psr-4, $namespaceType given");
+ }
+ if ($subPath === $realSubPath) {
+ $validClasses[] = $class;
+ } else {
+ $rejectedClasses[] = $class;
+ }
+ }
+ // warn only if no valid classes, else silently skip invalid
+ if (empty($validClasses)) {
+ foreach ($rejectedClasses as $class) {
+ if ($io) {
+ $io->writeError("Class $class located in ".preg_replace('{^'.preg_quote(getcwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.");
+ }
+ }
+
+ return array();
+ }
+
+ return $validClasses;
+ }
+
/**
* Extract the classes in the given file
*
@@ -131,7 +215,7 @@ public static function createMap($path, $blacklist = null, IOInterface $io = nul
private static function findClasses($path)
{
$extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait';
- if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) {
+ if (PHP_VERSION_ID >= 80100 || (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>='))) {
$extraTypes .= '|enum';
}
@@ -141,7 +225,7 @@ private static function findClasses($path)
if (!$contents) {
if (!file_exists($path)) {
$message = 'File at "%s" does not exist, check your classmap definitions';
- } elseif (!is_readable($path)) {
+ } elseif (!Filesystem::isReadable($path)) {
$message = 'File at "%s" is not readable, check its permissions';
} elseif ('' === trim(file_get_contents($path))) {
// The input file was really empty and thus contains no classes
@@ -162,18 +246,43 @@ private static function findClasses($path)
}
// strip heredocs/nowdocs
- $contents = preg_replace('{<<<\s*(\'?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\2(?=\r\n|\n|\r|;)}s', 'null', $contents);
+ $heredocRegex = '{
+ # opening heredoc/nowdoc delimiter (word-chars)
+ <<<[ \t]*+([\'"]?)(\w++)\\1
+ # needs to be followed by a newline
+ (?:\r\n|\n|\r)
+ # the meat of it, matching line by line until end delimiter
+ (?:
+ # a valid line is optional white-space (possessive match) not followed by the end delimiter, then anything goes for the rest of the line
+ [\t ]*+(?!\\2 \b)[^\r\n]*+
+ # end of line(s)
+ [\r\n]++
+ )*
+ # end delimiter
+ [\t ]*+ \\2 (?=\b)
+ }x';
+
+ // run first assuming the file is valid unicode
+ $contentWithoutHeredoc = preg_replace($heredocRegex.'u', 'null', $contents);
+ if (null === $contentWithoutHeredoc) {
+ // run again without unicode support if the file failed to be parsed
+ $contents = preg_replace($heredocRegex, 'null', $contents);
+ } else {
+ $contents = $contentWithoutHeredoc;
+ }
+ unset($contentWithoutHeredoc);
+
// strip strings
$contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents);
// strip leading non-php code if needed
- if (substr($contents, 0, 2) !== '') {
+ if (strpos($contents, '') !== 0) {
$contents = preg_replace('{^.+?<\?}s', '', $contents, 1, $replacements);
if ($replacements === 0) {
return array();
}
}
// strip non-php blocks in the file
- $contents = preg_replace('{\?>.+<\?}s', '?>', $contents);
+ $contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?>', $contents);
// strip trailing non-php code if needed
$pos = strrpos($contents, '?>');
if (false !== $pos && false === strpos(substr($contents, $pos), '')) {
diff --git a/app/vendor/composer/composer/src/Composer/Cache.php b/app/vendor/composer/composer/src/Composer/Cache.php
index 44395c3a2..a3aaebf57 100644
--- a/app/vendor/composer/composer/src/Composer/Cache.php
+++ b/app/vendor/composer/composer/src/Composer/Cache.php
@@ -24,27 +24,30 @@
*/
class Cache
{
- private static $cacheCollected = false;
+ private static $cacheCollected = null;
private $io;
private $root;
private $enabled = true;
- private $whitelist;
+ private $allowlist;
private $filesystem;
+ private $readOnly;
/**
* @param IOInterface $io
* @param string $cacheDir location of the cache
- * @param string $whitelist List of characters that are allowed in path names (used in a regex character class)
+ * @param string $allowlist List of characters that are allowed in path names (used in a regex character class)
* @param Filesystem $filesystem optional filesystem instance
+ * @param bool $readOnly whether the cache is in readOnly mode
*/
- public function __construct(IOInterface $io, $cacheDir, $whitelist = 'a-z0-9.', Filesystem $filesystem = null)
+ public function __construct(IOInterface $io, $cacheDir, $allowlist = 'a-z0-9.', Filesystem $filesystem = null, $readOnly = false)
{
$this->io = $io;
$this->root = rtrim($cacheDir, '/\\') . '/';
- $this->whitelist = $whitelist;
+ $this->allowlist = $allowlist;
$this->filesystem = $filesystem ?: new Filesystem();
+ $this->readOnly = (bool) $readOnly;
- if (preg_match('{(^|[\\\\/])(\$null|NUL|/dev/null)([\\\\/]|$)}', $cacheDir)) {
+ if (!self::isUsable($cacheDir)) {
$this->enabled = false;
return;
@@ -59,6 +62,27 @@ public function __construct(IOInterface $io, $cacheDir, $whitelist = 'a-z0-9.',
}
}
+ /**
+ * @param bool $readOnly
+ */
+ public function setReadOnly($readOnly)
+ {
+ $this->readOnly = (bool) $readOnly;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isReadOnly()
+ {
+ return $this->readOnly;
+ }
+
+ public static function isUsable($path)
+ {
+ return !preg_match('{(^|[\\\\/])(\$null|nul|NUL|/dev/null)([\\\\/]|$)}', $path);
+ }
+
public function isEnabled()
{
return $this->enabled;
@@ -72,7 +96,7 @@ public function getRoot()
public function read($file)
{
if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
$this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG);
@@ -85,25 +109,26 @@ public function read($file)
public function write($file, $contents)
{
- if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ if ($this->enabled && !$this->readOnly) {
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
$this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG);
+ $tempFileName = $this->root . $file . uniqid('.', true) . '.tmp';
try {
- return file_put_contents($this->root . $file, $contents);
+ return file_put_contents($tempFileName, $contents) !== false && rename($tempFileName, $this->root . $file);
} catch (\ErrorException $e) {
$this->io->writeError('Failed to write into cache: '.$e->getMessage().'', true, IOInterface::DEBUG);
if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) {
// Remove partial file.
- unlink($this->root . $file);
+ unlink($tempFileName);
$message = sprintf(
'Writing %1$s into cache failed after %2$u of %3$u bytes written, only %4$u bytes of free space available',
- $this->root . $file,
+ $tempFileName,
$m[1],
$m[2],
- @disk_free_space($this->root . dirname($file))
+ @disk_free_space(dirname($tempFileName))
);
$this->io->writeError($message);
@@ -123,8 +148,8 @@ public function write($file, $contents)
*/
public function copyFrom($file, $source)
{
- if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ if ($this->enabled && !$this->readOnly) {
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
$this->filesystem->ensureDirectoryExists(dirname($this->root . $file));
if (!file_exists($source)) {
@@ -145,7 +170,7 @@ public function copyFrom($file, $source)
public function copyTo($file, $target)
{
if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
try {
touch($this->root . $file, filemtime($this->root . $file), time());
@@ -166,13 +191,26 @@ public function copyTo($file, $target)
public function gcIsNecessary()
{
- return (!self::$cacheCollected && !mt_rand(0, 50));
+ if (self::$cacheCollected) {
+ return false;
+ }
+
+ self::$cacheCollected = true;
+ if (getenv('COMPOSER_TEST_SUITE')) {
+ return false;
+ }
+
+ if (PHP_VERSION_ID > 70000) {
+ return !random_int(0, 50);
+ }
+
+ return !mt_rand(0, 50);
}
public function remove($file)
{
if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return $this->filesystem->unlink($this->root . $file);
}
@@ -184,7 +222,9 @@ public function remove($file)
public function clear()
{
if ($this->enabled) {
- return $this->filesystem->removeDirectory($this->root);
+ $this->filesystem->emptyDirectory($this->root);
+
+ return true;
}
return false;
@@ -223,7 +263,7 @@ public function gc($ttl, $maxSize)
public function sha1($file)
{
if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return sha1_file($this->root . $file);
}
@@ -235,7 +275,7 @@ public function sha1($file)
public function sha256($file)
{
if ($this->enabled) {
- $file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
+ $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return hash_file('sha256', $this->root . $file);
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php b/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php
index 8fbad05a8..931c20e55 100644
--- a/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/AboutCommand.php
@@ -12,6 +12,7 @@
namespace Composer\Command;
+use Composer\Composer;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -24,7 +25,7 @@ protected function configure()
{
$this
->setName('about')
- ->setDescription('Shows the short information about Composer.')
+ ->setDescription('Shows a short information about Composer.')
->setHelp(
<<php composer.phar about
@@ -35,12 +36,16 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $composerVersion = Composer::getVersion();
+
$this->getIO()->write(
<<Composer - Package Management for PHP
+Composer - Dependency Manager for PHP - version $composerVersion
Composer is a dependency manager tracking local dependencies of your projects and libraries.
See https://getcomposer.org/ for more information.
EOT
);
+
+ return 0;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
index 29858c6fc..3acf4fd04 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
@@ -16,12 +16,15 @@
use Composer\IO\IOInterface;
use Composer\Config;
use Composer\Composer;
+use Composer\Package\CompletePackageInterface;
use Composer\Repository\CompositeRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Script\ScriptEvents;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Util\Filesystem;
+use Composer\Util\Loop;
+use Composer\Util\ProcessExecutor;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -46,7 +49,7 @@ protected function configure()
new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'),
new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.'
.' Note that the format will be appended.'),
- new InputOption('ignore-filters', false, InputOption::VALUE_NONE, 'Ignore filters when saving package'),
+ new InputOption('ignore-filters', null, InputOption::VALUE_NONE, 'Ignore filters when saving package'),
))
->setHelp(
<<php composer.phar archive [--format=zip] [--dir=/foo] [package [version]]
+Read more at https://getcomposer.org/doc/03-cli.md#archive
EOT
)
;
@@ -63,15 +67,21 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
- $config = Factory::createConfig();
$composer = $this->getComposer(false);
+ $config = null;
+
if ($composer) {
+ $config = $composer->getConfig();
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
$eventDispatcher = $composer->getEventDispatcher();
$eventDispatcher->dispatch($commandEvent->getName(), $commandEvent);
$eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
}
+ if (!$config) {
+ $config = Factory::createConfig();
+ }
+
if (null === $input->getOption('format')) {
$input->setOption('format', $config->get('archive-format'));
}
@@ -104,8 +114,10 @@ protected function archive(IOInterface $io, Config $config, $packageName = null,
$archiveManager = $composer->getArchiveManager();
} else {
$factory = new Factory;
- $downloadManager = $factory->createDownloadManager($io, $config);
- $archiveManager = $factory->createArchiveManager($config, $downloadManager);
+ $process = new ProcessExecutor();
+ $httpDownloader = Factory::createHttpDownloader($io, $config);
+ $downloadManager = $factory->createDownloadManager($io, $config, $httpDownloader, $process);
+ $archiveManager = $factory->createArchiveManager($config, $downloadManager, new Loop($httpDownloader, $process));
}
if ($packageName) {
@@ -129,6 +141,9 @@ protected function archive(IOInterface $io, Config $config, $packageName = null,
return 0;
}
+ /**
+ * @return CompletePackageInterface|false
+ */
protected function selectPackage(IOInterface $io, $packageName, $version = null)
{
$io->writeError('Searching for the specified package.');
@@ -160,6 +175,10 @@ protected function selectPackage(IOInterface $io, $packageName, $version = null)
return false;
}
+ if (!$package instanceof CompletePackageInterface) {
+ throw new \LogicException('Expected a CompletePackageInterface instance but found '.get_class($package));
+ }
+
return $package;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php b/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php
index d6b014d7d..b473fbe80 100644
--- a/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/BaseCommand.php
@@ -19,21 +19,27 @@
use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use Composer\Plugin\PreCommandRunEvent;
+use Composer\Package\Version\VersionParser;
use Composer\Plugin\PluginEvents;
+use Composer\Util\Platform;
+use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Terminal;
/**
* Base class for Composer commands
*
+ * @method Application getApplication()
+ *
* @author Ryan Weaver
* @author Konstantin Kudryashov
*/
abstract class BaseCommand extends Command
{
/**
- * @var Composer
+ * @var Composer|null
*/
private $composer;
@@ -46,7 +52,7 @@ abstract class BaseCommand extends Command
* @param bool $required
* @param bool|null $disablePlugins
* @throws \RuntimeException
- * @return Composer
+ * @return Composer|null
*/
public function getComposer($required = true, $disablePlugins = null)
{
@@ -55,6 +61,7 @@ public function getComposer($required = true, $disablePlugins = null)
if ($application instanceof Application) {
/* @var $application Application */
$this->composer = $application->getComposer($required, $disablePlugins);
+ /** @phpstan-ignore-next-line */
} elseif ($required) {
throw new \RuntimeException(
'Could not create a Composer\Composer instance, you must inject '.
@@ -103,8 +110,8 @@ public function getIO()
if (null === $this->io) {
$application = $this->getApplication();
if ($application instanceof Application) {
- /* @var $application Application */
$this->io = $application->getIO();
+ /** @phpstan-ignore-next-line */
} else {
$this->io = new NullIO();
}
@@ -171,11 +178,96 @@ protected function getPreferredInstallOptions(Config $config, InputInterface $in
break;
}
+ if ($input->hasOption('prefer-install') && $input->getOption('prefer-install')) {
+ if ($input->getOption('prefer-source')) {
+ throw new \InvalidArgumentException('--prefer-source can not be used together with --prefer-install');
+ }
+ if ($input->getOption('prefer-dist')) {
+ throw new \InvalidArgumentException('--prefer-dist can not be used together with --prefer-install');
+ }
+ switch ($input->getOption('prefer-install')) {
+ case 'dist':
+ $input->setOption('prefer-dist', true);
+ break;
+ case 'source':
+ $input->setOption('prefer-source', true);
+ break;
+ case 'auto':
+ $preferDist = false;
+ $preferSource = false;
+ break;
+ default:
+ throw new \UnexpectedValueException('--prefer-install accepts one of "dist", "source" or "auto", got '.$input->getOption('prefer-install'));
+ }
+ }
+
if ($input->getOption('prefer-source') || $input->getOption('prefer-dist') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'))) {
$preferSource = $input->getOption('prefer-source') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'));
- $preferDist = $input->getOption('prefer-dist');
+ $preferDist = (bool) $input->getOption('prefer-dist');
}
return array($preferSource, $preferDist);
}
+
+ protected function formatRequirements(array $requirements)
+ {
+ $requires = array();
+ $requirements = $this->normalizeRequirements($requirements);
+ foreach ($requirements as $requirement) {
+ if (!isset($requirement['version'])) {
+ throw new \UnexpectedValueException('Option '.$requirement['name'] .' is missing a version constraint, use e.g. '.$requirement['name'].':^1.0');
+ }
+ $requires[$requirement['name']] = $requirement['version'];
+ }
+
+ return $requires;
+ }
+
+ protected function normalizeRequirements(array $requirements)
+ {
+ $parser = new VersionParser();
+
+ return $parser->parseNameVersionPairs($requirements);
+ }
+
+ protected function renderTable(array $table, OutputInterface $output)
+ {
+ $renderer = new Table($output);
+ $renderer->setStyle('compact');
+ $rendererStyle = $renderer->getStyle();
+ if (method_exists($rendererStyle, 'setVerticalBorderChars')) {
+ $rendererStyle->setVerticalBorderChars('');
+ } else {
+ // TODO remove in composer 2.2
+ // @phpstan-ignore-next-line
+ $rendererStyle->setVerticalBorderChar('');
+ }
+ $rendererStyle->setCellRowContentFormat('%s ');
+ $renderer->setRows($table)->render();
+ }
+
+ protected function getTerminalWidth()
+ {
+ if (class_exists('Symfony\Component\Console\Terminal')) {
+ $terminal = new Terminal();
+ $width = $terminal->getWidth();
+ } else {
+ // For versions of Symfony console before 3.2
+ // TODO remove in composer 2.2
+ // @phpstan-ignore-next-line
+ list($width) = $this->getApplication()->getTerminalDimensions();
+ }
+ if (null === $width) {
+ // In case the width is not detected, we're probably running the command
+ // outside of a real terminal, use space without a limit
+ $width = PHP_INT_MAX;
+ }
+ if (Platform::isWindows()) {
+ $width--;
+ } else {
+ $width = max(80, $width);
+ }
+
+ return $width;
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php
index 4c8766ba3..962c1b2ce 100644
--- a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php
@@ -12,21 +12,20 @@
namespace Composer\Command;
-use Composer\DependencyResolver\Pool;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
-use Composer\Repository\ArrayRepository;
+use Composer\Package\RootPackage;
+use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\CompositeRepository;
+use Composer\Repository\RootPackageRepository;
+use Composer\Repository\InstalledRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Composer\Package\Version\VersionParser;
-use Symfony\Component\Console\Helper\Table;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@@ -37,32 +36,20 @@
class BaseDependencyCommand extends BaseCommand
{
const ARGUMENT_PACKAGE = 'package';
- const ARGUMENT_CONSTRAINT = 'constraint';
+ const ARGUMENT_CONSTRAINT = 'version';
const OPTION_RECURSIVE = 'recursive';
const OPTION_TREE = 'tree';
+ /** @var ?string[] */
protected $colors;
- /**
- * Set common options and arguments.
- */
- protected function configure()
- {
- $this->setDefinition(array(
- new InputArgument(self::ARGUMENT_PACKAGE, InputArgument::REQUIRED, 'Package to inspect'),
- new InputArgument(self::ARGUMENT_CONSTRAINT, InputArgument::OPTIONAL, 'Optional version constraint', '*'),
- new InputOption(self::OPTION_RECURSIVE, 'r', InputOption::VALUE_NONE, 'Recursively resolves up to the root package'),
- new InputOption(self::OPTION_TREE, 't', InputOption::VALUE_NONE, 'Prints the results as a nested tree'),
- ));
- }
-
/**
* Execute the command.
*
* @param InputInterface $input
* @param OutputInterface $output
* @param bool $inverted Whether to invert matching process (why-not vs why behaviour)
- * @return int|null Exit code of the operation.
+ * @return int Exit code of the operation.
*/
protected function doExecute(InputInterface $input, OutputInterface $output, $inverted = false)
{
@@ -71,35 +58,32 @@ protected function doExecute(InputInterface $input, OutputInterface $output, $in
$commandEvent = new CommandEvent(PluginEvents::COMMAND, $this->getName(), $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- // Prepare repositories and set up a pool
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
- $repository = new CompositeRepository(array(
- new ArrayRepository(array($composer->getPackage())),
+ $installedRepo = new InstalledRepository(array(
+ new RootPackageRepository($composer->getPackage()),
$composer->getRepositoryManager()->getLocalRepository(),
new PlatformRepository(array(), $platformOverrides),
));
- $pool = new Pool();
- $pool->addRepository($repository);
// Parse package name and constraint
list($needle, $textConstraint) = array_pad(
explode(':', $input->getArgument(self::ARGUMENT_PACKAGE)),
2,
- $input->getArgument(self::ARGUMENT_CONSTRAINT)
+ $input->hasArgument(self::ARGUMENT_CONSTRAINT) ? $input->getArgument(self::ARGUMENT_CONSTRAINT) : '*'
);
// Find packages that are or provide the requested package first
- $packages = $pool->whatProvides(strtolower($needle));
+ $packages = $installedRepo->findPackagesWithReplacersAndProviders($needle);
if (empty($packages)) {
throw new \InvalidArgumentException(sprintf('Could not find package "%s" in your project', $needle));
}
// If the version we ask for is not installed then we need to locate it in remote repos and add it.
// This is needed for why-not to resolve conflicts from an uninstalled version against installed packages.
- if (!$repository->findPackage($needle, $textConstraint)) {
+ if (!$installedRepo->findPackage($needle, $textConstraint)) {
$defaultRepos = new CompositeRepository(RepositoryFactory::defaultRepos($this->getIO()));
if ($match = $defaultRepos->findPackage($needle, $textConstraint)) {
- $repository->addRepository(new ArrayRepository(array(clone $match)));
+ $installedRepo->addRepository(new InstalledArrayRepository(array(clone $match)));
}
}
@@ -126,7 +110,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output, $in
$recursive = $renderTree || $input->getOption(self::OPTION_RECURSIVE);
// Resolve dependencies
- $results = $repository->getDependents($needles, $constraint, $inverted, $recursive);
+ $results = $installedRepo->getDependents($needles, $constraint, $inverted, $recursive);
if (empty($results)) {
$extra = (null !== $constraint) ? sprintf(' in versions %smatching %s', $inverted ? 'not ' : '', $textConstraint) : '';
$this->getIO()->writeError(sprintf(
@@ -170,7 +154,7 @@ protected function printTable(OutputInterface $output, $results)
continue;
}
$doubles[$unique] = true;
- $version = (strpos($package->getPrettyVersion(), 'No version set') === 0) ? '-' : $package->getPrettyVersion();
+ $version = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '-' : $package->getPrettyVersion();
$rows[] = array($package->getPrettyName(), $version, $link->getDescription(), sprintf('%s (%s)', $link->getTarget(), $link->getPrettyConstraint()));
if ($children) {
$queue = array_merge($queue, $children);
@@ -180,13 +164,7 @@ protected function printTable(OutputInterface $output, $results)
$table = array_merge($rows, $table);
} while (!empty($results));
- // Render table
- $renderer = new Table($output);
- $renderer->setStyle('compact');
- $rendererStyle = $renderer->getStyle();
- $rendererStyle->setVerticalBorderChar('');
- $rendererStyle->setCellRowContentFormat('%s ');
- $renderer->setRows($table)->render();
+ $this->renderTable($table, $output);
}
/**
@@ -225,14 +203,14 @@ protected function printTree($results, $prefix = '', $level = 1)
/**
* @var PackageInterface $package
* @var Link $link
- * @var array|bool $children
+ * @var array|bool $children
*/
list($package, $link, $children) = $result;
$color = $this->colors[$level % count($this->colors)];
$prevColor = $this->colors[($level - 1) % count($this->colors)];
$isLast = (++$idx == $count);
- $versionText = (strpos($package->getPrettyVersion(), 'No version set') === 0) ? '' : $package->getPrettyVersion();
+ $versionText = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '' : $package->getPrettyVersion();
$packageText = rtrim(sprintf('<%s>%s%1$s> %s', $color, $package->getPrettyName(), $versionText));
$linkText = sprintf('%s <%s>%s%2$s> %s', $link->getDescription(), $prevColor, $link->getTarget(), $link->getPrettyConstraint());
$circularWarn = $children === false ? '(circular dependency aborted here)' : '';
diff --git a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php
index 5a68661cc..2f68a65cb 100644
--- a/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php
@@ -13,12 +13,13 @@
namespace Composer\Command;
use Composer\Package\Link;
-use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
-use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Repository\PlatformRepository;
+use Composer\Repository\RootPackageRepository;
+use Composer\Repository\InstalledRepository;
class CheckPlatformReqsCommand extends BaseCommand
{
@@ -26,10 +27,16 @@ protected function configure()
{
$this->setName('check-platform-reqs')
->setDescription('Check that platform requirements are satisfied.')
+ ->setDefinition(array(
+ new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables checking of require-dev packages requirements.'),
+ new InputOption('lock', null, InputOption::VALUE_NONE, 'Checks requirements only from the lock file, not from installed packages.'),
+ ))
->setHelp(
<<php composer.phar check-platform-reqs
EOT
@@ -40,80 +47,117 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$composer = $this->getComposer();
- $repos = $composer->getRepositoryManager()->getLocalRepository();
+ $requires = array();
+ $removePackages = array();
+ if ($input->getOption('lock')) {
+ $this->getIO()->writeError('Checking '.($input->getOption('no-dev') ? 'non-dev ' : '').'platform requirements using the lock file');
+ $installedRepo = $composer->getLocker()->getLockedRepository(!$input->getOption('no-dev'));
+ } else {
+ $installedRepo = $composer->getRepositoryManager()->getLocalRepository();
+ // fallback to lockfile if installed repo is empty
+ if (!$installedRepo->getPackages()) {
+ $this->getIO()->writeError('No vendor dir present, checking '.($input->getOption('no-dev') ? 'non-dev ' : '').'platform requirements from the lock file');
+ $installedRepo = $composer->getLocker()->getLockedRepository(!$input->getOption('no-dev'));
+ } else {
+ if ($input->getOption('no-dev')) {
+ $removePackages = $installedRepo->getDevPackageNames();
+ }
+
+ $this->getIO()->writeError('Checking '.($input->getOption('no-dev') ? 'non-dev ' : '').'platform requirements for packages in the vendor dir');
+ }
+ }
+ if (!$input->getOption('no-dev')) {
+ $requires += $composer->getPackage()->getDevRequires();
+ }
- $allPackages = array_merge(array($composer->getPackage()), $repos->getPackages());
- $requires = $composer->getPackage()->getDevRequires();
foreach ($requires as $require => $link) {
$requires[$require] = array($link);
}
- /**
- * @var PackageInterface $package
- */
- foreach ($allPackages as $package) {
+ $installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository($composer->getPackage())));
+ foreach ($installedRepo->getPackages() as $package) {
+ if (in_array($package->getName(), $removePackages, true)) {
+ continue;
+ }
foreach ($package->getRequires() as $require => $link) {
$requires[$require][] = $link;
}
}
- ksort($requires);
- $platformRepo = new PlatformRepository(array(), array());
- $currentPlatformPackages = $platformRepo->getPackages();
- $currentPlatformPackageMap = array();
+ ksort($requires);
- /**
- * @var PackageInterface $currentPlatformPackage
- */
- foreach ($currentPlatformPackages as $currentPlatformPackage) {
- $currentPlatformPackageMap[$currentPlatformPackage->getName()] = $currentPlatformPackage;
- }
+ $installedRepo->addRepository(new PlatformRepository(array(), array()));
$results = array();
-
$exitCode = 0;
/**
- * @var Link $require
+ * @var Link[] $links
*/
foreach ($requires as $require => $links) {
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $require)) {
- if (isset($currentPlatformPackageMap[$require])) {
- $pass = true;
- $version = $currentPlatformPackageMap[$require]->getVersion();
-
- foreach ($links as $link) {
- if (!$link->getConstraint()->matches(new Constraint('=', $version))) {
- $results[] = array(
- $currentPlatformPackageMap[$require]->getPrettyName(),
- $currentPlatformPackageMap[$require]->getPrettyVersion(),
- $link,
- 'failed',
- );
- $pass = false;
-
- $exitCode = max($exitCode, 1);
+ if (PlatformRepository::isPlatformPackage($require)) {
+ $candidates = $installedRepo->findPackagesWithReplacersAndProviders($require);
+ if ($candidates) {
+ $reqResults = array();
+ foreach ($candidates as $candidate) {
+ $candidateConstraint = null;
+ if ($candidate->getName() === $require) {
+ $candidateConstraint = new Constraint('=', $candidate->getVersion());
+ $candidateConstraint->setPrettyString($candidate->getPrettyVersion());
+ } else {
+ foreach (array_merge($candidate->getProvides(), $candidate->getReplaces()) as $link) {
+ if ($link->getTarget() === $require) {
+ $candidateConstraint = $link->getConstraint();
+ break;
+ }
+ }
+ }
+
+ // safety check for phpstan, but it should not be possible to get a candidate out of findPackagesWithReplacersAndProviders without a constraint matching $require
+ if (!$candidateConstraint) {
+ continue;
+ }
+
+ foreach ($links as $link) {
+ if (!$link->getConstraint()->matches($candidateConstraint)) {
+ $reqResults[] = array(
+ $candidate->getName() === $require ? $candidate->getPrettyName() : $require,
+ $candidateConstraint->getPrettyString(),
+ $link,
+ 'failed'.($candidate->getName() === $require ? '' : ' provided by '.$candidate->getPrettyName().''),
+ );
+
+ // skip to next candidate
+ continue 2;
+ }
}
- }
- if ($pass) {
$results[] = array(
- $currentPlatformPackageMap[$require]->getPrettyName(),
- $currentPlatformPackageMap[$require]->getPrettyVersion(),
+ $candidate->getName() === $require ? $candidate->getPrettyName() : $require,
+ $candidateConstraint->getPrettyString(),
null,
- 'success',
+ 'success'.($candidate->getName() === $require ? '' : ' provided by '.$candidate->getPrettyName().''),
);
+
+ // candidate matched, skip to next requirement
+ continue 2;
}
- } else {
- $results[] = array(
- $require,
- 'n/a',
- $links[0],
- 'missing',
- );
-
- $exitCode = max($exitCode, 2);
+
+ // show the first error from every failed candidate
+ $results = array_merge($results, $reqResults);
+ $exitCode = max($exitCode, 1);
+
+ continue;
}
+
+ $results[] = array(
+ $require,
+ 'n/a',
+ $links[0],
+ 'missing',
+ );
+
+ $exitCode = max($exitCode, 2);
}
}
@@ -124,7 +168,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
protected function printTable(OutputInterface $output, $results)
{
- $table = array();
$rows = array();
foreach ($results as $result) {
/**
@@ -138,14 +181,7 @@ protected function printTable(OutputInterface $output, $results)
$status,
);
}
- $table = array_merge($rows, $table);
-
- // Render table
- $renderer = new Table($output);
- $renderer->setStyle('compact');
- $rendererStyle = $renderer->getStyle();
- $rendererStyle->setVerticalBorderChar('');
- $rendererStyle->setCellRowContentFormat('%s ');
- $renderer->setRows($table)->render();
+
+ $this->renderTable($rows, $output);
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php b/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php
index 2514f6330..bdbdd80cf 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ClearCacheCommand.php
@@ -26,12 +26,14 @@ protected function configure()
{
$this
->setName('clear-cache')
- ->setAliases(array('clearcache'))
+ ->setAliases(array('clearcache', 'cc'))
->setDescription('Clears composer\'s internal package cache.')
->setHelp(
<<clear-cache deletes all cached packages from composer's
cache directory.
+
+Read more at https://getcomposer.org/doc/03-cli.md#clear-cache-clearcache-cc
EOT
)
;
@@ -57,6 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
continue;
}
$cache = new Cache($io, $cachePath);
+ $cache->setReadOnly($config->get('cache-read-only'));
if (!$cache->isEnabled()) {
$io->writeError("Cache is not enabled ($key): $cachePath");
@@ -68,5 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$io->writeError('All caches cleared.');
+
+ return 0;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php
index b002fd3a7..39b4604d3 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ConfigCommand.php
@@ -12,6 +12,7 @@
namespace Composer\Command;
+use Composer\Util\Filesystem;
use Composer\Util\Platform;
use Composer\Util\Silencer;
use Symfony\Component\Console\Input\InputInterface;
@@ -21,6 +22,7 @@
use Composer\Config;
use Composer\Config\JsonConfigSource;
use Composer\Factory;
+use Composer\IO\IOInterface;
use Composer\Json\JsonFile;
use Composer\Semver\VersionParser;
use Composer\Package\BasePackage;
@@ -72,6 +74,9 @@ protected function configure()
new InputOption('list', 'l', InputOption::VALUE_NONE, 'List configuration settings'),
new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'If you want to choose a different composer.json or config.json'),
new InputOption('absolute', null, InputOption::VALUE_NONE, 'Returns absolute paths when fetching *-dir config values instead of relative'),
+ new InputOption('json', 'j', InputOption::VALUE_NONE, 'JSON decode the setting value, to be used with extra.* keys'),
+ new InputOption('merge', 'm', InputOption::VALUE_NONE, 'Merge the setting value with the current value, to be used with extra.* keys in combination with --json'),
+ new InputOption('append', null, InputOption::VALUE_NONE, 'When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority)'),
new InputArgument('setting-key', null, 'Setting key'),
new InputArgument('setting-value', InputArgument::IS_ARRAY, 'Setting value'),
))
@@ -110,6 +115,18 @@ protected function configure()
You can alter repositories in the global config.json file by passing in the
--global option.
+To add or edit suggested packages you can use:
+
+ %command.full_name% suggest.package reason for the suggestion
+
+To add or edit extra properties you can use:
+
+ %command.full_name% extra.property value
+
+Or to add a complex value you can use json with:
+
+ %command.full_name% extra.property --json '{"foo":true, "bar": []}'
+
To edit the file in an external editor:
%command.full_name% --editor
@@ -124,6 +141,8 @@ protected function configure()
global config.json file.
%command.full_name% --editor --global
+
+Read more at https://getcomposer.org/doc/03-cli.md#config
EOT
)
;
@@ -176,7 +195,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
}
if ($input->getOption('global') && !$this->authConfigFile->exists()) {
touch($this->authConfigFile->getPath());
- $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject));
+ $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject, 'bearer' => new \ArrayObject));
Silencer::call('chmod', $this->authConfigFile->getPath(), 0600);
}
@@ -225,7 +244,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$settingKey = $input->getArgument('setting-key');
- if (!$settingKey) {
+ if (!$settingKey || !is_string($settingKey)) {
return 0;
}
@@ -274,7 +293,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$value = $data;
} elseif (isset($data['config'][$settingKey])) {
$value = $this->config->get($settingKey, $input->getOption('absolute') ? 0 : Config::RELATIVE_PATHS);
- } elseif (in_array($settingKey, $properties, true) && isset($rawData[$settingKey])) {
+ } elseif (isset($rawData[$settingKey]) && in_array($settingKey, $properties, true)) {
$value = $rawData[$settingKey];
} else {
throw new \RuntimeException($settingKey.' is not defined');
@@ -284,7 +303,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$value = json_encode($value);
}
- $this->getIO()->write($value);
+ $this->getIO()->write($value, true, IOInterface::QUIET);
return 0;
}
@@ -302,6 +321,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$uniqueConfigValues = array(
'process-timeout' => array('is_numeric', 'intval'),
'use-include-path' => array($booleanValidator, $booleanNormalizer),
+ 'use-github-api' => array($booleanValidator, $booleanNormalizer),
'preferred-install' => array(
function ($val) {
return in_array($val, array('auto', 'source', 'dist'), true);
@@ -310,6 +330,14 @@ function ($val) {
return $val;
},
),
+ 'gitlab-protocol' => array(
+ function ($val) {
+ return in_array($val, array('git', 'http', 'https'), true);
+ },
+ function ($val) {
+ return $val;
+ },
+ ),
'store-auths' => array(
function ($val) {
return in_array($val, array('true', 'false', 'prompt'), true);
@@ -362,7 +390,7 @@ function ($val) {
),
'bin-compat' => array(
function ($val) {
- return in_array($val, array('auto', 'full'));
+ return in_array($val, array('auto', 'full', 'symlink'));
},
function ($val) {
return $val;
@@ -392,7 +420,7 @@ function ($val) {
'secure-http' => array($booleanValidator, $booleanNormalizer),
'cafile' => array(
function ($val) {
- return file_exists($val) && is_readable($val);
+ return file_exists($val) && Filesystem::isReadable($val);
},
function ($val) {
return $val === 'null' ? null : $val;
@@ -400,7 +428,7 @@ function ($val) {
),
'capath' => array(
function ($val) {
- return is_dir($val) && is_readable($val);
+ return is_dir($val) && Filesystem::isReadable($val);
},
function ($val) {
return $val === 'null' ? null : $val;
@@ -408,6 +436,19 @@ function ($val) {
),
'github-expose-hostname' => array($booleanValidator, $booleanNormalizer),
'htaccess-protect' => array($booleanValidator, $booleanNormalizer),
+ 'lock' => array($booleanValidator, $booleanNormalizer),
+ 'platform-check' => array(
+ function ($val) {
+ return in_array($val, array('php-only', 'true', 'false', '1', '0'), true);
+ },
+ function ($val) {
+ if ('php-only' === $val) {
+ return 'php-only';
+ }
+
+ return $val !== 'false' && (bool) $val;
+ },
+ ),
);
$multiConfigValues = array(
'github-protocols' => array(
@@ -455,13 +496,40 @@ function ($vals) {
);
if ($input->getOption('unset') && (isset($uniqueConfigValues[$settingKey]) || isset($multiConfigValues[$settingKey]))) {
- return $this->configSource->removeConfigSetting($settingKey);
+ if ($settingKey === 'disable-tls' && $this->config->get('disable-tls')) {
+ $this->getIO()->writeError('You are now running Composer with SSL/TLS protection enabled.');
+ }
+
+ $this->configSource->removeConfigSetting($settingKey);
+
+ return 0;
}
if (isset($uniqueConfigValues[$settingKey])) {
- return $this->handleSingleValue($settingKey, $uniqueConfigValues[$settingKey], $values, 'addConfigSetting');
+ $this->handleSingleValue($settingKey, $uniqueConfigValues[$settingKey], $values, 'addConfigSetting');
+
+ return 0;
}
if (isset($multiConfigValues[$settingKey])) {
- return $this->handleMultiValue($settingKey, $multiConfigValues[$settingKey], $values, 'addConfigSetting');
+ $this->handleMultiValue($settingKey, $multiConfigValues[$settingKey], $values, 'addConfigSetting');
+
+ return 0;
+ }
+ // handle preferred-install per-package config
+ if (preg_match('/^preferred-install\.(.+)/', $settingKey, $matches)) {
+ if ($input->getOption('unset')) {
+ $this->configSource->removeConfigSetting($settingKey);
+
+ return 0;
+ }
+
+ list($validator) = $uniqueConfigValues['preferred-install'];
+ if (!$validator($values[0])) {
+ throw new \RuntimeException('Invalid value for '.$settingKey.'. Should be one of: auto, source, or dist');
+ }
+
+ $this->configSource->addConfigSetting($settingKey, $values[0]);
+
+ return 0;
}
// handle properties
@@ -518,42 +586,55 @@ function ($vals) {
),
);
- if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || substr($settingKey, 0, 6) === 'extra.')) {
+ if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || strpos($settingKey, 'extra.') === 0)) {
throw new \InvalidArgumentException('The '.$settingKey.' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json');
}
if ($input->getOption('unset') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]))) {
- return $this->configSource->removeProperty($settingKey);
+ $this->configSource->removeProperty($settingKey);
+
+ return 0;
}
if (isset($uniqueProps[$settingKey])) {
- return $this->handleSingleValue($settingKey, $uniqueProps[$settingKey], $values, 'addProperty');
+ $this->handleSingleValue($settingKey, $uniqueProps[$settingKey], $values, 'addProperty');
+
+ return 0;
}
if (isset($multiProps[$settingKey])) {
- return $this->handleMultiValue($settingKey, $multiProps[$settingKey], $values, 'addProperty');
+ $this->handleMultiValue($settingKey, $multiProps[$settingKey], $values, 'addProperty');
+
+ return 0;
}
// handle repositories
if (preg_match('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
- return $this->configSource->removeRepository($matches[1]);
+ $this->configSource->removeRepository($matches[1]);
+
+ return 0;
}
if (2 === count($values)) {
- return $this->configSource->addRepository($matches[1], array(
+ $this->configSource->addRepository($matches[1], array(
'type' => $values[0],
'url' => $values[1],
- ));
+ ), $input->getOption('append'));
+
+ return 0;
}
if (1 === count($values)) {
$value = strtolower($values[0]);
if (true === $booleanValidator($value)) {
if (false === $booleanNormalizer($value)) {
- return $this->configSource->addRepository($matches[1], false);
+ $this->configSource->addRepository($matches[1], false, $input->getOption('append'));
+
+ return 0;
}
} else {
$value = JsonFile::parseJson($values[0]);
+ $this->configSource->addRepository($matches[1], $value, $input->getOption('append'));
- return $this->configSource->addRepository($matches[1], $value);
+ return 0;
}
}
@@ -563,31 +644,77 @@ function ($vals) {
// handle extra
if (preg_match('/^extra\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
- return $this->configSource->removeProperty($settingKey);
+ $this->configSource->removeProperty($settingKey);
+
+ return 0;
+ }
+
+ $value = $values[0];
+ if ($input->getOption('json')) {
+ $value = JsonFile::parseJson($value);
+ if ($input->getOption('merge')) {
+ $currentValue = $this->configFile->read();
+ $bits = explode('.', $settingKey);
+ foreach ($bits as $bit) {
+ $currentValue = isset($currentValue[$bit]) ? $currentValue[$bit] : null;
+ }
+ if (is_array($currentValue)) {
+ $value = array_merge($currentValue, $value);
+ }
+ }
+ }
+ $this->configSource->addProperty($settingKey, $value);
+
+ return 0;
+ }
+
+ // handle suggest
+ if (preg_match('/^suggest\.(.+)/', $settingKey, $matches)) {
+ if ($input->getOption('unset')) {
+ $this->configSource->removeProperty($settingKey);
+
+ return 0;
}
- return $this->configSource->addProperty($settingKey, $values[0]);
+ $this->configSource->addProperty($settingKey, implode(' ', $values));
+
+ return 0;
+ }
+
+ // handle unsetting extra/suggest
+ if (in_array($settingKey, array('suggest', 'extra'), true) && $input->getOption('unset')) {
+ $this->configSource->removeProperty($settingKey);
+
+ return 0;
}
// handle platform
if (preg_match('/^platform\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
- return $this->configSource->removeConfigSetting($settingKey);
+ $this->configSource->removeConfigSetting($settingKey);
+
+ return 0;
}
- return $this->configSource->addConfigSetting($settingKey, $values[0]);
+ $this->configSource->addConfigSetting($settingKey, $values[0]);
+
+ return 0;
}
+
+ // handle unsetting platform
if ($settingKey === 'platform' && $input->getOption('unset')) {
- return $this->configSource->removeConfigSetting($settingKey);
+ $this->configSource->removeConfigSetting($settingKey);
+
+ return 0;
}
// handle auth
- if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic)\.(.+)/', $settingKey, $matches)) {
+ if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|bearer)\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
- return;
+ return 0;
}
if ($matches[1] === 'bitbucket-oauth') {
@@ -596,7 +723,10 @@ function ($vals) {
}
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
- } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token'), true)) {
+ } elseif ($matches[1] === 'gitlab-token' && 2 === count($values)) {
+ $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
+ $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'token' => $values[1]));
+ } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) {
if (1 !== count($values)) {
throw new \RuntimeException('Too many arguments, expected only one token');
}
@@ -610,16 +740,20 @@ function ($vals) {
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'password' => $values[1]));
}
- return;
+ return 0;
}
// handle script
if (preg_match('/^scripts\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
- return $this->configSource->removeProperty($settingKey);
+ $this->configSource->removeProperty($settingKey);
+
+ return 0;
}
- return $this->configSource->addProperty($settingKey, count($values) > 1 ? $values : $values[0]);
+ $this->configSource->addProperty($settingKey, count($values) > 1 ? $values : $values[0]);
+
+ return 0;
}
throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command');
@@ -639,7 +773,17 @@ protected function handleSingleValue($key, array $callbacks, array $values, $met
));
}
- return call_user_func(array($this->configSource, $method), $key, $normalizer($values[0]));
+ $normalizedValue = $normalizer($values[0]);
+
+ if ($key === 'disable-tls') {
+ if (!$normalizedValue && $this->config->get('disable-tls')) {
+ $this->getIO()->writeError('You are now running Composer with SSL/TLS protection enabled.');
+ } elseif ($normalizedValue && !$this->config->get('disable-tls')) {
+ $this->getIO()->writeError('You are now running Composer with SSL/TLS protection disabled.');
+ }
+ }
+
+ return call_user_func(array($this->configSource, $method), $key, $normalizedValue);
}
protected function handleMultiValue($key, array $callbacks, array $values, $method)
@@ -695,9 +839,9 @@ protected function listConfiguration(array $contents, array $rawContents, Output
}
if (is_string($rawVal) && $rawVal != $value) {
- $io->write('[' . $k . $key . '] ' . $rawVal . ' (' . $value . ')');
+ $io->write('[' . $k . $key . '] ' . $rawVal . ' (' . $value . ')', true, IOInterface::QUIET);
} else {
- $io->write('[' . $k . $key . '] ' . $value . '');
+ $io->write('[' . $k . $key . '] ' . $value . '', true, IOInterface::QUIET);
}
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
index cca5f1871..b64b01e18 100644
--- a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
@@ -16,18 +16,17 @@
use Composer\Factory;
use Composer\Installer;
use Composer\Installer\ProjectInstaller;
-use Composer\Installer\InstallationManager;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\IO\IOInterface;
use Composer\Package\BasePackage;
-use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\Package\Version\VersionSelector;
use Composer\Package\AliasPackage;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
-use Composer\Repository\InstalledFilesystemRepository;
+use Composer\Repository\InstalledArrayRepository;
+use Composer\Repository\RepositorySet;
use Composer\Script\ScriptEvents;
use Composer\Util\Silencer;
use Symfony\Component\Console\Input\InputArgument;
@@ -38,6 +37,8 @@
use Composer\Json\JsonFile;
use Composer\Config\JsonConfigSource;
use Composer\Util\Filesystem;
+use Composer\Util\Platform;
+use Composer\Util\ProcessExecutor;
use Composer\Package\Version\VersionParser;
/**
@@ -66,9 +67,11 @@ protected function configure()
new InputArgument('version', InputArgument::OPTIONAL, 'Version, will default to latest'),
new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum-stability allowed (unless a version is specified).'),
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
- new InputOption('repository', null, InputOption::VALUE_REQUIRED, 'Pick a different repository (as url or json config) to look for the package.'),
+ new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'),
+ new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'),
+ new InputOption('repository', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Add custom repositories to look the package up, either by URL or using JSON arrays'),
new InputOption('repository-url', null, InputOption::VALUE_REQUIRED, 'DEPRECATED: Use --repository instead.'),
+ new InputOption('add-repository', null, InputOption::VALUE_NONE, 'Add the custom repository in the composer.json. If a lock file is present it will be deleted and an update will be run instead of install.'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
@@ -78,7 +81,9 @@ protected function configure()
new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deleting the vcs folder.'),
new InputOption('remove-vcs', null, InputOption::VALUE_NONE, 'Whether to force deletion of the vcs folder without prompting.'),
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
+ new InputOption('ask', null, InputOption::VALUE_NONE, 'Whether to ask for project directory.'),
))
->setHelp(
<<'--repository=https://myrepository.org' flag.
+Read more at https://getcomposer.org/doc/03-cli.md#create-project
EOT
)
;
@@ -124,6 +130,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$input->setOption('no-plugins', true);
}
+ if ($input->isInteractive() && $input->getOption('ask')) {
+ $parts = explode("/", strtolower($input->getArgument('package')), 2);
+ $input->setArgument('directory', $io->ask('New project directory ['.array_pop($parts).']: '));
+ }
+
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
+
return $this->installProject(
$io,
$config,
@@ -140,50 +153,86 @@ protected function execute(InputInterface $input, OutputInterface $output)
$input->getOption('no-scripts'),
$input->getOption('no-progress'),
$input->getOption('no-install'),
- $input->getOption('ignore-platform-reqs'),
- !$input->getOption('no-secure-http')
+ $ignorePlatformReqs,
+ !$input->getOption('no-secure-http'),
+ $input->getOption('add-repository')
);
}
- public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repository = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true)
+ public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $addRepository = false)
{
$oldCwd = getcwd();
+ if ($repositories !== null && !is_array($repositories)) {
+ $repositories = (array) $repositories;
+ }
+
// we need to manually load the configuration to pass the auth credentials to the io interface!
$io->loadConfiguration($config);
$this->suggestedPackagesReporter = new SuggestedPackagesReporter($io);
if ($packageName !== null) {
- $installedFromVcs = $this->installRootPackage($io, $config, $packageName, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repository, $disablePlugins, $noScripts, $noProgress, $ignorePlatformReqs, $secureHttp);
+ $installedFromVcs = $this->installRootPackage($io, $config, $packageName, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repositories, $disablePlugins, $noScripts, $noProgress, $ignorePlatformReqs, $secureHttp);
} else {
$installedFromVcs = false;
}
- $composer = Factory::create($io, null, $disablePlugins);
- $composer->getDownloadManager()->setOutputProgress(!$noProgress);
+ if ($repositories !== null && $addRepository && is_file('composer.lock')) {
+ unlink('composer.lock');
+ }
- $fs = new Filesystem();
+ $composer = Factory::create($io, null, $disablePlugins);
+ $composer->getEventDispatcher()->setRunScripts(!$noScripts);
+
+ // add the repository to the composer.json and use it for the install run later
+ if ($repositories !== null && $addRepository) {
+ foreach ($repositories as $index => $repo) {
+ $repoConfig = RepositoryFactory::configFromString($io, $composer->getConfig(), $repo, true);
+ $composerJsonRepositoriesConfig = $composer->getConfig()->getRepositories();
+ $name = RepositoryFactory::generateRepositoryName($index, $repoConfig, $composerJsonRepositoriesConfig);
+ $configSource = new JsonConfigSource(new JsonFile('composer.json'));
+
+ if (
+ (isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false))
+ || (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false))
+ ) {
+ $configSource->addRepository('packagist.org', false);
+ } else {
+ $configSource->addRepository($name, $repoConfig, false);
+ }
- if ($noScripts === false) {
- // dispatch event
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
+ $composer = Factory::create($io, null, $disablePlugins);
+ }
}
+ $process = new ProcessExecutor($io);
+ $fs = new Filesystem($process);
+
+ // dispatch event
+ $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
+
// use the new config including the newly installed project
$config = $composer->getConfig();
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input);
// install dependencies of the created project
if ($noInstall === false) {
+ $composer->getInstallationManager()->setOutputProgress(!$noProgress);
+
$installer = Installer::create($io, $composer);
$installer->setPreferSource($preferSource)
->setPreferDist($preferDist)
->setDevMode($installDevPackages)
- ->setRunScripts(!$noScripts)
->setIgnorePlatformRequirements($ignorePlatformReqs)
->setSuggestedPackagesReporter($this->suggestedPackagesReporter)
- ->setOptimizeAutoloader($config->get('optimize-autoloader'));
+ ->setOptimizeAutoloader($config->get('optimize-autoloader'))
+ ->setClassMapAuthoritative($config->get('classmap-authoritative'))
+ ->setApcuAutoloader($config->get('apcu-autoloader'));
+
+ if (!$composer->getLocker()->isLocked()) {
+ $installer->setUpdate(true);
+ }
if ($disablePlugins) {
$installer->disablePlugins();
@@ -202,7 +251,7 @@ public function installProject(IOInterface $io, Config $config, InputInterface $
&& (
$input->getOption('remove-vcs')
|| !$io->isInteractive()
- || $io->askConfirmation('Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? ', true)
+ || $io->askConfirmation('Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? ')
)
) {
$finder = new Finder();
@@ -239,10 +288,8 @@ public function installProject(IOInterface $io, Config $config, InputInterface $
}
}
- if ($noScripts === false) {
- // dispatch event
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages);
- }
+ // dispatch event
+ $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages);
chdir($oldCwd);
$vendorComposerDir = $config->get('vendor-dir').'/composer';
@@ -257,18 +304,12 @@ public function installProject(IOInterface $io, Config $config, InputInterface $
return 0;
}
- protected function installRootPackage(IOInterface $io, Config $config, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repository = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $ignorePlatformReqs = false, $secureHttp = true)
+ protected function installRootPackage(IOInterface $io, Config $config, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, array $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $ignorePlatformReqs = false, $secureHttp = true)
{
if (!$secureHttp) {
$config->merge(array('config' => array('secure-http' => false)));
}
- if (null === $repository) {
- $sourceRepo = new CompositeRepository(RepositoryFactory::defaultRepos($io, $config));
- } else {
- $sourceRepo = RepositoryFactory::fromString($io, $config, $repository, true);
- }
-
$parser = new VersionParser();
$requirements = $parser->parseNameVersionPairs(array($packageName));
$name = strtolower($requirements[0]['name']);
@@ -276,8 +317,33 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
$packageVersion = $requirements[0]['version'];
}
+ // if no directory was specified, use the 2nd part of the package name
+ if (null === $directory) {
+ $parts = explode("/", $name, 2);
+ $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);
+ }
+
+ $process = new ProcessExecutor($io);
+ $fs = new Filesystem($process);
+ if (!$fs->isAbsolutePath($directory)) {
+ $directory = getcwd() . DIRECTORY_SEPARATOR . $directory;
+ }
+
+ $io->writeError('Creating a "' . $packageName . '" project at "' . $fs->findShortestPath(getcwd(), $directory, true) . '"');
+
+ if (file_exists($directory)) {
+ if (!is_dir($directory)) {
+ throw new \InvalidArgumentException('Cannot create project directory at "'.$directory.'", it exists as a file.');
+ }
+ if (!$fs->isDirEmpty($directory)) {
+ throw new \InvalidArgumentException('Project directory "'.$directory.'" is not empty.');
+ }
+ }
+
if (null === $stability) {
- if (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) {
+ if (null === $packageVersion) {
+ $stability = 'stable';
+ } elseif (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) {
$stability = $match[1];
} else {
$stability = VersionParser::parseStability($packageVersion);
@@ -290,40 +356,44 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities)));
}
- $pool = new Pool($stability);
- $pool->addRepository($sourceRepo);
-
- $phpVersion = null;
- $prettyPhpVersion = null;
- if (!$ignorePlatformReqs) {
- $platformOverrides = $config->get('platform') ?: array();
- // initialize $this->repos as it is used by the parent InitCommand
- $platform = new PlatformRepository(array(), $platformOverrides);
- $phpPackage = $platform->findPackage('php', '*');
- $phpVersion = $phpPackage->getVersion();
- $prettyPhpVersion = $phpPackage->getPrettyVersion();
+ $composer = Factory::create($io, $config->all(), $disablePlugins);
+ $config = $composer->getConfig();
+ $rm = $composer->getRepositoryManager();
+
+ $repositorySet = new RepositorySet($stability);
+ if (null === $repositories) {
+ $repositorySet->addRepository(new CompositeRepository(RepositoryFactory::defaultRepos($io, $config, $rm)));
+ } else {
+ foreach ($repositories as $repo) {
+ $repoConfig = RepositoryFactory::configFromString($io, $config, $repo, true);
+ if (
+ (isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false))
+ || (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false))
+ ) {
+ continue;
+ }
+ $repositorySet->addRepository(RepositoryFactory::createRepo($io, $config, $repoConfig, $rm));
+ }
}
+ $platformOverrides = $config->get('platform') ?: array();
+ $platformRepo = new PlatformRepository(array(), $platformOverrides);
+
// find the latest version if there are multiple
- $versionSelector = new VersionSelector($pool);
- $package = $versionSelector->findBestCandidate($name, $packageVersion, $phpVersion, $stability);
+ $versionSelector = new VersionSelector($repositorySet, $platformRepo);
+ $package = $versionSelector->findBestCandidate($name, $packageVersion, $stability, $ignorePlatformReqs);
if (!$package) {
$errorMessage = "Could not find package $name with " . ($packageVersion ? "version $packageVersion" : "stability $stability");
- if ($phpVersion && $versionSelector->findBestCandidate($name, $packageVersion, null, $stability)) {
- throw new \InvalidArgumentException($errorMessage .' in a version installable using your PHP version '.$prettyPhpVersion.'.');
+ if (true !== $ignorePlatformReqs && $versionSelector->findBestCandidate($name, $packageVersion, $stability, true)) {
+ throw new \InvalidArgumentException($errorMessage .' in a version installable using your PHP version, PHP extensions and Composer version.');
}
throw new \InvalidArgumentException($errorMessage .'.');
}
- if (null === $directory) {
- $parts = explode("/", $name, 2);
- $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);
- }
-
// handler Ctrl+C for unix-like systems
- if (function_exists('pcntl_async_signals')) {
+ if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
@mkdir($directory, 0777, true);
if ($realDir = realpath($directory)) {
pcntl_async_signals(true);
@@ -334,6 +404,22 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
});
}
}
+ // handler Ctrl+C for Windows on PHP 7.4+
+ if (function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli') {
+ @mkdir($directory, 0777, true);
+ if ($realDir = realpath($directory)) {
+ sapi_windows_set_ctrl_handler(function () use ($realDir) {
+ $fs = new Filesystem();
+ $fs->removeDirectory($realDir);
+ exit(130);
+ });
+ }
+ }
+
+ // avoid displaying 9999999-dev as version if default-branch was selected
+ if ($package instanceof AliasPackage && $package->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) {
+ $package = $package->getAliasOf();
+ }
$io->writeError('Installing ' . $package->getName() . ' (' . $package->getFullPrettyVersion(false) . ')');
@@ -345,15 +431,15 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
$package = $package->getAliasOf();
}
- $dm = $this->createDownloadManager($io, $config);
+ $dm = $composer->getDownloadManager();
$dm->setPreferSource($preferSource)
- ->setPreferDist($preferDist)
- ->setOutputProgress(!$noProgress);
+ ->setPreferDist($preferDist);
- $projectInstaller = new ProjectInstaller($directory, $dm);
- $im = $this->createInstallationManager();
+ $projectInstaller = new ProjectInstaller($directory, $dm, $fs);
+ $im = $composer->getInstallationManager();
+ $im->setOutputProgress(!$noProgress);
$im->addInstaller($projectInstaller);
- $im->install(new InstalledFilesystemRepository(new JsonFile('php://memory')), new InstallOperation($package));
+ $im->execute(new InstalledArrayRepository(), array(new InstallOperation($package)));
$im->notifyInstalls($io);
// collect suggestions
@@ -364,21 +450,8 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
$io->writeError('Created project in ' . $directory . '');
chdir($directory);
- $_SERVER['COMPOSER_ROOT_VERSION'] = $package->getPrettyVersion();
- putenv('COMPOSER_ROOT_VERSION='.$_SERVER['COMPOSER_ROOT_VERSION']);
+ Platform::putEnv('COMPOSER_ROOT_VERSION', $package->getPrettyVersion());
return $installedFromVcs;
}
-
- protected function createDownloadManager(IOInterface $io, Config $config)
- {
- $factory = new Factory();
-
- return $factory->createDownloadManager($io, $config);
- }
-
- protected function createInstallationManager()
- {
- return new InstallationManager();
- }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php b/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php
index acbc89a70..c1ebe7eab 100644
--- a/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/DependsCommand.php
@@ -14,6 +14,8 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
/**
* @author Niels Keurentjes
@@ -25,18 +27,22 @@ class DependsCommand extends BaseDependencyCommand
*/
protected function configure()
{
- parent::configure();
-
$this
->setName('depends')
->setAliases(array('why'))
->setDescription('Shows which packages cause the given package to be installed.')
+ ->setDefinition(array(
+ new InputArgument(self::ARGUMENT_PACKAGE, InputArgument::REQUIRED, 'Package to inspect'),
+ new InputOption(self::OPTION_RECURSIVE, 'r', InputOption::VALUE_NONE, 'Recursively resolves up to the root package'),
+ new InputOption(self::OPTION_TREE, 't', InputOption::VALUE_NONE, 'Prints the results as a nested tree'),
+ ))
->setHelp(
<<php composer.phar depends composer/composer
+Read more at https://getcomposer.org/doc/03-cli.md#depends-why-
EOT
)
;
@@ -47,10 +53,10 @@ protected function configure()
*
* @param InputInterface $input
* @param OutputInterface $output
- * @return int|null
+ * @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- return parent::doExecute($input, $output, false);
+ return parent::doExecute($input, $output);
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
index 3efb34973..2fdd99bf2 100644
--- a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
@@ -22,21 +22,25 @@
use Composer\Util\ConfigValidator;
use Composer\Util\IniHelper;
use Composer\Util\ProcessExecutor;
-use Composer\Util\RemoteFilesystem;
+use Composer\Util\HttpDownloader;
use Composer\Util\StreamContextFactory;
+use Composer\Util\Platform;
use Composer\SelfUpdate\Keys;
use Composer\SelfUpdate\Versions;
use Composer\IO\NullIO;
+use Composer\Package\CompletePackageInterface;
+use Composer\XdebugHandler\XdebugHandler;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Process\ExecutableFinder;
/**
* @author Jordi Boggiano
*/
class DiagnoseCommand extends BaseCommand
{
- /** @var RemoteFilesystem */
- protected $rfs;
+ /** @var HttpDownloader */
+ protected $httpDownloader;
/** @var ProcessExecutor */
protected $process;
@@ -55,6 +59,7 @@ protected function configure()
The process exit code will be 1 in case of warnings and 2 for errors.
+Read more at https://getcomposer.org/doc/03-cli.md#diagnose
EOT
)
;
@@ -85,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$config->merge(array('config' => array('secure-http' => false)));
$config->prohibitUrlByConfig('http://repo.packagist.org', new NullIO);
- $this->rfs = Factory::createRemoteFilesystem($io, $config);
+ $this->httpDownloader = Factory::createHttpDownloader($io, $config);
$this->process = new ProcessExecutor($io);
$io->write('Checking platform settings: ', false);
@@ -104,10 +109,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!empty($opts['http']['proxy'])) {
$io->write('Checking HTTP proxy: ', false);
$this->outputResult($this->checkHttpProxy());
- $io->write('Checking HTTP proxy support for request_fulluri: ', false);
- $this->outputResult($this->checkHttpProxyFullUriRequestParam());
- $io->write('Checking HTTPS proxy support for request_fulluri: ', false);
- $this->outputResult($this->checkHttpsProxyFullUriRequestParam());
}
if ($oauth = $config->get('github-oauth')) {
@@ -119,8 +120,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->write('Checking github.com rate limit: ', false);
try {
$rate = $this->getGithubRateLimit('github.com');
- $this->outputResult(true);
- if (10 > $rate['remaining']) {
+ if (!is_array($rate)) {
+ $this->outputResult($rate);
+ } elseif (10 > $rate['remaining']) {
$io->write('WARNING');
$io->write(sprintf(
'Github has a rate limit on their API. '
@@ -131,6 +133,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$rate['remaining'],
$rate['limit']
));
+ } else {
+ $this->outputResult(true);
}
} catch (\Exception $e) {
if ($e instanceof TransportException && $e->getCode() === 401) {
@@ -144,7 +148,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->write('Checking disk free space: ', false);
$this->outputResult($this->checkDiskSpace($config));
- if ('phar:' === substr(__FILE__, 0, 5)) {
+ if (strpos(__FILE__, 'phar:') === 0) {
$io->write('Checking pubkeys: ', false);
$this->outputResult($this->checkPubKeys($config));
@@ -152,13 +156,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->outputResult($this->checkVersion($config));
}
- $io->write(sprintf('Composer version: %s', Composer::VERSION));
+ $io->write(sprintf('Composer version: %s', Composer::getVersion()));
$platformOverrides = $config->get('platform') ?: array();
$platformRepo = new PlatformRepository(array(), $platformOverrides);
$phpPkg = $platformRepo->findPackage('php', '*');
$phpVersion = $phpPkg->getPrettyVersion();
- if (false !== strpos($phpPkg->getDescription(), 'overridden')) {
+ if ($phpPkg instanceof CompletePackageInterface && false !== strpos($phpPkg->getDescription(), 'overridden')) {
$phpVersion .= ' - ' . $phpPkg->getDescription();
}
@@ -168,6 +172,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->write(sprintf('PHP binary path: %s', PHP_BINARY));
}
+ $io->write('OpenSSL version: ' . (defined('OPENSSL_VERSION_TEXT') ? ''.OPENSSL_VERSION_TEXT.'' : 'missing'));
+ $io->write('cURL version: ' . $this->getCurlVersion());
+
+ $finder = new ExecutableFinder;
+ $hasSystemUnzip = (bool) $finder->find('unzip');
+ $bin7zip = '';
+ if ($hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip'))) {
+ $bin7zip = '7z';
+ }
+ if (!Platform::isWindows() && !$hasSystem7zip && $hasSystem7zip = (bool) $finder->find('7zz')) {
+ $bin7zip = '7zz';
+ }
+
+ $io->write(
+ 'zip: ' . (extension_loaded('zip') ? 'extension present' : 'extension not loaded')
+ . ', ' . ($hasSystemUnzip ? 'unzip present' : 'unzip not available')
+ . ', ' . ($hasSystem7zip ? '7-Zip present ('.$bin7zip.')' : '7-Zip not available')
+ . (($hasSystem7zip || $hasSystemUnzip) && !function_exists('proc_open') ? ', proc_open is disabled or not present, unzip/7-z will not be usable' : '')
+ );
+
return $this->exitCode;
}
@@ -197,6 +221,10 @@ private function checkComposerSchema()
private function checkGit()
{
+ if (!function_exists('proc_open')) {
+ return 'proc_open is not available, git cannot be used';
+ }
+
$this->process->execute('git config color.ui', $output);
if (strtolower(trim($output)) === 'always') {
return 'Your git color.ui setting is set to always, this is known to create issues. Use "git config --global color.ui true" to set it correctly.';
@@ -207,26 +235,30 @@ private function checkGit()
private function checkHttp($proto, Config $config)
{
- $disableTls = false;
+ $result = $this->checkConnectivity();
+ if ($result !== true) {
+ return $result;
+ }
+
$result = array();
if ($proto === 'https' && $config->get('disable-tls') === true) {
- $disableTls = true;
- $result[] = 'Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.';
- }
- if ($proto === 'https' && !extension_loaded('openssl') && !$disableTls) {
- $result[] = 'Composer is configured to use SSL/TLS protection but the openssl extension is not available.';
+ $tlsWarning = 'Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.';
}
try {
- $this->rfs->getContents('packagist.org', $proto . '://repo.packagist.org/packages.json', false);
+ $this->httpDownloader->get($proto . '://repo.packagist.org/packages.json');
} catch (TransportException $e) {
- if (false !== strpos($e->getMessage(), 'cafile')) {
- $result[] = '[' . get_class($e) . '] ' . $e->getMessage() . '';
- $result[] = 'Unable to locate a valid CA certificate file. You must set a valid \'cafile\' option.';
- $result[] = 'You can alternatively disable this error, at your own risk, by enabling the \'disable-tls\' option.';
- } else {
- array_unshift($result, '[' . get_class($e) . '] ' . $e->getMessage());
+ if ($hints = HttpDownloader::getExceptionHints($e)) {
+ foreach ($hints as $hint) {
+ $result[] = $hint;
+ }
}
+
+ $result[] = '[' . get_class($e) . '] ' . $e->getMessage() . '';
+ }
+
+ if (isset($tlsWarning)) {
+ $result[] = $tlsWarning;
}
if (count($result) > 0) {
@@ -238,13 +270,18 @@ private function checkHttp($proto, Config $config)
private function checkHttpProxy()
{
+ $result = $this->checkConnectivity();
+ if ($result !== true) {
+ return $result;
+ }
+
$protocol = extension_loaded('openssl') ? 'https' : 'http';
try {
- $json = json_decode($this->rfs->getContents('packagist.org', $protocol . '://repo.packagist.org/packages.json', false), true);
+ $json = $this->httpDownloader->get($protocol . '://repo.packagist.org/packages.json')->decodeJson();
$hash = reset($json['provider-includes']);
$hash = $hash['sha256'];
$path = str_replace('%hash%', $hash, key($json['provider-includes']));
- $provider = $this->rfs->getContents('packagist.org', $protocol . '://repo.packagist.org/'.$path, false);
+ $provider = $this->httpDownloader->get($protocol . '://repo.packagist.org/'.$path)->getBody();
if (hash('sha256', $provider) !== $hash) {
return 'It seems that your proxy is modifying http traffic on the fly';
@@ -256,69 +293,22 @@ private function checkHttpProxy()
return true;
}
- /**
- * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
- * and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
- * This method will test, if you need to disable this parameter via setting extra environment variable in your system.
- *
- * @return bool|string
- */
- private function checkHttpProxyFullUriRequestParam()
- {
- $url = 'http://repo.packagist.org/packages.json';
- try {
- $this->rfs->getContents('packagist.org', $url, false);
- } catch (TransportException $e) {
- try {
- $this->rfs->getContents('packagist.org', $url, false, array('http' => array('request_fulluri' => false)));
- } catch (TransportException $e) {
- return 'Unable to assess the situation, maybe packagist.org is down ('.$e->getMessage().')';
- }
-
- return 'It seems there is a problem with your proxy server, try setting the "HTTP_PROXY_REQUEST_FULLURI" and "HTTPS_PROXY_REQUEST_FULLURI" environment variables to "false"';
- }
-
- return true;
- }
-
- /**
- * Due to various proxy servers configurations, some servers can't handle non-standard HTTP "http_proxy_request_fulluri" parameter,
- * and will return error 500/501 (as not implemented), see discussion @ https://github.com/composer/composer/pull/1825.
- * This method will test, if you need to disable this parameter via setting extra environment variable in your system.
- *
- * @return bool|string
- */
- private function checkHttpsProxyFullUriRequestParam()
+ private function checkGithubOauth($domain, $token)
{
- if (!extension_loaded('openssl')) {
- return 'You need the openssl extension installed for this check';
- }
-
- $url = 'https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0';
- try {
- $this->rfs->getContents('github.com', $url, false);
- } catch (TransportException $e) {
- try {
- $this->rfs->getContents('github.com', $url, false, array('http' => array('request_fulluri' => false)));
- } catch (TransportException $e) {
- return 'Unable to assess the situation, maybe github is down ('.$e->getMessage().')';
- }
-
- return 'It seems there is a problem with your proxy server, try setting the "HTTPS_PROXY_REQUEST_FULLURI" environment variable to "false"';
+ $result = $this->checkConnectivity();
+ if ($result !== true) {
+ return $result;
}
- return true;
- }
-
- private function checkGithubOauth($domain, $token)
- {
$this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
try {
$url = $domain === 'github.com' ? 'https://api.'.$domain.'/' : 'https://'.$domain.'/api/v3/';
- return $this->rfs->getContents($domain, $url, false, array(
+ $this->httpDownloader->get($url, array(
'retry-auth-failure' => false,
- )) ? true : 'Unexpected error';
+ ));
+
+ return true;
} catch (\Exception $e) {
if ($e instanceof TransportException && $e->getCode() === 401) {
return 'The oauth token for '.$domain.' seems invalid, run "composer config --global --unset github-oauth.'.$domain.'" to remove it';
@@ -332,17 +322,21 @@ private function checkGithubOauth($domain, $token)
* @param string $domain
* @param string $token
* @throws TransportException
- * @return array
+ * @return array|string
*/
private function getGithubRateLimit($domain, $token = null)
{
+ $result = $this->checkConnectivity();
+ if ($result !== true) {
+ return $result;
+ }
+
if ($token) {
$this->getIO()->setAuthentication($domain, $token, 'x-oauth-basic');
}
$url = $domain === 'github.com' ? 'https://api.'.$domain.'/rate_limit' : 'https://'.$domain.'/api/rate_limit';
- $json = $this->rfs->getContents($domain, $url, false, array('retry-auth-failure' => false));
- $data = json_decode($json, true);
+ $data = $this->httpDownloader->get($url, array('retry-auth-failure' => false))->decodeJson();
return $data['resources']['core'];
}
@@ -390,8 +384,17 @@ private function checkPubKeys($config)
private function checkVersion($config)
{
- $versionsUtil = new Versions($config, $this->rfs);
- $latest = $versionsUtil->getLatest();
+ $result = $this->checkConnectivity();
+ if ($result !== true) {
+ return $result;
+ }
+
+ $versionsUtil = new Versions($config, $this->httpDownloader);
+ try {
+ $latest = $versionsUtil->getLatest();
+ } catch (\Exception $e) {
+ return $e;
+ }
if (Composer::VERSION !== $latest['version'] && Composer::VERSION !== '@package_version@') {
return 'You are not running the latest '.$versionsUtil->getChannel().' version, run `composer self-update` to update ('.Composer::VERSION.' => '.$latest['version'].')';
@@ -400,8 +403,25 @@ private function checkVersion($config)
return true;
}
+ private function getCurlVersion()
+ {
+ if (extension_loaded('curl')) {
+ if (!HttpDownloader::isCurlEnabled()) {
+ return 'disabled via disable_functions, using php streams fallback, which reduces performance';
+ }
+
+ $version = curl_version();
+
+ return ''.$version['version'].' '.
+ 'libz '.(isset($version['libz_version']) ? $version['libz_version'] : 'missing').' '.
+ 'ssl '.(isset($version['ssl_version']) ? $version['ssl_version'] : 'missing').'';
+ }
+
+ return 'missing, using php streams fallback, which reduces performance';
+ }
+
/**
- * @param bool|string|\Exception $result
+ * @param bool|string|string[]|\Exception $result
*/
private function outputResult($result)
{
@@ -413,6 +433,7 @@ private function outputResult($result)
}
$hadError = false;
+ $hadWarning = false;
if ($result instanceof \Exception) {
$result = '['.get_class($result).'] '.$result->getMessage().'';
}
@@ -427,16 +448,18 @@ private function outputResult($result)
foreach ($result as $message) {
if (false !== strpos($message, '')) {
$hadError = true;
+ } elseif (false !== strpos($message, '')) {
+ $hadWarning = true;
}
}
}
if ($hadError) {
$io->write('FAIL');
- $this->exitCode = 2;
- } else {
+ $this->exitCode = max($this->exitCode, 2);
+ } elseif ($hadWarning) {
$io->write('WARNING');
- $this->exitCode = 1;
+ $this->exitCode = max($this->exitCode, 1);
}
if ($result) {
@@ -481,7 +504,7 @@ private function checkPlatform()
$errors['iconv_mbstring'] = true;
}
- if (!ini_get('allow_url_fopen')) {
+ if (!filter_var(ini_get('allow_url_fopen'), FILTER_VALIDATE_BOOLEAN)) {
$errors['allow_url_fopen'] = true;
}
@@ -505,7 +528,7 @@ private function checkPlatform()
$warnings['openssl_version'] = true;
}
- if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && ini_get('apc.enable_cli')) {
+ if (!defined('HHVM_VERSION') && !extension_loaded('apcu') && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
$warnings['apc_cli'] = true;
}
@@ -528,12 +551,19 @@ private function checkPlatform()
}
}
- if (ini_get('xdebug.profiler_enabled')) {
+ if (filter_var(ini_get('xdebug.profiler_enabled'), FILTER_VALIDATE_BOOLEAN)) {
$warnings['xdebug_profile'] = true;
- } elseif (extension_loaded('xdebug')) {
+ } elseif (XdebugHandler::isXdebugActive()) {
$warnings['xdebug_loaded'] = true;
}
+ if (defined('PHP_WINDOWS_VERSION_BUILD')
+ && (version_compare(PHP_VERSION, '7.2.23', '<')
+ || (version_compare(PHP_VERSION, '7.3.0', '>=')
+ && version_compare(PHP_VERSION, '7.3.10', '<')))) {
+ $warnings['onedrive'] = PHP_VERSION;
+ }
+
if (!empty($errors)) {
foreach ($errors as $error => $current) {
switch ($error) {
@@ -562,20 +592,6 @@ private function checkPlatform()
$text .= "Install either of them or recompile php without --disable-iconv";
break;
- case 'unicode':
- $text = PHP_EOL."The detect_unicode setting must be disabled.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini`:".PHP_EOL;
- $text .= " detect_unicode = Off";
- $displayIniMessage = true;
- break;
-
- case 'suhosin':
- $text = PHP_EOL."The suhosin.executor.include.whitelist setting is incorrect.".PHP_EOL;
- $text .= "Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):".PHP_EOL;
- $text .= " suhosin.executor.include.whitelist = phar ".$current;
- $displayIniMessage = true;
- break;
-
case 'php':
$text = PHP_EOL."Your PHP ({$current}) is too old, you must upgrade to PHP 5.3.2 or higher.";
break;
@@ -598,6 +614,9 @@ private function checkPlatform()
$text = PHP_EOL."The openssl extension is missing, which means that secure HTTPS transfers are impossible.".PHP_EOL;
$text .= "If possible you should enable it or recompile php with --with-openssl";
break;
+
+ default:
+ throw new \InvalidArgumentException(sprintf("DiagnoseCommand: Unknown error type \"%s\". Please report at https://github.com/composer/composer/issues/new.", $error));
}
$out($text, 'error');
}
@@ -657,6 +676,14 @@ private function checkPlatform()
$text .= " xdebug.profiler_enabled = 0";
$displayIniMessage = true;
break;
+
+ case 'onedrive':
+ $text = "The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.".PHP_EOL;
+ $text .= "Upgrade your PHP ({$current}) to use this location with Composer.".PHP_EOL;
+ break;
+
+ default:
+ throw new \InvalidArgumentException(sprintf("DiagnoseCommand: Unknown warning type \"%s\". Please report at https://github.com/composer/composer/issues/new.", $warning));
}
$out($text, 'comment');
}
@@ -668,4 +695,18 @@ private function checkPlatform()
return !$warnings && !$errors ? true : $output;
}
+
+ /**
+ * Check if allow_url_fopen is ON
+ *
+ * @return true|string
+ */
+ private function checkConnectivity()
+ {
+ if (!ini_get('allow_url_fopen')) {
+ return 'Skipped because allow_url_fopen is missing.';
+ }
+
+ return true;
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php b/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php
index fe80e3760..c4b0b9926 100644
--- a/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php
@@ -34,11 +34,17 @@ protected function configure()
new InputOption('optimize', 'o', InputOption::VALUE_NONE, 'Optimizes PSR0 and PSR4 packages to be loaded with classmaps too, good for production.'),
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize`.'),
new InputOption('apcu', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
- new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables autoload-dev rules.'),
+ new InputOption('apcu-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu'),
+ new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables autoload-dev rules. Composer will by default infer this automatically according to the last install or update --no-dev state.'),
+ new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables autoload-dev rules. Composer will by default infer this automatically according to the last install or update --no-dev state.'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
))
->setHelp(
<<php composer.phar dump-autoload
+
+Read more at https://getcomposer.org/doc/03-cli.md#dump-autoload-dumpautoload-
EOT
)
;
@@ -47,6 +53,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$composer = $this->getComposer();
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'dump-autoload', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
@@ -58,21 +65,43 @@ protected function execute(InputInterface $input, OutputInterface $output)
$optimize = $input->getOption('optimize') || $config->get('optimize-autoloader');
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- $apcu = $input->getOption('apcu') || $config->get('apcu-autoloader');
+ $apcuPrefix = $input->getOption('apcu-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu') || $config->get('apcu-autoloader');
if ($authoritative) {
- $this->getIO()->writeError('Generating optimized autoload files (authoritative)');
+ $this->getIO()->write('Generating optimized autoload files (authoritative)');
} elseif ($optimize) {
- $this->getIO()->writeError('Generating optimized autoload files');
+ $this->getIO()->write('Generating optimized autoload files');
} else {
- $this->getIO()->writeError('Generating autoload files');
+ $this->getIO()->write('Generating autoload files');
}
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
+
$generator = $composer->getAutoloadGenerator();
- $generator->setDevMode(!$input->getOption('no-dev'));
+ if ($input->getOption('no-dev')) {
+ $generator->setDevMode(false);
+ }
+ if ($input->getOption('dev')) {
+ if ($input->getOption('no-dev')) {
+ throw new \InvalidArgumentException('You can not use both --no-dev and --dev as they conflict with each other.');
+ }
+ $generator->setDevMode(true);
+ }
$generator->setClassMapAuthoritative($authoritative);
- $generator->setApcu($apcu);
- $generator->setRunScripts(!$input->getOption('no-scripts'));
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
+ $generator->setRunScripts(true);
+ $generator->setApcu($apcu, $apcuPrefix);
+ $generator->setIgnorePlatformRequirements($ignorePlatformReqs);
+ $numberOfClasses = $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
+
+ if ($authoritative) {
+ $this->getIO()->write('Generated optimized autoload files (authoritative) containing '. $numberOfClasses .' classes');
+ } elseif ($optimize) {
+ $this->getIO()->write('Generated optimized autoload files containing '. $numberOfClasses .' classes');
+ } else {
+ $this->getIO()->write('Generated autoload files');
+ }
+
+ return 0;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php b/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php
index f07bc9d28..167a2be0d 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ExecCommand.php
@@ -36,6 +36,13 @@ protected function configure()
'Arguments to pass to the binary. Use -- to separate from composer arguments'
),
))
+ ->setHelp(
+ <<getEventDispatcher();
$dispatcher->addListener('__exec_command', $binary);
- if ($output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL) {
- $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
+
+ // If the CWD was modified, we restore it to what it was initially, as it was
+ // most likely modified by the global command, and we want exec to run in the local working directory
+ // not the global one
+ if (getcwd() !== $this->getApplication()->getInitialWorkingDirectory()) {
+ try {
+ chdir($this->getApplication()->getInitialWorkingDirectory());
+ } catch (\Exception $e) {
+ throw new \RuntimeException('Could not switch back to working directory "'.$this->getApplication()->getInitialWorkingDirectory().'"', 0, $e);
+ }
}
return $dispatcher->dispatchScript('__exec_command', true, $input->getArgument('args'));
diff --git a/app/vendor/composer/composer/src/Composer/Command/FundCommand.php b/app/vendor/composer/composer/src/Composer/Command/FundCommand.php
new file mode 100644
index 000000000..edba9e806
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/Command/FundCommand.php
@@ -0,0 +1,145 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Command;
+
+use Composer\Json\JsonFile;
+use Composer\Package\AliasPackage;
+use Composer\Package\BasePackage;
+use Composer\Package\CompletePackageInterface;
+use Composer\Repository\CompositeRepository;
+use Composer\Semver\Constraint\MatchAllConstraint;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * @author Nicolas Grekas
+ * @author Jordi Boggiano
+ */
+class FundCommand extends BaseCommand
+{
+ protected function configure()
+ {
+ $this->setName('fund')
+ ->setDescription('Discover how to help fund the maintenance of your dependencies.')
+ ->setDefinition(array(
+ new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
+ ))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $composer = $this->getComposer();
+
+ $repo = $composer->getRepositoryManager()->getLocalRepository();
+ $remoteRepos = new CompositeRepository($composer->getRepositoryManager()->getRepositories());
+ $fundings = array();
+
+ $packagesToLoad = array();
+ foreach ($repo->getPackages() as $package) {
+ if ($package instanceof AliasPackage) {
+ continue;
+ }
+ $packagesToLoad[$package->getName()] = new MatchAllConstraint();
+ }
+
+ // load all packages dev versions in parallel
+ $result = $remoteRepos->loadPackages($packagesToLoad, array('dev' => BasePackage::STABILITY_DEV), array());
+
+ // collect funding data from default branches
+ foreach ($result['packages'] as $package) {
+ if (
+ !$package instanceof AliasPackage
+ && $package instanceof CompletePackageInterface
+ && $package->isDefaultBranch()
+ && $package->getFunding()
+ && isset($packagesToLoad[$package->getName()])
+ ) {
+ $fundings = $this->insertFundingData($fundings, $package);
+ unset($packagesToLoad[$package->getName()]);
+ }
+ }
+
+ // collect funding from installed packages if none was found in the default branch above
+ foreach ($repo->getPackages() as $package) {
+ if ($package instanceof AliasPackage || !isset($packagesToLoad[$package->getName()])) {
+ continue;
+ }
+
+ if ($package instanceof CompletePackageInterface && $package->getFunding()) {
+ $fundings = $this->insertFundingData($fundings, $package);
+ }
+ }
+
+ ksort($fundings);
+
+ $io = $this->getIO();
+
+ $format = $input->getOption('format');
+ if (!in_array($format, array('text', 'json'))) {
+ $io->writeError(sprintf('Unsupported format "%s". See help for supported formats.', $format));
+
+ return 1;
+ }
+
+ if ($fundings && $format === 'text') {
+ $prev = null;
+
+ $io->write('The following packages were found in your dependencies which publish funding information:');
+
+ foreach ($fundings as $vendor => $links) {
+ $io->write('');
+ $io->write(sprintf("%s", $vendor));
+ foreach ($links as $url => $packages) {
+ $line = sprintf(' %s', implode(', ', $packages));
+
+ if ($prev !== $line) {
+ $io->write($line);
+ $prev = $line;
+ }
+
+ $io->write(sprintf(' %s', $url));
+ }
+ }
+
+ $io->write("");
+ $io->write("Please consider following these links and sponsoring the work of package authors!");
+ $io->write("Thank you!");
+ } elseif ($format === 'json') {
+ $io->write(JsonFile::encode($fundings));
+ } else {
+ $io->write("No funding links were found in your package dependencies. This doesn't mean they don't need your support!");
+ }
+
+ return 0;
+ }
+
+ private function insertFundingData(array $fundings, CompletePackageInterface $package)
+ {
+ foreach ($package->getFunding() as $fundingOption) {
+ list($vendor, $packageName) = explode('/', $package->getPrettyName());
+ // ignore malformed funding entries
+ if (empty($fundingOption['url'])) {
+ continue;
+ }
+ $url = $fundingOption['url'];
+ if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && preg_match('{^https://github.com/([^/]+)$}', $url, $match)) {
+ $url = 'https://github.com/sponsors/'.$match[1];
+ }
+ $fundings[$vendor][$url][] = $packageName;
+ }
+
+ return $fundings;
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php b/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php
index e13b8aaf2..c78ea7109 100644
--- a/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/GlobalCommand.php
@@ -14,6 +14,7 @@
use Composer\Factory;
use Composer\Util\Filesystem;
+use Composer\Util\Platform;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\StringInput;
@@ -50,6 +51,7 @@ protected function configure()
Note: This path may vary depending on customizations to bin-dir in
composer.json or the environmental variable COMPOSER_BIN_DIR.
+Read more at https://getcomposer.org/doc/03-cli.md#global
EOT
)
;
@@ -57,6 +59,10 @@ protected function configure()
public function run(InputInterface $input, OutputInterface $output)
{
+ if (!method_exists($input, '__toString')) {
+ throw new \LogicException('Expected an Input instance that is stringable, got '.get_class($input));
+ }
+
// extract real command name
$tokens = preg_split('{\s+}', $input->__toString());
$args = array();
@@ -74,6 +80,11 @@ public function run(InputInterface $input, OutputInterface $output)
return parent::run($input, $output);
}
+ // The COMPOSER env var should not apply to the global execution scope
+ if (getenv('COMPOSER')) {
+ Platform::clearEnv('COMPOSER');
+ }
+
// change to global dir
$config = Factory::createConfig();
$home = $config->get('home');
diff --git a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php
index a2f0756a1..8e43f39a4 100644
--- a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php
@@ -14,7 +14,7 @@
use Composer\Package\CompletePackageInterface;
use Composer\Repository\RepositoryInterface;
-use Composer\Repository\ArrayRepository;
+use Composer\Repository\RootPackageRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
@@ -49,6 +49,8 @@ protected function configure()
To open the homepage by default, use -H or --homepage.
To show instead of open the repository or homepage URL, use -s or --show.
+
+Read more at https://getcomposer.org/doc/03-cli.md#browse-home
EOT
);
}
@@ -155,7 +157,7 @@ private function initializeRepos()
if ($composer) {
return array_merge(
- array(new ArrayRepository(array($composer->getPackage()))), // root package
+ array(new RootPackageRepository($composer->getPackage())), // root package
array($composer->getRepositoryManager()->getLocalRepository()), // installed packages
$composer->getRepositoryManager()->getRepositories() // remotes
);
diff --git a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php
index be56b23fb..c8888f07e 100644
--- a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php
@@ -12,21 +12,30 @@
namespace Composer\Command;
-use Composer\DependencyResolver\Pool;
use Composer\Factory;
use Composer\Json\JsonFile;
+use Composer\Json\JsonValidationException;
use Composer\Package\BasePackage;
+use Composer\Package\CompletePackageInterface;
+use Composer\Package\Package;
+use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser;
use Composer\Package\Version\VersionSelector;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
+use Composer\Repository\RepositorySet;
+use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
+use Composer\Semver\Constraint\Constraint;
+use Composer\Util\Silencer;
+use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
+use Symfony\Component\Console\Helper\FormatterHelper;
/**
* @author Justin Rainbow
@@ -34,14 +43,14 @@
*/
class InitCommand extends BaseCommand
{
- /** @var CompositeRepository */
+ /** @var ?CompositeRepository */
protected $repos;
- /** @var array */
+ /** @var array */
private $gitConfig;
- /** @var Pool[] */
- private $pools;
+ /** @var RepositorySet[] */
+ private $repositorySets;
/**
* {@inheritdoc}
@@ -63,6 +72,7 @@ protected function configure()
new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum stability (empty or one of: '.implode(', ', array_keys(BasePackage::$stabilities)).')'),
new InputOption('license', 'l', InputOption::VALUE_REQUIRED, 'License of package'),
new InputOption('repository', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Add custom repositories, either by URL or using JSON arrays'),
+ new InputOption('autoload', 'a', InputOption::VALUE_REQUIRED, 'Add PSR-4 autoload mapping. Maps your package\'s namespace to the provided directory. (Expects a relative path, e.g. src/)'),
))
->setHelp(
<<php composer.phar init
+Read more at https://getcomposer.org/doc/03-cli.md#init
EOT
)
;
@@ -83,8 +94,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$io = $this->getIO();
- $whitelist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license');
- $options = array_filter(array_intersect_key($input->getOptions(), array_flip($whitelist)));
+ $allowlist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license', 'autoload');
+ $options = array_filter(array_intersect_key($input->getOptions(), array_flip($allowlist)));
+
+ if (isset($options['name']) && !preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $options['name'])) {
+ throw new \InvalidArgumentException(
+ 'The package name '.$options['name'].' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
+ );
+ }
if (isset($options['author'])) {
$options['authors'] = $this->formatAuthors($options['author']);
@@ -95,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($repositories) {
$config = Factory::createConfig($io);
foreach ($repositories as $repo) {
- $options['repositories'][] = RepositoryFactory::configFromString($io, $config, $repo);
+ $options['repositories'][] = RepositoryFactory::configFromString($io, $config, $repo, true);
}
}
@@ -116,19 +133,58 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}
+ // --autoload - create autoload object
+ $autoloadPath = null;
+ if (isset($options['autoload'])) {
+ $autoloadPath = $options['autoload'];
+ $namespace = $this->namespaceFromPackageName($input->getOption('name'));
+ $options['autoload'] = (object) array(
+ 'psr-4' => array(
+ $namespace . '\\' => $autoloadPath,
+ ),
+ );
+ }
+
$file = new JsonFile(Factory::getComposerFile());
- $json = $file->encode($options);
+ $json = JsonFile::encode($options);
if ($input->isInteractive()) {
$io->writeError(array('', $json, ''));
- if (!$io->askConfirmation('Do you confirm generation [yes]? ', true)) {
+ if (!$io->askConfirmation('Do you confirm generation [yes]? ')) {
$io->writeError('Command aborted');
return 1;
}
+ } else {
+ if (json_encode($options) === '{"require":{}}') {
+ throw new \RuntimeException('You have to run this command in interactive mode, or specify at least some data using --name, --require, etc.');
+ }
+
+ $io->writeError('Writing '.$file->getPath());
}
$file->write($options);
+ try {
+ $file->validateSchema(JsonFile::LAX_SCHEMA);
+ } catch (JsonValidationException $e) {
+ $io->writeError('Schema validation error, aborting');
+ $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors());
+ $io->writeError($e->getMessage() . ':' . PHP_EOL . $errors);
+ Silencer::call('unlink', $file->getPath());
+
+ return 1;
+ }
+
+ // --autoload - Create src folder
+ if ($autoloadPath) {
+ $filesystem = new Filesystem();
+ $filesystem->ensureDirectoryExists($autoloadPath);
+
+ // dump-autoload only for projects without added dependencies.
+ if (!$this->hasDependencies($options)) {
+ $this->runDumpAutoloadCommand($output);
+ }
+ }
if ($input->isInteractive() && is_dir('.git')) {
$ignoreFile = realpath('.gitignore');
@@ -140,11 +196,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$this->hasVendorIgnore($ignoreFile)) {
$question = 'Would you like the vendor directory added to your .gitignore [yes]? ';
- if ($io->askConfirmation($question, true)) {
+ if ($io->askConfirmation($question)) {
$this->addVendorIgnore($ignoreFile);
}
}
}
+
+ $question = 'Would you like to install dependencies now [yes]? ';
+ if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) {
+ $this->updateDependencies($output);
+ }
+
+ // --autoload - Show post-install configuration info
+ if ($autoloadPath) {
+ $namespace = $this->namespaceFromPackageName($input->getOption('name'));
+
+ $io->writeError('PSR-4 autoloading configured. Use "namespace '.$namespace.';" in '.$autoloadPath);
+ $io->writeError('Include the Composer autoloader with: require \'vendor/autoload.php\';');
+ }
+
+ return 0;
}
/**
@@ -154,6 +225,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
{
$git = $this->getGitConfig();
$io = $this->getIO();
+ /** @var FormatterHelper $formatter */
$formatter = $this->getHelperSet()->get('formatter');
// initialize repos if configured
@@ -161,13 +233,25 @@ protected function interact(InputInterface $input, OutputInterface $output)
if ($repositories) {
$config = Factory::createConfig($io);
$repos = array(new PlatformRepository);
+ $createDefaultPackagistRepo = true;
foreach ($repositories as $repo) {
- $repos[] = RepositoryFactory::fromString($io, $config, $repo);
+ $repoConfig = RepositoryFactory::configFromString($io, $config, $repo, true);
+ if (
+ (isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false))
+ || (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false))
+ ) {
+ $createDefaultPackagistRepo = false;
+ continue;
+ }
+ $repos[] = RepositoryFactory::createRepo($io, $config, $repoConfig);
+ }
+
+ if ($createDefaultPackagistRepo) {
+ $repos[] = RepositoryFactory::createRepo($io, $config, array(
+ 'type' => 'composer',
+ 'url' => 'https://repo.packagist.org',
+ ));
}
- $repos[] = RepositoryFactory::createRepo($io, $config, array(
- 'type' => 'composer',
- 'url' => 'https://repo.packagist.org',
- ));
$this->repos = new CompositeRepository($repos);
unset($repos, $config, $repositories);
@@ -204,15 +288,9 @@ protected function interact(InputInterface $input, OutputInterface $output)
$name = get_current_user() . '/' . $name;
} else {
// package names must be in the format foo/bar
- $name = $name . '/' . $name;
+ $name .= '/' . $name;
}
$name = strtolower($name);
- } else {
- if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) {
- throw new \InvalidArgumentException(
- 'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
- );
- }
}
$name = $io->askAndValidate(
@@ -222,7 +300,7 @@ function ($value) use ($name) {
return $name;
}
- if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {
+ if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $value)) {
throw new \InvalidArgumentException(
'The package name '.$value.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
);
@@ -255,7 +333,7 @@ function ($value) use ($name) {
$author_email = $git['user.email'];
}
- if (isset($author_name) && isset($author_email)) {
+ if (isset($author_name, $author_email)) {
$author = sprintf('%s <%s>', $author_name, $author_email);
}
}
@@ -323,23 +401,61 @@ function ($value) use ($minimumStability) {
// prepare to resolve dependencies
$repos = $this->getRepos();
$preferredStability = $minimumStability ?: 'stable';
- $phpVersion = $repos->findPackage('php', '*')->getPrettyVersion();
+ $platformRepo = null;
+ if ($repos instanceof CompositeRepository) {
+ foreach ($repos->getRepositories() as $candidateRepo) {
+ if ($candidateRepo instanceof PlatformRepository) {
+ $platformRepo = $candidateRepo;
+ break;
+ }
+ }
+ }
$question = 'Would you like to define your dependencies (require) interactively [yes]? ';
$require = $input->getOption('require');
$requirements = array();
- if ($require || $io->askConfirmation($question, true)) {
- $requirements = $this->determineRequirements($input, $output, $require, $phpVersion, $preferredStability);
+ if ($require || $io->askConfirmation($question)) {
+ $requirements = $this->determineRequirements($input, $output, $require, $platformRepo, $preferredStability);
}
$input->setOption('require', $requirements);
$question = 'Would you like to define your dev dependencies (require-dev) interactively [yes]? ';
$requireDev = $input->getOption('require-dev');
$devRequirements = array();
- if ($requireDev || $io->askConfirmation($question, true)) {
- $devRequirements = $this->determineRequirements($input, $output, $requireDev, $phpVersion, $preferredStability);
+ if ($requireDev || $io->askConfirmation($question)) {
+ $devRequirements = $this->determineRequirements($input, $output, $requireDev, $platformRepo, $preferredStability);
}
$input->setOption('require-dev', $devRequirements);
+
+ // --autoload - input and validation
+ $autoload = $input->getOption('autoload') ?: 'src/';
+ $namespace = $this->namespaceFromPackageName($input->getOption('name'));
+ $autoload = $io->askAndValidate(
+ 'Add PSR-4 autoload mapping? Maps namespace "'.$namespace.'" to the entered relative path. ['.$autoload.', n to skip]: ',
+ function ($value) use ($autoload) {
+ if (null === $value) {
+ return $autoload;
+ }
+
+ if ($value === 'n' || $value === 'no') {
+ return;
+ }
+
+ $value = $value ?: $autoload;
+
+ if (!preg_match('{^[^/][A-Za-z0-9\-_/]+/$}', $value)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'The src folder name "%s" is invalid. Please add a relative path with tailing forward slash. [A-Za-z0-9_-/]+/',
+ $value
+ ));
+ }
+
+ return $value;
+ },
+ null,
+ $autoload
+ );
+ $input->setOption('autoload', $autoload);
}
/**
@@ -381,7 +497,7 @@ protected function getRepos()
return $this->repos;
}
- protected function determineRequirements(InputInterface $input, OutputInterface $output, $requires = array(), $phpVersion = null, $preferredStability = 'stable')
+ final protected function determineRequirements(InputInterface $input, OutputInterface $output, $requires = array(), PlatformRepository $platformRepo = null, $preferredStability = 'stable', $checkProvidedVersions = true, $fixed = false)
{
if ($requires) {
$requires = $this->normalizeRequirements($requires);
@@ -391,7 +507,7 @@ protected function determineRequirements(InputInterface $input, OutputInterface
foreach ($requires as $requirement) {
if (!isset($requirement['version'])) {
// determine the best version automatically
- list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $phpVersion, $preferredStability);
+ list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $platformRepo, $preferredStability, null, null, $fixed);
$requirement['version'] = $version;
// replace package name from packagist.org
@@ -404,7 +520,7 @@ protected function determineRequirements(InputInterface $input, OutputInterface
));
} else {
// check that the specified version/constraint exists before we proceed
- list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $phpVersion, $preferredStability, $requirement['version'], 'dev');
+ list($name) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $platformRepo, $preferredStability, $checkProvidedVersions ? $requirement['version'] : null, 'dev', $fixed);
// replace package name from packagist.org
$requirement['name'] = $name;
@@ -417,11 +533,31 @@ protected function determineRequirements(InputInterface $input, OutputInterface
}
$versionParser = new VersionParser();
+
+ // Collect existing packages
+ $composer = $this->getComposer(false);
+ $installedRepo = $composer ? $composer->getRepositoryManager()->getLocalRepository() : null;
+ $existingPackages = array();
+ if ($installedRepo) {
+ foreach ($installedRepo->getPackages() as $package) {
+ $existingPackages[] = $package->getName();
+ }
+ }
+ unset($composer, $installedRepo);
+
$io = $this->getIO();
while (null !== $package = $io->ask('Search for a package: ')) {
$matches = $this->findPackages($package);
if (count($matches)) {
+ // Remove existing packages from search results.
+ foreach ($matches as $position => $foundPackage) {
+ if (in_array($foundPackage['name'], $existingPackages, true)) {
+ unset($matches[$position]);
+ }
+ }
+ $matches = array_values($matches);
+
$exactMatch = null;
$choices = array();
foreach ($matches as $position => $foundPackage) {
@@ -505,7 +641,7 @@ protected function determineRequirements(InputInterface $input, OutputInterface
);
if (false === $constraint) {
- list($name, $constraint) = $this->findBestVersionAndNameForPackage($input, $package, $phpVersion, $preferredStability);
+ list(, $constraint) = $this->findBestVersionAndNameForPackage($input, $package, $platformRepo, $preferredStability);
$io->writeError(sprintf(
'Using version %s for %s',
@@ -519,6 +655,7 @@ protected function determineRequirements(InputInterface $input, OutputInterface
if (false !== $package) {
$requires[] = $package;
+ $existingPackages[] = substr($package, 0, strpos($package, ' '));
}
}
}
@@ -531,15 +668,32 @@ protected function formatAuthors($author)
return array($this->parseAuthorString($author));
}
- protected function formatRequirements(array $requirements)
+ /**
+ * Extract namespace from package's vendor name.
+ *
+ * new_projects.acme-extra/package-name becomes "NewProjectsAcmeExtra\PackageName"
+ *
+ * @param string $packageName
+ *
+ * @return string|null
+ */
+ public function namespaceFromPackageName($packageName)
{
- $requires = array();
- $requirements = $this->normalizeRequirements($requirements);
- foreach ($requirements as $requirement) {
- $requires[$requirement['name']] = $requirement['version'];
+ if (!$packageName || strpos($packageName, '/') === false) {
+ return null;
}
- return $requires;
+ $namespace = array_map(
+ function ($part) {
+ $part = preg_replace('/[^a-z0-9]/i', ' ', $part);
+ $part = ucwords($part);
+
+ return str_replace(' ', '', $part);
+ },
+ explode('/', $packageName)
+ );
+
+ return join('\\', $namespace);
}
protected function getGitConfig()
@@ -551,7 +705,13 @@ protected function getGitConfig()
$finder = new ExecutableFinder();
$gitBin = $finder->find('git');
- $cmd = new Process(sprintf('%s config -l', ProcessExecutor::escape($gitBin)));
+ // TODO in v2.3 always call with an array
+ if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
+ $cmd = new Process(array($gitBin, 'config', '-l'));
+ } else {
+ // @phpstan-ignore-next-line
+ $cmd = new Process(sprintf('%s config -l', ProcessExecutor::escape($gitBin)));
+ }
$cmd->run();
if ($cmd->isSuccessful()) {
@@ -601,20 +761,13 @@ protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor')
return false;
}
- protected function normalizeRequirements(array $requirements)
- {
- $parser = new VersionParser();
-
- return $parser->parseNameVersionPairs($requirements);
- }
-
protected function addVendorIgnore($ignoreFile, $vendor = '/vendor/')
{
$contents = "";
if (file_exists($ignoreFile)) {
$contents = file_get_contents($ignoreFile);
- if ("\n" !== substr($contents, 0, -1)) {
+ if (strpos($contents, "\n") !== 0) {
$contents .= "\n";
}
}
@@ -637,28 +790,28 @@ protected function isValidEmail($email)
return false !== filter_var($email, FILTER_VALIDATE_EMAIL);
}
- private function getPool(InputInterface $input, $minimumStability = null)
+ private function getRepositorySet(InputInterface $input, $minimumStability = null)
{
$key = $minimumStability ?: 'default';
- if (!isset($this->pools[$key])) {
- $this->pools[$key] = $pool = new Pool($minimumStability ?: $this->getMinimumStability($input));
- $pool->addRepository($this->getRepos());
+ if (!isset($this->repositorySets[$key])) {
+ $this->repositorySets[$key] = $repositorySet = new RepositorySet($minimumStability ?: $this->getMinimumStability($input));
+ $repositorySet->addRepository($this->getRepos());
}
- return $this->pools[$key];
+ return $this->repositorySets[$key];
}
private function getMinimumStability(InputInterface $input)
{
if ($input->hasOption('stability')) {
- return $input->getOption('stability') ?: 'stable';
+ return VersionParser::normalizeStability($input->getOption('stability') ?: 'stable');
}
$file = Factory::getComposerFile();
- if (is_file($file) && is_readable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
+ if (is_file($file) && Filesystem::isReadable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
if (!empty($composer['minimum-stability'])) {
- return $composer['minimum-stability'];
+ return VersionParser::normalizeStability($composer['minimum-stability']);
}
}
@@ -672,61 +825,94 @@ private function getMinimumStability(InputInterface $input)
*
* @param InputInterface $input
* @param string $name
- * @param string|null $phpVersion
+ * @param PlatformRepository|null $platformRepo
* @param string $preferredStability
* @param string|null $requiredVersion
* @param string $minimumStability
+ * @param bool $fixed
* @throws \InvalidArgumentException
* @return array name version
*/
- private function findBestVersionAndNameForPackage(InputInterface $input, $name, $phpVersion, $preferredStability = 'stable', $requiredVersion = null, $minimumStability = null)
+ private function findBestVersionAndNameForPackage(InputInterface $input, $name, PlatformRepository $platformRepo = null, $preferredStability = 'stable', $requiredVersion = null, $minimumStability = null, $fixed = null)
{
- // find the latest version allowed in this pool
- $versionSelector = new VersionSelector($this->getPool($input, $minimumStability));
- $package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
-
- // retry without phpVersion if platform requirements are ignored in case nothing was found
- if ($input->hasOption('ignore-platform-reqs') && $input->getOption('ignore-platform-reqs')) {
- $phpVersion = null;
- $package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
+ // handle ignore-platform-reqs flag if present
+ $ignorePlatformReqs = false;
+ if ($input->hasOption('ignore-platform-reqs') && $input->hasOption('ignore-platform-req')) {
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
}
+ // find the latest version allowed in this repo set
+ $versionSelector = new VersionSelector($this->getRepositorySet($input, $minimumStability), $platformRepo);
+ $effectiveMinimumStability = $minimumStability ?: $this->getMinimumStability($input);
+
+ $package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs);
+
if (!$package) {
+ // platform packages can not be found in the pool in versions other than the local platform's has
+ // so if platform reqs are ignored we just take the user's word for it
+ if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($name, $ignorePlatformReqs))) && PlatformRepository::isPlatformPackage($name)) {
+ return array($name, $requiredVersion ?: '*');
+ }
+
// Check whether the PHP version was the problem
- if ($phpVersion && $versionSelector->findBestCandidate($name, $requiredVersion, null, $preferredStability)) {
+ if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, true))) {
throw new \InvalidArgumentException(sprintf(
- 'Package %s at version %s has a PHP requirement incompatible with your PHP version (%s)',
+ 'Package %s%s has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo),
$name,
- $requiredVersion,
- $phpVersion
+ $requiredVersion ? ' at version '.$requiredVersion : ''
+ ));
+ }
+ // Check whether the minimum stability was the problem but the package exists
+ if ($package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) {
+ // we must first verify if a valid package would be found in a lower priority repository
+ if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) {
+ throw new \InvalidArgumentException(
+ 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages with higher priority do not match your minimum-stability and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.'
+ );
+ }
+
+ throw new \InvalidArgumentException(sprintf(
+ 'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.',
+ $name,
+ $effectiveMinimumStability
));
}
// Check whether the required version was the problem
- if ($requiredVersion && $versionSelector->findBestCandidate($name, null, $phpVersion, $preferredStability)) {
+ if ($requiredVersion && $package = $versionSelector->findBestCandidate($name, null, $preferredStability, $ignorePlatformReqs)) {
+ // we must first verify if a valid package would be found in a lower priority repository
+ if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, false, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) {
+ throw new \InvalidArgumentException(
+ 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.'
+ );
+ }
+
throw new \InvalidArgumentException(sprintf(
- 'Could not find package %s in a version matching %s',
+ 'Could not find package %s in a version matching "%s" and a stability matching "'.$effectiveMinimumStability.'".',
$name,
$requiredVersion
));
}
- // Check whether the PHP version was the problem
- if ($phpVersion && $versionSelector->findBestCandidate($name)) {
+ // Check whether the PHP version was the problem for all versions
+ if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, null, $preferredStability, true, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES))) {
+ $additional = '';
+ if (false === $versionSelector->findBestCandidate($name, null, $preferredStability, true)) {
+ $additional = PHP_EOL.PHP_EOL.'Additionally, the package was only found with a stability of "'.$candidate->getStability().'" while your minimum stability is "'.$effectiveMinimumStability.'".';
+ }
+
throw new \InvalidArgumentException(sprintf(
- 'Could not find package %s in any version matching your PHP version (%s)',
+ 'Could not find package %s in any version matching your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo) . '%s',
$name,
- $phpVersion
+ $additional
));
}
// Check for similar names/typos
$similar = $this->findSimilar($name);
if ($similar) {
- // Check whether the minimum stability was the problem but the package exists
- if ($requiredVersion === null && in_array($name, $similar, true)) {
+ if (in_array($name, $similar, true)) {
throw new \InvalidArgumentException(sprintf(
- 'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.',
- $name,
- $this->getMinimumStability($input)
+ "Could not find package %s. It was however found via repository search, which indicates a consistency issue with the repository.",
+ $name
));
}
@@ -740,16 +926,49 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name,
throw new \InvalidArgumentException(sprintf(
'Could not find a matching version of package %s. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (%s).',
$name,
- $this->getMinimumStability($input)
+ $effectiveMinimumStability
));
}
return array(
$package->getPrettyName(),
- $versionSelector->findRecommendedRequireVersion($package),
+ $fixed ? $package->getPrettyVersion() : $versionSelector->findRecommendedRequireVersion($package),
);
}
+ private function getPlatformExceptionDetails(PackageInterface $candidate, PlatformRepository $platformRepo = null)
+ {
+ $details = array();
+ if (!$platformRepo) {
+ return '';
+ }
+
+ foreach ($candidate->getRequires() as $link) {
+ if (!PlatformRepository::isPlatformPackage($link->getTarget())) {
+ continue;
+ }
+ $platformPkg = $platformRepo->findPackage($link->getTarget(), '*');
+ if (!$platformPkg) {
+ $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is not present.';
+ continue;
+ }
+ if (!$link->getConstraint()->matches(new Constraint('==', $platformPkg->getVersion()))) {
+ $platformPkgVersion = $platformPkg->getPrettyVersion();
+ $platformExtra = $platformPkg->getExtra();
+ if (isset($platformExtra['config.platform']) && $platformPkg instanceof CompletePackageInterface) {
+ $platformPkgVersion .= ' ('.$platformPkg->getDescription().')';
+ }
+ $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' which does not match your installed version '.$platformPkgVersion.'.';
+ }
+ }
+
+ if (!$details) {
+ return '';
+ }
+
+ return ':'.PHP_EOL.' - ' . implode(PHP_EOL.' - ', $details);
+ }
+
private function findSimilar($package)
{
try {
@@ -760,11 +979,47 @@ private function findSimilar($package)
}
$similarPackages = array();
+ $installedRepo = $this->getComposer()->getRepositoryManager()->getLocalRepository();
+
foreach ($results as $result) {
+ if ($installedRepo->findPackage($result['name'], '*')) {
+ // Ignore installed package
+ continue;
+ }
$similarPackages[$result['name']] = levenshtein($package, $result['name']);
}
asort($similarPackages);
return array_keys(array_slice($similarPackages, 0, 5));
}
+
+ private function updateDependencies($output)
+ {
+ try {
+ $updateCommand = $this->getApplication()->find('update');
+ $this->getApplication()->resetComposer();
+ $updateCommand->run(new ArrayInput(array()), $output);
+ } catch (\Exception $e) {
+ $this->getIO()->writeError('Could not update dependencies. Run `composer update` to see more information.');
+ }
+ }
+
+ private function runDumpAutoloadCommand($output)
+ {
+ try {
+ $command = $this->getApplication()->find('dump-autoload');
+ $this->getApplication()->resetComposer();
+ $command->run(new ArrayInput(array()), $output);
+ } catch (\Exception $e) {
+ $this->getIO()->writeError('Could not run dump-autoload.');
+ }
+ }
+
+ private function hasDependencies($options)
+ {
+ $requires = (array) $options['require'];
+ $devRequires = isset($options['require-dev']) ? (array) $options['require-dev'] : array();
+
+ return !empty($requires) || !empty($devRequires);
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php b/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php
index cc590d8c9..eda9c25cf 100644
--- a/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/InstallCommand.php
@@ -15,6 +15,7 @@
use Composer\Installer;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
+use Composer\Util\HttpDownloader;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
@@ -36,20 +37,23 @@ protected function configure()
->setDescription('Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.')
->setDefinition(array(
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
+ new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'),
+ new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'),
new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
+ new InputOption('dev', null, InputOption::VALUE_NONE, 'DEPRECATED: Enables installation of require-dev packages (enabled by default, only present for BC).'),
+ new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
- new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'Do not show package suggestions.'),
+ new InputOption('no-install', null, InputOption::VALUE_NONE, 'Do not use, only defined here to catch misuse of the install command.'),
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
+ new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Should not be provided, use composer require instead to add a given package to composer.json.'),
))
->setHelp(
@@ -61,6 +65,7 @@ protected function configure()
php composer.phar install
+Read more at https://getcomposer.org/doc/03-cli.md#install-i
EOT
)
;
@@ -69,23 +74,31 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = $this->getIO();
+ if ($input->getOption('dev')) {
+ $io->writeError('You are using the deprecated option "--dev". It has no effect and will break in Composer 3.');
+ }
+ if ($input->getOption('no-suggest')) {
+ $io->writeError('You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.');
+ }
+
if ($args = $input->getArgument('packages')) {
$io->writeError('Invalid argument '.implode(' ', $args).'. Use "composer require '.implode(' ', $args).'" instead to add packages to your composer.json.');
return 1;
}
- if ($input->getOption('no-custom-installers')) {
- $io->writeError('You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.');
- $input->setOption('no-plugins', true);
- }
+ if ($input->getOption('no-install')) {
+ $io->writeError('Invalid option "--no-install". Use "composer update --no-install" instead if you are trying to update the composer.lock file.');
- if ($input->getOption('dev')) {
- $io->writeError('You are using the deprecated option "dev". Dev packages are installed by default now.');
+ return 1;
}
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
+
+ if ((!$composer->getLocker() || !$composer->getLocker()->isLocked()) && !HttpDownloader::isCurlEnabled()) {
+ $io->writeError('Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.');
+ }
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'install', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
@@ -97,7 +110,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
$optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- $apcu = $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
+ $apcuPrefix = $input->getOption('apcu-autoloader-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
+
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
+
+ $composer->getInstallationManager()->setOutputProgress(!$input->getOption('no-progress'));
$install
->setDryRun($input->getOption('dry-run'))
@@ -106,12 +124,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setPreferDist($preferDist)
->setDevMode(!$input->getOption('no-dev'))
->setDumpAutoloader(!$input->getOption('no-autoloader'))
- ->setRunScripts(!$input->getOption('no-scripts'))
- ->setSkipSuggest($input->getOption('no-suggest'))
->setOptimizeAutoloader($optimize)
->setClassMapAuthoritative($authoritative)
- ->setApcuAutoloader($apcu)
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
+ ->setApcuAutoloader($apcu, $apcuPrefix)
+ ->setIgnorePlatformRequirements($ignorePlatformReqs)
;
if ($input->getOption('no-plugins')) {
diff --git a/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php b/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php
index 9dec45e1b..b4544cf50 100644
--- a/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/LicensesCommand.php
@@ -21,6 +21,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
/**
* @author Benoît Merlet
@@ -33,7 +34,7 @@ protected function configure()
->setName('licenses')
->setDescription('Shows information about licenses of dependencies.')
->setDefinition(array(
- new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
+ new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text, json or summary', 'text'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'),
))
->setHelp(
@@ -41,6 +42,7 @@ protected function configure()
The license command displays detailed information about the licenses of
the installed dependencies.
+Read more at https://getcomposer.org/doc/03-cli.md#licenses
EOT
)
;
@@ -76,7 +78,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$table = new Table($output);
$table->setStyle('compact');
$tableStyle = $table->getStyle();
- $tableStyle->setVerticalBorderChar('');
+ if (method_exists($tableStyle, 'setVerticalBorderChars')) {
+ $tableStyle->setVerticalBorderChars('');
+ } else {
+ // TODO remove in composer 2.2
+ // @phpstan-ignore-next-line
+ $tableStyle->setVerticalBorderChar('');
+ }
$tableStyle->setCellRowContentFormat('%s ');
$table->setHeaders(array('Name', 'Version', 'License'));
foreach ($packages as $package) {
@@ -106,9 +114,36 @@ protected function execute(InputInterface $input, OutputInterface $output)
)));
break;
+ case 'summary':
+ $usedLicenses = array();
+ foreach ($packages as $package) {
+ $license = $package->getLicense();
+ $licenseName = $license[0];
+ if (!isset($usedLicenses[$licenseName])) {
+ $usedLicenses[$licenseName] = 0;
+ }
+ $usedLicenses[$licenseName]++;
+ }
+
+ // Sort licenses so that the most used license will appear first
+ arsort($usedLicenses, SORT_NUMERIC);
+
+ $rows = array();
+ foreach ($usedLicenses as $usedLicense => $numberOfDependencies) {
+ $rows[] = array($usedLicense, $numberOfDependencies);
+ }
+
+ $symfonyIo = new SymfonyStyle($input, $output);
+ $symfonyIo->table(
+ array('License', 'Number of dependencies'),
+ $rows
+ );
+ break;
default:
throw new \RuntimeException(sprintf('Unsupported format "%s". See help for supported formats.', $format));
}
+
+ return 0;
}
/**
diff --git a/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php b/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php
index f867f75f4..ace1631d8 100644
--- a/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php
@@ -32,10 +32,13 @@ protected function configure()
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead.'),
new InputOption('outdated', 'o', InputOption::VALUE_NONE, 'Show only packages that are outdated (this is the default, but present here for compat with `show`'),
new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show all installed packages with their latest versions'),
+ new InputOption('locked', null, InputOption::VALUE_NONE, 'Shows updates for packages from the lock file, regardless of what is currently in vendor dir'),
new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'),
new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code when there are outdated packages'),
new InputOption('minor-only', 'm', InputOption::VALUE_NONE, 'Show only packages that have minor SemVer-compatible updates. Use with the --outdated option.'),
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
+ new InputOption('ignore', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore specified package(s). Use it with the --outdated option if you don\'t want to be informed about new versions of some packages.'),
+ new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'),
))
->setHelp(
<<red (!): Dependency has a new version that is semver-compatible and you should upgrade it.
-
+Read more at https://getcomposer.org/doc/03-cli.md#outdated
EOT
)
;
@@ -58,7 +61,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$args = array(
- 'show',
+ 'command' => 'show',
'--latest' => true,
);
if (!$input->getOption('all')) {
@@ -76,7 +79,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($input->getOption('minor-only')) {
$args['--minor-only'] = true;
}
+ if ($input->getOption('locked')) {
+ $args['--locked'] = true;
+ }
+ if ($input->getOption('no-dev')) {
+ $args['--no-dev'] = true;
+ }
$args['--format'] = $input->getOption('format');
+ $args['--ignore'] = $input->getOption('ignore');
$input = new ArrayInput($args);
diff --git a/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php b/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php
index edf6729ab..9931a881b 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php
@@ -14,6 +14,8 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
/**
* @author Niels Keurentjes
@@ -25,18 +27,23 @@ class ProhibitsCommand extends BaseDependencyCommand
*/
protected function configure()
{
- parent::configure();
-
$this
->setName('prohibits')
->setAliases(array('why-not'))
->setDescription('Shows which packages prevent the given package from being installed.')
+ ->setDefinition(array(
+ new InputArgument(self::ARGUMENT_PACKAGE, InputArgument::REQUIRED, 'Package to inspect'),
+ new InputArgument(self::ARGUMENT_CONSTRAINT, InputArgument::REQUIRED, 'Version constraint, which version you expected to be installed'),
+ new InputOption(self::OPTION_RECURSIVE, 'r', InputOption::VALUE_NONE, 'Recursively resolves up to the root package'),
+ new InputOption(self::OPTION_TREE, 't', InputOption::VALUE_NONE, 'Prints the results as a nested tree'),
+ ))
->setHelp(
<<php composer.phar prohibits composer/composer
+Read more at https://getcomposer.org/doc/03-cli.md#prohibits-why-not-
EOT
)
;
@@ -47,7 +54,7 @@ protected function configure()
*
* @param InputInterface $input
* @param OutputInterface $output
- * @return int|null
+ * @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php b/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php
new file mode 100644
index 000000000..c92564658
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php
@@ -0,0 +1,164 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Command;
+
+use Composer\DependencyResolver\Operation\InstallOperation;
+use Composer\DependencyResolver\Operation\UninstallOperation;
+use Composer\DependencyResolver\Transaction;
+use Composer\Package\AliasPackage;
+use Composer\Package\BasePackage;
+use Composer\Plugin\CommandEvent;
+use Composer\Plugin\PluginEvents;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * @author Jordi Boggiano
+ */
+class ReinstallCommand extends BaseCommand
+{
+ protected function configure()
+ {
+ $this
+ ->setName('reinstall')
+ ->setDescription('Uninstalls and reinstalls the given package names')
+ ->setDefinition(array(
+ new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
+ new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'),
+ new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'),
+ new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
+ new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
+ new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
+ new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
+ new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
+ new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
+ new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
+ new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'List of package names to reinstall, can include a wildcard (*) to match any substring.'),
+ ))
+ ->setHelp(
+ <<reinstall command looks up installed packages by name,
+uninstalls them and reinstalls them. This lets you do a clean install
+of a package if you messed with its files, or if you wish to change
+the installation type using --prefer-install.
+
+php composer.phar reinstall acme/foo "acme/bar-*"
+
+Read more at https://getcomposer.org/doc/03-cli.md#reinstall
+EOT
+ )
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = $this->getIO();
+
+ $composer = $this->getComposer(true, $input->getOption('no-plugins'));
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
+
+ $localRepo = $composer->getRepositoryManager()->getLocalRepository();
+ $packagesToReinstall = array();
+ $packageNamesToReinstall = array();
+ foreach ($input->getArgument('packages') as $pattern) {
+ $patternRegexp = BasePackage::packageNameToRegexp($pattern);
+ $matched = false;
+ foreach ($localRepo->getCanonicalPackages() as $package) {
+ if (preg_match($patternRegexp, $package->getName())) {
+ $matched = true;
+ $packagesToReinstall[] = $package;
+ $packageNamesToReinstall[] = $package->getName();
+ }
+ }
+
+ if (!$matched) {
+ $io->writeError('Pattern "' . $pattern . '" does not match any currently installed packages.');
+ }
+ }
+
+ if (!$packagesToReinstall) {
+ $io->writeError('Found no packages to reinstall, aborting.');
+
+ return 1;
+ }
+
+ $uninstallOperations = array();
+ foreach ($packagesToReinstall as $package) {
+ $uninstallOperations[] = new UninstallOperation($package);
+ }
+
+ // make sure we have a list of install operations ordered by dependency/plugins
+ $presentPackages = $localRepo->getPackages();
+ $resultPackages = $presentPackages;
+ foreach ($presentPackages as $index => $package) {
+ if (in_array($package->getName(), $packageNamesToReinstall, true)) {
+ unset($presentPackages[$index]);
+ }
+ }
+ $transaction = new Transaction($presentPackages, $resultPackages);
+ $installOperations = $transaction->getOperations();
+
+ // reverse-sort the uninstalls based on the install order
+ $installOrder = array();
+ foreach ($installOperations as $index => $op) {
+ if ($op instanceof InstallOperation && !$op->getPackage() instanceof AliasPackage) {
+ $installOrder[$op->getPackage()->getName()] = $index;
+ }
+ }
+ usort($uninstallOperations, function ($a, $b) use ($installOrder) {
+ return $installOrder[$b->getPackage()->getName()] - $installOrder[$a->getPackage()->getName()];
+ });
+
+ $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'reinstall', $input, $output);
+ $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
+
+ $config = $composer->getConfig();
+ list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input);
+
+ $installationManager = $composer->getInstallationManager();
+ $downloadManager = $composer->getDownloadManager();
+ $package = $composer->getPackage();
+
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
+
+ $installationManager->setOutputProgress(!$input->getOption('no-progress'));
+ if ($input->getOption('no-plugins')) {
+ $installationManager->disablePlugins();
+ }
+
+ $downloadManager->setPreferSource($preferSource);
+ $downloadManager->setPreferDist($preferDist);
+
+ $installationManager->execute($localRepo, $uninstallOperations, true);
+ $installationManager->execute($localRepo, $installOperations, true);
+
+ if (!$input->getOption('no-autoloader')) {
+ $optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
+ $authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
+ $apcuPrefix = $input->getOption('apcu-autoloader-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
+
+ $generator = $composer->getAutoloadGenerator();
+ $generator->setClassMapAuthoritative($authoritative);
+ $generator->setApcu($apcu, $apcuPrefix);
+ $generator->setIgnorePlatformRequirements($ignorePlatformReqs);
+ $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
+ }
+
+ return 0;
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php b/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php
index c97130c3a..3cd865126 100644
--- a/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/RemoveCommand.php
@@ -13,6 +13,7 @@
namespace Composer\Command;
use Composer\Config\JsonConfigSource;
+use Composer\DependencyResolver\Request;
use Composer\Installer;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
@@ -22,6 +23,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
+use Composer\Package\BasePackage;
/**
* @author Pierre du Plessis
@@ -37,16 +39,23 @@ protected function configure()
->setDefinition(array(
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'Packages that should be removed.'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Removes a package from the require-dev section.'),
+ new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'),
+ new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies (implies --no-install).'),
+ new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'),
- new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies. (Deprecrated, is now default behavior)'),
+ new InputOption('update-with-dependencies', 'w', InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies. (Deprecrated, is now default behavior)'),
+ new InputOption('update-with-all-dependencies', 'W', InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'),
+ new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Alias for --update-with-all-dependencies'),
new InputOption('no-update-with-dependencies', null, InputOption::VALUE_NONE, 'Does not allow inherited dependencies to be updated with explicit dependencies.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
+ new InputOption('unused', null, InputOption::VALUE_NONE, 'Remove all packages which are locked but not required by any other package.'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
+ new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'),
))
->setHelp(
<<php composer.phar remove
+Read more at https://getcomposer.org/doc/03-cli.md#remove
EOT
)
;
}
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ if ($input->getOption('unused')) {
+ $composer = $this->getComposer();
+ $locker = $composer->getLocker();
+ if (!$locker->isLocked()) {
+ throw new \UnexpectedValueException('A valid composer.lock file is required to run this command with --unused');
+ }
+
+ $lockedPackages = $locker->getLockedRepository()->getPackages();
+
+ $required = array();
+ foreach (array_merge($composer->getPackage()->getRequires(), $composer->getPackage()->getDevRequires()) as $link) {
+ $required[$link->getTarget()] = true;
+ }
+
+ do {
+ $found = false;
+ foreach ($lockedPackages as $index => $package) {
+ foreach ($package->getNames() as $name) {
+ if (isset($required[$name])) {
+ foreach ($package->getRequires() as $link) {
+ $required[$link->getTarget()] = true;
+ }
+ $found = true;
+ unset($lockedPackages[$index]);
+ break;
+ }
+ }
+ }
+ } while ($found);
+
+ $unused = array();
+ foreach ($lockedPackages as $package) {
+ $unused[] = $package->getName();
+ }
+ $input->setArgument('packages', array_merge($input->getArgument('packages'), $unused));
+
+ if (!$input->getArgument('packages')) {
+ $this->getIO()->writeError('No unused packages to remove');
+ $this->setCode(function () {
+ return 0;
+ });
+ }
+ }
+ }
+
protected function execute(InputInterface $input, OutputInterface $output)
{
$packages = $input->getArgument('packages');
@@ -90,14 +147,45 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}
+ $dryRun = $input->getOption('dry-run');
+ $toRemove = array();
foreach ($packages as $package) {
if (isset($composer[$type][$package])) {
- $json->removeLink($type, $composer[$type][$package]);
+ if ($dryRun) {
+ $toRemove[$type][] = $composer[$type][$package];
+ } else {
+ $json->removeLink($type, $composer[$type][$package]);
+ }
} elseif (isset($composer[$altType][$package])) {
- $io->writeError(''.$composer[$altType][$package].' could not be found in '.$type.' but it is present in '.$altType.'');
+ $io->writeError('' . $composer[$altType][$package] . ' could not be found in ' . $type . ' but it is present in ' . $altType . '');
if ($io->isInteractive()) {
- if ($io->askConfirmation('Do you want to remove it from '.$altType.' [yes]? ', true)) {
- $json->removeLink($altType, $composer[$altType][$package]);
+ if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ')) {
+ if ($dryRun) {
+ $toRemove[$altType][] = $composer[$altType][$package];
+ } else {
+ $json->removeLink($altType, $composer[$altType][$package]);
+ }
+ }
+ }
+ } elseif (isset($composer[$type]) && $matches = preg_grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$type]))) {
+ foreach ($matches as $matchedPackage) {
+ if ($dryRun) {
+ $toRemove[$type][] = $matchedPackage;
+ } else {
+ $json->removeLink($type, $matchedPackage);
+ }
+ }
+ } elseif (isset($composer[$altType]) && $matches = preg_grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$altType]))) {
+ foreach ($matches as $matchedPackage) {
+ $io->writeError('' . $matchedPackage . ' could not be found in ' . $type . ' but it is present in ' . $altType . '');
+ if ($io->isInteractive()) {
+ if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ')) {
+ if ($dryRun) {
+ $toRemove[$altType][] = $matchedPackage;
+ } else {
+ $json->removeLink($altType, $matchedPackage);
+ }
+ }
}
}
} else {
@@ -105,6 +193,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}
+ $io->writeError(''.$file.' has been updated');
+
if ($input->getOption('no-update')) {
return 0;
}
@@ -112,37 +202,85 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Update packages
$this->resetComposer();
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
+
+ if ($dryRun) {
+ $rootPackage = $composer->getPackage();
+ $links = array(
+ 'require' => $rootPackage->getRequires(),
+ 'require-dev' => $rootPackage->getDevRequires(),
+ );
+ foreach ($toRemove as $type => $names) {
+ foreach ($names as $name) {
+ unset($links[$type][$name]);
+ }
+ }
+ $rootPackage->setRequires($links['require']);
+ $rootPackage->setDevRequires($links['require-dev']);
+ }
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'remove', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
+ $composer->getInstallationManager()->setOutputProgress(!$input->getOption('no-progress'));
+
$install = Installer::create($io, $composer);
$updateDevMode = !$input->getOption('update-no-dev');
$optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
$authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');
- $apcu = $input->getOption('apcu-autoloader') || $composer->getConfig()->get('apcu-autoloader');
+ $apcuPrefix = $input->getOption('apcu-autoloader-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $composer->getConfig()->get('apcu-autoloader');
+
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE;
+ $flags = '';
+ if ($input->getOption('update-with-all-dependencies') || $input->getOption('with-all-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS;
+ $flags .= ' --with-all-dependencies';
+ } elseif ($input->getOption('no-update-with-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_ONLY_LISTED;
+ $flags .= ' --with-dependencies';
+ }
+
+ $io->writeError('Running composer update '.implode(' ', $packages).$flags.'');
+
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
$install
->setVerbose($input->getOption('verbose'))
->setDevMode($updateDevMode)
->setOptimizeAutoloader($optimize)
->setClassMapAuthoritative($authoritative)
- ->setApcuAutoloader($apcu)
+ ->setApcuAutoloader($apcu, $apcuPrefix)
->setUpdate(true)
- ->setUpdateWhitelist($packages)
- ->setWhitelistTransitiveDependencies(!$input->getOption('no-update-with-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
- ->setRunScripts(!$input->getOption('no-scripts'))
+ ->setInstall(!$input->getOption('no-install'))
+ ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)
+ ->setIgnorePlatformRequirements($ignorePlatformReqs)
+ ->setDryRun($dryRun)
;
+ // if no lock is present, we do not do a partial update as
+ // this is not supported by the Installer
+ if ($composer->getLocker()->isLocked()) {
+ $install->setUpdateAllowList($packages);
+ }
+
$status = $install->run();
if ($status !== 0) {
$io->writeError("\n".'Removal failed, reverting '.$file.' to its original content.');
file_put_contents($jsonFile->getPath(), $composerBackup);
}
+ if (!$dryRun) {
+ foreach ($packages as $package) {
+ if ($composer->getRepositoryManager()->getLocalRepository()->findPackages($package)) {
+ $io->writeError('Removal failed, '.$package.' is still present, it may be required by another package. See `composer why '.$package.'`.');
+
+ return 2;
+ }
+ }
+ }
+
return $status;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php
index 01439207f..578e2a208 100644
--- a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php
@@ -12,6 +12,8 @@
namespace Composer\Command;
+use Composer\DependencyResolver\Request;
+use Composer\Util\Filesystem;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
@@ -21,10 +23,14 @@
use Composer\Json\JsonFile;
use Composer\Json\JsonManipulator;
use Composer\Package\Version\VersionParser;
+use Composer\Package\Loader\ArrayLoader;
+use Composer\Package\BasePackage;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
+use Composer\IO\IOInterface;
+use Composer\Util\Silencer;
/**
* @author Jérémy Romey
@@ -32,6 +38,21 @@
*/
class RequireCommand extends InitCommand
{
+ /** @var bool */
+ private $newlyCreated;
+ /** @var bool */
+ private $firstRequire;
+ /** @var JsonFile */
+ private $json;
+ /** @var string */
+ private $file;
+ /** @var string */
+ private $composerBackup;
+ /** @var string file name */
+ private $lock;
+ /** @var ?string contents before modification if the lock file exists */
+ private $lockBackup;
+
protected function configure()
{
$this
@@ -40,34 +61,43 @@ protected function configure()
->setDefinition(array(
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Optional package name can also include a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'),
+ new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
+ new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'),
+ new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'),
+ new InputOption('fixed', null, InputOption::VALUE_NONE, 'Write fixed version to the composer.json.'),
+ new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'Do not show package suggestions.'),
- new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'),
+ new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies (implies --no-install).'),
+ new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'),
- new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated, except those that are root requirements.'),
- new InputOption('update-with-all-dependencies', null, InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
+ new InputOption('update-with-dependencies', 'w', InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated, except those that are root requirements.'),
+ new InputOption('update-with-all-dependencies', 'W', InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'),
+ new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Alias for --update-with-dependencies'),
+ new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Alias for --update-with-all-dependencies'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
new InputOption('prefer-stable', null, InputOption::VALUE_NONE, 'Prefer stable versions of dependencies.'),
new InputOption('prefer-lowest', null, InputOption::VALUE_NONE, 'Prefer lowest versions of dependencies.'),
new InputOption('sort-packages', null, InputOption::VALUE_NONE, 'Sorts packages when adding/updating a new dependency'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'),
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
+ new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'),
))
->setHelp(
<<file = Factory::getComposerFile();
$io = $this->getIO();
- $newlyCreated = !file_exists($file);
- if ($newlyCreated && !file_put_contents($file, "{\n}\n")) {
- $io->writeError(''.$file.' could not be created.');
+ if ($input->getOption('no-suggest')) {
+ $io->writeError('You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.');
+ }
+
+ $this->newlyCreated = !file_exists($this->file);
+ if ($this->newlyCreated && !file_put_contents($this->file, "{\n}\n")) {
+ $io->writeError(''.$this->file.' could not be created.');
return 1;
}
- if (!is_readable($file)) {
- $io->writeError(''.$file.' is not readable.');
+ if (!Filesystem::isReadable($this->file)) {
+ $io->writeError(''.$this->file.' is not readable.');
return 1;
}
- if (!is_writable($file)) {
- $io->writeError(''.$file.' is not writable.');
- return 1;
+ if (filesize($this->file) === 0) {
+ file_put_contents($this->file, "{\n}\n");
}
- if (filesize($file) === 0) {
- file_put_contents($file, "{\n}\n");
+ $this->json = new JsonFile($this->file);
+ $this->lock = Factory::getLockFile($this->file);
+ $this->composerBackup = file_get_contents($this->json->getPath());
+ $this->lockBackup = file_exists($this->lock) ? file_get_contents($this->lock) : null;
+
+ // check for writability by writing to the file as is_writable can not be trusted on network-mounts
+ // see https://github.com/composer/composer/issues/8231 and https://bugs.php.net/bug.php?id=68926
+ if (!is_writable($this->file) && !Silencer::call('file_put_contents', $this->file, $this->composerBackup)) {
+ $io->writeError(''.$this->file.' is not writable.');
+
+ return 1;
}
- $json = new JsonFile($file);
- $composerBackup = file_get_contents($json->getPath());
+ if ($input->getOption('fixed') === true) {
+ $config = $this->json->read();
+
+ $packageType = empty($config['type']) ? 'library' : $config['type'];
+
+ /**
+ * @see https://github.com/composer/composer/pull/8313#issuecomment-532637955
+ */
+ if ($packageType !== 'project') {
+ $io->writeError('"--fixed" option is allowed for "project" package types only to prevent possible misuses.');
+
+ if (empty($config['type'])) {
+ $io->writeError('If your package is not library, you should explicitly specify "type" parameter in composer.json.');
+ }
+
+ return 1;
+ }
+ }
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
$repos = $composer->getRepositoryManager()->getRepositories();
@@ -108,7 +173,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
// initialize $this->repos as it is used by the parent InitCommand
$this->repos = new CompositeRepository(array_merge(
- array(new PlatformRepository(array(), $platformOverrides)),
+ array($platformRepo = new PlatformRepository(array(), $platformOverrides)),
$repos
));
@@ -118,8 +183,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
$preferredStability = $composer->getPackage()->getMinimumStability();
}
- $phpVersion = $this->repos->findPackage('php', '*')->getPrettyVersion();
- $requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'), $phpVersion, $preferredStability);
+ try {
+ $requirements = $this->determineRequirements(
+ $input,
+ $output,
+ $input->getArgument('packages'),
+ $platformRepo,
+ $preferredStability,
+ !$input->getOption('no-update'),
+ $input->getOption('fixed')
+ );
+ } catch (\Exception $e) {
+ if ($this->newlyCreated) {
+ throw new \RuntimeException('No composer.json present in the current directory ('.$this->file.'), this may be the cause of the following exception.', 0, $e);
+ }
+
+ throw $e;
+ }
$requireKey = $input->getOption('dev') ? 'require-dev' : 'require';
$removeKey = $input->getOption('dev') ? 'require' : 'require-dev';
@@ -127,69 +207,187 @@ protected function execute(InputInterface $input, OutputInterface $output)
// validate requirements format
$versionParser = new VersionParser();
- foreach ($requirements as $constraint) {
+ foreach ($requirements as $package => $constraint) {
+ if (strtolower($package) === $composer->getPackage()->getName()) {
+ $io->writeError(sprintf('Root package \'%s\' cannot require itself in its composer.json', $package));
+
+ return 1;
+ }
$versionParser->parseConstraints($constraint);
}
+ $inconsistentRequireKeys = $this->getInconsistentRequireKeys($requirements, $requireKey);
+ if (count($inconsistentRequireKeys) > 0) {
+ foreach ($inconsistentRequireKeys as $package) {
+ $io->warning(sprintf(
+ '%s is currently present in the %s key and you ran the command %s the --dev flag, which would move it to the %s key.',
+ $package,
+ $removeKey,
+ $input->getOption('dev') ? 'with' : 'without',
+ $requireKey
+ ));
+ }
+
+ if ($io->isInteractive()) {
+ if (!$io->askConfirmation(sprintf('Do you want to move %s? [no]? ', count($inconsistentRequireKeys) > 1 ? 'these requirements' : 'this requirement'), false)) {
+ if (!$io->askConfirmation(sprintf('Do you want to re-run the command %s --dev? [yes]? ', $input->getOption('dev') ? 'without' : 'with'), true)) {
+ return 0;
+ }
+
+ list($requireKey, $removeKey) = array($removeKey, $requireKey);
+ }
+ }
+ }
+
$sortPackages = $input->getOption('sort-packages') || $composer->getConfig()->get('sort-packages');
- if (!$this->updateFileCleanly($json, $requirements, $requireKey, $removeKey, $sortPackages)) {
- $composerDefinition = $json->read();
+ $this->firstRequire = $this->newlyCreated;
+ if (!$this->firstRequire) {
+ $composerDefinition = $this->json->read();
+ if (empty($composerDefinition['require']) && empty($composerDefinition['require-dev'])) {
+ $this->firstRequire = true;
+ }
+ }
+
+ if (!$input->getOption('dry-run') && !$this->updateFileCleanly($this->json, $requirements, $requireKey, $removeKey, $sortPackages)) {
+ $composerDefinition = $this->json->read();
foreach ($requirements as $package => $version) {
$composerDefinition[$requireKey][$package] = $version;
unset($composerDefinition[$removeKey][$package]);
+ if (isset($composerDefinition[$removeKey]) && count($composerDefinition[$removeKey]) === 0) {
+ unset($composerDefinition[$removeKey]);
+ }
}
- $json->write($composerDefinition);
+ $this->json->write($composerDefinition);
}
- $io->writeError(''.$file.' has been '.($newlyCreated ? 'created' : 'updated').'');
+ $io->writeError(''.$this->file.' has been '.($this->newlyCreated ? 'created' : 'updated').'');
if ($input->getOption('no-update')) {
return 0;
}
- $updateDevMode = !$input->getOption('update-no-dev');
- $optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
- $authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');
- $apcu = $input->getOption('apcu-autoloader') || $composer->getConfig()->get('apcu-autoloader');
+ try {
+ return $this->doUpdate($input, $output, $io, $requirements, $requireKey, $removeKey);
+ } catch (\Exception $e) {
+ $this->revertComposerFile(false);
+ throw $e;
+ }
+ }
+
+ private function getInconsistentRequireKeys(array $newRequirements, $requireKey)
+ {
+ $requireKeys = $this->getPackagesByRequireKey();
+ $inconsistentRequirements = array();
+ foreach ($requireKeys as $package => $packageRequireKey) {
+ if (!isset($newRequirements[$package])) {
+ continue;
+ }
+ if ($requireKey !== $packageRequireKey) {
+ $inconsistentRequirements[] = $package;
+ }
+ }
+
+ return $inconsistentRequirements;
+ }
+
+ private function getPackagesByRequireKey()
+ {
+ $composerDefinition = $this->json->read();
+ $require = array();
+ $requireDev = array();
+
+ if (isset($composerDefinition['require'])) {
+ $require = $composerDefinition['require'];
+ }
+
+ if (isset($composerDefinition['require-dev'])) {
+ $requireDev = $composerDefinition['require-dev'];
+ }
+
+ return array_merge(
+ array_fill_keys(array_keys($require), 'require'),
+ array_fill_keys(array_keys($requireDev), 'require-dev')
+ );
+ }
+
+ private function doUpdate(InputInterface $input, OutputInterface $output, IOInterface $io, array $requirements, $requireKey, $removeKey)
+ {
// Update packages
$this->resetComposer();
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
+
+ if ($input->getOption('dry-run')) {
+ $rootPackage = $composer->getPackage();
+ $links = array(
+ 'require' => $rootPackage->getRequires(),
+ 'require-dev' => $rootPackage->getDevRequires(),
+ );
+ $loader = new ArrayLoader();
+ $newLinks = $loader->parseLinks($rootPackage->getName(), $rootPackage->getPrettyVersion(), BasePackage::$supportedLinkTypes[$requireKey]['method'], $requirements);
+ $links[$requireKey] = array_merge($links[$requireKey], $newLinks);
+ foreach ($requirements as $package => $constraint) {
+ unset($links[$removeKey][$package]);
+ }
+ $rootPackage->setRequires($links['require']);
+ $rootPackage->setDevRequires($links['require-dev']);
+ }
+
+ $updateDevMode = !$input->getOption('update-no-dev');
+ $optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
+ $authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');
+ $apcuPrefix = $input->getOption('apcu-autoloader-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $composer->getConfig()->get('apcu-autoloader');
+
+ $updateAllowTransitiveDependencies = Request::UPDATE_ONLY_LISTED;
+ $flags = '';
+ if ($input->getOption('update-with-all-dependencies') || $input->getOption('with-all-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS;
+ $flags .= ' --with-all-dependencies';
+ } elseif ($input->getOption('update-with-dependencies') || $input->getOption('with-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE;
+ $flags .= ' --with-dependencies';
+ }
+
+ $io->writeError('Running composer update '.implode(' ', array_keys($requirements)).$flags.'');
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'require', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
+ $composer->getInstallationManager()->setOutputProgress(!$input->getOption('no-progress'));
+
$install = Installer::create($io, $composer);
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
+ list($preferSource, $preferDist) = $this->getPreferredInstallOptions($composer->getConfig(), $input);
+
$install
+ ->setDryRun($input->getOption('dry-run'))
->setVerbose($input->getOption('verbose'))
- ->setPreferSource($input->getOption('prefer-source'))
- ->setPreferDist($input->getOption('prefer-dist'))
+ ->setPreferSource($preferSource)
+ ->setPreferDist($preferDist)
->setDevMode($updateDevMode)
- ->setRunScripts(!$input->getOption('no-scripts'))
- ->setSkipSuggest($input->getOption('no-suggest'))
->setOptimizeAutoloader($optimize)
->setClassMapAuthoritative($authoritative)
- ->setApcuAutoloader($apcu)
+ ->setApcuAutoloader($apcu, $apcuPrefix)
->setUpdate(true)
- ->setUpdateWhitelist(array_keys($requirements))
- ->setWhitelistTransitiveDependencies($input->getOption('update-with-dependencies'))
- ->setWhitelistAllDependencies($input->getOption('update-with-all-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
+ ->setInstall(!$input->getOption('no-install'))
+ ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)
+ ->setIgnorePlatformRequirements($ignorePlatformReqs)
->setPreferStable($input->getOption('prefer-stable'))
->setPreferLowest($input->getOption('prefer-lowest'))
;
+ // if no lock is present, or the file is brand new, we do not do a
+ // partial update as this is not supported by the Installer
+ if (!$this->firstRequire && $composer->getLocker()->isLocked()) {
+ $install->setUpdateAllowList(array_keys($requirements));
+ }
+
$status = $install->run();
if ($status !== 0) {
- if ($newlyCreated) {
- $io->writeError("\n".'Installation failed, deleting '.$file.'.');
- unlink($json->getPath());
- } else {
- $io->writeError("\n".'Installation failed, reverting '.$file.' to its original content.');
- file_put_contents($json->getPath(), $composerBackup);
- }
+ $this->revertComposerFile(false);
}
return $status;
@@ -210,6 +408,8 @@ private function updateFileCleanly($json, array $new, $requireKey, $removeKey, $
}
}
+ $manipulator->removeMainKeyIfEmpty($removeKey);
+
file_put_contents($json->getPath(), $manipulator->getContents());
return true;
@@ -219,4 +419,31 @@ protected function interact(InputInterface $input, OutputInterface $output)
{
return;
}
+
+ public function revertComposerFile($hardExit = true)
+ {
+ $io = $this->getIO();
+
+ if ($this->newlyCreated) {
+ $io->writeError("\n".'Installation failed, deleting '.$this->file.'.');
+ unlink($this->json->getPath());
+ if (file_exists($this->lock)) {
+ unlink($this->lock);
+ }
+ } else {
+ $msg = ' to its ';
+ if ($this->lockBackup) {
+ $msg = ' and '.$this->lock.' to their ';
+ }
+ $io->writeError("\n".'Installation failed, reverting '.$this->file.$msg.'original content.');
+ file_put_contents($this->json->getPath(), $this->composerBackup);
+ if ($this->lockBackup) {
+ file_put_contents($this->lock, $this->lockBackup);
+ }
+ }
+
+ if ($hardExit) {
+ exit(1);
+ }
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php
index ea3b5c892..81b625786 100644
--- a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php
@@ -15,11 +15,11 @@
use Composer\Script\Event as ScriptEvent;
use Composer\Script\ScriptEvents;
use Composer\Util\ProcessExecutor;
+use Composer\Util\Platform;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Helper\Table;
/**
* @author Fabien Potencier
@@ -27,7 +27,7 @@
class RunScriptCommand extends BaseCommand
{
/**
- * @var array Array with command events
+ * @var string[] Array with command events
*/
protected $scriptEvents = array(
ScriptEvents::PRE_INSTALL_CMD,
@@ -48,6 +48,7 @@ protected function configure()
{
$this
->setName('run-script')
+ ->setAliases(array('run'))
->setDescription('Runs the scripts defined in composer.json.')
->setDefinition(array(
new InputArgument('script', InputArgument::OPTIONAL, 'Script name to run.'),
@@ -62,6 +63,8 @@ protected function configure()
The run-script command runs scripts defined in composer.json:
php composer.phar run-script post-update-cmd
+
+Read more at https://getcomposer.org/doc/03-cli.md#run-script
EOT
)
;
@@ -71,7 +74,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('list')) {
return $this->listScripts($output);
- } elseif (!$input->getArgument('script')) {
+ }
+ if (!$input->getArgument('script')) {
throw new \RuntimeException('Missing required argument "script"');
}
@@ -100,6 +104,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
ProcessExecutor::setTimeout((int) $timeout);
}
+ Platform::putEnv('COMPOSER_DEV_MODE', $devMode ? '1' : '0');
+
return $composer->getEventDispatcher()->dispatchScript($script, $devMode, $args);
}
@@ -127,12 +133,7 @@ protected function listScripts(OutputInterface $output)
$table[] = array(' '.$name, $description);
}
- $renderer = new Table($output);
- $renderer->setStyle('compact');
- $rendererStyle = $renderer->getStyle();
- $rendererStyle->setVerticalBorderChar('');
- $rendererStyle->setCellRowContentFormat('%s ');
- $renderer->setRows($table)->render();
+ $this->renderTable($table, $output);
return 0;
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php
index 1aba0b074..63f0f9e6a 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php
@@ -22,7 +22,9 @@
*/
class ScriptAliasCommand extends BaseCommand
{
+ /** @var string */
private $script;
+ /** @var string */
private $description;
public function __construct($script, $description)
@@ -48,6 +50,8 @@ protected function configure()
The run-script command runs scripts defined in composer.json:
php composer.phar run-script post-update-cmd
+
+Read more at https://getcomposer.org/doc/03-cli.md#run-script
EOT
)
;
diff --git a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php
index ed180e84c..8b51d530a 100644
--- a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php
@@ -13,6 +13,7 @@
namespace Composer\Command;
use Composer\Factory;
+use Composer\Json\JsonFile;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
@@ -28,12 +29,6 @@
*/
class SearchCommand extends BaseCommand
{
- protected $matches;
- protected $lowMatches = array();
- protected $tokens;
- protected $output;
- protected $onlyName;
-
protected function configure()
{
$this
@@ -42,6 +37,7 @@ protected function configure()
->setDefinition(array(
new InputOption('only-name', 'N', InputOption::VALUE_NONE, 'Search only in name'),
new InputOption('type', 't', InputOption::VALUE_REQUIRED, 'Search for a specific package type'),
+ new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
new InputArgument('tokens', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'tokens to search for'),
))
->setHelp(
@@ -49,6 +45,7 @@ protected function configure()
The search command searches for packages by its name
php composer.phar search symfony composer
+Read more at https://getcomposer.org/doc/03-cli.md#search
EOT
)
;
@@ -59,6 +56,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
// init repos
$platformRepo = new PlatformRepository;
$io = $this->getIO();
+
+ $format = $input->getOption('format');
+ if (!in_array($format, array('text', 'json'))) {
+ $io->writeError(sprintf('Unsupported format "%s". See help for supported formats.', $format));
+
+ return 1;
+ }
+
if (!($composer = $this->getComposer(false))) {
$composer = Factory::create($this->getIO(), array(), $input->hasParameterOption('--no-plugins'));
}
@@ -75,8 +80,27 @@ protected function execute(InputInterface $input, OutputInterface $output)
$flags = $onlyName ? RepositoryInterface::SEARCH_NAME : RepositoryInterface::SEARCH_FULLTEXT;
$results = $repos->search(implode(' ', $input->getArgument('tokens')), $flags, $type);
- foreach ($results as $result) {
- $io->write($result['name'] . (isset($result['description']) ? ' '. $result['description'] : ''));
+ if ($results && $format === 'text') {
+ $width = $this->getTerminalWidth();
+
+ $nameLength = 0;
+ foreach ($results as $result) {
+ $nameLength = max(strlen($result['name']), $nameLength);
+ }
+ $nameLength += 1;
+ foreach ($results as $result) {
+ $description = isset($result['description']) ? $result['description'] : '';
+ $remaining = $width - $nameLength - 2;
+ if (strlen($description) > $remaining) {
+ $description = substr($description, 0, $remaining - 3) . '...';
+ }
+
+ $io->write(str_pad($result['name'], $nameLength, ' ') . $description);
+ }
+ } elseif ($format === 'json') {
+ $io->write(JsonFile::encode($results));
}
+
+ return 0;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php
index 2641a922b..70e65d252 100644
--- a/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php
@@ -16,10 +16,12 @@
use Composer\Factory;
use Composer\Config;
use Composer\Util\Filesystem;
+use Composer\Util\Platform;
use Composer\SelfUpdate\Keys;
use Composer\SelfUpdate\Versions;
use Composer\IO\IOInterface;
use Composer\Downloader\FilesystemException;
+use Composer\Downloader\TransportException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
@@ -51,6 +53,8 @@ protected function configure()
new InputOption('stable', null, InputOption::VALUE_NONE, 'Force an update to the stable channel'),
new InputOption('preview', null, InputOption::VALUE_NONE, 'Force an update to the preview channel'),
new InputOption('snapshot', null, InputOption::VALUE_NONE, 'Force an update to the snapshot channel'),
+ new InputOption('1', null, InputOption::VALUE_NONE, 'Force an update to the stable channel, but only use 1.x versions'),
+ new InputOption('2', null, InputOption::VALUE_NONE, 'Force an update to the stable channel, but only use 2.x versions'),
new InputOption('set-channel-only', null, InputOption::VALUE_NONE, 'Only store the channel as the default one and then exit'),
))
->setHelp(
@@ -60,6 +64,7 @@ protected function configure()
php composer.phar self-update
+Read more at https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-
EOT
)
;
@@ -76,14 +81,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$io = $this->getIO();
- $remoteFilesystem = Factory::createRemoteFilesystem($io, $config);
+ $httpDownloader = Factory::createHttpDownloader($io, $config);
- $versionsUtil = new Versions($config, $remoteFilesystem);
+ $versionsUtil = new Versions($config, $httpDownloader);
// switch channel if requested
- foreach (array('stable', 'preview', 'snapshot') as $channel) {
+ $requestedChannel = null;
+ foreach (Versions::$channels as $channel) {
if ($input->getOption($channel)) {
+ $requestedChannel = $channel;
$versionsUtil->setChannel($channel);
+ break;
}
}
@@ -100,6 +108,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
return $this->fetchKeys($io, $config);
}
+ // ensure composer.phar location is accessible
+ if (!file_exists($localFilename)) {
+ throw new FilesystemException('Composer update failed: the "'.$localFilename.'" is not accessible');
+ }
+
// check if current dir is writable and if not try the cache dir from settings
$tmpDir = is_writable(dirname($localFilename)) ? dirname($localFilename) : $cacheDir;
@@ -112,8 +125,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (function_exists('posix_getpwuid') && function_exists('posix_geteuid')) {
$composeUser = posix_getpwuid(posix_geteuid());
$homeOwner = posix_getpwuid(fileowner($home));
- if (isset($composeUser['name']) && isset($homeOwner['name']) && $composeUser['name'] !== $homeOwner['name']) {
- $io->writeError('You are running composer as "'.$composeUser['name'].'", while "'.$home.'" is owned by "'.$homeOwner['name'].'"');
+ if (isset($composeUser['name'], $homeOwner['name']) && $composeUser['name'] !== $homeOwner['name']) {
+ $io->writeError('You are running Composer as "'.$composeUser['name'].'", while "'.$home.'" is owned by "'.$homeOwner['name'].'"');
}
}
@@ -122,8 +135,41 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$latest = $versionsUtil->getLatest();
+ $latestStable = $versionsUtil->getLatest('stable');
+ try {
+ $latestPreview = $versionsUtil->getLatest('preview');
+ } catch (\UnexpectedValueException $e) {
+ $latestPreview = $latestStable;
+ }
$latestVersion = $latest['version'];
$updateVersion = $input->getArgument('version') ?: $latestVersion;
+ $currentMajorVersion = preg_replace('{^(\d+).*}', '$1', Composer::getVersion());
+ $updateMajorVersion = preg_replace('{^(\d+).*}', '$1', $updateVersion);
+ $previewMajorVersion = preg_replace('{^(\d+).*}', '$1', $latestPreview['version']);
+
+ if ($versionsUtil->getChannel() === 'stable' && !$input->getArgument('version')) {
+ // if requesting stable channel and no specific version, avoid automatically upgrading to the next major
+ // simply output a warning that the next major stable is available and let users upgrade to it manually
+ if ($currentMajorVersion < $updateMajorVersion) {
+ $skippedVersion = $updateVersion;
+
+ $versionsUtil->setChannel($currentMajorVersion);
+
+ $latest = $versionsUtil->getLatest();
+ $latestStable = $versionsUtil->getLatest('stable');
+ $latestVersion = $latest['version'];
+ $updateVersion = $latestVersion;
+
+ $io->writeError('A new stable major version of Composer is available ('.$skippedVersion.'), run "composer self-update --'.$updateMajorVersion.'" to update to it. See also https://getcomposer.org/'.$updateMajorVersion.'');
+ } elseif ($currentMajorVersion < $previewMajorVersion) {
+ // promote next major version if available in preview
+ $io->writeError('A preview release of the next major version of Composer is available ('.$latestPreview['version'].'), run "composer self-update --preview" to give it a try. See also https://github.com/composer/composer/releases for changelogs.');
+ }
+ }
+
+ if ($requestedChannel && is_numeric($requestedChannel) && strpos($latestStable['version'], $requestedChannel) !== 0) {
+ $io->writeError('Warning: You forced the install of '.$latestVersion.' via --'.$requestedChannel.', but '.$latestStable['version'].' is the latest stable version. Updating to it via composer self-update --stable is recommended.');
+ }
if (preg_match('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) {
$io->writeError('You can not update to a specific SHA-1 as those phars are not available for download');
@@ -131,8 +177,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
+ $channelString = $versionsUtil->getChannel();
+ if (is_numeric($channelString)) {
+ $channelString .= '.x';
+ }
+
if (Composer::VERSION === $updateVersion) {
- $io->writeError(sprintf('You are already using composer version %s (%s channel).', $updateVersion, $versionsUtil->getChannel()));
+ $io->writeError(
+ sprintf(
+ 'You are already using the latest available Composer version %s (%s channel).',
+ $updateVersion,
+ $channelString
+ )
+ );
// remove all backups except for the most recent, if any
if ($input->getOption('clean-backups')) {
@@ -153,11 +210,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
$updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion);
- $io->write(sprintf("Updating to version %s (%s channel).", $updateVersion, $versionsUtil->getChannel()));
+ $io->write(sprintf("Upgrading to version %s (%s channel).", $updateVersion, $channelString));
$remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar');
- $signature = $remoteFilesystem->getContents(self::HOMEPAGE, $remoteFilename.'.sig', false);
+ try {
+ $signature = $httpDownloader->get($remoteFilename.'.sig')->getBody();
+ } catch (TransportException $e) {
+ if ($e->getStatusCode() === 404) {
+ throw new \InvalidArgumentException('Version "'.$updateVersion.'" could not be found.', 0, $e);
+ }
+ throw $e;
+ }
$io->writeError(' ', false);
- $remoteFilesystem->copy(self::HOMEPAGE, $remoteFilename, $tempFilename, !$input->getOption('no-progress'));
+ $httpDownloader->copy($remoteFilename, $tempFilename);
$io->writeError('');
if (!file_exists($tempFilename) || !$signature) {
@@ -220,13 +284,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
$pubkeyid = openssl_pkey_get_public($sigFile);
$algo = defined('OPENSSL_ALGO_SHA384') ? OPENSSL_ALGO_SHA384 : 'SHA384';
- if (!in_array('SHA384', openssl_get_md_methods())) {
+ if (!in_array('sha384', array_map('strtolower', openssl_get_md_methods()))) {
throw new \RuntimeException('SHA384 is not supported by your openssl extension, could not verify the phar file integrity');
}
$signature = json_decode($signature, true);
$signature = base64_decode($signature['sha384']);
$verified = 1 === openssl_verify(file_get_contents($tempFilename), $signature, $pubkeyid, $algo);
- openssl_free_key($pubkeyid);
+
+ // PHP 8 automatically frees the key instance and deprecates the function
+ if (PHP_VERSION_ID < 80000) {
+ openssl_free_key($pubkeyid);
+ }
+
if (!$verified) {
throw new \RuntimeException('The phar signature did not match the file you downloaded, this means your public keys are outdated or that the phar file is corrupt/has been modified');
}
@@ -237,10 +306,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->cleanBackups($rollbackDir);
}
- if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
+ if (!$this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
@unlink($tempFilename);
- $io->writeError('The file is corrupted ('.$err->getMessage().').');
- $io->writeError('Please re-run the self-update command to try again.');
return 1;
}
@@ -253,6 +320,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$io->writeError('A backup of the current version could not be written to '.$backupFile.', no rollback possible');
}
+
+ return 0;
}
protected function fetchKeys(IOInterface $io, Config $config)
@@ -312,15 +381,13 @@ protected function rollback(OutputInterface $output, $rollbackDir, $localFilenam
if (!is_file($oldFile)) {
throw new FilesystemException('Composer rollback failed: "'.$oldFile.'" could not be found');
}
- if (!is_readable($oldFile)) {
+ if (!Filesystem::isReadable($oldFile)) {
throw new FilesystemException('Composer rollback failed: "'.$oldFile.'" could not be read');
}
$io = $this->getIO();
$io->writeError(sprintf("Rolling back to version %s.", $rollbackVersion));
- if ($err = $this->setLocalPhar($localFilename, $oldFile)) {
- $io->writeError('The backup file was corrupted ('.$err->getMessage().').');
-
+ if (!$this->setLocalPhar($localFilename, $oldFile)) {
return 1;
}
@@ -328,37 +395,56 @@ protected function rollback(OutputInterface $output, $rollbackDir, $localFilenam
}
/**
- * @param string $localFilename
- * @param string $newFilename
- * @param string $backupTarget
- * @throws \Exception
- * @return \UnexpectedValueException|\PharException|null
+ * Checks if the downloaded/rollback phar is valid then moves it
+ *
+ * @param string $localFilename The composer.phar location
+ * @param string $newFilename The downloaded or backup phar
+ * @param string $backupTarget The filename to use for the backup
+ * @throws FilesystemException If the file cannot be moved
+ * @return bool Whether the phar is valid and has been moved
*/
protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)
{
- try {
- @chmod($newFilename, fileperms($localFilename));
- if (!ini_get('phar.readonly')) {
- // test the phar validity
- $phar = new \Phar($newFilename);
- // free the variable to unlock the file
- unset($phar);
- }
+ $io = $this->getIO();
+ @chmod($newFilename, fileperms($localFilename));
+
+ // check phar validity
+ if (!$this->validatePhar($newFilename, $error)) {
+ $io->writeError('The '.($backupTarget ? 'update' : 'backup').' file is corrupted ('.$error.')');
- // copy current file into installations dir
- if ($backupTarget && file_exists($localFilename)) {
- @copy($localFilename, $backupTarget);
+ if ($backupTarget) {
+ $io->writeError('Please re-run the self-update command to try again.');
}
- rename($newFilename, $localFilename);
+ return false;
+ }
+
+ // copy current file into backups dir
+ if ($backupTarget) {
+ @copy($localFilename, $backupTarget);
+ }
+
+ try {
+ if (Platform::isWindows()) {
+ // use copy to apply permissions from the destination directory
+ // as rename uses source permissions and may block other users
+ copy($newFilename, $localFilename);
+ @unlink($newFilename);
+ } else {
+ rename($newFilename, $localFilename);
+ }
- return null;
+ return true;
} catch (\Exception $e) {
- if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
- throw $e;
+ // see if we can run this operation as an Admin on Windows
+ if (!is_writable(dirname($localFilename))
+ && $io->isInteractive()
+ && $this->isWindowsNonAdminUser()) {
+ return $this->tryAsWindowsAdmin($localFilename, $newFilename);
}
- return $e;
+ $action = 'Composer '.($backupTarget ? 'update' : 'rollback');
+ throw new FilesystemException($action.' failed: "'.$localFilename.'" could not be written.'.PHP_EOL.$e->getMessage());
}
}
@@ -393,12 +479,116 @@ protected function getLastBackupVersion($rollbackDir)
protected function getOldInstallationFinder($rollbackDir)
{
- $finder = Finder::create()
+ return Finder::create()
->depth(0)
->files()
->name('*' . self::OLD_INSTALL_EXT)
->in($rollbackDir);
+ }
+
+ /**
+ * Validates the downloaded/backup phar file
+ *
+ * @param string $pharFile The downloaded or backup phar
+ * @param null|string $error Set by method on failure
+ *
+ * Code taken from getcomposer.org/installer. Any changes should be made
+ * there and replicated here
+ *
+ * @throws \Exception
+ * @return bool If the operation succeeded
+ */
+ protected function validatePhar($pharFile, &$error)
+ {
+ if (ini_get('phar.readonly')) {
+ return true;
+ }
+
+ try {
+ // Test the phar validity
+ $phar = new \Phar($pharFile);
+ // Free the variable to unlock the file
+ unset($phar);
+ $result = true;
+ } catch (\Exception $e) {
+ if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
+ throw $e;
+ }
+ $error = $e->getMessage();
+ $result = false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns true if this is a non-admin Windows user account
+ *
+ * @return bool
+ */
+ protected function isWindowsNonAdminUser()
+ {
+ if (!Platform::isWindows()) {
+ return false;
+ }
+
+ // fltmc.exe manages filter drivers and errors without admin privileges
+ exec('fltmc.exe filters', $output, $exitCode);
+
+ return $exitCode !== 0;
+ }
+
+ /**
+ * Invokes a UAC prompt to update composer.phar as an admin
+ *
+ * Uses a .vbs script to elevate and run the cmd.exe copy command.
+ *
+ * @param string $localFilename The composer.phar location
+ * @param string $newFilename The downloaded or backup phar
+ * @return bool Whether composer.phar has been updated
+ */
+ protected function tryAsWindowsAdmin($localFilename, $newFilename)
+ {
+ $io = $this->getIO();
+
+ $io->writeError('Unable to write "'.$localFilename.'". Access is denied.');
+ $helpMessage = 'Please run the self-update command as an Administrator.';
+ $question = 'Complete this operation with Administrator privileges [Y,n]? ';
+
+ if (!$io->askConfirmation($question, false)) {
+ $io->writeError('Operation cancelled. '.$helpMessage.'');
+
+ return false;
+ }
+
+ $tmpFile = tempnam(sys_get_temp_dir(), '');
+ $script = $tmpFile.'.vbs';
+ rename($tmpFile, $script);
+
+ $checksum = hash_file('sha256', $newFilename);
+
+ // cmd's internal copy is fussy about backslashes
+ $source = str_replace('/', '\\', $newFilename);
+ $destination = str_replace('/', '\\', $localFilename);
+
+ $vbs = <<writeError('Operation succeeded.');
+ @unlink($newFilename);
+ } else {
+ $io->writeError('Operation failed.'.$helpMessage.'');
+ }
- return $finder;
+ return $result;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php
index ccea6a960..057edc40e 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php
@@ -14,31 +14,33 @@
use Composer\Composer;
use Composer\DependencyResolver\DefaultPolicy;
-use Composer\DependencyResolver\Pool;
use Composer\Json\JsonFile;
use Composer\Package\BasePackage;
use Composer\Package\CompletePackageInterface;
+use Composer\Package\Link;
+use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser;
use Composer\Package\Version\VersionSelector;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
-use Composer\Repository\ArrayRepository;
+use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\ComposerRepository;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
+use Composer\Repository\InstalledRepository;
use Composer\Repository\RepositoryInterface;
+use Composer\Repository\RepositorySet;
+use Composer\Repository\RootPackageRepository;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Semver;
use Composer\Spdx\SpdxLicenses;
-use Composer\Util\Platform;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Terminal;
/**
* @author Robert Schönthal
@@ -50,10 +52,11 @@ class ShowCommand extends BaseCommand
{
/** @var VersionParser */
protected $versionParser;
+ /** @var string[] */
protected $colors;
- /** @var Pool */
- private $pool;
+ /** @var ?RepositorySet */
+ private $repositorySet;
protected function configure()
{
@@ -65,6 +68,7 @@ protected function configure()
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead.'),
new InputArgument('version', InputArgument::OPTIONAL, 'Version or version constraint to inspect'),
new InputOption('all', null, InputOption::VALUE_NONE, 'List all packages'),
+ new InputOption('locked', null, InputOption::VALUE_NONE, 'List all locked packages'),
new InputOption('installed', 'i', InputOption::VALUE_NONE, 'List installed packages only (enabled by default, only present for BC).'),
new InputOption('platform', 'p', InputOption::VALUE_NONE, 'List platform packages only'),
new InputOption('available', 'a', InputOption::VALUE_NONE, 'List available packages only'),
@@ -74,16 +78,19 @@ protected function configure()
new InputOption('tree', 't', InputOption::VALUE_NONE, 'List the dependencies as a tree'),
new InputOption('latest', 'l', InputOption::VALUE_NONE, 'Show the latest version'),
new InputOption('outdated', 'o', InputOption::VALUE_NONE, 'Show the latest version but only for packages that are outdated'),
+ new InputOption('ignore', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore specified package(s). Use it with the --outdated option if you don\'t want to be informed about new versions of some packages.'),
new InputOption('minor-only', 'm', InputOption::VALUE_NONE, 'Show only packages that have minor SemVer-compatible updates. Use with the --outdated option.'),
new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'),
new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code when there are outdated packages'),
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
+ new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'),
))
->setHelp(
<<getOption('outdated')) {
$input->setOption('latest', true);
+ } elseif ($input->getOption('ignore')) {
+ $io->writeError('You are using the option "ignore" for action other than "outdated", it will be ignored.');
}
if ($input->getOption('direct') && ($input->getOption('all') || $input->getOption('available') || $input->getOption('platform'))) {
@@ -125,6 +134,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
+ if ($input->getOption('tree') && $input->getOption('path')) {
+ $io->writeError('The --tree (-t) option is not usable in combination with --path (-P)');
+
+ return 1;
+ }
+
$format = $input->getOption('format');
if (!in_array($format, array('text', 'json'))) {
$io->writeError(sprintf('Unsupported format "%s". See help for supported formats.', $format));
@@ -138,17 +153,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
}
$platformRepo = new PlatformRepository(array(), $platformOverrides);
- $phpVersion = $platformRepo->findPackage('php', '*')->getVersion();
+ $lockedRepo = null;
if ($input->getOption('self')) {
$package = $this->getComposer()->getPackage();
- $repos = $installedRepo = new ArrayRepository(array($package));
+ if ($input->getOption('name-only')) {
+ $io->write($package->getName());
+
+ return 0;
+ }
+ $repos = $installedRepo = new InstalledRepository(array(new RootPackageRepository($package)));
} elseif ($input->getOption('platform')) {
- $repos = $installedRepo = $platformRepo;
+ $repos = $installedRepo = new InstalledRepository(array($platformRepo));
} elseif ($input->getOption('available')) {
- $installedRepo = $platformRepo;
+ $installedRepo = new InstalledRepository(array($platformRepo));
if ($composer) {
$repos = new CompositeRepository($composer->getRepositoryManager()->getRepositories());
+ $installedRepo->addRepository($composer->getRepositoryManager()->getLocalRepository());
} else {
$defaultRepos = RepositoryFactory::defaultRepos($io);
$repos = new CompositeRepository($defaultRepos);
@@ -156,16 +177,41 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
} elseif ($input->getOption('all') && $composer) {
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
- $installedRepo = new CompositeRepository(array($localRepo, $platformRepo));
+ $locker = $composer->getLocker();
+ if ($locker->isLocked()) {
+ $lockedRepo = $locker->getLockedRepository(true);
+ $installedRepo = new InstalledRepository(array($lockedRepo, $localRepo, $platformRepo));
+ } else {
+ $installedRepo = new InstalledRepository(array($localRepo, $platformRepo));
+ }
$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
} elseif ($input->getOption('all')) {
$defaultRepos = RepositoryFactory::defaultRepos($io);
$io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
- $installedRepo = $platformRepo;
+ $installedRepo = new InstalledRepository(array($platformRepo));
$repos = new CompositeRepository(array_merge(array($installedRepo), $defaultRepos));
+ } elseif ($input->getOption('locked')) {
+ if (!$composer || !$composer->getLocker()->isLocked()) {
+ throw new \UnexpectedValueException('A valid composer.json and composer.lock files is required to run this command with --locked');
+ }
+ $locker = $composer->getLocker();
+ $lockedRepo = $locker->getLockedRepository(!$input->getOption('no-dev'));
+ $repos = $installedRepo = new InstalledRepository(array($lockedRepo));
} else {
- $repos = $installedRepo = $this->getComposer()->getRepositoryManager()->getLocalRepository();
- $rootPkg = $this->getComposer()->getPackage();
+ // --installed / default case
+ if (!$composer) {
+ $composer = $this->getComposer();
+ }
+ $rootPkg = $composer->getPackage();
+ $repos = $installedRepo = new InstalledRepository(array($composer->getRepositoryManager()->getLocalRepository()));
+
+ if ($input->getOption('no-dev')) {
+ $packages = $this->filterRequiredPackages($installedRepo, $rootPkg);
+ $repos = $installedRepo = new InstalledRepository(array(new InstalledArrayRepository(array_map(function ($pkg) {
+ return clone $pkg;
+ }, $packages))));
+ }
+
if (!$installedRepo->getPackages() && ($rootPkg->getRequires() || $rootPkg->getDevRequires())) {
$io->writeError('No dependencies installed. Try running composer install or update.');
}
@@ -191,6 +237,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (empty($package)) {
$options = $input->getOptions();
if (!isset($options['working-dir']) || !file_exists('composer.json')) {
+ if (PlatformRepository::isPlatformPackage($input->getArgument('package')) && !$input->getOption('platform')) {
+ throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found, try using --platform (-p) to show platform packages.');
+ }
throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found');
}
@@ -214,23 +263,29 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$latestPackage = null;
if ($input->getOption('latest')) {
- $latestPackage = $this->findLatestPackage($package, $composer, $phpVersion);
+ $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $input->getOption('minor-only'));
}
- if ($input->getOption('outdated') && $input->getOption('strict') && $latestPackage && $latestPackage->getFullPrettyVersion() !== $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) {
+ if (
+ $input->getOption('outdated')
+ && $input->getOption('strict')
+ && $latestPackage
+ && $latestPackage->getFullPrettyVersion() !== $package->getFullPrettyVersion()
+ && (!$latestPackage instanceof CompletePackageInterface || !$latestPackage->isAbandoned())
+ ) {
$exitCode = 1;
}
- $this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null);
- $this->printLinks($package, 'requires');
- $this->printLinks($package, 'devRequires', 'requires (dev)');
- if ($package->getSuggests()) {
- $io->write("\nsuggests");
- foreach ($package->getSuggests() as $suggested => $reason) {
- $io->write($suggested . ' ' . $reason . '');
- }
+ if ($input->getOption('path')) {
+ $io->write($package->getName(), false);
+ $io->write(' ' . strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n"));
+
+ return $exitCode;
+ }
+
+ if ('json' === $format) {
+ $this->printPackageInfoAsJson($package, $versions, $installedRepo, $latestPackage ?: null);
+ } else {
+ $this->printPackageInfo($package, $versions, $installedRepo, $latestPackage ?: null);
}
- $this->printLinks($package, 'provides');
- $this->printLinks($package, 'conflicts');
- $this->printLinks($package, 'replaces');
}
return $exitCode;
@@ -257,16 +312,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 0;
}
- if ($repos instanceof CompositeRepository) {
- $repos = $repos->getRepositories();
- } elseif (!is_array($repos)) {
- $repos = array($repos);
- }
-
// list packages
$packages = array();
+ $packageFilterRegex = null;
if (null !== $packageFilter) {
- $packageFilter = '{^'.str_replace('\\*', '.*?', preg_quote($packageFilter)).'$}i';
+ $packageFilterRegex = '{^'.str_replace('\\*', '.*?', preg_quote($packageFilter)).'$}i';
}
$packageListFilter = array();
@@ -274,45 +324,24 @@ protected function execute(InputInterface $input, OutputInterface $output)
$packageListFilter = $this->getRootRequires();
}
- if (class_exists('Symfony\Component\Console\Terminal')) {
- $terminal = new Terminal();
- $width = $terminal->getWidth();
- } else {
- // For versions of Symfony console before 3.2
- list($width) = $this->getApplication()->getTerminalDimensions();
- }
- if (null === $width) {
- // In case the width is not detected, we're probably running the command
- // outside of a real terminal, use space without a limit
- $width = PHP_INT_MAX;
- }
- if (Platform::isWindows()) {
- $width--;
- } else {
- $width = max(80, $width);
- }
-
if ($input->getOption('path') && null === $composer) {
$io->writeError('No composer.json found in the current directory, disabling "path" option');
$input->setOption('path', false);
}
- foreach ($repos as $repo) {
+ foreach ($repos->getRepositories() as $repo) {
if ($repo === $platformRepo) {
$type = 'platform';
- } elseif (
- $repo === $installedRepo
- || ($installedRepo instanceof CompositeRepository && in_array($repo, $installedRepo->getRepositories(), true))
- ) {
+ } elseif ($lockedRepo !== null && $repo === $lockedRepo) {
+ $type = 'locked';
+ } elseif ($repo === $installedRepo || in_array($repo, $installedRepo->getRepositories(), true)) {
$type = 'installed';
} else {
$type = 'available';
}
- if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
- foreach ($repo->getProviderNames() as $name) {
- if (!$packageFilter || preg_match($packageFilter, $name)) {
- $packages[$type][$name] = $name;
- }
+ if ($repo instanceof ComposerRepository) {
+ foreach ($repo->getPackageNames($packageFilter) as $name) {
+ $packages[$type][$name] = $name;
}
} else {
foreach ($repo->getPackages() as $package) {
@@ -320,7 +349,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
|| !is_object($packages[$type][$package->getName()])
|| version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<')
) {
- if (!$packageFilter || preg_match($packageFilter, $package->getName())) {
+ while ($package instanceof AliasPackage) {
+ $package = $package->getAliasOf();
+ }
+ if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) {
if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) {
$packages[$type][$package->getName()] = $package;
}
@@ -333,12 +365,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
$showAllTypes = $input->getOption('all');
$showLatest = $input->getOption('latest');
$showMinorOnly = $input->getOption('minor-only');
+ $ignoredPackages = array_map('strtolower', $input->getOption('ignore'));
$indent = $showAllTypes ? ' ' : '';
+ /** @var PackageInterface[] $latestPackages */
$latestPackages = array();
$exitCode = 0;
$viewData = array();
$viewMetaData = array();
- foreach (array('platform' => true, 'available' => false, 'installed' => true) as $type => $showVersion) {
+ foreach (array('platform' => true, 'locked' => true, 'available' => false, 'installed' => true) as $type => $showVersion) {
if (isset($packages[$type])) {
ksort($packages[$type]);
@@ -347,7 +381,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($showLatest && $showVersion) {
foreach ($packages[$type] as $package) {
if (is_object($package)) {
- $latestPackage = $this->findLatestPackage($package, $composer, $phpVersion, $showMinorOnly);
+ $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $showMinorOnly);
if ($latestPackage === false) {
continue;
}
@@ -372,9 +406,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($showLatest && isset($latestPackages[$package->getPrettyName()])) {
$latestPackage = $latestPackages[$package->getPrettyName()];
}
- if ($input->getOption('outdated') && $latestPackage && $latestPackage->getFullPrettyVersion() === $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) {
+
+ // Determine if Composer is checking outdated dependencies and if current package should trigger non-default exit code
+ $packageIsUpToDate = $latestPackage && $latestPackage->getFullPrettyVersion() === $package->getFullPrettyVersion() && (!$latestPackage instanceof CompletePackageInterface || !$latestPackage->isAbandoned());
+ $packageIsIgnored = \in_array($package->getPrettyName(), $ignoredPackages, true);
+ if ($input->getOption('outdated') && ($packageIsUpToDate || $packageIsIgnored)) {
continue;
- } elseif ($input->getOption('outdated') || $input->getOption('strict')) {
+ }
+
+ if ($input->getOption('outdated') || $input->getOption('strict')) {
$hasOutdatedPackages = true;
}
@@ -396,7 +436,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$packageViewData['path'] = strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n");
}
- if ($latestPackage && $latestPackage->isAbandoned()) {
+ if ($latestPackage instanceof CompletePackageInterface && $latestPackage->isAbandoned()) {
$replacement = is_string($latestPackage->getReplacementPackage())
? 'Use ' . $latestPackage->getReplacementPackage() . ' instead'
: 'No replacement was suggested';
@@ -428,6 +468,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ('json' === $format) {
$io->write(JsonFile::encode($viewData));
} else {
+ if ($input->getOption('latest') && array_filter($viewData)) {
+ if (!$io->isDecorated()) {
+ $io->writeError('Legend:');
+ $io->writeError('! patch or minor release available - update recommended');
+ $io->writeError('~ major release available - update possible');
+ if (!$input->getOption('outdated')) {
+ $io->writeError('= up to date version');
+ }
+ } else {
+ $io->writeError('Color legend:');
+ $io->writeError('- patch or minor release available - update recommended');
+ $io->writeError('- major release available - update possible');
+ if (!$input->getOption('outdated')) {
+ $io->writeError('- up to date version');
+ }
+ }
+ }
+
+ $width = $this->getTerminalWidth();
+
foreach ($viewData as $type => $packages) {
$nameLength = $viewMetaData[$type]['nameLength'];
$versionLength = $viewMetaData[$type]['versionLength'];
@@ -479,7 +539,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$io->write('');
if (isset($package['warning'])) {
- $io->writeError('' . $package['warning'] . '');
+ $io->write('' . $package['warning'] . '');
}
}
@@ -510,32 +570,32 @@ protected function getVersionStyle(PackageInterface $latestPackage, PackageInter
/**
* finds a package by name and version if provided
*
- * @param RepositoryInterface $installedRepo
+ * @param InstalledRepository $installedRepo
* @param RepositoryInterface $repos
* @param string $name
* @param ConstraintInterface|string $version
* @throws \InvalidArgumentException
* @return array array(CompletePackageInterface, array of versions)
*/
- protected function getPackage(RepositoryInterface $installedRepo, RepositoryInterface $repos, $name, $version = null)
+ protected function getPackage(InstalledRepository $installedRepo, RepositoryInterface $repos, $name, $version = null)
{
$name = strtolower($name);
$constraint = is_string($version) ? $this->versionParser->parseConstraints($version) : $version;
$policy = new DefaultPolicy();
- $pool = new Pool('dev');
- $pool->addRepository($repos);
+ $repositorySet = new RepositorySet('dev');
+ $repositorySet->allowInstalledRepositories();
+ $repositorySet->addRepository($repos);
$matchedPackage = null;
$versions = array();
+ if (PlatformRepository::isPlatformPackage($name)) {
+ $pool = $repositorySet->createPoolWithAllPackages();
+ } else {
+ $pool = $repositorySet->createPoolForPackage($name);
+ }
$matches = $pool->whatProvides($name, $constraint);
foreach ($matches as $index => $package) {
- // skip providers/replacers
- if ($package->getName() !== $name) {
- unset($matches[$index]);
- continue;
- }
-
// select an exact match if it is in the installed repo and no specific version was required
if (null === $version && $installedRepo->hasPackage($package)) {
$matchedPackage = $package;
@@ -546,21 +606,50 @@ protected function getPackage(RepositoryInterface $installedRepo, RepositoryInte
}
// select preferred package according to policy rules
- if (!$matchedPackage && $matches && $preferred = $policy->selectPreferredPackages($pool, array(), $matches)) {
+ if (!$matchedPackage && $matches && $preferred = $policy->selectPreferredPackages($pool, $matches)) {
$matchedPackage = $pool->literalToPackage($preferred[0]);
}
return array($matchedPackage, $versions);
}
+ /**
+ * Prints package info.
+ *
+ * @param CompletePackageInterface $package
+ * @param array $versions
+ * @param InstalledRepository $installedRepo
+ * @param PackageInterface|null $latestPackage
+ */
+ protected function printPackageInfo(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null)
+ {
+ $io = $this->getIO();
+
+ $this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null);
+ $this->printLinks($package, Link::TYPE_REQUIRE);
+ $this->printLinks($package, Link::TYPE_DEV_REQUIRE, 'requires (dev)');
+
+ if ($package->getSuggests()) {
+ $io->write("\nsuggests");
+ foreach ($package->getSuggests() as $suggested => $reason) {
+ $io->write($suggested . ' ' . $reason . '');
+ }
+ }
+
+ $this->printLinks($package, Link::TYPE_PROVIDE);
+ $this->printLinks($package, Link::TYPE_CONFLICT);
+ $this->printLinks($package, Link::TYPE_REPLACE);
+ }
+
/**
* Prints package metadata.
*
* @param CompletePackageInterface $package
* @param array $versions
- * @param RepositoryInterface $installedRepo
+ * @param InstalledRepository $installedRepo
+ * @param PackageInterface|null $latestPackage
*/
- protected function printMeta(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo, PackageInterface $latestPackage = null)
+ protected function printMeta(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null)
{
$io = $this->getIO();
$io->write('name : ' . $package->getPrettyName());
@@ -575,11 +664,15 @@ protected function printMeta(CompletePackageInterface $package, array $versions,
}
$io->write('type : ' . $package->getType());
$this->printLicenses($package);
+ $io->write('homepage : ' . $package->getHomepage());
$io->write('source : ' . sprintf('[%s] %s %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference()));
$io->write('dist : ' . sprintf('[%s] %s %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
+ if ($installedRepo->hasPackage($package)) {
+ $io->write('path : ' . sprintf('%s', realpath($this->getComposer()->getInstallationManager()->getInstallPath($package))));
+ }
$io->write('names : ' . implode(', ', $package->getNames()));
- if ($latestPackage->isAbandoned()) {
+ if ($latestPackage instanceof CompletePackageInterface && $latestPackage->isAbandoned()) {
$replacement = ($latestPackage->getReplacementPackage() !== null)
? ' The author suggests using the ' . $latestPackage->getReplacementPackage(). ' package instead.'
: null;
@@ -601,11 +694,7 @@ protected function printMeta(CompletePackageInterface $package, array $versions,
foreach ($package->getAutoload() as $type => $autoloads) {
$io->write('' . $type . '');
- if ($type === 'psr-0') {
- foreach ($autoloads as $name => $path) {
- $io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
- }
- } elseif ($type === 'psr-4') {
+ if ($type === 'psr-0' || $type === 'psr-4') {
foreach ($autoloads as $name => $path) {
$io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
}
@@ -625,19 +714,21 @@ protected function printMeta(CompletePackageInterface $package, array $versions,
*
* @param CompletePackageInterface $package
* @param array $versions
- * @param RepositoryInterface $installedRepo
+ * @param InstalledRepository $installedRepo
*/
- protected function printVersions(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo)
+ protected function printVersions(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo)
{
- uasort($versions, 'version_compare');
- $versions = array_keys(array_reverse($versions));
+ $versions = array_keys($versions);
+ $versions = Semver::rsort($versions);
// highlight installed version
- if ($installedRepo->hasPackage($package)) {
- $installedVersion = $package->getPrettyVersion();
- $key = array_search($installedVersion, $versions);
- if (false !== $key) {
- $versions[$key] = '* ' . $installedVersion . '';
+ if ($installedPackages = $installedRepo->findPackages($package->getName())) {
+ foreach ($installedPackages as $installedPackage) {
+ $installedVersion = $installedPackage->getPrettyVersion();
+ $key = array_search($installedVersion, $versions);
+ if (false !== $key) {
+ $versions[$key] = '* ' . $installedVersion . '';
+ }
}
}
@@ -696,6 +787,165 @@ protected function printLicenses(CompletePackageInterface $package)
}
}
+ /**
+ * Prints package info in JSON format.
+ *
+ * @param CompletePackageInterface $package
+ * @param array $versions
+ * @param InstalledRepository $installedRepo
+ * @param PackageInterface|null $latestPackage
+ */
+ protected function printPackageInfoAsJson(CompletePackageInterface $package, array $versions, InstalledRepository $installedRepo, PackageInterface $latestPackage = null)
+ {
+ $json = array(
+ 'name' => $package->getPrettyName(),
+ 'description' => $package->getDescription(),
+ 'keywords' => $package->getKeywords() ?: array(),
+ 'type' => $package->getType(),
+ 'homepage' => $package->getHomepage(),
+ 'names' => $package->getNames(),
+ );
+
+ $json = $this->appendVersions($json, $versions);
+ $json = $this->appendLicenses($json, $package);
+
+ if ($latestPackage) {
+ $json['latest'] = $latestPackage->getPrettyVersion();
+ } else {
+ $latestPackage = $package;
+ }
+
+ if ($package->getSourceType()) {
+ $json['source'] = array(
+ 'type' => $package->getSourceType(),
+ 'url' => $package->getSourceUrl(),
+ 'reference' => $package->getSourceReference(),
+ );
+ }
+
+ if ($package->getDistType()) {
+ $json['dist'] = array(
+ 'type' => $package->getDistType(),
+ 'url' => $package->getDistUrl(),
+ 'reference' => $package->getDistReference(),
+ );
+ }
+
+ if ($installedRepo->hasPackage($package)) {
+ $json['path'] = realpath($this->getComposer()->getInstallationManager()->getInstallPath($package));
+ if ($json['path'] === false) {
+ unset($json['path']);
+ }
+ }
+
+ if ($latestPackage instanceof CompletePackageInterface && $latestPackage->isAbandoned()) {
+ $json['replacement'] = $latestPackage->getReplacementPackage();
+ }
+
+ if ($package->getSuggests()) {
+ $json['suggests'] = $package->getSuggests();
+ }
+
+ if ($package->getSupport()) {
+ $json['support'] = $package->getSupport();
+ }
+
+ $json = $this->appendAutoload($json, $package);
+
+ if ($package->getIncludePaths()) {
+ $json['include_path'] = $package->getIncludePaths();
+ }
+
+ $json = $this->appendLinks($json, $package);
+
+ $this->getIO()->write(JsonFile::encode($json));
+ }
+
+ private function appendVersions($json, array $versions)
+ {
+ uasort($versions, 'version_compare');
+ $versions = array_keys(array_reverse($versions));
+ $json['versions'] = $versions;
+
+ return $json;
+ }
+
+ private function appendLicenses($json, CompletePackageInterface $package)
+ {
+ if ($licenses = $package->getLicense()) {
+ $spdxLicenses = new SpdxLicenses();
+
+ $json['licenses'] = array_map(function ($licenseId) use ($spdxLicenses) {
+ $license = $spdxLicenses->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url
+
+ if (!$license) {
+ return $licenseId;
+ }
+
+ return array(
+ 'name' => $license[0],
+ 'osi' => $licenseId,
+ 'url' => $license[2],
+ );
+ }, $licenses);
+ }
+
+ return $json;
+ }
+
+ private function appendAutoload($json, CompletePackageInterface $package)
+ {
+ if ($package->getAutoload()) {
+ $autoload = array();
+
+ foreach ($package->getAutoload() as $type => $autoloads) {
+ if ($type === 'psr-0' || $type === 'psr-4') {
+ $psr = array();
+
+ foreach ($autoloads as $name => $path) {
+ if (!$path) {
+ $path = '.';
+ }
+
+ $psr[$name ?: '*'] = $path;
+ }
+
+ $autoload[$type] = $psr;
+ } elseif ($type === 'classmap') {
+ $autoload['classmap'] = $autoloads;
+ }
+ }
+
+ $json['autoload'] = $autoload;
+ }
+
+ return $json;
+ }
+
+ private function appendLinks($json, CompletePackageInterface $package)
+ {
+ foreach (Link::$TYPES as $linkType) {
+ $json = $this->appendLink($json, $package, $linkType);
+ }
+
+ return $json;
+ }
+
+ private function appendLink($json, CompletePackageInterface $package, $linkType)
+ {
+ $links = $package->{'get' . ucfirst($linkType)}();
+
+ if ($links) {
+ $json[$linkType] = array();
+
+ foreach ($links as $link) {
+ $json[$linkType][$link->getTarget()] = $link->getPrettyConstraint();
+ }
+ }
+
+ return $json;
+ }
+
/**
* Init styles for tree
*
@@ -720,7 +970,7 @@ protected function initStyles(OutputInterface $output)
/**
* Display the tree
*
- * @param $arrayTree
+ * @param array $arrayTree
*/
protected function displayPackageTree(array $arrayTree)
{
@@ -765,57 +1015,55 @@ protected function displayPackageTree(array $arrayTree)
/**
* Generate the package tree
*
- * @param PackageInterface|string $package
- * @param RepositoryInterface $installedRepo
- * @param RepositoryInterface $distantRepos
+ * @param PackageInterface $package
+ * @param InstalledRepository $installedRepo
+ * @param RepositoryInterface $remoteRepos
* @return array
*/
protected function generatePackageTree(
PackageInterface $package,
- RepositoryInterface $installedRepo,
- RepositoryInterface $distantRepos
+ InstalledRepository $installedRepo,
+ RepositoryInterface $remoteRepos
) {
- if (is_object($package)) {
- $requires = $package->getRequires();
- ksort($requires);
- $children = array();
- foreach ($requires as $requireName => $require) {
- $packagesInTree = array($package->getName(), $requireName);
-
- $treeChildDesc = array(
- 'name' => $requireName,
- 'version' => $require->getPrettyConstraint(),
- );
+ $requires = $package->getRequires();
+ ksort($requires);
+ $children = array();
+ foreach ($requires as $requireName => $require) {
+ $packagesInTree = array($package->getName(), $requireName);
- $deepChildren = $this->addTree($requireName, $require, $installedRepo, $distantRepos, $packagesInTree);
+ $treeChildDesc = array(
+ 'name' => $requireName,
+ 'version' => $require->getPrettyConstraint(),
+ );
- if ($deepChildren) {
- $treeChildDesc['requires'] = $deepChildren;
- }
+ $deepChildren = $this->addTree($requireName, $require, $installedRepo, $remoteRepos, $packagesInTree);
- $children[] = $treeChildDesc;
+ if ($deepChildren) {
+ $treeChildDesc['requires'] = $deepChildren;
}
- $tree = array(
- 'name' => $package->getPrettyName(),
- 'version' => $package->getPrettyVersion(),
- 'description' => $package->getDescription(),
- );
- if ($children) {
- $tree['requires'] = $children;
- }
+ $children[] = $treeChildDesc;
+ }
+ $tree = array(
+ 'name' => $package->getPrettyName(),
+ 'version' => $package->getPrettyVersion(),
+ 'description' => $package instanceof CompletePackageInterface ? $package->getDescription() : '',
+ );
- return $tree;
+ if ($children) {
+ $tree['requires'] = $children;
}
+
+ return $tree;
}
/**
* Display a package tree
*
- * @param PackageInterface|string $package
- * @param array $packagesInTree
- * @param string $previousTreeBar
- * @param int $level
+ * @param array|string $package
+ * @param array $packagesInTree
+ * @param string $previousTreeBar
+ * @param int $level
*/
protected function displayTree(
$package,
@@ -824,7 +1072,7 @@ protected function displayTree(
$level = 1
) {
$previousTreeBar = str_replace('├', '│', $previousTreeBar);
- if (isset($package['requires'])) {
+ if (is_array($package) && isset($package['requires'])) {
$requires = $package['requires'];
$treeBar = $previousTreeBar . ' ├';
$i = 0;
@@ -865,26 +1113,26 @@ protected function displayTree(
/**
* Display a package tree
*
- * @param string $name
- * @param PackageInterface|string $package
- * @param RepositoryInterface $installedRepo
- * @param RepositoryInterface $distantRepos
- * @param array $packagesInTree
+ * @param string $name
+ * @param Link $link
+ * @param InstalledRepository $installedRepo
+ * @param RepositoryInterface $remoteRepos
+ * @param array $packagesInTree
* @return array
*/
protected function addTree(
$name,
- $package,
- RepositoryInterface $installedRepo,
- RepositoryInterface $distantRepos,
+ Link $link,
+ InstalledRepository $installedRepo,
+ RepositoryInterface $remoteRepos,
array $packagesInTree
) {
$children = array();
- list($package, $versions) = $this->getPackage(
+ list($package) = $this->getPackage(
$installedRepo,
- $distantRepos,
+ $remoteRepos,
$name,
- $package->getPrettyConstraint() === 'self.version' ? $package->getConstraint() : $package->getPrettyConstraint()
+ $link->getPrettyConstraint() === 'self.version' ? $link->getConstraint() : $link->getPrettyConstraint()
);
if (is_object($package)) {
$requires = $package->getRequires();
@@ -899,7 +1147,7 @@ protected function addTree(
if (!in_array($requireName, $currentTree, true)) {
$currentTree[] = $requireName;
- $deepChildren = $this->addTree($requireName, $require, $installedRepo, $distantRepos, $currentTree);
+ $deepChildren = $this->addTree($requireName, $require, $installedRepo, $remoteRepos, $currentTree);
if ($deepChildren) {
$treeChildDesc['requires'] = $deepChildren;
}
@@ -952,18 +1200,18 @@ private function writeTreeLine($line)
/**
* Given a package, this finds the latest package matching it
*
- * @param PackageInterface $package
- * @param Composer $composer
- * @param string $phpVersion
- * @param bool $minorOnly
+ * @param PackageInterface $package
+ * @param Composer $composer
+ * @param PlatformRepository $platformRepo
+ * @param bool $minorOnly
*
- * @return PackageInterface|null
+ * @return PackageInterface|false
*/
- private function findLatestPackage(PackageInterface $package, Composer $composer, $phpVersion, $minorOnly = false)
+ private function findLatestPackage(PackageInterface $package, Composer $composer, PlatformRepository $platformRepo, $minorOnly = false)
{
- // find the latest version allowed in this pool
+ // find the latest version allowed in this repo set
$name = $package->getName();
- $versionSelector = new VersionSelector($this->getPool($composer));
+ $versionSelector = new VersionSelector($this->getRepositorySet($composer), $platformRepo);
$stability = $composer->getPackage()->getMinimumStability();
$flags = $composer->getPackage()->getStabilityFlags();
if (isset($flags[$name])) {
@@ -984,16 +1232,51 @@ private function findLatestPackage(PackageInterface $package, Composer $composer
$targetVersion = '^' . $package->getVersion();
}
- return $versionSelector->findBestCandidate($name, $targetVersion, $phpVersion, $bestStability);
+ $candidate = $versionSelector->findBestCandidate($name, $targetVersion, $bestStability);
+ while ($candidate instanceof AliasPackage) {
+ $candidate = $candidate->getAliasOf();
+ }
+
+ return $candidate;
}
- private function getPool(Composer $composer)
+ /**
+ * @return RepositorySet
+ */
+ private function getRepositorySet(Composer $composer)
{
- if (!$this->pool) {
- $this->pool = new Pool($composer->getPackage()->getMinimumStability(), $composer->getPackage()->getStabilityFlags());
- $this->pool->addRepository(new CompositeRepository($composer->getRepositoryManager()->getRepositories()));
+ if (!$this->repositorySet) {
+ $this->repositorySet = new RepositorySet($composer->getPackage()->getMinimumStability(), $composer->getPackage()->getStabilityFlags());
+ $this->repositorySet->addRepository(new CompositeRepository($composer->getRepositoryManager()->getRepositories()));
+ }
+
+ return $this->repositorySet;
+ }
+
+ /**
+ * Find package requires and child requires
+ *
+ * @param RepositoryInterface $repo
+ * @param PackageInterface $package
+ * @param array $bucket
+ * @return array
+ */
+ private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array())
+ {
+ $requires = $package->getRequires();
+
+ foreach ($repo->getPackages() as $candidate) {
+ foreach ($candidate->getNames() as $name) {
+ if (isset($requires[$name])) {
+ if (!in_array($candidate, $bucket, true)) {
+ $bucket[] = $candidate;
+ $bucket = $this->filterRequiredPackages($repo, $candidate, $bucket);
+ }
+ break;
+ }
+ }
}
- return $this->pool;
+ return $bucket;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php
index 3e46b7fa0..ede91ac13 100644
--- a/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/StatusCommand.php
@@ -43,7 +43,7 @@ protected function configure()
{
$this
->setName('status')
- ->setDescription('Shows a list of locally modified packages, for packages installed from source.')
+ ->setDescription('Shows a list of locally modified packages.')
->setDefinition(array(
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Show modified files for each directory that contains changes.'),
))
@@ -52,6 +52,7 @@ protected function configure()
The status command displays a list of dependencies that have
been modified locally.
+Read more at https://getcomposer.org/doc/03-cli.md#status
EOT
)
;
@@ -60,24 +61,40 @@ protected function configure()
/**
* @param InputInterface $input
* @param OutputInterface $output
- * @return int|null
+ * @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- // init repos
$composer = $this->getComposer();
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'status', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
+ // Dispatch pre-status-command
+ $composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_STATUS_CMD, true);
+
+ $exitCode = $this->doExecute($input);
+
+ // Dispatch post-status-command
+ $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_STATUS_CMD, true);
+
+ return $exitCode;
+ }
+
+ /**
+ * @param InputInterface $input
+ * @return int
+ */
+ private function doExecute(InputInterface $input)
+ {
+ // init repos
+ $composer = $this->getComposer();
+
$installedRepo = $composer->getRepositoryManager()->getLocalRepository();
$dm = $composer->getDownloadManager();
$im = $composer->getInstallationManager();
- // Dispatch pre-status-command
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_STATUS_CMD, true);
-
$errors = array();
$io = $this->getIO();
$unpushedChanges = array();
@@ -89,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
// list packages
foreach ($installedRepo->getCanonicalPackages() as $package) {
- $downloader = $dm->getDownloaderForInstalledPackage($package);
+ $downloader = $dm->getDownloaderForPackage($package);
$targetDir = $im->getInstallPath($package);
if ($downloader instanceof ChangeReportInterface) {
@@ -103,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
if ($downloader instanceof VcsCapableDownloaderInterface) {
- if ($currentRef = $downloader->getVcsReference($package, $targetDir)) {
+ if ($downloader->getVcsReference($package, $targetDir)) {
switch ($package->getInstallationSource()) {
case 'source':
$previousRef = $package->getSourceReference();
@@ -205,9 +222,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->writeError('Use --verbose (-v) to see a list of files');
}
- // Dispatch post-status-command
- $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_STATUS_CMD, true);
-
return ($errors ? self::EXIT_CODE_ERRORS : 0) + ($unpushedChanges ? self::EXIT_CODE_UNPUSHED_CHANGES : 0) + ($vcsVersionChanges ? self::EXIT_CODE_VERSION_CHANGES : 0);
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php b/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php
index 225725e12..cb1f4e9a6 100644
--- a/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/SuggestsCommand.php
@@ -13,6 +13,9 @@
namespace Composer\Command;
use Composer\Repository\PlatformRepository;
+use Composer\Repository\RootPackageRepository;
+use Composer\Repository\InstalledRepository;
+use Composer\Installer\SuggestedPackagesReporter;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -26,8 +29,10 @@ protected function configure()
->setName('suggests')
->setDescription('Shows package suggestions.')
->setDefinition(array(
- new InputOption('by-package', null, InputOption::VALUE_NONE, 'Groups output by suggesting package'),
+ new InputOption('by-package', null, InputOption::VALUE_NONE, 'Groups output by suggesting package (default)'),
new InputOption('by-suggestion', null, InputOption::VALUE_NONE, 'Groups output by suggested package'),
+ new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show suggestions from all dependencies, including transitive ones'),
+ new InputOption('list', null, InputOption::VALUE_NONE, 'Show only list of suggested package names'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Exclude suggestions from require-dev packages'),
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that you want to list suggestions from.'),
))
@@ -36,116 +41,64 @@ protected function configure()
The %command.name% command shows a sorted list of suggested packages.
-Enabling -v implies --by-package --by-suggestion, showing both lists.
-
+Read more at https://getcomposer.org/doc/03-cli.md#suggests
EOT
)
;
}
+ /**
+ * {@inheritDoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
- $lock = $this->getComposer()->getLocker()->getLockData();
-
- if (empty($lock)) {
- throw new \RuntimeException('Lockfile seems to be empty?');
+ $composer = $this->getComposer();
+
+ $installedRepos = array(
+ new RootPackageRepository(clone $composer->getPackage()),
+ );
+
+ $locker = $composer->getLocker();
+ if ($locker->isLocked()) {
+ $installedRepos[] = new PlatformRepository(array(), $locker->getPlatformOverrides());
+ $installedRepos[] = $locker->getLockedRepository(!$input->getOption('no-dev'));
+ } else {
+ $installedRepos[] = new PlatformRepository(array(), $composer->getConfig()->get('platform') ?: array());
+ $installedRepos[] = $composer->getRepositoryManager()->getLocalRepository();
}
- $packages = $lock['packages'];
-
- if (!$input->getOption('no-dev')) {
- $packages += $lock['packages-dev'];
- }
+ $installedRepo = new InstalledRepository($installedRepos);
+ $reporter = new SuggestedPackagesReporter($this->getIO());
$filter = $input->getArgument('packages');
-
- // First assemble lookup list of packages that are installed, replaced or provided
- $installed = array();
+ $packages = $installedRepo->getPackages();
+ $packages[] = $composer->getPackage();
foreach ($packages as $package) {
- $installed[] = $package['name'];
-
- if (!empty($package['provide'])) {
- $installed = array_merge($installed, array_keys($package['provide']));
+ if (!empty($filter) && !in_array($package->getName(), $filter)) {
+ continue;
}
- if (!empty($package['replace'])) {
- $installed = array_merge($installed, array_keys($package['replace']));
- }
+ $reporter->addSuggestionsFromPackage($package);
}
- // Undub and sort the install list into a sorted lookup array
- $installed = array_flip($installed);
- ksort($installed);
-
- // Init platform repo
- $platform = new PlatformRepository(array(), $this->getComposer()->getConfig()->get('platform') ?: array());
+ // Determine output mode, default is by-package
+ $mode = SuggestedPackagesReporter::MODE_BY_PACKAGE;
- // Next gather all suggestions that are not in that list
- $suggesters = array();
- $suggested = array();
- foreach ($packages as $package) {
- $packageName = $package['name'];
- if ((!empty($filter) && !in_array($packageName, $filter)) || empty($package['suggest'])) {
- continue;
- }
- foreach ($package['suggest'] as $suggestion => $reason) {
- if (false === strpos('/', $suggestion) && null !== $platform->findPackage($suggestion, '*')) {
- continue;
- }
- if (!isset($installed[$suggestion])) {
- $suggesters[$packageName][$suggestion] = $reason;
- $suggested[$suggestion][$packageName] = $reason;
- }
- }
- }
- ksort($suggesters);
- ksort($suggested);
-
- // Determine output mode
- $mode = 0;
- $io = $this->getIO();
- if ($input->getOption('by-package') || $io->isVerbose()) {
- $mode |= 1;
- }
+ // if by-suggestion is given we override the default
if ($input->getOption('by-suggestion')) {
- $mode |= 2;
+ $mode = SuggestedPackagesReporter::MODE_BY_SUGGESTION;
}
-
- // Simple mode
- if ($mode === 0) {
- foreach (array_keys($suggested) as $suggestion) {
- $io->write(sprintf('%s', $suggestion));
- }
-
- return;
+ // unless by-package is also present then we enable both
+ if ($input->getOption('by-package')) {
+ $mode |= SuggestedPackagesReporter::MODE_BY_PACKAGE;
}
-
- // Grouped by package
- if ($mode & 1) {
- foreach ($suggesters as $suggester => $suggestions) {
- $io->write(sprintf('%s suggests:', $suggester));
-
- foreach ($suggestions as $suggestion => $reason) {
- $io->write(sprintf(' - %s: %s', $suggestion, $reason ?: '*'));
- }
- $io->write('');
- }
+ // list is exclusive and overrides everything else
+ if ($input->getOption('list')) {
+ $mode = SuggestedPackagesReporter::MODE_LIST;
}
- // Grouped by suggestion
- if ($mode & 2) {
- // Improve readability in full mode
- if ($mode & 1) {
- $io->write(str_repeat('-', 78));
- }
- foreach ($suggested as $suggestion => $suggesters) {
- $io->write(sprintf('%s is suggested by:', $suggestion));
+ $reporter->output($mode, $installedRepo, empty($filter) && !$input->getOption('all') ? $composer->getPackage() : null);
- foreach ($suggesters as $suggester => $reason) {
- $io->write(sprintf(' - %s: %s', $suggester, $reason ?: '*'));
- }
- $io->write('');
- }
- }
+ return 0;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php
index 34420b747..0fe582299 100644
--- a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php
@@ -13,10 +13,16 @@
namespace Composer\Command;
use Composer\Composer;
+use Composer\DependencyResolver\Request;
use Composer\Installer;
use Composer\IO\IOInterface;
+use Composer\Package\Loader\RootPackageLoader;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
+use Composer\Package\Version\VersionParser;
+use Composer\Util\HttpDownloader;
+use Composer\Semver\Constraint\MultiConstraint;
+use Composer\Package\Link;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -38,24 +44,28 @@ protected function configure()
->setDescription('Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.')
->setDefinition(array(
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that should be updated, if not provided all packages are.'),
+ new InputOption('with', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0'),
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
- new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
+ new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'),
+ new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'),
new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'),
- new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
+ new InputOption('dev', null, InputOption::VALUE_NONE, 'DEPRECATED: Enables installation of require-dev packages (enabled by default, only present for BC).'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
- new InputOption('lock', null, InputOption::VALUE_NONE, 'Only updates the lock file hash to suppress warning about the lock file being out of date.'),
- new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
+ new InputOption('lock', null, InputOption::VALUE_NONE, 'Overwrites the lock file hash to suppress warning about the lock file being out of date without updating package versions. Package metadata like mirrors and URLs are updated if they changed.'),
+ new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'),
new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'),
+ new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
- new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'Do not show package suggestions.'),
- new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also dependencies of whitelisted packages to the whitelist, except those defined in root package.'),
- new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist, including those defined in root package.'),
+ new InputOption('with-dependencies', 'w', InputOption::VALUE_NONE, 'Update also dependencies of packages in the argument list, except those which are root requirements.'),
+ new InputOption('with-all-dependencies', 'W', InputOption::VALUE_NONE, 'Update also dependencies of packages in the argument list, including those which are root requirements.'),
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'),
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
- new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore platform requirements (php & ext- packages).'),
+ new InputOption('apcu-autoloader-prefix', null, InputOption::VALUE_REQUIRED, 'Use a custom prefix for the APCu autoloader cache. Implicitly enables --apcu-autoloader'),
+ new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
+ new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
new InputOption('prefer-stable', null, InputOption::VALUE_NONE, 'Prefer stable versions of dependencies.'),
new InputOption('prefer-lowest', null, InputOption::VALUE_NONE, 'Prefer lowest versions of dependencies.'),
new InputOption('interactive', 'i', InputOption::VALUE_NONE, 'Interactive interface with autocompletion to select the packages to update.'),
@@ -79,8 +89,17 @@ protected function configure()
php composer.phar update vendor/package1 foo/* [...]
+To run an update with more restrictive constraints you can use:
+
+php composer.phar update --with vendor/package:1.0.*
+
+To run a partial update with more restrictive constraints you can use the shorthand:
+
+php composer.phar update vendor/package:1.0.*
+
To select packages names interactively with auto-completion use -i.
+Read more at https://getcomposer.org/doc/03-cli.md#update-u
EOT
)
;
@@ -89,42 +108,93 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = $this->getIO();
- if ($input->getOption('no-custom-installers')) {
- $io->writeError('You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.');
- $input->setOption('no-plugins', true);
- }
-
if ($input->getOption('dev')) {
- $io->writeError('You are using the deprecated option "dev". Dev packages are installed by default now.');
+ $io->writeError('You are using the deprecated option "--dev". It has no effect and will break in Composer 3.');
+ }
+ if ($input->getOption('no-suggest')) {
+ $io->writeError('You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.');
}
$composer = $this->getComposer(true, $input->getOption('no-plugins'));
+ $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts'));
+
+ if (!HttpDownloader::isCurlEnabled()) {
+ $io->writeError('Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.');
+ }
$packages = $input->getArgument('packages');
+ $reqs = $this->formatRequirements($input->getOption('with'));
+
+ // extract --with shorthands from the allowlist
+ if ($packages) {
+ $allowlistPackagesWithRequirements = array_filter($packages, function ($pkg) {
+ return preg_match('{\S+[ =:]\S+}', $pkg) > 0;
+ });
+ foreach ($this->formatRequirements($allowlistPackagesWithRequirements) as $package => $constraint) {
+ $reqs[$package] = $constraint;
+ }
+
+ // replace the foo/bar:req by foo/bar in the allowlist
+ foreach ($allowlistPackagesWithRequirements as $package) {
+ $packageName = preg_replace('{^([^ =:]+)[ =:].*$}', '$1', $package);
+ $index = array_search($package, $packages);
+ $packages[$index] = $packageName;
+ }
+ }
+
+ $rootPackage = $composer->getPackage();
+ $rootRequires = $rootPackage->getRequires();
+ $rootDevRequires = $rootPackage->getDevRequires();
+ foreach ($reqs as $package => $constraint) {
+ if (isset($rootRequires[$package])) {
+ $rootRequires[$package] = $this->appendConstraintToLink($rootRequires[$package], $constraint);
+ } elseif (isset($rootDevRequires[$package])) {
+ $rootDevRequires[$package] = $this->appendConstraintToLink($rootDevRequires[$package], $constraint);
+ } else {
+ throw new \UnexpectedValueException('Only root package requirements can receive temporary constraints and '.$package.' is not one');
+ }
+ }
+ $rootPackage->setRequires($rootRequires);
+ $rootPackage->setDevRequires($rootDevRequires);
+ $rootPackage->setReferences(RootPackageLoader::extractReferences($reqs, $rootPackage->getReferences()));
+ $rootPackage->setStabilityFlags(RootPackageLoader::extractStabilityFlags($reqs, $rootPackage->getMinimumStability(), $rootPackage->getStabilityFlags()));
if ($input->getOption('interactive')) {
$packages = $this->getPackagesInteractively($io, $input, $output, $composer, $packages);
}
if ($input->getOption('root-reqs')) {
- $require = array_keys($composer->getPackage()->getRequires());
+ $requires = array_keys($rootRequires);
if (!$input->getOption('no-dev')) {
- $requireDev = array_keys($composer->getPackage()->getDevRequires());
- $require = array_merge($require, $requireDev);
+ $requires = array_merge($requires, array_keys($rootDevRequires));
}
if (!empty($packages)) {
- $packages = array_intersect($packages, $require);
+ $packages = array_intersect($packages, $requires);
} else {
- $packages = $require;
+ $packages = $requires;
}
}
- $composer->getDownloadManager()->setOutputProgress(!$input->getOption('no-progress'));
+ // the arguments lock/nothing/mirrors are not package names but trigger a mirror update instead
+ // they are further mutually exclusive with listing actual package names
+ $filteredPackages = array_filter($packages, function ($package) {
+ return !in_array($package, array('lock', 'nothing', 'mirrors'), true);
+ });
+ $updateMirrors = $input->getOption('lock') || count($filteredPackages) != count($packages);
+ $packages = $filteredPackages;
+
+ if ($updateMirrors && !empty($packages)) {
+ $io->writeError('You cannot simultaneously update only a selection of packages and regenerate the lock file metadata.');
+
+ return -1;
+ }
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'update', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
+ $composer->getInstallationManager()->setOutputProgress(!$input->getOption('no-progress'));
+
$install = Installer::create($io, $composer);
$config = $composer->getConfig();
@@ -132,7 +202,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
- $apcu = $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
+ $apcuPrefix = $input->getOption('apcu-autoloader-prefix');
+ $apcu = $apcuPrefix !== null || $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
+
+ $updateAllowTransitiveDependencies = Request::UPDATE_ONLY_LISTED;
+ if ($input->getOption('with-all-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS;
+ } elseif ($input->getOption('with-dependencies')) {
+ $updateAllowTransitiveDependencies = Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE;
+ }
+
+ $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
$install
->setDryRun($input->getOption('dry-run'))
@@ -141,16 +221,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setPreferDist($preferDist)
->setDevMode(!$input->getOption('no-dev'))
->setDumpAutoloader(!$input->getOption('no-autoloader'))
- ->setRunScripts(!$input->getOption('no-scripts'))
- ->setSkipSuggest($input->getOption('no-suggest'))
->setOptimizeAutoloader($optimize)
->setClassMapAuthoritative($authoritative)
- ->setApcuAutoloader($apcu)
+ ->setApcuAutoloader($apcu, $apcuPrefix)
->setUpdate(true)
- ->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $packages)
- ->setWhitelistTransitiveDependencies($input->getOption('with-dependencies'))
- ->setWhitelistAllDependencies($input->getOption('with-all-dependencies'))
- ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
+ ->setInstall(!$input->getOption('no-install'))
+ ->setUpdateMirrors($updateMirrors)
+ ->setUpdateAllowList($packages)
+ ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)
+ ->setIgnorePlatformRequirements($ignorePlatformReqs)
->setPreferStable($input->getOption('prefer-stable'))
->setPreferLowest($input->getOption('prefer-lowest'))
;
@@ -218,10 +297,27 @@ private function getPackagesInteractively(IOInterface $io, InputInterface $input
if ($io->askConfirmation(sprintf(
'Would you like to continue and update the above package%s [yes]? ',
1 === count($packages) ? '' : 's'
- ), true)) {
+ ))) {
return $packages;
}
throw new \RuntimeException('Installation aborted.');
}
+
+ private function appendConstraintToLink(Link $link, $constraint)
+ {
+ $parser = new VersionParser;
+ $oldPrettyString = $link->getConstraint()->getPrettyString();
+ $newConstraint = MultiConstraint::create(array($link->getConstraint(), $parser->parseConstraints($constraint)));
+ $newConstraint->setPrettyString($oldPrettyString.', '.$constraint);
+
+ return new Link(
+ $link->getSource(),
+ $link->getTarget(),
+ $newConstraint,
+ /** @phpstan-ignore-next-line */
+ $link->getDescription(),
+ $link->getPrettyConstraint() . ', ' . $constraint
+ );
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php
index 52bba1838..fdb424423 100644
--- a/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php
+++ b/app/vendor/composer/composer/src/Composer/Command/ValidateCommand.php
@@ -16,7 +16,10 @@
use Composer\Package\Loader\ValidatingArrayLoader;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
+use Composer\Repository\InstalledRepository;
+use Composer\Repository\PlatformRepository;
use Composer\Util\ConfigValidator;
+use Composer\Util\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -39,9 +42,10 @@ protected function configure()
->setName('validate')
->setDescription('Validates a composer.json and composer.lock.')
->setDefinition(array(
- new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not make a complete validation'),
+ new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not validate requires for overly strict/loose constraints'),
new InputOption('no-check-lock', null, InputOption::VALUE_NONE, 'Do not check if lock file is up to date'),
new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'),
+ new InputOption('no-check-version', null, InputOption::VALUE_NONE, 'Do not report a warning if the version field is present'),
new InputOption('with-dependencies', 'A', InputOption::VALUE_NONE, 'Also validate the composer.json of all installed dependencies'),
new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code for warnings as well as errors'),
new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file'),
@@ -55,6 +59,7 @@ protected function configure()
2 validation error(s)
3 file unreadable or missing
+Read more at https://getcomposer.org/doc/03-cli.md#validate
EOT
);
}
@@ -75,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 3;
}
- if (!is_readable($file)) {
+ if (!Filesystem::isReadable($file)) {
$io->writeError('' . $file . ' is not readable.');
return 3;
@@ -85,19 +90,53 @@ protected function execute(InputInterface $input, OutputInterface $output)
$checkAll = $input->getOption('no-check-all') ? 0 : ValidatingArrayLoader::CHECK_ALL;
$checkPublish = !$input->getOption('no-check-publish');
$checkLock = !$input->getOption('no-check-lock');
+ $checkVersion = $input->getOption('no-check-version') ? 0 : ConfigValidator::CHECK_VERSION;
$isStrict = $input->getOption('strict');
- list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
+ list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll, $checkVersion);
$lockErrors = array();
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
$locker = $composer->getLocker();
if ($locker->isLocked() && !$locker->isFresh()) {
- $lockErrors[] = 'The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update`.';
+ $lockErrors[] = '- The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update `.';
+ }
+
+ if ($locker->isLocked()) {
+ $missingRequirements = false;
+ $sets = array(
+ array('repo' => $locker->getLockedRepository(false), 'method' => 'getRequires', 'description' => 'Required'),
+ array('repo' => $locker->getLockedRepository(true), 'method' => 'getDevRequires', 'description' => 'Required (in require-dev)'),
+ );
+ foreach ($sets as $set) {
+ $installedRepo = new InstalledRepository(array($set['repo']));
+
+ foreach (call_user_func(array($composer->getPackage(), $set['method'])) as $link) {
+ if (PlatformRepository::isPlatformPackage($link->getTarget())) {
+ continue;
+ }
+ if (!$installedRepo->findPackagesWithReplacersAndProviders($link->getTarget(), $link->getConstraint())) {
+ if ($results = $installedRepo->findPackagesWithReplacersAndProviders($link->getTarget())) {
+ $provider = reset($results);
+ $lockErrors[] = '- ' . $set['description'].' package "' . $link->getTarget() . '" is in the lock file as "'.$provider->getPrettyVersion().'" but that does not satisfy your constraint "'.$link->getPrettyConstraint().'".';
+ } else {
+ $lockErrors[] = '- ' . $set['description'].' package "' . $link->getTarget() . '" is not present in the lock file.';
+ }
+ $missingRequirements = true;
+ }
+ }
+ }
+
+ if ($missingRequirements) {
+ $lockErrors[] = 'This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.';
+ $lockErrors[] = 'Read more about correctly resolving merge conflicts https://getcomposer.org/doc/articles/resolving-merge-conflicts.md';
+ $lockErrors[] = 'and prefer using the "require" command over editing the composer.json file directly https://getcomposer.org/doc/03-cli.md#require';
+ }
}
$this->outputResult($io, $file, $errors, $warnings, $checkPublish, $publishErrors, $checkLock, $lockErrors, true);
- $exitCode = $errors || ($publishErrors && $checkPublish) || ($lockErrors && $checkLock) ? 2 : ($isStrict && $warnings ? 1 : 0);
+ // $errors include publish and lock errors when exists
+ $exitCode = $errors ? 2 : ($isStrict && $warnings ? 1 : 0);
if ($input->getOption('with-dependencies')) {
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
@@ -105,10 +144,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
$path = $composer->getInstallationManager()->getInstallPath($package);
$file = $path . '/composer.json';
if (is_dir($path) && file_exists($file)) {
- list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll);
+ list($errors, $publishErrors, $warnings) = $validator->validate($file, $checkAll, $checkVersion);
+
$this->outputResult($io, $package->getPrettyName(), $errors, $warnings, $checkPublish, $publishErrors);
- $depCode = $errors || ($publishErrors && $checkPublish) ? 2 : ($isStrict && $warnings ? 1 : 0);
+ // $errors include publish errors when exists
+ $depCode = $errors ? 2 : ($isStrict && $warnings ? 1 : 0);
$exitCode = max($depCode, $exitCode);
}
}
@@ -116,52 +157,87 @@ protected function execute(InputInterface $input, OutputInterface $output)
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'validate', $input, $output);
$eventCode = $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
- $exitCode = max($eventCode, $exitCode);
- return $exitCode;
+ return max($eventCode, $exitCode);
}
private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false)
{
- if (!$errors && !$publishErrors && !$warnings) {
- $io->write('' . $name . ' is valid');
- } elseif (!$errors && !$publishErrors) {
+ $doPrintSchemaUrl = false;
+
+ if ($errors) {
+ $io->writeError('' . $name . ' is invalid, the following errors/warnings were found:');
+ } elseif ($publishErrors) {
+ $io->writeError('' . $name . ' is valid for simple usage with Composer but has');
+ $io->writeError('strict errors that make it unable to be published as a package');
+ $doPrintSchemaUrl = $printSchemaUrl;
+ } elseif ($warnings) {
$io->writeError('' . $name . ' is valid, but with a few warnings');
- if ($printSchemaUrl) {
- $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
- }
- } elseif (!$errors) {
- $io->writeError('' . $name . ' is valid for simple usage with composer but has');
- $io->writeError('strict errors that make it unable to be published as a package:');
- if ($printSchemaUrl) {
- $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
- }
+ $doPrintSchemaUrl = $printSchemaUrl;
+ } elseif ($lockErrors) {
+ $io->write('' . $name . ' is valid but your composer.lock has some '.($checkLock ? 'errors' : 'warnings').'');
} else {
- $io->writeError('' . $name . ' is invalid, the following errors/warnings were found:');
+ $io->write('' . $name . ' is valid');
+ }
+
+ if ($doPrintSchemaUrl) {
+ $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
+ }
+
+ if ($errors) {
+ $errors = array_map(function ($err) {
+ return '- ' . $err;
+ }, $errors);
+ array_unshift($errors, '# General errors');
+ }
+ if ($warnings) {
+ $warnings = array_map(function ($err) {
+ return '- ' . $err;
+ }, $warnings);
+ array_unshift($warnings, '# General warnings');
}
+ // Avoid setting the exit code to 1 in case --strict and --no-check-publish/--no-check-lock are combined
+ $extraWarnings = array();
+
// If checking publish errors, display them as errors, otherwise just show them as warnings
- if ($checkPublish) {
- $errors = array_merge($errors, $publishErrors);
- } else {
- $warnings = array_merge($warnings, $publishErrors);
+ if ($publishErrors) {
+ $publishErrors = array_map(function ($err) {
+ return '- ' . $err;
+ }, $publishErrors);
+
+ if ($checkPublish) {
+ array_unshift($publishErrors, '# Publish errors');
+ $errors = array_merge($errors, $publishErrors);
+ } else {
+ array_unshift($publishErrors, '# Publish warnings');
+ $extraWarnings = array_merge($extraWarnings, $publishErrors);
+ }
}
// If checking lock errors, display them as errors, otherwise just show them as warnings
- if ($checkLock) {
- $errors = array_merge($errors, $lockErrors);
- } else {
- $warnings = array_merge($warnings, $lockErrors);
+ if ($lockErrors) {
+ if ($checkLock) {
+ array_unshift($lockErrors, '# Lock file errors');
+ $errors = array_merge($errors, $lockErrors);
+ } else {
+ array_unshift($lockErrors, '# Lock file warnings');
+ $extraWarnings = array_merge($extraWarnings, $lockErrors);
+ }
}
$messages = array(
'error' => $errors,
- 'warning' => $warnings,
+ 'warning' => array_merge($warnings, $extraWarnings),
);
foreach ($messages as $style => $msgs) {
foreach ($msgs as $msg) {
- $io->writeError('<' . $style . '>' . $msg . '' . $style . '>');
+ if (strpos($msg, '#') === 0) {
+ $io->writeError('<' . $style . '>' . $msg . '' . $style . '>');
+ } else {
+ $io->writeError($msg);
+ }
}
}
}
diff --git a/app/vendor/composer/composer/src/Composer/Compiler.php b/app/vendor/composer/composer/src/Composer/Compiler.php
index 4064b20b5..8476a529f 100644
--- a/app/vendor/composer/composer/src/Composer/Compiler.php
+++ b/app/vendor/composer/composer/src/Composer/Compiler.php
@@ -13,11 +13,11 @@
namespace Composer;
use Composer\Json\JsonFile;
-use Composer\Spdx\SpdxLicenses;
use Composer\CaBundle\CaBundle;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Process;
use Seld\PharUtils\Timestamps;
+use Seld\PharUtils\Linter;
/**
* The Compiler class compiles composer into a phar
@@ -43,13 +43,25 @@ public function compile($pharFile = 'composer.phar')
unlink($pharFile);
}
- $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__);
+ // TODO in v2.3 always call with an array
+ if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
+ $process = new Process(array('git', 'log', '--pretty="%H"', '-n1', 'HEAD'), __DIR__);
+ } else {
+ // @phpstan-ignore-next-line
+ $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__);
+ }
if ($process->run() != 0) {
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
}
$this->version = trim($process->getOutput());
- $process = new Process('git log -n1 --pretty=%ci HEAD', __DIR__);
+ // TODO in v2.3 always call with an array
+ if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
+ $process = new Process(array('git', 'log', '-n1', '--pretty=%ci', 'HEAD'), __DIR__);
+ } else {
+ // @phpstan-ignore-next-line
+ $process = new Process('git log -n1 --pretty=%ci HEAD', __DIR__);
+ }
if ($process->run() != 0) {
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
}
@@ -57,7 +69,13 @@ public function compile($pharFile = 'composer.phar')
$this->versionDate = new \DateTime(trim($process->getOutput()));
$this->versionDate->setTimezone(new \DateTimeZone('UTC'));
- $process = new Process('git describe --tags --exact-match HEAD');
+ // TODO in v2.3 always call with an array
+ if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
+ $process = new Process(array('git', 'describe', '--tags', '--exact-match', 'HEAD'), __DIR__);
+ } else {
+ // @phpstan-ignore-next-line
+ $process = new Process('git describe --tags --exact-match HEAD');
+ }
if ($process->run() == 0) {
$this->version = trim($process->getOutput());
} else {
@@ -71,7 +89,7 @@ public function compile($pharFile = 'composer.phar')
}
$phar = new \Phar($pharFile, 0, 'composer.phar');
- $phar->setSignatureAlgorithm(\Phar::SHA1);
+ $phar->setSignatureAlgorithm(\Phar::SHA512);
$phar->startBuffering();
@@ -79,71 +97,83 @@ public function compile($pharFile = 'composer.phar')
return strcmp(strtr($a->getRealPath(), '\\', '/'), strtr($b->getRealPath(), '\\', '/'));
};
+ // Add Composer sources
$finder = new Finder();
$finder->files()
->ignoreVCS(true)
->name('*.php')
->notName('Compiler.php')
->notName('ClassLoader.php')
+ ->notName('InstalledVersions.php')
->in(__DIR__.'/..')
->sort($finderSort)
;
-
foreach ($finder as $file) {
$this->addFile($phar, $file);
}
+ // Add runtime utilities separately to make sure they retains the docblocks as these will get copied into projects
$this->addFile($phar, new \SplFileInfo(__DIR__ . '/Autoload/ClassLoader.php'), false);
+ $this->addFile($phar, new \SplFileInfo(__DIR__ . '/InstalledVersions.php'), false);
+ // Add Composer resources
$finder = new Finder();
$finder->files()
- ->name('*.json')
->in(__DIR__.'/../../res')
- ->in(SpdxLicenses::getResourcesDir())
->sort($finderSort)
;
-
foreach ($finder as $file) {
$this->addFile($phar, $file, false);
}
- $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../vendor/symfony/console/Resources/bin/hiddeninput.exe'), false);
+ // Add vendor files
$finder = new Finder();
$finder->files()
->ignoreVCS(true)
- ->name('*.php')
- ->name('LICENSE')
+ ->notPath('/\/(composer\.(json|lock)|[A-Z]+\.md|\.gitignore|appveyor.yml|phpunit\.xml\.dist|phpstan\.neon\.dist|phpstan-config\.neon)$/')
+ ->notPath('/bin\/(jsonlint|validate-json|simple-phpunit)(\.bat)?$/')
+ ->notPath('symfony/debug/Resources/ext/')
+ ->notPath('justinrainbow/json-schema/demo/')
+ ->notPath('justinrainbow/json-schema/dist/')
+ ->notPath('composer/installed.json')
+ ->notPath('composer/LICENSE')
->exclude('Tests')
->exclude('tests')
->exclude('docs')
- ->in(__DIR__.'/../../vendor/symfony/')
- ->in(__DIR__.'/../../vendor/seld/jsonlint/')
- ->in(__DIR__.'/../../vendor/justinrainbow/json-schema/')
- ->in(__DIR__.'/../../vendor/composer/spdx-licenses/')
- ->in(__DIR__.'/../../vendor/composer/semver/')
- ->in(__DIR__.'/../../vendor/composer/ca-bundle/')
- ->in(__DIR__.'/../../vendor/composer/xdebug-handler/')
- ->in(__DIR__.'/../../vendor/psr/')
+ ->in(__DIR__.'/../../vendor/')
->sort($finderSort)
;
+ $extraFiles = array(
+ realpath(__DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-exceptions.json'),
+ realpath(__DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-licenses.json'),
+ realpath(CaBundle::getBundledCaBundlePath()),
+ realpath(__DIR__ . '/../../vendor/symfony/console/Resources/bin/hiddeninput.exe'),
+ realpath(__DIR__ . '/../../vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8'),
+ );
+ $unexpectedFiles = array();
+
foreach ($finder as $file) {
- $this->addFile($phar, $file);
- }
+ if (in_array(realpath($file), $extraFiles, true)) {
+ unset($extraFiles[array_search(realpath($file), $extraFiles, true)]);
+ } elseif (!preg_match('{([/\\\\]LICENSE|\.php)$}', $file)) {
+ $unexpectedFiles[] = (string) $file;
+ }
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/autoload.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_namespaces.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_psr4.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_classmap.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_files.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_real.php'));
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/autoload_static.php'));
- if (file_exists(__DIR__.'/../../vendor/composer/include_paths.php')) {
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/include_paths.php'));
+ if (preg_match('{\.php[\d.]*$}', $file)) {
+ $this->addFile($phar, $file);
+ } else {
+ $this->addFile($phar, $file, false);
+ }
}
- $this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/ClassLoader.php'));
- $this->addFile($phar, new \SplFileInfo(CaBundle::getBundledCaBundlePath()), false);
+ if ($extraFiles) {
+ throw new \RuntimeException('These files were expected but not added to the phar, they might be excluded or gone from the source package:'.PHP_EOL.implode(PHP_EOL, $extraFiles));
+ }
+ if ($unexpectedFiles) {
+ throw new \RuntimeException('These files were unexpectedly added to the phar, make sure they are excluded or listed in $extraFiles:'.PHP_EOL.implode(PHP_EOL, $unexpectedFiles));
+ }
+ // Add bin/composer
$this->addComposerBin($phar);
// Stubs
@@ -161,7 +191,9 @@ public function compile($pharFile = 'composer.phar')
// re-sign the phar with reproducible timestamp / signature
$util = new Timestamps($pharFile);
$util->updateTimestamps($this->versionDate);
- $util->save($pharFile, \Phar::SHA1);
+ $util->save($pharFile, \Phar::SHA512);
+
+ Linter::lint($pharFile);
}
/**
@@ -190,9 +222,15 @@ private function addFile($phar, $file, $strip = true)
}
if ($path === 'src/Composer/Composer.php') {
- $content = str_replace('@package_version@', $this->version, $content);
- $content = str_replace('@package_branch_alias_version@', $this->branchAliasVersion, $content);
- $content = str_replace('@release_date@', $this->versionDate->format('Y-m-d H:i:s'), $content);
+ $content = strtr(
+ $content,
+ array(
+ '@package_version@' => $this->version,
+ '@package_branch_alias_version@' => $this->branchAliasVersion,
+ '@release_date@' => $this->versionDate->format('Y-m-d H:i:s'),
+ )
+ );
+ $content = preg_replace('{SOURCE_VERSION = \'[^\']+\';}', 'SOURCE_VERSION = \'\';', $content);
}
$phar->addFromString($path, $content);
@@ -255,7 +293,7 @@ private function getStub()
*/
// Avoid APC causing random fatal errors per https://github.com/composer/composer/issues/264
-if (extension_loaded('apc') && ini_get('apc.enable_cli') && ini_get('apc.cache_by_default')) {
+if (extension_loaded('apc') && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.cache_by_default'), FILTER_VALIDATE_BOOLEAN)) {
if (version_compare(phpversion('apc'), '3.0.12', '>=')) {
ini_set('apc.cache_by_default', 0);
} else {
@@ -264,6 +302,11 @@ private function getStub()
}
}
+if (!class_exists('Phar')) {
+ echo 'PHP\'s phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.' . PHP_EOL;
+ exit(1);
+}
+
Phar::mapPhar('composer.phar');
EOF;
diff --git a/app/vendor/composer/composer/src/Composer/Composer.php b/app/vendor/composer/composer/src/Composer/Composer.php
index b1a131a4f..29136f995 100644
--- a/app/vendor/composer/composer/src/Composer/Composer.php
+++ b/app/vendor/composer/composer/src/Composer/Composer.php
@@ -14,6 +14,7 @@
use Composer\Package\RootPackageInterface;
use Composer\Package\Locker;
+use Composer\Util\Loop;
use Composer\Repository\RepositoryManager;
use Composer\Installer\InstallationManager;
use Composer\Plugin\PluginManager;
@@ -29,19 +30,72 @@
*/
class Composer
{
- const VERSION = '1.7.2';
+ /*
+ * Examples of the following constants in the various configurations they can be in
+ *
+ * releases (phar):
+ * const VERSION = '1.8.2';
+ * const BRANCH_ALIAS_VERSION = '';
+ * const RELEASE_DATE = '2019-01-29 15:00:53';
+ * const SOURCE_VERSION = '';
+ *
+ * snapshot builds (phar):
+ * const VERSION = 'd3873a05650e168251067d9648845c220c50e2d7';
+ * const BRANCH_ALIAS_VERSION = '1.9-dev';
+ * const RELEASE_DATE = '2019-02-20 07:43:56';
+ * const SOURCE_VERSION = '';
+ *
+ * source (git clone):
+ * const VERSION = '@package_version@';
+ * const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@';
+ * const RELEASE_DATE = '@release_date@';
+ * const SOURCE_VERSION = '1.8-dev+source';
+ */
+ const VERSION = '2.1.8';
const BRANCH_ALIAS_VERSION = '';
- const RELEASE_DATE = '2018-08-16 16:57:12';
+ const RELEASE_DATE = '2021-09-15 13:55:14';
+ const SOURCE_VERSION = '';
/**
- * @var Package\RootPackageInterface
+ * Version number of the internal composer-runtime-api package
+ *
+ * This is used to version features available to projects at runtime
+ * like the platform-check file, the Composer\InstalledVersions class
+ * and possibly others in the future.
+ *
+ * @var string
+ */
+ const RUNTIME_API_VERSION = '2.1.0';
+
+ public static function getVersion()
+ {
+ // no replacement done, this must be a source checkout
+ if (self::VERSION === '@package_version'.'@') {
+ return self::SOURCE_VERSION;
+ }
+
+ // we have a branch alias and version is a commit id, this must be a snapshot build
+ if (self::BRANCH_ALIAS_VERSION !== '' && preg_match('{^[a-f0-9]{40}$}', self::VERSION)) {
+ return self::BRANCH_ALIAS_VERSION.'+'.self::VERSION;
+ }
+
+ return self::VERSION;
+ }
+
+ /**
+ * @var RootPackageInterface
*/
private $package;
/**
- * @var Locker
+ * @var ?Locker
+ */
+ private $locker = null;
+
+ /**
+ * @var Loop
*/
- private $locker;
+ private $loop;
/**
* @var Repository\RepositoryManager
@@ -84,7 +138,7 @@ class Composer
private $archiveManager;
/**
- * @param Package\RootPackageInterface $package
+ * @param RootPackageInterface $package
* @return void
*/
public function setPackage(RootPackageInterface $package)
@@ -93,7 +147,7 @@ public function setPackage(RootPackageInterface $package)
}
/**
- * @return Package\RootPackageInterface
+ * @return RootPackageInterface
*/
public function getPackage()
{
@@ -117,7 +171,7 @@ public function getConfig()
}
/**
- * @param Package\Locker $locker
+ * @param Locker $locker
*/
public function setLocker(Locker $locker)
{
@@ -125,7 +179,7 @@ public function setLocker(Locker $locker)
}
/**
- * @return Package\Locker
+ * @return ?Locker
*/
public function getLocker()
{
@@ -133,7 +187,23 @@ public function getLocker()
}
/**
- * @param Repository\RepositoryManager $manager
+ * @param Loop $loop
+ */
+ public function setLoop(Loop $loop)
+ {
+ $this->loop = $loop;
+ }
+
+ /**
+ * @return Loop
+ */
+ public function getLoop()
+ {
+ return $this->loop;
+ }
+
+ /**
+ * @param RepositoryManager $manager
*/
public function setRepositoryManager(RepositoryManager $manager)
{
@@ -141,7 +211,7 @@ public function setRepositoryManager(RepositoryManager $manager)
}
/**
- * @return Repository\RepositoryManager
+ * @return RepositoryManager
*/
public function getRepositoryManager()
{
@@ -149,7 +219,7 @@ public function getRepositoryManager()
}
/**
- * @param Downloader\DownloadManager $manager
+ * @param DownloadManager $manager
*/
public function setDownloadManager(DownloadManager $manager)
{
@@ -157,7 +227,7 @@ public function setDownloadManager(DownloadManager $manager)
}
/**
- * @return Downloader\DownloadManager
+ * @return DownloadManager
*/
public function getDownloadManager()
{
@@ -181,7 +251,7 @@ public function getArchiveManager()
}
/**
- * @param Installer\InstallationManager $manager
+ * @param InstallationManager $manager
*/
public function setInstallationManager(InstallationManager $manager)
{
@@ -189,7 +259,7 @@ public function setInstallationManager(InstallationManager $manager)
}
/**
- * @return Installer\InstallationManager
+ * @return InstallationManager
*/
public function getInstallationManager()
{
@@ -197,7 +267,7 @@ public function getInstallationManager()
}
/**
- * @param Plugin\PluginManager $manager
+ * @param PluginManager $manager
*/
public function setPluginManager(PluginManager $manager)
{
@@ -205,7 +275,7 @@ public function setPluginManager(PluginManager $manager)
}
/**
- * @return Plugin\PluginManager
+ * @return PluginManager
*/
public function getPluginManager()
{
@@ -229,7 +299,7 @@ public function getEventDispatcher()
}
/**
- * @param Autoload\AutoloadGenerator $autoloadGenerator
+ * @param AutoloadGenerator $autoloadGenerator
*/
public function setAutoloadGenerator(AutoloadGenerator $autoloadGenerator)
{
@@ -237,7 +307,7 @@ public function setAutoloadGenerator(AutoloadGenerator $autoloadGenerator)
}
/**
- * @return Autoload\AutoloadGenerator
+ * @return AutoloadGenerator
*/
public function getAutoloadGenerator()
{
diff --git a/app/vendor/composer/composer/src/Composer/Config.php b/app/vendor/composer/composer/src/Composer/Config.php
index 7b4220724..4cb7ab8ae 100644
--- a/app/vendor/composer/composer/src/Composer/Config.php
+++ b/app/vendor/composer/composer/src/Composer/Config.php
@@ -16,6 +16,7 @@
use Composer\Downloader\TransportException;
use Composer\IO\IOInterface;
use Composer\Util\Platform;
+use Composer\Util\ProcessExecutor;
/**
* @author Jordi Boggiano
@@ -27,9 +28,10 @@ class Config
public static $defaultConfig = array(
'process-timeout' => 300,
'use-include-path' => false,
- 'preferred-install' => 'auto',
+ 'preferred-install' => 'dist',
'notify-on-install' => true,
'github-protocols' => array('https', 'ssh', 'git'),
+ 'gitlab-protocol' => null,
'vendor-dir' => 'vendor',
'bin-dir' => '{$vendor-dir}/bin',
'cache-dir' => '{$home}/cache',
@@ -40,6 +42,7 @@ class Config
'cache-ttl' => 15552000, // 6 months
'cache-files-ttl' => null, // fallback to cache-ttl
'cache-files-maxsize' => '300MiB',
+ 'cache-read-only' => false,
'bin-compat' => 'auto',
'discard-changes' => false,
'autoloader-suffix' => null,
@@ -52,6 +55,7 @@ class Config
'bitbucket-expose-hostname' => true,
'disable-tls' => false,
'secure-http' => true,
+ 'secure-svn-domains' => array(),
'cafile' => null,
'capath' => null,
'github-expose-hostname' => true,
@@ -61,19 +65,22 @@ class Config
'archive-format' => 'tar',
'archive-dir' => '.',
'htaccess-protect' => true,
+ 'use-github-api' => true,
+ 'lock' => true,
+ 'platform-check' => 'php-only',
// valid keys without defaults (auth config stuff):
// bitbucket-oauth
// github-oauth
// gitlab-oauth
// gitlab-token
// http-basic
+ // bearer
);
public static $defaultRepositories = array(
'packagist.org' => array(
'type' => 'composer',
- 'url' => 'https?://repo.packagist.org',
- 'allow_ssl_downgrade' => true,
+ 'url' => 'https://repo.packagist.org',
),
);
@@ -130,8 +137,10 @@ public function merge($config)
// override defaults with given config
if (!empty($config['config']) && is_array($config['config'])) {
foreach ($config['config'] as $key => $val) {
- if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic')) && isset($this->config[$key])) {
+ if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic', 'bearer')) && isset($this->config[$key])) {
$this->config[$key] = array_merge($this->config[$key], $val);
+ } elseif (in_array($key, array('gitlab-domains', 'github-domains')) && isset($this->config[$key])) {
+ $this->config[$key] = array_unique(array_merge($this->config[$key], $val));
} elseif ('preferred-install' === $key && isset($this->config[$key])) {
if (is_array($val) || is_array($this->config[$key])) {
if (is_string($val)) {
@@ -172,6 +181,11 @@ public function merge($config)
continue;
}
+ // auto-deactivate the default packagist.org repo if it gets redefined
+ if (isset($repository['type'], $repository['url']) && $repository['type'] === 'composer' && preg_match('{^https?://(?:[a-z0-9-.]+\.)?packagist.org(/|$)}', $repository['url'])) {
+ $this->disableRepoByName('packagist.org');
+ }
+
// store repo
if (is_int($name)) {
$this->repositories[] = $repository;
@@ -206,6 +220,7 @@ public function getRepositories()
public function get($key, $flags = 0)
{
switch ($key) {
+ // strings/paths with env var and {$refs} support
case 'vendor-dir':
case 'bin-dir':
case 'process-timeout':
@@ -216,7 +231,6 @@ public function get($key, $flags = 0)
case 'cache-vcs-dir':
case 'cafile':
case 'capath':
- case 'htaccess-protect':
// convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config
$env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
@@ -230,13 +244,40 @@ public function get($key, $flags = 0)
return (($flags & self::RELATIVE_PATHS) == self::RELATIVE_PATHS) ? $val : $this->realpath($val);
+ // booleans with env var support
+ case 'cache-read-only':
+ case 'htaccess-protect':
+ // convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config
+ $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
+
+ $val = $this->getComposerEnv($env);
+ if (false === $val) {
+ $val = $this->config[$key];
+ }
+
+ return $val !== 'false' && (bool) $val;
+
+ // booleans without env var support
+ case 'disable-tls':
+ case 'secure-http':
+ case 'use-github-api':
+ case 'lock':
+ // special case for secure-http
+ if ($key === 'secure-http' && $this->get('disable-tls') === true) {
+ return false;
+ }
+
+ return $this->config[$key] !== 'false' && (bool) $this->config[$key];
+
+ // ints without env var support
case 'cache-ttl':
return (int) $this->config[$key];
+ // numbers with kb/mb/gb support, without env var support
case 'cache-files-maxsize':
if (!preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $this->config[$key], $matches)) {
throw new \RuntimeException(
- "Could not parse the value of 'cache-files-maxsize': {$this->config[$key]}"
+ "Could not parse the value of '$key': {$this->config[$key]}"
);
}
$size = $matches[1];
@@ -258,6 +299,7 @@ public function get($key, $flags = 0)
return $size;
+ // special cases below
case 'cache-files-ttl':
if (isset($this->config[$key])) {
return (int) $this->config[$key];
@@ -273,9 +315,9 @@ public function get($key, $flags = 0)
case 'bin-compat':
$value = $this->getComposerEnv('COMPOSER_BIN_COMPAT') ?: $this->config[$key];
- if (!in_array($value, array('auto', 'full'))) {
+ if (!in_array($value, array('auto', 'full', 'symlink'))) {
throw new \RuntimeException(
- "Invalid value for 'bin-compat': {$value}. Expected auto, full"
+ "Invalid value for 'bin-compat': {$value}. Expected auto, full or symlink"
);
}
@@ -315,12 +357,6 @@ public function get($key, $flags = 0)
return $protos;
- case 'disable-tls':
- return $this->config[$key] !== 'false' && (bool) $this->config[$key];
-
- case 'secure-http':
- return $this->config[$key] !== 'false' && (bool) $this->config[$key];
-
default:
if (!isset($this->config[$key])) {
return null;
@@ -440,10 +476,20 @@ public function prohibitUrlByConfig($url, IOInterface $io = null)
// Extract scheme and throw exception on known insecure protocols
$scheme = parse_url($url, PHP_URL_SCHEME);
+ $hostname = parse_url($url, PHP_URL_HOST);
if (in_array($scheme, array('http', 'git', 'ftp', 'svn'))) {
if ($this->get('secure-http')) {
+ if ($scheme === 'svn') {
+ if (in_array($hostname, $this->get('secure-svn-domains'), true)) {
+ return;
+ }
+
+ throw new TransportException("Your configuration does not allow connections to $url. See https://getcomposer.org/doc/06-config.md#secure-svn-domains for details.");
+ }
+
throw new TransportException("Your configuration does not allow connections to $url. See https://getcomposer.org/doc/06-config.md#secure-http for details.");
- } elseif ($io) {
+ }
+ if ($io) {
$host = parse_url($url, PHP_URL_HOST);
if (!isset($this->warnedHosts[$host])) {
$io->writeError("Warning: Accessing $host over $scheme which is an insecure protocol.");
@@ -452,4 +498,20 @@ public function prohibitUrlByConfig($url, IOInterface $io = null)
}
}
}
+
+ /**
+ * Used by long-running custom scripts in composer.json
+ *
+ * "scripts": {
+ * "watch": [
+ * "Composer\\Config::disableProcessTimeout",
+ * "vendor/bin/long-running-script --watch"
+ * ]
+ * }
+ */
+ public static function disableProcessTimeout()
+ {
+ // Override global timeout set earlier by environment or config
+ ProcessExecutor::setTimeout(0);
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php b/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php
index 0d56fc0ed..e1ef38de0 100644
--- a/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php
+++ b/app/vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php
@@ -23,10 +23,10 @@ interface ConfigSourceInterface
/**
* Add a repository
*
- * @param string $name Name
- * @param array $config Configuration
+ * @param string $name Name
+ * @param array|false $config Configuration
*/
- public function addRepository($name, $config);
+ public function addRepository($name, $config, $append = true);
/**
* Remove a repository
@@ -38,8 +38,8 @@ public function removeRepository($name);
/**
* Add a config setting
*
- * @param string $name Name
- * @param string $value Value
+ * @param string $name Name
+ * @param string|array $value Value
*/
public function addConfigSetting($name, $value);
diff --git a/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php b/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php
index 128ebf8ec..4be155782 100644
--- a/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php
+++ b/app/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php
@@ -14,6 +14,8 @@
use Composer\Json\JsonFile;
use Composer\Json\JsonManipulator;
+use Composer\Json\JsonValidationException;
+use Composer\Util\Filesystem;
use Composer\Util\Silencer;
/**
@@ -57,9 +59,9 @@ public function getName()
/**
* {@inheritdoc}
*/
- public function addRepository($name, $config)
+ public function addRepository($name, $config, $append = true)
{
- $this->manipulateJson('addRepository', $name, $config, function (&$config, $repo, $repoConfig) {
+ $this->manipulateJson('addRepository', $name, $config, $append, function (&$config, $repo, $repoConfig) use ($append) {
// if converting from an array format to hashmap format, and there is a {"packagist.org":false} repo, we have
// to convert it to "packagist.org": false key on the hashmap otherwise it fails schema validation
if (isset($config['repositories'])) {
@@ -75,7 +77,11 @@ public function addRepository($name, $config)
}
}
- $config['repositories'][$repo] = $repoConfig;
+ if ($append) {
+ $config['repositories'][$repo] = $repoConfig;
+ } else {
+ $config['repositories'] = array($repo => $repoConfig) + $config['repositories'];
+ }
});
}
@@ -96,7 +102,7 @@ public function addConfigSetting($name, $value)
{
$authConfig = $this->authConfig;
$this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($authConfig) {
- if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|platform)\.}', $key)) {
+ if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) {
list($key, $host) = explode('.', $key, 2);
if ($authConfig) {
$config[$key][$host] = $val;
@@ -116,7 +122,7 @@ public function removeConfigSetting($name)
{
$authConfig = $this->authConfig;
$this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($authConfig) {
- if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|platform)\.}', $key)) {
+ if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) {
list($key, $host) = explode('.', $key, 2);
if ($authConfig) {
unset($config[$key][$host]);
@@ -135,7 +141,7 @@ public function removeConfigSetting($name)
public function addProperty($name, $value)
{
$this->manipulateJson('addProperty', $name, $value, function (&$config, $key, $val) {
- if (substr($key, 0, 6) === 'extra.' || substr($key, 0, 8) === 'scripts.') {
+ if (strpos($key, 'extra.') === 0 || strpos($key, 'scripts.') === 0) {
$bits = explode('.', $key);
$last = array_pop($bits);
$arr = &$config[reset($bits)];
@@ -157,9 +163,8 @@ public function addProperty($name, $value)
*/
public function removeProperty($name)
{
- $authConfig = $this->authConfig;
$this->manipulateJson('removeProperty', $name, function (&$config, $key) {
- if (substr($key, 0, 6) === 'extra.' || substr($key, 0, 8) === 'scripts.') {
+ if (strpos($key, 'extra.') === 0 || strpos($key, 'scripts.') === 0) {
$bits = explode('.', $key);
$last = array_pop($bits);
$arr = &$config[reset($bits)];
@@ -194,6 +199,11 @@ public function removeLink($type, $name)
$this->manipulateJson('removeSubNode', $type, $name, function (&$config, $type, $name) {
unset($config[$type][$name]);
});
+ $this->manipulateJson('removeMainKeyIfEmpty', $type, function (&$config, $type) {
+ if (0 === count($config[$type])) {
+ unset($config[$type]);
+ }
+ });
}
protected function manipulateJson($method, $args, $fallback)
@@ -208,7 +218,7 @@ protected function manipulateJson($method, $args, $fallback)
throw new \RuntimeException(sprintf('The file "%s" is not writable.', $this->file->getPath()));
}
- if (!is_readable($this->file->getPath())) {
+ if (!Filesystem::isReadable($this->file->getPath())) {
throw new \RuntimeException(sprintf('The file "%s" is not readable.', $this->file->getPath()));
}
@@ -242,9 +252,36 @@ protected function manipulateJson($method, $args, $fallback)
$config = $this->file->read();
$this->arrayUnshiftRef($args, $config);
call_user_func_array($fallback, $args);
+ // avoid ending up with arrays for keys that should be objects
+ foreach (array('require', 'require-dev', 'conflict', 'provide', 'replace', 'suggest', 'config', 'autoload', 'autoload-dev', 'scripts', 'scripts-descriptions', 'support') as $prop) {
+ if (isset($config[$prop]) && $config[$prop] === array()) {
+ $config[$prop] = new \stdClass;
+ }
+ }
+ foreach (array('psr-0', 'psr-4') as $prop) {
+ if (isset($config['autoload'][$prop]) && $config['autoload'][$prop] === array()) {
+ $config['autoload'][$prop] = new \stdClass;
+ }
+ if (isset($config['autoload-dev'][$prop]) && $config['autoload-dev'][$prop] === array()) {
+ $config['autoload-dev'][$prop] = new \stdClass;
+ }
+ }
+ foreach (array('platform', 'http-basic', 'bearer', 'gitlab-token', 'gitlab-oauth', 'github-oauth', 'preferred-install') as $prop) {
+ if (isset($config['config'][$prop]) && $config['config'][$prop] === array()) {
+ $config['config'][$prop] = new \stdClass;
+ }
+ }
$this->file->write($config);
}
+ try {
+ $this->file->validateSchema(JsonFile::LAX_SCHEMA);
+ } catch (JsonValidationException $e) {
+ // restore contents to the original state
+ file_put_contents($this->file->getPath(), $contents);
+ throw new \RuntimeException('Failed to update composer.json with a valid format, reverting to the original content. Please report an issue to us with details (command you run and a copy of your composer.json).', 0, $e);
+ }
+
if ($newFile) {
Silencer::call('chmod', $this->file->getPath(), 0600);
}
@@ -255,7 +292,7 @@ protected function manipulateJson($method, $args, $fallback)
*
* @param array $array
* @param mixed $value
- * @return array
+ * @return int
*/
private function arrayUnshiftRef(&$array, &$value)
{
diff --git a/app/vendor/composer/composer/src/Composer/Console/Application.php b/app/vendor/composer/composer/src/Composer/Console/Application.php
index a7cf26921..bdc9b2a32 100644
--- a/app/vendor/composer/composer/src/Composer/Console/Application.php
+++ b/app/vendor/composer/composer/src/Composer/Console/Application.php
@@ -13,12 +13,17 @@
namespace Composer\Console;
use Composer\IO\NullIO;
+use Composer\Util\Filesystem;
use Composer\Util\Platform;
use Composer\Util\Silencer;
use Symfony\Component\Console\Application as BaseApplication;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Seld\JsonLint\ParsingException;
use Composer\Command;
use Composer\Composer;
use Composer\Factory;
@@ -26,8 +31,11 @@
use Composer\IO\ConsoleIO;
use Composer\Json\JsonValidationException;
use Composer\Util\ErrorHandler;
+use Composer\Util\HttpDownloader;
use Composer\EventDispatcher\ScriptExecutionException;
use Composer\Exception\NoSslException;
+use Composer\XdebugHandler\XdebugHandler;
+use Symfony\Component\Process\Exception\ProcessTimedOutException;
/**
* The console application that handles the commands
@@ -39,7 +47,7 @@
class Application extends BaseApplication
{
/**
- * @var Composer
+ * @var ?Composer
*/
protected $composer;
@@ -48,6 +56,7 @@ class Application extends BaseApplication
*/
protected $io;
+ /** @var string */
private static $logo = ' ______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
@@ -56,16 +65,23 @@ class Application extends BaseApplication
/_/
';
+ /** @var bool */
private $hasPluginCommands = false;
+ /** @var bool */
private $disablePluginsByDefault = false;
+ /**
+ * @var string Store the initial working directory at startup time
+ */
+ private $initialWorkingDirectory;
+
public function __construct()
{
static $shutdownRegistered = false;
if (function_exists('ini_set') && extension_loaded('xdebug')) {
- ini_set('xdebug.show_exception_trace', false);
- ini_set('xdebug.scream', false);
+ ini_set('xdebug.show_exception_trace', '0');
+ ini_set('xdebug.scream', '0');
}
if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) {
@@ -73,6 +89,13 @@ public function __construct()
}
if (!$shutdownRegistered) {
+ if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
+ pcntl_async_signals(true);
+ pcntl_signal(SIGINT, function ($sig) {
+ exit(130);
+ });
+ }
+
$shutdownRegistered = true;
register_shutdown_function(function () {
@@ -88,7 +111,9 @@ public function __construct()
$this->io = new NullIO();
- parent::__construct('Composer', Composer::VERSION);
+ $this->initialWorkingDirectory = getcwd();
+
+ parent::__construct('Composer', Composer::getVersion());
}
/**
@@ -110,13 +135,27 @@ public function doRun(InputInterface $input, OutputInterface $output)
{
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
- $io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
+ if (getenv('COMPOSER_NO_INTERACTION') || !Platform::isTty(defined('STDIN') ? STDIN : fopen('php://stdin', 'r'))) {
+ $input->setInteractive(false);
+ }
+
+ $io = $this->io = new ConsoleIO($input, $output, new HelperSet(array(
+ new QuestionHelper(),
+ )));
+
+ // Register error handler again to pass it the IO instance
ErrorHandler::register($io);
+ if ($input->hasParameterOption('--no-cache')) {
+ $io->writeError('Disabling cache usage', true, IOInterface::DEBUG);
+ Platform::putEnv('COMPOSER_CACHE_DIR', Platform::isWindows() ? 'nul' : '/dev/null');
+ }
+
// switch working dir
if ($newWorkDir = $this->getNewWorkingDir($input)) {
$oldWorkingDir = getcwd();
chdir($newWorkDir);
+ $this->initialWorkingDirectory = $newWorkDir;
$io->writeError('Changed CWD to ' . getcwd(), true, IOInterface::DEBUG);
}
@@ -125,19 +164,22 @@ public function doRun(InputInterface $input, OutputInterface $output)
if ($name = $this->getCommandName($input)) {
try {
$commandName = $this->find($name)->getName();
+ } catch (CommandNotFoundException $e) {
+ // we'll check command validity again later after plugins are loaded
+ $commandName = false;
} catch (\InvalidArgumentException $e) {
}
}
// prompt user for dir change if no composer.json is present in current dir
- if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project'), true) && !file_exists(Factory::getComposerFile())) {
+ if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project', 'outdated'), true) && !file_exists(Factory::getComposerFile())) {
$dir = dirname(getcwd());
$home = realpath(getenv('HOME') ?: getenv('USERPROFILE') ?: '/');
// abort when we reach the home dir or top of the filesystem
while (dirname($dir) !== $dir && $dir !== $home) {
if (file_exists($dir.'/'.Factory::getComposerFile())) {
- if ($io->askConfirmation('No composer.json in current directory, do you want to use the one at '.$dir.'? [Y,n]? ', true)) {
+ if ($io->askConfirmation('No composer.json in current directory, do you want to use the one at '.$dir.'? [Y,n]? ')) {
$oldWorkingDir = getcwd();
chdir($dir);
}
@@ -147,7 +189,17 @@ public function doRun(InputInterface $input, OutputInterface $output)
}
}
- if (!$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
+ // avoid loading plugins/initializing the Composer instance earlier than necessary if no plugin command is needed
+ // if showing the version, we never need plugin commands
+ $mayNeedPluginCommand = false === $input->hasParameterOption(array('--version', '-V'))
+ && (
+ // not a composer command, so try loading plugin ones
+ false === $commandName
+ // list command requires plugin commands to show them
+ || in_array($commandName, array('', 'list'), true)
+ );
+
+ if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
try {
foreach ($this->getPluginCommands() as $command) {
if ($this->has($command->getName())) {
@@ -158,6 +210,20 @@ public function doRun(InputInterface $input, OutputInterface $output)
}
} catch (NoSslException $e) {
// suppress these as they are not relevant at this point
+ } catch (ParsingException $e) {
+ $details = $e->getDetails();
+
+ $file = realpath(Factory::getComposerFile());
+
+ $line = null;
+ if ($details && isset($details['line'])) {
+ $line = $details['line'];
+ }
+
+ $ghe = new GithubActionError($this->io);
+ $ghe->emit($e->getMessage(), $file, $line);
+
+ throw $e;
}
$this->hasPluginCommands = true;
@@ -177,7 +243,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
if (!$isProxyCommand) {
$io->writeError(sprintf(
'Running %s (%s) with %s on %s',
- Composer::VERSION,
+ Composer::getVersion(),
Composer::RELEASE_DATE,
defined('HHVM_VERSION') ? 'HHVM '.HHVM_VERSION : 'PHP '.PHP_VERSION,
function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknown OS'
@@ -187,22 +253,29 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow
$io->writeError('Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.');
}
- if (extension_loaded('xdebug') && !getenv('COMPOSER_DISABLE_XDEBUG_WARN')) {
- $io->writeError('You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug');
+ if (XdebugHandler::isXdebugActive() && !getenv('COMPOSER_DISABLE_XDEBUG_WARN')) {
+ $io->writeError('Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug');
}
if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME) {
- $io->writeError(sprintf('Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.', $_SERVER['PHP_SELF']));
+ $io->writeError(sprintf('Warning: This development build of Composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.', $_SERVER['PHP_SELF']));
}
- if (getenv('COMPOSER_NO_INTERACTION')) {
- $input->setInteractive(false);
- }
-
- if (!Platform::isWindows() && function_exists('exec') && !getenv('COMPOSER_ALLOW_SUPERUSER')) {
+ if (
+ !Platform::isWindows()
+ && function_exists('exec')
+ && !getenv('COMPOSER_ALLOW_SUPERUSER')
+ && (ini_get('open_basedir') || !file_exists('/.dockerenv'))
+ ) {
if (function_exists('posix_getuid') && posix_getuid() === 0) {
if ($commandName !== 'self-update' && $commandName !== 'selfupdate') {
$io->writeError('Do not run Composer as root/super user! See https://getcomposer.org/root for details');
+
+ if ($io->isInteractive()) {
+ if (!$io->askConfirmation('Continue as root/super user [yes]? ')) {
+ return 1;
+ }
+ }
}
if ($uid = (int) getenv('SUDO_UID')) {
// Silently clobber any sudo credentials on the invoking user to avoid privilege escalations later on
@@ -224,7 +297,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow
// add non-standard scripts as own commands
$file = Factory::getComposerFile();
- if (is_file($file) && is_readable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
+ if (is_file($file) && Filesystem::isReadable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {
if (isset($composer['scripts']) && is_array($composer['scripts'])) {
foreach ($composer['scripts'] as $script => $dummy) {
if (!defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {
@@ -253,22 +326,28 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow
$result = parent::doRun($input, $output);
+ // chdir back to $oldWorkingDir if set
if (isset($oldWorkingDir)) {
- chdir($oldWorkingDir);
+ Silencer::call('chdir', $oldWorkingDir);
}
if (isset($startTime)) {
- $io->writeError('Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MB), time: '.round(microtime(true) - $startTime, 2).'s');
+ $io->writeError('Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MiB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MiB), time: '.round(microtime(true) - $startTime, 2).'s');
}
restore_error_handler();
return $result;
} catch (ScriptExecutionException $e) {
- return $e->getCode();
+ return (int) $e->getCode();
} catch (\Exception $e) {
+ $ghe = new GithubActionError($this->io);
+ $ghe->emit($e->getMessage());
+
$this->hintCommonErrors($e);
+
restore_error_handler();
+
throw $e;
}
}
@@ -322,13 +401,25 @@ private function hintCommonErrors($exception)
$io->writeError('The following exception is caused by a lack of memory or swap, or not having swap configured', true, IOInterface::QUIET);
$io->writeError('Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details', true, IOInterface::QUIET);
}
+
+ if ($exception instanceof ProcessTimedOutException) {
+ $io->writeError('The following exception is caused by a process timeout', true, IOInterface::QUIET);
+ $io->writeError('Check https://getcomposer.org/doc/06-config.md#process-timeout for details', true, IOInterface::QUIET);
+ }
+
+ if ($hints = HttpDownloader::getExceptionHints($exception)) {
+ foreach ($hints as $hint) {
+ $io->writeError($hint, true, IOInterface::QUIET);
+ }
+ }
}
/**
* @param bool $required
* @param bool|null $disablePlugins
* @throws JsonValidationException
- * @return \Composer\Composer
+ * @throws \InvalidArgumentException
+ * @return ?\Composer\Composer If $required is true then the return value is guaranteed
*/
public function getComposer($required = true, $disablePlugins = null)
{
@@ -342,12 +433,16 @@ public function getComposer($required = true, $disablePlugins = null)
} catch (\InvalidArgumentException $e) {
if ($required) {
$this->io->writeError($e->getMessage());
- exit(1);
+ // TODO composer 2.3 simplify to $this->areExceptionsCaught()
+ if (!method_exists($this, 'areExceptionsCaught') || $this->areExceptionsCaught()) {
+ exit(1);
+ }
+ throw $e;
}
} catch (JsonValidationException $e) {
- $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors());
- $message = $e->getMessage() . ':' . PHP_EOL . $errors;
- throw new JsonValidationException($message);
+ if ($required) {
+ throw $e;
+ }
}
}
@@ -360,6 +455,9 @@ public function getComposer($required = true, $disablePlugins = null)
public function resetComposer()
{
$this->composer = null;
+ if (method_exists($this->getIO(), 'resetAuthentications')) {
+ $this->getIO()->resetAuthentications();
+ }
}
/**
@@ -407,9 +505,11 @@ protected function getDefaultCommands()
new Command\ExecCommand(),
new Command\OutdatedCommand(),
new Command\CheckPlatformReqsCommand(),
+ new Command\FundCommand(),
+ new Command\ReinstallCommand(),
));
- if ('phar:' === substr(__FILE__, 0, 5)) {
+ if (strpos(__FILE__, 'phar:') === 0) {
$commands[] = new Command\SelfUpdateCommand();
}
@@ -421,7 +521,7 @@ protected function getDefaultCommands()
*/
public function getLongVersion()
{
- if (Composer::BRANCH_ALIAS_VERSION) {
+ if (Composer::BRANCH_ALIAS_VERSION && Composer::BRANCH_ALIAS_VERSION !== '@package_branch_alias_version'.'@') {
return sprintf(
'%s version %s (%s) %s',
$this->getName(),
@@ -443,6 +543,7 @@ protected function getDefaultInputDefinition()
$definition->addOption(new InputOption('--profile', null, InputOption::VALUE_NONE, 'Display timing and memory usage information'));
$definition->addOption(new InputOption('--no-plugins', null, InputOption::VALUE_NONE, 'Whether to disable plugins.'));
$definition->addOption(new InputOption('--working-dir', '-d', InputOption::VALUE_REQUIRED, 'If specified, use the given directory as working directory.'));
+ $definition->addOption(new InputOption('--no-cache', null, InputOption::VALUE_NONE, 'Prevent use of the cache'));
return $definition;
}
@@ -453,7 +554,7 @@ private function getPluginCommands()
$composer = $this->getComposer(false, false);
if (null === $composer) {
- $composer = Factory::createGlobal($this->io, false);
+ $composer = Factory::createGlobal($this->io);
}
if (null !== $composer) {
@@ -474,4 +575,14 @@ private function getPluginCommands()
return $commands;
}
+
+ /**
+ * Get the working directory at startup time
+ *
+ * @return string
+ */
+ public function getInitialWorkingDirectory()
+ {
+ return $this->initialWorkingDirectory;
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php b/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php
new file mode 100644
index 000000000..c862dd9be
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/Console/GithubActionError.php
@@ -0,0 +1,50 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Console;
+
+use Composer\IO\IOInterface;
+
+final class GithubActionError
+{
+ /**
+ * @var IOInterface
+ */
+ protected $io;
+
+ public function __construct(IOInterface $io)
+ {
+ $this->io = $io;
+ }
+
+ /**
+ * @param string $message
+ * @param null|string $file
+ * @param null|int $line
+ */
+ public function emit($message, $file = null, $line = null)
+ {
+ if (getenv('GITHUB_ACTIONS') && !getenv('COMPOSER_TESTS_ARE_RUNNING')) {
+ // newlines need to be encoded
+ // see https://github.com/actions/starter-workflows/issues/68#issuecomment-581479448
+ $message = str_replace("\n", '%0A', $message);
+
+ if ($file && $line) {
+ $this->io->write("::error file=". $file .",line=". $line ."::". $message);
+ } elseif ($file) {
+ $this->io->write("::error file=". $file ."::". $message);
+ } else {
+ $this->io->write("::error ::". $message);
+ }
+ }
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php
index 994fcbcd5..acef97325 100644
--- a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php
+++ b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php
@@ -19,6 +19,7 @@
*/
class HtmlOutputFormatter extends OutputFormatter
{
+ /** @var array */
private static $availableForegroundColors = array(
30 => 'black',
31 => 'red',
@@ -29,6 +30,7 @@ class HtmlOutputFormatter extends OutputFormatter
36 => 'cyan',
37 => 'white',
);
+ /** @var array */
private static $availableBackgroundColors = array(
40 => 'black',
41 => 'red',
@@ -39,6 +41,7 @@ class HtmlOutputFormatter extends OutputFormatter
46 => 'cyan',
47 => 'white',
);
+ /** @var array */
private static $availableOptions = array(
1 => 'bold',
4 => 'underscore',
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php
index a9808e60e..799a0a1fa 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php
@@ -16,17 +16,21 @@
* Stores decisions on installing, removing or keeping packages
*
* @author Nils Adermann
+ * @implements \Iterator
*/
class Decisions implements \Iterator, \Countable
{
const DECISION_LITERAL = 0;
const DECISION_REASON = 1;
+ /** @var Pool */
protected $pool;
+ /** @var array */
protected $decisionMap;
+ /** @var array */
protected $decisionQueue = array();
- public function __construct($pool)
+ public function __construct(Pool $pool)
{
$this->pool = $pool;
$this->decisionMap = array();
@@ -108,17 +112,17 @@ public function atOffset($queueOffset)
public function validOffset($queueOffset)
{
- return $queueOffset >= 0 && $queueOffset < count($this->decisionQueue);
+ return $queueOffset >= 0 && $queueOffset < \count($this->decisionQueue);
}
public function lastReason()
{
- return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_REASON];
+ return $this->decisionQueue[\count($this->decisionQueue) - 1][self::DECISION_REASON];
}
public function lastLiteral()
{
- return $this->decisionQueue[count($this->decisionQueue) - 1][self::DECISION_LITERAL];
+ return $this->decisionQueue[\count($this->decisionQueue) - 1][self::DECISION_LITERAL];
}
public function reset()
@@ -130,7 +134,7 @@ public function reset()
public function resetToOffset($offset)
{
- while (count($this->decisionQueue) > $offset + 1) {
+ while (\count($this->decisionQueue) > $offset + 1) {
$decision = array_pop($this->decisionQueue);
$this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;
}
@@ -142,31 +146,37 @@ public function revertLast()
array_pop($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function count()
{
- return count($this->decisionQueue);
+ return \count($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function rewind()
{
end($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function current()
{
return current($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function key()
{
return key($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function next()
{
- return prev($this->decisionQueue);
+ prev($this->decisionQueue);
}
+ #[\ReturnTypeWillChange]
public function valid()
{
return false !== current($this->decisionQueue);
@@ -174,7 +184,7 @@ public function valid()
public function isEmpty()
{
- return count($this->decisionQueue) === 0;
+ return \count($this->decisionQueue) === 0;
}
protected function addDecision($literal, $level)
@@ -183,7 +193,7 @@ protected function addDecision($literal, $level)
$previousDecision = isset($this->decisionMap[$packageId]) ? $this->decisionMap[$packageId] : null;
if ($previousDecision != 0) {
- $literalString = $this->pool->literalToString($literal);
+ $literalString = $this->pool->literalToPrettyString($literal, array());
$package = $this->pool->literalToPackage($literal);
throw new SolverBugException(
"Trying to decide $literalString on level $level, even though $package was previously decided as ".(int) $previousDecision."."
@@ -196,4 +206,22 @@ protected function addDecision($literal, $level)
$this->decisionMap[$packageId] = -$level;
}
}
+
+ public function toString(Pool $pool = null)
+ {
+ $decisionMap = $this->decisionMap;
+ ksort($decisionMap);
+ $str = '[';
+ foreach ($decisionMap as $packageId => $level) {
+ $str .= (($pool) ? $pool->literalToPackage($packageId) : $packageId).':'.$level.',';
+ }
+ $str .= ']';
+
+ return $str;
+ }
+
+ public function __toString()
+ {
+ return $this->toString();
+ }
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php
index 542c6e625..832a009e5 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php
@@ -12,9 +12,9 @@
namespace Composer\DependencyResolver;
-use Composer\Package\PackageInterface;
use Composer\Package\AliasPackage;
use Composer\Package\BasePackage;
+use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
/**
@@ -23,7 +23,9 @@
*/
class DefaultPolicy implements PolicyInterface
{
+ /** @var bool */
private $preferStable;
+ /** @var bool */
private $preferLowest;
public function __construct($preferStable = false, $preferLowest = false)
@@ -44,54 +46,33 @@ public function versionCompare(PackageInterface $a, PackageInterface $b, $operat
return $constraint->matchSpecific($version, true);
}
- public function findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package, $mustMatchName = false)
- {
- $packages = array();
-
- foreach ($pool->whatProvides($package->getName(), null, $mustMatchName) as $candidate) {
- if ($candidate !== $package) {
- $packages[] = $candidate;
- }
- }
-
- return $packages;
- }
-
- public function getPriority(Pool $pool, PackageInterface $package)
- {
- return $pool->getPriority($package->getRepository());
- }
-
- public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)
+ public function selectPreferredPackages(Pool $pool, array $literals, $requiredPackage = null)
{
- $packages = $this->groupLiteralsByNamePreferInstalled($pool, $installedMap, $literals);
+ $packages = $this->groupLiteralsByName($pool, $literals);
+ $policy = $this;
- foreach ($packages as &$literals) {
- $policy = $this;
- usort($literals, function ($a, $b) use ($policy, $pool, $installedMap, $requiredPackage) {
- return $policy->compareByPriorityPreferInstalled($pool, $installedMap, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage, true);
+ foreach ($packages as &$nameLiterals) {
+ usort($nameLiterals, function ($a, $b) use ($policy, $pool, $requiredPackage) {
+ return $policy->compareByPriority($pool, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage, true);
});
}
- foreach ($packages as &$literals) {
- $literals = $this->pruneToHighestPriorityOrInstalled($pool, $installedMap, $literals);
-
- $literals = $this->pruneToBestVersion($pool, $literals);
-
- $literals = $this->pruneRemoteAliases($pool, $literals);
+ foreach ($packages as &$sortedLiterals) {
+ $sortedLiterals = $this->pruneToBestVersion($pool, $sortedLiterals);
+ $sortedLiterals = $this->pruneRemoteAliases($pool, $sortedLiterals);
}
- $selected = call_user_func_array('array_merge', $packages);
+ $selected = \call_user_func_array('array_merge', array_values($packages));
// now sort the result across all packages to respect replaces across packages
- usort($selected, function ($a, $b) use ($policy, $pool, $installedMap, $requiredPackage) {
- return $policy->compareByPriorityPreferInstalled($pool, $installedMap, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage);
+ usort($selected, function ($a, $b) use ($policy, $pool, $requiredPackage) {
+ return $policy->compareByPriority($pool, $pool->literalToPackage($a), $pool->literalToPackage($b), $requiredPackage);
});
return $selected;
}
- protected function groupLiteralsByNamePreferInstalled(Pool $pool, array $installedMap, $literals)
+ protected function groupLiteralsByName(Pool $pool, $literals)
{
$packages = array();
foreach ($literals as $literal) {
@@ -100,12 +81,7 @@ protected function groupLiteralsByNamePreferInstalled(Pool $pool, array $install
if (!isset($packages[$packageName])) {
$packages[$packageName] = array();
}
-
- if (isset($installedMap[abs($literal)])) {
- array_unshift($packages[$packageName], $literal);
- } else {
- $packages[$packageName][] = $literal;
- }
+ $packages[$packageName][] = $literal;
}
return $packages;
@@ -114,61 +90,49 @@ protected function groupLiteralsByNamePreferInstalled(Pool $pool, array $install
/**
* @protected
*/
- public function compareByPriorityPreferInstalled(Pool $pool, array $installedMap, PackageInterface $a, PackageInterface $b, $requiredPackage = null, $ignoreReplace = false)
+ public function compareByPriority(Pool $pool, BasePackage $a, BasePackage $b, $requiredPackage = null, $ignoreReplace = false)
{
- if ($a->getRepository() === $b->getRepository()) {
- // prefer aliases to the original package
- if ($a->getName() === $b->getName()) {
- $aAliased = $a instanceof AliasPackage;
- $bAliased = $b instanceof AliasPackage;
- if ($aAliased && !$bAliased) {
- return -1; // use a
- }
- if (!$aAliased && $bAliased) {
- return 1; // use b
- }
+ // prefer aliases to the original package
+ if ($a->getName() === $b->getName()) {
+ $aAliased = $a instanceof AliasPackage;
+ $bAliased = $b instanceof AliasPackage;
+ if ($aAliased && !$bAliased) {
+ return -1; // use a
+ }
+ if (!$aAliased && $bAliased) {
+ return 1; // use b
}
+ }
- if (!$ignoreReplace) {
- // return original, not replaced
- if ($this->replaces($a, $b)) {
- return 1; // use b
- }
- if ($this->replaces($b, $a)) {
- return -1; // use a
- }
+ if (!$ignoreReplace) {
+ // return original, not replaced
+ if ($this->replaces($a, $b)) {
+ return 1; // use b
+ }
+ if ($this->replaces($b, $a)) {
+ return -1; // use a
+ }
- // for replacers not replacing each other, put a higher prio on replacing
- // packages with the same vendor as the required package
- if ($requiredPackage && false !== ($pos = strpos($requiredPackage, '/'))) {
- $requiredVendor = substr($requiredPackage, 0, $pos);
+ // for replacers not replacing each other, put a higher prio on replacing
+ // packages with the same vendor as the required package
+ if ($requiredPackage && false !== ($pos = strpos($requiredPackage, '/'))) {
+ $requiredVendor = substr($requiredPackage, 0, $pos);
- $aIsSameVendor = substr($a->getName(), 0, $pos) === $requiredVendor;
- $bIsSameVendor = substr($b->getName(), 0, $pos) === $requiredVendor;
+ $aIsSameVendor = strpos($a->getName(), $requiredVendor) === 0;
+ $bIsSameVendor = strpos($b->getName(), $requiredVendor) === 0;
- if ($bIsSameVendor !== $aIsSameVendor) {
- return $aIsSameVendor ? -1 : 1;
- }
+ if ($bIsSameVendor !== $aIsSameVendor) {
+ return $aIsSameVendor ? -1 : 1;
}
}
-
- // priority equal, sort by package id to make reproducible
- if ($a->id === $b->id) {
- return 0;
- }
-
- return ($a->id < $b->id) ? -1 : 1;
- }
-
- if (isset($installedMap[$a->id])) {
- return -1;
}
- if (isset($installedMap[$b->id])) {
- return 1;
+ // priority equal, sort by package id to make reproducible
+ if ($a->id === $b->id) {
+ return 0;
}
- return ($this->getPriority($pool, $a) > $this->getPriority($pool, $b)) ? -1 : 1;
+ return ($a->id < $b->id) ? -1 : 1;
}
/**
@@ -177,11 +141,11 @@ public function compareByPriorityPreferInstalled(Pool $pool, array $installedMap
* Replace constraints are ignored. This method should only be used for
* prioritisation, not for actual constraint verification.
*
- * @param PackageInterface $source
- * @param PackageInterface $target
+ * @param BasePackage $source
+ * @param BasePackage $target
* @return bool
*/
- protected function replaces(PackageInterface $source, PackageInterface $target)
+ protected function replaces(BasePackage $source, BasePackage $target)
{
foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName()
@@ -218,37 +182,6 @@ protected function pruneToBestVersion(Pool $pool, $literals)
return $bestLiterals;
}
- /**
- * Assumes that installed packages come first and then all highest priority packages
- */
- protected function pruneToHighestPriorityOrInstalled(Pool $pool, array $installedMap, array $literals)
- {
- $selected = array();
-
- $priority = null;
-
- foreach ($literals as $literal) {
- $package = $pool->literalToPackage($literal);
-
- if (isset($installedMap[$package->id])) {
- $selected[] = $literal;
- continue;
- }
-
- if (null === $priority) {
- $priority = $this->getPriority($pool, $package);
- }
-
- if ($this->getPriority($pool, $package) != $priority) {
- break;
- }
-
- $selected[] = $literal;
- }
-
- return $selected;
- }
-
/**
* Assumes that locally aliased (in root package requires) packages take priority over branch-alias ones
*
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php
index df8a2a003..61d95275f 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php
@@ -12,25 +12,24 @@
namespace Composer\DependencyResolver;
-use Composer\Package\PackageInterface;
+use Composer\Package\BasePackage;
use Composer\Package\Link;
+use Composer\Semver\Constraint\ConstraintInterface;
/**
* @author Nils Adermann
*/
class GenericRule extends Rule
{
+ /** @var int[] */
protected $literals;
/**
- * @param array $literals
- * @param int $reason A RULE_* constant describing the reason for generating this rule
- * @param Link|PackageInterface $reasonData
- * @param array $job The job this rule was created from
+ * @param int[] $literals
*/
- public function __construct(array $literals, $reason, $reasonData, $job = null)
+ public function __construct(array $literals, $reason, $reasonData)
{
- parent::__construct($reason, $reasonData, $job);
+ parent::__construct($reason, $reasonData);
// sort all packages ascending by id
sort($literals);
@@ -65,7 +64,7 @@ public function equals(Rule $rule)
public function isAssertion()
{
- return 1 === count($this->literals);
+ return 1 === \count($this->literals);
}
/**
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/LocalRepoTransaction.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/LocalRepoTransaction.php
new file mode 100644
index 000000000..daefc12b9
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/LocalRepoTransaction.php
@@ -0,0 +1,30 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\DependencyResolver;
+
+use Composer\Repository\RepositoryInterface;
+
+/**
+ * @author Nils Adermann
+ * @internal
+ */
+class LocalRepoTransaction extends Transaction
+{
+ public function __construct(RepositoryInterface $lockedRepository, $localRepository)
+ {
+ parent::__construct(
+ $localRepository->getPackages(),
+ $lockedRepository->getPackages()
+ );
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php
new file mode 100644
index 000000000..3a3d94505
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php
@@ -0,0 +1,148 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\DependencyResolver;
+
+use Composer\Package\AliasPackage;
+use Composer\Package\BasePackage;
+use Composer\Package\Package;
+
+/**
+ * @author Nils Adermann
+ * @internal
+ */
+class LockTransaction extends Transaction
+{
+ /**
+ * packages in current lock file, platform repo or otherwise present
+ *
+ * Indexed by spl_object_hash
+ *
+ * @var array
+ */
+ protected $presentMap;
+
+ /**
+ * Packages which cannot be mapped, platform repo, root package, other fixed repos
+ *
+ * Indexed by package id
+ *
+ * @var array
+ */
+ protected $unlockableMap;
+
+ /**
+ * @var array{dev: BasePackage[], non-dev: BasePackage[], all: BasePackage[]}
+ */
+ protected $resultPackages;
+
+ /**
+ * @param array $presentMap
+ * @param array $unlockableMap
+ */
+ public function __construct(Pool $pool, array $presentMap, array $unlockableMap, Decisions $decisions)
+ {
+ $this->presentMap = $presentMap;
+ $this->unlockableMap = $unlockableMap;
+
+ $this->setResultPackages($pool, $decisions);
+ parent::__construct($this->presentMap, $this->resultPackages['all']);
+ }
+
+ // TODO make this a bit prettier instead of the two text indexes?
+ public function setResultPackages(Pool $pool, Decisions $decisions)
+ {
+ $this->resultPackages = array('all' => array(), 'non-dev' => array(), 'dev' => array());
+ foreach ($decisions as $i => $decision) {
+ $literal = $decision[Decisions::DECISION_LITERAL];
+
+ if ($literal > 0) {
+ $package = $pool->literalToPackage($literal);
+
+ $this->resultPackages['all'][] = $package;
+ if (!isset($this->unlockableMap[$package->id])) {
+ $this->resultPackages['non-dev'][] = $package;
+ }
+ }
+ }
+ }
+
+ public function setNonDevPackages(LockTransaction $extractionResult)
+ {
+ $packages = $extractionResult->getNewLockPackages(false);
+
+ $this->resultPackages['dev'] = $this->resultPackages['non-dev'];
+ $this->resultPackages['non-dev'] = array();
+
+ foreach ($packages as $package) {
+ foreach ($this->resultPackages['dev'] as $i => $resultPackage) {
+ // TODO this comparison is probably insufficient, aliases, what about modified versions? I guess they aren't possible?
+ if ($package->getName() == $resultPackage->getName()) {
+ $this->resultPackages['non-dev'][] = $resultPackage;
+ unset($this->resultPackages['dev'][$i]);
+ }
+ }
+ }
+ }
+
+ // TODO additionalFixedRepository needs to be looked at here as well?
+ public function getNewLockPackages($devMode, $updateMirrors = false)
+ {
+ $packages = array();
+ foreach ($this->resultPackages[$devMode ? 'dev' : 'non-dev'] as $package) {
+ if (!$package instanceof AliasPackage) {
+ // if we're just updating mirrors we need to reset references to the same as currently "present" packages' references to keep the lock file as-is
+ // we do not reset references if the currently present package didn't have any, or if the type of VCS has changed
+ if ($updateMirrors && !isset($this->presentMap[spl_object_hash($package)])) {
+ foreach ($this->presentMap as $presentPackage) {
+ if ($package->getName() == $presentPackage->getName() && $package->getVersion() == $presentPackage->getVersion()) {
+ if ($presentPackage->getSourceReference() && $presentPackage->getSourceType() === $package->getSourceType()) {
+ $package->setSourceDistReferences($presentPackage->getSourceReference());
+ }
+ if ($presentPackage->getReleaseDate() && $package instanceof Package) {
+ $package->setReleaseDate($presentPackage->getReleaseDate());
+ }
+ }
+ }
+ }
+ $packages[] = $package;
+ }
+ }
+
+ return $packages;
+ }
+
+ /**
+ * Checks which of the given aliases from composer.json are actually in use for the lock file
+ */
+ public function getAliases($aliases)
+ {
+ $usedAliases = array();
+
+ foreach ($this->resultPackages['all'] as $package) {
+ if ($package instanceof AliasPackage) {
+ foreach ($aliases as $index => $alias) {
+ if ($alias['package'] === $package->getName()) {
+ $usedAliases[] = $alias;
+ unset($aliases[$index]);
+ }
+ }
+ }
+ }
+
+ usort($usedAliases, function ($a, $b) {
+ return strcmp($a['package'], $b['package']);
+ });
+
+ return $usedAliases;
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php
new file mode 100644
index 000000000..16a7bd9e2
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php
@@ -0,0 +1,105 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\DependencyResolver;
+
+use Composer\Package\BasePackage;
+use Composer\Package\Link;
+
+/**
+ * @author Nils Adermann
+ *
+ * MultiConflictRule([A, B, C]) acts as Rule([-A, -B]), Rule([-A, -C]), Rule([-B, -C])
+ */
+class MultiConflictRule extends Rule
+{
+ /** @var int[] */
+ protected $literals;
+
+ /**
+ * @param int[] $literals
+ */
+ public function __construct(array $literals, $reason, $reasonData)
+ {
+ parent::__construct($reason, $reasonData);
+
+ if (\count($literals) < 3) {
+ throw new \RuntimeException("multi conflict rule requires at least 3 literals");
+ }
+
+ // sort all packages ascending by id
+ sort($literals);
+
+ $this->literals = $literals;
+ }
+
+ public function getLiterals()
+ {
+ return $this->literals;
+ }
+
+ public function getHash()
+ {
+ $data = unpack('ihash', md5('c:'.implode(',', $this->literals), true));
+
+ return $data['hash'];
+ }
+
+ /**
+ * Checks if this rule is equal to another one
+ *
+ * Ignores whether either of the rules is disabled.
+ *
+ * @param Rule $rule The rule to check against
+ * @return bool Whether the rules are equal
+ */
+ public function equals(Rule $rule)
+ {
+ if ($rule instanceof MultiConflictRule) {
+ return $this->literals === $rule->getLiterals();
+ }
+
+ return false;
+ }
+
+ public function isAssertion()
+ {
+ return false;
+ }
+
+ public function disable()
+ {
+ throw new \RuntimeException("Disabling multi conflict rules is not possible. Please contact composer at https://github.com/composer/composer to let us debug what lead to this situation.");
+ }
+
+ /**
+ * Formats a rule as a string of the format (Literal1|Literal2|...)
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // TODO multi conflict?
+ $result = $this->isDisabled() ? 'disabled(multi(' : '(multi(';
+
+ foreach ($this->literals as $i => $literal) {
+ if ($i != 0) {
+ $result .= '|';
+ }
+ $result .= $literal;
+ }
+
+ $result .= '))';
+
+ return $result;
+ }
+}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/InstallOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/InstallOperation.php
index 08c659c49..6eefbd5bb 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/InstallOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/InstallOperation.php
@@ -19,20 +19,17 @@
*
* @author Konstantin Kudryashov
*/
-class InstallOperation extends SolverOperation
+class InstallOperation extends SolverOperation implements OperationInterface
{
- protected $package;
+ const TYPE = 'install';
/**
- * Initializes operation.
- *
- * @param PackageInterface $package package instance
- * @param string $reason operation reason
+ * @var PackageInterface
*/
- public function __construct(PackageInterface $package, $reason = null)
- {
- parent::__construct($reason);
+ protected $package;
+ public function __construct(PackageInterface $package)
+ {
$this->package = $package;
}
@@ -47,20 +44,15 @@ public function getPackage()
}
/**
- * Returns job type.
- *
- * @return string
+ * {@inheritDoc}
*/
- public function getJobType()
+ public function show($lock)
{
- return 'install';
+ return self::format($this->package, $lock);
}
- /**
- * {@inheritDoc}
- */
- public function __toString()
+ public static function format(PackageInterface $package, $lock = false)
{
- return 'Installing '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
+ return ($lock ? 'Locking ' : 'Installing ').''.$package->getPrettyName().' ('.$package->getFullPrettyVersion().')';
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php
index 920e54e67..a1aa1219f 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php
@@ -13,55 +13,41 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\AliasPackage;
-use Composer\Package\PackageInterface;
/**
* Solver install operation.
*
* @author Nils Adermann
*/
-class MarkAliasInstalledOperation extends SolverOperation
+class MarkAliasInstalledOperation extends SolverOperation implements OperationInterface
{
- protected $package;
+ const TYPE = 'markAliasInstalled';
/**
- * Initializes operation.
- *
- * @param AliasPackage $package package instance
- * @param string $reason operation reason
+ * @var AliasPackage
*/
- public function __construct(AliasPackage $package, $reason = null)
- {
- parent::__construct($reason);
+ protected $package;
+ public function __construct(AliasPackage $package)
+ {
$this->package = $package;
}
/**
* Returns package instance.
*
- * @return PackageInterface
+ * @return AliasPackage
*/
public function getPackage()
{
return $this->package;
}
- /**
- * Returns job type.
- *
- * @return string
- */
- public function getJobType()
- {
- return 'markAliasInstalled';
- }
-
/**
* {@inheritDoc}
*/
- public function __toString()
+ public function show($lock)
{
- return 'Marking '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).') as installed, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->formatVersion($this->package->getAliasOf()).')';
+ return 'Marking '.$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().') as installed, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->package->getAliasOf()->getFullPrettyVersion().')';
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php
index 77f3aef8c..d0c193478 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php
@@ -13,55 +13,41 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\AliasPackage;
-use Composer\Package\PackageInterface;
/**
* Solver install operation.
*
* @author Nils Adermann
*/
-class MarkAliasUninstalledOperation extends SolverOperation
+class MarkAliasUninstalledOperation extends SolverOperation implements OperationInterface
{
- protected $package;
+ const TYPE = 'markAliasUninstalled';
/**
- * Initializes operation.
- *
- * @param AliasPackage $package package instance
- * @param string $reason operation reason
+ * @var AliasPackage
*/
- public function __construct(AliasPackage $package, $reason = null)
- {
- parent::__construct($reason);
+ protected $package;
+ public function __construct(AliasPackage $package)
+ {
$this->package = $package;
}
/**
* Returns package instance.
*
- * @return PackageInterface
+ * @return AliasPackage
*/
public function getPackage()
{
return $this->package;
}
- /**
- * Returns job type.
- *
- * @return string
- */
- public function getJobType()
- {
- return 'markAliasUninstalled';
- }
-
/**
* {@inheritDoc}
*/
- public function __toString()
+ public function show($lock)
{
- return 'Marking '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).') as uninstalled, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->formatVersion($this->package->getAliasOf()).')';
+ return 'Marking '.$this->package->getPrettyName().' ('.$this->package->getFullPrettyVersion().') as uninstalled, alias of '.$this->package->getAliasOf()->getPrettyName().' ('.$this->package->getAliasOf()->getFullPrettyVersion().')';
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/OperationInterface.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/OperationInterface.php
index 330cbceb1..b0cc29b6d 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/OperationInterface.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/OperationInterface.php
@@ -20,18 +20,19 @@
interface OperationInterface
{
/**
- * Returns job type.
+ * Returns operation type.
*
* @return string
*/
- public function getJobType();
+ public function getOperationType();
/**
- * Returns operation reason.
+ * Serializes the operation in a human readable format
*
+ * @param bool $lock Whether this is an operation on the lock file
* @return string
*/
- public function getReason();
+ public function show($lock);
/**
* Serializes the operation in a human readable format
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php
index e1a68585e..7ab87fe8a 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/SolverOperation.php
@@ -12,39 +12,30 @@
namespace Composer\DependencyResolver\Operation;
-use Composer\Package\PackageInterface;
-
/**
- * Abstract solver operation class.
+ * Abstract operation class.
*
- * @author Konstantin Kudryashov
+ * @author Aleksandr Bezpiatov
*/
abstract class SolverOperation implements OperationInterface
{
- protected $reason;
+ const TYPE = null;
/**
- * Initializes operation.
+ * Returns operation type.
*
- * @param string $reason operation reason
+ * @return string
*/
- public function __construct($reason = null)
+ public function getOperationType()
{
- $this->reason = $reason;
+ return static::TYPE;
}
/**
- * Returns operation reason.
- *
- * @return string
+ * {@inheritDoc}
*/
- public function getReason()
- {
- return $this->reason;
- }
-
- protected function formatVersion(PackageInterface $package)
+ public function __toString()
{
- return $package->getFullPrettyVersion();
+ return $this->show(false);
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php
index b4a73811e..585fdb1e5 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UninstallOperation.php
@@ -19,20 +19,17 @@
*
* @author Konstantin Kudryashov
*/
-class UninstallOperation extends SolverOperation
+class UninstallOperation extends SolverOperation implements OperationInterface
{
- protected $package;
+ const TYPE = 'uninstall';
/**
- * Initializes operation.
- *
- * @param PackageInterface $package package instance
- * @param string $reason operation reason
+ * @var PackageInterface
*/
- public function __construct(PackageInterface $package, $reason = null)
- {
- parent::__construct($reason);
+ protected $package;
+ public function __construct(PackageInterface $package)
+ {
$this->package = $package;
}
@@ -47,20 +44,15 @@ public function getPackage()
}
/**
- * Returns job type.
- *
- * @return string
+ * {@inheritDoc}
*/
- public function getJobType()
+ public function show($lock)
{
- return 'uninstall';
+ return self::format($this->package, $lock);
}
- /**
- * {@inheritDoc}
- */
- public function __toString()
+ public static function format(PackageInterface $package, $lock = false)
{
- return 'Uninstalling '.$this->package->getPrettyName().' ('.$this->formatVersion($this->package).')';
+ return 'Removing '.$package->getPrettyName().' ('.$package->getFullPrettyVersion().')';
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php
index 836725ef5..543c8e783 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Operation/UpdateOperation.php
@@ -13,28 +13,33 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\PackageInterface;
+use Composer\Package\Version\VersionParser;
/**
* Solver update operation.
*
* @author Konstantin Kudryashov
*/
-class UpdateOperation extends SolverOperation
+class UpdateOperation extends SolverOperation implements OperationInterface
{
+ const TYPE = 'update';
+
+ /**
+ * @var PackageInterface
+ */
protected $initialPackage;
+
+ /**
+ * @var PackageInterface
+ */
protected $targetPackage;
/**
- * Initializes update operation.
- *
* @param PackageInterface $initial initial package
* @param PackageInterface $target target package (updated)
- * @param string $reason update reason
*/
- public function __construct(PackageInterface $initial, PackageInterface $target, $reason = null)
+ public function __construct(PackageInterface $initial, PackageInterface $target)
{
- parent::__construct($reason);
-
$this->initialPackage = $initial;
$this->targetPackage = $target;
}
@@ -60,21 +65,28 @@ public function getTargetPackage()
}
/**
- * Returns job type.
- *
- * @return string
+ * {@inheritDoc}
*/
- public function getJobType()
+ public function show($lock)
{
- return 'update';
+ return self::format($this->initialPackage, $this->targetPackage, $lock);
}
- /**
- * {@inheritDoc}
- */
- public function __toString()
+ public static function format(PackageInterface $initialPackage, PackageInterface $targetPackage, $lock = false)
{
- return 'Updating '.$this->initialPackage->getPrettyName().' ('.$this->formatVersion($this->initialPackage).') to '.
- $this->targetPackage->getPrettyName(). ' ('.$this->formatVersion($this->targetPackage).')';
+ $fromVersion = $initialPackage->getFullPrettyVersion();
+ $toVersion = $targetPackage->getFullPrettyVersion();
+
+ if ($fromVersion === $toVersion && $initialPackage->getSourceReference() !== $targetPackage->getSourceReference()) {
+ $fromVersion = $initialPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_SOURCE_REF);
+ $toVersion = $targetPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_SOURCE_REF);
+ } elseif ($fromVersion === $toVersion && $initialPackage->getDistReference() !== $targetPackage->getDistReference()) {
+ $fromVersion = $initialPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_DIST_REF);
+ $toVersion = $targetPackage->getFullPrettyVersion(true, PackageInterface::DISPLAY_DIST_REF);
+ }
+
+ $actionName = VersionParser::isUpgrade($initialPackage->getVersion(), $targetPackage->getVersion()) ? 'Upgrading' : 'Downgrading';
+
+ return $actionName.' '.$initialPackage->getPrettyName().' ('.$fromVersion.' => '.$toVersion.')';
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php
index 3464bd594..b10a43e9f 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php
@@ -21,7 +21,5 @@ interface PolicyInterface
{
public function versionCompare(PackageInterface $a, PackageInterface $b, $operator);
- public function findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package);
-
- public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null);
+ public function selectPreferredPackages(Pool $pool, array $literals, $requiredPackage = null);
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php
index 3dc6d90be..733b0edf5 100644
--- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php
@@ -12,148 +12,66 @@
namespace Composer\DependencyResolver;
-use Composer\Package\BasePackage;
-use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser;
+use Composer\Semver\CompilingMatcher;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint;
-use Composer\Semver\Constraint\EmptyConstraint;
-use Composer\Repository\RepositoryInterface;
-use Composer\Repository\CompositeRepository;
-use Composer\Repository\ComposerRepository;
-use Composer\Repository\InstalledRepositoryInterface;
-use Composer\Repository\PlatformRepository;
-use Composer\Package\PackageInterface;
+use Composer\Package\BasePackage;
/**
- * A package pool contains repositories that provide packages.
+ * A package pool contains all packages for dependency resolution
*
* @author Nils Adermann
* @author Jordi Boggiano
*/
class Pool implements \Countable
{
- const MATCH_NAME = -1;
- const MATCH_NONE = 0;
- const MATCH = 1;
- const MATCH_PROVIDE = 2;
- const MATCH_REPLACE = 3;
- const MATCH_FILTERED = 4;
-
- protected $repositories = array();
- protected $providerRepos = array();
+ /** @var BasePackage[] */
protected $packages = array();
+ /** @var array */
protected $packageByName = array();
- protected $packageByExactName = array();
- protected $acceptableStabilities;
- protected $stabilityFlags;
+ /** @var VersionParser */
protected $versionParser;
+ /** @var array> */
protected $providerCache = array();
- protected $filterRequires;
- protected $whitelist = null;
- protected $id = 1;
+ /** @var BasePackage[] */
+ protected $unacceptableFixedOrLockedPackages;
- public function __construct($minimumStability = 'stable', array $stabilityFlags = array(), array $filterRequires = array())
+ public function __construct(array $packages = array(), array $unacceptableFixedOrLockedPackages = array())
{
$this->versionParser = new VersionParser;
- $this->acceptableStabilities = array();
- foreach (BasePackage::$stabilities as $stability => $value) {
- if ($value <= BasePackage::$stabilities[$minimumStability]) {
- $this->acceptableStabilities[$stability] = $value;
- }
- }
- $this->stabilityFlags = $stabilityFlags;
- $this->filterRequires = $filterRequires;
- foreach ($filterRequires as $name => $constraint) {
- if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name)) {
- unset($this->filterRequires[$name]);
- }
- }
+ $this->setPackages($packages);
+ $this->unacceptableFixedOrLockedPackages = $unacceptableFixedOrLockedPackages;
}
- public function setWhitelist($whitelist)
+ private function setPackages(array $packages)
{
- $this->whitelist = $whitelist;
- $this->providerCache = array();
- }
+ $id = 1;
- /**
- * Adds a repository and its packages to this package pool
- *
- * @param RepositoryInterface $repo A package repository
- * @param array $rootAliases
- */
- public function addRepository(RepositoryInterface $repo, $rootAliases = array())
- {
- if ($repo instanceof CompositeRepository) {
- $repos = $repo->getRepositories();
- } else {
- $repos = array($repo);
- }
+ foreach ($packages as $package) {
+ $this->packages[] = $package;
- foreach ($repos as $repo) {
- $this->repositories[] = $repo;
-
- $exempt = $repo instanceof PlatformRepository || $repo instanceof InstalledRepositoryInterface;
-
- if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
- $this->providerRepos[] = $repo;
- $repo->setRootAliases($rootAliases);
- $repo->resetPackageIds();
- } else {
- foreach ($repo->getPackages() as $package) {
- $names = $package->getNames();
- $stability = $package->getStability();
- if ($exempt || $this->isPackageAcceptable($names, $stability)) {
- $package->setId($this->id++);
- $this->packages[] = $package;
- $this->packageByExactName[$package->getName()][$package->id] = $package;
-
- foreach ($names as $provided) {
- $this->packageByName[$provided][] = $package;
- }
-
- // handle root package aliases
- $name = $package->getName();
- if (isset($rootAliases[$name][$package->getVersion()])) {
- $alias = $rootAliases[$name][$package->getVersion()];
- if ($package instanceof AliasPackage) {
- $package = $package->getAliasOf();
- }
- $aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']);
- $aliasPackage->setRootPackageAlias(true);
- $aliasPackage->setId($this->id++);
-
- $package->getRepository()->addPackage($aliasPackage);
- $this->packages[] = $aliasPackage;
- $this->packageByExactName[$aliasPackage->getName()][$aliasPackage->id] = $aliasPackage;
-
- foreach ($aliasPackage->getNames() as $name) {
- $this->packageByName[$name][] = $aliasPackage;
- }
- }
- }
- }
+ $package->id = $id++;
+
+ foreach ($package->getNames() as $provided) {
+ $this->packageByName[$provided][] = $package;
}
}
}
- public function getPriority(RepositoryInterface $repo)
+ /**
+ * @return BasePackage[]
+ */
+ public function getPackages()
{
- $priority = array_search($repo, $this->repositories, true);
-
- if (false === $priority) {
- throw new \RuntimeException("Could not determine repository priority. The repository was not registered in the pool.");
- }
-
- return -$priority;
+ return $this->packages;
}
/**
* Retrieves the package object for a given package id.
*
- * @param int $id
- * @return PackageInterface
+ * @param int $id
+ * @return BasePackage
*/
public function packageById($id)
{
@@ -163,117 +81,48 @@ public function packageById($id)
/**
* Returns how many packages have been loaded into the pool
*/
+ #[\ReturnTypeWillChange]
public function count()
{
- return count($this->packages);
+ return \count($this->packages);
}
/**
* Searches all packages providing the given package name and match the constraint
*
- * @param string $name The package name to be searched for
- * @param ConstraintInterface $constraint A constraint that all returned
- * packages must match or null to return all
- * @param bool $mustMatchName Whether the name of returned packages
- * must match the given name
- * @param bool $bypassFilters If enabled, filterRequires and stability matching is ignored
- * @return PackageInterface[] A set of packages
+ * @param string $name The package name to be searched for
+ * @param ConstraintInterface $constraint A constraint that all returned
+ * packages must match or null to return all
+ * @return BasePackage[] A set of packages
*/
- public function whatProvides($name, ConstraintInterface $constraint = null, $mustMatchName = false, $bypassFilters = false)
+ public function whatProvides($name, ConstraintInterface $constraint = null)
{
- if ($bypassFilters) {
- return $this->computeWhatProvides($name, $constraint, $mustMatchName, true);
- }
-
- $key = ((int) $mustMatchName).$constraint;
+ $key = (string) $constraint;
if (isset($this->providerCache[$name][$key])) {
return $this->providerCache[$name][$key];
}
- return $this->providerCache[$name][$key] = $this->computeWhatProvides($name, $constraint, $mustMatchName, $bypassFilters);
+ return $this->providerCache[$name][$key] = $this->computeWhatProvides($name, $constraint);
}
/**
* @see whatProvides
*/
- private function computeWhatProvides($name, $constraint, $mustMatchName = false, $bypassFilters = false)
+ private function computeWhatProvides($name, $constraint)
{
- $candidates = array();
-
- foreach ($this->providerRepos as $repo) {
- foreach ($repo->whatProvides($this, $name, $bypassFilters) as $candidate) {
- $candidates[] = $candidate;
- if ($candidate->id < 1) {
- $candidate->setId($this->id++);
- $this->packages[$this->id - 2] = $candidate;
- }
- }
+ if (!isset($this->packageByName[$name])) {
+ return array();
}
- if ($mustMatchName) {
- $candidates = array_filter($candidates, function ($candidate) use ($name) {
- return $candidate->getName() == $name;
- });
- if (isset($this->packageByExactName[$name])) {
- $candidates = array_merge($candidates, $this->packageByExactName[$name]);
- }
- } elseif (isset($this->packageByName[$name])) {
- $candidates = array_merge($candidates, $this->packageByName[$name]);
- }
-
- $matches = $provideMatches = array();
- $nameMatch = false;
-
- foreach ($candidates as $candidate) {
- $aliasOfCandidate = null;
-
- // alias packages are not white listed, make sure that the package
- // being aliased is white listed
- if ($candidate instanceof AliasPackage) {
- $aliasOfCandidate = $candidate->getAliasOf();
- }
-
- if ($this->whitelist !== null && !$bypassFilters && (
- (!($candidate instanceof AliasPackage) && !isset($this->whitelist[$candidate->id])) ||
- ($candidate instanceof AliasPackage && !isset($this->whitelist[$aliasOfCandidate->id]))
- )) {
- continue;
- }
- switch ($this->match($candidate, $name, $constraint, $bypassFilters)) {
- case self::MATCH_NONE:
- break;
-
- case self::MATCH_NAME:
- $nameMatch = true;
- break;
-
- case self::MATCH:
- $nameMatch = true;
- $matches[] = $candidate;
- break;
-
- case self::MATCH_PROVIDE:
- $provideMatches[] = $candidate;
- break;
-
- case self::MATCH_REPLACE:
- $matches[] = $candidate;
- break;
+ $matches = array();
- case self::MATCH_FILTERED:
- break;
-
- default:
- throw new \UnexpectedValueException('Unexpected match type');
+ foreach ($this->packageByName[$name] as $candidate) {
+ if ($this->match($candidate, $name, $constraint)) {
+ $matches[] = $candidate;
}
}
- // if a package with the required name exists, we ignore providers
- if ($nameMatch) {
- return $matches;
- }
-
- return array_merge($matches, $provideMatches);
+ return $matches;
}
public function literalToPackage($literal)
@@ -296,53 +145,22 @@ public function literalToPrettyString($literal, $installedMap)
return $prefix.' '.$package->getPrettyString();
}
- public function isPackageAcceptable($name, $stability)
- {
- foreach ((array) $name as $n) {
- // allow if package matches the global stability requirement and has no exception
- if (!isset($this->stabilityFlags[$n]) && isset($this->acceptableStabilities[$stability])) {
- return true;
- }
-
- // allow if package matches the package-specific stability flag
- if (isset($this->stabilityFlags[$n]) && BasePackage::$stabilities[$stability] <= $this->stabilityFlags[$n]) {
- return true;
- }
- }
-
- return false;
- }
-
/**
* Checks if the package matches the given constraint directly or through
* provided or replaced packages
*
- * @param array|PackageInterface $candidate
- * @param string $name Name of the package to be matched
- * @param ConstraintInterface $constraint The constraint to verify
- * @return int One of the MATCH* constants of this class or 0 if there is no match
+ * @param BasePackage $candidate
+ * @param string $name Name of the package to be matched
+ * @param ConstraintInterface $constraint The constraint to verify
+ * @return bool
*/
- private function match($candidate, $name, ConstraintInterface $constraint = null, $bypassFilters)
+ public function match(BasePackage $candidate, $name, ConstraintInterface $constraint = null)
{
$candidateName = $candidate->getName();
$candidateVersion = $candidate->getVersion();
- $isDev = $candidate->getStability() === 'dev';
- $isAlias = $candidate instanceof AliasPackage;
-
- if (!$bypassFilters && !$isDev && !$isAlias && isset($this->filterRequires[$name])) {
- $requireFilter = $this->filterRequires[$name];
- } else {
- $requireFilter = new EmptyConstraint;
- }
if ($candidateName === $name) {
- $pkgConstraint = new Constraint('==', $candidateVersion);
-
- if ($constraint === null || $constraint->matches($pkgConstraint)) {
- return $requireFilter->matches($pkgConstraint) ? self::MATCH : self::MATCH_FILTERED;
- }
-
- return self::MATCH_NAME;
+ return $constraint === null || CompilingMatcher::match($constraint, Constraint::OP_EQ, $candidateVersion);
}
$provides = $candidate->getProvides();
@@ -352,27 +170,43 @@ private function match($candidate, $name, ConstraintInterface $constraint = null
if (isset($replaces[0]) || isset($provides[0])) {
foreach ($provides as $link) {
if ($link->getTarget() === $name && ($constraint === null || $constraint->matches($link->getConstraint()))) {
- return $requireFilter->matches($link->getConstraint()) ? self::MATCH_PROVIDE : self::MATCH_FILTERED;
+ return true;
}
}
foreach ($replaces as $link) {
if ($link->getTarget() === $name && ($constraint === null || $constraint->matches($link->getConstraint()))) {
- return $requireFilter->matches($link->getConstraint()) ? self::MATCH_REPLACE : self::MATCH_FILTERED;
+ return true;
}
}
- return self::MATCH_NONE;
+ return false;
}
if (isset($provides[$name]) && ($constraint === null || $constraint->matches($provides[$name]->getConstraint()))) {
- return $requireFilter->matches($provides[$name]->getConstraint()) ? self::MATCH_PROVIDE : self::MATCH_FILTERED;
+ return true;
}
if (isset($replaces[$name]) && ($constraint === null || $constraint->matches($replaces[$name]->getConstraint()))) {
- return $requireFilter->matches($replaces[$name]->getConstraint()) ? self::MATCH_REPLACE : self::MATCH_FILTERED;
+ return true;
+ }
+
+ return false;
+ }
+
+ public function isUnacceptableFixedOrLockedPackage(BasePackage $package)
+ {
+ return \in_array($package, $this->unacceptableFixedOrLockedPackages, true);
+ }
+
+ public function __toString()
+ {
+ $str = "Pool:\n";
+
+ foreach ($this->packages as $package) {
+ $str .= '- '.str_pad((string) $package->id, 6, ' ', STR_PAD_LEFT).': '.$package->getName()."\n";
}
- return self::MATCH_NONE;
+ return $str;
}
}
diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php
new file mode 100644
index 000000000..97159a3c8
--- /dev/null
+++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php
@@ -0,0 +1,548 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\DependencyResolver;
+
+use Composer\EventDispatcher\EventDispatcher;
+use Composer\IO\IOInterface;
+use Composer\Package\AliasPackage;
+use Composer\Package\BasePackage;
+use Composer\Package\CompleteAliasPackage;
+use Composer\Package\CompletePackage;
+use Composer\Package\CompletePackageInterface;
+use Composer\Package\PackageInterface;
+use Composer\Package\Version\StabilityFilter;
+use Composer\Plugin\PluginEvents;
+use Composer\Plugin\PrePoolCreateEvent;
+use Composer\Repository\PlatformRepository;
+use Composer\Repository\RootPackageRepository;
+use Composer\Semver\CompilingMatcher;
+use Composer\Semver\Constraint\Constraint;
+use Composer\Semver\Constraint\ConstraintInterface;
+use Composer\Semver\Constraint\MatchAllConstraint;
+use Composer\Semver\Constraint\MultiConstraint;
+use Composer\Semver\Intervals;
+
+/**
+ * @author Nils Adermann
+ */
+class PoolBuilder
+{
+ /**
+ * @var int[]
+ * @phpstan-var array
+ */
+ private $acceptableStabilities;
+ /**
+ * @var int[]
+ * @phpstan-var array
+ */
+ private $stabilityFlags;
+ /**
+ * @var array[]
+ * @phpstan-var array>
+ */
+ private $rootAliases;
+ /**
+ * @var string[]
+ * @phpstan-var array
+ */
+ private $rootReferences;
+ /**
+ * @var ?EventDispatcher
+ */
+ private $eventDispatcher;
+ /**
+ * @var IOInterface
+ */
+ private $io;
+ /**
+ * @var array[]
+ * @phpstan-var array
+ */
+ private $aliasMap = array();
+ /**
+ * @var ConstraintInterface[]
+ * @phpstan-var array
+ */
+ private $packagesToLoad = array();
+ /**
+ * @var ConstraintInterface[]
+ * @phpstan-var array
+ */
+ private $loadedPackages = array();
+ /**
+ * @var array[]
+ * @phpstan-var array>>
+ */
+ private $loadedPerRepo = array();
+ /**
+ * @var PackageInterface[]
+ */
+ private $packages = array();
+ /**
+ * @var PackageInterface[]
+ * @phpstan-var list
+ */
+ private $unacceptableFixedOrLockedPackages = array();
+ /** @var string[] */
+ private $updateAllowList = array();
+ /** @var array */
+ private $skippedLoad = array();
+
+ /**
+ * Keeps a list of dependencies which are root requirements, and as such
+ * have already their maximum required range loaded and can not be
+ * extended by markPackageNameForLoading
+ *
+ * Packages get cleared from this list if they get unlocked as in that case
+ * we need to actually load them
+ *
+ * @var array
+ */
+ private $maxExtendedReqs = array();
+ /**
+ * @var array
+ * @phpstan-var array
+ */
+ private $updateAllowWarned = array();
+
+ /** @var int */
+ private $indexCounter = 0;
+
+ /**
+ * @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value
+ * @phpstan-param array $acceptableStabilities
+ * @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value
+ * @phpstan-param array $stabilityFlags
+ * @param array[] $rootAliases
+ * @phpstan-param array> $rootAliases
+ * @param string[] $rootReferences an array of package name => source reference
+ * @phpstan-param array $rootReferences
+ */
+ public function __construct(array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, IOInterface $io, EventDispatcher $eventDispatcher = null)
+ {
+ $this->acceptableStabilities = $acceptableStabilities;
+ $this->stabilityFlags = $stabilityFlags;
+ $this->rootAliases = $rootAliases;
+ $this->rootReferences = $rootReferences;
+ $this->eventDispatcher = $eventDispatcher;
+ $this->io = $io;
+ }
+
+ public function buildPool(array $repositories, Request $request)
+ {
+ if ($request->getUpdateAllowList()) {
+ $this->updateAllowList = $request->getUpdateAllowList();
+ $this->warnAboutNonMatchingUpdateAllowList($request);
+
+ foreach ($request->getLockedRepository()->getPackages() as $lockedPackage) {
+ if (!$this->isUpdateAllowed($lockedPackage)) {
+ $request->lockPackage($lockedPackage);
+ $lockedName = $lockedPackage->getName();
+ // remember which packages we skipped loading remote content for in this partial update
+ $this->skippedLoad[$lockedName] = $lockedName;
+ foreach ($lockedPackage->getReplaces() as $link) {
+ $this->skippedLoad[$link->getTarget()] = $lockedName;
+ }
+ }
+ }
+ }
+
+ foreach ($request->getFixedOrLockedPackages() as $package) {
+ // using MatchAllConstraint here because fixed packages do not need to retrigger
+ // loading any packages
+ $this->loadedPackages[$package->getName()] = new MatchAllConstraint();
+
+ // replace means conflict, so if a fixed package replaces a name, no need to load that one, packages would conflict anyways
+ foreach ($package->getReplaces() as $link) {
+ $this->loadedPackages[$link->getTarget()] = new MatchAllConstraint();
+ }
+
+ // TODO in how far can we do the above for conflicts? It's more tricky cause conflicts can be limited to
+ // specific versions while replace is a conflict with all versions of the name
+
+ if (
+ $package->getRepository() instanceof RootPackageRepository
+ || $package->getRepository() instanceof PlatformRepository
+ || StabilityFilter::isPackageAcceptable($this->acceptableStabilities, $this->stabilityFlags, $package->getNames(), $package->getStability())
+ ) {
+ $this->loadPackage($request, $package, false);
+ } else {
+ $this->unacceptableFixedOrLockedPackages[] = $package;
+ }
+ }
+
+ foreach ($request->getRequires() as $packageName => $constraint) {
+ // fixed and locked packages have already been added, so if a root require needs one of them, no need to do anything
+ if (isset($this->loadedPackages[$packageName])) {
+ continue;
+ }
+
+ $this->packagesToLoad[$packageName] = $constraint;
+ $this->maxExtendedReqs[$packageName] = true;
+ }
+
+ // clean up packagesToLoad for anything we manually marked loaded above
+ foreach ($this->packagesToLoad as $name => $constraint) {
+ if (isset($this->loadedPackages[$name])) {
+ unset($this->packagesToLoad[$name]);
+ }
+ }
+
+ while (!empty($this->packagesToLoad)) {
+ $this->loadPackagesMarkedForLoading($request, $repositories);
+ }
+
+ foreach ($this->packages as $i => $package) {
+ // we check all alias related packages at once, so no need to check individual aliases
+ // isset also checks non-null value
+ if (!$package instanceof AliasPackage) {
+ $constraint = new Constraint('==', $package->getVersion());
+ $aliasedPackages = array($i => $package);
+ if (isset($this->aliasMap[spl_object_hash($package)])) {
+ $aliasedPackages += $this->aliasMap[spl_object_hash($package)];
+ }
+
+ $found = false;
+ foreach ($aliasedPackages as $packageOrAlias) {
+ if (CompilingMatcher::match($constraint, Constraint::OP_EQ, $packageOrAlias->getVersion())) {
+ $found = true;
+ }
+ }
+ if (!$found) {
+ foreach ($aliasedPackages as $index => $packageOrAlias) {
+ unset($this->packages[$index]);
+ }
+ }
+ }
+ }
+
+ if ($this->eventDispatcher) {
+ $prePoolCreateEvent = new PrePoolCreateEvent(
+ PluginEvents::PRE_POOL_CREATE,
+ $repositories,
+ $request,
+ $this->acceptableStabilities,
+ $this->stabilityFlags,
+ $this->rootAliases,
+ $this->rootReferences,
+ $this->packages,
+ $this->unacceptableFixedOrLockedPackages
+ );
+ $this->eventDispatcher->dispatch($prePoolCreateEvent->getName(), $prePoolCreateEvent);
+ $this->packages = $prePoolCreateEvent->getPackages();
+ $this->unacceptableFixedOrLockedPackages = $prePoolCreateEvent->getUnacceptableFixedPackages();
+ }
+
+ $pool = new Pool($this->packages, $this->unacceptableFixedOrLockedPackages);
+
+ $this->aliasMap = array();
+ $this->packagesToLoad = array();
+ $this->loadedPackages = array();
+ $this->loadedPerRepo = array();
+ $this->packages = array();
+ $this->unacceptableFixedOrLockedPackages = array();
+ $this->maxExtendedReqs = array();
+ $this->skippedLoad = array();
+ $this->indexCounter = 0;
+
+ Intervals::clear();
+
+ return $pool;
+ }
+
+ private function markPackageNameForLoading(Request $request, $name, ConstraintInterface $constraint)
+ {
+ // Skip platform requires at this stage
+ if (PlatformRepository::isPlatformPackage($name)) {
+ return;
+ }
+
+ // Root require (which was not unlocked) already loaded the maximum range so no
+ // need to check anything here
+ if (isset($this->maxExtendedReqs[$name])) {
+ return;
+ }
+
+ // Root requires can not be overruled by dependencies so there is no point in
+ // extending the loaded constraint for those.
+ // This is triggered when loading a root require which was locked but got unlocked, then
+ // we make sure that we load at most the intervals covered by the root constraint.
+ $rootRequires = $request->getRequires();
+ if (isset($rootRequires[$name]) && !Intervals::isSubsetOf($constraint, $rootRequires[$name])) {
+ $constraint = $rootRequires[$name];
+ }
+
+ // Not yet loaded or already marked for a reload, set the constraint to be loaded
+ if (!isset($this->loadedPackages[$name])) {
+ // Maybe it was already marked before but not loaded yet. In that case
+ // we have to extend the constraint (we don't check if they are identical because
+ // MultiConstraint::create() will optimize anyway)
+ if (isset($this->packagesToLoad[$name])) {
+ // Already marked for loading and this does not expand the constraint to be loaded, nothing to do
+ if (Intervals::isSubsetOf($constraint, $this->packagesToLoad[$name])) {
+ return;
+ }
+
+ // extend the constraint to be loaded
+ $constraint = Intervals::compactConstraint(MultiConstraint::create(array($this->packagesToLoad[$name], $constraint), false));
+ }
+
+ $this->packagesToLoad[$name] = $constraint;
+
+ return;
+ }
+
+ // No need to load this package with this constraint because it is
+ // a subset of the constraint with which we have already loaded packages
+ if (Intervals::isSubsetOf($constraint, $this->loadedPackages[$name])) {
+ return;
+ }
+
+ // We have already loaded that package but not in the constraint that's
+ // required. We extend the constraint and mark that package as not being loaded
+ // yet so we get the required package versions
+ $this->packagesToLoad[$name] = Intervals::compactConstraint(MultiConstraint::create(array($this->loadedPackages[$name], $constraint), false));
+ unset($this->loadedPackages[$name]);
+ }
+
+ private function loadPackagesMarkedForLoading(Request $request, $repositories)
+ {
+ foreach ($this->packagesToLoad as $name => $constraint) {
+ $this->loadedPackages[$name] = $constraint;
+ }
+
+ $packageBatch = $this->packagesToLoad;
+ $this->packagesToLoad = array();
+
+ foreach ($repositories as $repoIndex => $repository) {
+ if (empty($packageBatch)) {
+ break;
+ }
+
+ // these repos have their packages fixed or locked if they need to be loaded so we
+ // never need to load anything else from them
+ if ($repository instanceof PlatformRepository || $repository === $request->getLockedRepository()) {
+ continue;
+ }
+ $result = $repository->loadPackages($packageBatch, $this->acceptableStabilities, $this->stabilityFlags, isset($this->loadedPerRepo[$repoIndex]) ? $this->loadedPerRepo[$repoIndex] : array());
+
+ foreach ($result['namesFound'] as $name) {
+ // avoid loading the same package again from other repositories once it has been found
+ unset($packageBatch[$name]);
+ }
+ foreach ($result['packages'] as $package) {
+ $this->loadedPerRepo[$repoIndex][$package->getName()][$package->getVersion()] = $package;
+ $this->loadPackage($request, $package);
+ }
+ }
+ }
+
+ private function loadPackage(Request $request, BasePackage $package, $propagateUpdate = true)
+ {
+ $index = $this->indexCounter++;
+ $this->packages[$index] = $package;
+
+ if ($package instanceof AliasPackage) {
+ $this->aliasMap[spl_object_hash($package->getAliasOf())][$index] = $package;
+ }
+
+ $name = $package->getName();
+
+ // we're simply setting the root references on all versions for a name here and rely on the solver to pick the
+ // right version. It'd be more work to figure out which versions and which aliases of those versions this may
+ // apply to
+ if (isset($this->rootReferences[$name])) {
+ // do not modify the references on already locked or fixed packages
+ if (!$request->isLockedPackage($package) && !$request->isFixedPackage($package)) {
+ $package->setSourceDistReferences($this->rootReferences[$name]);
+ }
+ }
+
+ // if propogateUpdate is false we are loading a fixed or locked package, root aliases do not apply as they are
+ // manually loaded as separate packages in this case
+ if ($propagateUpdate && isset($this->rootAliases[$name][$package->getVersion()])) {
+ $alias = $this->rootAliases[$name][$package->getVersion()];
+ if ($package instanceof AliasPackage) {
+ $basePackage = $package->getAliasOf();
+ } else {
+ $basePackage = $package;
+ }
+ if ($basePackage instanceof CompletePackage) {
+ $aliasPackage = new CompleteAliasPackage($basePackage, $alias['alias_normalized'], $alias['alias']);
+ } else {
+ $aliasPackage = new AliasPackage($basePackage, $alias['alias_normalized'], $alias['alias']);
+ }
+ $aliasPackage->setRootPackageAlias(true);
+
+ $newIndex = $this->indexCounter++;
+ $this->packages[$newIndex] = $aliasPackage;
+ $this->aliasMap[spl_object_hash($aliasPackage->getAliasOf())][$newIndex] = $aliasPackage;
+ }
+
+ foreach ($package->getRequires() as $link) {
+ $require = $link->getTarget();
+ $linkConstraint = $link->getConstraint();
+
+ // if the required package is loaded as a locked package only and hasn't had its deps analyzed
+ if (isset($this->skippedLoad[$require])) {
+ // if we're doing a full update or this is a partial update with transitive deps and we're currently
+ // looking at a package which needs to be updated we need to unlock the package we now know is a
+ // dependency of another package which we are trying to update, and then attempt to load it again
+ if ($propagateUpdate && $request->getUpdateAllowTransitiveDependencies()) {
+ if ($request->getUpdateAllowTransitiveRootDependencies() || !$this->isRootRequire($request, $this->skippedLoad[$require])) {
+ $this->unlockPackage($request, $require);
+ $this->markPackageNameForLoading($request, $require, $linkConstraint);
+ } elseif (!isset($this->updateAllowWarned[$this->skippedLoad[$require]])) {
+ $this->updateAllowWarned[$this->skippedLoad[$require]] = true;
+ $this->io->writeError('