Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] Add gitignore to AbstractPhpCodegen #765

Merged
merged 11 commits into from
Aug 20, 2018
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,6 @@ samples/client/petstore/java/jersey2-java6/project/
samples/client/petstore/java/jersey2-java8/project/
samples/client/petstore/java/jersey2/project/

#PHP
samples/client/petstore/php/OpenAPIToolsClient-php/composer.lock
samples/client/petstore/php/OpenAPIToolsClient-php/vendor/
samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/
**/vendor/
**/composer.lock

#PHP-Symfony
samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/cache/
samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/logs/

#PHP-laravel
samples/server/petstore/php-laravel/node_modules

# Perl
samples/client/petstore/perl/deep_module_test/

Expand Down
2 changes: 1 addition & 1 deletion bin/security/silex-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-silex -o samples/server/petstore-security-test/silex $@"
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-silex -o samples/server/petstore-security-test/silex/SwaggerServer $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.openapitools.codegen.CodegenParameter;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.DefaultCodegen;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.utils.ModelUtils;

import io.swagger.v3.oas.models.media.*;
Expand Down Expand Up @@ -238,6 +239,9 @@ public void processOpts() {

// apache v2 license
// supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

// all PHP codegens requires Composer, it means that we need to exclude from SVN at least vendor folder
supportingFiles.add(new SupportingFile(".gitignore", "", ".gitignore"));
}

public String getPackageName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public PhpSilexServerCodegen() {
supportingFiles.add(new SupportingFile("composer.json", "", "composer.json"));
supportingFiles.add(new SupportingFile("index.mustache", "", "index.php"));
supportingFiles.add(new SupportingFile(".htaccess", "", ".htaccess"));

// remove this line when this class extends AbstractPhpCodegen
supportingFiles.add(new SupportingFile(".gitignore", "", ".gitignore"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("composer.mustache", "", "composer.json"));
supportingFiles.add(new SupportingFile("index.mustache", "", "index.php"));
supportingFiles.add(new SupportingFile(".htaccess", "", ".htaccess"));
supportingFiles.add(new SupportingFile(".gitignore", "", ".gitignore"));
supportingFiles.add(new SupportingFile("AbstractApiController.mustache", toSrcPath(invokerPackage, srcBasePath), "AbstractApiController.php"));
supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php"));
supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist"));
Expand Down
8 changes: 8 additions & 0 deletions modules/openapi-generator/src/main/resources/lumen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ref: https://github.com/github/gitignore/blob/master/Laravel.gitignore

vendor/
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot
storage/*.key
.env
Homestead.yaml
Homestead.json
/.vagrant
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ref: https://github.com/github/gitignore/blob/master/Symfony.gitignore

# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep

# Email spool folder
/app/spool/*

# Cache, session files and logs (Symfony3)
/var/cache/*
/var/logs/*
/var/sessions/*
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/sessions/.gitkeep

# Parameters
/app/config/parameters.yml
/app/config/parameters.ini

# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements
/vendor/

# Assets and user uploads
/web/bundles/
/web/uploads/

# PHPUnit
/app/phpunit.xml
/phpunit.xml

# Build data
/build/

# Composer PHAR
/composer.phar

# Backup entities generated with doctrine:generate:entities command
**/Entity/*~

# Embedded web-server pid file
/.web-server-pid

# From root gitignore
/Tests/cache/
/Tests/logs/
8 changes: 8 additions & 0 deletions modules/openapi-generator/src/main/resources/php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
26 changes: 26 additions & 0 deletions modules/openapi-generator/src/main/resources/ze-ph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ref: https://github.com/github/gitignore/blob/master/ZendFramework.gitignore

# Composer files
composer.phar
vendor/

# Local configs
config/autoload/*.local.php

# Binary gettext files
*.mo

# Data
data/logs/
data/cache/
data/sessions/
data/tmp/
temp/

#Doctrine 2
data/DoctrineORMModule/Proxy/
data/DoctrineORMModule/cache/

# Legacy ZF1
demos/
extras/documentation
8 changes: 8 additions & 0 deletions samples/client/petstore-security-test/php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
8 changes: 8 additions & 0 deletions samples/client/petstore/php/OpenAPIClient-php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
8 changes: 8 additions & 0 deletions samples/server/petstore-security-test/lumen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
2 changes: 2 additions & 0 deletions samples/server/petstore-security-test/php-slim/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore

composer.phar
/vendor/

Expand Down
Loading