ヤミRoot VoidGate
User / IP
:
216.73.216.81
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
fixtures
/
assert
/
Viewing: docs.tar
en/derived-collections.rst 0000644 00000001342 15120276245 0011642 0 ustar 00 Derived Collections =================== You can create custom collection classes by extending the ``Doctrine\Common\Collections\ArrayCollection`` class. If the ``__construct`` semantics are different from the default ``ArrayCollection`` you can override the ``createFrom`` method: .. code-block:: php final class DerivedArrayCollection extends ArrayCollection { /** @var \stdClass */ private $foo; public function __construct(\stdClass $foo, array $elements = []) { $this->foo = $foo; parent::__construct($elements); } protected function createFrom(array $elements) : self { return new static($this->foo, $elements); } } en/expression-builder.rst 0000644 00000006726 15120276245 0011542 0 ustar 00 Expression Builder ================== The Expression Builder is a convenient fluent interface for building expressions to be used with the ``Doctrine\Common\Collections\Criteria`` class: .. code-block:: php $expressionBuilder = Criteria::expr(); $criteria = new Criteria(); $criteria->where($expressionBuilder->eq('name', 'jwage')); $criteria->orWhere($expressionBuilder->eq('name', 'romanb')); $collection->matching($criteria); The ``ExpressionBuilder`` has the following API: andX ---- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->andX( $expressionBuilder->eq('foo', 1), $expressionBuilder->eq('bar', 1) ); $collection->matching(new Criteria($expression)); orX --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->orX( $expressionBuilder->eq('foo', 1), $expressionBuilder->eq('bar', 1) ); $collection->matching(new Criteria($expression)); eq --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->eq('foo', 1); $collection->matching(new Criteria($expression)); gt --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->gt('foo', 1); $collection->matching(new Criteria($expression)); lt --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->lt('foo', 1); $collection->matching(new Criteria($expression)); gte --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->gte('foo', 1); $collection->matching(new Criteria($expression)); lte --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->lte('foo', 1); $collection->matching(new Criteria($expression)); neq --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->neq('foo', 1); $collection->matching(new Criteria($expression)); isNull ------ .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->isNull('foo'); $collection->matching(new Criteria($expression)); in --- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->in('foo', ['value1', 'value2']); $collection->matching(new Criteria($expression)); notIn ----- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->notIn('foo', ['value1', 'value2']); $collection->matching(new Criteria($expression)); contains -------- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->contains('foo', 'value1'); $collection->matching(new Criteria($expression)); memberOf -------- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->memberOf('foo', ['value1', 'value2']); $collection->matching(new Criteria($expression)); startsWith ---------- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->startsWith('foo', 'hello'); $collection->matching(new Criteria($expression)); endsWith -------- .. code-block:: php $expressionBuilder = Criteria::expr(); $expression = $expressionBuilder->endsWith('foo', 'world'); $collection->matching(new Criteria($expression)); en/expressions.rst 0000644 00000004263 15120276245 0010273 0 ustar 00 Expressions =========== The ``Doctrine\Common\Collections\Expr\Comparison`` class can be used to create expressions to be used with the ``Doctrine\Common\Collections\Criteria`` class. It has the following operator constants: - ``Comparison::EQ`` - ``Comparison::NEQ`` - ``Comparison::LT`` - ``Comparison::LTE`` - ``Comparison::GT`` - ``Comparison::GTE`` - ``Comparison::IS`` - ``Comparison::IN`` - ``Comparison::NIN`` - ``Comparison::CONTAINS`` - ``Comparison::MEMBER_OF`` - ``Comparison::STARTS_WITH`` - ``Comparison::ENDS_WITH`` The ``Doctrine\Common\Collections\Criteria`` class has the following API to be used with expressions: where ----- Sets the where expression to evaluate when this Criteria is searched for. .. code-block:: php $expr = new Comparison('key', Comparison::EQ, 'value'); $criteria->where($expr); andWhere -------- Appends the where expression to evaluate when this Criteria is searched for using an AND with previous expression. .. code-block:: php $expr = new Comparison('key', Comparison::EQ, 'value'); $criteria->andWhere($expr); orWhere ------- Appends the where expression to evaluate when this Criteria is searched for using an OR with previous expression. .. code-block:: php $expr1 = new Comparison('key', Comparison::EQ, 'value1'); $expr2 = new Comparison('key', Comparison::EQ, 'value2'); $criteria->where($expr1); $criteria->orWhere($expr2); orderBy ------- Sets the ordering of the result of this Criteria. .. code-block:: php $criteria->orderBy(['name' => Criteria::ASC]); setFirstResult -------------- Set the number of first result that this Criteria should return. .. code-block:: php $criteria->setFirstResult(0); getFirstResult -------------- Gets the current first result option of this Criteria. .. code-block:: php $criteria->setFirstResult(10); echo $criteria->getFirstResult(); // 10 setMaxResults ------------- Sets the max results that this Criteria should return. .. code-block:: php $criteria->setMaxResults(20); getMaxResults ------------- Gets the current max results option of this Criteria. .. code-block:: php $criteria->setMaxResults(20); echo $criteria->getMaxResults(); // 20 en/index.rst 0000644 00000020323 15120276245 0007013 0 ustar 00 Introduction ============ Doctrine Collections is a library that contains classes for working with arrays of data. Here is an example using the simple ``Doctrine\Common\Collections\ArrayCollection`` class: .. code-block:: php <?php use Doctrine\Common\Collections\ArrayCollection; $collection = new ArrayCollection([1, 2, 3]); $filteredCollection = $collection->filter(function($element) { return $element > 1; }); // [2, 3] Collection Methods ================== Doctrine Collections provides an interface named ``Doctrine\Common\Collections\Collection`` that resembles the nature of a regular PHP array. That is, it is essentially an **ordered map** that can also be used like a list. A Collection has an internal iterator just like a PHP array. In addition, a Collection can be iterated with external iterators, which is preferable. To use an external iterator simply use the foreach language construct to iterate over the collection, which calls ``getIterator()`` internally, or explicitly retrieve an iterator though ``getIterator()`` which can then be used to iterate over the collection. You can not rely on the internal iterator of the collection being at a certain position unless you explicitly positioned it before. Methods that do not alter the collection or have template types appearing in invariant or contravariant positions are not directly defined in ``Doctrine\Common\Collections\Collection``, but are inherited from the ``Doctrine\Common\Collections\ReadableCollection`` interface. The methods available on the interface are: add --- Adds an element at the end of the collection. .. code-block:: php $collection->add('test'); clear ----- Clears the collection, removing all elements. .. code-block:: php $collection->clear(); contains -------- Checks whether an element is contained in the collection. This is an O(n) operation, where n is the size of the collection. .. code-block:: php $collection = new Collection(['test']); $contains = $collection->contains('test'); // true containsKey ----------- Checks whether the collection contains an element with the specified key/index. .. code-block:: php $collection = new Collection(['test' => true]); $contains = $collection->containsKey('test'); // true current ------- Gets the element of the collection at the current iterator position. .. code-block:: php $collection = new Collection(['first', 'second', 'third']); $current = $collection->current(); // first get --- Gets the element at the specified key/index. .. code-block:: php $collection = new Collection([ 'key' => 'value', ]); $value = $collection->get('key'); // value getKeys ------- Gets all keys/indices of the collection. .. code-block:: php $collection = new Collection(['a', 'b', 'c']); $keys = $collection->getKeys(); // [0, 1, 2] getValues --------- Gets all values of the collection. .. code-block:: php $collection = new Collection([ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3', ]); $values = $collection->getValues(); // ['value1', 'value2', 'value3'] isEmpty ------- Checks whether the collection is empty (contains no elements). .. code-block:: php $collection = new Collection(['a', 'b', 'c']); $isEmpty = $collection->isEmpty(); // false first ----- Sets the internal iterator to the first element in the collection and returns this element. .. code-block:: php $collection = new Collection(['first', 'second', 'third']); $first = $collection->first(); // first exists ------ Tests for the existence of an element that satisfies the given predicate. .. code-block:: php $collection = new Collection(['first', 'second', 'third']); $exists = $collection->exists(function($key, $value) { return $value === 'first'; }); // true filter ------ Returns all the elements of this collection for which your callback function returns `true`. The order and keys of the elements are preserved. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $filteredCollection = $collection->filter(function($element) { return $element > 1; }); // [2, 3] forAll ------ Tests whether the given predicate holds for all elements of this collection. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $forAll = $collection->forAll(function($key, $value) { return $value > 1; }); // false indexOf ------- Gets the index/key of a given element. The comparison of two elements is strict, that means not only the value but also the type must match. For objects this means reference equality. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $indexOf = $collection->indexOf(3); // 2 key --- Gets the key/index of the element at the current iterator position. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $collection->next(); $key = $collection->key(); // 1 last ---- Sets the internal iterator to the last element in the collection and returns this element. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $last = $collection->last(); // 3 map --- Applies the given function to each element in the collection and returns a new collection with the elements returned by the function. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $mappedCollection = $collection->map(function($value) { return $value + 1; }); // [2, 3, 4] next ---- Moves the internal iterator position to the next element and returns this element. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $next = $collection->next(); // 2 partition --------- Partitions this collection in two collections according to a predicate. Keys are preserved in the resulting collections. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $mappedCollection = $collection->partition(function($key, $value) { return $value > 1 }); // [[2, 3], [1]] remove ------ Removes the element at the specified index from the collection. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $collection->remove(0); // [2, 3] removeElement ------------- Removes the specified element from the collection, if it is found. .. code-block:: php $collection = new ArrayCollection([1, 2, 3]); $collection->removeElement(3); // [1, 2] set --- Sets an element in the collection at the specified key/index. .. code-block:: php $collection = new ArrayCollection(); $collection->set('name', 'jwage'); slice ----- Extracts a slice of $length elements starting at position $offset from the Collection. If $length is null it returns all elements from $offset to the end of the Collection. Keys have to be preserved by this method. Calling this method will only return the selected slice and NOT change the elements contained in the collection slice is called on. .. code-block:: php $collection = new ArrayCollection([0, 1, 2, 3, 4, 5]); $slice = $collection->slice(1, 2); // [1, 2] toArray ------- Gets a native PHP array representation of the collection. .. code-block:: php $collection = new ArrayCollection([0, 1, 2, 3, 4, 5]); $array = $collection->toArray(); // [0, 1, 2, 3, 4, 5] Selectable Methods ================== Some Doctrine Collections, like ``Doctrine\Common\Collections\ArrayCollection``, implement an interface named ``Doctrine\Common\Collections\Selectable`` that offers the usage of a powerful expressions API, where conditions can be applied to a collection to get a result with matching elements only. matching -------- Selects all elements from a selectable that match the expression and returns a new collection containing these elements. .. code-block:: php use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Expr\Comparison; $collection = new ArrayCollection([ [ 'name' => 'jwage', ], [ 'name' => 'romanb', ], ]); $expr = new Comparison('name', '=', 'jwage'); $criteria = new Criteria(); $criteria->where($expr); $matched = $collection->matching($criteria); // ['jwage'] You can read more about expressions :ref:`here <expressions>`. en/lazy-collections.rst 0000644 00000001344 15120276245 0011201 0 ustar 00 Lazy Collections ================ To create a lazy collection you can extend the ``Doctrine\Common\Collections\AbstractLazyCollection`` class and define the ``doInitialize`` method. Here is an example where we lazily query the database for a collection of user records: .. code-block:: php use Doctrine\DBAL\Connection; class UsersLazyCollection extends AbstractLazyCollection { /** @var Connection */ private $connection; public function __construct(Connection $connection) { $this->connection = $connection; } protected function doInitialize() : void { $this->collection = $this->connection->fetchAll('SELECT * FROM users'); } } en/sidebar.rst 0000644 00000000172 15120276245 0007315 0 ustar 00 .. toctree:: :depth: 3 index expressions expression-builder derived-collections lazy-collections api/patchFs.md 0000644 00000001274 15120345525 0007235 0 ustar 00 # `patchFs(vol[, fs])` Rewrites Node's filesystem module `fs` with *fs-like* object. - `vol` - fs-like object - `fs` *(optional)* - a filesystem to patch, defaults to `require('fs')` ```js import {patchFs} from 'fs-monkey'; const myfs = { readFileSync: () => 'hello world', }; patchFs(myfs); console.log(require('fs').readFileSync('/foo/bar')); // hello world ``` You don't need to create *fs-like* objects yourself, use [`memfs`](https://github.com/streamich/memfs) to create a virtual filesystem for you: ```js import {vol} from 'memfs'; import {patchFs} from 'fs-monkey'; vol.fromJSON({'/dir/foo': 'bar'}); patchFs(vol); console.log(require('fs').readdirSync('/')); // [ 'dir' ] ``` api/patchRequire.md 0000644 00000003214 15120345525 0010275 0 ustar 00 # `patchRequire(vol[, unixifyPaths[, Module]])` Patches Node's `module` module to use a given *fs-like* object `vol` for module loading. - `vol` - fs-like object - `unixifyPaths` *(optional)* - whether to convert Windows paths to unix style paths, defaults to `false`. - `Module` *(optional)* - a module to patch, defaults to `require('module')` Monkey-patches the `require` function in Node, this way you can make Node.js to *require* modules from your custom filesystem. It expects an object with three filesystem methods implemented that are needed for the `require` function to work. ```js let vol = { readFileSync: () => {}, realpathSync: () => {}, statSync: () => {}, }; ``` If you want to make Node.js to *require* your files from memory, you don't need to implement those functions yourself, just use the [`memfs`](https://github.com/streamich/memfs) package: ```js import {vol} from 'memfs'; import {patchRequire} from 'fs-monkey'; vol.fromJSON({'/foo/bar.js': 'console.log("obi trice");'}); patchRequire(vol); require('/foo/bar'); // obi trice ``` Now the `require` function will only load the files from the `vol` file system, but not from the actual filesystem on the disk. If you want the `require` function to load modules from both file systems, use the [`unionfs`](https://github.com/streamich/unionfs) package to combine both filesystems into a union: ```js import {vol} from 'memfs'; import {patchRequire} from 'fs-monkey'; import {ufs} from 'unionfs'; import * as fs from 'fs'; vol.fromJSON({'/foo/bar.js': 'console.log("obi trice");'}); ufs .use(vol) .use(fs); patchRequire(ufs); require('/foo/bar.js'); // obi trice ```
Coded With 💗 by
0x6ick