mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-23 05:09:56 +09:00
Move all composer files inside the common directory
- 2022년 3월 개발팀 결정사항 적용 - 모듈 등 서드파티 자료 개발시 composer를 사용하면 상위 경로에 있는 코어의 composer.json을 수정하고, 코어의 vendor 디렉토리를 건드리는 것이 기본값임 - 이를 방지하기 위해 코어의 composer.json과 vendor를 common 디렉토리 안으로 이동하여, 모듈 경로에서 상위 폴더로 인식하지 않도록 함
This commit is contained in:
parent
7b912d21fc
commit
5fff6b6eab
1478 changed files with 2 additions and 2 deletions
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* A simple array-backed queue, based off of the classic Okasaki
|
||||
* persistent amortized queue. The basic idea is to maintain two
|
||||
* stacks: an input stack and an output stack. When the output
|
||||
* stack runs out, reverse the input stack and use it as the output
|
||||
* stack.
|
||||
*
|
||||
* We don't use the SPL implementation because it's only supported
|
||||
* on PHP 5.3 and later.
|
||||
*
|
||||
* Exercise: Prove that push/pop on this queue take amortized O(1) time.
|
||||
*
|
||||
* Exercise: Extend this queue to be a deque, while preserving amortized
|
||||
* O(1) time. Some care must be taken on rebalancing to avoid quadratic
|
||||
* behaviour caused by repeatedly shuffling data from the input stack
|
||||
* to the output stack and back.
|
||||
*/
|
||||
class HTMLPurifier_Queue {
|
||||
private $input;
|
||||
private $output;
|
||||
|
||||
public function __construct($input = array()) {
|
||||
$this->input = $input;
|
||||
$this->output = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shifts an element off the front of the queue.
|
||||
*/
|
||||
public function shift() {
|
||||
if (empty($this->output)) {
|
||||
$this->output = array_reverse($this->input);
|
||||
$this->input = array();
|
||||
}
|
||||
if (empty($this->output)) {
|
||||
return NULL;
|
||||
}
|
||||
return array_pop($this->output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes an element onto the front of the queue.
|
||||
*/
|
||||
public function push($x) {
|
||||
array_push($this->input, $x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if it's empty.
|
||||
*/
|
||||
public function isEmpty() {
|
||||
return empty($this->input) && empty($this->output);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue