diff --git a/.buildpath b/.buildpath new file mode 100755 index 000000000..ad4b4c718 --- /dev/null +++ b/.buildpath @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.dbeaver/.credentials-config.json.bak b/.dbeaver/.credentials-config.json.bak new file mode 100755 index 000000000..7e91f62f7 --- /dev/null +++ b/.dbeaver/.credentials-config.json.bak @@ -0,0 +1,2 @@ +H|kt씉XCw$$'c#H+ɕ]D P,X<~WG8BL2Sp={w F UOA15@eiY묖ۮHm +յ?2!EqLEj $3/H'9*rQp]J;~no+$,T!950t#bn'%CIM9:} \ No newline at end of file diff --git a/.dbeaver/.data-sources.json.bak b/.dbeaver/.data-sources.json.bak new file mode 100755 index 000000000..ea4614170 --- /dev/null +++ b/.dbeaver/.data-sources.json.bak @@ -0,0 +1,61 @@ +{ + "folders": {}, + "connections": { + "mysql8-177f1df173f-2ff7634518f3a52d": { + "provider": "mysql", + "driver": "mysql8", + "name": "localhost", + "save-password": true, + "read-only": false, + "configuration": { + "host": "localhost", + "port": "3306", + "url": "jdbc:mysql://localhost:3306/", + "type": "dev", + "auth-model": "native", + "handlers": {} + } + }, + "mysql8-177f1e0b513-747f1c1518866031": { + "provider": "mysql", + "driver": "mysql8", + "name": "localhost 2", + "save-password": true, + "read-only": false, + "configuration": { + "host": "localhost", + "port": "3306", + "url": "jdbc:mysql://localhost:3306/", + "type": "dev", + "auth-model": "native", + "handlers": {} + } + }, + "mysql8-177f1e12c0e-6e8b2b03ff11ca68": { + "provider": "mysql", + "driver": "mysql8", + "name": "localhost 3", + "save-password": true, + "read-only": false, + "configuration": { + "host": "localhost", + "port": "3306", + "url": "jdbc:mysql://localhost:3306/", + "home": "/usr/bin", + "type": "dev", + "auth-model": "native", + "handlers": {} + } + } + }, + "connection-types": { + "dev": { + "name": "Development", + "color": "255,255,255", + "description": "Regular development database", + "auto-commit": true, + "confirm-execute": false, + "confirm-data-change": false + } + } +} \ No newline at end of file diff --git a/.dbeaver/credentials-config.json b/.dbeaver/credentials-config.json new file mode 100755 index 000000000..327d716a1 --- /dev/null +++ b/.dbeaver/credentials-config.json @@ -0,0 +1 @@ +&l2ͻoSFA[礑o9c`Qo;ЎQxm7$ FU$e%xY5dh]ls7|\+P \ No newline at end of file diff --git a/.dbeaver/data-sources.json b/.dbeaver/data-sources.json new file mode 100755 index 000000000..13086939c --- /dev/null +++ b/.dbeaver/data-sources.json @@ -0,0 +1,29 @@ +{ + "folders": {}, + "connections": { + "mysql8-177f1df173f-2ff7634518f3a52d": { + "provider": "mysql", + "driver": "mysql8", + "name": "localhost", + "save-password": true, + "read-only": false, + "configuration": { + "host": "localhost", + "port": "3306", + "url": "jdbc:mysql://localhost:3306/", + "type": "dev", + "auth-model": "native" + } + } + }, + "connection-types": { + "dev": { + "name": "Development", + "color": "255,255,255", + "description": "Regular development database", + "auto-commit": true, + "confirm-execute": false, + "confirm-data-change": false + } + } +} \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f302e8fc9..4f233da6d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,54 +1,1844 @@ -name: Docker Image Creation - -on: - push: - branches: - - master - tags: - - '**' - -jobs: - - base-image: - - runs-on: ubuntu-latest - name: Create the base image - - steps: - - uses: actions/checkout@v2 - - name: Fetch git tags - run: git fetch --unshallow origin +refs/tags/*:refs/tags/* - - - name: Build the base docker image - run: docker pull partkeepr/base-dev:latest && docker build docker/base-dev --file docker/base-dev/Dockerfile --cache-from partkeepr/base-dev:latest --tag partkeepr/base-dev:latest - - name: Tag the base docker image with git hash - run: docker tag partkeepr/base-dev:latest partkeepr/base-dev:$(git describe) - - name: Deploy the base docker images - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }} - docker push partkeepr/base-dev:latest - docker push partkeepr/base-dev:$(git describe) - - development-image: - - runs-on: ubuntu-latest - needs: base-image - name: Create the development image - - steps: - - uses: actions/checkout@v2 - - name: Fetch git tags - run: git fetch --unshallow origin +refs/tags/*:refs/tags/* - - - name: Build development image - run: | - docker pull partkeepr/development:latest - docker build docker/development/app --file docker/development/app/Dockerfile --tag partkeepr/development:latest --build-arg SRC_IMAGE=partkeepr/base-dev:$(git describe) --cache-from partkeepr/development:latest - - name: Tag the development docker image with git hash - run: docker tag partkeepr/development:latest partkeepr/development:$(git describe) - - name: Deploy the development docker images - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }} - docker push partkeepr/development:latest - docker push partkeepr/development:$(git describe) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PartKeepr/docker.yml at symfony_28_to_30 · ghost-from-the-past/PartKeepr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + +
+ +
+ + + + + +
+ + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + +
+ +
+ +
+

+ + + / + + PartKeepr + + +

+ + + forked from partkeepr/PartKeepr + + +
+ +
    + +
  • + +
    + + + + + + + + Watch + + + + + +
    +
    +

    Notifications

    + +
    + +
    +
    + + + + + + + + +
    + +
    +
    +
    + + +
    +
    + +
    + + + +
  • + +
  • +
    +
    + + +
    +
    + + +
    + +
  • + +
  • + + + Fork + + +
  • +
