OXIESEC PANEL
- Current Dir:
/
/
usr
/
share
/
php
/
Composer
/
DependencyResolver
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/20/2024 06:32:22 AM
rwxr-xr-x
📄
Decisions.php
5.1 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
DefaultPolicy.php
9.12 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
GenericRule.php
2.12 KB
01/31/2018 03:28:18 PM
rw-r--r--
📁
Operation
-
07/20/2024 06:32:22 AM
rwxr-xr-x
📄
PolicyInterface.php
746 bytes
01/31/2018 03:28:18 PM
rw-r--r--
📄
Pool.php
13.88 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Problem.php
9.45 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Request.php
1.91 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Rule.php
8.99 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Rule2Literals.php
2.44 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleSet.php
4.06 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleSetGenerator.php
12.41 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleSetIterator.php
2.28 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleWatchChain.php
1.37 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleWatchGraph.php
5.2 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
RuleWatchNode.php
2.68 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Solver.php
26.15 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
SolverBugException.php
757 bytes
01/31/2018 03:28:18 PM
rw-r--r--
📄
SolverProblemsException.php
2.69 KB
01/31/2018 03:28:18 PM
rw-r--r--
📄
Transaction.php
7.55 KB
01/31/2018 03:28:18 PM
rw-r--r--
Editing: RuleSet.php
Close
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\DependencyResolver; /** * @author Nils Adermann <naderman@naderman.de> */ class RuleSet implements \IteratorAggregate, \Countable { // highest priority => lowest number const TYPE_PACKAGE = 0; const TYPE_JOB = 1; const TYPE_LEARNED = 4; /** * READ-ONLY: Lookup table for rule id to rule object * * @var Rule[] */ public $ruleById; protected static $types = array( 255 => 'UNKNOWN', self::TYPE_PACKAGE => 'PACKAGE', self::TYPE_JOB => 'JOB', self::TYPE_LEARNED => 'LEARNED', ); protected $rules; protected $nextRuleId; protected $rulesByHash; public function __construct() { $this->nextRuleId = 0; foreach ($this->getTypes() as $type) { $this->rules[$type] = array(); } $this->rulesByHash = array(); } public function add(Rule $rule, $type) { if (!isset(self::$types[$type])) { throw new \OutOfBoundsException('Unknown rule type: ' . $type); } $hash = $rule->getHash(); // Do not add if rule already exists if (isset($this->rulesByHash[$hash])) { $potentialDuplicates = $this->rulesByHash[$hash]; if (is_array($potentialDuplicates)) { foreach ($potentialDuplicates as $potentialDuplicate) { if ($rule->equals($potentialDuplicate)) { return; } } } else { if ($rule->equals($potentialDuplicates)) { return; } } } if (!isset($this->rules[$type])) { $this->rules[$type] = array(); } $this->rules[$type][] = $rule; $this->ruleById[$this->nextRuleId] = $rule; $rule->setType($type); $this->nextRuleId++; if (!isset($this->rulesByHash[$hash])) { $this->rulesByHash[$hash] = $rule; } elseif (is_array($this->rulesByHash[$hash])) { $this->rulesByHash[$hash][] = $rule; } else { $originalRule = $this->rulesByHash[$hash]; $this->rulesByHash[$hash] = array($originalRule, $rule); } } public function count() { return $this->nextRuleId; } public function ruleById($id) { return $this->ruleById[$id]; } public function getRules() { return $this->rules; } public function getIterator() { return new RuleSetIterator($this->getRules()); } public function getIteratorFor($types) { if (!is_array($types)) { $types = array($types); } $allRules = $this->getRules(); $rules = array(); foreach ($types as $type) { $rules[$type] = $allRules[$type]; } return new RuleSetIterator($rules); } public function getIteratorWithout($types) { if (!is_array($types)) { $types = array($types); } $rules = $this->getRules(); foreach ($types as $type) { unset($rules[$type]); } return new RuleSetIterator($rules); } public function getTypes() { $types = self::$types; unset($types[255]); return array_keys($types); } public function getPrettyString(Pool $pool = null) { $string = "\n"; foreach ($this->rules as $type => $rules) { $string .= str_pad(self::$types[$type], 8, ' ') . ": "; foreach ($rules as $rule) { $string .= ($pool ? $rule->getPrettyString($pool) : $rule)."\n"; } $string .= "\n\n"; } return $string; } public function __toString() { return $this->getPrettyString(null); } }