From a4642d17e0e1ea018b128efdcc3db281461458b1 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 4 Apr 2018 15:21:13 -0700 Subject: Move custom libs to the source tree --- composer.json | 5 +- composer.lock | 97 +------------ libs/SimpleQueue/Adapter/AmqpQueueAdapter.php | 138 +++++++++++++++++++ libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php | 120 +++++++++++++++++ .../Exception/NotSupportedException.php | 14 ++ libs/SimpleQueue/Job.php | 98 ++++++++++++++ libs/SimpleQueue/Queue.php | 92 +++++++++++++ libs/SimpleQueue/QueueAdapterInterface.php | 58 ++++++++ libs/SimpleValidator/Validator.php | 44 ++++++ libs/SimpleValidator/Validators/Alpha.php | 15 +++ libs/SimpleValidator/Validators/AlphaNumeric.php | 15 +++ libs/SimpleValidator/Validators/Base.php | 37 +++++ libs/SimpleValidator/Validators/Date.php | 45 +++++++ libs/SimpleValidator/Validators/Email.php | 67 +++++++++ libs/SimpleValidator/Validators/Equals.php | 27 ++++ libs/SimpleValidator/Validators/Exists.php | 38 ++++++ libs/SimpleValidator/Validators/GreaterThan.php | 23 ++++ libs/SimpleValidator/Validators/InArray.php | 23 ++++ libs/SimpleValidator/Validators/Integer.php | 25 ++++ libs/SimpleValidator/Validators/Ip.php | 15 +++ libs/SimpleValidator/Validators/Length.php | 26 ++++ libs/SimpleValidator/Validators/MaxLength.php | 24 ++++ libs/SimpleValidator/Validators/MinLength.php | 24 ++++ libs/SimpleValidator/Validators/NotEmpty.php | 15 +++ libs/SimpleValidator/Validators/NotEquals.php | 28 ++++ libs/SimpleValidator/Validators/NotInArray.php | 15 +++ libs/SimpleValidator/Validators/Numeric.php | 15 +++ libs/SimpleValidator/Validators/Range.php | 33 +++++ libs/SimpleValidator/Validators/Required.php | 11 ++ libs/SimpleValidator/Validators/Unique.php | 48 +++++++ vendor/composer/autoload_classmap.php | 60 ++++----- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 1 - vendor/composer/autoload_static.php | 77 +++++------ vendor/composer/installed.json | 101 +------------- vendor/fguillot/simple-queue/LICENSE | 21 --- .../simple-queue/src/Adapter/AmqpQueueAdapter.php | 138 ------------------- .../src/Adapter/AwsSqsQueueAdapter.php | 150 --------------------- .../src/Adapter/BeanstalkQueueAdapter.php | 120 ----------------- .../src/Adapter/DisqueQueueAdapter.php | 109 --------------- .../src/Adapter/MemoryQueueAdapter.php | 100 -------------- .../src/Exception/NotSupportedException.php | 14 -- vendor/fguillot/simple-queue/src/Job.php | 98 -------------- vendor/fguillot/simple-queue/src/Queue.php | 92 ------------- .../simple-queue/src/QueueAdapterInterface.php | 58 -------- vendor/fguillot/simple-validator/LICENSE | 21 --- .../src/SimpleValidator/Validator.php | 44 ------ .../src/SimpleValidator/Validators/Alpha.php | 15 --- .../SimpleValidator/Validators/AlphaNumeric.php | 15 --- .../src/SimpleValidator/Validators/Base.php | 37 ----- .../src/SimpleValidator/Validators/Date.php | 45 ------- .../src/SimpleValidator/Validators/Email.php | 67 --------- .../src/SimpleValidator/Validators/Equals.php | 27 ---- .../src/SimpleValidator/Validators/Exists.php | 38 ------ .../src/SimpleValidator/Validators/GreaterThan.php | 23 ---- .../src/SimpleValidator/Validators/InArray.php | 23 ---- .../src/SimpleValidator/Validators/Integer.php | 25 ---- .../src/SimpleValidator/Validators/Ip.php | 15 --- .../src/SimpleValidator/Validators/Length.php | 26 ---- .../src/SimpleValidator/Validators/MaxLength.php | 24 ---- .../src/SimpleValidator/Validators/MinLength.php | 24 ---- .../src/SimpleValidator/Validators/NotEmpty.php | 15 --- .../src/SimpleValidator/Validators/NotEquals.php | 28 ---- .../src/SimpleValidator/Validators/NotInArray.php | 15 --- .../src/SimpleValidator/Validators/Numeric.php | 15 --- .../src/SimpleValidator/Validators/Range.php | 33 ----- .../src/SimpleValidator/Validators/Required.php | 11 -- .../src/SimpleValidator/Validators/Unique.php | 48 ------- vendor/symfony/finder/SplFileInfo.php | 2 +- vendor/symfony/finder/Tests/FinderTest.php | 18 ++- 70 files changed, 1229 insertions(+), 1801 deletions(-) create mode 100644 libs/SimpleQueue/Adapter/AmqpQueueAdapter.php create mode 100644 libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php create mode 100644 libs/SimpleQueue/Exception/NotSupportedException.php create mode 100644 libs/SimpleQueue/Job.php create mode 100644 libs/SimpleQueue/Queue.php create mode 100644 libs/SimpleQueue/QueueAdapterInterface.php create mode 100644 libs/SimpleValidator/Validator.php create mode 100644 libs/SimpleValidator/Validators/Alpha.php create mode 100644 libs/SimpleValidator/Validators/AlphaNumeric.php create mode 100644 libs/SimpleValidator/Validators/Base.php create mode 100644 libs/SimpleValidator/Validators/Date.php create mode 100644 libs/SimpleValidator/Validators/Email.php create mode 100644 libs/SimpleValidator/Validators/Equals.php create mode 100644 libs/SimpleValidator/Validators/Exists.php create mode 100644 libs/SimpleValidator/Validators/GreaterThan.php create mode 100644 libs/SimpleValidator/Validators/InArray.php create mode 100644 libs/SimpleValidator/Validators/Integer.php create mode 100644 libs/SimpleValidator/Validators/Ip.php create mode 100644 libs/SimpleValidator/Validators/Length.php create mode 100644 libs/SimpleValidator/Validators/MaxLength.php create mode 100644 libs/SimpleValidator/Validators/MinLength.php create mode 100644 libs/SimpleValidator/Validators/NotEmpty.php create mode 100644 libs/SimpleValidator/Validators/NotEquals.php create mode 100644 libs/SimpleValidator/Validators/NotInArray.php create mode 100644 libs/SimpleValidator/Validators/Numeric.php create mode 100644 libs/SimpleValidator/Validators/Range.php create mode 100644 libs/SimpleValidator/Validators/Required.php create mode 100644 libs/SimpleValidator/Validators/Unique.php delete mode 100644 vendor/fguillot/simple-queue/LICENSE delete mode 100644 vendor/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php delete mode 100644 vendor/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php delete mode 100644 vendor/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php delete mode 100644 vendor/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php delete mode 100644 vendor/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php delete mode 100644 vendor/fguillot/simple-queue/src/Exception/NotSupportedException.php delete mode 100644 vendor/fguillot/simple-queue/src/Job.php delete mode 100644 vendor/fguillot/simple-queue/src/Queue.php delete mode 100644 vendor/fguillot/simple-queue/src/QueueAdapterInterface.php delete mode 100644 vendor/fguillot/simple-validator/LICENSE delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validator.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php delete mode 100644 vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php diff --git a/composer.json b/composer.json index 2d7ec51a..95a6e73f 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,6 @@ "erusev/parsedown" : "1.6.0", "fguillot/json-rpc" : "1.2.1", "fguillot/picodb" : "v1.0.18", - "fguillot/simple-validator" : "1.0.1", - "fguillot/simple-queue" : "1.0.1", "paragonie/random_compat": "2.0.11", "pimple/pimple" : "3.2.2", "psr/log": "~1.0", @@ -47,6 +45,9 @@ "psr-4" : { "Kanboard\\" : "app/" }, + "psr-0" : { + "": "libs/" + }, "files" : [ "app/functions.php" ] diff --git a/composer.lock b/composer.lock index 76cff2aa..31af6394 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "f8d9d35adda9c522defa8e3c519f5a23", + "content-hash": "bc94bc536e82cb9a522675ff6bed4dad", "packages": [ { "name": "aferrandini/phpqrcode", @@ -326,91 +326,6 @@ "homepage": "https://github.com/fguillot/picoDb", "time": "2018-03-05T22:39:16+00:00" }, - { - "name": "fguillot/simple-queue", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/fguillot/simple-queue.git", - "reference": "ce7801c507f9501bcca455129fb04c3d2107d5ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/simple-queue/zipball/ce7801c507f9501bcca455129fb04c3d2107d5ff", - "reference": "ce7801c507f9501bcca455129fb04c3d2107d5ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "aws/aws-sdk-php": "~3.0", - "mariano/disque-php": "~2.0", - "pda/pheanstalk": "~3.0", - "php-amqplib/php-amqplib": "2.6.*", - "phpunit/phpunit": "5.3.*" - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the AWS SQS queue driver (~3.0).", - "mariano/disque-php": "Required to use the Disque queue driver (~2.0).", - "pda/pheanstalk": "Required to use the Beanstalk queue driver (~3.0).", - "php-amqplib/php-amqplib": "Required to use the RabbitMQ queue driver (2.6.*)." - }, - "type": "library", - "autoload": { - "psr-4": { - "SimpleQueue\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frédéric Guillot" - } - ], - "description": "Abstraction layer for multiple queue systems", - "homepage": "https://github.com/fguillot/simple-queue", - "time": "2016-06-05T21:34:56+00:00" - }, - { - "name": "fguillot/simple-validator", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/fguillot/simpleValidator.git", - "reference": "23b0a99c5f11ad74d05f8845feaafbcfd9223eda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/simpleValidator/zipball/23b0a99c5f11ad74d05f8845feaafbcfd9223eda", - "reference": "23b0a99c5f11ad74d05f8845feaafbcfd9223eda", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "SimpleValidator": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frédéric Guillot" - } - ], - "description": "Simple validator library", - "homepage": "https://github.com/fguillot/simpleValidator", - "time": "2016-06-26T15:09:26+00:00" - }, { "name": "gregwar/captcha", "version": "v1.1.4", @@ -902,16 +817,16 @@ }, { "name": "symfony/finder", - "version": "v3.4.6", + "version": "v3.4.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625" + "reference": "7a2e1299cc0c4162996f18e347b6356729a55317" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625", + "url": "https://api.github.com/repos/symfony/finder/zipball/7a2e1299cc0c4162996f18e347b6356729a55317", + "reference": "7a2e1299cc0c4162996f18e347b6356729a55317", "shasum": "" }, "require": { @@ -947,7 +862,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:11+00:00" + "time": "2018-03-28T18:23:39+00:00" }, { "name": "symfony/polyfill-mbstring", diff --git a/libs/SimpleQueue/Adapter/AmqpQueueAdapter.php b/libs/SimpleQueue/Adapter/AmqpQueueAdapter.php new file mode 100644 index 00000000..379dd9b8 --- /dev/null +++ b/libs/SimpleQueue/Adapter/AmqpQueueAdapter.php @@ -0,0 +1,138 @@ +channel = $channel; + $this->exchange = $exchange; + $this->queue = $queue; + } + + /** + * Send a job + * + * @access public + * @param Job $job + * @return $this + */ + public function push(Job $job) + { + $message = new AMQPMessage($job->serialize(), array('content_type' => 'text/plain')); + $this->channel->basic_publish($message, $this->exchange); + return $this; + } + + /** + * Schedule a job in the future + * + * @access public + * @param Job $job + * @param DateTime $dateTime + * @return $this + */ + public function schedule(Job $job, DateTime $dateTime) + { + $now = new DateTime(); + $when = clone($dateTime); + $delay = $when->getTimestamp() - $now->getTimestamp(); + + $message = new AMQPMessage($job->serialize(), array('delivery_mode' => 2)); + $message->set('application_headers', new AMQPTable(array('x-delay' => $delay))); + + $this->channel->basic_publish($message, $this->exchange); + return $this; + } + + /** + * Wait and get job from a queue + * + * @access public + * @return Job|null + */ + public function pull() + { + $message = null; + + $this->channel->basic_consume($this->queue, 'test', false, false, false, false, function ($msg) use (&$message) { + $message = $msg; + $message->delivery_info['channel']->basic_cancel($message->delivery_info['consumer_tag']); + }); + + while (count($this->channel->callbacks)) { + $this->channel->wait(); + } + + if ($message === null) { + return null; + } + + $job = new Job(); + $job->setId($message->get('delivery_tag')); + $job->unserialize($message->getBody()); + + return $job; + } + + /** + * Acknowledge a job + * + * @access public + * @param Job $job + * @return $this + */ + public function completed(Job $job) + { + $this->channel->basic_ack($job->getId()); + return $this; + } + + /** + * Mark a job as failed + * + * @access public + * @param Job $job + * @return $this + */ + public function failed(Job $job) + { + $this->channel->basic_nack($job->getId()); + return $this; + } +} diff --git a/libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php b/libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php new file mode 100644 index 00000000..407f60e2 --- /dev/null +++ b/libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php @@ -0,0 +1,120 @@ +beanstalk = $beanstalk; + $this->queueName = $queueName; + } + + /** + * Send a job + * + * @access public + * @param Job $job + * @return $this + */ + public function push(Job $job) + { + $this->beanstalk->putInTube($this->queueName, $job->serialize()); + return $this; + } + + /** + * Schedule a job in the future + * + * @access public + * @param Job $job + * @param DateTime $dateTime + * @return $this + */ + public function schedule(Job $job, DateTime $dateTime) + { + $now = new DateTime(); + $when = clone($dateTime); + $delay = $when->getTimestamp() - $now->getTimestamp(); + + $this->beanstalk->putInTube($this->queueName, $job->serialize(), Pheanstalk::DEFAULT_PRIORITY, $delay); + return $this; + } + + /** + * Wait and get job from a queue + * + * @access public + * @return Job|null + */ + public function pull() + { + $beanstalkJob = $this->beanstalk->reserveFromTube($this->queueName); + + if ($beanstalkJob === false) { + return null; + } + + $job = new Job(); + $job->setId($beanstalkJob->getId()); + $job->unserialize($beanstalkJob->getData()); + + return $job; + } + + /** + * Acknowledge a job + * + * @access public + * @param Job $job + * @return $this + */ + public function completed(Job $job) + { + $beanstalkJob = new BeanstalkJob($job->getId(), $job->serialize()); + $this->beanstalk->delete($beanstalkJob); + return $this; + } + + /** + * Mark a job as failed + * + * @access public + * @param Job $job + * @return $this + */ + public function failed(Job $job) + { + $beanstalkJob = new BeanstalkJob($job->getId(), $job->serialize()); + $this->beanstalk->bury($beanstalkJob); + return $this; + } +} diff --git a/libs/SimpleQueue/Exception/NotSupportedException.php b/libs/SimpleQueue/Exception/NotSupportedException.php new file mode 100644 index 00000000..36106659 --- /dev/null +++ b/libs/SimpleQueue/Exception/NotSupportedException.php @@ -0,0 +1,14 @@ +body = $body; + $this->id = $id; + } + + /** + * Unserialize a payload + * + * @param string $payload + * @return $this + */ + public function unserialize($payload) + { + $this->body = json_decode($payload, true); + return $this; + } + + /** + * Serialize the body + * + * @return string + */ + public function serialize() + { + return json_encode($this->body); + } + + /** + * Set body + * + * @param mixed $body + * @return Job + */ + public function setBody($body) + { + $this->body = $body; + return $this; + } + + /** + * Get body + * + * @return mixed + */ + public function getBody() + { + return $this->body; + } + + /** + * Set job ID + * + * @param mixed $jobId + * @return Job + */ + public function setId($jobId) + { + $this->id = $jobId; + return $this; + } + + /** + * Get job ID + * @return mixed + */ + public function getId() + { + return $this->id; + } + + /** + * Execute job + */ + public function execute() + { + } +} diff --git a/libs/SimpleQueue/Queue.php b/libs/SimpleQueue/Queue.php new file mode 100644 index 00000000..a88b55cb --- /dev/null +++ b/libs/SimpleQueue/Queue.php @@ -0,0 +1,92 @@ +queueAdapter = $queueAdapter; + } + + /** + * Send a job + * + * @access public + * @param Job $job + * @return $this + */ + public function push(Job $job) + { + $this->queueAdapter->push($job); + return $this; + } + + /** + * Schedule a job in the future + * + * @access public + * @param Job $job + * @param DateTime $dateTime + * @return $this + */ + public function schedule(Job $job, DateTime $dateTime) + { + $this->queueAdapter->schedule($job, $dateTime); + return $this; + } + + /** + * Wait and get job from a queue + * + * @access public + * @return Job|null + */ + public function pull() + { + return $this->queueAdapter->pull(); + } + + /** + * Acknowledge a job + * + * @access public + * @param Job $job + * @return $this + */ + public function completed(Job $job) + { + $this->queueAdapter->completed($job); + return $this; + } + + /** + * Mark a job as failed + * + * @access public + * @param Job $job + * @return $this + */ + public function failed(Job $job) + { + $this->queueAdapter->failed($job); + return $this; + } +} diff --git a/libs/SimpleQueue/QueueAdapterInterface.php b/libs/SimpleQueue/QueueAdapterInterface.php new file mode 100644 index 00000000..9bda3070 --- /dev/null +++ b/libs/SimpleQueue/QueueAdapterInterface.php @@ -0,0 +1,58 @@ +data = $data; + $this->validators = $validators; + } + + public function execute() + { + $result = true; + + foreach ($this->validators as $validator) { + if (! $validator->execute($this->data)) { + $this->addError($validator->getField(), $validator->getErrorMessage()); + $result = false; + } + } + + return $result; + } + + public function addError($field, $message) + { + if (! isset($this->errors[$field])) { + $this->errors[$field] = array(); + } + + $this->errors[$field][] = $message; + } + + public function getErrors() + { + return $this->errors; + } +} diff --git a/libs/SimpleValidator/Validators/Alpha.php b/libs/SimpleValidator/Validators/Alpha.php new file mode 100644 index 00000000..c29ba481 --- /dev/null +++ b/libs/SimpleValidator/Validators/Alpha.php @@ -0,0 +1,15 @@ +isFieldNotEmpty($data)) { + return ctype_alpha($data[$this->field]); + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/AlphaNumeric.php b/libs/SimpleValidator/Validators/AlphaNumeric.php new file mode 100644 index 00000000..8d5000b4 --- /dev/null +++ b/libs/SimpleValidator/Validators/AlphaNumeric.php @@ -0,0 +1,15 @@ +isFieldNotEmpty($data)) { + return ctype_alnum($data[$this->field]); + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Base.php b/libs/SimpleValidator/Validators/Base.php new file mode 100644 index 00000000..8157ae50 --- /dev/null +++ b/libs/SimpleValidator/Validators/Base.php @@ -0,0 +1,37 @@ +field = $field; + $this->error_message = $error_message; + } + + public function getErrorMessage() + { + return $this->error_message; + } + + public function getField() + { + if (is_array($this->field)) { + return $this->field[0]; + } + + return $this->field; + } + + public function isFieldNotEmpty(array $data) + { + return isset($data[$this->field]) && $data[$this->field] !== ''; + } +} diff --git a/libs/SimpleValidator/Validators/Date.php b/libs/SimpleValidator/Validators/Date.php new file mode 100644 index 00000000..4ec4b7fd --- /dev/null +++ b/libs/SimpleValidator/Validators/Date.php @@ -0,0 +1,45 @@ +formats = $formats; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + foreach ($this->formats as $format) { + if ($this->isValidDate($data[$this->field], $format)) { + return true; + } + } + + return false; + } + + return true; + } + + public function isValidDate($value, $format) + { + $date = DateTime::createFromFormat($format, $value); + + if ($date !== false) { + $errors = DateTime::getLastErrors(); + if ($errors['error_count'] === 0 && $errors['warning_count'] === 0) { + return $date->getTimestamp() > 0; + } + } + + return false; + } +} diff --git a/libs/SimpleValidator/Validators/Email.php b/libs/SimpleValidator/Validators/Email.php new file mode 100644 index 00000000..f3977042 --- /dev/null +++ b/libs/SimpleValidator/Validators/Email.php @@ -0,0 +1,67 @@ +isFieldNotEmpty($data)) { + + // I use the same validation method as Firefox + // http://hg.mozilla.org/mozilla-central/file/cf5da681d577/content/html/content/src/nsHTMLInputElement.cpp#l3967 + + $value = $data[$this->field]; + $length = strlen($value); + + // If the email address begins with a '@' or ends with a '.', + // we know it's invalid. + if ($value[0] === '@' || $value[$length - 1] === '.') { + + return false; + } + + // Check the username + for ($i = 0; $i < $length && $value[$i] !== '@'; ++$i) { + + $c = $value[$i]; + + if (! (ctype_alnum($c) || $c === '.' || $c === '!' || $c === '#' || $c === '$' || + $c === '%' || $c === '&' || $c === '\'' || $c === '*' || $c === '+' || + $c === '-' || $c === '/' || $c === '=' || $c === '?' || $c === '^' || + $c === '_' || $c === '`' || $c === '{' || $c === '|' || $c === '}' || + $c === '~')) { + + return false; + } + } + + // There is no domain name (or it's one-character long), + // that's not a valid email address. + if (++$i >= $length) return false; + if (($i + 1) === $length) return false; + + // The domain name can't begin with a dot. + if ($value[$i] === '.') return false; + + // Parsing the domain name. + for (; $i < $length; ++$i) { + + $c = $value[$i]; + + if ($c === '.') { + + // A dot can't follow a dot. + if ($value[$i - 1] === '.') return false; + } + elseif (! (ctype_alnum($c) || $c === '-')) { + + // The domain characters have to be in this list to be valid. + return false; + } + } + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Equals.php b/libs/SimpleValidator/Validators/Equals.php new file mode 100644 index 00000000..6b69dd80 --- /dev/null +++ b/libs/SimpleValidator/Validators/Equals.php @@ -0,0 +1,27 @@ +field2 = $field2; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + if (! isset($data[$this->field2])) { + return false; + } + + return $data[$this->field] === $data[$this->field2]; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Exists.php b/libs/SimpleValidator/Validators/Exists.php new file mode 100644 index 00000000..1998e673 --- /dev/null +++ b/libs/SimpleValidator/Validators/Exists.php @@ -0,0 +1,38 @@ +pdo = $pdo; + $this->table = $table; + $this->key = $key; + } + + + public function execute(array $data) + { + if (! $this->isFieldNotEmpty($data)) { + return true; + } + + if ($this->key === '') { + $this->key = $this->field; + } + + $rq = $this->pdo->prepare('SELECT 1 FROM '.$this->table.' WHERE '.$this->key.'=?'); + $rq->execute(array($data[$this->field])); + + return $rq->fetchColumn() == 1; + } +} diff --git a/libs/SimpleValidator/Validators/GreaterThan.php b/libs/SimpleValidator/Validators/GreaterThan.php new file mode 100644 index 00000000..6e560319 --- /dev/null +++ b/libs/SimpleValidator/Validators/GreaterThan.php @@ -0,0 +1,23 @@ +min = $min; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + return $data[$this->field] > $this->min; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/InArray.php b/libs/SimpleValidator/Validators/InArray.php new file mode 100644 index 00000000..f2f8c134 --- /dev/null +++ b/libs/SimpleValidator/Validators/InArray.php @@ -0,0 +1,23 @@ +array = $array; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + return in_array($data[$this->field], $this->array); + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Integer.php b/libs/SimpleValidator/Validators/Integer.php new file mode 100644 index 00000000..5afdc1e0 --- /dev/null +++ b/libs/SimpleValidator/Validators/Integer.php @@ -0,0 +1,25 @@ +isFieldNotEmpty($data)) { + if (is_string($data[$this->field])) { + + if ($data[$this->field][0] === '-') { + return ctype_digit(substr($data[$this->field], 1)); + } + + return ctype_digit($data[$this->field]); + } + else { + return is_int($data[$this->field]); + } + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Ip.php b/libs/SimpleValidator/Validators/Ip.php new file mode 100644 index 00000000..754f4f3e --- /dev/null +++ b/libs/SimpleValidator/Validators/Ip.php @@ -0,0 +1,15 @@ +isFieldNotEmpty($data)) { + return filter_var($data[$this->field], FILTER_VALIDATE_IP) !== false; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Length.php b/libs/SimpleValidator/Validators/Length.php new file mode 100644 index 00000000..7ef241c4 --- /dev/null +++ b/libs/SimpleValidator/Validators/Length.php @@ -0,0 +1,26 @@ +min = $min; + $this->max = $max; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + $length = mb_strlen($data[$this->field], 'UTF-8'); + return $length >= $this->min && $length <= $this->max; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/MaxLength.php b/libs/SimpleValidator/Validators/MaxLength.php new file mode 100644 index 00000000..6c4e7771 --- /dev/null +++ b/libs/SimpleValidator/Validators/MaxLength.php @@ -0,0 +1,24 @@ +max = $max; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + $length = mb_strlen($data[$this->field], 'UTF-8'); + return $length <= $this->max; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/MinLength.php b/libs/SimpleValidator/Validators/MinLength.php new file mode 100644 index 00000000..0ac4217a --- /dev/null +++ b/libs/SimpleValidator/Validators/MinLength.php @@ -0,0 +1,24 @@ +min = $min; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + $length = mb_strlen($data[$this->field], 'UTF-8'); + return $length >= $this->min; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/NotEmpty.php b/libs/SimpleValidator/Validators/NotEmpty.php new file mode 100644 index 00000000..bbb14b5b --- /dev/null +++ b/libs/SimpleValidator/Validators/NotEmpty.php @@ -0,0 +1,15 @@ +field, $data)) { + return $data[$this->field] !== null && $data[$this->field] !== ''; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/NotEquals.php b/libs/SimpleValidator/Validators/NotEquals.php new file mode 100644 index 00000000..d1d949ea --- /dev/null +++ b/libs/SimpleValidator/Validators/NotEquals.php @@ -0,0 +1,28 @@ +field2 = $field2; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + + if (! isset($data[$this->field2])) { + return true; + } + + return $data[$this->field] !== $data[$this->field2]; + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/NotInArray.php b/libs/SimpleValidator/Validators/NotInArray.php new file mode 100644 index 00000000..98974c9c --- /dev/null +++ b/libs/SimpleValidator/Validators/NotInArray.php @@ -0,0 +1,15 @@ +isFieldNotEmpty($data)) { + return ! in_array($data[$this->field], $this->array); + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Numeric.php b/libs/SimpleValidator/Validators/Numeric.php new file mode 100644 index 00000000..31226866 --- /dev/null +++ b/libs/SimpleValidator/Validators/Numeric.php @@ -0,0 +1,15 @@ +isFieldNotEmpty($data)) { + return is_numeric($data[$this->field]); + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Range.php b/libs/SimpleValidator/Validators/Range.php new file mode 100644 index 00000000..065b2b9d --- /dev/null +++ b/libs/SimpleValidator/Validators/Range.php @@ -0,0 +1,33 @@ +min = $min; + $this->max = $max; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + + if (! is_numeric($data[$this->field])) { + return false; + } + + if ($data[$this->field] < $this->min || $data[$this->field] > $this->max) { + return false; + } + } + + return true; + } +} diff --git a/libs/SimpleValidator/Validators/Required.php b/libs/SimpleValidator/Validators/Required.php new file mode 100644 index 00000000..f5e65616 --- /dev/null +++ b/libs/SimpleValidator/Validators/Required.php @@ -0,0 +1,11 @@ +isFieldNotEmpty($data); + } +} diff --git a/libs/SimpleValidator/Validators/Unique.php b/libs/SimpleValidator/Validators/Unique.php new file mode 100644 index 00000000..00caeb54 --- /dev/null +++ b/libs/SimpleValidator/Validators/Unique.php @@ -0,0 +1,48 @@ +pdo = $pdo; + $this->primary_key = $primary_key; + $this->table = $table; + } + + public function execute(array $data) + { + if ($this->isFieldNotEmpty($data)) { + if (! isset($data[$this->primary_key])) { + $rq = $this->pdo->prepare('SELECT 1 FROM '.$this->table.' WHERE '.$this->field.'=?'); + $rq->execute(array($data[$this->field])); + } + else { + + $rq = $this->pdo->prepare( + 'SELECT 1 FROM '.$this->table.' + WHERE '.$this->field.'=? AND '.$this->primary_key.' != ?' + ); + + $rq->execute(array($data[$this->field], $data[$this->primary_key])); + } + + $result = $rq->fetchColumn(); + + if ($result == 1) { // Postgresql returns an integer but other database returns a string '1' + return false; + } + } + + return true; + } +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index f86dc910..0c4445b7 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -129,6 +129,7 @@ return array( 'Kanboard\\Api\\Procedure\\LinkProcedure' => $baseDir . '/app/Api/Procedure/LinkProcedure.php', 'Kanboard\\Api\\Procedure\\MeProcedure' => $baseDir . '/app/Api/Procedure/MeProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectFileProcedure' => $baseDir . '/app/Api/Procedure/ProjectFileProcedure.php', + 'Kanboard\\Api\\Procedure\\ProjectMetadataProcedure' => $baseDir . '/app/Api/Procedure/ProjectMetaDataProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectPermissionProcedure' => $baseDir . '/app/Api/Procedure/ProjectPermissionProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectProcedure' => $baseDir . '/app/Api/Procedure/ProjectProcedure.php', 'Kanboard\\Api\\Procedure\\SubtaskProcedure' => $baseDir . '/app/Api/Procedure/SubtaskProcedure.php', @@ -741,37 +742,34 @@ return array( 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'SimpleQueue\\Adapter\\AmqpQueueAdapter' => $vendorDir . '/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php', - 'SimpleQueue\\Adapter\\AwsSqsQueueAdapter' => $vendorDir . '/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php', - 'SimpleQueue\\Adapter\\BeanstalkQueueAdapter' => $vendorDir . '/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php', - 'SimpleQueue\\Adapter\\DisqueQueueAdapter' => $vendorDir . '/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php', - 'SimpleQueue\\Adapter\\MemoryQueueAdapter' => $vendorDir . '/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php', - 'SimpleQueue\\Exception\\NotSupportedException' => $vendorDir . '/fguillot/simple-queue/src/Exception/NotSupportedException.php', - 'SimpleQueue\\Job' => $vendorDir . '/fguillot/simple-queue/src/Job.php', - 'SimpleQueue\\Queue' => $vendorDir . '/fguillot/simple-queue/src/Queue.php', - 'SimpleQueue\\QueueAdapterInterface' => $vendorDir . '/fguillot/simple-queue/src/QueueAdapterInterface.php', - 'SimpleValidator\\Validator' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validator.php', - 'SimpleValidator\\Validators\\Alpha' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php', - 'SimpleValidator\\Validators\\AlphaNumeric' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php', - 'SimpleValidator\\Validators\\Base' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php', - 'SimpleValidator\\Validators\\Date' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php', - 'SimpleValidator\\Validators\\Email' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php', - 'SimpleValidator\\Validators\\Equals' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php', - 'SimpleValidator\\Validators\\Exists' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php', - 'SimpleValidator\\Validators\\GreaterThan' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php', - 'SimpleValidator\\Validators\\InArray' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php', - 'SimpleValidator\\Validators\\Integer' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php', - 'SimpleValidator\\Validators\\Ip' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php', - 'SimpleValidator\\Validators\\Length' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php', - 'SimpleValidator\\Validators\\MaxLength' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php', - 'SimpleValidator\\Validators\\MinLength' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php', - 'SimpleValidator\\Validators\\NotEmpty' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php', - 'SimpleValidator\\Validators\\NotEquals' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php', - 'SimpleValidator\\Validators\\NotInArray' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php', - 'SimpleValidator\\Validators\\Numeric' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php', - 'SimpleValidator\\Validators\\Range' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php', - 'SimpleValidator\\Validators\\Required' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php', - 'SimpleValidator\\Validators\\Unique' => $vendorDir . '/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php', + 'SimpleQueue\\Adapter\\AmqpQueueAdapter' => $baseDir . '/libs/SimpleQueue/Adapter/AmqpQueueAdapter.php', + 'SimpleQueue\\Adapter\\BeanstalkQueueAdapter' => $baseDir . '/libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php', + 'SimpleQueue\\Exception\\NotSupportedException' => $baseDir . '/libs/SimpleQueue/Exception/NotSupportedException.php', + 'SimpleQueue\\Job' => $baseDir . '/libs/SimpleQueue/Job.php', + 'SimpleQueue\\Queue' => $baseDir . '/libs/SimpleQueue/Queue.php', + 'SimpleQueue\\QueueAdapterInterface' => $baseDir . '/libs/SimpleQueue/QueueAdapterInterface.php', + 'SimpleValidator\\Validator' => $baseDir . '/libs/SimpleValidator/Validator.php', + 'SimpleValidator\\Validators\\Alpha' => $baseDir . '/libs/SimpleValidator/Validators/Alpha.php', + 'SimpleValidator\\Validators\\AlphaNumeric' => $baseDir . '/libs/SimpleValidator/Validators/AlphaNumeric.php', + 'SimpleValidator\\Validators\\Base' => $baseDir . '/libs/SimpleValidator/Validators/Base.php', + 'SimpleValidator\\Validators\\Date' => $baseDir . '/libs/SimpleValidator/Validators/Date.php', + 'SimpleValidator\\Validators\\Email' => $baseDir . '/libs/SimpleValidator/Validators/Email.php', + 'SimpleValidator\\Validators\\Equals' => $baseDir . '/libs/SimpleValidator/Validators/Equals.php', + 'SimpleValidator\\Validators\\Exists' => $baseDir . '/libs/SimpleValidator/Validators/Exists.php', + 'SimpleValidator\\Validators\\GreaterThan' => $baseDir . '/libs/SimpleValidator/Validators/GreaterThan.php', + 'SimpleValidator\\Validators\\InArray' => $baseDir . '/libs/SimpleValidator/Validators/InArray.php', + 'SimpleValidator\\Validators\\Integer' => $baseDir . '/libs/SimpleValidator/Validators/Integer.php', + 'SimpleValidator\\Validators\\Ip' => $baseDir . '/libs/SimpleValidator/Validators/Ip.php', + 'SimpleValidator\\Validators\\Length' => $baseDir . '/libs/SimpleValidator/Validators/Length.php', + 'SimpleValidator\\Validators\\MaxLength' => $baseDir . '/libs/SimpleValidator/Validators/MaxLength.php', + 'SimpleValidator\\Validators\\MinLength' => $baseDir . '/libs/SimpleValidator/Validators/MinLength.php', + 'SimpleValidator\\Validators\\NotEmpty' => $baseDir . '/libs/SimpleValidator/Validators/NotEmpty.php', + 'SimpleValidator\\Validators\\NotEquals' => $baseDir . '/libs/SimpleValidator/Validators/NotEquals.php', + 'SimpleValidator\\Validators\\NotInArray' => $baseDir . '/libs/SimpleValidator/Validators/NotInArray.php', + 'SimpleValidator\\Validators\\Numeric' => $baseDir . '/libs/SimpleValidator/Validators/Numeric.php', + 'SimpleValidator\\Validators\\Range' => $baseDir . '/libs/SimpleValidator/Validators/Range.php', + 'SimpleValidator\\Validators\\Required' => $baseDir . '/libs/SimpleValidator/Validators/Required.php', + 'SimpleValidator\\Validators\\Unique' => $baseDir . '/libs/SimpleValidator/Validators/Unique.php', 'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php', 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php', 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php', diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 133559c8..c40ec570 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'SimpleValidator' => array($vendorDir . '/fguillot/simple-validator/src'), 'Pimple' => array($vendorDir . '/pimple/pimple/src'), 'PicoDb' => array($vendorDir . '/fguillot/picodb/lib'), 'Parsedown' => array($vendorDir . '/erusev/parsedown'), @@ -14,4 +13,5 @@ return array( 'Otp' => array($vendorDir . '/christian-riesen/otp/src'), 'JsonRPC' => array($vendorDir . '/fguillot/json-rpc/src'), 'Eluceo\\iCal' => array($vendorDir . '/eluceo/ical/src'), + '' => array($baseDir . '/libs'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 284d4042..0431d31f 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -11,7 +11,6 @@ return array( 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'SimpleQueue\\' => array($vendorDir . '/fguillot/simple-queue/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Kanboard\\' => array($baseDir . '/app'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5e3804fc..bca69b0d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -21,7 +21,6 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e 'Symfony\\Component\\EventDispatcher\\' => 34, 'Symfony\\Component\\Debug\\' => 24, 'Symfony\\Component\\Console\\' => 26, - 'SimpleQueue\\' => 12, ), 'P' => array ( @@ -63,10 +62,6 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e array ( 0 => __DIR__ . '/..' . '/symfony/console', ), - 'SimpleQueue\\' => - array ( - 0 => __DIR__ . '/..' . '/fguillot/simple-queue/src', - ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', @@ -90,13 +85,6 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e ); public static $prefixesPsr0 = array ( - 'S' => - array ( - 'SimpleValidator' => - array ( - 0 => __DIR__ . '/..' . '/fguillot/simple-validator/src', - ), - ), 'P' => array ( 'Pimple' => @@ -139,6 +127,10 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e ), ); + public static $fallbackDirsPsr0 = array ( + 0 => __DIR__ . '/../..' . '/libs', + ); + public static $classMap = array ( 'Base32\\Base32' => __DIR__ . '/..' . '/christian-riesen/base32/src/Base32.php', 'Eluceo\\iCal\\Component' => __DIR__ . '/..' . '/eluceo/ical/src/Eluceo/iCal/Component.php', @@ -263,6 +255,7 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e 'Kanboard\\Api\\Procedure\\LinkProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/LinkProcedure.php', 'Kanboard\\Api\\Procedure\\MeProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/MeProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectFileProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/ProjectFileProcedure.php', + 'Kanboard\\Api\\Procedure\\ProjectMetadataProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/ProjectMetaDataProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectPermissionProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/ProjectPermissionProcedure.php', 'Kanboard\\Api\\Procedure\\ProjectProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/ProjectProcedure.php', 'Kanboard\\Api\\Procedure\\SubtaskProcedure' => __DIR__ . '/../..' . '/app/Api/Procedure/SubtaskProcedure.php', @@ -875,37 +868,34 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'SimpleQueue\\Adapter\\AmqpQueueAdapter' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php', - 'SimpleQueue\\Adapter\\AwsSqsQueueAdapter' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php', - 'SimpleQueue\\Adapter\\BeanstalkQueueAdapter' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php', - 'SimpleQueue\\Adapter\\DisqueQueueAdapter' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php', - 'SimpleQueue\\Adapter\\MemoryQueueAdapter' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php', - 'SimpleQueue\\Exception\\NotSupportedException' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Exception/NotSupportedException.php', - 'SimpleQueue\\Job' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Job.php', - 'SimpleQueue\\Queue' => __DIR__ . '/..' . '/fguillot/simple-queue/src/Queue.php', - 'SimpleQueue\\QueueAdapterInterface' => __DIR__ . '/..' . '/fguillot/simple-queue/src/QueueAdapterInterface.php', - 'SimpleValidator\\Validator' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validator.php', - 'SimpleValidator\\Validators\\Alpha' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php', - 'SimpleValidator\\Validators\\AlphaNumeric' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php', - 'SimpleValidator\\Validators\\Base' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php', - 'SimpleValidator\\Validators\\Date' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php', - 'SimpleValidator\\Validators\\Email' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php', - 'SimpleValidator\\Validators\\Equals' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php', - 'SimpleValidator\\Validators\\Exists' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php', - 'SimpleValidator\\Validators\\GreaterThan' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php', - 'SimpleValidator\\Validators\\InArray' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php', - 'SimpleValidator\\Validators\\Integer' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php', - 'SimpleValidator\\Validators\\Ip' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php', - 'SimpleValidator\\Validators\\Length' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php', - 'SimpleValidator\\Validators\\MaxLength' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php', - 'SimpleValidator\\Validators\\MinLength' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php', - 'SimpleValidator\\Validators\\NotEmpty' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php', - 'SimpleValidator\\Validators\\NotEquals' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php', - 'SimpleValidator\\Validators\\NotInArray' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php', - 'SimpleValidator\\Validators\\Numeric' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php', - 'SimpleValidator\\Validators\\Range' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php', - 'SimpleValidator\\Validators\\Required' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php', - 'SimpleValidator\\Validators\\Unique' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php', + 'SimpleQueue\\Adapter\\AmqpQueueAdapter' => __DIR__ . '/../..' . '/libs/SimpleQueue/Adapter/AmqpQueueAdapter.php', + 'SimpleQueue\\Adapter\\BeanstalkQueueAdapter' => __DIR__ . '/../..' . '/libs/SimpleQueue/Adapter/BeanstalkQueueAdapter.php', + 'SimpleQueue\\Exception\\NotSupportedException' => __DIR__ . '/../..' . '/libs/SimpleQueue/Exception/NotSupportedException.php', + 'SimpleQueue\\Job' => __DIR__ . '/../..' . '/libs/SimpleQueue/Job.php', + 'SimpleQueue\\Queue' => __DIR__ . '/../..' . '/libs/SimpleQueue/Queue.php', + 'SimpleQueue\\QueueAdapterInterface' => __DIR__ . '/../..' . '/libs/SimpleQueue/QueueAdapterInterface.php', + 'SimpleValidator\\Validator' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validator.php', + 'SimpleValidator\\Validators\\Alpha' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Alpha.php', + 'SimpleValidator\\Validators\\AlphaNumeric' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/AlphaNumeric.php', + 'SimpleValidator\\Validators\\Base' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Base.php', + 'SimpleValidator\\Validators\\Date' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Date.php', + 'SimpleValidator\\Validators\\Email' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Email.php', + 'SimpleValidator\\Validators\\Equals' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Equals.php', + 'SimpleValidator\\Validators\\Exists' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Exists.php', + 'SimpleValidator\\Validators\\GreaterThan' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/GreaterThan.php', + 'SimpleValidator\\Validators\\InArray' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/InArray.php', + 'SimpleValidator\\Validators\\Integer' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Integer.php', + 'SimpleValidator\\Validators\\Ip' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Ip.php', + 'SimpleValidator\\Validators\\Length' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Length.php', + 'SimpleValidator\\Validators\\MaxLength' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/MaxLength.php', + 'SimpleValidator\\Validators\\MinLength' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/MinLength.php', + 'SimpleValidator\\Validators\\NotEmpty' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/NotEmpty.php', + 'SimpleValidator\\Validators\\NotEquals' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/NotEquals.php', + 'SimpleValidator\\Validators\\NotInArray' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/NotInArray.php', + 'SimpleValidator\\Validators\\Numeric' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Numeric.php', + 'SimpleValidator\\Validators\\Range' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Range.php', + 'SimpleValidator\\Validators\\Required' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Required.php', + 'SimpleValidator\\Validators\\Unique' => __DIR__ . '/../..' . '/libs/SimpleValidator/Validators/Unique.php', 'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php', 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php', 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php', @@ -1043,6 +1033,7 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e $loader->prefixLengthsPsr4 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixesPsr0; + $loader->fallbackDirsPsr0 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$fallbackDirsPsr0; $loader->classMap = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$classMap; }, null, ClassLoader::class); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 24b51fc4..2423a5dd 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -291,95 +291,6 @@ "description": "Simple Json-RPC client/server library that just works", "homepage": "https://github.com/fguillot/JsonRPC" }, - { - "name": "fguillot/simple-queue", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/fguillot/simple-queue.git", - "reference": "ce7801c507f9501bcca455129fb04c3d2107d5ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/simple-queue/zipball/ce7801c507f9501bcca455129fb04c3d2107d5ff", - "reference": "ce7801c507f9501bcca455129fb04c3d2107d5ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "aws/aws-sdk-php": "~3.0", - "mariano/disque-php": "~2.0", - "pda/pheanstalk": "~3.0", - "php-amqplib/php-amqplib": "2.6.*", - "phpunit/phpunit": "5.3.*" - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the AWS SQS queue driver (~3.0).", - "mariano/disque-php": "Required to use the Disque queue driver (~2.0).", - "pda/pheanstalk": "Required to use the Beanstalk queue driver (~3.0).", - "php-amqplib/php-amqplib": "Required to use the RabbitMQ queue driver (2.6.*)." - }, - "time": "2016-06-05T21:34:56+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "SimpleQueue\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frédéric Guillot" - } - ], - "description": "Abstraction layer for multiple queue systems", - "homepage": "https://github.com/fguillot/simple-queue" - }, - { - "name": "fguillot/simple-validator", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/fguillot/simpleValidator.git", - "reference": "23b0a99c5f11ad74d05f8845feaafbcfd9223eda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/simpleValidator/zipball/23b0a99c5f11ad74d05f8845feaafbcfd9223eda", - "reference": "23b0a99c5f11ad74d05f8845feaafbcfd9223eda", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-06-26T15:09:26+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "SimpleValidator": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frédéric Guillot" - } - ], - "description": "Simple validator library", - "homepage": "https://github.com/fguillot/simpleValidator" - }, { "name": "psr/log", "version": "1.0.2", @@ -992,23 +903,23 @@ }, { "name": "symfony/finder", - "version": "v3.4.6", - "version_normalized": "3.4.6.0", + "version": "v3.4.7", + "version_normalized": "3.4.7.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625" + "reference": "7a2e1299cc0c4162996f18e347b6356729a55317" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625", + "url": "https://api.github.com/repos/symfony/finder/zipball/7a2e1299cc0c4162996f18e347b6356729a55317", + "reference": "7a2e1299cc0c4162996f18e347b6356729a55317", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, - "time": "2018-03-05T18:28:11+00:00", + "time": "2018-03-28T18:23:39+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/fguillot/simple-queue/LICENSE b/vendor/fguillot/simple-queue/LICENSE deleted file mode 100644 index a19d63a3..00000000 --- a/vendor/fguillot/simple-queue/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Frédéric Guillot - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php b/vendor/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php deleted file mode 100644 index 379dd9b8..00000000 --- a/vendor/fguillot/simple-queue/src/Adapter/AmqpQueueAdapter.php +++ /dev/null @@ -1,138 +0,0 @@ -channel = $channel; - $this->exchange = $exchange; - $this->queue = $queue; - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $message = new AMQPMessage($job->serialize(), array('content_type' => 'text/plain')); - $this->channel->basic_publish($message, $this->exchange); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return $this - */ - public function schedule(Job $job, DateTime $dateTime) - { - $now = new DateTime(); - $when = clone($dateTime); - $delay = $when->getTimestamp() - $now->getTimestamp(); - - $message = new AMQPMessage($job->serialize(), array('delivery_mode' => 2)); - $message->set('application_headers', new AMQPTable(array('x-delay' => $delay))); - - $this->channel->basic_publish($message, $this->exchange); - return $this; - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - $message = null; - - $this->channel->basic_consume($this->queue, 'test', false, false, false, false, function ($msg) use (&$message) { - $message = $msg; - $message->delivery_info['channel']->basic_cancel($message->delivery_info['consumer_tag']); - }); - - while (count($this->channel->callbacks)) { - $this->channel->wait(); - } - - if ($message === null) { - return null; - } - - $job = new Job(); - $job->setId($message->get('delivery_tag')); - $job->unserialize($message->getBody()); - - return $job; - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - $this->channel->basic_ack($job->getId()); - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $this->channel->basic_nack($job->getId()); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php b/vendor/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php deleted file mode 100644 index 01377317..00000000 --- a/vendor/fguillot/simple-queue/src/Adapter/AwsSqsQueueAdapter.php +++ /dev/null @@ -1,150 +0,0 @@ - - */ -class AwsSqsQueueAdapter implements QueueAdapterInterface -{ - /** - * @var string - */ - private $queueName; - - /** - * @var SqsClient - */ - private $sqsClient; - - /** - * @var string - */ - private $sqsUrl; - - /** - * @var array - */ - private $config; - - /** - * AwsSqsQueueAdapter constructor. - * - * @param string $queueName The name of the SQS queue - * @param SqsClient $sqsClient An SQS client - * @param array $config Array of config values - */ - public function __construct($queueName, SqsClient $sqsClient, $config = array()) - { - $this->queueName = $queueName; - $this->sqsClient = $sqsClient; - $this->sqsUrl = $this->sqsClient->getQueueUrl(array('QueueName' => $this->queueName))->get('QueueUrl'); - $this->config = $config; - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $this->sqsClient->sendMessage(array( - 'QueueUrl' => $this->sqsUrl, - 'MessageBody' => $job->serialize() - )); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return $this - */ - public function schedule(Job $job, DateTime $dateTime) - { - $now = new DateTime(); - $when = clone($dateTime); - $delay = $when->getTimestamp() - $now->getTimestamp(); - - $this->sqsClient->sendMessage(array( - 'QueueUrl' => $this->sqsUrl, - 'MessageBody' => $job->serialize(), - 'VisibilityTimeout' => $delay - )); - - return $this; - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - $result = $this->sqsClient->receiveMessage(array( - 'QueueUrl' => $this->sqsUrl, - 'WaitTimeSeconds' => empty($this->config['LongPollingTime']) ? 0 : (int) $this->config['LongPollingTime'] - )); - - if ($result['Messages'] == null) { - return null; - } - - $resultMessage = array_pop($result['Messages']); - - $job = new Job(); - $job->setId($resultMessage['ReceiptHandle']); - $job->unserialize($resultMessage['Body']); - - return $job; - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - $this->sqsClient->deleteMessage(array( - 'QueueUrl' => $this->sqsUrl, - 'ReceiptHandle' => $job->getId() - )); - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $this->sqsClient->changeMessageVisibility(array( - 'QueueUrl' => $this->sqsUrl, - 'ReceiptHandle' => $job->getId(), - 'VisibilityTimeout' => 0 - )); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php b/vendor/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php deleted file mode 100644 index 407f60e2..00000000 --- a/vendor/fguillot/simple-queue/src/Adapter/BeanstalkQueueAdapter.php +++ /dev/null @@ -1,120 +0,0 @@ -beanstalk = $beanstalk; - $this->queueName = $queueName; - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $this->beanstalk->putInTube($this->queueName, $job->serialize()); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return $this - */ - public function schedule(Job $job, DateTime $dateTime) - { - $now = new DateTime(); - $when = clone($dateTime); - $delay = $when->getTimestamp() - $now->getTimestamp(); - - $this->beanstalk->putInTube($this->queueName, $job->serialize(), Pheanstalk::DEFAULT_PRIORITY, $delay); - return $this; - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - $beanstalkJob = $this->beanstalk->reserveFromTube($this->queueName); - - if ($beanstalkJob === false) { - return null; - } - - $job = new Job(); - $job->setId($beanstalkJob->getId()); - $job->unserialize($beanstalkJob->getData()); - - return $job; - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - $beanstalkJob = new BeanstalkJob($job->getId(), $job->serialize()); - $this->beanstalk->delete($beanstalkJob); - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $beanstalkJob = new BeanstalkJob($job->getId(), $job->serialize()); - $this->beanstalk->bury($beanstalkJob); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php b/vendor/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php deleted file mode 100644 index 047658d7..00000000 --- a/vendor/fguillot/simple-queue/src/Adapter/DisqueQueueAdapter.php +++ /dev/null @@ -1,109 +0,0 @@ -disque = $disque; - $this->queueName = $queueName; - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $this->disque->queue($this->queueName)->push(new DisqueJob($job->getBody())); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return $this - */ - public function schedule(Job $job, DateTime $dateTime) - { - $this->disque->queue($this->queueName)->schedule(new DisqueJob($job->serialize()), $dateTime); - return $this; - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - $disqueJob = $this->disque->queue($this->queueName)->pull(); - - if ($disqueJob === null) { - return null; - } - - return new Job($disqueJob->getBody(), $disqueJob->getId()); - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - $this->disque->queue($this->queueName)->processed(new DisqueJob($job->getBody(), $job->getId())); - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $this->disque->queue($this->queueName)->failed(new DisqueJob($job->getBody(), $job->getId())); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php b/vendor/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php deleted file mode 100644 index 36375d5b..00000000 --- a/vendor/fguillot/simple-queue/src/Adapter/MemoryQueueAdapter.php +++ /dev/null @@ -1,100 +0,0 @@ -queue = new SplQueue(); - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $this->queue->enqueue($job->serialize()); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return bool - * @throws NotSupportedException - */ - public function schedule(Job $job, DateTime $dateTime) - { - throw new NotSupportedException('Job delay is not supported by MemoryQueue'); - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - try { - $job = new Job(); - $payload = $this->queue->dequeue(); - return $job->unserialize($payload); - } catch (Exception $e) { - return null; - } - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $this->queue->enqueue($job->serialize()); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/Exception/NotSupportedException.php b/vendor/fguillot/simple-queue/src/Exception/NotSupportedException.php deleted file mode 100644 index 36106659..00000000 --- a/vendor/fguillot/simple-queue/src/Exception/NotSupportedException.php +++ /dev/null @@ -1,14 +0,0 @@ -body = $body; - $this->id = $id; - } - - /** - * Unserialize a payload - * - * @param string $payload - * @return $this - */ - public function unserialize($payload) - { - $this->body = json_decode($payload, true); - return $this; - } - - /** - * Serialize the body - * - * @return string - */ - public function serialize() - { - return json_encode($this->body); - } - - /** - * Set body - * - * @param mixed $body - * @return Job - */ - public function setBody($body) - { - $this->body = $body; - return $this; - } - - /** - * Get body - * - * @return mixed - */ - public function getBody() - { - return $this->body; - } - - /** - * Set job ID - * - * @param mixed $jobId - * @return Job - */ - public function setId($jobId) - { - $this->id = $jobId; - return $this; - } - - /** - * Get job ID - * @return mixed - */ - public function getId() - { - return $this->id; - } - - /** - * Execute job - */ - public function execute() - { - } -} diff --git a/vendor/fguillot/simple-queue/src/Queue.php b/vendor/fguillot/simple-queue/src/Queue.php deleted file mode 100644 index a88b55cb..00000000 --- a/vendor/fguillot/simple-queue/src/Queue.php +++ /dev/null @@ -1,92 +0,0 @@ -queueAdapter = $queueAdapter; - } - - /** - * Send a job - * - * @access public - * @param Job $job - * @return $this - */ - public function push(Job $job) - { - $this->queueAdapter->push($job); - return $this; - } - - /** - * Schedule a job in the future - * - * @access public - * @param Job $job - * @param DateTime $dateTime - * @return $this - */ - public function schedule(Job $job, DateTime $dateTime) - { - $this->queueAdapter->schedule($job, $dateTime); - return $this; - } - - /** - * Wait and get job from a queue - * - * @access public - * @return Job|null - */ - public function pull() - { - return $this->queueAdapter->pull(); - } - - /** - * Acknowledge a job - * - * @access public - * @param Job $job - * @return $this - */ - public function completed(Job $job) - { - $this->queueAdapter->completed($job); - return $this; - } - - /** - * Mark a job as failed - * - * @access public - * @param Job $job - * @return $this - */ - public function failed(Job $job) - { - $this->queueAdapter->failed($job); - return $this; - } -} diff --git a/vendor/fguillot/simple-queue/src/QueueAdapterInterface.php b/vendor/fguillot/simple-queue/src/QueueAdapterInterface.php deleted file mode 100644 index 9bda3070..00000000 --- a/vendor/fguillot/simple-queue/src/QueueAdapterInterface.php +++ /dev/null @@ -1,58 +0,0 @@ -data = $data; - $this->validators = $validators; - } - - public function execute() - { - $result = true; - - foreach ($this->validators as $validator) { - if (! $validator->execute($this->data)) { - $this->addError($validator->getField(), $validator->getErrorMessage()); - $result = false; - } - } - - return $result; - } - - public function addError($field, $message) - { - if (! isset($this->errors[$field])) { - $this->errors[$field] = array(); - } - - $this->errors[$field][] = $message; - } - - public function getErrors() - { - return $this->errors; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php deleted file mode 100644 index c29ba481..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php +++ /dev/null @@ -1,15 +0,0 @@ -isFieldNotEmpty($data)) { - return ctype_alpha($data[$this->field]); - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php deleted file mode 100644 index 8d5000b4..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php +++ /dev/null @@ -1,15 +0,0 @@ -isFieldNotEmpty($data)) { - return ctype_alnum($data[$this->field]); - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php deleted file mode 100644 index 8157ae50..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php +++ /dev/null @@ -1,37 +0,0 @@ -field = $field; - $this->error_message = $error_message; - } - - public function getErrorMessage() - { - return $this->error_message; - } - - public function getField() - { - if (is_array($this->field)) { - return $this->field[0]; - } - - return $this->field; - } - - public function isFieldNotEmpty(array $data) - { - return isset($data[$this->field]) && $data[$this->field] !== ''; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php deleted file mode 100644 index 4ec4b7fd..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php +++ /dev/null @@ -1,45 +0,0 @@ -formats = $formats; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - foreach ($this->formats as $format) { - if ($this->isValidDate($data[$this->field], $format)) { - return true; - } - } - - return false; - } - - return true; - } - - public function isValidDate($value, $format) - { - $date = DateTime::createFromFormat($format, $value); - - if ($date !== false) { - $errors = DateTime::getLastErrors(); - if ($errors['error_count'] === 0 && $errors['warning_count'] === 0) { - return $date->getTimestamp() > 0; - } - } - - return false; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php deleted file mode 100644 index f3977042..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php +++ /dev/null @@ -1,67 +0,0 @@ -isFieldNotEmpty($data)) { - - // I use the same validation method as Firefox - // http://hg.mozilla.org/mozilla-central/file/cf5da681d577/content/html/content/src/nsHTMLInputElement.cpp#l3967 - - $value = $data[$this->field]; - $length = strlen($value); - - // If the email address begins with a '@' or ends with a '.', - // we know it's invalid. - if ($value[0] === '@' || $value[$length - 1] === '.') { - - return false; - } - - // Check the username - for ($i = 0; $i < $length && $value[$i] !== '@'; ++$i) { - - $c = $value[$i]; - - if (! (ctype_alnum($c) || $c === '.' || $c === '!' || $c === '#' || $c === '$' || - $c === '%' || $c === '&' || $c === '\'' || $c === '*' || $c === '+' || - $c === '-' || $c === '/' || $c === '=' || $c === '?' || $c === '^' || - $c === '_' || $c === '`' || $c === '{' || $c === '|' || $c === '}' || - $c === '~')) { - - return false; - } - } - - // There is no domain name (or it's one-character long), - // that's not a valid email address. - if (++$i >= $length) return false; - if (($i + 1) === $length) return false; - - // The domain name can't begin with a dot. - if ($value[$i] === '.') return false; - - // Parsing the domain name. - for (; $i < $length; ++$i) { - - $c = $value[$i]; - - if ($c === '.') { - - // A dot can't follow a dot. - if ($value[$i - 1] === '.') return false; - } - elseif (! (ctype_alnum($c) || $c === '-')) { - - // The domain characters have to be in this list to be valid. - return false; - } - } - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php deleted file mode 100644 index 6b69dd80..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php +++ /dev/null @@ -1,27 +0,0 @@ -field2 = $field2; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - if (! isset($data[$this->field2])) { - return false; - } - - return $data[$this->field] === $data[$this->field2]; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php deleted file mode 100644 index 1998e673..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php +++ /dev/null @@ -1,38 +0,0 @@ -pdo = $pdo; - $this->table = $table; - $this->key = $key; - } - - - public function execute(array $data) - { - if (! $this->isFieldNotEmpty($data)) { - return true; - } - - if ($this->key === '') { - $this->key = $this->field; - } - - $rq = $this->pdo->prepare('SELECT 1 FROM '.$this->table.' WHERE '.$this->key.'=?'); - $rq->execute(array($data[$this->field])); - - return $rq->fetchColumn() == 1; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php deleted file mode 100644 index 6e560319..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php +++ /dev/null @@ -1,23 +0,0 @@ -min = $min; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - return $data[$this->field] > $this->min; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php deleted file mode 100644 index f2f8c134..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php +++ /dev/null @@ -1,23 +0,0 @@ -array = $array; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - return in_array($data[$this->field], $this->array); - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php deleted file mode 100644 index 5afdc1e0..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php +++ /dev/null @@ -1,25 +0,0 @@ -isFieldNotEmpty($data)) { - if (is_string($data[$this->field])) { - - if ($data[$this->field][0] === '-') { - return ctype_digit(substr($data[$this->field], 1)); - } - - return ctype_digit($data[$this->field]); - } - else { - return is_int($data[$this->field]); - } - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php deleted file mode 100644 index 754f4f3e..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php +++ /dev/null @@ -1,15 +0,0 @@ -isFieldNotEmpty($data)) { - return filter_var($data[$this->field], FILTER_VALIDATE_IP) !== false; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php deleted file mode 100644 index 7ef241c4..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php +++ /dev/null @@ -1,26 +0,0 @@ -min = $min; - $this->max = $max; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - $length = mb_strlen($data[$this->field], 'UTF-8'); - return $length >= $this->min && $length <= $this->max; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php deleted file mode 100644 index 6c4e7771..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php +++ /dev/null @@ -1,24 +0,0 @@ -max = $max; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - $length = mb_strlen($data[$this->field], 'UTF-8'); - return $length <= $this->max; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php deleted file mode 100644 index 0ac4217a..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php +++ /dev/null @@ -1,24 +0,0 @@ -min = $min; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - $length = mb_strlen($data[$this->field], 'UTF-8'); - return $length >= $this->min; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php deleted file mode 100644 index bbb14b5b..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEmpty.php +++ /dev/null @@ -1,15 +0,0 @@ -field, $data)) { - return $data[$this->field] !== null && $data[$this->field] !== ''; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php deleted file mode 100644 index d1d949ea..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php +++ /dev/null @@ -1,28 +0,0 @@ -field2 = $field2; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - - if (! isset($data[$this->field2])) { - return true; - } - - return $data[$this->field] !== $data[$this->field2]; - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php deleted file mode 100644 index 98974c9c..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php +++ /dev/null @@ -1,15 +0,0 @@ -isFieldNotEmpty($data)) { - return ! in_array($data[$this->field], $this->array); - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php deleted file mode 100644 index 31226866..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php +++ /dev/null @@ -1,15 +0,0 @@ -isFieldNotEmpty($data)) { - return is_numeric($data[$this->field]); - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php deleted file mode 100644 index 065b2b9d..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php +++ /dev/null @@ -1,33 +0,0 @@ -min = $min; - $this->max = $max; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - - if (! is_numeric($data[$this->field])) { - return false; - } - - if ($data[$this->field] < $this->min || $data[$this->field] > $this->max) { - return false; - } - } - - return true; - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php deleted file mode 100644 index f5e65616..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php +++ /dev/null @@ -1,11 +0,0 @@ -isFieldNotEmpty($data); - } -} diff --git a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php b/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php deleted file mode 100644 index 00caeb54..00000000 --- a/vendor/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php +++ /dev/null @@ -1,48 +0,0 @@ -pdo = $pdo; - $this->primary_key = $primary_key; - $this->table = $table; - } - - public function execute(array $data) - { - if ($this->isFieldNotEmpty($data)) { - if (! isset($data[$this->primary_key])) { - $rq = $this->pdo->prepare('SELECT 1 FROM '.$this->table.' WHERE '.$this->field.'=?'); - $rq->execute(array($data[$this->field])); - } - else { - - $rq = $this->pdo->prepare( - 'SELECT 1 FROM '.$this->table.' - WHERE '.$this->field.'=? AND '.$this->primary_key.' != ?' - ); - - $rq->execute(array($data[$this->field], $data[$this->primary_key])); - } - - $result = $rq->fetchColumn(); - - if ($result == 1) { // Postgresql returns an integer but other database returns a string '1' - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php index 19f95e26..2cf3a27f 100644 --- a/vendor/symfony/finder/SplFileInfo.php +++ b/vendor/symfony/finder/SplFileInfo.php @@ -28,7 +28,7 @@ class SplFileInfo extends \SplFileInfo */ public function __construct($file, $relativePath, $relativePathname) { - parent::__construct($file); + parent::__construct(realpath($file) ?: $file); $this->relativePath = $relativePath; $this->relativePathname = $relativePathname; } diff --git a/vendor/symfony/finder/Tests/FinderTest.php b/vendor/symfony/finder/Tests/FinderTest.php index 7e75f141..634f731a 100644 --- a/vendor/symfony/finder/Tests/FinderTest.php +++ b/vendor/symfony/finder/Tests/FinderTest.php @@ -46,6 +46,20 @@ class FinderTest extends Iterator\RealIteratorTestCase $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator()); } + public function testRemoveTrailingSlash() + { + if ('\\' === \DIRECTORY_SEPARATOR) { + $this->markTestSkipped('This test cannot be run on Windows.'); + } + + $finder = $this->buildFinder(); + + $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')); + $in = '//'.realpath(self::$tmpDir).'//'; + + $this->assertIterator($expected, $finder->in($in)->files()->getIterator()); + } + public function testDepth() { $finder = $this->buildFinder(); @@ -514,8 +528,8 @@ class FinderTest extends Iterator\RealIteratorTestCase $finder->in($locations)->depth('< 10')->name('*.neon'); $expected = array( - __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', - __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', + __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon', + __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon', ); $this->assertIterator($expected, $finder); -- cgit v1.2.3