+ +
+ + + + +
+ + +
+
+ + + + +
+ + + + Permalink + + + +
+ +
+
+ + + symfony_28_to_… + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + View runs + + + Go to file + + +
+ + + + + + + + + +
+
+
+ + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + 54 lines (43 sloc) + + 1.87 KB +
+ +
+ + + +
+ + + + +
+ +
+
+ +
+
+ +
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name: Docker Image Creation
+
on:
push:
branches:
- master
tags:
- '**'
+
jobs:
+
base-image:
+
runs-on: ubuntu-latest
name: Create the base image
+
steps:
- uses: actions/checkout@v2
- name: Fetch git tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Build the base docker image
run: docker pull partkeepr/base-dev:latest && docker build docker/base-dev --file docker/base-dev/Dockerfile --cache-from partkeepr/base-dev:latest --tag partkeepr/base-dev:latest
- name: Tag the base docker image with git hash
run: docker tag partkeepr/base-dev:latest partkeepr/base-dev:$(git describe)
- name: Deploy the base docker images
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
docker push partkeepr/base-dev:latest
docker push partkeepr/base-dev:$(git describe)
development-image:
runs-on: ubuntu-latest
needs: base-image
name: Create the development image
steps:
- uses: actions/checkout@v2
- name: Fetch git tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Build development image
run: |
docker pull partkeepr/development:latest
docker build docker/development/app --file docker/development/app/Dockerfile --tag partkeepr/development:latest --build-arg SRC_IMAGE=partkeepr/base-dev:$(git describe) --cache-from partkeepr/development:latest
- name: Tag the development docker image with git hash
run: docker tag partkeepr/development:latest partkeepr/development:$(git describe)
- name: Deploy the development docker images
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
docker push partkeepr/development:latest
docker push partkeepr/development:$(git describe)
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/.github/workflows/notify_irc.yml b/.github/workflows/notify_irc.yml index a5106ba03..a03458202 100644 --- a/.github/workflows/notify_irc.yml +++ b/.github/workflows/notify_irc.yml @@ -1,35 +1,1764 @@ -name: "Push Notification" -on: [push, pull_request, create] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: irc push - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'push' - with: - channel: "#partkeepr" - nickname: PartKeepr - password: ${{ secrets.FREENODE_PASSWORD }} - message: | - ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }} - ${{ join(github.event.commits.*.message) }} - - name: irc pull request - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'pull_request' - with: - channel: "#partkeepr" - nickname: PartKeepr - password: ${{ secrets.FREENODE_PASSWORD }} - message: | - ${{ github.actor }} opened PR ${{ github.event.html_url }} - - name: irc tag created - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'create' && github.event.ref_type == 'tag' - with: - channel: "#partkeepr" - nickname: PartKeepr - password: ${{ secrets.FREENODE_PASSWORD }} - message: | - ${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PartKeepr/notify_irc.yml at symfony_28_to_30 · ghost-from-the-past/PartKeepr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + +
+ +
+ + + + + +
+ + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + +
+ +
+ +
+

+ + + / + + PartKeepr + + +

+ + + forked from partkeepr/PartKeepr + + +
+ +
    + +
  • + +
    + + + + + + + + Watch + + + + + +
    +
    +

    Notifications

    + +
    + +
    +
    + + + + + + + + +
    + +
    +
    +
    + + +
    +
    + +
    + + + +
  • + +
  • +
    +
    + + +
    +
    + + +
    + +
  • + +
  • + + + Fork + + +
  • +
+ +
+ + + + +
+ + +
+
+ + + + +
+ + + + Permalink + + + +
+ +
+
+ + + symfony_28_to_… + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + View runs + + + Go to file + + +
+ + + + + + + + + +
+
+
+ + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + 35 lines (34 sloc) + + 1.2 KB +
+ +
+ + + +
+ + + + +
+ +
+
+ +
+
+ +
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name: "Push Notification"
on: [push, pull_request, create]
+
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: irc push
uses: rectalogic/notify-irc@v1
if: github.event_name == 'push'
with:
channel: "#partkeepr"
nickname: PartKeepr
password: ${{ secrets.FREENODE_PASSWORD }}
message: |
${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}
${{ join(github.event.commits.*.message) }}
- name: irc pull request
uses: rectalogic/notify-irc@v1
if: github.event_name == 'pull_request'
with:
channel: "#partkeepr"
nickname: PartKeepr
password: ${{ secrets.FREENODE_PASSWORD }}
message: |
${{ github.actor }} opened PR ${{ github.event.html_url }}
- name: irc tag created
uses: rectalogic/notify-irc@v1
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
channel: "#partkeepr"
nickname: PartKeepr
password: ${{ secrets.FREENODE_PASSWORD }}
message: |
${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }}
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index ce4df8742..2c77f3575 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,35 @@ -/build +/.web-server-pid +/app/config/parameters.yml +/app/authkey.php + +# temporarely enabled for development +# /app/config/parameters.php +# /app/config/parameters_setup.php + +/app/cache/* +/app/config/parameters.yml +/app/logs/* +/build/ +/phpunit.xml +/var/* +!/var/cache +/var/cache/* +!var/cache/.gitkeep +!/var/logs +/var/logs/* +!var/logs/.gitkeep +!/var/sessions +/var/sessions/* +!var/sessions/.gitkeep +!var/SymfonyRequirements.php +/vendor/ +/web/bundles/ +/web/images/* +/web/spritesheets/* +/web/atelierspierrot/* +/web/js/* +/web/css/* + /setup /frontend /data/files/FootprintAttachment/* @@ -22,21 +53,7 @@ theme/sass/.sass-cache/ /reports /nbproject/ partkeepr.jsfiles -app/authkey.php -app/config/parameters.php -app/config/parameters_setup.php -/web/bundles/ -/web/images/* -/web/spritesheets/* -/web/atelierspierrot/* -/web/js/* -/web/css/* -/app/bootstrap.php.cache -/app/cache/* -/app/config/parameters.yml -/app/logs/* -/vendor/ /bin/ /composer.phar diff --git a/.project b/.project new file mode 100755 index 000000000..410a657e8 --- /dev/null +++ b/.project @@ -0,0 +1,46 @@ + + + Partkeepr + + + + + + com.dubture.doctrine.core.doctrineBuilder + + + + + com.dubture.symfony.core.symfonyBuilder + + + + + org.eclipse.php.composer.core.builder.buildPathManagementBuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.dltk.core.scriptbuilder + + + + + + org.jkiss.dbeaver.DBeaverNature + org.eclipse.php.core.PHPNature + org.eclipse.wst.common.project.facet.core.nature + com.dubture.symfony.core.symfonyNature + com.dubture.doctrine.core.doctrineNature + + diff --git a/.settings/org.eclipse.php.core.prefs b/.settings/org.eclipse.php.core.prefs new file mode 100755 index 000000000..62cfd98d8 --- /dev/null +++ b/.settings/org.eclipse.php.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +include_path=0;/PartKeepr diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100755 index 000000000..8625df2bf --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100755 index 000000000..39a5ef641 --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06vendor +eclipse.preferences.version=1 diff --git a/app/AppKernel.php b/app/AppKernel.php index 7ec7426be..a12b5cc98 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -1,7 +1,7 @@ getEnvironment(), ['dev', 'test'])) { + if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { + $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); + $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); $bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle(); } @@ -67,7 +69,7 @@ public function registerBundles() $bundles[] = new PartKeepr\BatchJobBundle\PartKeeprBatchJobBundle(); $bundles[] = new PartKeepr\OctoPartBundle\PartKeeprOctoPartBundle(); $bundles[] = new PartKeepr\MobileFrontendBundle\PartKeeprMobileFrontendBundle(); - + return array_merge($bundles, $this->getCustomBundles()); } @@ -79,10 +81,10 @@ public function registerBundles() */ public function registerContainerConfiguration(LoaderInterface $loader) { - $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); + $loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml'); if ($this->getEnvironment() !== 'test') { - $customConfig = __DIR__.'/config/config_custom.yml'; + $customConfig = $this->getProjectDir().'/app/config/config_custom.yml'; if (file_exists($customConfig)) { $loader->load($customConfig); @@ -115,8 +117,15 @@ public function getCacheDir() } return $this->rootDir.'/cache/'.$environment; +// return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); } - + + public function getLogDir() + { + return dirname(__DIR__).'/var/logs'; + } + + /** * Override to avoid stripping comments. * diff --git a/app/SetupAppKernel.php b/app/SetupAppKernel.php index 46fb76063..ab7150615 100644 --- a/app/SetupAppKernel.php +++ b/app/SetupAppKernel.php @@ -1,11 +1,12 @@ getEnvironment(), ['dev', 'test'])) { + if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { +// $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); +// $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); $bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle(); } @@ -33,8 +50,25 @@ public function registerBundles() return $bundles; } + /** + * Loads the configuration for an environment. Also loads a custom configuration for non-text environments from + * app/config_config_custom.yml if it exists. + * + * @param $loader LoaderInterface + */ public function registerContainerConfiguration(LoaderInterface $loader) { - $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); + $loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml'); + } + + /** + * Returns any custom bundles for a custom setup. Override this + * method in a custom AppKernel. + * + * @return array + */ + public function getCustomBundles() + { + return []; } } diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php new file mode 100755 index 000000000..4a1fcc621 --- /dev/null +++ b/app/SymfonyRequirements.php @@ -0,0 +1,810 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Users of PHP 5.2 should be able to run the requirements checks. + * This is why the file and all classes must be compatible with PHP 5.2+ + * (e.g. not using namespaces and closures). + * + * ************** CAUTION ************** + * + * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of + * the installation/update process. The original file resides in the + * SensioDistributionBundle. + * + * ************** CAUTION ************** + */ + +/** + * Represents a single PHP requirement, e.g. an installed extension. + * It can be a mandatory requirement or an optional recommendation. + * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. + * + * @author Tobias Schultze + */ +class Requirement +{ + private $fulfilled; + private $testMessage; + private $helpText; + private $helpHtml; + private $optional; + + /** + * Constructor that initializes the requirement. + * + * @param bool $fulfilled Whether the requirement is fulfilled + * @param string $testMessage The message for testing the requirement + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement + */ + public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) + { + $this->fulfilled = (bool) $fulfilled; + $this->testMessage = (string) $testMessage; + $this->helpHtml = (string) $helpHtml; + $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; + $this->optional = (bool) $optional; + } + + /** + * Returns whether the requirement is fulfilled. + * + * @return bool true if fulfilled, otherwise false + */ + public function isFulfilled() + { + return $this->fulfilled; + } + + /** + * Returns the message for testing the requirement. + * + * @return string The test message + */ + public function getTestMessage() + { + return $this->testMessage; + } + + /** + * Returns the help text for resolving the problem. + * + * @return string The help text + */ + public function getHelpText() + { + return $this->helpText; + } + + /** + * Returns the help text formatted in HTML. + * + * @return string The HTML help + */ + public function getHelpHtml() + { + return $this->helpHtml; + } + + /** + * Returns whether this is only an optional recommendation and not a mandatory requirement. + * + * @return bool true if optional, false if mandatory + */ + public function isOptional() + { + return $this->optional; + } +} + +/** + * Represents a PHP requirement in form of a php.ini configuration. + * + * @author Tobias Schultze + */ +class PhpIniRequirement extends Requirement +{ + /** + * Constructor that initializes the requirement. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement + */ + public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) + { + $cfgValue = ini_get($cfgName); + + if (is_callable($evaluation)) { + if (null === $testMessage || null === $helpHtml) { + throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); + } + + $fulfilled = call_user_func($evaluation, $cfgValue); + } else { + if (null === $testMessage) { + $testMessage = sprintf('%s %s be %s in php.ini', + $cfgName, + $optional ? 'should' : 'must', + $evaluation ? 'enabled' : 'disabled' + ); + } + + if (null === $helpHtml) { + $helpHtml = sprintf('Set %s to %s in php.ini*.', + $cfgName, + $evaluation ? 'on' : 'off' + ); + } + + $fulfilled = $evaluation == $cfgValue; + } + + parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); + } +} + +/** + * A RequirementCollection represents a set of Requirement instances. + * + * @author Tobias Schultze + */ +class RequirementCollection implements IteratorAggregate +{ + /** + * @var Requirement[] + */ + private $requirements = array(); + + /** + * Gets the current RequirementCollection as an Iterator. + * + * @return Traversable A Traversable interface + */ + public function getIterator() + { + return new ArrayIterator($this->requirements); + } + + /** + * Adds a Requirement. + * + * @param Requirement $requirement A Requirement instance + */ + public function add(Requirement $requirement) + { + $this->requirements[] = $requirement; + } + + /** + * Adds a mandatory requirement. + * + * @param bool $fulfilled Whether the requirement is fulfilled + * @param string $testMessage The message for testing the requirement + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) + { + $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); + } + + /** + * Adds an optional recommendation. + * + * @param bool $fulfilled Whether the recommendation is fulfilled + * @param string $testMessage The message for testing the recommendation + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) + { + $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); + } + + /** + * Adds a mandatory requirement in form of a php.ini configuration. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) + { + $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); + } + + /** + * Adds an optional recommendation in form of a php.ini configuration. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) + { + $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); + } + + /** + * Adds a requirement collection to the current set of requirements. + * + * @param RequirementCollection $collection A RequirementCollection instance + */ + public function addCollection(RequirementCollection $collection) + { + $this->requirements = array_merge($this->requirements, $collection->all()); + } + + /** + * Returns both requirements and recommendations. + * + * @return Requirement[] + */ + public function all() + { + return $this->requirements; + } + + /** + * Returns all mandatory requirements. + * + * @return Requirement[] + */ + public function getRequirements() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns the mandatory requirements that were not met. + * + * @return Requirement[] + */ + public function getFailedRequirements() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && !$req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns all optional recommendations. + * + * @return Requirement[] + */ + public function getRecommendations() + { + $array = array(); + foreach ($this->requirements as $req) { + if ($req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns the recommendations that were not met. + * + * @return Requirement[] + */ + public function getFailedRecommendations() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && $req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns whether a php.ini configuration is not correct. + * + * @return bool php.ini configuration problem? + */ + public function hasPhpIniConfigIssue() + { + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { + return true; + } + } + + return false; + } + + /** + * Returns the PHP configuration file (php.ini) path. + * + * @return string|false php.ini file path + */ + public function getPhpIniConfigPath() + { + return get_cfg_var('cfg_file_path'); + } +} + +/** + * This class specifies all requirements and optional recommendations that + * are necessary to run the Symfony Standard Edition. + * + * @author Tobias Schultze + * @author Fabien Potencier + */ +class SymfonyRequirements extends RequirementCollection +{ + const LEGACY_REQUIRED_PHP_VERSION = '5.3.3'; + const REQUIRED_PHP_VERSION = '5.5.9'; + + /** + * Constructor that initializes the requirements. + */ + public function __construct() + { + /* mandatory requirements follow */ + + $installedPhpVersion = PHP_VERSION; + $requiredPhpVersion = $this->getPhpRequiredVersion(); + + $this->addRecommendation( + $requiredPhpVersion, + 'Vendors should be installed in order to check all requirements.', + 'Run the composer install command.', + 'Run the "composer install" command.' + ); + + if (false !== $requiredPhpVersion) { + $this->addRequirement( + version_compare($installedPhpVersion, $requiredPhpVersion, '>='), + sprintf('PHP version must be at least %s (%s installed)', $requiredPhpVersion, $installedPhpVersion), + sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. + Before using Symfony, upgrade your PHP installation, preferably to the latest version.', + $installedPhpVersion, $requiredPhpVersion), + sprintf('Install PHP %s or newer (installed version is %s)', $requiredPhpVersion, $installedPhpVersion) + ); + } + + $this->addRequirement( + version_compare($installedPhpVersion, '5.3.16', '!='), + 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', + 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' + ); + + $this->addRequirement( + is_dir(__DIR__.'/../vendor/composer'), + 'Vendor libraries must be installed', + 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. '. + 'Then run "php composer.phar install" to install them.' + ); + + $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; + + $this->addRequirement( + is_writable($cacheDir), + 'app/cache/ or var/cache/ directory must be writable', + 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' + ); + + $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; + + $this->addRequirement( + is_writable($logsDir), + 'app/logs/ or var/logs/ directory must be writable', + 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' + ); + + if (version_compare($installedPhpVersion, '7.0.0', '<')) { + $this->addPhpIniRequirement( + 'date.timezone', true, false, + 'date.timezone setting must be set', + 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' + ); + } + + if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) { + $this->addRequirement( + in_array(@date_default_timezone_get(), DateTimeZone::listIdentifiers(), true), + sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), + 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' + ); + } + + $this->addRequirement( + function_exists('iconv'), + 'iconv() must be available', + 'Install and enable the iconv extension.' + ); + + $this->addRequirement( + function_exists('json_encode'), + 'json_encode() must be available', + 'Install and enable the JSON extension.' + ); + + $this->addRequirement( + function_exists('session_start'), + 'session_start() must be available', + 'Install and enable the session extension.' + ); + + $this->addRequirement( + function_exists('ctype_alpha'), + 'ctype_alpha() must be available', + 'Install and enable the ctype extension.' + ); + + $this->addRequirement( + function_exists('token_get_all'), + 'token_get_all() must be available', + 'Install and enable the Tokenizer extension.' + ); + + $this->addRequirement( + function_exists('simplexml_import_dom'), + 'simplexml_import_dom() must be available', + 'Install and enable the SimpleXML extension.' + ); + + if (function_exists('apc_store') && ini_get('apc.enabled')) { + if (version_compare($installedPhpVersion, '5.4.0', '>=')) { + $this->addRequirement( + version_compare(phpversion('apc'), '3.1.13', '>='), + 'APC version must be at least 3.1.13 when using PHP 5.4', + 'Upgrade your APC extension (3.1.13+).' + ); + } else { + $this->addRequirement( + version_compare(phpversion('apc'), '3.0.17', '>='), + 'APC version must be at least 3.0.17', + 'Upgrade your APC extension (3.0.17+).' + ); + } + } + + $this->addPhpIniRequirement('detect_unicode', false); + + if (extension_loaded('suhosin')) { + $this->addPhpIniRequirement( + 'suhosin.executor.include.whitelist', + create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), + false, + 'suhosin.executor.include.whitelist must be configured correctly in php.ini', + 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' + ); + } + + if (extension_loaded('xdebug')) { + $this->addPhpIniRequirement( + 'xdebug.show_exception_trace', false, true + ); + + $this->addPhpIniRequirement( + 'xdebug.scream', false, true + ); + + $this->addPhpIniRecommendation( + 'xdebug.max_nesting_level', + create_function('$cfgValue', 'return $cfgValue > 100;'), + true, + 'xdebug.max_nesting_level should be above 100 in php.ini', + 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' + ); + } + + $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; + + $this->addRequirement( + null !== $pcreVersion, + 'PCRE extension must be available', + 'Install the PCRE extension (version 8.0+).' + ); + + if (extension_loaded('mbstring')) { + $this->addPhpIniRequirement( + 'mbstring.func_overload', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'string functions should not be overloaded', + 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' + ); + } + + /* optional recommendations follow */ + + if (file_exists(__DIR__.'/../vendor/composer')) { + require_once __DIR__.'/../vendor/autoload.php'; + + try { + $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); + + $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); + } catch (ReflectionException $e) { + $contents = ''; + } + $this->addRecommendation( + file_get_contents(__FILE__) === $contents, + 'Requirements file should be up-to-date', + 'Your requirements file is outdated. Run composer install and re-check your configuration.' + ); + } + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.3.4', '>='), + 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', + 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.3.8', '>='), + 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', + 'Install PHP 5.3.8 or newer if your project uses annotations.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.4.0', '!='), + 'You should not use PHP 5.4.0 due to the PHP bug #61453', + 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.4.11', '>='), + 'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)', + 'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.' + ); + + $this->addRecommendation( + (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<')) + || + version_compare($installedPhpVersion, '5.4.8', '>='), + 'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909', + 'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.' + ); + + if (null !== $pcreVersion) { + $this->addRecommendation( + $pcreVersion >= 8.0, + sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), + 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' + ); + } + + $this->addRecommendation( + class_exists('DomDocument'), + 'PHP-DOM and PHP-XML modules should be installed', + 'Install and enable the PHP-DOM and the PHP-XML modules.' + ); + + $this->addRecommendation( + function_exists('mb_strlen'), + 'mb_strlen() should be available', + 'Install and enable the mbstring extension.' + ); + + $this->addRecommendation( + function_exists('utf8_decode'), + 'utf8_decode() should be available', + 'Install and enable the XML extension.' + ); + + $this->addRecommendation( + function_exists('filter_var'), + 'filter_var() should be available', + 'Install and enable the filter extension.' + ); + + if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->addRecommendation( + function_exists('posix_isatty'), + 'posix_isatty() should be available', + 'Install and enable the php_posix extension (used to colorize the CLI output).' + ); + } + + $this->addRecommendation( + extension_loaded('intl'), + 'intl extension should be available', + 'Install and enable the intl extension (used for validators).' + ); + + if (extension_loaded('intl')) { + // in some WAMP server installations, new Collator() returns null + $this->addRecommendation( + null !== new Collator('fr_FR'), + 'intl extension should be correctly configured', + 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' + ); + + // check for compatible ICU versions (only done when you have the intl extension) + if (defined('INTL_ICU_VERSION')) { + $version = INTL_ICU_VERSION; + } else { + $reflector = new ReflectionExtension('intl'); + + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + + preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); + $version = $matches[1]; + } + + $this->addRecommendation( + version_compare($version, '4.0', '>='), + 'intl ICU version should be at least 4+', + 'Upgrade your intl extension with a newer ICU version (4+).' + ); + + if (class_exists('Symfony\Component\Intl\Intl')) { + $this->addRecommendation( + \Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion(), + sprintf('intl ICU version installed on your system is outdated (%s) and does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), + 'To get the latest internationalization data upgrade the ICU system package and the intl PHP extension.' + ); + if (\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion()) { + $this->addRecommendation( + \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(), + sprintf('intl ICU version installed on your system (%s) does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), + 'To avoid internationalization data inconsistencies upgrade the symfony/intl component.' + ); + } + } + + $this->addPhpIniRecommendation( + 'intl.error_level', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'intl.error_level should be 0 in php.ini', + 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' + ); + } + + $accelerator = + (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) + || + (extension_loaded('apc') && ini_get('apc.enabled')) + || + (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) + || + (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) + || + (extension_loaded('xcache') && ini_get('xcache.cacher')) + || + (extension_loaded('wincache') && ini_get('wincache.ocenabled')) + ; + + $this->addRecommendation( + $accelerator, + 'a PHP accelerator should be installed', + 'Install and/or enable a PHP accelerator (highly recommended).' + ); + + if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { + $this->addRecommendation( + $this->getRealpathCacheSize() >= 5 * 1024 * 1024, + 'realpath_cache_size should be at least 5M in php.ini', + 'Setting "realpath_cache_size" to e.g. "5242880" or "5M" in php.ini* may improve performance on Windows significantly in some cases.' + ); + } + + $this->addPhpIniRecommendation('short_open_tag', false); + + $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); + + $this->addPhpIniRecommendation('register_globals', false, true); + + $this->addPhpIniRecommendation('session.auto_start', false); + + $this->addRecommendation( + class_exists('PDO'), + 'PDO should be installed', + 'Install PDO (mandatory for Doctrine).' + ); + + if (class_exists('PDO')) { + $drivers = PDO::getAvailableDrivers(); + $this->addRecommendation( + count($drivers) > 0, + sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), + 'Install PDO drivers (mandatory for Doctrine).' + ); + } + } + + /** + * Loads realpath_cache_size from php.ini and converts it to int. + * + * (e.g. 16k is converted to 16384 int) + * + * @return int + */ + protected function getRealpathCacheSize() + { + $size = ini_get('realpath_cache_size'); + $size = trim($size); + $unit = ''; + if (!ctype_digit($size)) { + $unit = strtolower(substr($size, -1, 1)); + $size = (int) substr($size, 0, -1); + } + switch ($unit) { + case 'g': + return $size * 1024 * 1024 * 1024; + case 'm': + return $size * 1024 * 1024; + case 'k': + return $size * 1024; + default: + return (int) $size; + } + } + + /** + * Defines PHP required version from Symfony version. + * + * @return string|false The PHP required version or false if it could not be guessed + */ + protected function getPhpRequiredVersion() + { + if (!file_exists($path = __DIR__.'/../composer.lock')) { + return false; + } + + $composerLock = json_decode(file_get_contents($path), true); + foreach ($composerLock['packages'] as $package) { + $name = $package['name']; + if ('symfony/symfony' !== $name && 'symfony/http-kernel' !== $name) { + continue; + } + + return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; + } + + return false; + } +} diff --git a/app/config/config.yml b/app/config/config.yml index ce7d1cad5..06abe64a1 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -6,16 +6,25 @@ imports: - { resource: config_doctrine.yml } - { resource: config_fos_user.yml } - { resource: config_dunglas.yml } - - { resource: config_ldap.yml } - { resource: config_partkeepr.yml } - { resource: config_filesystem.yml } +framework: + serializer: true +# enable serialier for fos_rest +# serializer: +# enabled: true + fos_rest: body_listener: true format_listener: true param_fetcher_listener: force - service: - exception_handler: "partkeepr.exceptionwrapper" +# service: +# exception_handler: "partkeepr.exceptionwrapper" +# fos_rest.service.serializer +# serializer: +# serialize_null: true +# scope: request format_listener: rules: - priorities: [json, xml] @@ -29,35 +38,37 @@ fos_rest: html: false view_response_listener: true - - sensio_framework_extra: - view: { annotations: false } + view: { annotations: true } router: { annotations: true } # Assetic Configuration -assetic: - debug: %kernel.debug% - use_controller: false - bundles: [ PartKeeprFrontendBundle, PartKeeprMobileFrontendBundle ] - #java: /usr/bin/java - filters: - cssrewrite: ~ - #closure: - # jar: %kernel.root_dir%/Resources/java/compiler.jar - #yui_css: - # jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar +## assetic: +## debug: %kernel.debug% +## use_controller: false +## bundles: [ PartKeeprFrontendBundle, PartKeeprMobileFrontendBundle ] +## #java: /usr/bin/java +## filters: +## cssrewrite: ~ +## #closure: +## # jar: %kernel.root_dir%/Resources/java/compiler.jar +## #yui_css: +## # jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar twig: exception_controller: 'FOS\RestBundle\Controller\ExceptionController::showAction' - -dunglas_api: + cache: false + +api_platform: title: "PartKeepr" description: "The PartKeepr REST API" collection: + order_parameter_name: 'order' + order: 'ASC' pagination: - items_per_page: - client_can_change: true + client_enabled: true + client_items_per_page: true +# items_per_page: 3 sprite_generator: sprites: @@ -82,25 +93,6 @@ sprite_generator: imagePositioning: min-image imageGenerator: gd2 -fr3d_ldap: - driver: - host: "%fr3d_ldap.driver.host%" - port: "%fr3d_ldap.driver.port%" - username: "%fr3d_ldap.driver.username%" - password: "%fr3d_ldap.driver.password%" - bindRequiresDn: "%fr3d_ldap.driver.bindRequiresDn%" - baseDn: "%fr3d_ldap.driver.baseDn%" - accountFilterFormat: "%fr3d_ldap.driver.accountFilterFormat%" - optReferrals: "%fr3d_ldap.driver.optReferrals%" - useSsl: "%fr3d_ldap.driver.useSsl%" - useStartTls: "%fr3d_ldap.driver.useStartTls%" - accountCanonicalForm: "%fr3d_ldap.driver.accountCanonicalForm%" - accountDomainName: "%fr3d_ldap.driver.accountDomainName%" - accountDomainNameShort: "%fr3d_ldap.driver.accountDomainNameShort%" - user: - baseDn: "%fr3d_ldap.user.baseDn%" - filter: "%fr3d_ldap.user.filter%" - services: serializer.normalizer.custom: class: Symfony\Component\Serializer\Normalizer\ObjectNormalizer diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index a1ae888db..9e39ac489 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml @@ -29,8 +29,8 @@ monolog: # type: chromephp # level: info -assetic: - use_controller: true +## assetic: +## use_controller: true #swiftmailer: # delivery_address: me@example.com diff --git a/app/config/config_dunglas.yml b/app/config/config_dunglas.yml index 6380f97a9..0c3d34a04 100644 --- a/app/config/config_dunglas.yml +++ b/app/config/config_dunglas.yml @@ -1,9 +1,21 @@ -dunglas_api: +api_platform: title: "PartKeepr" description: "The PartKeepr REST API" + eager_loading: + enabled: false +# cache: %cache.dunglas% +#in v1 cache: false # The caching service to use. Set to "dunglas_api.mapping.cache.apc" to enable APC metadata caching. collection: + order_parameter_name: 'order' + order: 'ASC' pagination: - items_per_page: - client_can_change: true - supported_formats: [ "jsonld", "csv", "xlsx" ] - cache: %cache.dunglas% + client_enabled: true + client_items_per_page: true +# items_per_page: 3 + formats: + jsonld: ['application/ld+json'] + xml: ['application/xml', 'text/xml'] +# csv: ['text/csv'] + csv: ['text/comma-separated-values'] + xlsx: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] +#in v1 supported_formats: [ "jsonld", "csv", "xlsx" ] diff --git a/app/config/config_framework.yml b/app/config/config_framework.yml index 0dc7bf3c8..e0d600c67 100644 --- a/app/config/config_framework.yml +++ b/app/config/config_framework.yml @@ -8,12 +8,21 @@ framework: strict_requirements: ~ form: ~ csrf_protection: ~ - validation: { enabled: true, enable_annotations: true } +# validation: { enabled: true, api: auto, enable_annotations: true, strict_email: true } + validation: { enabled: true, enable_annotations: true, strict_email: true, cache: validator.mapping.cache.doctrine.apc } templating: engines: ['twig'] #assets_version: SomeVersionScheme default_locale: "%locale%" trusted_proxies: ~ session: ~ +### http://symfony.com/doc/current/reference/configuration/framework.html#handler-id +## handler_id: session.handler.native_file +## save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%" fragments: ~ http_method_override: true + cache: +# directory: '%kernel.cache_dir%/pools' # Only used with cache.adapter.filesystem + directory: '/var/www/partkeepr/app/cache' + app: cache.adapter.apcu + \ No newline at end of file diff --git a/app/config/config_ldap.yml b/app/config/config_ldap.yml deleted file mode 100644 index 1b0e41551..000000000 --- a/app/config/config_ldap.yml +++ /dev/null @@ -1,22 +0,0 @@ -fr3d_ldap: - driver: - host: "%fr3d_ldap.driver.host%" - port: "%fr3d_ldap.driver.port%" - username: "%fr3d_ldap.driver.username%" - password: "%fr3d_ldap.driver.password%" - bindRequiresDn: "%fr3d_ldap.driver.bindRequiresDn%" - baseDn: "%fr3d_ldap.driver.baseDn%" - accountFilterFormat: "%fr3d_ldap.driver.accountFilterFormat%" - optReferrals: "%fr3d_ldap.driver.optReferrals%" - useSsl: "%fr3d_ldap.driver.useSsl%" - useStartTls: "%fr3d_ldap.driver.useStartTls%" - accountCanonicalForm: "%fr3d_ldap.driver.accountCanonicalForm%" - accountDomainName: "%fr3d_ldap.driver.accountDomainName%" - accountDomainNameShort: "%fr3d_ldap.driver.accountDomainNameShort%" - user: - enabled: "%fr3d_ldap.user.enabled%" - baseDn: "%fr3d_ldap.user.baseDn%" - filter: "%fr3d_ldap.user.filter%" - attributes: - - { ldap_attr: %fr3d_ldap.user.attribute.username%, user_method: setUsername } - - { ldap_attr: %fr3d_ldap.user.attribute.email%, user_method: setEmail } diff --git a/app/config/config_partkeepr.yml b/app/config/config_partkeepr.yml index d48fee196..c88e41035 100644 --- a/app/config/config_partkeepr.yml +++ b/app/config/config_partkeepr.yml @@ -89,1463 +89,5 @@ services: - "@partkeepr_image_service" - "@annotation_reader" - "@property_accessor" - - "@api.iri_converter" + - "@api_platform.iri_converter" tags: [ { name: "kernel.event_listener", event: "kernel.view", method: "replaceTemporaryFile", priority: 100 } ] - - resource.distributor: - parent: "api.resource" - arguments: [ "PartKeepr\\DistributorBundle\Entity\Distributor" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.footprint: - parent: "api.resource" - arguments: [ "PartKeepr\FootprintBundle\Entity\Footprint" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.batchjob.item_operation.execute: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.batchjob" # Resource - - [ "PUT" ] # Methods - - "/batch_jobs/{id}/execute" # Path - - "partkeepr.batchjob.execute" # Controller - - "BatchJobExecute" # Route name - - resource.batchjob: - parent: "api.resource" - arguments: [ 'PartKeepr\BatchJobBundle\Entity\BatchJob' ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - method: "initItemOperations" - arguments: [ [ "@resource.batchjob.item_operation.get", "@resource.batchjob.item_operation.put", "@resource.batchjob.item_operation.delete", "@resource.batchjob.item_operation.execute" ] ] - - - - - - resource.batchjob_queryfield: - parent: "api.resource" - arguments: [ 'PartKeepr\BatchJobBundle\Entity\BatchJobQueryField' ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.batchjob_updatefield: - parent: "api.resource" - arguments: [ 'PartKeepr\BatchJobBundle\Entity\BatchJobUpdateField' ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - - resource.footprint_image.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.footprint_image", "GET" ] - - resource.footprint_image.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.footprint_image" # Resource - - [ "GET" ] # Methods - - "/footprint_images/{id}/getImage" # Path - - "PartKeeprFootprintBundle:FootprintImage:getImage" # Controller - - "FootprintImageGetImage" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.footprint_image: - parent: "api.resource" - arguments: [ "PartKeepr\FootprintBundle\Entity\FootprintImage" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.footprint_image.item_operation.get", "@resource.footprint_image.item_operation.custom_get" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.footprint_attachment.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.footprint_attachment" # Resource - - [ "GET" ] # Methods - - "/footprint_attachments/{id}/getFile" # Path - - "PartKeeprFootprintBundle:FootprintAttachment:getFile" # Controller - - "FootprintAttachmentGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.footprint_attachment.item_operation.custom_get_mime: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.footprint_attachment" # Resource - - [ "GET" ] # Methods - - "/footprint_attachments/{id}/getMimeTypeIcon" # Path - - "PartKeeprFootprintBundle:FootprintAttachment:getMimeTypeIcon" # Controller - - "FootprintAttachmentMimeTypeIcon" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.footprint_attachment.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.footprint_attachment", "GET" ] - - resource.footprint_attachment: - parent: "api.resource" - arguments: [ "PartKeepr\FootprintBundle\Entity\FootprintAttachment" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.footprint_attachment.item_operation.get", "@resource.footprint_attachment.item_operation.custom_get", "@resource.footprint_attachment.item_operation.custom_get_mime" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.footprint_category.item_operation.move: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.footprint_category" # Resource - - [ "PUT" ] # Methods - - "/footprint_categories/{id}/move" # Path - - "partkeepr.category.move" # Controller - - "FootprintCategoryMove" # Route name - - resource.footprint_category.collection_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: [ "@resource.footprint_category", "GET" ] - - resource.footprint_category.collection_operation.get_root: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.footprint_category" # Resource - - [ "GET" ] # Methods - - "/footprint_categories/getExtJSRootNode" # Path - - "partkeepr.category.get_root_node" # Controller - - "PartKeeprFootprintCategoryGetRootNode" - - resource.footprint_category.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.footprint_category", "GET" ] - - resource.footprint_category.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.footprint_category", "PUT" ] - - resource.footprint_category.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.footprint_category", "DELETE" ] - - resource.footprint_category: - parent: "api.resource" - arguments: [ "PartKeepr\FootprintBundle\Entity\FootprintCategory" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initCollectionOperations" - arguments: [ [ "@resource.footprint_category.collection_operation.get", "@resource.footprint_category.collection_operation.get_root", "@resource.footprint_category.collection_operation.post" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.footprint_category.item_operation.get", "@resource.footprint_category.item_operation.put", "@resource.footprint_category.item_operation.delete", "@resource.footprint_category.item_operation.move" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default", "tree" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default", "tree" ] } - - resource.import_preset: - parent: "api.resource" - arguments: [ "PartKeepr\ImportBundle\Entity\ImportPreset" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.grid_preset.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.grid_preset", "GET" ] - - resource.grid_preset.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.grid_preset", "PUT" ] - - resource.grid_preset.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.grid_preset", "DELETE" ] - - resource.grid_preset.item_operation.markAsDefault: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.grid_preset" # Resource - - [ "PUT" ] # Methods - - "/grid_presets/{id}/markAsDefault" # Path - - "partkeepr.grid_preset.mark_as_default" # Controller - - "MarkGridPresetAsDefault" # Route name - - resource.grid_preset: - parent: "api.resource" - arguments: [ "PartKeepr\FrontendBundle\Entity\GridPreset" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.grid_preset.item_operation.get", "@resource.grid_preset.item_operation.put", "@resource.grid_preset.item_operation.delete", "@resource.grid_preset.item_operation.markAsDefault" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.part.collection_operation.custom_post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.part" - - [ "POST" ] - - "/parts" - - "partkeepr.part.post" - - "PartPost" - - resource.part.collection_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.part" - - [ "GET" ] - - "/parts" - - "partkeepr.parts.collection_get" - - "PartsGet" - - resource.part.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part", "GET" ] - - resource.part.item_operation.custom_put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part" - - [ "PUT" ] - - "/parts/{id}" - - "partkeepr.part.put" - - "PartPut" - - - resource.part.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part", "DELETE" ] - - resource.part.item_operation.add_stock: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part" # Resource - - [ "PUT" ] # Methods - - "/parts/{id}/addStock" # Path - - "partkeepr.part.add_stock" # Controller - - "PartAddStock" # Route name - - resource.part.item_operation.remove_stock: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part" # Resource - - [ "PUT" ] # Methods - - "/parts/{id}/removeStock" # Path - - "partkeepr.part.remove_stock" # Controller - - "PartRemoveStock" # Route name - - resource.part.item_operation.set_stock: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part" # Resource - - [ "PUT" ] # Methods - - "/parts/{id}/setStock" # Path - - "partkeepr.part.set_stock" # Controller - - "PartSetStock" # Route name - - resource.part: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\Part" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.part.item_operation.get", "@resource.part.item_operation.custom_put", "@resource.part.item_operation.delete", "@resource.part.item_operation.add_stock", "@resource.part.item_operation.remove_stock", "@resource.part.item_operation.set_stock" ] ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.part.collection_operation.custom_get", "@resource.part.collection_operation.custom_post" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default", "readonly" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default", "stock" ] } - - resource.part_attachment.item_operation.custom_get_image: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part_attachment" # Resource - - [ "GET" ] # Methods - - "/part_attachments/{id}/getImage" # Path - - "PartKeeprPartBundle:PartAttachment:getImage" # Controller - - "PartAttachmentGetImage" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.part_attachment.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part_attachment" # Resource - - [ "GET" ] # Methods - - "/part_attachments/{id}/getFile" # Path - - "PartKeeprPartBundle:PartAttachment:getFile" # Controller - - "PartAttachmentGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.part_attachment.item_operation.custom_get_mime: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part_attachment" # Resource - - [ "GET" ] # Methods - - "/part_attachments/{id}/getMimeTypeIcon" # Path - - "PartKeeprPartBundle:PartAttachment:getMimeTypeIcon" # Controller - - "PartAttachmentMimeTypeIcon" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.part_attachment.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part_attachment", "GET" ] - - resource.part_attachment: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\PartAttachment" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.part_attachment.item_operation.get", "@resource.part_attachment.item_operation.custom_get", "@resource.part_attachment.item_operation.custom_get_mime", "@resource.part_attachment.item_operation.custom_get_image" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.part_category.item_operation.move: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.part_category" # Resource - - [ "PUT" ] # Methods - - "/part_categories/{id}/move" # Path - - "partkeepr.category.move" # Controller - - "PartKeeprPartCategoryMove" - - resource.part_category.collection_operation.get_root: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.part_category" # Resource - - [ "GET" ] # Methods - - "/part_categories/getExtJSRootNode" # Path - - "partkeepr.category.get_root_node" # Controller - - "PartKeeprPartCategoryGetRootNode" - - resource.part_category.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part_category", "GET" ] - - resource.part_category.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part_category", "PUT" ] - - resource.part_category.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.part_category", "DELETE" ] - - resource.part_category: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\Entity\\PartCategory" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initCollectionOperations" - arguments: [ [ "@resource.part_category.collection_operation.get", "@resource.part_category.collection_operation.get_root", "@resource.part_category.collection_operation.post" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.part_category.item_operation.get", "@resource.part_category.item_operation.put", "@resource.part_category.item_operation.delete", "@resource.part_category.item_operation.move" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default", "tree" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default", "tree" ] } - - resource.part_distributor: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\PartDistributor" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.part_manufacturer: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\PartManufacturer" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.part_parameter: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\PartParameter" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.meta_part_parameter_criteria: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\MetaPartParameterCriteria" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.manufacturer: - parent: "api.resource" - arguments: [ "PartKeepr\\ManufacturerBundle\\Entity\\Manufacturer" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.manufacturer_ic_logo.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.manufacturer_ic_logo" # Resource - - [ "GET" ] # Methods - - "/manufacturer_i_c_logos/{id}/getImage" # Path - - "PartKeeprManufacturerBundle:ManufacturerIcLogo:getImage" # Controller - - "ManufacturerIcLogoGetImage" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.manufacturer_ic_logo.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.manufacturer_ic_logo", "GET" ] - - resource.manufacturer_ic_logo.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.manufacturer_ic_logo", "PUT" ] - - resource.manufacturer_ic_logo: - parent: "api.resource" - arguments: [ "PartKeepr\\ManufacturerBundle\Entity\ManufacturerICLogo" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.manufacturer_ic_logo.item_operation.get", "@resource.manufacturer_ic_logo.item_operation.put", "@resource.manufacturer_ic_logo.item_operation.custom_get" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.partmeasurementunit.item_operation.custom_put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.partmeasurementunit" # Resource - - [ "PUT" ] # Methods - - "/part_measurement_units/{id}/setDefault" # Path - - "partkeepr.part_measurement_unit.set_default" # Controller - - "PartMeasurementUnitSetDefault" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.partmeasurementunit.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.partmeasurementunit", "GET" ] - - resource.partmeasurementunit.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.partmeasurementunit", "PUT" ] - - resource.partmeasurementunit: - parent: "api.resource" - arguments: [ "PartKeepr\\PartBundle\\Entity\\PartMeasurementUnit" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.partmeasurementunit.item_operation.custom_put", "@resource.partmeasurementunit.item_operation.get", "@resource.partmeasurementunit.item_operation.put" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - - resource.unit: - parent: "api.resource" - arguments: [ "PartKeepr\\UnitBundle\\Entity\\Unit" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.siprefix: - parent: "api.resource" - arguments: [ "PartKeepr\\SiPrefixBundle\\Entity\\SiPrefix" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - -# ######################## Storage Location Categories###################################### - resource.storage_location: - parent: "api.resource" - arguments: [ "PartKeepr\StorageLocationBundle\Entity\StorageLocation" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.stock_entry: - parent: "api.resource" - arguments: [ "PartKeepr\StockBundle\Entity\StockEntry" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - -# ######################## Storage Location Categories###################################### - - resource.storage_location_category.item_operation.move: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.storage_location_category" # Resource - - [ "PUT" ] # Methods - - "/storage_location_categories/{id}/move" # Path - - "partkeepr.category.move" # Controller - - "StorageLocationCategoryMove" # Route name - - resource.storage_location_category.collection_operation.get_root: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.storage_location_category" # Resource - - [ "GET" ] # Methods - - "/storage_location_categories/getExtJSRootNode" # Path - - "partkeepr.category.get_root_node" # Controller - - "StorageLocationCategoryGetRoot" # Route name - - resource.storage_location_category.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.storage_location_category", "GET" ] - - resource.storage_location_category.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.storage_location_category", "PUT" ] - - resource.storage_location_category.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.storage_location_category", "DELETE" ] - - resource.storage_location_category.collection_operation.post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: [ "@resource.storage_location_category", "POST" ] - - resource.storage_location_category: - parent: "api.resource" - arguments: [ "PartKeepr\StorageLocationBundle\Entity\StorageLocationCategory" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initCollectionOperations" - arguments: [ [ "@resource.storage_location_category.collection_operation.get", "@resource.storage_location_category.collection_operation.get_root", "@resource.storage_location_category.collection_operation.post" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.storage_location_category.item_operation.get", "@resource.storage_location_category.item_operation.put", "@resource.storage_location_category.item_operation.delete", "@resource.storage_location_category.item_operation.move" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default", "tree" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default", "tree" ] } - - resource.storage_location_image.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.storage_location_image", "GET" ] - - resource.storage_location_image.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.storage_location_image" # Resource - - [ "GET" ] # Methods - - "/storage_location_images/{id}/getImage" # Path - - "PartKeeprStorageLocationBundle:StorageLocationImage:getImage" # Controller - - "StorageLocationGetImage" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.storage_location_image: - parent: "api.resource" - arguments: [ "PartKeepr\StorageLocationBundle\Entity\StorageLocationImage" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.storage_location_image.item_operation.get", "@resource.storage_location_image.item_operation.custom_get" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - -# ######################## Temporary Images ###################################### - resource.tempimage.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.tempimage", "GET" ] - - resource.tempimage.collection_operation.custom_post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tempimage" # Resource - - [ "POST" ] # Methods - - "/temp_images/upload" # Path - - "PartKeeprImageBundle:TemporaryImage:upload" # Controller - - "TemporaryImageUpload" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempimage.collection_operation.custom_post_webcam: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tempimage" # Resource - - [ "POST" ] # Methods - - "/temp_images/webcamUpload" # Path - - "PartKeeprImageBundle:TemporaryImage:webcamUpload" # Controller - - "TemporaryImageUploadWebcam" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempimage.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.tempimage" # Resource - - [ "GET" ] # Methods - - "/temp_images/{id}/getImage" # Path - - "PartKeeprImageBundle:TemporaryImage:getImage" # Controller - - "TemporaryImageGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempimage: - parent: "api.resource" - arguments: [ "PartKeepr\\ImageBundle\\Entity\\TempImage" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initCollectionOperations" - arguments: [ [ "@resource.tempimage.collection_operation.custom_post", "@resource.tempimage.collection_operation.custom_post_webcam" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.tempimage.item_operation.get", "@resource.tempimage.item_operation.custom_get" ] ] - - resource.tempfile.collection_operation.custom_post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tempfile" # Resource - - [ "POST" ] # Methods - - "/temp_uploaded_files/upload" # Path - - "PartKeeprUploadedFileBundle:TemporaryFile:upload" # Controller - - "TemporaryFileUpload" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempfile.collection_operation.custom_post_webcam: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tempfile" # Resource - - [ "POST" ] # Methods - - "/temp_uploaded_files/webcamUpload" # Path - - "PartKeeprUploadedFileBundle:TemporaryFile:webcamUpload" # Controller - - "TemporaryFileUploadWebcam" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempfile.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.tempfile", "GET" ] - - resource.tempfile.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.tempfile" # Resource - - [ "GET" ] # Methods - - "/temp_uploaded_files/{id}/getFile" # Path - - "PartKeeprUploadedFileBundle:TemporaryFile:getFile" # Controller - - "TemporaryFileGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempfile.item_operation.custom_get_mimetype: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.tempfile" # Resource - - [ "GET" ] # Methods - - "/temp_uploaded_files/{id}/getMimeTypeIcon" # Path - - "PartKeeprUploadedFileBundle:TemporaryFile:getMimeTypeIcon" # Controller - - "TemporaryFileGetMimeTypeIcon" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.tempfile: - parent: "api.resource" - arguments: [ "PartKeepr\\UploadedFileBundle\\Entity\\TempUploadedFile" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initCollectionOperations" - arguments: [ [ "@resource.tempfile.collection_operation.custom_post" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.tempfile.item_operation.get", "@resource.tempfile.item_operation.custom_get", "@resource.tempfile.item_operation.custom_get_mimetype", "@resource.tempfile.collection_operation.custom_post_webcam" ] ] - - resource.tip_of_the_day.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.tip_of_the_day", "GET" ] - - resource.tip_of_the_day.item_operation.mark_read: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.tip_of_the_day" - - "PUT" - - "/tip_of_the_days/{id}/markTipRead" - - "partkeepr.tip_of_the_day.mark_read" - - "TipMarkRead" - - - resource.tip_of_the_day.collection_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: [ "@resource.tip_of_the_day", "GET" ] - - resource.tip_of_the_day.collection_operation.post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: [ "@resource.tip_of_the_day", "POST" ] - - resource.tip_of_the_day.collection_operation.mark_all_unread: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tip_of_the_day" - - [ "POST" ] - - "/tip_of_the_days/markAllTipsAsUnread" - - "partkeepr.tip_of_the_day.mark_all_unread" - - "TipMarkAllUnrad" - - resource.tip_of_the_day: - parent: "api.resource" - arguments: [ "PartKeepr\\TipOfTheDayBundle\\Entity\\TipOfTheDay" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.tip_of_the_day.collection_operation.get", "@resource.tip_of_the_day.collection_operation.post", "@resource.tip_of_the_day.collection_operation.mark_all_unread" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.tip_of_the_day.item_operation.get", "@resource.tip_of_the_day.item_operation.mark_read" ] ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.tip_of_the_day_history.collection_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.tip_of_the_day_history" - - [ "GET" ] - - "/tip_of_the_day_histories" - - "partkeepr.tip_of_the_day_history.collection_get" - - "TipHistoriesGet" - - resource.tip_of_the_day_history: - parent: "api.resource" - arguments: [ "PartKeepr\\TipOfTheDayBundle\\Entity\\TipOfTheDayHistory" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.tip_of_the_day_history.collection_operation.custom_get" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.user.item_operation.get_preferences: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.user" # Resource - - [ "GET" ] # Methods - - "/user_preferences" # Path - - "partkeepr.user_preference.get_preferences" # Controller - - "PartKeeprUserPreferenceGet" - - resource.user.item_operation.set_preference: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.user" # Resource - - [ "POST", "PUT" ] # Methods - - "/user_preferences" # Path - - "partkeepr.user_preference.set_preference" # Controller - - "PartKeeprUserPreferenceSet" - - resource.user.item_operation.delete_preference: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" # Resource - - [ "DELETE" ] # Methods - - "/user_preferences" # Path - - "partkeepr.user_preference.delete_preference" # Controller - - "PartKeeprUserPreferenceDelete" - - resource.user.item_operation.login: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" # Resource - - [ "POST" ] # Methods - - "/users/login" # Path - - "partkeepr.auth.login" # Controller - - "PartKeeprAuthLogin" - - resource.user.item_operation.change_password: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" # Resource - - [ "PUT" ] # Methods - - "/users/{id}/changePassword" # Path - - "partkeepr.auth.change_password" # Controller - - "PartKeeprAuthChangePassword" - - resource.user.collection_operation.get_providers: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" # Resource - - [ "GET" ] # Methods - - "/users/get_user_providers" # Path - - "partkeepr.auth.get_providers" # Controller - - "PartKeeprAuthGetProviders" - - resource.user.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.user", "GET" ] - - resource.user.item_operation.put_custom: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" # Resource - - [ "PUT" ] # Methods - - "/users/{id}" # Path - - "partkeepr.user.put" # Controller - - "PartKeeprUserPut" - - resource.user.collection_operation.post_custom: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.user" # Resource - - [ "POST" ] # Methods - - "/users" # Path - - "partkeepr.user.post" # Controller - - "PartKeeprUserPost" - - resource.user.item_operation.delete_custom: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.user" - - [ "DELETE" ] - - "/users/{id}" # Path - - "partkeepr.user.delete" # Controller - - "PartKeeprUserDelete" - - resource.user_provider: - parent: "api.resource" - arguments: [ "PartKeepr\\AuthBundle\\Entity\\UserProvider" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.user: - parent: "api.resource" - arguments: [ "PartKeepr\\AuthBundle\\Entity\\User" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.user.collection_operation.get", "@resource.user.collection_operation.post_custom", "@resource.user.collection_operation.get_providers" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.user.item_operation.get", "@resource.user.item_operation.get", "@resource.user.item_operation.put_custom", "@resource.user.item_operation.delete_custom", "@resource.user.item_operation.get_preferences", "@resource.user.item_operation.set_preference", "@resource.user.item_operation.delete_preference", "@resource.user.item_operation.login", "@resource.user.item_operation.change_password" ] ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.fos_user: - parent: "api.resource" - arguments: [ "PartKeepr\\AuthBundle\\Entity\\FOSUser" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\Project" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_part: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ProjectPart" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_report.collection_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: [ "@resource.project_report", "GET" ] - - resource.project_report.item_operation.custom_post: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.project_report" # Resource - - [ "POST" ] # Methods - - "/reports" # Path - - "PartKeeprProjectBundle:ProjectReport:createReport" # Controller - - "ProjectReportPost" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.project_report.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.project_report" # Resource - - [ "GET" ] # Methods - - "/reports/{id}" # Path - - "PartKeeprProjectBundle:ProjectReport:getReport" # Controller - - "ProjectReportGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.project_report.item_operation.put: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.project_report", "PUT" ] - - resource.project_report.item_operation.delete: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.project_report", "DELETE" ] - - resource.project_report: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\Report" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.project_report.item_operation.custom_get", "@resource.project_report.item_operation.put", "@resource.project_report.item_operation.delete" ] ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.project_report.collection_operation.get", "@resource.project_report.item_operation.custom_post"]] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default", "readonly" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_report_project: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ReportProject" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_report_part: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ReportPart" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_attachment.item_operation.custom_get_image: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.project_attachment" # Resource - - [ "GET" ] # Methods - - "/project_attachments/{id}/getImage" # Path - - "PartKeeprProjectBundle:ProjectAttachment:getImage" # Controller - - "ProjectAttachmentGetImage" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.project_attachment.item_operation.custom_get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.project_attachment" # Resource - - [ "GET" ] # Methods - - "/project_attachments/{id}/getFile" # Path - - "PartKeeprProjectBundle:ProjectAttachment:getFile" # Controller - - "ProjectAttachmentGet" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.project_attachment.item_operation.custom_get_mime: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.project_attachment" # Resource - - [ "GET" ] # Methods - - "/project_attachments/{id}/getMimeTypeIcon" # Path - - "PartKeeprProjectBundle:ProjectAttachment:getMimeTypeIcon" # Controller - - "ProjectAttachmentMimeTypeIcon" # Route name - - # Context (will be present in Hydra documentation) - "@type": "hydra:Operation" - "hydra:title": "A custom operation" - "returns": "xmls:string" - - resource.project_attachment.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.project_attachment", "GET" ] - - resource.project_attachment: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ProjectAttachment" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.project_attachment.item_operation.get", "@resource.project_attachment.item_operation.custom_get", "@resource.project_attachment.item_operation.custom_get_mime", "@resource.project_attachment.item_operation.custom_get_image" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_run: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ProjectRun" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.project_run_part: - parent: "api.resource" - arguments: [ "PartKeepr\\ProjectBundle\\Entity\\ProjectRunPart" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.system_notice.item_operation.get: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: [ "@resource.system_notice", "GET" ] - - resource.system_notice.item_operation.acknowledge: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.system_notice" # Resource - - [ "PUT" ] # Methods - - "/system_notices/{id}/acknowledge" # Path - - "partkeepr.system_notice.acknowledge" # Controller - - "SystemNoticeAcknowledge" # Route name - - resource.system_notice: - parent: "api.resource" - arguments: [ "PartKeepr\\CoreBundle\\Entity\\SystemNotice" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initItemOperations" - arguments: [ [ "@resource.system_notice.item_operation.get", "@resource.system_notice.item_operation.acknowledge" ] ] - - method: "initFilters" - arguments: [ [ "@doctrine_reflection_service.search_filter" ] ] - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } - - resource.system_preference.item_operation.get_preferences: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.system_preference" # Resource - - [ "GET" ] # Methods - - "/system_preferences" # Path - - "partkeepr.system_preference.get_preferences" # Controller - - "PartKeeprSystemPreferenceGet" - - resource.system_preference.item_operation.set_preference: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createCollectionOperation" ] - arguments: - - "@resource.system_preference" # Resource - - [ "POST", "PUT" ] # Methods - - "/system_preferences" # Path - - "partkeepr.system_preference.set_preference" # Controller - - "PartKeeprSystemPreferenceSet" - - resource.system_preference.item_operation.delete_preference: - class: "Dunglas\ApiBundle\Api\Operation\Operation" - public: false - factory: [ "@api.operation_factory", "createItemOperation" ] - arguments: - - "@resource.system_preference" # Resource - - [ "DELETE" ] # Methods - - "/system_preferences" # Path - - "partkeepr.system_preference.delete_preference" # Controller - - "PartKeeprSystemPreferenceDelete" - - resource.system_preference: - parent: "api.resource" - arguments: [ "PartKeepr\\SystemPreferenceBundle\\Entity\\SystemPreference" ] - tags: [ { name: "api.resource" } ] - calls: - - method: "initNormalizationContext" - arguments: [ { groups: [ "default" ] } ] - - method: "initCollectionOperations" - arguments: [ [ "@resource.system_preference.item_operation.get_preferences" ] ] - - method: "initItemOperations" - arguments: [ [ "@resource.system_preference.item_operation.set_preference", "@resource.system_preference.item_operation.delete_preference" ] ] - - method: "initDenormalizationContext" - arguments: - - { groups: [ "default" ] } diff --git a/app/config/config_setup.yml b/app/config/config_setup.yml index 06a73b589..073e0c84c 100644 --- a/app/config/config_setup.yml +++ b/app/config/config_setup.yml @@ -6,7 +6,7 @@ framework: engines: ['twig', 'php'] sensio_framework_extra: - view: { annotations: false } + view: { annotations: true } router: { annotations: true } monolog: diff --git a/app/config/config_setup_test.yml b/app/config/config_setup_test.yml index 07b3b23d2..994a650da 100644 --- a/app/config/config_setup_test.yml +++ b/app/config/config_setup_test.yml @@ -7,7 +7,6 @@ imports: - { resource: config_doctrine.yml } - { resource: config_fos_user.yml } - { resource: config_dunglas.yml } - - { resource: config_ldap.yml } - { resource: config_partkeepr.yml } - { resource: config_filesystem.yml } diff --git a/app/config/config_test.yml b/app/config/config_test.yml index aad23b3f9..61dd54605 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -5,6 +5,9 @@ framework: test: ~ session: storage_id: session.storage.mock_file +### http://symfony.com/doc/current/reference/configuration/framework.html#handler-id +## handler_id: session.handler.native_file +## save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%" profiler: enabled: false @@ -12,7 +15,7 @@ web_profiler: toolbar: false intercept_redirects: false -dunglas_api: +api_platform: cache: false doctrine: diff --git a/app/config/parameters.php b/app/config/parameters.php new file mode 100755 index 000000000..9435a7c39 --- /dev/null +++ b/app/config/parameters.php @@ -0,0 +1,56 @@ +setParameter('authentication_provider', 'PartKeepr.Auth.HTTPBasicAuthenticationProvider'); +$container->setParameter('cache.doctrine', 'array'); +$container->setParameter('cache.dunglas', false); +$container->setParameter('database_driver', 'pdo_mysql'); +$container->setParameter('database_host', 'localhost'); +$container->setParameter('database_name', 'te_mpe_ep'); +$container->setParameter('database_password', 'daniel'); +$container->setParameter('database_port', 3306); +$container->setParameter('database_user', 'daniel'); +$container->setParameter('fr3d_ldap.driver.accountCanonicalForm', NULL); +$container->setParameter('fr3d_ldap.driver.accountDomainName', NULL); +$container->setParameter('fr3d_ldap.driver.accountDomainNameShort', NULL); +$container->setParameter('fr3d_ldap.driver.accountFilterFormat', NULL); +$container->setParameter('fr3d_ldap.driver.baseDn', ''); +$container->setParameter('fr3d_ldap.driver.bindRequiresDn', false); +$container->setParameter('fr3d_ldap.driver.host', '127.0.0.1'); +$container->setParameter('fr3d_ldap.driver.optReferrals', NULL); +$container->setParameter('fr3d_ldap.driver.password', NULL); +$container->setParameter('fr3d_ldap.driver.port', NULL); +$container->setParameter('fr3d_ldap.driver.useSsl', NULL); +$container->setParameter('fr3d_ldap.driver.useStartTls', NULL); +$container->setParameter('fr3d_ldap.driver.username', NULL); +$container->setParameter('fr3d_ldap.user.attribute.email', 'email'); +$container->setParameter('fr3d_ldap.user.attribute.username', 'samaccountname'); +$container->setParameter('fr3d_ldap.user.baseDn', 'dc=blabla,dc=com'); +$container->setParameter('fr3d_ldap.user.filter', NULL); +$container->setParameter('locale', 'en'); +$container->setParameter('mailer_auth_mode', NULL); +$container->setParameter('mailer_encryption', NULL); +$container->setParameter('mailer_host', NULL); +$container->setParameter('mailer_password', NULL); +$container->setParameter('mailer_port', NULL); +$container->setParameter('mailer_transport', NULL); +$container->setParameter('mailer_user', NULL); +$container->setParameter('partkeepr.auth.max_users', 'unlimited'); +$container->setParameter('partkeepr.category.path_separator', ' ➤ '); +$container->setParameter('partkeepr.cronjob.check', true); +$container->setParameter('partkeepr.filesystem.data_directory', '%kernel.root_dir%/../data/'); +$container->setParameter('partkeepr.filesystem.quota', false); +$container->setParameter('partkeepr.frontend.auto_login.enabled', false); +$container->setParameter('partkeepr.frontend.auto_login.password', 'admin'); +$container->setParameter('partkeepr.frontend.auto_login.username', 'admin'); +$container->setParameter('partkeepr.frontend.base_url', false); +$container->setParameter('partkeepr.frontend.motd', false); +$container->setParameter('partkeepr.maintenance', false); +$container->setParameter('partkeepr.maintenance.message', ''); +$container->setParameter('partkeepr.maintenance.title', ''); +$container->setParameter('partkeepr.octopart.apikey', ''); +$container->setParameter('partkeepr.octopart.limit', '3'); +$container->setParameter('partkeepr.parts.internalpartnumberunique', false); +$container->setParameter('partkeepr.parts.limit', false); +$container->setParameter('partkeepr.patreon.statusuri', 'https://www.partkeepr.org/patreon.json'); +$container->setParameter('partkeepr.upload.limit', false); +$container->setParameter('partkeepr.users.limit', false); +$container->setParameter('secret', 'COAAFJGGLPHPDGGNCNILHFGECFMMACKC'); diff --git a/app/config/parameters.php.dist b/app/config/parameters.php.dist index 90cdc8820..c6b71bb34 100644 --- a/app/config/parameters.php.dist +++ b/app/config/parameters.php.dist @@ -120,7 +120,7 @@ $container->setParameter('fr3d_ldap.driver.accountDomainName', null); $container->setParameter('fr3d_ldap.driver.accountDomainNameShort', null); // set to true to enable LDAP -$container->setParameter('fr3d_ldap.user.enabled', false); +#$container->setParameter('fr3d_ldap.user.enabled', false); // sets the base DN $container->setParameter('fr3d_ldap.user.baseDn', 'dc=blabla,dc=com'); @@ -192,7 +192,7 @@ $container->setParameter('partkeepr.filesystem.quota', false); /** * Specifies the dunglas cache. Defaults to false. - * You can use the APCu cache by specifying "api.mapping.cache.apc" here. + * You can use the APCu cache by specifying "api_platform.mapping.cache.apc" here. * * Further reading: https://api-platform.com/doc/1.0/api-bundle/performances */ diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist new file mode 100644 index 000000000..55071a83c --- /dev/null +++ b/app/config/parameters.yml.dist @@ -0,0 +1,4 @@ +parameters: + api_platform: + cache: false + \ No newline at end of file diff --git a/app/config/parameters_setup.php b/app/config/parameters_setup.php new file mode 100755 index 000000000..9435a7c39 --- /dev/null +++ b/app/config/parameters_setup.php @@ -0,0 +1,56 @@ +setParameter('authentication_provider', 'PartKeepr.Auth.HTTPBasicAuthenticationProvider'); +$container->setParameter('cache.doctrine', 'array'); +$container->setParameter('cache.dunglas', false); +$container->setParameter('database_driver', 'pdo_mysql'); +$container->setParameter('database_host', 'localhost'); +$container->setParameter('database_name', 'te_mpe_ep'); +$container->setParameter('database_password', 'daniel'); +$container->setParameter('database_port', 3306); +$container->setParameter('database_user', 'daniel'); +$container->setParameter('fr3d_ldap.driver.accountCanonicalForm', NULL); +$container->setParameter('fr3d_ldap.driver.accountDomainName', NULL); +$container->setParameter('fr3d_ldap.driver.accountDomainNameShort', NULL); +$container->setParameter('fr3d_ldap.driver.accountFilterFormat', NULL); +$container->setParameter('fr3d_ldap.driver.baseDn', ''); +$container->setParameter('fr3d_ldap.driver.bindRequiresDn', false); +$container->setParameter('fr3d_ldap.driver.host', '127.0.0.1'); +$container->setParameter('fr3d_ldap.driver.optReferrals', NULL); +$container->setParameter('fr3d_ldap.driver.password', NULL); +$container->setParameter('fr3d_ldap.driver.port', NULL); +$container->setParameter('fr3d_ldap.driver.useSsl', NULL); +$container->setParameter('fr3d_ldap.driver.useStartTls', NULL); +$container->setParameter('fr3d_ldap.driver.username', NULL); +$container->setParameter('fr3d_ldap.user.attribute.email', 'email'); +$container->setParameter('fr3d_ldap.user.attribute.username', 'samaccountname'); +$container->setParameter('fr3d_ldap.user.baseDn', 'dc=blabla,dc=com'); +$container->setParameter('fr3d_ldap.user.filter', NULL); +$container->setParameter('locale', 'en'); +$container->setParameter('mailer_auth_mode', NULL); +$container->setParameter('mailer_encryption', NULL); +$container->setParameter('mailer_host', NULL); +$container->setParameter('mailer_password', NULL); +$container->setParameter('mailer_port', NULL); +$container->setParameter('mailer_transport', NULL); +$container->setParameter('mailer_user', NULL); +$container->setParameter('partkeepr.auth.max_users', 'unlimited'); +$container->setParameter('partkeepr.category.path_separator', ' ➤ '); +$container->setParameter('partkeepr.cronjob.check', true); +$container->setParameter('partkeepr.filesystem.data_directory', '%kernel.root_dir%/../data/'); +$container->setParameter('partkeepr.filesystem.quota', false); +$container->setParameter('partkeepr.frontend.auto_login.enabled', false); +$container->setParameter('partkeepr.frontend.auto_login.password', 'admin'); +$container->setParameter('partkeepr.frontend.auto_login.username', 'admin'); +$container->setParameter('partkeepr.frontend.base_url', false); +$container->setParameter('partkeepr.frontend.motd', false); +$container->setParameter('partkeepr.maintenance', false); +$container->setParameter('partkeepr.maintenance.message', ''); +$container->setParameter('partkeepr.maintenance.title', ''); +$container->setParameter('partkeepr.octopart.apikey', ''); +$container->setParameter('partkeepr.octopart.limit', '3'); +$container->setParameter('partkeepr.parts.internalpartnumberunique', false); +$container->setParameter('partkeepr.parts.limit', false); +$container->setParameter('partkeepr.patreon.statusuri', 'https://www.partkeepr.org/patreon.json'); +$container->setParameter('partkeepr.upload.limit', false); +$container->setParameter('partkeepr.users.limit', false); +$container->setParameter('secret', 'COAAFJGGLPHPDGGNCNILHFGECFMMACKC'); diff --git a/app/config/routing.yml b/app/config/routing.yml index e928500e7..4bac60a5b 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -57,5 +57,5 @@ _setup: api: resource: "." - type: "api" + type: "api_platform" prefix: "/api" # Optional diff --git a/app/config/routing_dev.yml b/app/config/routing_dev.yml index 577c3c482..304e72bae 100644 --- a/app/config/routing_dev.yml +++ b/app/config/routing_dev.yml @@ -6,9 +6,10 @@ _profiler: resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" prefix: /_profiler -_configurator: - resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" - prefix: /_configurator +# removed due to SensioUpgrade +#_configurator: +# resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" +# prefix: /_configurator _main: resource: routing.yml diff --git a/app/config/security.yml b/app/config/security.yml index 8e3c3aa19..d0bad84b0 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -18,26 +18,24 @@ security: providers: chain_provider: chain: - providers: [in_memory, fos_userbundle, fr3d_ldapbundle, legacy] + providers: [in_memory, fos_userbundle, legacy] legacy: id: partkeepr_legacy_user_provider in_memory: memory: ~ fos_userbundle: id: fos_user.user_provider.username - fr3d_ldapbundle: - id: fr3d_ldap.security.user.provider firewalls: login: pattern: ^/api/users/getSalt +#symf 3 ? path: ^/api/users/getSalt security: false main: stateless: false # Stores authentification within a cookie. This is important to allow file uploads without having to send authentification data. pattern: ^/api/.* +#symf 3 ? path: ^/api/.* provider: chain_provider - fr3d_ldap_httpbasic: - provider: chain_provider http_basic: provider: chain_provider remote_user: diff --git a/app/console b/bin/console similarity index 61% rename from app/console rename to bin/console index fa6a36e24..8cef40b2c 100755 --- a/app/console +++ b/bin/console @@ -1,22 +1,22 @@ #!/usr/bin/env php getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); -$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; +$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev', true); +$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption('--no-debug', true) && $env !== 'prod'; if ($debug) { Debug::enable(); diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index bbb0e6254..5490a972f --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "repositories": [ { "type": "vcs", - "url": "https://github.com/felicitus/EscapeWSSEAuthenticationBundle" + "url": "https://github.com/djoos/EscapeWSSEAuthenticationBundle" }, { "type": "vcs", @@ -31,7 +31,7 @@ }, { "type": "vcs", - "url": "https://github.com/partkeepr/FR3DLdapBundle" + "url": "https://github.com/Maks3w/FR3DLdapBundle" }, { "type": "vcs", @@ -39,72 +39,94 @@ } ], "require": { - "php": ">=5.6.0", + "php": ">=7.1.0", "atelierspierrot/famfamfam-silk-sprite": "1.0.0", "brainbits/fugue-icons-bundle": "3.5.6", "doctrine/doctrine-bundle": "1.10.3", - "doctrine/doctrine-fixtures-bundle": "2.4.1", - "doctrine/doctrine-migrations-bundle": "1.3.2", - "doctrine/migrations": "1.2.2", - "doctrine/orm": "2.5.14", + "doctrine/doctrine-cache-bundle": "1.3.5", + "doctrine/doctrine-fixtures-bundle": "v2.4.1", + "doctrine/doctrine-migrations-bundle": "v1.3.2", + "doctrine/migrations": "v1.2.2", + "doctrine/orm": "v2.6.6", "fortawesome/font-awesome": "5.15.1", - "friendsofsymfony/rest-bundle": "1.7.7", - "friendsofsymfony/user-bundle": "2.1.2", + "friendsofsymfony/rest-bundle": "2.0.1", + "friendsofsymfony/user-bundle": "v2.1.2", "guzzlehttp/guzzle": "6.5.5", "imagine/imagine": "1.2.4", - "incenteev/composer-parameter-handler": "2.1.4", - "knplabs/knp-gaufrette-bundle": "0.5.3", + "incenteev/composer-parameter-handler": "v2.1.4", + "knplabs/knp-gaufrette-bundle": "v0.5.3", "phpseclib/phpseclib": "2.0.30", - "predis/predis": "1.1.6", + "predis/predis": "v1.1.6", "ramsey/uuid": "3.9.3", "reputation-vip/composer-assets-installer": "1.0.4", - "sensio/distribution-bundle": "4.0.42", - "sensio/framework-extra-bundle": "3.0.29", + "sensio/distribution-bundle": "v5.0.25", + "sensio/framework-extra-bundle": "v3.0.29", "sonata-project/exporter": "1.7.1", - "snc/redis-bundle": "2.1.13", - "stof/doctrine-extensions-bundle": "1.3", - "symfony/assetic-bundle": "2.8.2", - "symfony/monolog-bundle": "3.3.1", - "symfony/property-access": "2.8.52", - "symfony/swiftmailer-bundle": "3.0.3", - "symfony/symfony": "2.8.52", - "twig/extensions": "1.5.4", - "twig/twig": "1.42.2", - - "dunglas/api-bundle": "dev-master#b30de689f94410c7dc0e449f2ecc15cfa8e70f54", - "escapestudios/wsse-authentication-bundle": "dev-advancedUserInterface", - "fr3d/ldap-bundle": "dev-master", + "stof/doctrine-extensions-bundle": "v1.3.0", + "symfony/assetic-bundle": "v2.8.2", + "symfony/monolog-bundle": "v3.4.0", + "symfony/property-access": "v3.4.10", + "symfony/cache": "v3.4.10", + "symfony/swiftmailer-bundle": "v3.4.0", + "symfony/symfony": "v3.4.10", + "twig/extensions": "v1.5.4", + "twig/twig": "v1.42.2", + + "api-platform/core": "dev-main", + "escapestudios/wsse-authentication-bundle": "2.3.0", "nfq-alpha/sprite-bundle": "dev-min-image-fix", "partkeepr/extjs6": "dev-master", "partkeepr/remote-file-loader": "dev-master", - "nelmio/api-doc-bundle": "~2.9@dev" + "nelmio/api-doc-bundle": "2.13.5" }, "require-dev": { + "sensio/generator-bundle": "^3.0", + "symfony/phpunit-bridge": "^3.0", "phpunit/phpunit": "5.7.27", "liip/functional-test-bundle": "1.10.0", "phing/phing": "2.16.3" }, - "autoload": { - "psr-0": { - "": "src/", - "PartKeepr": "src/backend" - } - }, - "minimum-stability": "stable", + "autoload": { + "psr-0": { "": "src/", "PartKeepr": "src/backend" }, + "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] + }, + "autoload-dev": { + "psr-4": { "Tests\\": "tests/" } + }, + "minimum-stability": "dev", "scripts": { "post-install-cmd": [ - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ], "post-update-cmd": [ - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", - "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" + "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ] }, + "config": { + "platform": { + "php": "7.4.18" + } + }, "extra": { - "symfony-assets-install": "relative", + "symfony-app-dir": "app", + "symfony-bin-dir": "bin", + "symfony-var-dir": "var", + "symfony-web-dir": "web", + "symfony-tests-dir": "tests", + "symfony-assets-install": "relative", + "incenteev-parameters": { + "file": "app/config/parameters.yml" + }, "assets-dir" : "web/", "installer-paths": { "web/js/packages/{$name}": [ diff --git a/composer.lock b/composer.lock index cd1b2a642..8e3a0aa42 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,102 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "005da634ba3ea4356b95323be5a97d37", + "content-hash": "9f10dbad29eccd40dc4aef5eded2c4a7", "packages": [ + { + "name": "api-platform/core", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/api-platform/core.git", + "reference": "63c880f975435c3cb04512f1d6367a17dad9ff0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/core/zipball/63c880f975435c3cb04512f1d6367a17dad9ff0d", + "reference": "63c880f975435c3cb04512f1d6367a17dad9ff0d", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.0", + "php": ">=7.0", + "psr/cache": "^1.0", + "symfony/http-foundation": "^2.7 || ^3.0", + "symfony/http-kernel": "^2.7 || ^3.0", + "symfony/serializer": "^3.1", + "willdurand/negotiation": "^2.0.3" + }, + "require-dev": { + "behat/behat": "^3.1", + "behat/mink": "^1.7", + "behat/mink-browserkit-driver": "^1.3.1", + "behat/mink-extension": "^2.2", + "behat/symfony2-extension": "^2.1", + "behatch/contexts": "^2.5", + "doctrine/annotations": "^1.2", + "doctrine/doctrine-bundle": "^1.6.3", + "doctrine/orm": "^2.5", + "friendsofsymfony/user-bundle": "^2.0@dev", + "nelmio/api-doc-bundle": "^2.11.2", + "php-mock/php-mock-phpunit": "^1.1", + "phpdocumentor/reflection-docblock": "^3.0", + "phpdocumentor/type-resolver": "^0.2", + "phpunit/phpunit": "^5.6.8", + "psr/log": "^1.0", + "symfony/asset": "^2.7 || ^3.0", + "symfony/cache": "^3.1", + "symfony/config": "^2.7 || ^3.0", + "symfony/dependency-injection": "^2.7 || ^3.0", + "symfony/doctrine-bridge": "^2.8 || ^3.0", + "symfony/finder": "^2.7 || ^3.0", + "symfony/framework-bundle": "^3.1", + "symfony/phpunit-bridge": "^2.7 || ^3.0", + "symfony/security": "^2.7 || ^3.0", + "symfony/templating": "^2.7 || ^3.0", + "symfony/twig-bundle": "^2.8 || ^3.1", + "symfony/validator": "^2.7 || ^3.0" + }, + "suggest": { + "friendsofsymfony/user-bundle": "To use the FOSUserBundle bridge.", + "phpdocumentor/reflection-docblock": "To support extracting metadata from PHPDoc.", + "psr/cache-implementation": "To use metadata caching.", + "symfony/cache": "To have metadata caching when using Symfony integration.", + "symfony/config": "To load XML configuration files.", + "symfony/twig-bundle": "To use the Swagger UI integration." + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Core\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com", + "homepage": "http://dunglas.fr" + } + ], + "description": "JSON-LD / Hydra REST API for Symfony", + "homepage": "http://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "json", + "rest" + ], + "time": "2016-12-02T13:50:49+00:00" + }, { "name": "atelierspierrot/famfamfam-silk-sprite", "version": "v1.0.0", @@ -250,35 +344,32 @@ }, { "name": "doctrine/annotations", - "version": "1.11.1", + "version": "1.14.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" + "reference": "03cb2123a67d4be806554fe670d0adc298199808" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/03cb2123a67d4be806554fe670d0adc298199808", + "reference": "03cb2123a67d4be806554fe670d0adc298199808", "shasum": "" }, "require": { "doctrine/lexer": "1.*", "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/cache": "1.*", + "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" + "phpunit/phpunit": "^7.5 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" @@ -317,44 +408,43 @@ "docblock", "parser" ], - "time": "2020-10-26T10:28:16+00:00" + "time": "2021-04-29T07:39:39+00:00" }, { "name": "doctrine/cache", - "version": "1.10.2", + "version": "1.11.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" + "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", + "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0", + "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0", "shasum": "" }, "require": { "php": "~7.1 || ^8.0" }, "conflict": { - "doctrine/common": ">2.2,<2.4" + "doctrine/common": ">2.2,<2.4", + "psr/cache": ">=3" }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^8.0", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0", + "symfony/cache": "^4.4 || ^5.2" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" @@ -413,30 +503,30 @@ "type": "tidelift" } ], - "time": "2020-07-07T18:54:01+00:00" + "time": "2021-04-13T14:46:17+00:00" }, { "name": "doctrine/collections", - "version": "1.6.7", + "version": "1.7.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a" + "reference": "436a4eb4535f141c6c52a3099016cb22ceca05b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/55f8b799269a1a472457bd1a41b4f379d4cfba4a", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a", + "url": "https://api.github.com/repos/doctrine/collections/zipball/436a4eb4535f141c6c52a3099016cb22ceca05b5", + "reference": "436a4eb4535f141c6c52a3099016cb22ceca05b5", "shasum": "" }, "require": { "php": "^7.1.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.8.1" + "doctrine/coding-standard": "^6.0 || ^8.0", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", + "vimeo/psalm": "^4.2.1" }, "type": "library", "autoload": { @@ -478,20 +568,20 @@ "iterators", "php" ], - "time": "2020-07-27T17:53:49+00:00" + "time": "2021-02-10T21:28:26+00:00" }, { "name": "doctrine/common", - "version": "v2.8.1", + "version": "2.8.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66" + "reference": "09140dc44c8fde67cf2c676f6e063406404f032f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", - "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", + "url": "https://api.github.com/repos/doctrine/common/zipball/09140dc44c8fde67cf2c676f6e063406404f032f", + "reference": "09140dc44c8fde67cf2c676f6e063406404f032f", "shasum": "" }, "require": { @@ -551,7 +641,7 @@ "persistence", "spl" ], - "time": "2017-08-31T08:43:38+00:00" + "time": "2017-08-31T08:48:09+00:00" }, { "name": "doctrine/data-fixtures", @@ -985,33 +1075,38 @@ }, { "name": "doctrine/inflector", - "version": "1.3.1", + "version": "1.4.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -1040,15 +1135,35 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ "inflection", - "pluralize", - "singularize", - "string" + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } ], - "time": "2019-10-30T19:59:35+00:00" + "time": "2021-04-16T17:34:40+00:00" }, { "name": "doctrine/instantiator", @@ -1117,30 +1232,27 @@ }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.3.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "59bfb3b9be04237be4cd1afea9bbb58794c25ce8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/59bfb3b9be04237be4cd1afea9bbb58794c25ce8", + "reference": "59bfb3b9be04237be4cd1afea9bbb58794c25ce8", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^8.2 || ^9.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" @@ -1151,14 +1263,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -1173,7 +1285,21 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2021-01-20T07:15:06+00:00" }, { "name": "doctrine/migrations", @@ -1245,38 +1371,39 @@ }, { "name": "doctrine/orm", - "version": "v2.5.14", + "version": "v2.6.6", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "810a7baf81462a5ddf10e8baa8cb94b6eec02754" + "reference": "2d9b9351831d1230881c52f006011cbf72fe944e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/810a7baf81462a5ddf10e8baa8cb94b6eec02754", - "reference": "810a7baf81462a5ddf10e8baa8cb94b6eec02754", + "url": "https://api.github.com/repos/doctrine/orm/zipball/2d9b9351831d1230881c52f006011cbf72fe944e", + "reference": "2d9b9351831d1230881c52f006011cbf72fe944e", "shasum": "" }, "require": { - "doctrine/cache": "~1.4", - "doctrine/collections": "~1.2", - "doctrine/common": ">=2.5-dev,<2.9-dev", - "doctrine/dbal": ">=2.5-dev,<2.7-dev", - "doctrine/instantiator": "^1.0.1", + "doctrine/annotations": "~1.5", + "doctrine/cache": "~1.6", + "doctrine/collections": "^1.4", + "doctrine/common": "^2.7.1", + "doctrine/dbal": "^2.6", + "doctrine/instantiator": "~1.1", "ext-pdo": "*", - "php": ">=5.4", - "symfony/console": "~2.5|~3.0|~4.0" + "php": "^7.1", + "symfony/console": "~3.0|~4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "symfony/yaml": "~2.3|~3.0|~4.0" + "doctrine/coding-standard": "^5.0", + "phpunit/phpunit": "^7.5", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" }, "bin": [ - "bin/doctrine", - "bin/doctrine.php" + "bin/doctrine" ], "type": "library", "extra": { @@ -1285,8 +1412,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\ORM\\": "lib/" + "psr-4": { + "Doctrine\\ORM\\": "lib/Doctrine/ORM" } }, "notification-url": "https://packagist.org/downloads/", @@ -1294,6 +1421,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -1302,13 +1433,13 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], "description": "Object-Relational-Mapper for PHP", @@ -1317,140 +1448,7 @@ "database", "orm" ], - "time": "2017-12-17T02:57:51+00:00" - }, - { - "name": "dunglas/api-bundle", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/api-platform/core.git", - "reference": "b30de689f94410c7dc0e449f2ecc15cfa8e70f54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/api-platform/core/zipball/b30de689f94410c7dc0e449f2ecc15cfa8e70f54", - "reference": "b30de689f94410c7dc0e449f2ecc15cfa8e70f54", - "shasum": "" - }, - "require": { - "doctrine/doctrine-bundle": "~1.2", - "doctrine/inflector": "~1.0", - "doctrine/orm": "~2.2,>=2.2.3", - "dunglas/php-property-info": "~0.2", - "ocramius/proxy-manager": "~1.0", - "php": ">=5.5", - "phpdocumentor/reflection": "^1.0.7", - "symfony/framework-bundle": "~2.6|~3.0", - "symfony/proxy-manager-bridge": "~2.3", - "symfony/serializer": "^2.7.2|~3.0", - "symfony/validator": "~2.5|~3.0", - "willdurand/negotiation": "~1.4" - }, - "require-dev": { - "behat/behat": "~3.0", - "behat/mink": "~1.5", - "behat/mink-browserkit-driver": "~1.1", - "behat/mink-extension": "~2.0", - "behat/symfony2-extension": "~2.0", - "behatch/contexts": "dev-master", - "friendsofsymfony/user-bundle": "~1.3", - "phpunit/phpunit": "~4.6", - "symfony/finder": "~2.3", - "symfony/security": "~2.7.2|~3.0" - }, - "suggest": { - "friendsofsymfony/user-bundle": "To use the FOSUserBundle bridge." - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Dunglas\\ApiBundle\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kévin Dunglas", - "email": "dunglas@gmail.com", - "homepage": "http://dunglas.fr" - } - ], - "description": "JSON-LD / Hydra REST API for Symfony", - "homepage": "http://api-platform.com", - "keywords": [ - "Hydra", - "JSON-LD", - "api", - "json", - "rest" - ], - "abandoned": "api-platform/api-pack", - "time": "2015-09-23T13:09:28+00:00" - }, - { - "name": "dunglas/php-property-info", - "version": "v0.2.3", - "source": { - "type": "git", - "url": "https://github.com/dunglas/php-property-info.git", - "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dunglas/php-property-info/zipball/698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", - "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", - "shasum": "" - }, - "require": { - "php": ">=5.4" - }, - "require-dev": { - "doctrine/orm": "~2.3", - "phpdocumentor/reflection": "~1.0", - "phpspec/phpspec": "~2.1" - }, - "suggest": { - "doctrine/orm": "To use Doctrine metadata", - "phpdocumentor/reflection": "To use the PHPDoc", - "symfony/validator": "To use Symfony validator metadata" - }, - "type": "library", - "autoload": { - "psr-0": { - "PropertyInfo\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kévin Dunglas", - "email": "dunglas@gmail.com" - } - ], - "description": "Retrieve type and description of PHP properties using various sources ", - "homepage": "http://dunglas.fr", - "keywords": [ - "doctrine", - "phpdoc", - "property", - "symfony", - "type", - "validator" - ], - "abandoned": "symfony/property-info", - "time": "2015-12-29T08:21:00+00:00" + "time": "2019-11-18T22:01:21+00:00" }, { "name": "egulias/email-validator", @@ -1518,34 +1516,30 @@ }, { "name": "escapestudios/wsse-authentication-bundle", - "version": "dev-advancedUserInterface", + "version": "2.3.0", "target-dir": "Escape/WSSEAuthenticationBundle", "source": { "type": "git", - "url": "https://github.com/Drachenkaetzchen/EscapeWSSEAuthenticationBundle.git", - "reference": "f0f75ff74a1fcb960d7b1f39dd10600f8cdaa20a" + "url": "https://github.com/djoos/EscapeWSSEAuthenticationBundle.git", + "reference": "fe5585f20570c89a3e6f9b889104c1263a734a22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Drachenkaetzchen/EscapeWSSEAuthenticationBundle/zipball/f0f75ff74a1fcb960d7b1f39dd10600f8cdaa20a", - "reference": "f0f75ff74a1fcb960d7b1f39dd10600f8cdaa20a", + "url": "https://api.github.com/repos/djoos/EscapeWSSEAuthenticationBundle/zipball/fe5585f20570c89a3e6f9b889104c1263a734a22", + "reference": "fe5585f20570c89a3e6f9b889104c1263a734a22", "shasum": "" }, "require": { "doctrine/common": "~2.2", - "php": ">=5.3.2", - "symfony/framework-bundle": "~2.3", - "symfony/security-bundle": "~2.3" + "php": ">=5.3.9", + "symfony/framework-bundle": "~2.3|~3.0", + "symfony/security-bundle": "~2.3|~3.0" }, "require-dev": { - "symfony/finder": "~2.3" + "symfony/finder": "~2.3|~3.0", + "symfony/phpunit-bridge": "~2.7|~3.0" }, "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, "autoload": { "psr-0": { "Escape\\WSSEAuthenticationBundle": "" @@ -1557,24 +1551,25 @@ "authors": [ { "name": "David Joos", - "email": "david@escapestudios.com" + "email": "david.joos@escapestudios.com" }, { "name": "Community contributors", - "homepage": "https://github.com/escapestudios/EscapeWSSEAuthenticationBundle/graphs/contributors" + "homepage": "https://github.com/djoos/EscapeWSSEAuthenticationBundle/graphs/contributors" } ], "description": "Symfony2 bundle to implement WSSE authentication", - "homepage": "https://github.com/escapestudios/EscapeWSSEAuthenticationBundle", + "homepage": "https://github.com/djoos/EscapeWSSEAuthenticationBundle", "keywords": [ "authentication", "bundle", "wsse" ], "support": { - "source": "https://github.com/Drachenkaetzchen/EscapeWSSEAuthenticationBundle/tree/PSR3Logging" + "source": "https://github.com/djoos/EscapeWSSEAuthenticationBundle/tree/2.3.0", + "issues": "https://github.com/djoos/EscapeWSSEAuthenticationBundle/issues" }, - "time": "2016-01-03T15:44:13+00:00" + "time": "2018-02-08T14:04:44+00:00" }, { "name": "fortawesome/font-awesome", @@ -1640,122 +1635,66 @@ "time": "2020-10-05T16:44:11+00:00" }, { - "name": "fr3d/ldap-bundle", - "version": "dev-master", + "name": "friendsofsymfony/rest-bundle", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/partkeepr/FR3DLdapBundle.git", - "reference": "492a4ac6d2edf95aa0a252fbca4376aad42d05c1" + "url": "https://github.com/FriendsOfSymfony/FOSRestBundle.git", + "reference": "183989449865836c08347f8e0e54e1f3aa9c45f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/partkeepr/FR3DLdapBundle/zipball/492a4ac6d2edf95aa0a252fbca4376aad42d05c1", - "reference": "492a4ac6d2edf95aa0a252fbca4376aad42d05c1", + "url": "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/183989449865836c08347f8e0e54e1f3aa9c45f0", + "reference": "183989449865836c08347f8e0e54e1f3aa9c45f0", "shasum": "" }, "require": { - "ext-ldap": "*", - "php": ">=5.3.2", - "symfony/config": "~2.1", - "symfony/dependency-injection": "~2.1", - "symfony/security": "~2.1", - "symfony/security-bundle": "~2.1", - "zendframework/zend-ldap": "~2" + "doctrine/inflector": "^1.0", + "php": "^5.5.9|~7.0", + "psr/log": "^1.0", + "symfony/finder": "^2.7|^3.0", + "symfony/framework-bundle": "^2.7|^3.0", + "symfony/routing": "^2.7|^3.0", + "willdurand/jsonp-callback-validator": "^1.0", + "willdurand/negotiation": "^2.0" + }, + "conflict": { + "jms/serializer": "1.3.0", + "sensio/framework-extra-bundle": "<3.0.13" }, "require-dev": { - "fabpot/php-cs-fixer": "*", - "phpunit/phpunit": "~4", - "symfony/validator": "~2.1" + "jms/serializer-bundle": "^1.0", + "phpoption/phpoption": "^1.1", + "sensio/framework-extra-bundle": "^3.0.13", + "symfony/browser-kit": "^2.7|^3.0", + "symfony/css-selector": "^2.7|^3.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/expression-language": "~2.7|^3.0", + "symfony/form": "^2.7|^3.0", + "symfony/phpunit-bridge": "~2.7|^3.0", + "symfony/security-bundle": "^2.7|^3.0", + "symfony/serializer": "^2.7.11|^3.0.4", + "symfony/twig-bundle": "^2.7|^3.0", + "symfony/validator": "^2.7|^3.0", + "symfony/web-profiler-bundle": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0" }, "suggest": { - "friendsofsymfony/user-bundle": "Integrate authentication and management for DB users, useful for unmanaged LDAP servers", - "symfony/validator": "Allow pre-validate for existing users before register new ones" - }, - "type": "symfony-bundle", - "autoload": { - "psr-4": { - "FR3D\\LdapBundle\\": "" - } - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Maks3w" - } - ], - "description": "This package provide users and authentication services based on LDAP directories for Symfony2 framework", - "homepage": "https://github.com/Maks3w/FR3DLdapBundle", - "keywords": [ - "authentication", - "ldap" - ], - "support": { - "issues": "https://github.com/Maks3w/FR3DLdapBundle/issues", - "source": "https://github.com/Maks3w/FR3DLdapBundle" - }, - "time": "2015-11-02T22:02:23+00:00" - }, - { - "name": "friendsofsymfony/rest-bundle", - "version": "1.7.7", - "target-dir": "FOS/RestBundle", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfSymfony/FOSRestBundle.git", - "reference": "c79b7e5df96e5581591ceb6a026bd4e5f9346de0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/zipball/c79b7e5df96e5581591ceb6a026bd4e5f9346de0", - "reference": "c79b7e5df96e5581591ceb6a026bd4e5f9346de0", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.0", - "php": "^5.3.9|~7.0", - "psr/log": "~1.0", - "symfony/framework-bundle": "~2.3|~3.0", - "symfony/http-kernel": "^2.3.24|~3.0", - "willdurand/jsonp-callback-validator": "~1.0", - "willdurand/negotiation": "~1.2" - }, - "conflict": { - "jms/serializer": "<0.12", - "jms/serializer-bundle": "<0.11", - "symfony/validator": ">=2.5.0,<2.5.5" - }, - "require-dev": { - "jms/serializer": "~0.13|~1.0", - "jms/serializer-bundle": "~0.12|~1.0", - "phpoption/phpoption": "~1.1.0", - "sensio/framework-extra-bundle": "~2.0|~3.0", - "sllh/php-cs-fixer-styleci-bridge": "^1.3", - "symfony/browser-kit": "~2.3|~3.0", - "symfony/dependency-injection": "~2.3|~3.0", - "symfony/form": "~2.3|~3.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "symfony/security": "~2.3|~3.0", - "symfony/serializer": "~2.3|~3.0", - "symfony/validator": "~2.3|~3.0", - "symfony/yaml": "~2.3|~3.0" - }, - "suggest": { - "jms/serializer-bundle": "Add support for advanced serialization capabilities, recommended, requires ~0.12||~1.0", - "sensio/framework-extra-bundle": "Add support for route annotations and the view response listener, requires ~3.0", - "symfony/serializer": "Add support for basic serialization capabilities and xml decoding, requires ~2.3", - "symfony/validator": "Add support for validation capabilities in the ParamFetcher, requires ~2.3" + "jms/serializer-bundle": "Add support for advanced serialization capabilities, recommended, requires ^1.0", + "sensio/framework-extra-bundle": "Add support for route annotations and the view response listener, requires ^3.0", + "symfony/expression-language": "Add support for using the expression language in the routing, requires ^2.7|^3.0", + "symfony/serializer": "Add support for basic serialization capabilities and xml decoding, requires ^2.7|^3.0", + "symfony/validator": "Add support for validation capabilities in the ParamFetcher, requires ^2.7|^3.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-0": { - "FOS\\RestBundle": "" + "psr-4": { + "FOS\\RestBundle\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1781,7 +1720,7 @@ "keywords": [ "rest" ], - "time": "2015-12-29T16:02:50+00:00" + "time": "2016-09-07T15:10:30+00:00" }, { "name": "friendsofsymfony/user-bundle", @@ -2626,42 +2565,47 @@ }, { "name": "nelmio/api-doc-bundle", - "version": "dev-master", + "version": "2.13.5", "target-dir": "Nelmio/ApiDocBundle", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioApiDocBundle.git", - "reference": "9af37448fa2f82856d068205afa96e9874527672" + "reference": "158149568863c688abfa3df94037257bbed628ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/9af37448fa2f82856d068205afa96e9874527672", - "reference": "9af37448fa2f82856d068205afa96e9874527672", + "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/158149568863c688abfa3df94037257bbed628ed", + "reference": "158149568863c688abfa3df94037257bbed628ed", "shasum": "" }, "require": { "michelf/php-markdown": "~1.4", - "symfony/console": "~2.3", - "symfony/framework-bundle": "~2.3", - "symfony/twig-bundle": "~2.3" + "php": ">=5.4", + "symfony/console": "~2.3|~3.0|~4.0", + "symfony/framework-bundle": "~2.3|~3.0|~4.0", + "symfony/twig-bundle": "~2.3|~3.0|~4.0" }, "conflict": { "jms/serializer": "<0.12", - "jms/serializer-bundle": "<0.11" + "jms/serializer-bundle": "<0.11", + "symfony/symfony": "~2.7.8", + "twig/twig": "<1.12" }, "require-dev": { - "dunglas/api-bundle": "~1.0@beta", - "friendsofsymfony/rest-bundle": "~1.0", + "doctrine/doctrine-bundle": "~1.5", + "doctrine/orm": "~2.3", + "dunglas/api-bundle": "~1.0", + "friendsofsymfony/rest-bundle": "~1.0|~2.0", "jms/serializer-bundle": ">=0.11", "sensio/framework-extra-bundle": "~3.0", - "symfony/browser-kit": "~2.3", - "symfony/css-selector": "~2.3", - "symfony/finder": "~2.3", - "symfony/form": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/serializer": "~2.7", - "symfony/validator": "~2.3", - "symfony/yaml": "~2.3" + "symfony/browser-kit": "~2.3|~3.0|~4.0", + "symfony/css-selector": "~2.3|~3.0|~4.0", + "symfony/finder": "~2.3|~3.0|~4.0", + "symfony/form": "~2.3|~3.0|~4.0", + "symfony/phpunit-bridge": "~2.7|~3.0|~4.0", + "symfony/serializer": "~2.7|~3.0|~4.0", + "symfony/validator": "~2.3|~3.0|~4.0", + "symfony/yaml": "~2.3|~3.0|~4.0" }, "suggest": { "dunglas/api-bundle": "For making use of resources definitions of DunglasApiBundle.", @@ -2673,7 +2617,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.9.x-dev" + "dev-2.x": "2.13-dev" } }, "autoload": { @@ -2702,7 +2646,7 @@ "documentation", "rest" ], - "time": "2015-09-30T21:35:45+00:00" + "time": "2021-03-23T07:09:33+00:00" }, { "name": "nfq-alpha/sprite-bundle", @@ -2748,113 +2692,6 @@ }, "time": "2016-08-01T15:59:08+00:00" }, - { - "name": "nikic/php-parser", - "version": "v0.9.4", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f", - "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9-dev" - } - }, - "autoload": { - "psr-0": { - "PHPParser": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2013-08-25T17:11:40+00:00" - }, - { - "name": "ocramius/proxy-manager", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", - "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "zendframework/zend-code": ">2.2.5,<3.0" - }, - "require-dev": { - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "1.5.*" - }, - "suggest": { - "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", - "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", - "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", - "zendframework/zend-stdlib": "To use the hydrator proxy", - "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "ProxyManager\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", - "homepage": "https://github.com/Ocramius/ProxyManager", - "keywords": [ - "aop", - "lazy loading", - "proxy", - "proxy pattern", - "service proxies" - ], - "time": "2015-08-09T04:28:19+00:00" - }, { "name": "paragonie/random_compat", "version": "v2.0.19", @@ -2987,109 +2824,6 @@ ], "time": "2015-09-30T13:47:50+00:00" }, - { - "name": "phpdocumentor/reflection", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/Reflection.git", - "reference": "fc40c3f604ac2287eb5c314174d5109b2c699372" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/fc40c3f604ac2287eb5c314174d5109b2c699372", - "reference": "fc40c3f604ac2287eb5c314174d5109b2c699372", - "shasum": "" - }, - "require": { - "nikic/php-parser": "~0.9.4", - "php": ">=5.3.3", - "phpdocumentor/reflection-docblock": "~2.0", - "psr/log": "~1.0" - }, - "require-dev": { - "behat/behat": "~2.4", - "mockery/mockery": "~0.8", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/", - "tests/unit/", - "tests/mocks/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Reflection library to do Static Analysis for PHP Projects", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2014-11-14T11:43:04+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2016-01-25T08:17:30+00:00" - }, { "name": "phpseclib/phpseclib", "version": "2.0.30", @@ -3271,8 +3005,54 @@ "time": "2020-09-11T19:18:05+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", @@ -3371,22 +3151,30 @@ }, { "name": "psr/log", - "version": "1.0.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3396,16 +3184,65 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21T11:40:51+00:00" + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "5a7b96b1dda5d957e01bc1bfe77dcca09c5a7474" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/5a7b96b1dda5d957e01bc1bfe77dcca09c5a7474", + "reference": "5a7b96b1dda5d957e01bc1bfe77dcca09c5a7474", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2020-04-21T06:43:17+00:00" }, { "name": "ralouphie/getallheaders", @@ -3550,7 +3387,7 @@ }, "require": { "composer-plugin-api": "~1.0", - "symfony/filesystem": "^2.0" + "symfony/filesystem": "^3.0" }, "require-dev": { "composer/composer": "1.0.x-dev", @@ -3576,45 +3413,37 @@ }, { "name": "sensio/distribution-bundle", - "version": "v4.0.42", - "target-dir": "Sensio/Bundle/DistributionBundle", + "version": "v5.0.25", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "71fdc7d57538f17eedf3c548c91ab214c694a9c0" + "reference": "80a38234bde8321fb92aa0b8c27978a272bb4baf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/71fdc7d57538f17eedf3c548c91ab214c694a9c0", - "reference": "71fdc7d57538f17eedf3c548c91ab214c694a9c0", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/80a38234bde8321fb92aa0b8c27978a272bb4baf", + "reference": "80a38234bde8321fb92aa0b8c27978a272bb4baf", "shasum": "" }, "require": { "php": ">=5.3.9", - "sensiolabs/security-checker": "~3.0|~4.0|~5.0|~6.0", - "symfony/class-loader": "~2.2", - "symfony/framework-bundle": "~2.3", - "symfony/process": "~2.2" - }, - "require-dev": { - "symfony/form": "~2.2", - "symfony/validator": "~2.2", - "symfony/yaml": "~2.2" - }, - "suggest": { - "symfony/form": "If you want to use the configurator", - "symfony/validator": "If you want to use the configurator", - "symfony/yaml": "If you want to use the configurator" + "sensiolabs/security-checker": "~5.0|~6.0", + "symfony/class-loader": "~2.3|~3.0", + "symfony/config": "~2.3|~3.0", + "symfony/dependency-injection": "~2.3|~3.0", + "symfony/filesystem": "~2.3|~3.0", + "symfony/http-kernel": "~2.3|~3.0", + "symfony/process": "~2.3|~3.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { - "psr-0": { - "Sensio\\Bundle\\DistributionBundle": "" + "psr-4": { + "Sensio\\Bundle\\DistributionBundle\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -3633,7 +3462,7 @@ "distribution" ], "abandoned": true, - "time": "2019-06-18T15:41:34+00:00" + "time": "2019-06-18T15:43:58+00:00" }, { "name": "sensio/framework-extra-bundle", @@ -3751,74 +3580,9 @@ } ], "description": "A security checker for your composer.lock", + "abandoned": "https://github.com/fabpot/local-php-security-checker", "time": "2019-11-01T13:20:14+00:00" }, - { - "name": "snc/redis-bundle", - "version": "2.1.13", - "source": { - "type": "git", - "url": "https://github.com/snc/SncRedisBundle.git", - "reference": "7c8652c1811c573ae567c1bcaa5e1c65723c5907" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/snc/SncRedisBundle/zipball/7c8652c1811c573ae567c1bcaa5e1c65723c5907", - "reference": "7c8652c1811c573ae567c1bcaa5e1c65723c5907", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0", - "symfony/yaml": "^2.7 || ^3.0 || ^4.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", - "predis/predis": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0", - "symfony/phpunit-bridge": "^2.7 || ^3.0 || ^4.0" - }, - "suggest": { - "monolog/monolog": "If you want to use the monolog redis handler.", - "predis/predis": "If you want to use predis.", - "symfony/console": "If you want to use commands to interact with the redis database", - "symfony/proxy-manager-bridge": "If you want to lazy-load some services" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Snc\\RedisBundle\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Henrik Westphal", - "email": "henrik.westphal@gmail.com" - }, - { - "name": "Community contributors", - "homepage": "https://github.com/snc/SncRedisBundle/contributors" - } - ], - "description": "A Redis bundle for Symfony", - "homepage": "https://github.com/snc/SncRedisBundle", - "keywords": [ - "nosql", - "redis", - "symfony" - ], - "time": "2019-12-09T12:56:15+00:00" - }, { "name": "sonata-project/exporter", "version": "1.7.1", @@ -4095,6 +3859,76 @@ "abandoned": "symfony/webpack-encore-pack", "time": "2017-07-14T07:26:46+00:00" }, + { + "name": "symfony/cache", + "version": "v3.4.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "b6f157d4529a3484f60ebc40661b5232526fb432" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/b6f157d4529a3484f60ebc40661b5232526fb432", + "reference": "b6f157d4529a3484f60ebc40661b5232526fb432", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/cache": "~1.0", + "psr/log": "~1.0", + "psr/simple-cache": "^1.0", + "symfony/polyfill-apcu": "~1.1" + }, + "conflict": { + "symfony/var-dumper": "<3.3" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "~1.6", + "doctrine/dbal": "~2.4", + "predis/predis": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Cache component with PSR-6, PSR-16, and tags", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "time": "2018-05-16T12:49:49+00:00" + }, { "name": "symfony/http-client", "version": "v4.4.18", @@ -4320,30 +4154,30 @@ }, { "name": "symfony/monolog-bundle", - "version": "v3.3.1", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "572e143afc03419a75ab002c80a2fd99299195ff" + "reference": "7fbecb371c1c614642c93c6b2cbcdf723ae8809d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/572e143afc03419a75ab002c80a2fd99299195ff", - "reference": "572e143afc03419a75ab002c80a2fd99299195ff", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/7fbecb371c1c614642c93c6b2cbcdf723ae8809d", + "reference": "7fbecb371c1c614642c93c6b2cbcdf723ae8809d", "shasum": "" }, "require": { "monolog/monolog": "~1.22", "php": ">=5.6", - "symfony/config": "~2.7|~3.3|~4.0", - "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", - "symfony/http-kernel": "~2.7|~3.3|~4.0", - "symfony/monolog-bridge": "~2.7|~3.3|~4.0" + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4.10|^4.0.10", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/monolog-bridge": "~3.4|~4.0" }, "require-dev": { - "symfony/console": "~2.7|~3.3|~4.0", - "symfony/phpunit-bridge": "^3.3|^4.0", - "symfony/yaml": "~2.7|~3.3|~4.0" + "symfony/console": "~3.4|~4.0", + "symfony/phpunit-bridge": "^3.4.19|^4.0", + "symfony/yaml": "~3.4|~4.0" }, "type": "symfony-bundle", "extra": { @@ -4379,20 +4213,20 @@ "log", "logging" ], - "time": "2018-11-04T09:58:13+00:00" + "time": "2019-06-20T12:18:19+00:00" }, { "name": "symfony/polyfill-apcu", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-apcu.git", - "reference": "f5191eb0e98e08d12eb49fc0ed0820e37de89fdf" + "reference": "80f7fb64c5b64ebcba76f40215e63808a2062a18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/f5191eb0e98e08d12eb49fc0ed0820e37de89fdf", - "reference": "f5191eb0e98e08d12eb49fc0ed0820e37de89fdf", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/80f7fb64c5b64ebcba76f40215e63808a2062a18", + "reference": "80f7fb64c5b64ebcba76f40215e63808a2062a18", "shasum": "" }, "require": { @@ -4401,7 +4235,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4453,20 +4287,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -4478,7 +4312,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4529,7 +4363,7 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-iconv", @@ -4610,29 +4444,28 @@ }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "c44d5bf6a75eed79555c6bf37505c6d39559353e" + "reference": "d76a2aba89a14405e288ea47598e91e304c3e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/c44d5bf6a75eed79555c6bf37505c6d39559353e", - "reference": "c44d5bf6a75eed79555c6bf37505c6d39559353e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/d76a2aba89a14405e288ea47598e91e304c3e120", + "reference": "d76a2aba89a14405e288ea47598e91e304c3e120", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/intl": "~2.3|~3.0|~4.0|~5.0" + "php": ">=7.1" }, "suggest": { - "ext-intl": "For best performance" + "ext-intl": "For best performance and support of other locales than \"en\"" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4642,6 +4475,15 @@ "autoload": { "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Icu\\": "" + }, + "classmap": [ + "Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -4682,7 +4524,7 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-04-19T09:48:16+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -4851,16 +4693,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "reference": "9ad2f3c9de0273812c616fdf96070a129c3defcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9ad2f3c9de0273812c616fdf96070a129c3defcb", + "reference": "9ad2f3c9de0273812c616fdf96070a129c3defcb", "shasum": "" }, "require": { @@ -4872,7 +4714,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4924,11 +4766,11 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-04-23T08:04:02+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", @@ -4993,7 +4835,7 @@ }, { "name": "symfony/polyfill-php55", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", @@ -5058,7 +4900,7 @@ }, { "name": "symfony/polyfill-php56", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", @@ -5123,7 +4965,7 @@ }, { "name": "symfony/polyfill-php70", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", @@ -5337,16 +5179,16 @@ }, { "name": "symfony/polyfill-util", - "version": "v1.20.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "fd2008fac0a11ae100537406d95887d5a9155e4f" + "reference": "f2a03e0938d3e4feabf63db6300da01b01cfa00e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/fd2008fac0a11ae100537406d95887d5a9155e4f", - "reference": "fd2008fac0a11ae100537406d95887d5a9155e4f", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/f2a03e0938d3e4feabf63db6300da01b01cfa00e", + "reference": "f2a03e0938d3e4feabf63db6300da01b01cfa00e", "shasum": "" }, "require": { @@ -5355,7 +5197,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5403,7 +5245,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T08:53:22+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/security-acl", @@ -5544,16 +5386,16 @@ }, { "name": "symfony/swiftmailer-bundle", - "version": "v3.0.3", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/swiftmailer-bundle.git", - "reference": "1c870bdd6ad0cccd45a7e553f80ca881b60a14d6" + "reference": "553d2474288349faed873da8ab7c1551a00d26ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/1c870bdd6ad0cccd45a7e553f80ca881b60a14d6", - "reference": "1c870bdd6ad0cccd45a7e553f80ca881b60a14d6", + "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/553d2474288349faed873da8ab7c1551a00d26ae", + "reference": "553d2474288349faed873da8ab7c1551a00d26ae", "shasum": "" }, "require": { @@ -5603,16 +5445,16 @@ }, { "name": "symfony/symfony", - "version": "v2.8.52", + "version": "v3.4.10", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "88f3ef62d6ab870128352c8686c7889562698faf" + "reference": "816bf5030e3ac7cf6a88575a27138a088d3041b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/88f3ef62d6ab870128352c8686c7889562698faf", - "reference": "88f3ef62d6ab870128352c8686c7889562698faf", + "url": "https://api.github.com/repos/symfony/symfony/zipball/816bf5030e3ac7cf6a88575a27138a088d3041b0", + "reference": "816bf5030e3ac7cf6a88575a27138a088d3041b0", "shasum": "" }, "require": { @@ -5905,25 +5747,28 @@ }, { "name": "willdurand/negotiation", - "version": "1.5.0", + "version": "v2.0.3", "source": { "type": "git", "url": "https://github.com/willdurand/Negotiation.git", - "reference": "2a59f2376557303e3fa91465ab691abb82945edf" + "reference": "1ebc51dd6d47f4037b0d2493335304e5aea50ab6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/2a59f2376557303e3fa91465ab691abb82945edf", - "reference": "2a59f2376557303e3fa91465ab691abb82945edf", + "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/1ebc51dd6d47f4037b0d2493335304e5aea50ab6", + "reference": "1ebc51dd6d47f4037b0d2493335304e5aea50ab6", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -5937,8 +5782,8 @@ ], "authors": [ { - "name": "William DURAND", - "email": "william.durand1@gmail.com" + "name": "William Durand", + "email": "will+git@drnd.me" } ], "description": "Content Negotiation tools for PHP provided as a standalone library.", @@ -5950,454 +5795,310 @@ "header", "negotiation" ], - "time": "2015-10-01T07:42:40+00:00" - }, + "time": "2016-08-30T11:08:41+00:00" + } + ], + "packages-dev": [ { - "name": "zendframework/zend-code", - "version": "2.6.3", + "name": "ddeboer/data-import", + "version": "0.18.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-code.git", - "reference": "95033f061b083e16cdee60530ec260d7d628b887" + "url": "https://github.com/ddeboer/data-import.git", + "reference": "cbae2f570192b738c5cec835fbf583a75c52d535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887", - "reference": "95033f061b083e16cdee60530ec260d7d628b887", + "url": "https://api.github.com/repos/ddeboer/data-import/zipball/cbae2f570192b738c5cec835fbf583a75c52d535", + "reference": "cbae2f570192b738c5cec835fbf583a75c52d535", "shasum": "" }, "require": { - "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6", - "zendframework/zend-eventmanager": "^2.6 || ^3.0" + "php": ">=5.3.0", + "psr/log": "~1.0" }, "require-dev": { - "doctrine/annotations": "~1.0", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "^4.8.21", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "doctrine/dbal": "*", + "doctrine/orm": "*", + "ext-iconv": "*", + "ext-mbstring": "*", + "ext-sqlite3": "*", + "phpoffice/phpexcel": "*", + "symfony/console": "~2.5.0", + "symfony/property-access": "*", + "symfony/validator": "~2.3.0" }, "suggest": { - "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", - "zendframework/zend-stdlib": "Zend\\Stdlib component" + "doctrine/dbal": "If you want to use the DbalReader", + "ext-iconv": "For the CharsetValueConverter", + "ext-mbstring": "For the CharsetValueConverter", + "phpoffice/phpexcel": "If you want to use the ExcelReader", + "symfony/console": "If you want to use the ConsoleProgressWriter", + "symfony/property-access": "If you want to use the ObjectConverter", + "symfony/validator": "to use the ValidatorFilter" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, "autoload": { - "psr-4": { - "Zend\\Code\\": "src/" + "psr-0": { + "Ddeboer\\DataImport": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "description": "provides facilities to generate arbitrary code using an object oriented interface", - "homepage": "https://github.com/zendframework/zend-code", - "keywords": [ - "code", - "zf2" + "MIT" ], - "abandoned": "laminas/laminas-code", - "time": "2016-04-20T17:26:42+00:00" - }, - { - "name": "zendframework/zend-eventmanager", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0" - }, - "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\EventManager\\": "src/" + "authors": [ + { + "name": "The community", + "homepage": "https://github.com/ddeboer/data-import/graphs/contributors" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" ], - "description": "Trigger and listen to events within a PHP application", - "homepage": "https://github.com/zendframework/zend-eventmanager", + "description": "Import data from, and export data to, a range of file formats and media", "keywords": [ - "event", - "eventmanager", - "events", - "zf2" + "csv", + "data", + "doctrine", + "excel", + "export", + "import" ], - "abandoned": "laminas/laminas-eventmanager", - "time": "2018-04-25T15:33:34+00:00" + "time": "2015-04-21T14:06:20+00:00" }, { - "name": "zendframework/zend-hydrator", - "version": "1.1.0", + "name": "dunglas/php-property-info", + "version": "v0.2.3", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-hydrator.git", - "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65" + "url": "https://github.com/dunglas/php-property-info.git", + "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/22652e1661a5a10b3f564cf7824a2206cf5a4a65", - "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65", + "url": "https://api.github.com/repos/dunglas/php-property-info/zipball/698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", + "reference": "698a5fa4f3901dba31e9163599aa9d4fdbf88f1a", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "php": ">=5.4" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.0@dev", - "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", - "zendframework/zend-filter": "^2.6", - "zendframework/zend-inputfilter": "^2.6", - "zendframework/zend-serializer": "^2.6.1", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" + "doctrine/orm": "~2.3", + "phpdocumentor/reflection": "~1.0", + "phpspec/phpspec": "~2.1" }, "suggest": { - "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", - "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage", - "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" + "doctrine/orm": "To use Doctrine metadata", + "phpdocumentor/reflection": "To use the PHPDoc", + "symfony/validator": "To use Symfony validator metadata" }, "type": "library", - "extra": { - "branch-alias": { - "dev-release-1.0": "1.0-dev", - "dev-release-1.1": "1.1-dev", - "dev-master": "2.0-dev", - "dev-develop": "2.1-dev" - } - }, "autoload": { - "psr-4": { - "Zend\\Hydrator\\": "src/" + "psr-0": { + "PropertyInfo\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "homepage": "https://github.com/zendframework/zend-hydrator", + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" + } + ], + "description": "Retrieve type and description of PHP properties using various sources ", + "homepage": "http://dunglas.fr", "keywords": [ - "hydrator", - "zf2" + "doctrine", + "phpdoc", + "property", + "symfony", + "type", + "validator" ], - "abandoned": "laminas/laminas-hydrator", - "time": "2016-02-18T22:38:26+00:00" + "abandoned": "symfony/property-info", + "time": "2015-12-29T08:21:00+00:00" }, { - "name": "zendframework/zend-ldap", - "version": "2.5.1", + "name": "laminas/laminas-code", + "version": "3.4.1", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-ldap.git", - "reference": "c647a86224030543401634dbafd514074b49b2b6" + "url": "https://github.com/laminas/laminas-code.git", + "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-ldap/zipball/c647a86224030543401634dbafd514074b49b2b6", - "reference": "c647a86224030543401634dbafd514074b49b2b6", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/1cb8f203389ab1482bf89c0e70a04849bacd7766", + "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766", "shasum": "" }, "require": { - "ext-ldap": "*", - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" + "laminas/laminas-eventmanager": "^2.6 || ^3.0", + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.1" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, + "replace": { + "zendframework/zend-code": "self.version" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5" + "doctrine/annotations": "^1.7", + "ext-phar": "*", + "laminas/laminas-coding-standard": "^1.0", + "laminas/laminas-stdlib": "^2.7 || ^3.0", + "phpunit/phpunit": "^7.5.16 || ^8.4" }, "suggest": { - "zendframework/zend-eventmanager": "Zend\\EventManager component" + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "laminas/laminas-stdlib": "Laminas\\Stdlib component" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "3.4.x-dev", + "dev-develop": "3.5.x-dev", + "dev-dev-4.0": "4.0.x-dev" } }, "autoload": { "psr-4": { - "Zend\\Ldap\\": "src/" + "Laminas\\Code\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides support for LDAP operations including but not limited to binding, searching and modifying entries in an LDAP directory", - "homepage": "https://github.com/zendframework/zend-ldap", + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", + "homepage": "https://laminas.dev", "keywords": [ - "ldap", - "zf2" + "code", + "laminas" ], - "abandoned": "laminas/laminas-ldap", - "time": "2015-06-03T15:32:02+00:00" + "time": "2019-12-31T16:28:24+00:00" }, { - "name": "zendframework/zend-stdlib", - "version": "2.7.7", + "name": "laminas/laminas-eventmanager", + "version": "3.4.x-dev", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f" + "url": "https://github.com/laminas/laminas-eventmanager.git", + "reference": "3da9d1c5334501c68cc68cd72cf5c4498dd7a14b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/3da9d1c5334501c68cc68cd72cf5c4498dd7a14b", + "reference": "3da9d1c5334501c68cc68cd72cf5c4498dd7a14b", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-hydrator": "~1.1" + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.3 || ^8.0" + }, + "replace": { + "zendframework/zend-eventmanager": "^3.2.1" }, "require-dev": { - "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" + "container-interop/container-interop": "^1.1", + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-stdlib": "^2.7.3 || ^3.0", + "phpbench/phpbench": "^0.17.1", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.4.1" }, "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + "container-interop/container-interop": "^1.1, to use the lazy listeners feature", + "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", - "extra": { - "branch-alias": { - "dev-release-2.7": "2.7-dev", - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" - } - }, "autoload": { "psr-4": { - "Zend\\Stdlib\\": "src/" + "Laminas\\EventManager\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://laminas.dev", "keywords": [ - "stdlib", - "zf2" - ], - "abandoned": "laminas/laminas-stdlib", - "time": "2016-04-12T21:17:31+00:00" - } - ], - "packages-dev": [ - { - "name": "ddeboer/data-import", - "version": "0.18.0", - "source": { - "type": "git", - "url": "https://github.com/ddeboer/data-import.git", - "reference": "cbae2f570192b738c5cec835fbf583a75c52d535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ddeboer/data-import/zipball/cbae2f570192b738c5cec835fbf583a75c52d535", - "reference": "cbae2f570192b738c5cec835fbf583a75c52d535", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "require-dev": { - "doctrine/dbal": "*", - "doctrine/orm": "*", - "ext-iconv": "*", - "ext-mbstring": "*", - "ext-sqlite3": "*", - "phpoffice/phpexcel": "*", - "symfony/console": "~2.5.0", - "symfony/property-access": "*", - "symfony/validator": "~2.3.0" - }, - "suggest": { - "doctrine/dbal": "If you want to use the DbalReader", - "ext-iconv": "For the CharsetValueConverter", - "ext-mbstring": "For the CharsetValueConverter", - "phpoffice/phpexcel": "If you want to use the ExcelReader", - "symfony/console": "If you want to use the ConsoleProgressWriter", - "symfony/property-access": "If you want to use the ObjectConverter", - "symfony/validator": "to use the ValidatorFilter" - }, - "type": "library", - "autoload": { - "psr-0": { - "Ddeboer\\DataImport": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "event", + "eventmanager", + "events", + "laminas" ], - "authors": [ - { - "name": "The community", - "homepage": "https://github.com/ddeboer/data-import/graphs/contributors" - }, + "funding": [ { - "name": "David de Boer", - "email": "david@ddeboer.nl" + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } ], - "description": "Import data from, and export data to, a range of file formats and media", - "keywords": [ - "csv", - "data", - "doctrine", - "excel", - "export", - "import" - ], - "time": "2015-04-21T14:06:20+00:00" + "time": "2021-03-08T15:26:33+00:00" }, { - "name": "guzzle/guzzle", - "version": "v3.9.3", + "name": "laminas/laminas-zendframework-bridge", + "version": "1.3.x-dev", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "url": "https://github.com/laminas/laminas-zendframework-bridge.git", + "reference": "ff8e9a7832de38fc329eb7cc0bc2b9bdaeddb819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/ff8e9a7832de38fc329eb7cc0bc2b9bdaeddb819", + "reference": "ff8e9a7832de38fc329eb7cc0bc2b9bdaeddb819", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" + "php": "^7.3 || ^8.0" }, "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "psalm/plugin-phpunit": "^0.15.1", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.6" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.9-dev" + "laminas": { + "module": "Laminas\\ZendFrameworkBridge" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "files": [ + "src/autoload.php" + ], + "psr-4": { + "Laminas\\ZendFrameworkBridge\\": "src//" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, + "description": "Alias legacy ZF class names to Laminas Project equivalents.", + "keywords": [ + "ZendFramework", + "autoloading", + "laminas", + "zf" + ], + "funding": [ { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2021-02-25T21:55:08+00:00" }, { "name": "liip/functional-test-bundle", @@ -6517,114 +6218,468 @@ "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v0.9.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + }, + "autoload": { + "psr-0": { + "PHPParser": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2013-08-25T17:11:40+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/1d32342b8c1eb27353c8887c366147b4c2da673c", + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.3.0" + }, + "require-dev": { + "composer/composer": "^1.8.6", + "doctrine/coding-standard": "^6.0.0", + "ext-zip": "*", + "infection/infection": "^0.13.4", + "phpunit/phpunit": "^8.2.5", + "vimeo/psalm": "^3.4.9" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-07-17T15:49:50+00:00" + }, + { + "name": "ocramius/proxy-manager", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "dec37bfb3c3594440ee4fa263494189344787d22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/dec37bfb3c3594440ee4fa263494189344787d22", + "reference": "dec37bfb3c3594440ee4fa263494189344787d22", + "shasum": "" + }, + "require": { + "laminas/laminas-code": "^3.4.1", + "ocramius/package-versions": "^1.5.1", + "php": "7.4.*", + "webimpress/safe-writer": "^2.0" + }, + "conflict": { + "doctrine/annotations": "<1.6.1", + "laminas/laminas-stdlib": "<3.2.1", + "zendframework/zend-stdlib": "<3.2.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0.0", + "ext-phar": "*", + "infection/infection": "^0.15.0", + "mikey179/vfsstream": "^1.6.8", + "nikic/php-parser": "^4.3.0", + "phpbench/phpbench": "^0.16.10", + "phpunit/phpunit": "^8.5.1", + "slevomat/coding-standard": "^5.0.4", + "squizlabs/php_codesniffer": "^3.5.3", + "symfony/console": "^4.4.2", + "vimeo/psalm": "3.7.0" + }, + "suggest": { + "laminas/laminas-json": "To have the JsonRpc adapter (Remote Object feature)", + "laminas/laminas-soap": "To have the Soap adapter (Remote Object feature)", + "laminas/laminas-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)", + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "ProxyManager\\": "src/ProxyManager" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", + "keywords": [ + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" + ], + "time": "2020-01-27T09:25:51+00:00" + }, + { + "name": "phing/phing", + "version": "2.16.3", + "source": { + "type": "git", + "url": "https://github.com/phingofficial/phing.git", + "reference": "b34c2bf9cd6abd39b4287dee31e68673784c8567" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phingofficial/phing/zipball/b34c2bf9cd6abd39b4287dee31e68673784c8567", + "reference": "b34c2bf9cd6abd39b4287dee31e68673784c8567", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "mikey179/vfsstream": "^1.6", + "pdepend/pdepend": "2.x", + "pear/archive_tar": "1.4.x", + "pear/http_request2": "dev-trunk", + "pear/net_growl": "dev-trunk", + "pear/pear-core-minimal": "1.10.1", + "pear/versioncontrol_git": "@dev", + "pear/versioncontrol_svn": "~0.5", + "phpdocumentor/phpdocumentor": "2.x", + "phploc/phploc": "~2.0.6", + "phpmd/phpmd": "~2.2", + "phpunit/phpunit": ">=3.7", + "sebastian/git": "~1.0", + "sebastian/phpcpd": "2.x", + "siad007/versioncontrol_hg": "^1.0", + "simpletest/simpletest": "^1.1", + "squizlabs/php_codesniffer": "~2.2", + "symfony/yaml": "^2.8 || ^3.1 || ^4.0" + }, + "suggest": { + "pdepend/pdepend": "PHP version of JDepend", + "pear/archive_tar": "Tar file management class", + "pear/versioncontrol_git": "A library that provides OO interface to handle Git repository", + "pear/versioncontrol_svn": "A simple OO-style interface for Subversion, the free/open-source version control system", + "phpdocumentor/phpdocumentor": "Documentation Generator for PHP", + "phploc/phploc": "A tool for quickly measuring the size of a PHP project", + "phpmd/phpmd": "PHP version of PMD tool", + "phpunit/php-code-coverage": "Library that provides collection, processing, and rendering functionality for PHP code coverage information", + "phpunit/phpunit": "The PHP Unit Testing Framework", + "sebastian/phpcpd": "Copy/Paste Detector (CPD) for PHP code", + "siad007/versioncontrol_hg": "A library for interfacing with Mercurial repositories.", + "tedivm/jshrink": "Javascript Minifier built in PHP" + }, + "bin": [ + "bin/phing" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.16.x-dev" + } + }, + "autoload": { + "classmap": [ + "classes/phing/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "classes" + ], + "license": [ + "LGPL-3.0-only" + ], + "authors": [ + { + "name": "Michiel Rook", + "email": "mrook@php.net" + }, + { + "name": "Phing Community", + "homepage": "https://www.phing.info/trac/wiki/Development/Contributors" + } + ], + "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", + "homepage": "https://www.phing.info/", + "keywords": [ + "build", + "phing", + "task", + "tool" + ], + "time": "2020-02-03T18:50:54+00:00" + }, + { + "name": "php-coveralls/php-coveralls", + "version": "v2.4.3", + "source": { + "type": "git", + "url": "https://github.com/php-coveralls/php-coveralls.git", + "reference": "909381bd40a17ae6e9076051f0d73293c1c091af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/909381bd40a17ae6e9076051f0d73293c1c091af", + "reference": "909381bd40a17ae6e9076051f0d73293c1c091af", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "php": "^5.5 || ^7.0 || ^8.0", + "psr/log": "^1.0", + "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0", + "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0", + "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/php-coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpCoveralls\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp", + "role": "Original creator" + }, + { + "name": "Takashi Matsuo", + "email": "tmatsuo@google.com" + }, + { + "name": "Google Inc" + }, + { + "name": "Dariusz Ruminski", + "email": "dariusz.ruminski@gmail.com", + "homepage": "https://github.com/keradus" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/php-coveralls/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2020-12-24T09:17:03+00:00" + }, + { + "name": "phpdocumentor/reflection", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "fc40c3f604ac2287eb5c314174d5109b2c699372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/fc40c3f604ac2287eb5c314174d5109b2c699372", + "reference": "fc40c3f604ac2287eb5c314174d5109b2c699372", + "shasum": "" + }, + "require": { + "nikic/php-parser": "~0.9.4", + "php": ">=5.3.3", + "phpdocumentor/reflection-docblock": "~2.0", + "psr/log": "~1.0" + }, + "require-dev": { + "behat/behat": "~2.4", + "mockery/mockery": "~0.8", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/", + "tests/mocks/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2014-11-14T11:43:04+00:00" }, { - "name": "phing/phing", - "version": "2.16.3", + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", "source": { "type": "git", - "url": "https://github.com/phingofficial/phing.git", - "reference": "b34c2bf9cd6abd39b4287dee31e68673784c8567" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phingofficial/phing/zipball/b34c2bf9cd6abd39b4287dee31e68673784c8567", - "reference": "b34c2bf9cd6abd39b4287dee31e68673784c8567", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": ">=5.3.3" }, "require-dev": { - "ext-pdo_sqlite": "*", - "mikey179/vfsstream": "^1.6", - "pdepend/pdepend": "2.x", - "pear/archive_tar": "1.4.x", - "pear/http_request2": "dev-trunk", - "pear/net_growl": "dev-trunk", - "pear/pear-core-minimal": "1.10.1", - "pear/versioncontrol_git": "@dev", - "pear/versioncontrol_svn": "~0.5", - "phpdocumentor/phpdocumentor": "2.x", - "phploc/phploc": "~2.0.6", - "phpmd/phpmd": "~2.2", - "phpunit/phpunit": ">=3.7", - "sebastian/git": "~1.0", - "sebastian/phpcpd": "2.x", - "siad007/versioncontrol_hg": "^1.0", - "simpletest/simpletest": "^1.1", - "squizlabs/php_codesniffer": "~2.2", - "symfony/yaml": "^2.8 || ^3.1 || ^4.0" + "phpunit/phpunit": "~4.0" }, "suggest": { - "pdepend/pdepend": "PHP version of JDepend", - "pear/archive_tar": "Tar file management class", - "pear/versioncontrol_git": "A library that provides OO interface to handle Git repository", - "pear/versioncontrol_svn": "A simple OO-style interface for Subversion, the free/open-source version control system", - "phpdocumentor/phpdocumentor": "Documentation Generator for PHP", - "phploc/phploc": "A tool for quickly measuring the size of a PHP project", - "phpmd/phpmd": "PHP version of PMD tool", - "phpunit/php-code-coverage": "Library that provides collection, processing, and rendering functionality for PHP code coverage information", - "phpunit/phpunit": "The PHP Unit Testing Framework", - "sebastian/phpcpd": "Copy/Paste Detector (CPD) for PHP code", - "siad007/versioncontrol_hg": "A library for interfacing with Mercurial repositories.", - "tedivm/jshrink": "Javascript Minifier built in PHP" + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" }, - "bin": [ - "bin/phing" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.16.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "classmap": [ - "classes/phing/" - ] + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "classes" - ], "license": [ - "LGPL-3.0-only" + "MIT" ], "authors": [ { - "name": "Michiel Rook", - "email": "mrook@php.net" - }, - { - "name": "Phing Community", - "homepage": "https://www.phing.info/trac/wiki/Development/Contributors" + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" } ], - "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", - "homepage": "https://www.phing.info/", - "keywords": [ - "build", - "phing", - "task", - "tool" - ], - "time": "2020-02-03T18:50:54+00:00" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", @@ -7081,75 +7136,6 @@ "abandoned": true, "time": "2017-06-30T09:13:00+00:00" }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "abandoned": "php-coveralls/php-coveralls", - "time": "2013-05-04T08:07:33+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.2", @@ -7671,38 +7657,44 @@ }, { "name": "sensio/generator-bundle", - "version": "v2.5.3", - "target-dir": "Sensio/Bundle/GeneratorBundle", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", - "reference": "e50108c2133ee5c9c484555faed50c17a61221d3" + "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/e50108c2133ee5c9c484555faed50c17a61221d3", - "reference": "e50108c2133ee5c9c484555faed50c17a61221d3", + "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/28cbaa244bd0816fd8908b93f90380bcd7b67a65", + "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65", "shasum": "" }, "require": { - "symfony/console": "~2.5", - "symfony/framework-bundle": "~2.2" + "symfony/console": "~2.7|~3.0", + "symfony/framework-bundle": "~2.7|~3.0", + "symfony/process": "~2.7|~3.0", + "symfony/yaml": "~2.7|~3.0", + "twig/twig": "^1.28.2|^2.0" }, "require-dev": { - "doctrine/orm": "~2.2,>=2.2.3", - "symfony/doctrine-bridge": "~2.2", - "twig/twig": "~1.11" + "doctrine/orm": "~2.4", + "symfony/doctrine-bridge": "~2.7|~3.0", + "symfony/filesystem": "~2.7|~3.0", + "symfony/phpunit-bridge": "^3.3" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.5.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { - "psr-0": { - "Sensio\\Bundle\\GeneratorBundle": "" - } + "psr-4": { + "Sensio\\Bundle\\GeneratorBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -7716,25 +7708,156 @@ ], "description": "This bundle generates code for you", "abandoned": "symfony/maker-bundle", - "time": "2015-03-17T06:36:52+00:00" + "time": "2017-12-07T15:36:41+00:00" + }, + { + "name": "symfony/phpunit-bridge", + "version": "3.4.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "120273ad5d03a8deee08ca9260e2598f288f2bac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/120273ad5d03a8deee08ca9260e2598f288f2bac", + "reference": "120273ad5d03a8deee08ca9260e2598f288f2bac", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0|9.1.2" + }, + "suggest": { + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", + "extra": { + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PHPUnit Bridge", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-11-13T16:28:59+00:00" + }, + { + "name": "webimpress/safe-writer", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/webimpress/safe-writer.git", + "reference": "f06fc5fb526980819d01549a86b5288d0c94aa50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webimpress/safe-writer/zipball/f06fc5fb526980819d01549a86b5288d0c94aa50", + "reference": "f06fc5fb526980819d01549a86b5288d0c94aa50", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.4", + "vimeo/psalm": "^4.7", + "webimpress/coding-standard": "^1.2.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev", + "dev-develop": "2.3.x-dev", + "dev-release-1.0": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Webimpress\\SafeWriter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "Tool to write files safely, to avoid race conditions", + "keywords": [ + "concurrent write", + "file writer", + "race condition", + "safe writer", + "webimpress" + ], + "funding": [ + { + "url": "https://github.com/michalbundyra", + "type": "github" + } + ], + "time": "2021-04-20T07:05:28+00:00" } ], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": { - "dunglas/api-bundle": 20, - "escapestudios/wsse-authentication-bundle": 20, - "fr3d/ldap-bundle": 20, + "api-platform/core": 20, "nfq-alpha/sprite-bundle": 20, "partkeepr/extjs6": 20, - "partkeepr/remote-file-loader": 20, - "nelmio/api-doc-bundle": 20 + "partkeepr/remote-file-loader": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6.0" + "php": ">=7.1.0" }, "platform-dev": [], + "platform-overrides": { + "php": "7.4.18" + }, "plugin-api-version": "1.1.0" } diff --git a/documentation/developer/UNIT-TESTS.md b/documentation/developer/UNIT-TESTS.md index f39b4c169..3734d4dca 100644 --- a/documentation/developer/UNIT-TESTS.md +++ b/documentation/developer/UNIT-TESTS.md @@ -28,4 +28,4 @@ If you need to run individual tests, you can do so by using the following comman Full example: -`phpunit -c app/ src/PartKeepr/AuthBundle/Tests/Controller/DefaultControllerTest` +`phpunit -c app/ tests/PartKeepr/AuthBundle/Controller/DefaultControllerTest` diff --git a/app/autoload.php b/migrated/autoload.php similarity index 100% rename from app/autoload.php rename to migrated/autoload.php diff --git a/migrated/bootstrap.php.cache b/migrated/bootstrap.php.cache new file mode 100644 index 000000000..0f01bcde2 --- /dev/null +++ b/migrated/bootstrap.php.cache @@ -0,0 +1,1410 @@ +parameters = $parameters; +} +public function all() +{ +return $this->parameters; +} +public function keys() +{ +return array_keys($this->parameters); +} +public function replace(array $parameters = array()) +{ +$this->parameters = $parameters; +} +public function add(array $parameters = array()) +{ +$this->parameters = array_replace($this->parameters, $parameters); +} +public function get($key, $default = null) +{ +return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; +} +public function set($key, $value) +{ +$this->parameters[$key] = $value; +} +public function has($key) +{ +return array_key_exists($key, $this->parameters); +} +public function remove($key) +{ +unset($this->parameters[$key]); +} +public function getAlpha($key, $default ='') +{ +return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default)); +} +public function getAlnum($key, $default ='') +{ +return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default)); +} +public function getDigits($key, $default ='') +{ +return str_replace(array('-','+'),'', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT)); +} +public function getInt($key, $default = 0) +{ +return (int) $this->get($key, $default); +} +public function getBoolean($key, $default = false) +{ +return $this->filter($key, $default, FILTER_VALIDATE_BOOLEAN); +} +public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array()) +{ +$value = $this->get($key, $default); +if (!is_array($options) && $options) { +$options = array('flags'=> $options); +} +if (is_array($value) && !isset($options['flags'])) { +$options['flags'] = FILTER_REQUIRE_ARRAY; +} +return filter_var($value, $filter, $options); +} +public function getIterator() +{ +return new \ArrayIterator($this->parameters); +} +public function count() +{ +return count($this->parameters); +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class HeaderBag implements \IteratorAggregate, \Countable +{ +protected $headers = array(); +protected $cacheControl = array(); +public function __construct(array $headers = array()) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function __toString() +{ +if (!$headers = $this->all()) { +return''; +} +ksort($headers); +$max = max(array_map('strlen', array_keys($headers))) + 1; +$content =''; +foreach ($headers as $name => $values) { +$name = implode('-', array_map('ucfirst', explode('-', $name))); +foreach ($values as $value) { +$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); +} +} +return $content; +} +public function all() +{ +return $this->headers; +} +public function keys() +{ +return array_keys($this->all()); +} +public function replace(array $headers = array()) +{ +$this->headers = array(); +$this->add($headers); +} +public function add(array $headers) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function get($key, $default = null, $first = true) +{ +$key = str_replace('_','-', strtolower($key)); +$headers = $this->all(); +if (!array_key_exists($key, $headers)) { +if (null === $default) { +return $first ? null : array(); +} +return $first ? $default : array($default); +} +if ($first) { +return \count($headers[$key]) ? $headers[$key][0] : $default; +} +return $headers[$key]; +} +public function set($key, $values, $replace = true) +{ +$key = str_replace('_','-', strtolower($key)); +if (\is_array($values)) { +$values = array_values($values); +if (true === $replace || !isset($this->headers[$key])) { +$this->headers[$key] = $values; +} else { +$this->headers[$key] = array_merge($this->headers[$key], $values); +} +} else { +if (true === $replace || !isset($this->headers[$key])) { +$this->headers[$key] = array($values); +} else { +$this->headers[$key][] = $values; +} +} +if ('cache-control'=== $key) { +$this->cacheControl = $this->parseCacheControl(implode(', ', $this->headers[$key])); +} +} +public function has($key) +{ +return array_key_exists(str_replace('_','-', strtolower($key)), $this->all()); +} +public function contains($key, $value) +{ +return in_array($value, $this->get($key, null, false)); +} +public function remove($key) +{ +$key = str_replace('_','-', strtolower($key)); +unset($this->headers[$key]); +if ('cache-control'=== $key) { +$this->cacheControl = array(); +} +} +public function getDate($key, \DateTime $default = null) +{ +if (null === $value = $this->get($key)) { +return $default; +} +if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { +throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); +} +return $date; +} +public function addCacheControlDirective($key, $value = true) +{ +$this->cacheControl[$key] = $value; +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function hasCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl); +} +public function getCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; +} +public function removeCacheControlDirective($key) +{ +unset($this->cacheControl[$key]); +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function getIterator() +{ +return new \ArrayIterator($this->headers); +} +public function count() +{ +return count($this->headers); +} +protected function getCacheControlHeader() +{ +$parts = array(); +ksort($this->cacheControl); +foreach ($this->cacheControl as $key => $value) { +if (true === $value) { +$parts[] = $key; +} else { +if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { +$value ='"'.$value.'"'; +} +$parts[] = "$key=$value"; +} +} +return implode(', ', $parts); +} +protected function parseCacheControl($header) +{ +$cacheControl = array(); +preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); +foreach ($matches as $match) { +$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); +} +return $cacheControl; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\File\UploadedFile; +class FileBag extends ParameterBag +{ +private static $fileKeys = array('error','name','size','tmp_name','type'); +public function __construct(array $parameters = array()) +{ +$this->replace($parameters); +} +public function replace(array $files = array()) +{ +$this->parameters = array(); +$this->add($files); +} +public function set($key, $value) +{ +if (!is_array($value) && !$value instanceof UploadedFile) { +throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); +} +parent::set($key, $this->convertFileInformation($value)); +} +public function add(array $files = array()) +{ +foreach ($files as $key => $file) { +$this->set($key, $file); +} +} +protected function convertFileInformation($file) +{ +if ($file instanceof UploadedFile) { +return $file; +} +$file = $this->fixPhpFilesArray($file); +if (is_array($file)) { +$keys = array_keys($file); +sort($keys); +if ($keys == self::$fileKeys) { +if (UPLOAD_ERR_NO_FILE == $file['error']) { +$file = null; +} else { +$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); +} +} else { +$file = array_map(array($this,'convertFileInformation'), $file); +if (array_keys($keys) === $keys) { +$file = array_filter($file); +} +} +} +return $file; +} +protected function fixPhpFilesArray($data) +{ +if (!is_array($data)) { +return $data; +} +$keys = array_keys($data); +sort($keys); +if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) { +return $data; +} +$files = $data; +foreach (self::$fileKeys as $k) { +unset($files[$k]); +} +foreach ($data['name'] as $key => $name) { +$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $name,'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key], +)); +} +return $files; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class ServerBag extends ParameterBag +{ +public function getHeaders() +{ +$headers = array(); +$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true); +foreach ($this->parameters as $key => $value) { +if (0 === strpos($key,'HTTP_')) { +$headers[substr($key, 5)] = $value; +} +elseif (isset($contentHeaders[$key])) { +$headers[$key] = $value; +} +} +if (isset($this->parameters['PHP_AUTH_USER'])) { +$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; +$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :''; +} else { +$authorizationHeader = null; +if (isset($this->parameters['HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; +} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; +} +if (null !== $authorizationHeader) { +if (0 === stripos($authorizationHeader,'basic ')) { +$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); +if (2 == count($exploded)) { +list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; +} +} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest '))) { +$headers['PHP_AUTH_DIGEST'] = $authorizationHeader; +$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; +} elseif (0 === stripos($authorizationHeader,'bearer ')) { +$headers['AUTHORIZATION'] = $authorizationHeader; +} +} +} +if (isset($headers['AUTHORIZATION'])) { +return $headers; +} +if (isset($headers['PHP_AUTH_USER'])) { +$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); +} elseif (isset($headers['PHP_AUTH_DIGEST'])) { +$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; +} +return $headers; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; +use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; +use Symfony\Component\HttpFoundation\Session\SessionInterface; +class Request +{ +const HEADER_FORWARDED = 0b00001; const HEADER_X_FORWARDED_FOR = 0b00010; +const HEADER_X_FORWARDED_HOST = 0b00100; +const HEADER_X_FORWARDED_PROTO = 0b01000; +const HEADER_X_FORWARDED_PORT = 0b10000; +const HEADER_X_FORWARDED_ALL = 0b11110; const HEADER_X_FORWARDED_AWS_ELB = 0b11010; +const HEADER_CLIENT_IP = self::HEADER_X_FORWARDED_FOR; +const HEADER_CLIENT_HOST = self::HEADER_X_FORWARDED_HOST; +const HEADER_CLIENT_PROTO = self::HEADER_X_FORWARDED_PROTO; +const HEADER_CLIENT_PORT = self::HEADER_X_FORWARDED_PORT; +const METHOD_HEAD ='HEAD'; +const METHOD_GET ='GET'; +const METHOD_POST ='POST'; +const METHOD_PUT ='PUT'; +const METHOD_PATCH ='PATCH'; +const METHOD_DELETE ='DELETE'; +const METHOD_PURGE ='PURGE'; +const METHOD_OPTIONS ='OPTIONS'; +const METHOD_TRACE ='TRACE'; +const METHOD_CONNECT ='CONNECT'; +protected static $trustedProxies = array(); +protected static $trustedHostPatterns = array(); +protected static $trustedHosts = array(); +protected static $trustedHeaders = array( +self::HEADER_FORWARDED =>'FORWARDED', +self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR', +self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST', +self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO', +self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT', +); +protected static $httpMethodParameterOverride = false; +public $attributes; +public $request; +public $query; +public $server; +public $files; +public $cookies; +public $headers; +protected $content; +protected $languages; +protected $charsets; +protected $encodings; +protected $acceptableContentTypes; +protected $pathInfo; +protected $requestUri; +protected $baseUrl; +protected $basePath; +protected $method; +protected $format; +protected $session; +protected $locale; +protected $defaultLocale ='en'; +protected static $formats; +protected static $requestFactory; +private $isHostValid = true; +private $isForwardedValid = true; +private static $trustedHeaderSet = -1; +private static $trustedHeaderNames = array( +self::HEADER_FORWARDED =>'FORWARDED', +self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR', +self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST', +self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO', +self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT', +); +private static $forwardedParams = array( +self::HEADER_X_FORWARDED_FOR =>'for', +self::HEADER_X_FORWARDED_HOST =>'host', +self::HEADER_X_FORWARDED_PROTO =>'proto', +self::HEADER_X_FORWARDED_PORT =>'host', +); +public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); +} +public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->request = new ParameterBag($request); +$this->query = new ParameterBag($query); +$this->attributes = new ParameterBag($attributes); +$this->cookies = new ParameterBag($cookies); +$this->files = new FileBag($files); +$this->server = new ServerBag($server); +$this->headers = new HeaderBag($this->server->getHeaders()); +$this->content = $content; +$this->languages = null; +$this->charsets = null; +$this->encodings = null; +$this->acceptableContentTypes = null; +$this->pathInfo = null; +$this->requestUri = null; +$this->baseUrl = null; +$this->basePath = null; +$this->method = null; +$this->format = null; +} +public static function createFromGlobals() +{ +$server = $_SERVER; +if ('cli-server'=== PHP_SAPI) { +if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) { +$server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH']; +} +if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { +$server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE']; +} +} +$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server); +if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded') +&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH')) +) { +parse_str($request->getContent(), $data); +$request->request = new ParameterBag($data); +} +return $request; +} +public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) +{ +$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/3.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(), +), $server); +$server['PATH_INFO'] =''; +$server['REQUEST_METHOD'] = strtoupper($method); +$components = parse_url($uri); +if (isset($components['host'])) { +$server['SERVER_NAME'] = $components['host']; +$server['HTTP_HOST'] = $components['host']; +} +if (isset($components['scheme'])) { +if ('https'=== $components['scheme']) { +$server['HTTPS'] ='on'; +$server['SERVER_PORT'] = 443; +} else { +unset($server['HTTPS']); +$server['SERVER_PORT'] = 80; +} +} +if (isset($components['port'])) { +$server['SERVER_PORT'] = $components['port']; +$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; +} +if (isset($components['user'])) { +$server['PHP_AUTH_USER'] = $components['user']; +} +if (isset($components['pass'])) { +$server['PHP_AUTH_PW'] = $components['pass']; +} +if (!isset($components['path'])) { +$components['path'] ='/'; +} +switch (strtoupper($method)) { +case'POST': +case'PUT': +case'DELETE': +if (!isset($server['CONTENT_TYPE'])) { +$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded'; +} +case'PATCH': +$request = $parameters; +$query = array(); +break; +default: +$request = array(); +$query = $parameters; +break; +} +$queryString =''; +if (isset($components['query'])) { +parse_str(html_entity_decode($components['query']), $qs); +if ($query) { +$query = array_replace($qs, $query); +$queryString = http_build_query($query,'','&'); +} else { +$query = $qs; +$queryString = $components['query']; +} +} elseif ($query) { +$queryString = http_build_query($query,'','&'); +} +$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :''); +$server['QUERY_STRING'] = $queryString; +return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content); +} +public static function setFactory($callable) +{ +self::$requestFactory = $callable; +} +public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) +{ +$dup = clone $this; +if (null !== $query) { +$dup->query = new ParameterBag($query); +} +if (null !== $request) { +$dup->request = new ParameterBag($request); +} +if (null !== $attributes) { +$dup->attributes = new ParameterBag($attributes); +} +if (null !== $cookies) { +$dup->cookies = new ParameterBag($cookies); +} +if (null !== $files) { +$dup->files = new FileBag($files); +} +if (null !== $server) { +$dup->server = new ServerBag($server); +$dup->headers = new HeaderBag($dup->server->getHeaders()); +} +$dup->languages = null; +$dup->charsets = null; +$dup->encodings = null; +$dup->acceptableContentTypes = null; +$dup->pathInfo = null; +$dup->requestUri = null; +$dup->baseUrl = null; +$dup->basePath = null; +$dup->method = null; +$dup->format = null; +if (!$dup->get('_format') && $this->get('_format')) { +$dup->attributes->set('_format', $this->get('_format')); +} +if (!$dup->getRequestFormat(null)) { +$dup->setRequestFormat($this->getRequestFormat(null)); +} +return $dup; +} +public function __clone() +{ +$this->query = clone $this->query; +$this->request = clone $this->request; +$this->attributes = clone $this->attributes; +$this->cookies = clone $this->cookies; +$this->files = clone $this->files; +$this->server = clone $this->server; +$this->headers = clone $this->headers; +} +public function __toString() +{ +try { +$content = $this->getContent(); +} catch (\LogicException $e) { +return trigger_error($e, E_USER_ERROR); +} +$cookieHeader =''; +$cookies = array(); +foreach ($this->cookies as $k => $v) { +$cookies[] = $k.'='.$v; +} +if (!empty($cookies)) { +$cookieHeader ='Cookie: '.implode('; ', $cookies)."\r\n"; +} +return +sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". +$this->headers. +$cookieHeader."\r\n". +$content; +} +public function overrideGlobals() +{ +$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(),'','&'))); +$_GET = $this->query->all(); +$_POST = $this->request->all(); +$_SERVER = $this->server->all(); +$_COOKIE = $this->cookies->all(); +foreach ($this->headers->all() as $key => $value) { +$key = strtoupper(str_replace('-','_', $key)); +if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) { +$_SERVER[$key] = implode(', ', $value); +} else { +$_SERVER['HTTP_'.$key] = implode(', ', $value); +} +} +$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE); +$requestOrder = ini_get('request_order') ?: ini_get('variables_order'); +$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp'; +$_REQUEST = array(); +foreach (str_split($requestOrder) as $order) { +$_REQUEST = array_merge($_REQUEST, $request[$order]); +} +} +public static function setTrustedProxies(array $proxies) +{ +self::$trustedProxies = $proxies; +if (2 > func_num_args()) { +@trigger_error(sprintf('The %s() method expects a bit field of Request::HEADER_* as second argument since Symfony 3.3. Defining it will be required in 4.0. ', __METHOD__), E_USER_DEPRECATED); +return; +} +$trustedHeaderSet = (int) func_get_arg(1); +foreach (self::$trustedHeaderNames as $header => $name) { +self::$trustedHeaders[$header] = $header & $trustedHeaderSet ? $name : null; +} +self::$trustedHeaderSet = $trustedHeaderSet; +} +public static function getTrustedProxies() +{ +return self::$trustedProxies; +} +public static function getTrustedHeaderSet() +{ +return self::$trustedHeaderSet; +} +public static function setTrustedHosts(array $hostPatterns) +{ +self::$trustedHostPatterns = array_map(function ($hostPattern) { +return sprintf('{%s}i', $hostPattern); +}, $hostPatterns); +self::$trustedHosts = array(); +} +public static function getTrustedHosts() +{ +return self::$trustedHostPatterns; +} +public static function setTrustedHeaderName($key, $value) +{ +@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED); +if ('forwarded'=== $key) { +$key = self::HEADER_FORWARDED; +} elseif ('client_ip'=== $key) { +$key = self::HEADER_CLIENT_IP; +} elseif ('client_host'=== $key) { +$key = self::HEADER_CLIENT_HOST; +} elseif ('client_proto'=== $key) { +$key = self::HEADER_CLIENT_PROTO; +} elseif ('client_port'=== $key) { +$key = self::HEADER_CLIENT_PORT; +} elseif (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); +} +self::$trustedHeaders[$key] = $value; +if (null !== $value) { +self::$trustedHeaderNames[$key] = $value; +self::$trustedHeaderSet |= $key; +} else { +self::$trustedHeaderSet &= ~$key; +} +} +public static function getTrustedHeaderName($key) +{ +if (2 > func_num_args() || func_get_arg(1)) { +@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.', __METHOD__), E_USER_DEPRECATED); +} +if (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); +} +return self::$trustedHeaders[$key]; +} +public static function normalizeQueryString($qs) +{ +if (''== $qs) { +return''; +} +$parts = array(); +$order = array(); +foreach (explode('&', $qs) as $param) { +if (''=== $param ||'='=== $param[0]) { +continue; +} +$keyValuePair = explode('=', $param, 2); +$parts[] = isset($keyValuePair[1]) ? +rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : +rawurlencode(urldecode($keyValuePair[0])); +$order[] = urldecode($keyValuePair[0]); +} +array_multisort($order, SORT_ASC, $parts); +return implode('&', $parts); +} +public static function enableHttpMethodParameterOverride() +{ +self::$httpMethodParameterOverride = true; +} +public static function getHttpMethodParameterOverride() +{ +return self::$httpMethodParameterOverride; +} +public function get($key, $default = null) +{ +if ($this !== $result = $this->attributes->get($key, $this)) { +return $result; +} +if ($this !== $result = $this->query->get($key, $this)) { +return $result; +} +if ($this !== $result = $this->request->get($key, $this)) { +return $result; +} +return $default; +} +public function getSession() +{ +return $this->session; +} +public function hasPreviousSession() +{ +return $this->hasSession() && $this->cookies->has($this->session->getName()); +} +public function hasSession() +{ +return null !== $this->session; +} +public function setSession(SessionInterface $session) +{ +$this->session = $session; +} +public function getClientIps() +{ +$ip = $this->server->get('REMOTE_ADDR'); +if (!$this->isFromTrustedProxy()) { +return array($ip); +} +return $this->getTrustedValues(self::HEADER_CLIENT_IP, $ip) ?: array($ip); +} +public function getClientIp() +{ +$ipAddresses = $this->getClientIps(); +return $ipAddresses[0]; +} +public function getScriptName() +{ +return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME','')); +} +public function getPathInfo() +{ +if (null === $this->pathInfo) { +$this->pathInfo = $this->preparePathInfo(); +} +return $this->pathInfo; +} +public function getBasePath() +{ +if (null === $this->basePath) { +$this->basePath = $this->prepareBasePath(); +} +return $this->basePath; +} +public function getBaseUrl() +{ +if (null === $this->baseUrl) { +$this->baseUrl = $this->prepareBaseUrl(); +} +return $this->baseUrl; +} +public function getScheme() +{ +return $this->isSecure() ?'https':'http'; +} +public function getPort() +{ +if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_PORT)) { +$host = $host[0]; +} elseif ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { +$host = $host[0]; +} elseif (!$host = $this->headers->get('HOST')) { +return $this->server->get('SERVER_PORT'); +} +if ('['=== $host[0]) { +$pos = strpos($host,':', strrpos($host,']')); +} else { +$pos = strrpos($host,':'); +} +if (false !== $pos) { +return (int) substr($host, $pos + 1); +} +return'https'=== $this->getScheme() ? 443 : 80; +} +public function getUser() +{ +return $this->headers->get('PHP_AUTH_USER'); +} +public function getPassword() +{ +return $this->headers->get('PHP_AUTH_PW'); +} +public function getUserInfo() +{ +$userinfo = $this->getUser(); +$pass = $this->getPassword(); +if (''!= $pass) { +$userinfo .= ":$pass"; +} +return $userinfo; +} +public function getHttpHost() +{ +$scheme = $this->getScheme(); +$port = $this->getPort(); +if (('http'== $scheme && 80 == $port) || ('https'== $scheme && 443 == $port)) { +return $this->getHost(); +} +return $this->getHost().':'.$port; +} +public function getRequestUri() +{ +if (null === $this->requestUri) { +$this->requestUri = $this->prepareRequestUri(); +} +return $this->requestUri; +} +public function getSchemeAndHttpHost() +{ +return $this->getScheme().'://'.$this->getHttpHost(); +} +public function getUri() +{ +if (null !== $qs = $this->getQueryString()) { +$qs ='?'.$qs; +} +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; +} +public function getUriForPath($path) +{ +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; +} +public function getRelativeUriForPath($path) +{ +if (!isset($path[0]) ||'/'!== $path[0]) { +return $path; +} +if ($path === $basePath = $this->getPathInfo()) { +return''; +} +$sourceDirs = explode('/', isset($basePath[0]) &&'/'=== $basePath[0] ? substr($basePath, 1) : $basePath); +$targetDirs = explode('/', isset($path[0]) &&'/'=== $path[0] ? substr($path, 1) : $path); +array_pop($sourceDirs); +$targetFile = array_pop($targetDirs); +foreach ($sourceDirs as $i => $dir) { +if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { +unset($sourceDirs[$i], $targetDirs[$i]); +} else { +break; +} +} +$targetDirs[] = $targetFile; +$path = str_repeat('../', count($sourceDirs)).implode('/', $targetDirs); +return !isset($path[0]) ||'/'=== $path[0] +|| false !== ($colonPos = strpos($path,':')) && ($colonPos < ($slashPos = strpos($path,'/')) || false === $slashPos) +? "./$path" : $path; +} +public function getQueryString() +{ +$qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); +return''=== $qs ? null : $qs; +} +public function isSecure() +{ +if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_CLIENT_PROTO)) { +return in_array(strtolower($proto[0]), array('https','on','ssl','1'), true); +} +$https = $this->server->get('HTTPS'); +return !empty($https) &&'off'!== strtolower($https); +} +public function getHost() +{ +if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { +$host = $host[0]; +} elseif (!$host = $this->headers->get('HOST')) { +if (!$host = $this->server->get('SERVER_NAME')) { +$host = $this->server->get('SERVER_ADDR',''); +} +} +$host = strtolower(preg_replace('/:\d+$/','', trim($host))); +if ($host &&''!== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/','', $host)) { +if (!$this->isHostValid) { +return''; +} +$this->isHostValid = false; +throw new SuspiciousOperationException(sprintf('Invalid Host "%s".', $host)); +} +if (count(self::$trustedHostPatterns) > 0) { +if (in_array($host, self::$trustedHosts)) { +return $host; +} +foreach (self::$trustedHostPatterns as $pattern) { +if (preg_match($pattern, $host)) { +self::$trustedHosts[] = $host; +return $host; +} +} +if (!$this->isHostValid) { +return''; +} +$this->isHostValid = false; +throw new SuspiciousOperationException(sprintf('Untrusted Host "%s".', $host)); +} +return $host; +} +public function setMethod($method) +{ +$this->method = null; +$this->server->set('REQUEST_METHOD', $method); +} +public function getMethod() +{ +if (null === $this->method) { +$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET')); +if ('POST'=== $this->method) { +if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { +$this->method = strtoupper($method); +} elseif (self::$httpMethodParameterOverride) { +$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST'))); +} +} +} +return $this->method; +} +public function getRealMethod() +{ +return strtoupper($this->server->get('REQUEST_METHOD','GET')); +} +public function getMimeType($format) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; +} +public static function getMimeTypes($format) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +return isset(static::$formats[$format]) ? static::$formats[$format] : array(); +} +public function getFormat($mimeType) +{ +$canonicalMimeType = null; +if (false !== $pos = strpos($mimeType,';')) { +$canonicalMimeType = substr($mimeType, 0, $pos); +} +if (null === static::$formats) { +static::initializeFormats(); +} +foreach (static::$formats as $format => $mimeTypes) { +if (in_array($mimeType, (array) $mimeTypes)) { +return $format; +} +if (null !== $canonicalMimeType && in_array($canonicalMimeType, (array) $mimeTypes)) { +return $format; +} +} +} +public function setFormat($format, $mimeTypes) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes); +} +public function getRequestFormat($default ='html') +{ +if (null === $this->format) { +$this->format = $this->attributes->get('_format'); +} +return null === $this->format ? $default : $this->format; +} +public function setRequestFormat($format) +{ +$this->format = $format; +} +public function getContentType() +{ +return $this->getFormat($this->headers->get('CONTENT_TYPE')); +} +public function setDefaultLocale($locale) +{ +$this->defaultLocale = $locale; +if (null === $this->locale) { +$this->setPhpDefaultLocale($locale); +} +} +public function getDefaultLocale() +{ +return $this->defaultLocale; +} +public function setLocale($locale) +{ +$this->setPhpDefaultLocale($this->locale = $locale); +} +public function getLocale() +{ +return null === $this->locale ? $this->defaultLocale : $this->locale; +} +public function isMethod($method) +{ +return $this->getMethod() === strtoupper($method); +} +public function isMethodSafe() +{ +if (!func_num_args() || func_get_arg(0)) { +@trigger_error('Checking only for cacheable HTTP methods with Symfony\Component\HttpFoundation\Request::isMethodSafe() is deprecated since Symfony 3.2 and will throw an exception in 4.0. Disable checking only for cacheable methods by calling the method with `false` as first argument or use the Request::isMethodCacheable() instead.', E_USER_DEPRECATED); +return in_array($this->getMethod(), array('GET','HEAD')); +} +return in_array($this->getMethod(), array('GET','HEAD','OPTIONS','TRACE')); +} +public function isMethodIdempotent() +{ +return in_array($this->getMethod(), array('HEAD','GET','PUT','DELETE','TRACE','OPTIONS','PURGE')); +} +public function isMethodCacheable() +{ +return in_array($this->getMethod(), array('GET','HEAD')); +} +public function getProtocolVersion() +{ +if ($this->isFromTrustedProxy()) { +preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via'), $matches); +if ($matches) { +return'HTTP/'.$matches[2]; +} +} +return $this->server->get('SERVER_PROTOCOL'); +} +public function getContent($asResource = false) +{ +$currentContentIsResource = is_resource($this->content); +if (\PHP_VERSION_ID < 50600 && false === $this->content) { +throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); +} +if (true === $asResource) { +if ($currentContentIsResource) { +rewind($this->content); +return $this->content; +} +if (is_string($this->content)) { +$resource = fopen('php://temp','r+'); +fwrite($resource, $this->content); +rewind($resource); +return $resource; +} +$this->content = false; +return fopen('php://input','rb'); +} +if ($currentContentIsResource) { +rewind($this->content); +return stream_get_contents($this->content); +} +if (null === $this->content || false === $this->content) { +$this->content = file_get_contents('php://input'); +} +return $this->content; +} +public function getETags() +{ +return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); +} +public function isNoCache() +{ +return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma'); +} +public function getPreferredLanguage(array $locales = null) +{ +$preferredLanguages = $this->getLanguages(); +if (empty($locales)) { +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; +} +if (!$preferredLanguages) { +return $locales[0]; +} +$extendedPreferredLanguages = array(); +foreach ($preferredLanguages as $language) { +$extendedPreferredLanguages[] = $language; +if (false !== $position = strpos($language,'_')) { +$superLanguage = substr($language, 0, $position); +if (!in_array($superLanguage, $preferredLanguages)) { +$extendedPreferredLanguages[] = $superLanguage; +} +} +} +$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0]; +} +public function getLanguages() +{ +if (null !== $this->languages) { +return $this->languages; +} +$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); +$this->languages = array(); +foreach ($languages as $lang => $acceptHeaderItem) { +if (false !== strpos($lang,'-')) { +$codes = explode('-', $lang); +if ('i'=== $codes[0]) { +if (count($codes) > 1) { +$lang = $codes[1]; +} +} else { +for ($i = 0, $max = count($codes); $i < $max; ++$i) { +if (0 === $i) { +$lang = strtolower($codes[0]); +} else { +$lang .='_'.strtoupper($codes[$i]); +} +} +} +} +$this->languages[] = $lang; +} +return $this->languages; +} +public function getCharsets() +{ +if (null !== $this->charsets) { +return $this->charsets; +} +return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); +} +public function getEncodings() +{ +if (null !== $this->encodings) { +return $this->encodings; +} +return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()); +} +public function getAcceptableContentTypes() +{ +if (null !== $this->acceptableContentTypes) { +return $this->acceptableContentTypes; +} +return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); +} +public function isXmlHttpRequest() +{ +return'XMLHttpRequest'== $this->headers->get('X-Requested-With'); +} +protected function prepareRequestUri() +{ +$requestUri =''; +if ($this->headers->has('X_ORIGINAL_URL')) { +$requestUri = $this->headers->get('X_ORIGINAL_URL'); +$this->headers->remove('X_ORIGINAL_URL'); +$this->server->remove('HTTP_X_ORIGINAL_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->headers->has('X_REWRITE_URL')) { +$requestUri = $this->headers->get('X_REWRITE_URL'); +$this->headers->remove('X_REWRITE_URL'); +} elseif ('1'== $this->server->get('IIS_WasUrlRewritten') &&''!= $this->server->get('UNENCODED_URL')) { +$requestUri = $this->server->get('UNENCODED_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->server->has('REQUEST_URI')) { +$requestUri = $this->server->get('REQUEST_URI'); +$schemeAndHttpHost = $this->getSchemeAndHttpHost(); +if (0 === strpos($requestUri, $schemeAndHttpHost)) { +$requestUri = substr($requestUri, strlen($schemeAndHttpHost)); +} +} elseif ($this->server->has('ORIG_PATH_INFO')) { +$requestUri = $this->server->get('ORIG_PATH_INFO'); +if (''!= $this->server->get('QUERY_STRING')) { +$requestUri .='?'.$this->server->get('QUERY_STRING'); +} +$this->server->remove('ORIG_PATH_INFO'); +} +$this->server->set('REQUEST_URI', $requestUri); +return $requestUri; +} +protected function prepareBaseUrl() +{ +$filename = basename($this->server->get('SCRIPT_FILENAME')); +if (basename($this->server->get('SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('SCRIPT_NAME'); +} elseif (basename($this->server->get('PHP_SELF')) === $filename) { +$baseUrl = $this->server->get('PHP_SELF'); +} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else { +$path = $this->server->get('PHP_SELF',''); +$file = $this->server->get('SCRIPT_FILENAME',''); +$segs = explode('/', trim($file,'/')); +$segs = array_reverse($segs); +$index = 0; +$last = count($segs); +$baseUrl =''; +do { +$seg = $segs[$index]; +$baseUrl ='/'.$seg.$baseUrl; +++$index; +} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); +} +$requestUri = $this->getRequestUri(); +if (''!== $requestUri &&'/'!== $requestUri[0]) { +$requestUri ='/'.$requestUri; +} +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { +return $prefix; +} +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(dirname($baseUrl),'/'.DIRECTORY_SEPARATOR).'/')) { +return rtrim($prefix,'/'.DIRECTORY_SEPARATOR); +} +$truncatedRequestUri = $requestUri; +if (false !== $pos = strpos($requestUri,'?')) { +$truncatedRequestUri = substr($requestUri, 0, $pos); +} +$basename = basename($baseUrl); +if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { +return''; +} +if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && 0 !== $pos) { +$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); +} +return rtrim($baseUrl,'/'.DIRECTORY_SEPARATOR); +} +protected function prepareBasePath() +{ +$baseUrl = $this->getBaseUrl(); +if (empty($baseUrl)) { +return''; +} +$filename = basename($this->server->get('SCRIPT_FILENAME')); +if (basename($baseUrl) === $filename) { +$basePath = dirname($baseUrl); +} else { +$basePath = $baseUrl; +} +if ('\\'=== DIRECTORY_SEPARATOR) { +$basePath = str_replace('\\','/', $basePath); +} +return rtrim($basePath,'/'); +} +protected function preparePathInfo() +{ +if (null === ($requestUri = $this->getRequestUri())) { +return'/'; +} +if (false !== $pos = strpos($requestUri,'?')) { +$requestUri = substr($requestUri, 0, $pos); +} +if (''!== $requestUri &&'/'!== $requestUri[0]) { +$requestUri ='/'.$requestUri; +} +if (null === ($baseUrl = $this->getBaseUrl())) { +return $requestUri; +} +$pathInfo = substr($requestUri, strlen($baseUrl)); +if (false === $pathInfo ||''=== $pathInfo) { +return'/'; +} +return (string) $pathInfo; +} +protected static function initializeFormats() +{ +static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'jsonld'=> array('application/ld+json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'),'form'=> array('application/x-www-form-urlencoded'), +); +} +private function setPhpDefaultLocale($locale) +{ +try { +if (class_exists('Locale', false)) { +\Locale::setDefault($locale); +} +} catch (\Exception $e) { +} +} +private function getUrlencodedPrefix($string, $prefix) +{ +if (0 !== strpos(rawurldecode($string), $prefix)) { +return false; +} +$len = strlen($prefix); +if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) { +return $match[0]; +} +return false; +} +private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +if (self::$requestFactory) { +$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); +if (!$request instanceof self) { +throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); +} +return $request; +} +return new static($query, $request, $attributes, $cookies, $files, $server, $content); +} +public function isFromTrustedProxy() +{ +return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies); +} +private function getTrustedValues($type, $ip = null) +{ +$clientValues = array(); +$forwardedValues = array(); +if (self::$trustedHeaders[$type] && $this->headers->has(self::$trustedHeaders[$type])) { +foreach (explode(',', $this->headers->get(self::$trustedHeaders[$type])) as $v) { +$clientValues[] = (self::HEADER_CLIENT_PORT === $type ?'0.0.0.0:':'').trim($v); +} +} +if (self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) { +$forwardedValues = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]); +$forwardedValues = preg_match_all(sprintf('{(?:%s)=(?:"?\[?)([a-zA-Z0-9\.:_\-/]*+)}', self::$forwardedParams[$type]), $forwardedValues, $matches) ? $matches[1] : array(); +} +if (null !== $ip) { +$clientValues = $this->normalizeAndFilterClientIps($clientValues, $ip); +$forwardedValues = $this->normalizeAndFilterClientIps($forwardedValues, $ip); +} +if ($forwardedValues === $clientValues || !$clientValues) { +return $forwardedValues; +} +if (!$forwardedValues) { +return $clientValues; +} +if (!$this->isForwardedValid) { +return null !== $ip ? array('0.0.0.0', $ip) : array(); +} +$this->isForwardedValid = false; +throw new ConflictingHeadersException(sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::$trustedHeaders[self::HEADER_FORWARDED], self::$trustedHeaders[$type])); +} +private function normalizeAndFilterClientIps(array $clientIps, $ip) +{ +if (!$clientIps) { +return array(); +} +$clientIps[] = $ip; $firstTrustedIp = null; +foreach ($clientIps as $key => $clientIp) { +if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { +$clientIps[$key] = $clientIp = $match[1]; +} +if (!filter_var($clientIp, FILTER_VALIDATE_IP)) { +unset($clientIps[$key]); +continue; +} +if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { +unset($clientIps[$key]); +if (null === $firstTrustedIp) { +$firstTrustedIp = $clientIp; +} +} +} +return $clientIps ? array_reverse($clientIps) : array($firstTrustedIp); +} +} +} +namespace {require __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php';} diff --git a/app/phpunit.xml.dist b/phpunit.xml.dist similarity index 77% rename from app/phpunit.xml.dist rename to phpunit.xml.dist index 3c23e39be..721adfee1 100644 --- a/app/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,20 +11,19 @@ processIsolation = "false" stopOnFailure = "false" syntaxCheck = "false" - bootstrap = "bootstrap.php.cache" > + bootstrap = "vendor/autoload.php" > - ../src/*/*Bundle/Tests - ../src/*/Bundle/*Bundle/Tests + ../tests/*/*Bundle + ../tests/*/Bundle/*Bundle - - + - --> + + + - - + + + + - + + + - + diff --git a/src/PartKeepr/AuthBundle/Security/User/LegacyUserProvider.php b/src/PartKeepr/AuthBundle/Security/User/LegacyUserProvider.php index 37e47a112..0692f6313 100644 --- a/src/PartKeepr/AuthBundle/Security/User/LegacyUserProvider.php +++ b/src/PartKeepr/AuthBundle/Security/User/LegacyUserProvider.php @@ -9,6 +9,7 @@ use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; +// recomendation : implement UserLoaderInterface for Symf 3 class LegacyUserProvider implements UserProviderInterface { /** diff --git a/src/PartKeepr/BatchJobBundle/Action/ExecuteBatchJobAction.php b/src/PartKeepr/BatchJobBundle/Action/ExecuteBatchJobAction.php index 90ac7e425..c610a9800 100644 --- a/src/PartKeepr/BatchJobBundle/Action/ExecuteBatchJobAction.php +++ b/src/PartKeepr/BatchJobBundle/Action/ExecuteBatchJobAction.php @@ -4,20 +4,24 @@ use Doctrine\ORM\EntityManager; use Doctrine\ORM\QueryBuilder; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\IriConverter; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\IriConverter; +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\BatchJobBundle\Entity\BatchJob; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter; use PartKeepr\DoctrineReflectionBundle\Services\ReflectionService; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Routing\Annotation\Route; class ExecuteBatchJobAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -66,11 +70,19 @@ public function __construct( * * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable + */ + /** + * @Route( + * name="BatchJobExecute", + * path="/batch_jobs/{id}/execute", + * defaults={"_api_resource_class"=BatchJob::class, "_api_item_operation_name"="execute"}, + * methods={"PUT"} + * ) */ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); /** * @var BatchJob diff --git a/src/PartKeepr/BatchJobBundle/Entity/BatchJob.php b/src/PartKeepr/BatchJobBundle/Entity/BatchJob.php index 16039d24e..332dac800 100644 --- a/src/PartKeepr/BatchJobBundle/Entity/BatchJob.php +++ b/src/PartKeepr/BatchJobBundle/Entity/BatchJob.php @@ -3,12 +3,30 @@ namespace PartKeepr\BatchJobBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"}, + * "execute"={"route_name"="BatchJobExecute"} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/batch_jobs") */ diff --git a/src/PartKeepr/BatchJobBundle/Entity/BatchJobQueryField.php b/src/PartKeepr/BatchJobBundle/Entity/BatchJobQueryField.php index 53b320616..b379a8a02 100644 --- a/src/PartKeepr/BatchJobBundle/Entity/BatchJobQueryField.php +++ b/src/PartKeepr/BatchJobBundle/Entity/BatchJobQueryField.php @@ -2,13 +2,22 @@ namespace PartKeepr\BatchJobBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use Symfony\Component\Serializer\Annotation\Groups; /** * Represents a batch job query field. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity */ class BatchJobQueryField extends BaseEntity diff --git a/src/PartKeepr/BatchJobBundle/Entity/BatchJobUpdateField.php b/src/PartKeepr/BatchJobBundle/Entity/BatchJobUpdateField.php index 03c2d3ed3..bca1d06c4 100644 --- a/src/PartKeepr/BatchJobBundle/Entity/BatchJobUpdateField.php +++ b/src/PartKeepr/BatchJobBundle/Entity/BatchJobUpdateField.php @@ -2,13 +2,22 @@ namespace PartKeepr\BatchJobBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use Symfony\Component\Serializer\Annotation\Groups; /** * Represents a batch job update field. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity */ class BatchJobUpdateField extends BaseEntity diff --git a/src/PartKeepr/BatchJobBundle/Resources/config/actions.xml b/src/PartKeepr/BatchJobBundle/Resources/config/actions.xml index 0ab212a45..c9980a457 100644 --- a/src/PartKeepr/BatchJobBundle/Resources/config/actions.xml +++ b/src/PartKeepr/BatchJobBundle/Resources/config/actions.xml @@ -3,11 +3,13 @@ - + - - + + + + diff --git a/src/PartKeepr/CategoryBundle/Action/GetRootNodeAction.php b/src/PartKeepr/CategoryBundle/Action/GetRootNodeAction.php index fbd112910..20ab0b44e 100644 --- a/src/PartKeepr/CategoryBundle/Action/GetRootNodeAction.php +++ b/src/PartKeepr/CategoryBundle/Action/GetRootNodeAction.php @@ -2,20 +2,23 @@ namespace PartKeepr\CategoryBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Exception\RuntimeException; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Exception\RuntimeException; use Gedmo\Tree\Entity\Repository\AbstractTreeRepository; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use Symfony\Bridge\Doctrine\ManagerRegistry; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Returns the tree root node. */ class GetRootNodeAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var ManagerRegistry @@ -34,11 +37,35 @@ public function __construct(ManagerRegistry $manager) * * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="StorageLocationCategoryGetRoot", + * path="/storage_location_categories/getExtJSRootNode", + * defaults={"_api_resource_class"=StorageLocationCategory::class, "_api_collection_operation_name"="get_root"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="PartKeeprFootprintCategoryGetRootNode", + * path="/footprint_categories/getExtJSRootNode", + * defaults={"_api_resource_class"=FootprintCategory::class, "_api_collection_operation_name"="get_root"} + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="PartKeeprPartCategoryGetRootNode", + * path="/part_categories/getExtJSRootNode", + * defaults={"_api_resource_class"=PartCategory::class, "_api_collection_operation_name"="get_root"}, + * methods={"GET"} + * ) + **/ public function __invoke(Request $request) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); /* * @var ResourceInterface $resourceType diff --git a/src/PartKeepr/CategoryBundle/Action/MoveAction.php b/src/PartKeepr/CategoryBundle/Action/MoveAction.php index e42406c9a..41bfeaf4a 100644 --- a/src/PartKeepr/CategoryBundle/Action/MoveAction.php +++ b/src/PartKeepr/CategoryBundle/Action/MoveAction.php @@ -2,23 +2,26 @@ namespace PartKeepr\CategoryBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\IriConverter; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\IriConverter; +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\CategoryBundle\Exception\MissingParentCategoryException; use PartKeepr\CategoryBundle\Exception\RootMayNotBeMovedException; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use Symfony\Bridge\Doctrine\ManagerRegistry; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; /** * Returns the tree root node. */ class MoveAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -52,11 +55,35 @@ public function __construct( * * @throws RuntimeException|RootNodeNotFoundException|RootMayNotBeMovedException|MissingParentCategoryException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="StorageLocationCategoryMove", + * path="/storage_location_categories/{id}/move", + * defaults={"_api_resource_class"=PartAttachment::class, "_api_item_operation_name"="move"}, + * methods={"PUT"} + * ) + **/ + /** + * @Route( + * name="FootprintCategoryMove", + * path="/footprint_categories/{id}/move", + * defaults={"_api_resource_class"=FootprintCategory::class, "_api_item_operation_name"="move"}, + * methods={"PUT"} + * ) + **/ + /** + * @Route( + * name="PartKeeprPartCategoryMove", + * path="/part_categories/{id}/move", + * defaults={"_api_resource_class"=PartCategory::class, "_api_item_operation_name"="move"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $entity = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php b/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php index 5dd840d53..4e0e492af 100644 --- a/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php +++ b/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php @@ -3,7 +3,9 @@ namespace PartKeepr\CategoryBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use Gedmo\Mapping\Annotation as Gedmo; use PartKeepr\CoreBundle\Entity\BaseEntity; use Symfony\Component\Serializer\Annotation\Groups; diff --git a/src/PartKeepr/CategoryBundle/Resources/config/actions.xml b/src/PartKeepr/CategoryBundle/Resources/config/actions.xml index a29ab8ca3..05ea33ae3 100644 --- a/src/PartKeepr/CategoryBundle/Resources/config/actions.xml +++ b/src/PartKeepr/CategoryBundle/Resources/config/actions.xml @@ -5,12 +5,20 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> + + + + + + - - + + + + diff --git a/src/PartKeepr/CoreBundle/Action/SystemNoticeAcknowledgeAction.php b/src/PartKeepr/CoreBundle/Action/SystemNoticeAcknowledgeAction.php index c66284bc3..b91417b7e 100644 --- a/src/PartKeepr/CoreBundle/Action/SystemNoticeAcknowledgeAction.php +++ b/src/PartKeepr/CoreBundle/Action/SystemNoticeAcknowledgeAction.php @@ -3,15 +3,19 @@ namespace PartKeepr\CoreBundle\Action; use Doctrine\ORM\EntityManager; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\CoreBundle\Entity\SystemNotice; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class SystemNoticeAcknowledgeAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -39,11 +43,20 @@ public function __construct( * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + + /** + * @Route( + * name="SystemNoticeAcknowledge", + * path="/system_notices/{id}/acknowledge", + * defaults={"_api_resource_class"=SystemNotice::class, "_api_item_operation_name"="acknowledge"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $systemNotice = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/CoreBundle/Entity/BaseEntity.php b/src/PartKeepr/CoreBundle/Entity/BaseEntity.php index 33779d703..820c7ced1 100644 --- a/src/PartKeepr/CoreBundle/Entity/BaseEntity.php +++ b/src/PartKeepr/CoreBundle/Entity/BaseEntity.php @@ -2,7 +2,9 @@ namespace PartKeepr\CoreBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** @ORM\MappedSuperclass */ abstract class BaseEntity diff --git a/src/PartKeepr/CoreBundle/Entity/SystemNotice.php b/src/PartKeepr/CoreBundle/Entity/SystemNotice.php index 2899afe70..7757857ac 100644 --- a/src/PartKeepr/CoreBundle/Entity/SystemNotice.php +++ b/src/PartKeepr/CoreBundle/Entity/SystemNotice.php @@ -2,13 +2,29 @@ namespace PartKeepr\CoreBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; /** * Holds a system notice. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "acknowledge"={"route_name"="SystemNoticeAcknowledge"} + * } + * ) * @ORM\Entity * @TargetService("/api/system_notices") **/ diff --git a/src/PartKeepr/CoreBundle/EventListener/RequestExceptionListener.php b/src/PartKeepr/CoreBundle/EventListener/RequestExceptionListener.php index 02a5dd5e4..73037dd97 100644 --- a/src/PartKeepr/CoreBundle/EventListener/RequestExceptionListener.php +++ b/src/PartKeepr/CoreBundle/EventListener/RequestExceptionListener.php @@ -9,21 +9,108 @@ namespace PartKeepr\CoreBundle\EventListener; use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\IriConverter; -use Dunglas\ApiBundle\JsonLd\Response; -use Dunglas\ApiBundle\Model\DataProviderInterface; + +// use ApiPlatform\Core\Action\ActionUtilTrait; + +use ApiPlatform\Core\Api\IriConverterInterface; +use ApiPlatform\Core\JsonLd\Response; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\DoctrineReflectionBundle\Exception\EntityInUseException; use PartKeepr\DoctrineReflectionBundle\Services\DeletionService; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +// working on this +// PHP Fatal error: Uncaught Symfony\\Component\\Debug\\Exception\\FatalThrowableError: Type error: +// Argument 2 passed to PartKeepr\\CoreBundle\\EventListener\\RequestExceptionListener::__construct() +// must be an instance of ApiPlatform\\Core\\Model\\DataProviderInterface, instance of ApiPlatform\\Core\\DataProvider\\ChainCollectionDataProvider +//----------------------------------------------------------- +// copy from the original \Dunglas\ApiBundle\Hydra\EventListener\RequestExceptionListener + +/* + * This file is part of the DunglasApiBundle package. + * + * (c) Kévin Dunglas + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +//namespace Dunglas\ApiBundle\Hydra\EventListener; + +use ApiPlatform\Core\Exception\InvalidArgumentException; +//use ApiPlatform\Core\Exception\ValidationException; +//use ApiPlatform\Core\JsonLd\Response; +//use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Exception\HttpException; +use Symfony\Component\Serializer\Exception\ExceptionInterface; +//use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +/** + * Handle requests errors. + * + * @author Samuel ROZE + * @author Kévin Dunglas + */ +class RequestExceptionListener_ +{ + const FORMAT = 'jsonld'; + + /** + * @var NormalizerInterface + */ + private $normalizer; + + public function __construct(NormalizerInterface $normalizer) + { + $this->normalizer = $normalizer; + } + + /** + * @param GetResponseForExceptionEvent $event + */ + public function onKernelException(GetResponseForExceptionEvent $event) + { + $request = $event->getRequest(); + if (!$request->attributes->has('_resource_type') || self::FORMAT !== $request->attributes->get('_api_format')) { + return; + } + + $exception = $event->getException(); + $headers = []; + + if ($exception instanceof HttpException) { + $status = $exception->getStatusCode(); + $headers = $exception->getHeaders(); + $data = $exception; + } elseif ($exception instanceof ValidationException) { + $status = Response::HTTP_BAD_REQUEST; + $data = $exception->getConstraintViolationList(); + } elseif ($exception instanceof ExceptionInterface || $exception instanceof InvalidArgumentException) { + $status = Response::HTTP_BAD_REQUEST; + $data = $exception; + } else { + $status = Response::HTTP_INTERNAL_SERVER_ERROR; + $data = $exception; + } + + $event->setResponse(new Response( + $this->normalizer->normalize($data, 'hydra-error'), + $status, + $headers + )); + } +} +//----------------------------------------------------------- + + /** * Handle referential integrity errors. */ -class RequestExceptionListener extends \Dunglas\ApiBundle\Hydra\EventListener\RequestExceptionListener +// class RequestExceptionListener extends \ApiPlatform\Core\Hydra\EventListener\RequestExceptionListener +class RequestExceptionListener extends RequestExceptionListener_ { - use ActionUtilTrait; +// use ActionUtilTrait; const FORMAT = 'jsonld'; diff --git a/src/PartKeepr/CoreBundle/Resources/config/actions.xml b/src/PartKeepr/CoreBundle/Resources/config/actions.xml index fc11a8459..cfc4b001e 100644 --- a/src/PartKeepr/CoreBundle/Resources/config/actions.xml +++ b/src/PartKeepr/CoreBundle/Resources/config/actions.xml @@ -7,7 +7,9 @@ - + + + diff --git a/src/PartKeepr/CoreBundle/Resources/config/services.xml b/src/PartKeepr/CoreBundle/Resources/config/services.xml index a14a2a017..a6971e8af 100644 --- a/src/PartKeepr/CoreBundle/Resources/config/services.xml +++ b/src/PartKeepr/CoreBundle/Resources/config/services.xml @@ -20,9 +20,11 @@ - - - + + + + + diff --git a/src/PartKeepr/CronLoggerBundle/Controller/CronRunnerController.php b/src/PartKeepr/CronLoggerBundle/Controller/CronRunnerController.php index 614c643d1..75c92d4da 100644 --- a/src/PartKeepr/CronLoggerBundle/Controller/CronRunnerController.php +++ b/src/PartKeepr/CronLoggerBundle/Controller/CronRunnerController.php @@ -3,8 +3,9 @@ namespace PartKeepr\CronLoggerBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +// use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; class CronRunnerController extends FOSRestController { diff --git a/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php b/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php index b5f822f53..7175dcf2d 100644 --- a/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php +++ b/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php @@ -2,12 +2,15 @@ namespace PartKeepr\CronLoggerBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; /** * Holds a project attachment. * + * @ApiResource * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="cronjob", columns={"cronjob"})}) * @ORM\Entity **/ diff --git a/src/PartKeepr/DistributorBundle/Entity/Distributor.php b/src/PartKeepr/DistributorBundle/Entity/Distributor.php index 3072a6f87..11e52ebe4 100644 --- a/src/PartKeepr/DistributorBundle/Entity/Distributor.php +++ b/src/PartKeepr/DistributorBundle/Entity/Distributor.php @@ -2,14 +2,23 @@ namespace PartKeepr\DistributorBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; /** * Represents a distributor. - * + * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/distributors") **/ diff --git a/src/PartKeepr/DoctrineReflectionBundle/Command/GenerateEntityCommand.php b/src/PartKeepr/DoctrineReflectionBundle/Command/GenerateEntityCommand.php index 60882327c..a0bf63859 100644 --- a/src/PartKeepr/DoctrineReflectionBundle/Command/GenerateEntityCommand.php +++ b/src/PartKeepr/DoctrineReflectionBundle/Command/GenerateEntityCommand.php @@ -18,7 +18,7 @@ public function configure() public function execute(InputInterface $input, OutputInterface $output) { $reflectionService = $this->getContainer()->get('doctrine_reflection_service'); - $cacheDir = $this->getContainer()->get('kernel')->getRootDir().'/../web/bundles/doctrinereflection/'; + $cacheDir = $this->getContainer()->get('kernel')->getProjectDir().'/web/bundles/doctrinereflection/'; $reflectionService->createCache($cacheDir); } } diff --git a/src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php b/src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php index 7cecfe31c..41643bfa7 100644 --- a/src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php +++ b/src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php @@ -4,9 +4,9 @@ use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\ORM\QueryBuilder; -use Dunglas\ApiBundle\Api\IriConverterInterface; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Doctrine\Orm\Filter\AbstractFilter; +use ApiPlatform\Core\Api\IriConverterInterface; +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Doctrine\Orm\Filter\AbstractFilter; use PartKeepr\DoctrineReflectionBundle\Services\FilterService; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; diff --git a/src/PartKeepr/DoctrineReflectionBundle/Resources/config/services.xml b/src/PartKeepr/DoctrineReflectionBundle/Resources/config/services.xml index 1256cc5e7..d233dc6b5 100644 --- a/src/PartKeepr/DoctrineReflectionBundle/Resources/config/services.xml +++ b/src/PartKeepr/DoctrineReflectionBundle/Resources/config/services.xml @@ -18,7 +18,7 @@ - + diff --git a/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/CsvFormatPass.php b/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/CsvFormatPass.php index be80b49c8..dcdd18b91 100644 --- a/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/CsvFormatPass.php +++ b/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/CsvFormatPass.php @@ -7,10 +7,19 @@ class CsvFormatPass implements CompilerPassInterface { +/* + before + + + now + +*/ public function process(ContainerBuilder $container) { - $container->getDefinition('api.format_negotiator')->addMethodCall('registerFormat', [ +/* + $container->getDefinition('api_platform.negotiator')->addMethodCall('registerFormat', [ 'csv', ['text/comma-separated-values'], true, ]); +*/ } } diff --git a/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/XmlExcelFormatPass.php b/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/XmlExcelFormatPass.php index 7ab9ef1cf..68fa8e237 100644 --- a/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/XmlExcelFormatPass.php +++ b/src/PartKeepr/ExportBundle/DependencyInjection/Compiler/XmlExcelFormatPass.php @@ -7,10 +7,20 @@ class XmlExcelFormatPass implements CompilerPassInterface { + /* + before + + + now + + */ + public function process(ContainerBuilder $container) { - $container->getDefinition('api.format_negotiator')->addMethodCall('registerFormat', [ +/* + $container->getDefinition('api_platform.negotiator')->addMethodCall('registerFormat', [ 'xlsx', ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], true, ]); +*/ } } diff --git a/src/PartKeepr/FootprintBundle/Entity/Footprint.php b/src/PartKeepr/FootprintBundle/Entity/Footprint.php index 5fa4b719b..d749b8557 100644 --- a/src/PartKeepr/FootprintBundle/Entity/Footprint.php +++ b/src/PartKeepr/FootprintBundle/Entity/Footprint.php @@ -3,7 +3,9 @@ namespace PartKeepr\FootprintBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\UploadedFileBundle\Annotation\UploadedFile; @@ -11,6 +13,13 @@ use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/footprints") */ diff --git a/src/PartKeepr/FootprintBundle/Entity/FootprintAttachment.php b/src/PartKeepr/FootprintBundle/Entity/FootprintAttachment.php index 00cf4a6a2..f30142e15 100644 --- a/src/PartKeepr/FootprintBundle/Entity/FootprintAttachment.php +++ b/src/PartKeepr/FootprintBundle/Entity/FootprintAttachment.php @@ -2,12 +2,29 @@ namespace PartKeepr\FootprintBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; /** * Holds a footprint attachment. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="FootprintAttachmentGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_mime"={"route_name"="FootprintAttachmentMimeTypeIcon","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity **/ class FootprintAttachment extends UploadedFile diff --git a/src/PartKeepr/FootprintBundle/Entity/FootprintCategory.php b/src/PartKeepr/FootprintBundle/Entity/FootprintCategory.php index 36e7211df..505084ef7 100644 --- a/src/PartKeepr/FootprintBundle/Entity/FootprintCategory.php +++ b/src/PartKeepr/FootprintBundle/Entity/FootprintCategory.php @@ -3,7 +3,9 @@ namespace PartKeepr\FootprintBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use Gedmo\Mapping\Annotation as Gedmo; use PartKeepr\CategoryBundle\Entity\AbstractCategory; use PartKeepr\CategoryBundle\Entity\CategoryPathInterface; @@ -11,12 +13,32 @@ use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default", "tree"}}, + * "denormalization_context"={"groups"={"default", "tree"}} + * }, + * collectionOperations={ + * "get"={"method"="GET"}, + * "get_root"={"route_name"="PartKeeprFootprintCategoryGetRootNode"}, + * "post"={"method"="POST"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"}, + * "move"={"route_name"="FootprintCategoryMove"} + * } + * ) * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository") * @Gedmo\Tree(type="nested") * @ORM\Table(indexes={@ORM\Index(columns={"lft"}),@ORM\Index(columns={"rgt"})}) * The entity for our footprint categories * @TargetService(uri="/api/footprint_categories") - */ +**/ class FootprintCategory extends AbstractCategory implements CategoryPathInterface { /** diff --git a/src/PartKeepr/FootprintBundle/Entity/FootprintImage.php b/src/PartKeepr/FootprintBundle/Entity/FootprintImage.php index c43fefcaa..c3812cda2 100644 --- a/src/PartKeepr/FootprintBundle/Entity/FootprintImage.php +++ b/src/PartKeepr/FootprintBundle/Entity/FootprintImage.php @@ -2,12 +2,28 @@ namespace PartKeepr\FootprintBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\ImageBundle\Entity\Image; /** * Holds a footprint image. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="FootprintImageGetImage","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity **/ class FootprintImage extends Image diff --git a/src/PartKeepr/FrontendBundle/Action/MarkAsDefaultAction.php b/src/PartKeepr/FrontendBundle/Action/MarkAsDefaultAction.php index 14606fbe4..283b5957a 100644 --- a/src/PartKeepr/FrontendBundle/Action/MarkAsDefaultAction.php +++ b/src/PartKeepr/FrontendBundle/Action/MarkAsDefaultAction.php @@ -2,16 +2,19 @@ namespace PartKeepr\FrontendBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\FrontendBundle\Entity\GridPreset; use PartKeepr\FrontendBundle\Services\GridPresetService; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class MarkAsDefaultAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -39,11 +42,19 @@ public function __construct( * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="MarkGridPresetAsDefault", + * path="/grid_presets/{id}/markAsDefault", + * defaults={"_api_resource_class"=GridPreset::class, "_api_item_operation_name"="markAsDefault"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); /** * @var GridPreset diff --git a/src/PartKeepr/FrontendBundle/Entity/GridPreset.php b/src/PartKeepr/FrontendBundle/Entity/GridPreset.php index d1ea1dd3b..4d31a9389 100644 --- a/src/PartKeepr/FrontendBundle/Entity/GridPreset.php +++ b/src/PartKeepr/FrontendBundle/Entity/GridPreset.php @@ -2,7 +2,9 @@ namespace PartKeepr\FrontendBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; @@ -10,6 +12,22 @@ /** * Stores the grid presets. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"}, + * "markAsDefault"={"route_name"="MarkGridPresetAsDefault"} + * } + * ) * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="name_grid_unique", columns={"grid", "name"})}) * @ORM\Entity() * @TargetService(uri="/api/grid_presets") diff --git a/src/PartKeepr/FrontendBundle/Resources/config/actions.xml b/src/PartKeepr/FrontendBundle/Resources/config/actions.xml index 37f960f77..26ed6de44 100644 --- a/src/PartKeepr/FrontendBundle/Resources/config/actions.xml +++ b/src/PartKeepr/FrontendBundle/Resources/config/actions.xml @@ -5,9 +5,12 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> + - + + + diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/HTTPBasicAuthenticationProvider.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/HTTPBasicAuthenticationProvider.js index 3ce1c3f67..4fd3d22d2 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/HTTPBasicAuthenticationProvider.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/HTTPBasicAuthenticationProvider.js @@ -5,7 +5,13 @@ Ext.define('PartKeepr.Auth.HTTPBasicAuthenticationProvider', { extend: 'PartKeepr.Auth.AuthenticationProvider', /** - * @method add + * @Route( + * path="/getPreview/", + * methods={"add"} + * ) + **/ + + /** * @inheritdoc PartKeepr.Auth.AuthenticationProvider#getHeaders */ getHeaders: function () diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/WSSEAuthenticationProvider.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/WSSEAuthenticationProvider.js index 20dfdf5a5..03374ed67 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/WSSEAuthenticationProvider.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Auth/WSSEAuthenticationProvider.js @@ -50,7 +50,13 @@ Ext.define('PartKeepr.Auth.WSSEAuthenticationProvider', { }, /** - * @method add + * @Route( + * path="/getPreview/", + * methods={"add"} + * ) + **/ + + /** * @inheritdoc PartKeepr.Auth.AuthenticationProvider#getHeaders */ getHeaders: function () diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js index 1f146f572..ce5968761 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/OctoPart/SearchPanel.js @@ -206,7 +206,7 @@ Ext.define("PartKeepr.Components.OctoPart.SearchPanel", { }, checkForErrors: function (data) { - if (data.results.length == 0 && data.errors.length > 0) { + if (data.errors && data.errors.length > 0) { Ext.Msg.alert(i18n("Octopart Error"), data.errors.map(e => e.message).join()); } diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js index ee6b0b6b6..99bb3d7f1 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditor.js @@ -19,8 +19,19 @@ Ext.define('PartKeepr.PartEditor', { */ initComponent: function () { - // Defines the overall height of all fields, used to calculate the anchoring for the description field - var overallHeight = (this.partMode == "create") ? 320: 265; +/* DANIEL DANIEL DANIEL DANIEL DANIEL ToDo: fix the comment in the master, say wrongly "decription" while is for "comment"*/ + + // Defines the overall height of all fields, used to calculate the anchoring for the comment field +// var overallHeight = (this.partMode == "create") ? 320: 265; +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ +/* +435 total = 265 + 170 (comment 4 rows) 42.5 points per row +500 total = 320 + 180 (comment 4 rows) 45 points per row + +575 - 170 -> 405 +620 - 170 -> 450 +*/ + var overallHeight = (this.partMode == "create") ? 450: 405; this.nameField = Ext.create("Ext.form.field.Text", { name: 'name', @@ -216,7 +227,35 @@ Ext.define('PartKeepr.PartEditor', { } ] + } +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ + , { + xtype: 'textfield', + fieldLabel: i18n("Presentation"), + name: 'partPresentation', + allowBlank: this.isOptional("partPresentation"), + } , { + xtype: 'textfield', + fieldLabel: i18n("Code Manufacturer"), + name: 'partCodeManufacturer', + allowBlank: this.isOptional("partCodeManufacturer"), + } , { + xtype: 'textfield', + fieldLabel: i18n("Code Supplier"), + name: 'partCodeSupplier', + allowBlank: this.isOptional("partCodeSupplier"), + } , { + xtype: 'textfield', + fieldLabel: i18n("Code Additional"), + name: 'partCodeAdditional', + allowBlank: this.isOptional("partCodeAdditional"), + } , { + xtype: 'textfield', + fieldLabel: i18n("CERN project"), + name: 'partCERNproject', + allowBlank: this.isOptional("partCERNproject"), } +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ ]; // Creates the distributor grid diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js index f99befb4d..48b5cae2a 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/Editor/PartEditorWindow.js @@ -15,8 +15,11 @@ Ext.define('PartKeepr.PartEditorWindow', { /* Width and height settings */ width: 750, minWidth: 600, - minHeight: 435, - height: 435, +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ +// minHeight: 435, +// height: 435, + minHeight: 575, + height: 575, saveText: i18n("Save"), cancelText: i18n("Cancel"), @@ -39,9 +42,12 @@ Ext.define('PartKeepr.PartEditorWindow', { }); /* If the edit mode is "create", we need to enlarge the window a bit to fit the fields without scrolling */ +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ if (this.partMode && this.partMode == "create") { - this.height = 500; - this.minHeight = 500; +// this.height = 500; +// this.minHeight = 500; + this.height = 620; + this.minHeight = 620; } this.items = [this.editor]; @@ -140,7 +146,11 @@ Ext.define('PartKeepr.PartEditorWindow', { this.octoPartQueryWindow = Ext.create("PartKeepr.Components.OctoPart.SearchWindow"); this.octoPartQueryWindow.show(); this.octoPartQueryWindow.setPart(this.editor.record); - this.octoPartQueryWindow.startSearch(this.editor.nameField.getValue()); + // don't autosearch octo for empty name + let name = this.editor.nameField.getValue(); + if (name !== "") + this.octoPartQueryWindow.startSearch(name); +// this.octoPartQueryWindow.startSearch(this.editor.nameField.getValue()); this.octoPartQueryWindow.on("refreshData", this.onRefreshData, this); } else { Ext.MessageBox.alert(i18n("Octopart is not configured"), i18n("Your administrator needs to configure the API key for Octopart in the parameters.php file - see parameters.php.dist for instructions")); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartInfoGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartInfoGrid.js index b50663ae9..c558bb528 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartInfoGrid.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartInfoGrid.js @@ -22,6 +22,21 @@ Ext.define("PartKeepr.Components.Part.PartInfoGrid", { comment: { displayName: i18n("Comment") }, +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ + partCodeManufacturer: { + displayName: i18n("Code Manufacturer") + }, + partCodeSupplier: { + displayName: i18n("Code Supplier") + }, + partCodeAdditional: { + displayName: i18n("Code Additional") + }, + partCERNproject: { + displayName: i18n("Project") + }, + +/* DANIEL DANIEL DANIEL DANIEL DANIEL */ createDate: { displayName: i18n("Create Date"), type: 'date' diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js index 27a10bfb5..6590aec3b 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js @@ -160,11 +160,33 @@ Ext.define('PartKeepr.PartStockWindow', { } else { price = this.priceField.getValue() / this.quantityField.getValue(); } - - Ext.callback(this.callbackFn, - this.callbackScope, - [this.quantityField.getValue(), price, this.commentField.getValue()]); - this.close(); + + //Warn the user if they want to remove more than the current available + var current_stock = this.callbackScope.record.data.stockLevel; + if ((this.title == this.removePartText) & (this.quantityField.getValue() > current_stock)){ + + Ext.Msg.confirm(i18n("Not enough stock"), + i18n("You are removing more parts than are in stock. \ + If you continue a negative stock will be tracked.

\ + Are you sure you want to remove these parts?"), + function(buttonid){ + // if yes, submit data as normal + if (buttonid == "yes") { + Ext.callback(this.callbackFn, + this.callbackScope, + [this.quantityField.getValue(), price, this.commentField.getValue()]); + this.close(); + } + return; //otherwise, return without doing anything + }, this); + } + else { // add or remove stock normally + + Ext.callback(this.callbackFn, + this.callbackScope, + [this.quantityField.getValue(), price, this.commentField.getValue()]); + this.close(); + } } }, /** @@ -201,7 +223,10 @@ Ext.define('PartKeepr.PartStockWindow', { this.priceField.hide(); this.priceCheckbox.hide(); this.okButton.setIconCls("web-icon brick_delete"); - this.quantityField.maxValue = this.callbackScope.record.data.stockLevel; + +// Revert max value limitation. Negative stock values are allowed/expected behavior in some circumstances. +// this.quantityField.maxValue = this.callbackScope.record.data.stockLevel; + this.show(); } }); diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js index b4229e59f..185cd0ee6 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/ActionsConfiguration.js @@ -86,8 +86,10 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfigurat xtype: 'button', text: i18n("Delete Action"), disabled: true, - itemId: 'actionDelete' - } + itemId: 'actionDelete', + handler: this.onDeleteClick, + scope: this + } ] } ] @@ -125,6 +127,11 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.ActionsConfigurat grid.getPlugin("editing").startEdit(0, 0); }, + onDeleteClick: function () + { + var grid = this.down("#actionGrid"); + grid.getStore().remove(grid.getView().getSelectionModel().getSelection()); + }, onSelectionChange: function (grid, selection) { if (selection.length === 1) { diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js old mode 100644 new mode 100755 index 6e872289c..c8b5b3764 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Preferences/BarcodeScannerConfiguration.js @@ -77,10 +77,10 @@ Ext.define('PartKeepr.Components.SystemPreferences.Preferences.BarcodeScannerCon }, { text: i18n("Action"), dataIndex: 'action', flex: 1, - renderer: function (v) + renderer: function (v, m, record) { - if (v instanceof Ext.data.Model) { - return v.get("name"); + if (record.get("action") instanceof Ext.data.Model) { + return record.get("action").get("name"); } else { return i18n("No action selected"); } diff --git a/src/PartKeepr/ImageBundle/Controller/ImageController.php b/src/PartKeepr/ImageBundle/Controller/ImageController.php index 2133559d2..50e24e9c7 100644 --- a/src/PartKeepr/ImageBundle/Controller/ImageController.php +++ b/src/PartKeepr/ImageBundle/Controller/ImageController.php @@ -14,6 +14,7 @@ use PartKeepr\UploadedFileBundle\Entity\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; abstract class ImageController extends FileController { @@ -31,6 +32,54 @@ abstract class ImageController extends FileController * * @return ImageResponse|Response */ + /** + * @Route( + * name="ProjectAttachmentGetImage", + * path="/project_attachments/{id}/getImage", + * defaults={"_api_resource_class"=ProjectAttachment::class, "_api_item_operation_name"="custom_get_image"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="TemporaryImageGet", + * path="/temp_images/{id}/getImage", + * defaults={"_api_resource_class"=TempImage::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="StorageLocationGetImage", + * path="/storage_location_images/{id}/getImage", + * defaults={"_api_resource_class"=StorageLocationImage::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="ManufacturerIcLogoGetImage", + * path="/manufacturer_i_c_logos/{id}/getImage", + * defaults={"_api_resource_class"=ManufacturerICLogo::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="PartAttachmentGetImage", + * path="/part_attachments/{id}/getImage", + * defaults={"_api_resource_class"=PartAttachment::class, "_api_item_operation_name"="custom_get_image"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="FootprintImageGetImage", + * path="/footprint_images/{id}/getImage", + * defaults={"_api_resource_class"=FootprintImage::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + */ public function getImageAction(Request $request, $id) { /** diff --git a/src/PartKeepr/ImageBundle/Controller/TemporaryImageController.php b/src/PartKeepr/ImageBundle/Controller/TemporaryImageController.php index 8469a2e53..63ad317e4 100644 --- a/src/PartKeepr/ImageBundle/Controller/TemporaryImageController.php +++ b/src/PartKeepr/ImageBundle/Controller/TemporaryImageController.php @@ -2,8 +2,12 @@ namespace PartKeepr\ImageBundle\Controller; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; +use Symfony\Component\Routing\Annotation\Route; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; use FOS\RestBundle\Controller\Annotations\RequestParam; use FOS\RestBundle\Controller\Annotations\View; use PartKeepr\ImageBundle\Entity\TempImage; @@ -16,7 +20,7 @@ class TemporaryImageController extends ImageController { - use ActionUtilTrait; +// use ActionUtilTrait; /** * Handles a temporary image upload. @@ -31,6 +35,14 @@ class TemporaryImageController extends ImageController * * @return JsonResponse The JSON response from the temporary image upload */ + /** + * @Route( + * name="TemporaryImageUpload", + * path="/temp_images/upload", + * defaults={"_api_resource_class"=TempImage::class, "_api_collection_operation_name"="custom_post"}, + * methods={"POST"} + * ) + **/ public function uploadAction(Request $request) { $image = new TempImage(); @@ -55,7 +67,7 @@ public function uploadAction(Request $request) /** * @var ResourceInterface */ - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $serializedData = $this->get('serializer')->normalize( $image, @@ -73,6 +85,14 @@ public function uploadAction(Request $request) * * @return Response */ + /** + * @Route( + * name="TemporaryImageUploadWebcam", + * path="/temp_images/webcamUpload", + * defaults={"_api_resource_class"=TempImage::class, "_api_collection_operation_name"="custom_post_webcam"}, + * methods={"POST"} + * ) + **/ public function webcamUploadAction(Request $request) { $image = new TempImage(); diff --git a/src/PartKeepr/ImageBundle/Entity/CachedImage.php b/src/PartKeepr/ImageBundle/Entity/CachedImage.php index 3106a9307..e74d5752a 100644 --- a/src/PartKeepr/ImageBundle/Entity/CachedImage.php +++ b/src/PartKeepr/ImageBundle/Entity/CachedImage.php @@ -2,7 +2,9 @@ namespace PartKeepr\ImageBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; @@ -11,6 +13,7 @@ * operations, so that the resize/scale operation doesn't need to be done * every time a scaled/resized image is requested. * + * @ApiResource * @ORM\Entity */ class CachedImage extends BaseEntity diff --git a/src/PartKeepr/ImageBundle/Entity/Image.php b/src/PartKeepr/ImageBundle/Entity/Image.php index 45e9447fe..fd58bb3a3 100644 --- a/src/PartKeepr/ImageBundle/Entity/Image.php +++ b/src/PartKeepr/ImageBundle/Entity/Image.php @@ -2,7 +2,9 @@ namespace PartKeepr\ImageBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\Image\Exceptions\InvalidImageTypeException; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; diff --git a/src/PartKeepr/ImageBundle/Entity/TempImage.php b/src/PartKeepr/ImageBundle/Entity/TempImage.php index dd052456b..39443b1f3 100644 --- a/src/PartKeepr/ImageBundle/Entity/TempImage.php +++ b/src/PartKeepr/ImageBundle/Entity/TempImage.php @@ -2,12 +2,27 @@ namespace PartKeepr\ImageBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * Represents a temporary image. Temporary images are used when * a user uploaded an image, but not attached it to an entity. * + * @ApiResource( + * collectionOperations={ + * "custom_post_webcam"={"route_name"="TemporaryImageUploadWebcam","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "post"={"route_name"="TemporaryImageUpload","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="TemporaryImageGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity */ class TempImage extends Image diff --git a/src/PartKeepr/ImportBundle/Configuration/BaseConfiguration.php b/src/PartKeepr/ImportBundle/Configuration/BaseConfiguration.php index 8755083b7..8da9dba92 100644 --- a/src/PartKeepr/ImportBundle/Configuration/BaseConfiguration.php +++ b/src/PartKeepr/ImportBundle/Configuration/BaseConfiguration.php @@ -4,7 +4,7 @@ use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; -use Dunglas\ApiBundle\Api\IriConverter; +use ApiPlatform\Core\Api\IriConverter; use PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter; use PartKeepr\DoctrineReflectionBundle\Services\ReflectionService; diff --git a/src/PartKeepr/ImportBundle/Controller/ImportController.php b/src/PartKeepr/ImportBundle/Controller/ImportController.php index 4dba2a903..df9bf84eb 100644 --- a/src/PartKeepr/ImportBundle/Controller/ImportController.php +++ b/src/PartKeepr/ImportBundle/Controller/ImportController.php @@ -27,9 +27,12 @@ public function getSourceAction(Request $request) } /** - * @Route("/getPreview/") - * @Method({"POST"}) - * + * @Route( + * path="/getPreview/", + * methods={"POST"} + * ) + **/ + /** * @return JsonResponse */ public function getPreviewAction(Request $request) @@ -55,9 +58,12 @@ public function getPreviewAction(Request $request) } /** - * @Route("/executeImport/") - * @Method({"POST"}) - * + * @Route( + * path="/executeImport/", + * methods={"POST"} + * ) + **/ + /** * @return JsonResponse */ public function importAction(Request $request) @@ -79,7 +85,7 @@ public function importAction(Request $request) protected function extractCSVData($tempFileIRI, $includeHeaders = true) { - $tempUploadedFile = $this->get("api.iri_converter")->getItemFromIri($tempFileIRI); + $tempUploadedFile = $this->get("api_platform.iri_converter")->getItemFromIri($tempFileIRI); $fileContents = $this->get('partkeepr_uploadedfile_service')->getStorage($tempUploadedFile)->read($tempUploadedFile->getFullFilename()); $tempFile = tempnam(sys_get_temp_dir(), "import"); diff --git a/src/PartKeepr/ImportBundle/Entity/ImportPreset.php b/src/PartKeepr/ImportBundle/Entity/ImportPreset.php index 95696d509..ee70e487b 100644 --- a/src/PartKeepr/ImportBundle/Entity/ImportPreset.php +++ b/src/PartKeepr/ImportBundle/Entity/ImportPreset.php @@ -2,12 +2,21 @@ namespace PartKeepr\ImportBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="name_entity_unique", columns={"baseEntity", "name"})}) * @ORM\Entity() * @TargetService(uri="/api/import_presets") diff --git a/src/PartKeepr/ImportBundle/Resources/config/services.xml b/src/PartKeepr/ImportBundle/Resources/config/services.xml index ae10f1fd9..e791e7094 100644 --- a/src/PartKeepr/ImportBundle/Resources/config/services.xml +++ b/src/PartKeepr/ImportBundle/Resources/config/services.xml @@ -9,7 +9,7 @@ - +
diff --git a/src/PartKeepr/ImportBundle/Service/ImporterService.php b/src/PartKeepr/ImportBundle/Service/ImporterService.php index aee0daa57..c63870481 100644 --- a/src/PartKeepr/ImportBundle/Service/ImporterService.php +++ b/src/PartKeepr/ImportBundle/Service/ImporterService.php @@ -5,7 +5,7 @@ use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\ORM\EntityManager; use Doctrine\ORM\UnitOfWork; -use Dunglas\ApiBundle\Api\IriConverter; +use ApiPlatform\Core\Api\IriConverter; use PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter; use PartKeepr\DoctrineReflectionBundle\Services\ReflectionService; use PartKeepr\ImportBundle\Configuration\EntityConfiguration; diff --git a/src/PartKeepr/ManufacturerBundle/Entity/Manufacturer.php b/src/PartKeepr/ManufacturerBundle/Entity/Manufacturer.php index bf326e239..152d1baa2 100644 --- a/src/PartKeepr/ManufacturerBundle/Entity/Manufacturer.php +++ b/src/PartKeepr/ManufacturerBundle/Entity/Manufacturer.php @@ -3,7 +3,9 @@ namespace PartKeepr\ManufacturerBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\UploadedFileBundle\Annotation\UploadedFileCollection; @@ -12,6 +14,13 @@ /** * Represents a manufacturer. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/manufacturers") **/ diff --git a/src/PartKeepr/ManufacturerBundle/Entity/ManufacturerICLogo.php b/src/PartKeepr/ManufacturerBundle/Entity/ManufacturerICLogo.php index 6fc77c435..4605be1b8 100644 --- a/src/PartKeepr/ManufacturerBundle/Entity/ManufacturerICLogo.php +++ b/src/PartKeepr/ManufacturerBundle/Entity/ManufacturerICLogo.php @@ -2,12 +2,29 @@ namespace PartKeepr\ManufacturerBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\ImageBundle\Entity\Image; /** * Holds a manufacturer IC logo. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "custom_get"={"route_name"="ManufacturerIcLogoGetImage","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity **/ class ManufacturerICLogo extends Image diff --git a/src/PartKeepr/OctoPartBundle/Services/OctoPartService.php b/src/PartKeepr/OctoPartBundle/Services/OctoPartService.php index 81cb1ff94..0343735e0 100644 --- a/src/PartKeepr/OctoPartBundle/Services/OctoPartService.php +++ b/src/PartKeepr/OctoPartBundle/Services/OctoPartService.php @@ -55,9 +55,6 @@ class OctoPartService credit_string text } - cad { - add_to_library_url - } reference_designs { name url @@ -137,9 +134,6 @@ class OctoPartService credit_string text } - cad { - add_to_library_url - } reference_designs { name url diff --git a/src/PartKeepr/PartBundle/Action/AddStockAction.php b/src/PartKeepr/PartBundle/Action/AddStockAction.php index c96521cf5..7d6a9fcbb 100644 --- a/src/PartKeepr/PartBundle/Action/AddStockAction.php +++ b/src/PartKeepr/PartBundle/Action/AddStockAction.php @@ -2,22 +2,25 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Services\UserService; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\PartBundle\Entity\Part; use PartKeepr\StockBundle\Entity\StockEntry; use Symfony\Bridge\Doctrine\ManagerRegistry; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Adds stock to a given part. */ class AddStockAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -52,11 +55,19 @@ public function __construct( * * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="PartAddStock", + * path="/parts/{id}/addStock", + * defaults={"_api_resource_class"=Part::class, "_api_item_operation_name"="add_stock"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $part = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/PartBundle/Action/GetPartsAction.php b/src/PartKeepr/PartBundle/Action/GetPartsAction.php index 1ce2e00c7..9a4b461df 100644 --- a/src/PartKeepr/PartBundle/Action/GetPartsAction.php +++ b/src/PartKeepr/PartBundle/Action/GetPartsAction.php @@ -3,12 +3,16 @@ namespace PartKeepr\PartBundle\Action; use Doctrine\ORM\EntityManager; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\PartBundle\Entity\Part; use PartKeepr\PartBundle\Services\PartService; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Default API action retrieving a collection of resources. @@ -17,7 +21,7 @@ */ class GetPartsAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -48,11 +52,19 @@ public function __construct(DataProviderInterface $dataProvider, EntityManager $ * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="PartsGet", + * path="/parts", + * defaults={"_api_resource_class"=Part::class, "_api_collection_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ public function __invoke(Request $request) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $items = $this->dataProvider->getCollection($resourceType); diff --git a/src/PartKeepr/PartBundle/Action/PartPostAction.php b/src/PartKeepr/PartBundle/Action/PartPostAction.php index f0f52f86e..250530501 100644 --- a/src/PartKeepr/PartBundle/Action/PartPostAction.php +++ b/src/PartKeepr/PartBundle/Action/PartPostAction.php @@ -2,19 +2,22 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Exception\RuntimeException; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Exception\RuntimeException; use PartKeepr\PartBundle\Entity\Part; use PartKeepr\PartBundle\Exceptions\InternalPartNumberNotUniqueException; use PartKeepr\PartBundle\Exceptions\PartLimitExceededException; use PartKeepr\PartBundle\Services\PartService; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Serializer\SerializerInterface; +use Symfony\Component\Routing\Annotation\Route; class PartPostAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var SerializerInterface @@ -45,6 +48,14 @@ public function __construct( * * @return mixed */ + /** + * @Route( + * name="PartPost", + * path="/parts", + * defaults={"_api_resource_class"=Part::class, "_api_collection_operation_name"="custom_post"}, + * methods={"POST"} + * ) + **/ public function __invoke(Request $request) { if ($this->partService->checkPartLimit()) { @@ -54,7 +65,7 @@ public function __invoke(Request $request) /** * @var ResourceInterface */ - list($resourceType, $format) = $this->extractAttributes($request); + list($resourceType, $format) = RequestAttributesExtractor::extractAttributes($request); /** * @var Part diff --git a/src/PartKeepr/PartBundle/Action/PartPutAction.php b/src/PartKeepr/PartBundle/Action/PartPutAction.php index 38399b255..52586c2c9 100644 --- a/src/PartKeepr/PartBundle/Action/PartPutAction.php +++ b/src/PartKeepr/PartBundle/Action/PartPutAction.php @@ -2,10 +2,12 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Exceptions\UserLimitReachedException; use PartKeepr\AuthBundle\Exceptions\UserProtectedException; use PartKeepr\PartBundle\Entity\Part; @@ -14,10 +16,11 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Serializer\SerializerInterface; +use Symfony\Component\Routing\Annotation\Route; class PartPutAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -57,12 +60,20 @@ public function __construct( * * @return mixed */ + /** + * @Route( + * name="PartPut", + * path="/parts/{id}", + * defaults={"_api_resource_class"=Part::class, "_api_item_operation_name"="custom_put"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { /** * @var ResourceInterface */ - list($resourceType, $format) = $this->extractAttributes($request); + list($resourceType, $format) = RequestAttributesExtractor::extractAttributes($request); /* * Workaround to ensure stockLevels are not overwritten in a PUT request. diff --git a/src/PartKeepr/PartBundle/Action/RemoveStockAction.php b/src/PartKeepr/PartBundle/Action/RemoveStockAction.php index bfd725dfd..141738468 100644 --- a/src/PartKeepr/PartBundle/Action/RemoveStockAction.php +++ b/src/PartKeepr/PartBundle/Action/RemoveStockAction.php @@ -2,22 +2,25 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Services\UserService; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\PartBundle\Entity\Part; use PartKeepr\StockBundle\Entity\StockEntry; use Symfony\Bridge\Doctrine\ManagerRegistry; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Removes stock for a given part. */ class RemoveStockAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -52,11 +55,19 @@ public function __construct( * * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="PartRemoveStock", + * path="/parts/{id}/removeStock", + * defaults={"_api_resource_class"=Part::class, "_api_item_operation_name"="remove_stock"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $part = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/PartBundle/Action/SetDefaultUnitAction.php b/src/PartKeepr/PartBundle/Action/SetDefaultUnitAction.php index 56034d91b..d773d30ab 100644 --- a/src/PartKeepr/PartBundle/Action/SetDefaultUnitAction.php +++ b/src/PartKeepr/PartBundle/Action/SetDefaultUnitAction.php @@ -2,16 +2,19 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\PartBundle\Entity\PartMeasurementUnit; use PartKeepr\PartBundle\Services\PartMeasurementUnitService; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class SetDefaultUnitAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var PartMeasurementUnitService @@ -37,11 +40,19 @@ public function __construct(DataProviderInterface $dataProvider, PartMeasurement * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="PartMeasurementUnitSetDefault", + * path="/part_measurement_units/{id}/setDefault", + * defaults={"_api_resource_class"=PartMeasurementUnit::class, "_api_item_operation_name"="custom_put"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); /** * @var PartMeasurementUnit diff --git a/src/PartKeepr/PartBundle/Action/SetStockAction.php b/src/PartKeepr/PartBundle/Action/SetStockAction.php index 281c3e357..c03b9557c 100644 --- a/src/PartKeepr/PartBundle/Action/SetStockAction.php +++ b/src/PartKeepr/PartBundle/Action/SetStockAction.php @@ -2,22 +2,25 @@ namespace PartKeepr\PartBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Services\UserService; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\PartBundle\Entity\Part; use PartKeepr\StockBundle\Entity\StockEntry; use Symfony\Bridge\Doctrine\ManagerRegistry; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Sets the stock for a given part. */ class SetStockAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -52,11 +55,19 @@ public function __construct( * * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="PartSetStock", + * path="/parts/{id}/setStock", + * defaults={"_api_resource_class"=Part::class, "_api_item_operation_name"="set_stock"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $part = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/PartBundle/Controller/PartController.php b/src/PartKeepr/PartBundle/Controller/PartController.php index 59418b38f..c0bd399a2 100644 --- a/src/PartKeepr/PartBundle/Controller/PartController.php +++ b/src/PartKeepr/PartBundle/Controller/PartController.php @@ -2,7 +2,7 @@ namespace PartKeepr\PartBundle\Controller; -use Dunglas\ApiBundle\Api\IriConverter; +use ApiPlatform\Core\Api\IriConverter; use FOS\RestBundle\Controller\Annotations\View; use FOS\RestBundle\Controller\FOSRestController; use PartKeepr\PartBundle\Entity\Part; @@ -28,7 +28,7 @@ public function massRemoveStockAction(Request $request) /** * @var IriConverter */ - $iriConverter = $this->get('api.iri_converter'); + $iriConverter = $this->get('api_platform.iri_converter'); $removals = json_decode($request->get('removals')); diff --git a/src/PartKeepr/PartBundle/Entity/MetaPartParameterCriteria.php b/src/PartKeepr/PartBundle/Entity/MetaPartParameterCriteria.php index 7c4a24251..951316427 100644 --- a/src/PartKeepr/PartBundle/Entity/MetaPartParameterCriteria.php +++ b/src/PartKeepr/PartBundle/Entity/MetaPartParameterCriteria.php @@ -2,12 +2,23 @@ namespace PartKeepr\PartBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\SiPrefixBundle\Entity\SiPrefix; use Symfony\Component\Serializer\Annotation\Groups; + + + /** + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity() */ class MetaPartParameterCriteria extends BaseEntity diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php index d24be9f3f..71a80ee1e 100644 --- a/src/PartKeepr/PartBundle/Entity/Part.php +++ b/src/PartKeepr/PartBundle/Entity/Part.php @@ -3,7 +3,9 @@ namespace PartKeepr\PartBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\FootprintBundle\Entity\Footprint; @@ -16,11 +18,32 @@ use PartKeepr\StorageLocationBundle\Entity\StorageLocation; use PartKeepr\UploadedFileBundle\Annotation\UploadedFileCollection; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * Represents a part in the database. The heart of our project. Handle with care! * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default", "readonly" }}, + * "denormalization_context"={"groups"={"default", "stock"}} + * }, + * collectionOperations={ + * "custom_get"={"route_name"="PartsGet"}, + * "custom_post"={"route_name"="PartPost"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_put"={"route_name"="PartPut"}, + * "delete"={"method"="DELETE"}, + * "add_stock"={"route_name"="PartAddStock"}, + * "remove_stock"={"route_name"="PartRemoveStock"}, + * "set_stock"={"route_name"="PartSetStock"} + * } + * ) * @ORM\Entity * @ORM\HasLifecycleCallbacks * @TargetService(uri="/api/parts") @@ -297,7 +320,63 @@ class Part extends BaseEntity * @var array */ private $metaPartMatches; + + /* + * DANIEL DANIEL DANIEL DANIEL DANIEL + */ + + /** + * The partPresentation + * + * @ORM\Column(type="string",nullable=true) + * @Groups({"default"}) + * + * @var string + */ + private $partPresentation; + + /** + * The partCodeManufacturer + * + * @ORM\Column(type="string",nullable=true) + * @Groups({"default"}) + * + * @var string + */ + private $partCodeManufacturer; + /** + * The partCodeSupplier + * + * @ORM\Column(type="string",nullable=true) + * @Groups({"default"}) + * + * @var string + */ + private $partCodeSupplier; + /** + * The partCodeAdditional + * + * @ORM\Column(type="string",nullable=true) + * @Groups({"default"}) + * + * @var string + */ + private $partCodeAdditional; + /** + * The partCERNproject + * + * @ORM\Column(type="string",nullable=true) + * @Groups({"default"}) + * + * @var string + */ + private $partCERNproject; + + /* + * DANIEL DANIEL DANIEL DANIEL DANIEL + */ + public function __construct() { $this->distributors = new ArrayCollection(); @@ -1057,4 +1136,112 @@ public function setStockLevel($stockLevel) { $this->stockLevel = $stockLevel; } + + /* + * DANIEL DANIEL DANIEL DANIEL DANIEL + */ + /** + * Returns the partPresentation of this part. + * + * @return string The partPresentation + */ + public function getpartPresentation() + { + return $this->partPresentation; + } + + /** + * Sets the partPresentation for this part. + * + * @param string $partPresentation The partPresentation + */ + public function setpartPresentation($partPresentation) + { + $this->partPresentation = $partPresentation; + } + + /** + * Returns the partCodeManufacturer of this part. + * + * @return string The partCodeManufacturer + */ + public function getPartCodeManufacturer() + { + return $this->partCodeManufacturer; + } + + /** + * Sets the partCodeManufacturer for this part. + * + * @param string $partCodeManufacturer The partCodeManufacturer + */ + public function setPartCodeManufacturer($partCodeManufacturer) + { + $this->partCodeManufacturer = $partCodeManufacturer; + } + + /** + * Returns the partCodeSupplier of this part. + * + * @return string The partCodeSupplier + */ + public function getPartCodeSupplier() + { + return $this->partCodeSupplier; + } + + /** + * Sets the partCodeSupplier for this part. + * + * @param string $partCodeSupplier The partCodeSupplier + */ + public function setPartCodeSupplier($partCodeSupplier) + { + $this->partCodeSupplier = $partCodeSupplier; + } + + /** + * Returns the partCodeAdditional of this part. + * + * @return string The partCodeAdditional + */ + public function getPartCodeAdditional() + { + return $this->partCodeAdditional; + } + + /** + * Sets the partCodeAdditional for this part. + * + * @param string $partCodeAdditional The partCodeAdditional + */ + public function setPartCodeAdditional($partCodeAdditional) + { + $this->partCodeAdditional = $partCodeAdditional; + } + + /** + * Returns the partCERNproject of this part. + * + * @return string The partCERNproject + */ + public function getPartCERNproject() + { + return $this->partCERNproject; + } + + /** + * Sets the partCERNproject for this part. + * + * @param string $partCERNproject The partCERNproject + */ + public function setPartCERNproject($partCERNproject) + { + $this->partCERNproject = $partCERNproject; + } + + /* + * DANIEL DANIEL DANIEL DANIEL DANIEL + */ + } diff --git a/src/PartKeepr/PartBundle/Entity/PartAttachment.php b/src/PartKeepr/PartBundle/Entity/PartAttachment.php index fda092167..42eec3e14 100644 --- a/src/PartKeepr/PartBundle/Entity/PartAttachment.php +++ b/src/PartKeepr/PartBundle/Entity/PartAttachment.php @@ -2,13 +2,31 @@ namespace PartKeepr\PartBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; use Symfony\Component\Serializer\Annotation\Groups; /** * Holds a part attachment. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="PartAttachmentGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_mime"={"route_name"="PartAttachmentMimeTypeIcon","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_image"={"route_name"="PartAttachmentGetImage","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity **/ class PartAttachment extends UploadedFile diff --git a/src/PartKeepr/PartBundle/Entity/PartCategory.php b/src/PartKeepr/PartBundle/Entity/PartCategory.php index 14ad674d3..75df55e19 100644 --- a/src/PartKeepr/PartBundle/Entity/PartCategory.php +++ b/src/PartKeepr/PartBundle/Entity/PartCategory.php @@ -3,7 +3,9 @@ namespace PartKeepr\PartBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use Gedmo\Mapping\Annotation as Gedmo; use PartKeepr\CategoryBundle\Entity\AbstractCategory; use PartKeepr\CategoryBundle\Entity\CategoryPathInterface; @@ -11,6 +13,26 @@ use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default", "tree"}}, + * "denormalization_context"={"groups"={"default", "tree"}} + * }, + * collectionOperations={ + * "get"={"method"="GET"}, + * "get_root"={"route_name"="PartKeeprPartCategoryGetRootNode"}, + * "post"={"method"="POST"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"}, + * "move"={"route_name"="PartKeeprPartCategoryMove"} + * } + * ) * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository") * @ORM\Table(indexes={@ORM\Index(columns={"lft"}),@ORM\Index(columns={"rgt"})}) * @Gedmo\Tree(type="nested") diff --git a/src/PartKeepr/PartBundle/Entity/PartDistributor.php b/src/PartKeepr/PartBundle/Entity/PartDistributor.php index 232c3ef7a..b8ecfac85 100644 --- a/src/PartKeepr/PartBundle/Entity/PartDistributor.php +++ b/src/PartKeepr/PartBundle/Entity/PartDistributor.php @@ -2,16 +2,23 @@ namespace PartKeepr\PartBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DistributorBundle\Entity\Distributor; use PartKeepr\PartBundle\Exceptions\PackagingUnitOutOfRangeException; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * This class represents the link between a part and a distributor. * + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity */ class PartDistributor extends BaseEntity diff --git a/src/PartKeepr/PartBundle/Entity/PartManufacturer.php b/src/PartKeepr/PartBundle/Entity/PartManufacturer.php index b02394f71..638a7e095 100644 --- a/src/PartKeepr/PartBundle/Entity/PartManufacturer.php +++ b/src/PartKeepr/PartBundle/Entity/PartManufacturer.php @@ -2,12 +2,20 @@ namespace PartKeepr\PartBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\ManufacturerBundle\Entity\Manufacturer; use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity */ class PartManufacturer extends BaseEntity diff --git a/src/PartKeepr/PartBundle/Entity/PartMeasurementUnit.php b/src/PartKeepr/PartBundle/Entity/PartMeasurementUnit.php index 4cd0cec61..9627b3662 100644 --- a/src/PartKeepr/PartBundle/Entity/PartMeasurementUnit.php +++ b/src/PartKeepr/PartBundle/Entity/PartMeasurementUnit.php @@ -3,15 +3,31 @@ namespace PartKeepr\PartBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * This entity represents a part measurement unit. Typical measurement units are pieces, centimeters etc. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "custom_put"={"route_name"="PartMeasurementUnitSetDefault","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity * @ORM\Table(name="PartUnit") * @TargetService(uri="/api/part_measurement_units") diff --git a/src/PartKeepr/PartBundle/Entity/PartParameter.php b/src/PartKeepr/PartBundle/Entity/PartParameter.php index 31ceed13d..39a5985a7 100644 --- a/src/PartKeepr/PartBundle/Entity/PartParameter.php +++ b/src/PartKeepr/PartBundle/Entity/PartParameter.php @@ -2,7 +2,9 @@ namespace PartKeepr\PartBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\SiPrefixBundle\Entity\SiPrefix; use PartKeepr\UnitBundle\Entity\Unit; @@ -12,6 +14,12 @@ * This object represents a parameter. Each parameter can have an unit (defined by the class "Unit") associated with * a numeric value. * + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity @ORM\HasLifecycleCallbacks */ class PartParameter extends BaseEntity diff --git a/src/PartKeepr/PartBundle/Resources/config/actions.xml b/src/PartKeepr/PartBundle/Resources/config/actions.xml index 24ed4ae03..c3032cab7 100644 --- a/src/PartKeepr/PartBundle/Resources/config/actions.xml +++ b/src/PartKeepr/PartBundle/Resources/config/actions.xml @@ -5,38 +5,57 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> + - + + - - + + + + + - + + + + - + + + + - + + + + - + + + + - + + + diff --git a/src/PartKeepr/ProjectBundle/Controller/ProjectReportController.php b/src/PartKeepr/ProjectBundle/Controller/ProjectReportController.php index 01268408e..bf5757563 100644 --- a/src/PartKeepr/ProjectBundle/Controller/ProjectReportController.php +++ b/src/PartKeepr/ProjectBundle/Controller/ProjectReportController.php @@ -2,16 +2,19 @@ namespace PartKeepr\ProjectBundle\Controller; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; use FOS\RestBundle\Controller\FOSRestController; use PartKeepr\ProjectBundle\Entity\ProjectPart; use PartKeepr\ProjectBundle\Entity\Report; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class ProjectReportController extends FOSRestController { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @param Request $request @@ -20,13 +23,21 @@ class ProjectReportController extends FOSRestController * * @return \Symfony\Component\HttpFoundation\Response */ + /** + * @Route( + * name="ProjectReportPost", + * path="/reports", + * defaults={"_api_resource_class"=Report::class, "_api_collection_operation_name"="custom_post"}, + * methods={"POST"} + * ) + **/ public function createReportAction(Request $request) { /** * @var ResourceInterface */ - list($resourceType, $format) = $this->extractAttributes($request); - $report = $this->get("api.serializer")->deserialize( + list($resourceType, $format) = RequestAttributesExtractor::extractAttributes($request); + $report = $this->get("api_platform.serializer")->deserialize( $request->getContent(), $resourceType->getEntityClass(), $format, @@ -72,6 +83,14 @@ public function createReportAction(Request $request) * * @return \Symfony\Component\HttpFoundation\Response */ + /** + * @Route( + * name="ProjectReportGet", + * path="/reports/{id}", + * defaults={"_api_resource_class"=Report::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ public function getReportAction(Request $request, $id) { /** diff --git a/src/PartKeepr/ProjectBundle/Entity/Project.php b/src/PartKeepr/ProjectBundle/Entity/Project.php index 291309159..3e7d6d84a 100644 --- a/src/PartKeepr/ProjectBundle/Entity/Project.php +++ b/src/PartKeepr/ProjectBundle/Entity/Project.php @@ -3,16 +3,26 @@ namespace PartKeepr\ProjectBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\AuthBundle\Entity\User; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\UploadedFileBundle\Annotation\UploadedFileCollection; use Symfony\Component\Serializer\Annotation\Groups; + /** * Represents a project. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService("/api/projects") */ diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectAttachment.php b/src/PartKeepr/ProjectBundle/Entity/ProjectAttachment.php index 0c357b41e..609f51832 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ProjectAttachment.php +++ b/src/PartKeepr/ProjectBundle/Entity/ProjectAttachment.php @@ -2,13 +2,31 @@ namespace PartKeepr\ProjectBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; /** * Holds a project attachment. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="ProjectAttachmentGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_mime"={"route_name"="ProjectAttachmentMimeTypeIcon","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_image"={"route_name"="ProjectAttachmentGetImage","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity * @TargetService("/api/project_attachments") **/ diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php b/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php index 49e8db47f..b72435498 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php +++ b/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php @@ -2,17 +2,25 @@ namespace PartKeepr\ProjectBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\ByReference; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\PartBundle\Entity\Part; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * Represents a project part. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService("/api/project_parts") */ diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectRun.php b/src/PartKeepr/ProjectBundle/Entity/ProjectRun.php index c5910dae2..5efd291e7 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ProjectRun.php +++ b/src/PartKeepr/ProjectBundle/Entity/ProjectRun.php @@ -3,7 +3,9 @@ namespace PartKeepr\ProjectBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; @@ -11,6 +13,13 @@ /** * Represents a project. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService("/api/project_runs") */ diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectRunPart.php b/src/PartKeepr/ProjectBundle/Entity/ProjectRunPart.php index 0bda3f157..d5c533885 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ProjectRunPart.php +++ b/src/PartKeepr/ProjectBundle/Entity/ProjectRunPart.php @@ -2,7 +2,9 @@ namespace PartKeepr\ProjectBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\PartBundle\Entity\Part; use Symfony\Component\Serializer\Annotation\Groups; @@ -10,6 +12,13 @@ /** * Represents a project run part. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity */ class ProjectRunPart extends BaseEntity diff --git a/src/PartKeepr/ProjectBundle/Entity/Report.php b/src/PartKeepr/ProjectBundle/Entity/Report.php index a20cb7ca0..1ad1f3f9b 100644 --- a/src/PartKeepr/ProjectBundle/Entity/Report.php +++ b/src/PartKeepr/ProjectBundle/Entity/Report.php @@ -3,7 +3,9 @@ namespace PartKeepr\ProjectBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\PartBundle\Entity\Part; @@ -12,6 +14,25 @@ /** * Represents a project part. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default", "readonly"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * collectionOperations={ + * "get"={"method"="GET"}, + * "custom_post"={"route_name"="ProjectReportPost","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "custom_get"={"route_name"="ProjectReportGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"} + * } + * ) * @ORM\Entity * @TargetService("/api/reports") */ diff --git a/src/PartKeepr/ProjectBundle/Entity/ReportPart.php b/src/PartKeepr/ProjectBundle/Entity/ReportPart.php index e5d4742fa..b1497c21c 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ReportPart.php +++ b/src/PartKeepr/ProjectBundle/Entity/ReportPart.php @@ -3,7 +3,9 @@ namespace PartKeepr\ProjectBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DistributorBundle\Entity\Distributor; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; @@ -14,6 +16,13 @@ /** * Represents a project part. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService("/api/project_report_parts") */ diff --git a/src/PartKeepr/ProjectBundle/Entity/ReportProject.php b/src/PartKeepr/ProjectBundle/Entity/ReportProject.php index f62566414..5cc19dbd2 100644 --- a/src/PartKeepr/ProjectBundle/Entity/ReportProject.php +++ b/src/PartKeepr/ProjectBundle/Entity/ReportProject.php @@ -2,15 +2,23 @@ namespace PartKeepr\ProjectBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * Represents one project and the quantity. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService("/api/project_report_projects") */ diff --git a/src/PartKeepr/RESTBundle/Resources/config/request.xml b/src/PartKeepr/RESTBundle/Resources/config/request.xml index 4c7997bc6..fae5f93b6 100644 --- a/src/PartKeepr/RESTBundle/Resources/config/request.xml +++ b/src/PartKeepr/RESTBundle/Resources/config/request.xml @@ -1,25 +1,34 @@ - - - FOS\RestBundle\Request\ParamFetcher + FOS\RestBundle\Request\ParamFetcherInterface PartKeepr\RESTBundle\Request\ParamReader - - + + + + - - + + + + + + + + + + + diff --git a/src/PartKeepr/SetupBundle/Controller/CacheWarmupSetupController.php b/src/PartKeepr/SetupBundle/Controller/CacheWarmupSetupController.php index 806ef4c65..b6f93a389 100644 --- a/src/PartKeepr/SetupBundle/Controller/CacheWarmupSetupController.php +++ b/src/PartKeepr/SetupBundle/Controller/CacheWarmupSetupController.php @@ -111,7 +111,7 @@ public function intCacheWarmupAction(Request $request) public function cacheWarmupAction(Request $request) { // Clear old cache. We don't do that directly as it could happen that old files are loaded prior clearing the cache - $cacheDir = $this->get('kernel')->getRootDir().'/cache/prod'; + $cacheDir = $this->get('kernel')->getProjectDir().'/var/cache/prod'; $filesystem = $this->get('filesystem'); $filesystem->remove($cacheDir); diff --git a/src/PartKeepr/SetupBundle/Controller/ExistingUserSetupController.php b/src/PartKeepr/SetupBundle/Controller/ExistingUserSetupController.php index 35b2d70fb..2605c0cf9 100644 --- a/src/PartKeepr/SetupBundle/Controller/ExistingUserSetupController.php +++ b/src/PartKeepr/SetupBundle/Controller/ExistingUserSetupController.php @@ -2,10 +2,11 @@ namespace PartKeepr\SetupBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +// use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; class ExistingUserSetupController extends SetupBaseController { diff --git a/src/PartKeepr/SetupBundle/Controller/FileMigrationController.php b/src/PartKeepr/SetupBundle/Controller/FileMigrationController.php index a189df71b..46e444b06 100644 --- a/src/PartKeepr/SetupBundle/Controller/FileMigrationController.php +++ b/src/PartKeepr/SetupBundle/Controller/FileMigrationController.php @@ -2,10 +2,11 @@ namespace PartKeepr\SetupBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +// use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; class FileMigrationController extends SetupBaseController { @@ -44,8 +45,8 @@ public function intMigrateFilesAction(Request $request) $legacyConfig = $this->get('partkeepr.setup.config_service')->legacyConfigParser(); - $legacyFilePath = $this->get('kernel')->getRootDir().'/../data/'; - $legacyImagePath = $this->get('kernel')->getRootDir().'/../data/images/'; + $legacyFilePath = $this->get('kernel')->getProjectDir().'/data/'; + $legacyImagePath = $this->get('kernel')->getProjectDir().'/data/images/'; $legacyFileDirectories = ['FootprintAttachment', 'PartAttachment', 'ProjectAttachment']; diff --git a/src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php b/src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php index c56b9fd16..0dc4b22a9 100644 --- a/src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php +++ b/src/PartKeepr/SetupBundle/Controller/SiPrefixSetupController.php @@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; + class SiPrefixSetupController extends SetupBaseController { /** diff --git a/src/PartKeepr/SetupBundle/Services/ConfigSetupService.php b/src/PartKeepr/SetupBundle/Services/ConfigSetupService.php index 0b49cbbc4..e5dc45fe8 100644 --- a/src/PartKeepr/SetupBundle/Services/ConfigSetupService.php +++ b/src/PartKeepr/SetupBundle/Services/ConfigSetupService.php @@ -65,7 +65,7 @@ public function getConfig($config) 'fr3d_ldap.driver.accountCanonicalForm' => null, 'fr3d_ldap.driver.accountDomainName' => null, 'fr3d_ldap.driver.accountDomainNameShort' => null, - 'fr3d_ldap.user.enabled' => false, +# 'fr3d_ldap.user.enabled' => false, 'fr3d_ldap.user.baseDn' => 'dc=example,dc=com', 'fr3d_ldap.user.filter' => null, 'fr3d_ldap.user.attribute.username' => 'samaccountname', @@ -88,7 +88,7 @@ public function getConfig($config) ]; if (function_exists('apc_fetch')) { - $parameters['cache.dunglas'] = 'api.mapping.cache.apc'; + $parameters['cache.dunglas'] = 'api_platform.mapping.cache.apc'; $parameters['cache.doctrine'] = 'apc'; } diff --git a/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php b/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php index a7e1097eb..4ea07f355 100644 --- a/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php +++ b/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php @@ -2,17 +2,25 @@ namespace PartKeepr\SiPrefixBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * Represents an SI Prefix. * * @link http://en.wikipedia.org/wiki/Metric_prefix * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/si_prefixes") */ diff --git a/src/PartKeepr/StatisticBundle/Controller/StatisticController.php b/src/PartKeepr/StatisticBundle/Controller/StatisticController.php index 445e6f66f..e0931e8e6 100644 --- a/src/PartKeepr/StatisticBundle/Controller/StatisticController.php +++ b/src/PartKeepr/StatisticBundle/Controller/StatisticController.php @@ -5,7 +5,7 @@ use FOS\RestBundle\Controller\Annotations\QueryParam; use FOS\RestBundle\Controller\Annotations\View; use FOS\RestBundle\Controller\FOSRestController; -use FOS\RestBundle\Request\ParamFetcher; +use FOS\RestBundle\Request\ParamFetcherInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration as Routing; class StatisticController extends FOSRestController diff --git a/src/PartKeepr/StockBundle/Entity/StockEntry.php b/src/PartKeepr/StockBundle/Entity/StockEntry.php index aba8f4484..f182c5b2a 100644 --- a/src/PartKeepr/StockBundle/Entity/StockEntry.php +++ b/src/PartKeepr/StockBundle/Entity/StockEntry.php @@ -2,7 +2,9 @@ namespace PartKeepr\StockBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\AuthBundle\Entity\User; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; @@ -10,6 +12,13 @@ use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @ORM\HasLifecycleCallbacks * @TargetService(uri="/api/stock_entries") diff --git a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocation.php b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocation.php index b9cbed65a..800b676c8 100644 --- a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocation.php +++ b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocation.php @@ -2,13 +2,23 @@ namespace PartKeepr\StorageLocationBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\UploadedFileBundle\Annotation\UploadedFile; use Symfony\Component\Serializer\Annotation\Groups; -/** @ORM\Entity +/** + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) + * @ORM\Entity * @TargetService(uri="/api/storage_locations") */ class StorageLocation extends BaseEntity diff --git a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationCategory.php b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationCategory.php index d36e162c7..966d7d2ce 100644 --- a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationCategory.php +++ b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationCategory.php @@ -3,7 +3,9 @@ namespace PartKeepr\StorageLocationBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use Gedmo\Mapping\Annotation as Gedmo; use PartKeepr\CategoryBundle\Entity\AbstractCategory; use PartKeepr\CategoryBundle\Entity\CategoryPathInterface; @@ -11,6 +13,26 @@ use Symfony\Component\Serializer\Annotation\Groups; /** + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default", "tree"}}, + * "denormalization_context"={"groups"={"default", "tree"}} + * }, + * collectionOperations={ + * "get"={"method"="GET"}, + * "get_root"={"route_name"="StorageLocationCategoryGetRoot"}, + * "post"={"method"="POST"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "put"={"method"="PUT"}, + * "delete"={"method"="DELETE"}, + * "move"={"route_name"="StorageLocationCategoryMove"} + * } + * ) * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository") * @Gedmo\Tree(type="nested") * @ORM\Table(indexes={@ORM\Index(columns={"lft"}),@ORM\Index(columns={"rgt"})}) diff --git a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationImage.php b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationImage.php index cf9954f54..532652c09 100644 --- a/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationImage.php +++ b/src/PartKeepr/StorageLocationBundle/Entity/StorageLocationImage.php @@ -2,12 +2,28 @@ namespace PartKeepr\StorageLocationBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\ImageBundle\Entity\Image; /** * Holds a storage location image. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="StorageLocationGetImage","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity **/ class StorageLocationImage extends Image diff --git a/src/PartKeepr/SystemPreferenceBundle/Action/DeletePreferenceAction.php b/src/PartKeepr/SystemPreferenceBundle/Action/DeletePreferenceAction.php index 0122dfe48..caa9f4b7a 100644 --- a/src/PartKeepr/SystemPreferenceBundle/Action/DeletePreferenceAction.php +++ b/src/PartKeepr/SystemPreferenceBundle/Action/DeletePreferenceAction.php @@ -2,18 +2,20 @@ namespace PartKeepr\SystemPreferenceBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; +// use ApiPlatform\Core\Action\ActionUtilTrait; + +use ApiPlatform\Core\Exception\RuntimeException; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\SystemPreferenceBundle\Service\SystemPreferenceService; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * Returns the tree root node. */ class DeletePreferenceAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var SystemPreferenceService @@ -34,8 +36,18 @@ public function __construct( * @throws \Exception If the format is invalid * @throws RuntimeException|RootNodeNotFoundException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + + /** + * @Route( + * name="PartKeeprSystemPreferenceDelete", + * path="/system_preferences", + * defaults={"_api_resource_class"=SystemPreference::class, "_api_item_operation_name"="delete_preference"}, + * methods={"DELETE"} + * ) + **/ + public function __invoke(Request $request) { if ($request->request->has('preferenceKey')) { diff --git a/src/PartKeepr/SystemPreferenceBundle/Action/GetPreferencesAction.php b/src/PartKeepr/SystemPreferenceBundle/Action/GetPreferencesAction.php index bc12179fc..b61e2aaf3 100644 --- a/src/PartKeepr/SystemPreferenceBundle/Action/GetPreferencesAction.php +++ b/src/PartKeepr/SystemPreferenceBundle/Action/GetPreferencesAction.php @@ -2,21 +2,24 @@ namespace PartKeepr\SystemPreferenceBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Exception\RuntimeException; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Exception\RuntimeException; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\SystemPreferenceBundle\Service\SystemPreferenceService; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Serializer\Serializer; +use Symfony\Component\Routing\Annotation\Route; /** * Returns the tree root node. */ class GetPreferencesAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var SystemPreferenceService @@ -45,6 +48,14 @@ public function __construct( * * @return JsonResponse */ + /** + * @Route( + * name="PartKeeprSystemPreferenceGet", + * path="/system_preferences", + * defaults={"_api_resource_class"=SystemPreference::class, "_api_collection_operation_name"="get_preferences"}, + * methods={"GET"} + * ) + **/ public function __invoke(Request $request) { $preferences = $this->systemPreferenceService->getPreferences(); @@ -52,7 +63,7 @@ public function __invoke(Request $request) /** * @var ResourceInterface */ - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); /* * @var ResourceInterface $resourceType diff --git a/src/PartKeepr/SystemPreferenceBundle/Action/SetPreferenceAction.php b/src/PartKeepr/SystemPreferenceBundle/Action/SetPreferenceAction.php index 7d2a5410b..9afb30abe 100644 --- a/src/PartKeepr/SystemPreferenceBundle/Action/SetPreferenceAction.php +++ b/src/PartKeepr/SystemPreferenceBundle/Action/SetPreferenceAction.php @@ -2,21 +2,24 @@ namespace PartKeepr\SystemPreferenceBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; -use Dunglas\ApiBundle\Exception\RuntimeException; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; +use ApiPlatform\Core\Exception\RuntimeException; use PartKeepr\CategoryBundle\Exception\RootNodeNotFoundException; use PartKeepr\SystemPreferenceBundle\Service\SystemPreferenceService; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Serializer\Serializer; +use Symfony\Component\Routing\Annotation\Route; /** * Returns the tree root node. */ class SetPreferenceAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var SystemPreferenceService @@ -46,6 +49,22 @@ public function __construct( * * @return JsonResponse */ + /** + * @Route( + * name="PartKeeprSystemPreferenceSet", + * path="/system_preferences", + * defaults={"_api_resource_class"=SystemPreference::class, "_api_collection_operation_name"="set_preference"}, + * methods={"POST"} + * ) + **/ + /** + * @Route( + * name="PartKeeprSystemPreferenceSet", + * path="/system_preferences", + * defaults={"_api_resource_class"=SystemPreference::class, "_api_collection_operation_name"="set_preference"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request) { $data = json_decode($request->getContent()); @@ -62,7 +81,7 @@ public function __invoke(Request $request) /** * @var ResourceInterface */ - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $serializedData = $this->serializer->normalize( $preference, diff --git a/src/PartKeepr/SystemPreferenceBundle/Entity/SystemPreference.php b/src/PartKeepr/SystemPreferenceBundle/Entity/SystemPreference.php index 0f5f7d39d..5fa78066d 100644 --- a/src/PartKeepr/SystemPreferenceBundle/Entity/SystemPreference.php +++ b/src/PartKeepr/SystemPreferenceBundle/Entity/SystemPreference.php @@ -2,7 +2,9 @@ namespace PartKeepr\SystemPreferenceBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\DoctrineReflectionBundle\Annotation\IgnoreIds; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; @@ -15,6 +17,22 @@ * * Note that values are stored internally as serialized PHP values to keep their type. * + * @ApiResource( + * attributes={ + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * collectionOperations={ + * "get_preferences"={"route_name"="PartKeeprSystemPreferenceGet"}, + * "set_preference"={"route_name"="PartKeeprSystemPreferenceSet"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "delete_preference"={"route_name"="PartKeeprSystemPreferenceDelete"} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/system_preferences") * @IgnoreIds() diff --git a/src/PartKeepr/SystemPreferenceBundle/Resources/config/actions.xml b/src/PartKeepr/SystemPreferenceBundle/Resources/config/actions.xml index b960906d6..3bda72290 100644 --- a/src/PartKeepr/SystemPreferenceBundle/Resources/config/actions.xml +++ b/src/PartKeepr/SystemPreferenceBundle/Resources/config/actions.xml @@ -8,11 +8,11 @@ - + - + diff --git a/src/PartKeepr/TipOfTheDayBundle/Action/GetTipHistoryCollectionAction.php b/src/PartKeepr/TipOfTheDayBundle/Action/GetTipHistoryCollectionAction.php index c2682787e..7ba43e975 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Action/GetTipHistoryCollectionAction.php +++ b/src/PartKeepr/TipOfTheDayBundle/Action/GetTipHistoryCollectionAction.php @@ -2,16 +2,19 @@ namespace PartKeepr\TipOfTheDayBundle\Action; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Services\UserService; use PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDayHistory; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class GetTipHistoryCollectionAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -36,11 +39,19 @@ public function __construct(DataProviderInterface $dataProvider, UserService $us * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="TipHistoriesGet", + * path="/tip_of_the_day_histories", + * defaults={"_api_resource_class"=TipOfTheDayHistory::class, "_api_collection_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ public function __invoke(Request $request) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $collection = $this->dataProvider->getCollection($resourceType); $user = $this->userService->getUser(); diff --git a/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipReadAction.php b/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipReadAction.php index ac686f1e6..b901afa60 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipReadAction.php +++ b/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipReadAction.php @@ -2,10 +2,14 @@ namespace PartKeepr\TipOfTheDayBundle\Action; +use Symfony\Component\Routing\Annotation\Route; use Doctrine\ORM\EntityManager; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; -use Dunglas\ApiBundle\Model\DataProviderInterface; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Exception\RuntimeException; +use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use PartKeepr\AuthBundle\Services\UserService; use PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDay; use PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDayHistory; @@ -13,7 +17,7 @@ class MarkTipReadAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var DataProviderInterface @@ -48,11 +52,19 @@ public function __construct( * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="TipMarkRead", + * path="/tip_of_the_days/{id}/markTipRead", + * defaults={"_api_resource_class"=TipOfTheDay, "_api_item_operation_name"="mark_read"}, + * methods={"PUT"} + * ) + **/ public function __invoke(Request $request, $id) { - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $tip = $this->getItem($this->dataProvider, $resourceType, $id); diff --git a/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipsAsUnreadAction.php b/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipsAsUnreadAction.php index b1d43135f..290775844 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipsAsUnreadAction.php +++ b/src/PartKeepr/TipOfTheDayBundle/Action/MarkTipsAsUnreadAction.php @@ -2,16 +2,19 @@ namespace PartKeepr\TipOfTheDayBundle\Action; +use Symfony\Component\Routing\Annotation\Route; use Doctrine\ORM\EntityManager; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Exception\RuntimeException; + +// use ApiPlatform\Core\Action\ActionUtilTrait; + +use ApiPlatform\Core\Exception\RuntimeException; use PartKeepr\AuthBundle\Services\UserService; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class MarkTipsAsUnreadAction { - use ActionUtilTrait; +// use ActionUtilTrait; /** * @var EntityManager @@ -36,8 +39,16 @@ public function __construct(EntityManager $entityManager, UserService $userServi * * @throws RuntimeException * - * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable + * @return array|\ApiPlatform\Core\Model\PaginatorInterface|\Traversable */ + /** + * @Route( + * name="TipMarkAllUnrad", + * path="/tip_of_the_days/markAllTipsAsUnread", + * defaults={"_api_resource_class"=TipOfTheDay, "_api_collection_operation_name"="mark_all_unread"}, + * methods={"POST"} + * ) + **/ public function __invoke(Request $request) { $dql = "DELETE FROM PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDayHistory th WHERE th.user = :user"; diff --git a/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDay.php b/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDay.php index dff776d83..4221c5866 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDay.php +++ b/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDay.php @@ -2,7 +2,9 @@ namespace PartKeepr\TipOfTheDayBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use Symfony\Component\Serializer\Annotation\Groups; @@ -16,6 +18,25 @@ * * Note: If you wish to link against a tip of the day, do it by name and not by id! * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * collectionOperations={ + * "get"={"method"="GET"}, + * "mark_all_unread"={"route_name"="TipMarkAllUnrad"}, + * "post"={"method"="POST"} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "mark_read"={"route_name"="TipMarkRead"} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/tip_of_the_days") **/ diff --git a/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDayHistory.php b/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDayHistory.php index 0b2f65419..af2de82a6 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDayHistory.php +++ b/src/PartKeepr/TipOfTheDayBundle/Entity/TipOfTheDayHistory.php @@ -2,7 +2,9 @@ namespace PartKeepr\TipOfTheDayBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\AuthBundle\Entity\User; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; @@ -13,6 +15,16 @@ * * This entity stores each tip of the day the user has already seen. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * }, + * collectionOperations={ + * "custom_get"={"route_name"="TipHistoriesGet"} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/tip_of_the_day_histories") **/ diff --git a/src/PartKeepr/TipOfTheDayBundle/Resources/config/actions.xml b/src/PartKeepr/TipOfTheDayBundle/Resources/config/actions.xml index 181aa4bcf..86e8c4d95 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Resources/config/actions.xml +++ b/src/PartKeepr/TipOfTheDayBundle/Resources/config/actions.xml @@ -6,7 +6,9 @@ - + + + @@ -17,7 +19,9 @@ - + + + diff --git a/src/PartKeepr/UnitBundle/Entity/Unit.php b/src/PartKeepr/UnitBundle/Entity/Unit.php index 613bbb954..7bb10d242 100644 --- a/src/PartKeepr/UnitBundle/Entity/Unit.php +++ b/src/PartKeepr/UnitBundle/Entity/Unit.php @@ -3,16 +3,24 @@ namespace PartKeepr\UnitBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; use PartKeepr\SiPrefixBundle\Entity\SiPrefix; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; /** * This object represents an unit. Units can be: Volt, Hertz etc. * + * @ApiResource( + * attributes={ + * "filters": {"@doctrine_reflection_service.search_filter"}, + * "normalization_context"={"groups"={"default"}}, + * "denormalization_context"={"groups"={"default"}} + * } + * ) * @ORM\Entity * @TargetService(uri="/api/units") **/ diff --git a/src/PartKeepr/UploadedFileBundle/Controller/FileController.php b/src/PartKeepr/UploadedFileBundle/Controller/FileController.php index 90ff58747..3f576ea71 100644 --- a/src/PartKeepr/UploadedFileBundle/Controller/FileController.php +++ b/src/PartKeepr/UploadedFileBundle/Controller/FileController.php @@ -2,6 +2,8 @@ namespace PartKeepr\UploadedFileBundle\Controller; +use Symfony\Component\Routing\Annotation\Route; + use Doctrine\ORM\EntityManager; use Gaufrette\Exception\FileNotFound; use PartKeepr\UploadedFileBundle\Entity\UploadedFile; @@ -17,6 +19,38 @@ abstract class FileController extends Controller * * @return Response */ + /** + * @Route( + * name="ProjectAttachmentMimeTypeIcon", + * path="/project_attachments/{id}/getMimeTypeIcon", + * defaults={"_api_resource_class"=ProjectAttachment::class, "_api_item_operation_name"="custom_get_mime"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="TemporaryFileGetMimeTypeIcon", + * path="/temp_uploaded_files/{id}/getMimeTypeIcon", + * defaults={"_api_resource_class"=TempUploadedFile::class, "_api_item_operation_name"="custom_get_mimetype"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="PartAttachmentMimeTypeIcon", + * path="/part_attachments/{id}/getMimeTypeIcon", + * defaults={"_api_resource_class"=PartAttachment::class, "_api_item_operation_name"="custom_get_mime"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="FootprintAttachmentMimeTypeIcon", + * path="/footprint_attachments/{id}/getMimeTypeIcon", + * defaults={"_api_resource_class"=FootprintImage::class, "_api_item_operation_name"="custom_get_mime"}, + * methods={"GET"} + * ) + **/ public function getMimeTypeIconAction($id) { /** @@ -41,6 +75,38 @@ public function getMimeTypeIconAction($id) * * @return Response */ + /** + * @Route( + * name="ProjectAttachmentGet", + * path="/project_attachments/{id}/getFile", + * defaults={"_api_resource_class"=ProjectAttachment::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="TemporaryFileGet", + * path="/temp_uploaded_files/{id}/getFile", + * defaults={"_api_resource_class"=TempUploadedFile::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="PartAttachmentGet", + * path="/part_attachments/{id}/getFile", + * defaults={"_api_resource_class"=PartAttachment::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ + /** + * @Route( + * name="FootprintAttachmentGet", + * path="/footprint_attachments/{id}/getFile", + * defaults={"_api_resource_class"=FootprintImage::class, "_api_item_operation_name"="custom_get"}, + * methods={"GET"} + * ) + **/ public function getFileAction($id) { /** diff --git a/src/PartKeepr/UploadedFileBundle/Controller/TemporaryFileController.php b/src/PartKeepr/UploadedFileBundle/Controller/TemporaryFileController.php index 1c2de3eb7..0d43d13ac 100644 --- a/src/PartKeepr/UploadedFileBundle/Controller/TemporaryFileController.php +++ b/src/PartKeepr/UploadedFileBundle/Controller/TemporaryFileController.php @@ -2,8 +2,12 @@ namespace PartKeepr\UploadedFileBundle\Controller; -use Dunglas\ApiBundle\Action\ActionUtilTrait; -use Dunglas\ApiBundle\Api\ResourceInterface; +use Symfony\Component\Routing\Annotation\Route; + +//use ApiPlatform\Core\Action\ActionUtilTrait; +use ApiPlatform\Core\Util\RequestAttributesExtractor; + +use ApiPlatform\Core\Api\ResourceInterface; use FOS\RestBundle\Controller\Annotations\RequestParam; use FOS\RestBundle\Controller\Annotations\View; use Nelmio\ApiDocBundle\Annotation\ApiDoc; @@ -17,7 +21,7 @@ class TemporaryFileController extends FileController { - use ActionUtilTrait; +// use ActionUtilTrait; /** * Handles a temporary file upload. @@ -32,6 +36,14 @@ class TemporaryFileController extends FileController * * @return JsonResponse The JSON response from the temporary file upload */ + /** + * @Route( + * name="TemporaryFileUpload", + * path="/temp_uploaded_files/upload", + * defaults={"_api_resource_class"=TempUploadedFile::class, "_api_collection_operation_name"="custom_post"}, + * methods={"POST"} + * ) + **/ public function uploadAction(Request $request) { $uploadedFile = new TempUploadedFile(); @@ -85,7 +97,7 @@ public function uploadAction(Request $request) /** * @var ResourceInterface */ - list($resourceType) = $this->extractAttributes($request); + list($resourceType) = RequestAttributesExtractor::extractAttributes($request); $serializedData = $this->get('serializer')->normalize( $uploadedFile, @@ -103,6 +115,14 @@ public function uploadAction(Request $request) * * @return Response */ + /** + * @Route( + * name="TemporaryFileUploadWebcam", + * path="/temp_uploaded_files/webcamUpload", + * defaults={"_api_resource_class"=TempUploadedFile::class, "_api_collection_operation_name"="custom_post_webcam"}, + * methods={"POST"} + * ) + **/ public function webcamUploadAction(Request $request) { $file = new TempUploadedFile(); diff --git a/src/PartKeepr/UploadedFileBundle/Entity/TempUploadedFile.php b/src/PartKeepr/UploadedFileBundle/Entity/TempUploadedFile.php index 73ded9a9d..060ac399e 100644 --- a/src/PartKeepr/UploadedFileBundle/Entity/TempUploadedFile.php +++ b/src/PartKeepr/UploadedFileBundle/Entity/TempUploadedFile.php @@ -2,12 +2,29 @@ namespace PartKeepr\UploadedFileBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * Represents a temporary file. Temporary files are used when * a user uploaded a file, but not attached it to an entity. * + * @ApiResource( + * collectionOperations={ + * "post"={"method"="POST"}, + * "custom_post"={"route_name"="TemporaryFileUpload","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_post_webcam"={"route_name"="TemporaryFileUploadWebcam","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * }, + * itemOperations={ + * "swagger"= { + * "method"="GET", + * }, + * "get"={"method"="GET"}, + * "custom_get"={"route_name"="TemporaryFileGet","hydra_context"={"title"="A custom operation","returns"="xmls:string"}}, + * "custom_get_mimetype"={"route_name"="TemporaryFileGetMimeTypeIcon","hydra_context"={"title"="A custom operation","returns"="xmls:string"}} + * } + * ) * @ORM\Entity */ class TempUploadedFile extends UploadedFile diff --git a/src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php b/src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php index 8bf0d4472..0aac172f1 100644 --- a/src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php +++ b/src/PartKeepr/UploadedFileBundle/Entity/UploadedFile.php @@ -2,7 +2,9 @@ namespace PartKeepr\UploadedFileBundle\Entity; +use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; use PartKeepr\CoreBundle\Entity\BaseEntity; use Ramsey\Uuid\Uuid; use Symfony\Component\Serializer\Annotation\Groups; diff --git a/src/PartKeepr/UploadedFileBundle/EventListener/TemporaryFileEventListener.php b/src/PartKeepr/UploadedFileBundle/EventListener/TemporaryFileEventListener.php index cef2fe6d1..059f1823c 100644 --- a/src/PartKeepr/UploadedFileBundle/EventListener/TemporaryFileEventListener.php +++ b/src/PartKeepr/UploadedFileBundle/EventListener/TemporaryFileEventListener.php @@ -3,7 +3,7 @@ namespace PartKeepr\UploadedFileBundle\EventListener; use Doctrine\Common\Annotations\Reader; -use Dunglas\ApiBundle\Api\IriConverterInterface; +use ApiPlatform\Core\Api\IriConverterInterface; use PartKeepr\ImageBundle\Entity\Image; use PartKeepr\ImageBundle\Entity\TempImage; use PartKeepr\ImageBundle\Services\ImageService; diff --git a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php index 1d199d3e2..d22b8074a 100644 --- a/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php +++ b/src/PartKeepr/UploadedFileBundle/Services/UploadedFileService.php @@ -134,8 +134,8 @@ public function replaceFromURL(UploadedFile $file, $url) $header[] = 'Accept-Language: en-us,en;q=0.5'; $header[] = 'Pragma: '; - $browser = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092510 '; - $browser .= 'Ubuntu/8.04 (hardy) Firefox/3.0.3'; + $browser = 'Mozilla/5.0 (X11; Linux x86_64; rv:83.0) '; + $browser .= 'Gecko/20100101 Firefox/83.0'; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, $browser); diff --git a/src/PartKeepr/AuthBundle/Tests/Controller/DefaultControllerTest.php b/tests/AuthBundle/Controller/DefaultControllerTest.php similarity index 91% rename from src/PartKeepr/AuthBundle/Tests/Controller/DefaultControllerTest.php rename to tests/AuthBundle/Controller/DefaultControllerTest.php index 39ba9b6c1..a65919dcc 100644 --- a/src/PartKeepr/AuthBundle/Tests/Controller/DefaultControllerTest.php +++ b/tests/AuthBundle/Controller/DefaultControllerTest.php @@ -1,10 +1,10 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($user); $client->request('GET', $iri); @@ -103,7 +103,7 @@ public function testSelfChangeUserPassword() ] ); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($user).'/changePassword'; $parameters = [ @@ -156,7 +156,7 @@ public function testUserProtect() $client = static::makeClient(true); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($user); $data = [ @@ -225,7 +225,7 @@ public function testUserWithPreferencesDeletion() $userPreferenceService->setPreference($user, 'foo', 'bar'); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($user); $client->request('DELETE', $iri); diff --git a/src/PartKeepr/CategoryBundle/Tests/AbstractCategoryCreateTest.php b/tests/CategoryBundle/AbstractCategoryCreateTest.php similarity index 81% rename from src/PartKeepr/CategoryBundle/Tests/AbstractCategoryCreateTest.php rename to tests/CategoryBundle/AbstractCategoryCreateTest.php index ab21d731d..1d1956252 100644 --- a/src/PartKeepr/CategoryBundle/Tests/AbstractCategoryCreateTest.php +++ b/tests/CategoryBundle/AbstractCategoryCreateTest.php @@ -1,10 +1,10 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $request = [ 'parent' => $iriConverter->getIriFromItem($rootCategory), 'name' => 'test', ]; - $resource = $this->getContainer()->get('api.resource_collection')->getResourceForEntity($this->getResourceClass()); + $resource = $this->getContainer()->get('api_platform.resource_collection')->getResourceForEntity($this->getResourceClass()); $iri = $iriConverter->getIriFromResource($resource); $client->request( @@ -70,13 +70,13 @@ public function testCreateRootCategory() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $request = [ 'name' => 'test', ]; - $resource = $this->getContainer()->get('api.resource_collection')->getResourceForEntity($this->getResourceClass()); + $resource = $this->getContainer()->get('api_platform.resource_collection')->getResourceForEntity($this->getResourceClass()); $iri = $iriConverter->getIriFromResource($resource); $client->request( diff --git a/src/PartKeepr/CategoryBundle/Tests/AbstractMoveCategoryTest.php b/tests/CategoryBundle/AbstractMoveCategoryTest.php similarity index 88% rename from src/PartKeepr/CategoryBundle/Tests/AbstractMoveCategoryTest.php rename to tests/CategoryBundle/AbstractMoveCategoryTest.php index e2eb38986..83de06bea 100644 --- a/src/PartKeepr/CategoryBundle/Tests/AbstractMoveCategoryTest.php +++ b/tests/CategoryBundle/AbstractMoveCategoryTest.php @@ -1,11 +1,11 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($secondCategory); $iri .= '/move'; diff --git a/src/PartKeepr/CoreBundle/Tests/Fixtures/versions.json b/tests/CoreBundle/Fixtures/versions.json similarity index 100% rename from src/PartKeepr/CoreBundle/Tests/Fixtures/versions.json rename to tests/CoreBundle/Fixtures/versions.json diff --git a/src/PartKeepr/CoreBundle/Tests/SetupWebTestCase.php b/tests/CoreBundle/SetupWebTestCase.php similarity index 96% rename from src/PartKeepr/CoreBundle/Tests/SetupWebTestCase.php rename to tests/CoreBundle/SetupWebTestCase.php index 309a7e827..d7bc21c80 100644 --- a/src/PartKeepr/CoreBundle/Tests/SetupWebTestCase.php +++ b/tests/CoreBundle/SetupWebTestCase.php @@ -6,7 +6,7 @@ * Time: 7:43 PM. */ -namespace PartKeepr\CoreBundle\Tests; +namespace PartKeepr\Tests\CoreBundle; /** * Special WebTestCase which forces to load the AppKernel. This is because the base getKernelClass() method diff --git a/src/PartKeepr/CoreBundle/Tests/SystemInformationTest.php b/tests/CoreBundle/SystemInformationTest.php similarity index 97% rename from src/PartKeepr/CoreBundle/Tests/SystemInformationTest.php rename to tests/CoreBundle/SystemInformationTest.php index a6784e025..3a427c860 100644 --- a/src/PartKeepr/CoreBundle/Tests/SystemInformationTest.php +++ b/tests/CoreBundle/SystemInformationTest.php @@ -1,6 +1,6 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($notice); $ackIri = $iri.'/acknowledge'; diff --git a/src/PartKeepr/CoreBundle/Tests/VersionServiceTest.php b/tests/CoreBundle/VersionServiceTest.php similarity index 96% rename from src/PartKeepr/CoreBundle/Tests/VersionServiceTest.php rename to tests/CoreBundle/VersionServiceTest.php index 701084c8b..a03d3a8f0 100644 --- a/src/PartKeepr/CoreBundle/Tests/VersionServiceTest.php +++ b/tests/CoreBundle/VersionServiceTest.php @@ -1,6 +1,6 @@ getReferenceRepository(); } @@ -56,7 +56,7 @@ public function testEqualFilter() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $this->assertEquals( $iriConverter->getIriFromItem($this->fixtures->getReference("part.1")), @@ -93,7 +93,7 @@ public function testEqualFilterSame() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $this->assertEquals( $iriConverter->getIriFromItem($this->fixtures->getReference("part.1")), @@ -108,7 +108,7 @@ public function testIDReference() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $filter = [ [ @@ -139,7 +139,7 @@ public function testIDReferenceArray() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $filter = [ [ diff --git a/src/PartKeepr/FootprintBundle/Tests/CategoryCreateTest.php b/tests/FootprintBundle/CategoryCreateTest.php similarity index 79% rename from src/PartKeepr/FootprintBundle/Tests/CategoryCreateTest.php rename to tests/FootprintBundle/CategoryCreateTest.php index 09f3f6c12..81259e975 100644 --- a/src/PartKeepr/FootprintBundle/Tests/CategoryCreateTest.php +++ b/tests/FootprintBundle/CategoryCreateTest.php @@ -1,8 +1,8 @@ assertEquals(51, $imageSize[0]); $this->assertEquals(23, $imageSize[1]); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $image = $iriConverter->getItemFromIri($imageId); diff --git a/src/PartKeepr/ManufacturerBundle/Tests/DataFixtures/ManufacturerDataLoader.php b/tests/ManufacturerBundle/DataFixtures/ManufacturerDataLoader.php similarity index 89% rename from src/PartKeepr/ManufacturerBundle/Tests/DataFixtures/ManufacturerDataLoader.php rename to tests/ManufacturerBundle/DataFixtures/ManufacturerDataLoader.php index 1742f45bb..aa7460f4e 100644 --- a/src/PartKeepr/ManufacturerBundle/Tests/DataFixtures/ManufacturerDataLoader.php +++ b/tests/ManufacturerBundle/DataFixtures/ManufacturerDataLoader.php @@ -1,6 +1,6 @@ getReferenceRepository(); } @@ -34,7 +34,7 @@ public function testInternalPartNumberUniqueness() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $part = [ "name" => "foobar", diff --git a/src/PartKeepr/PartBundle/Tests/Issues/DistributorAndManufacturerSearchTest.php b/tests/PartBundle/Issues/DistributorAndManufacturerSearchTest.php similarity index 83% rename from src/PartKeepr/PartBundle/Tests/Issues/DistributorAndManufacturerSearchTest.php rename to tests/PartBundle/Issues/DistributorAndManufacturerSearchTest.php index 68061638d..2e04a1697 100644 --- a/src/PartKeepr/PartBundle/Tests/Issues/DistributorAndManufacturerSearchTest.php +++ b/tests/PartBundle/Issues/DistributorAndManufacturerSearchTest.php @@ -1,9 +1,9 @@ getReferenceRepository(); } @@ -59,7 +59,7 @@ public function testManufacturerFilter() $filter = [ 'property' => 'manufacturers.manufacturer', 'operator' => '=', - 'value' => $this->getContainer()->get('api.iri_converter')->getIriFromItem($manufacturer), + 'value' => $this->getContainer()->get('api_platform.iri_converter')->getIriFromItem($manufacturer), ]; $filters = [$filter]; @@ -67,7 +67,7 @@ public function testManufacturerFilter() $client = static::makeClient(true); $partResource = $this->getContainer()->get('resource.part'); - $iri = $this->getContainer()->get('api.iri_converter')->getIriFromResource($partResource); + $iri = $this->getContainer()->get('api_platform.iri_converter')->getIriFromResource($partResource); $client->request('GET', $iri, ['filter' => json_encode($filters)]); @@ -99,7 +99,7 @@ public function testDistributorFilter() $filter = [ 'property' => 'distributors.distributor', 'operator' => '=', - 'value' => $this->getContainer()->get('api.iri_converter')->getIriFromItem($distributor), + 'value' => $this->getContainer()->get('api_platform.iri_converter')->getIriFromItem($distributor), ]; $filters = [$filter]; @@ -107,7 +107,7 @@ public function testDistributorFilter() $client = static::makeClient(true); $partResource = $this->getContainer()->get('resource.part'); - $iri = $this->getContainer()->get('api.iri_converter')->getIriFromResource($partResource); + $iri = $this->getContainer()->get('api_platform.iri_converter')->getIriFromResource($partResource); $client->request('GET', $iri, ['filter' => json_encode($filters)]); diff --git a/src/PartKeepr/PartBundle/Tests/Issues/StockHistoryLostTest.php b/tests/PartBundle/Issues/StockHistoryLostTest.php similarity index 88% rename from src/PartKeepr/PartBundle/Tests/Issues/StockHistoryLostTest.php rename to tests/PartBundle/Issues/StockHistoryLostTest.php index b652c81ef..13dc54107 100644 --- a/src/PartKeepr/PartBundle/Tests/Issues/StockHistoryLostTest.php +++ b/tests/PartBundle/Issues/StockHistoryLostTest.php @@ -1,9 +1,9 @@ getReferenceRepository(); } @@ -56,7 +56,7 @@ public function testStockHistory() $this->getContainer()->get('doctrine.orm.default_entity_manager')->flush(); - $iriCoverter = $this->getContainer()->get('api.iri_converter'); + $iriCoverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriCoverter->getIriFromItem($part1); $client->request('GET', $iri); diff --git a/src/PartKeepr/PartBundle/Tests/MetaPartTest.php b/tests/PartBundle/MetaPartTest.php similarity index 89% rename from src/PartKeepr/PartBundle/Tests/MetaPartTest.php rename to tests/PartBundle/MetaPartTest.php index 2f385a3e7..553a48d2a 100644 --- a/src/PartKeepr/PartBundle/Tests/MetaPartTest.php +++ b/tests/PartBundle/MetaPartTest.php @@ -1,9 +1,9 @@ getReferenceRepository(); } diff --git a/src/PartKeepr/PartBundle/Tests/MoveActionTest.php b/tests/PartBundle/MoveActionTest.php similarity index 73% rename from src/PartKeepr/PartBundle/Tests/MoveActionTest.php rename to tests/PartBundle/MoveActionTest.php index 7535044a4..09145fcba 100644 --- a/src/PartKeepr/PartBundle/Tests/MoveActionTest.php +++ b/tests/PartBundle/MoveActionTest.php @@ -1,8 +1,8 @@ getReferenceRepository(); } diff --git a/src/PartKeepr/PartBundle/Tests/StockTest.php b/tests/PartBundle/StockTest.php similarity index 91% rename from src/PartKeepr/PartBundle/Tests/StockTest.php rename to tests/PartBundle/StockTest.php index 823e0ae9b..b144c7ecb 100644 --- a/src/PartKeepr/PartBundle/Tests/StockTest.php +++ b/tests/PartBundle/StockTest.php @@ -1,11 +1,11 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($part); $iri .= '/addStock'; @@ -92,7 +92,7 @@ public function testRemoveStock() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($part); $iri .= '/removeStock'; @@ -130,7 +130,7 @@ public function testSetStock() /** * @var IriConverter */ - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($part); $iri .= '/setStock'; diff --git a/src/PartKeepr/ProjectBundle/Tests/ProjectTest.php b/tests/ProjectBundle/ProjectTest.php similarity index 95% rename from src/PartKeepr/ProjectBundle/Tests/ProjectTest.php rename to tests/ProjectBundle/ProjectTest.php index 9801b89f3..b77f9ebf4 100644 --- a/src/PartKeepr/ProjectBundle/Tests/ProjectTest.php +++ b/tests/ProjectBundle/ProjectTest.php @@ -1,9 +1,9 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($project); $client->request( @@ -192,7 +192,7 @@ public function testProjectAttachmentRemoval() 'jsonld' ); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($project); $client->request( @@ -227,7 +227,7 @@ public function testAbsentProjectReference() $project = $this->fixtures->getReference('project'); - $iriConverter = $this->getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($project); $client->request( diff --git a/src/PartKeepr/SetupBundle/Tests/ExistingUsersSetupTest.php b/tests/SetupBundle/ExistingUsersSetupTest.php similarity index 95% rename from src/PartKeepr/SetupBundle/Tests/ExistingUsersSetupTest.php rename to tests/SetupBundle/ExistingUsersSetupTest.php index 51c79f0b9..f91a2f472 100644 --- a/src/PartKeepr/SetupBundle/Tests/ExistingUsersSetupTest.php +++ b/tests/SetupBundle/ExistingUsersSetupTest.php @@ -1,8 +1,8 @@ assertGreaterThan(1, $query->getSingleScalarResult()); $this->markTestSkipped( - 'Synchronization of the tips of the day (PartKeepr\TipOfTheDayBundle\Tests\SyncTipsTest) skipped' + 'Synchronization of the tips of the day (PartKeepr\Tests\TipOfTheDayBundle\SyncTipsTest) skipped' ); } } diff --git a/src/PartKeepr/TipOfTheDayBundle/Tests/TipOfTheDayTest.php b/tests/TipOfTheDayBundle/TipOfTheDayTest.php similarity index 91% rename from src/PartKeepr/TipOfTheDayBundle/Tests/TipOfTheDayTest.php rename to tests/TipOfTheDayBundle/TipOfTheDayTest.php index 3bf511a48..4fd1b28cc 100644 --- a/src/PartKeepr/TipOfTheDayBundle/Tests/TipOfTheDayTest.php +++ b/tests/TipOfTheDayBundle/TipOfTheDayTest.php @@ -1,10 +1,10 @@ getContainer()->get('api.iri_converter'); + $iriConverter = $this->getContainer()->get('api_platform.iri_converter'); $iri = $iriConverter->getIriFromItem($tip); $iri .= '/markTipRead'; diff --git a/src/PartKeepr/UnitBundle/Tests/Model/UnitTest.php b/tests/UnitBundle/Model/UnitTest.php similarity index 94% rename from src/PartKeepr/UnitBundle/Tests/Model/UnitTest.php rename to tests/UnitBundle/Model/UnitTest.php index 6cb977496..0cd11d5d5 100644 --- a/src/PartKeepr/UnitBundle/Tests/Model/UnitTest.php +++ b/tests/UnitBundle/Model/UnitTest.php @@ -1,6 +1,6 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Users of PHP 5.2 should be able to run the requirements checks. + * This is why the file and all classes must be compatible with PHP 5.2+ + * (e.g. not using namespaces and closures). + * + * ************** CAUTION ************** + * + * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of + * the installation/update process. The original file resides in the + * SensioDistributionBundle. + * + * ************** CAUTION ************** + */ + +/** + * Represents a single PHP requirement, e.g. an installed extension. + * It can be a mandatory requirement or an optional recommendation. + * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. + * + * @author Tobias Schultze + */ +class Requirement +{ + private $fulfilled; + private $testMessage; + private $helpText; + private $helpHtml; + private $optional; + + /** + * Constructor that initializes the requirement. + * + * @param bool $fulfilled Whether the requirement is fulfilled + * @param string $testMessage The message for testing the requirement + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement + */ + public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) + { + $this->fulfilled = (bool) $fulfilled; + $this->testMessage = (string) $testMessage; + $this->helpHtml = (string) $helpHtml; + $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; + $this->optional = (bool) $optional; + } + + /** + * Returns whether the requirement is fulfilled. + * + * @return bool true if fulfilled, otherwise false + */ + public function isFulfilled() + { + return $this->fulfilled; + } + + /** + * Returns the message for testing the requirement. + * + * @return string The test message + */ + public function getTestMessage() + { + return $this->testMessage; + } + + /** + * Returns the help text for resolving the problem. + * + * @return string The help text + */ + public function getHelpText() + { + return $this->helpText; + } + + /** + * Returns the help text formatted in HTML. + * + * @return string The HTML help + */ + public function getHelpHtml() + { + return $this->helpHtml; + } + + /** + * Returns whether this is only an optional recommendation and not a mandatory requirement. + * + * @return bool true if optional, false if mandatory + */ + public function isOptional() + { + return $this->optional; + } +} + +/** + * Represents a PHP requirement in form of a php.ini configuration. + * + * @author Tobias Schultze + */ +class PhpIniRequirement extends Requirement +{ + /** + * Constructor that initializes the requirement. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement + */ + public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) + { + $cfgValue = ini_get($cfgName); + + if (is_callable($evaluation)) { + if (null === $testMessage || null === $helpHtml) { + throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); + } + + $fulfilled = call_user_func($evaluation, $cfgValue); + } else { + if (null === $testMessage) { + $testMessage = sprintf('%s %s be %s in php.ini', + $cfgName, + $optional ? 'should' : 'must', + $evaluation ? 'enabled' : 'disabled' + ); + } + + if (null === $helpHtml) { + $helpHtml = sprintf('Set %s to %s in php.ini*.', + $cfgName, + $evaluation ? 'on' : 'off' + ); + } + + $fulfilled = $evaluation == $cfgValue; + } + + parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); + } +} + +/** + * A RequirementCollection represents a set of Requirement instances. + * + * @author Tobias Schultze + */ +class RequirementCollection implements IteratorAggregate +{ + /** + * @var Requirement[] + */ + private $requirements = array(); + + /** + * Gets the current RequirementCollection as an Iterator. + * + * @return Traversable A Traversable interface + */ + public function getIterator() + { + return new ArrayIterator($this->requirements); + } + + /** + * Adds a Requirement. + * + * @param Requirement $requirement A Requirement instance + */ + public function add(Requirement $requirement) + { + $this->requirements[] = $requirement; + } + + /** + * Adds a mandatory requirement. + * + * @param bool $fulfilled Whether the requirement is fulfilled + * @param string $testMessage The message for testing the requirement + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) + { + $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); + } + + /** + * Adds an optional recommendation. + * + * @param bool $fulfilled Whether the recommendation is fulfilled + * @param string $testMessage The message for testing the recommendation + * @param string $helpHtml The help text formatted in HTML for resolving the problem + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) + { + $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); + } + + /** + * Adds a mandatory requirement in form of a php.ini configuration. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) + { + $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); + } + + /** + * Adds an optional recommendation in form of a php.ini configuration. + * + * @param string $cfgName The configuration name used for ini_get() + * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + */ + public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) + { + $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); + } + + /** + * Adds a requirement collection to the current set of requirements. + * + * @param RequirementCollection $collection A RequirementCollection instance + */ + public function addCollection(RequirementCollection $collection) + { + $this->requirements = array_merge($this->requirements, $collection->all()); + } + + /** + * Returns both requirements and recommendations. + * + * @return Requirement[] + */ + public function all() + { + return $this->requirements; + } + + /** + * Returns all mandatory requirements. + * + * @return Requirement[] + */ + public function getRequirements() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns the mandatory requirements that were not met. + * + * @return Requirement[] + */ + public function getFailedRequirements() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && !$req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns all optional recommendations. + * + * @return Requirement[] + */ + public function getRecommendations() + { + $array = array(); + foreach ($this->requirements as $req) { + if ($req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns the recommendations that were not met. + * + * @return Requirement[] + */ + public function getFailedRecommendations() + { + $array = array(); + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && $req->isOptional()) { + $array[] = $req; + } + } + + return $array; + } + + /** + * Returns whether a php.ini configuration is not correct. + * + * @return bool php.ini configuration problem? + */ + public function hasPhpIniConfigIssue() + { + foreach ($this->requirements as $req) { + if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { + return true; + } + } + + return false; + } + + /** + * Returns the PHP configuration file (php.ini) path. + * + * @return string|false php.ini file path + */ + public function getPhpIniConfigPath() + { + return get_cfg_var('cfg_file_path'); + } +} + +/** + * This class specifies all requirements and optional recommendations that + * are necessary to run the Symfony Standard Edition. + * + * @author Tobias Schultze + * @author Fabien Potencier + */ +class SymfonyRequirements extends RequirementCollection +{ + const LEGACY_REQUIRED_PHP_VERSION = '5.3.3'; + const REQUIRED_PHP_VERSION = '5.5.9'; + + /** + * Constructor that initializes the requirements. + */ + public function __construct() + { + /* mandatory requirements follow */ + + $installedPhpVersion = PHP_VERSION; + $requiredPhpVersion = $this->getPhpRequiredVersion(); + + $this->addRecommendation( + $requiredPhpVersion, + 'Vendors should be installed in order to check all requirements.', + 'Run the composer install command.', + 'Run the "composer install" command.' + ); + + if (false !== $requiredPhpVersion) { + $this->addRequirement( + version_compare($installedPhpVersion, $requiredPhpVersion, '>='), + sprintf('PHP version must be at least %s (%s installed)', $requiredPhpVersion, $installedPhpVersion), + sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. + Before using Symfony, upgrade your PHP installation, preferably to the latest version.', + $installedPhpVersion, $requiredPhpVersion), + sprintf('Install PHP %s or newer (installed version is %s)', $requiredPhpVersion, $installedPhpVersion) + ); + } + + $this->addRequirement( + version_compare($installedPhpVersion, '5.3.16', '!='), + 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', + 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' + ); + + $this->addRequirement( + is_dir(__DIR__.'/../vendor/composer'), + 'Vendor libraries must be installed', + 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. '. + 'Then run "php composer.phar install" to install them.' + ); + + $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; + + $this->addRequirement( + is_writable($cacheDir), + 'app/cache/ or var/cache/ directory must be writable', + 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' + ); + + $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; + + $this->addRequirement( + is_writable($logsDir), + 'app/logs/ or var/logs/ directory must be writable', + 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' + ); + + if (version_compare($installedPhpVersion, '7.0.0', '<')) { + $this->addPhpIniRequirement( + 'date.timezone', true, false, + 'date.timezone setting must be set', + 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' + ); + } + + if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) { + $this->addRequirement( + in_array(@date_default_timezone_get(), DateTimeZone::listIdentifiers(), true), + sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), + 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' + ); + } + + $this->addRequirement( + function_exists('iconv'), + 'iconv() must be available', + 'Install and enable the iconv extension.' + ); + + $this->addRequirement( + function_exists('json_encode'), + 'json_encode() must be available', + 'Install and enable the JSON extension.' + ); + + $this->addRequirement( + function_exists('session_start'), + 'session_start() must be available', + 'Install and enable the session extension.' + ); + + $this->addRequirement( + function_exists('ctype_alpha'), + 'ctype_alpha() must be available', + 'Install and enable the ctype extension.' + ); + + $this->addRequirement( + function_exists('token_get_all'), + 'token_get_all() must be available', + 'Install and enable the Tokenizer extension.' + ); + + $this->addRequirement( + function_exists('simplexml_import_dom'), + 'simplexml_import_dom() must be available', + 'Install and enable the SimpleXML extension.' + ); + + if (function_exists('apc_store') && ini_get('apc.enabled')) { + if (version_compare($installedPhpVersion, '5.4.0', '>=')) { + $this->addRequirement( + version_compare(phpversion('apc'), '3.1.13', '>='), + 'APC version must be at least 3.1.13 when using PHP 5.4', + 'Upgrade your APC extension (3.1.13+).' + ); + } else { + $this->addRequirement( + version_compare(phpversion('apc'), '3.0.17', '>='), + 'APC version must be at least 3.0.17', + 'Upgrade your APC extension (3.0.17+).' + ); + } + } + + $this->addPhpIniRequirement('detect_unicode', false); + + if (extension_loaded('suhosin')) { + $this->addPhpIniRequirement( + 'suhosin.executor.include.whitelist', + create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), + false, + 'suhosin.executor.include.whitelist must be configured correctly in php.ini', + 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' + ); + } + + if (extension_loaded('xdebug')) { + $this->addPhpIniRequirement( + 'xdebug.show_exception_trace', false, true + ); + + $this->addPhpIniRequirement( + 'xdebug.scream', false, true + ); + + $this->addPhpIniRecommendation( + 'xdebug.max_nesting_level', + create_function('$cfgValue', 'return $cfgValue > 100;'), + true, + 'xdebug.max_nesting_level should be above 100 in php.ini', + 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' + ); + } + + $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; + + $this->addRequirement( + null !== $pcreVersion, + 'PCRE extension must be available', + 'Install the PCRE extension (version 8.0+).' + ); + + if (extension_loaded('mbstring')) { + $this->addPhpIniRequirement( + 'mbstring.func_overload', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'string functions should not be overloaded', + 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' + ); + } + + /* optional recommendations follow */ + + if (file_exists(__DIR__.'/../vendor/composer')) { + require_once __DIR__.'/../vendor/autoload.php'; + + try { + $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); + + $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); + } catch (ReflectionException $e) { + $contents = ''; + } + $this->addRecommendation( + file_get_contents(__FILE__) === $contents, + 'Requirements file should be up-to-date', + 'Your requirements file is outdated. Run composer install and re-check your configuration.' + ); + } + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.3.4', '>='), + 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', + 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.3.8', '>='), + 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', + 'Install PHP 5.3.8 or newer if your project uses annotations.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.4.0', '!='), + 'You should not use PHP 5.4.0 due to the PHP bug #61453', + 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' + ); + + $this->addRecommendation( + version_compare($installedPhpVersion, '5.4.11', '>='), + 'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)', + 'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.' + ); + + $this->addRecommendation( + (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<')) + || + version_compare($installedPhpVersion, '5.4.8', '>='), + 'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909', + 'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.' + ); + + if (null !== $pcreVersion) { + $this->addRecommendation( + $pcreVersion >= 8.0, + sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), + 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' + ); + } + + $this->addRecommendation( + class_exists('DomDocument'), + 'PHP-DOM and PHP-XML modules should be installed', + 'Install and enable the PHP-DOM and the PHP-XML modules.' + ); + + $this->addRecommendation( + function_exists('mb_strlen'), + 'mb_strlen() should be available', + 'Install and enable the mbstring extension.' + ); + + $this->addRecommendation( + function_exists('utf8_decode'), + 'utf8_decode() should be available', + 'Install and enable the XML extension.' + ); + + $this->addRecommendation( + function_exists('filter_var'), + 'filter_var() should be available', + 'Install and enable the filter extension.' + ); + + if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->addRecommendation( + function_exists('posix_isatty'), + 'posix_isatty() should be available', + 'Install and enable the php_posix extension (used to colorize the CLI output).' + ); + } + + $this->addRecommendation( + extension_loaded('intl'), + 'intl extension should be available', + 'Install and enable the intl extension (used for validators).' + ); + + if (extension_loaded('intl')) { + // in some WAMP server installations, new Collator() returns null + $this->addRecommendation( + null !== new Collator('fr_FR'), + 'intl extension should be correctly configured', + 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' + ); + + // check for compatible ICU versions (only done when you have the intl extension) + if (defined('INTL_ICU_VERSION')) { + $version = INTL_ICU_VERSION; + } else { + $reflector = new ReflectionExtension('intl'); + + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + + preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); + $version = $matches[1]; + } + + $this->addRecommendation( + version_compare($version, '4.0', '>='), + 'intl ICU version should be at least 4+', + 'Upgrade your intl extension with a newer ICU version (4+).' + ); + + if (class_exists('Symfony\Component\Intl\Intl')) { + $this->addRecommendation( + \Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion(), + sprintf('intl ICU version installed on your system is outdated (%s) and does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), + 'To get the latest internationalization data upgrade the ICU system package and the intl PHP extension.' + ); + if (\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion()) { + $this->addRecommendation( + \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(), + sprintf('intl ICU version installed on your system (%s) does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()), + 'To avoid internationalization data inconsistencies upgrade the symfony/intl component.' + ); + } + } + + $this->addPhpIniRecommendation( + 'intl.error_level', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'intl.error_level should be 0 in php.ini', + 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' + ); + } + + $accelerator = + (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) + || + (extension_loaded('apc') && ini_get('apc.enabled')) + || + (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) + || + (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) + || + (extension_loaded('xcache') && ini_get('xcache.cacher')) + || + (extension_loaded('wincache') && ini_get('wincache.ocenabled')) + ; + + $this->addRecommendation( + $accelerator, + 'a PHP accelerator should be installed', + 'Install and/or enable a PHP accelerator (highly recommended).' + ); + + if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { + $this->addRecommendation( + $this->getRealpathCacheSize() >= 5 * 1024 * 1024, + 'realpath_cache_size should be at least 5M in php.ini', + 'Setting "realpath_cache_size" to e.g. "5242880" or "5M" in php.ini* may improve performance on Windows significantly in some cases.' + ); + } + + $this->addPhpIniRecommendation('short_open_tag', false); + + $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); + + $this->addPhpIniRecommendation('register_globals', false, true); + + $this->addPhpIniRecommendation('session.auto_start', false); + + $this->addRecommendation( + class_exists('PDO'), + 'PDO should be installed', + 'Install PDO (mandatory for Doctrine).' + ); + + if (class_exists('PDO')) { + $drivers = PDO::getAvailableDrivers(); + $this->addRecommendation( + count($drivers) > 0, + sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), + 'Install PDO drivers (mandatory for Doctrine).' + ); + } + } + + /** + * Loads realpath_cache_size from php.ini and converts it to int. + * + * (e.g. 16k is converted to 16384 int) + * + * @return int + */ + protected function getRealpathCacheSize() + { + $size = ini_get('realpath_cache_size'); + $size = trim($size); + $unit = ''; + if (!ctype_digit($size)) { + $unit = strtolower(substr($size, -1, 1)); + $size = (int) substr($size, 0, -1); + } + switch ($unit) { + case 'g': + return $size * 1024 * 1024 * 1024; + case 'm': + return $size * 1024 * 1024; + case 'k': + return $size * 1024; + default: + return (int) $size; + } + } + + /** + * Defines PHP required version from Symfony version. + * + * @return string|false The PHP required version or false if it could not be guessed + */ + protected function getPhpRequiredVersion() + { + if (!file_exists($path = __DIR__.'/../composer.lock')) { + return false; + } + + $composerLock = json_decode(file_get_contents($path), true); + foreach ($composerLock['packages'] as $package) { + $name = $package['name']; + if ('symfony/symfony' !== $name && 'symfony/http-kernel' !== $name) { + continue; + } + + return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; + } + + return false; + } +} diff --git a/var/cache/.keep b/var/cache/.keep new file mode 100755 index 000000000..e69de29bb diff --git a/web/app.php b/web/app.php index 80154eda9..7dded0a71 100644 --- a/web/app.php +++ b/web/app.php @@ -1,9 +1,12 @@ loadClassCache(); //$kernel = new AppCache($kernel); $request = Request::createFromGlobals(); $response = $kernel->handle($request); diff --git a/web/app_dev.php b/web/app_dev.php index e74228d5d..d3f3a3fc3 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -1,12 +1,16 @@ unregister(); + $apcLoader->register(true); + */ -$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; Debug::enable(); require_once __DIR__.'/../app/AppKernel.php'; +// require_once __DIR__.'/../app/AppCache.php'; + +if (!file_exists('../app/config/parameters.php')) { + echo 'Unable to load parameters.php - please run setup to generate a parameters.php file.'; + exit; +} -$kernel = new AppKernel('dev', true); -$kernel->loadClassCache(); +$kernel = new AppKernel('prod', false); +//$kernel = new AppCache($kernel); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); diff --git a/web/setup.php b/web/setup.php old mode 100644 new mode 100755 index 54a9af237..5e29b1182 --- a/web/setup.php +++ b/web/setup.php @@ -2,14 +2,15 @@ use Symfony\Component\HttpFoundation\Request; -$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; +set_time_limit(0); -require_once __DIR__.'/../app/SetupAppKernel.php'; -require_once __DIR__.'/../app/AppKernel.php'; +// $loader = require_once __DIR__ . "/../var/bootstrap.php.cache"; + +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . "/../app/SetupAppKernel.php"; $kernel = new SetupAppKernel('setup', true); -$kernel->loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); -$kernel->terminate($request, $response); +$kernel->terminate($request, $response); \ No newline at end of file diff --git a/web/setup/js/SetupTests/WebserverLogTest.js b/web/setup/js/SetupTests/WebserverLogTest.js index c66e3b3c7..2a21512fd 100644 --- a/web/setup/js/SetupTests/WebserverLogTest.js +++ b/web/setup/js/SetupTests/WebserverLogTest.js @@ -3,10 +3,10 @@ */ Ext.define('PartKeeprSetup.WebserverLogDirectoryTest', { extend: 'PartKeeprSetup.AbstractTest', - url: '../../app/logs/ignore.json', + url: '../../var/logs/ignore.json', method: 'GET', name: "PHP", - message: "app/logs access check", + message: "var/logs access check", onSuccess: function (response) { try { var responseObj = Ext.decode(response.responseText); @@ -17,7 +17,7 @@ Ext.define('PartKeeprSetup.WebserverLogDirectoryTest', { if (responseObj.message && responseObj.message === "readable") { this.success = false; this.resultMessage = "Web Server misconfiguration"; - this.errors = ['Your app/logs directory is readable. Please either move your web server\'s document root to the web/ directory or configure app/logs to disallow access. For further information please read wiki about how to prevent access to the logs directory']; + this.errors = ['Your var/logs directory is readable. Please either move your web server\'s document root to the web/ directory or configure var/logs to disallow access. For further information please read wiki about how to prevent access to the logs directory']; if (this.callback) { this.callback.appendTestResult(this); @@ -36,7 +36,7 @@ Ext.define('PartKeeprSetup.WebserverLogDirectoryTest', { */ onFailure: function () { this.success = true; - this.resultMessage = "app/logs not readable"; + this.resultMessage = "var/logs not readable"; if (this.callback) { this.callback.appendTestResult(this); diff --git a/web/setup/tests/check-php.php b/web/setup/tests/check-php.php old mode 100644 new mode 100755 index e13e5d94e..07c7cb780 --- a/web/setup/tests/check-php.php +++ b/web/setup/tests/check-php.php @@ -5,9 +5,9 @@ echo '{"success": false, "message": "PHP Version '.phpversion().' is too old, minimum required version is PHP 7.0.",'; echo '"errors": ["Your PHP Version is too old. The minimum required version is 7.0.0. '; echo 'Read more…"]}'; -} elseif (version_compare(phpversion(), '7.2', '>=')) { +} elseif (version_compare(phpversion(), '7.5', '>=')) { echo '{"success": false, "message": "PHP Version '.phpversion().' is not supported.",'; - echo '"errors": ["Your PHP Version is too new. PartKeepr currently only works well with PHP <= 7.1."]}'; + echo '"errors": ["Your PHP Version is too new. PartKeepr currently only works well with PHP <= 7.4."]}'; } else { echo '{"success": true, "message": "PHP Version '.phpversion().' found"}'; } diff --git a/web/setup/tests/check.php b/web/setup/tests/check.php index 461d24917..74a81b92e 100644 --- a/web/setup/tests/check.php +++ b/web/setup/tests/check.php @@ -1,6 +1,6 @@