Compare commits

...

411 commits

Author SHA1 Message Date
Arnout Boks 64b0f60368 Removed unused 'standard' option for PhpCpd plugin (#1249) 2016-08-17 12:35:21 +01:00
Dan Cryer 42ca1c6527 Fix for handling old unserialize mode. 2016-06-29 10:13:27 +01:00
Dan Cryer 4d0911f2a9 Bug fixes
Signed-off-by: Dan Cryer <dan@block8.co.uk>
2016-06-23 11:30:41 +01:00
Dan Cryer 3cdaef8fa9 Update README.md 2016-06-03 17:30:45 +01:00
David Rimbault db93f55427 [FIX] Running Complete stage even on Exception catch. (#1186) 2016-04-27 16:59:29 +01:00
Dan Cryer 49db1a26ba
Make sure we always show the correct error count on the build errors tab. 2016-04-27 16:40:55 +01:00
Dan Cryer 77e9710d09
Testing PHPMD error supression 2016-04-27 15:45:24 +01:00
Dan Cryer 7027055711
Merge branch 'feature/bitbucket-webhooks' 2016-04-27 15:35:10 +01:00
Dan Cryer 21ba39e6ff
Fixes 2016-04-27 15:27:27 +01:00
Dan Cryer 6418fde928 Defaulting to using neither --prefer-source or --prefer-dist for composer. Allow user to specify either. 2016-04-27 15:20:20 +01:00
Dan Cryer 21d5f4954f
Adding a debug mode to the worker so you can see what commands are being run. 2016-04-27 14:56:52 +01:00
Dan Cryer 1f035463e4 Merge branch 'patch-4' of https://github.com/wodka/PHPCI into feature/bitbucket-webhooks 2016-04-27 14:26:44 +01:00
Dan Cryer 5ead42a7c2
README tweaks. 2016-04-27 14:18:40 +01:00
Dan Cryer 1e13538c28
Updating README 2016-04-27 14:13:42 +01:00
Dan Cryer 424f1c5c4b Removing Test from README 2016-04-27 14:08:01 +01:00
Dan Cryer dc9aa195d1 Merge branch 'master' of github.com:Block8/PHPCI 2016-04-27 12:35:17 +01:00
Dan Cryer 1e2cbcaf3d Fixing duplicate error listing in builds.
Closes #1130
2016-04-27 12:33:07 +01:00
David Valdez e567088a00 now take in account the errors in the codeception plugin (#1206) 2016-04-27 12:10:46 +01:00
Dan Cryer ffa593f1a3 Fixing PHPCS errors 2016-04-27 12:02:13 +01:00
Dan Cryer cc6d0f2964 Updating dependencies 2016-04-27 11:43:57 +01:00
Dan Cryer e6b02b6019 Merge remote-tracking branch 'origin/master' into v/1.7 2016-04-27 11:32:50 +01:00
Dan Cryer 81eadcf3f5 Contributing guidelines, issue template and PR template. 2016-04-27 11:29:03 +01:00
Dan Cryer f200bd0411 Fixing MySQL strict-mode install error.
Fixes #977
Fixes #818
2016-04-27 11:06:32 +01:00
Mike Bronner fe9289eda5 Remove whitespace from empty lines, reformatted inline comments 2016-02-08 12:59:15 +01:00
Michael Schramm 66ffea12f0 remove whitespace 2016-02-08 12:59:15 +01:00
Michael Schramm 3c8ed45c46 implement bitbucket webhooks
this fixes issue https://github.com/Block8/PHPCI/issues/1015 and adds support for the new bitbucket webhooks
2016-02-08 12:59:15 +01:00
Dan Cryer 2ddda7711e Update README.md 2016-02-08 11:44:35 +00:00
Dan Cryer 42bea5f876 Merge pull request #1154 from staudenmeir/update-german-translation
Update German translation.
2016-01-08 11:04:54 +00:00
Dan Cryer d3af89a0c5 Merge pull request #1157 from Lechus/patch-2
Update Polish translation
2016-01-08 11:03:35 +00:00
Leszek 9af9e0ec35 Update Polish translation
Contribution Type: improvement
Primary Area: front-end

Description of change: Updated Polish translation.
2016-01-06 22:01:38 +00:00
Jonas Staudenmeir 7f43f94cc0 Updated German translation. 2016-01-06 00:24:42 +01:00
Jonas Staudenmeir 949bfc5376 Added default value in settings language select (current language). 2016-01-05 16:21:21 +01:00
Dan Cryer 992cf767a6 Merge pull request #1128 from Block8/Deployer_branch_update
Added branch and update_only parameters
2015-11-24 11:37:16 +00:00
Stephen Ball 6eeddc9dc6 Added branch and update_only parameters
Fixes #1127
2015-11-14 23:08:22 +00:00
Dan Cryer 6eb180ed5f Merge pull request #1124 from Block8/REBELinBLUE-patch-1
Fixes a issue with a double slash in the path meaning ignore doesn't …
2015-11-12 17:47:16 +00:00
Stephen Ball 148e4414fb Fixes a issue with a double slash in the path meaning ignore doesn't work 2015-11-12 17:42:00 +00:00
Dan Cryer b24b01ec65 Fixing tests on install command 2015-11-07 12:47:39 +00:00
Dan Cryer 04c67dc1dd Update installer to support new worker functionality. Closes #1094 2015-11-07 12:25:01 +00:00
Dan Cryer 4b8d25c0f7 Adding rebuild queue option 2015-11-03 20:42:47 +00:00
Dan Cryer 9ea6f299c1 Fix for warnings chart, courtesy of @Henk8 closes #1098 2015-11-03 11:58:22 +00:00
Dan Cryer 7b345cbc49 Making the lines of code chart hide if no data available. Closes #1103 2015-11-03 11:51:45 +00:00
Dan Cryer c95e226496 Allow more errors. Fixes #1104 2015-11-03 11:44:08 +00:00
Dan Cryer 7bfba0ee30 Fixing error duplication bug. Closes #1112 2015-11-03 11:42:28 +00:00
Stephen Ball 551bae312f Merge pull request #1111 from SQweb-team/img_optim
ImageOptim'ed assets/
2015-10-27 10:46:13 +00:00
Pierre Lavaux d8be38ace0 ImageOptim'ed assets/ 2015-10-27 02:17:26 +01:00
Andreus Timm 1d9c610a25 Adding slash in path
Fix / for DIRECTORY_SEPARATOR

Closed #1109
2015-10-26 16:26:47 +01:00
Dan Cryer 943c8124ac Merge pull request #1091 from andreustimm/master
Improvement with rtrim
2015-10-15 14:49:54 +01:00
Dan Cryer f33f0a4512 Fixes 2015-10-15 14:23:55 +01:00
Dan Cryer dd1d3b3d6a Switching charts to use Chart.js instead of Google Charts 2015-10-15 12:34:58 +01:00
Dan Cryer 66cf713ebc Merge branch 'master' of github.com:Block8/PHPCI 2015-10-15 10:41:42 +01:00
Dan Cryer 8fed994921 Fixing login pages 2015-10-15 10:41:35 +01:00
Stephen Ball cb346f6808 Merge pull request #1093 from REBELinBLUE/missing_composer_dependencies
Added missing dependencies to require
2015-10-15 10:30:33 +01:00
Stephen Ball 78690f32c2 Merge branch 'master' into missing_composer_dependencies 2015-10-15 10:26:35 +01:00
Dan Cryer f904cab599 Fixing PHPMD error 2015-10-15 10:26:13 +01:00
Stephen Ball 19a7ab995c Merge branch 'master' into missing_composer_dependencies 2015-10-15 10:21:00 +01:00
Dan Cryer 38b024833f Fixing PHPCI errors 2015-10-15 10:17:22 +01:00
Stephen Ball 7c03c77870 Added missing dependencies to require 2015-10-15 10:11:21 +01:00
Dan Cryer 7f823b37cf Big update: New way of storing build errors, updated UI, AdminLTE 2, fixes, etc. 2015-10-15 10:07:54 +01:00
Andreus Timm d49cecf40a Improvement with rtrim 2015-10-14 14:24:18 -03:00
Dan Cryer 9c7a1c7907 Merge pull request #1085 from corpsee/feature-ru-update-2
Updated russian translation for Summary plugin section
2015-10-14 09:24:55 +01:00
Stephen Ball 82ffbfea5c Merge pull request #1086 from Block8/REBELinBLUE-patch-1
Adding missing closing bracket
2015-10-13 22:23:32 +01:00
Stephen Ball 0f84cc6334 Adding missing closing bracket 2015-10-13 22:02:05 +01:00
corpsee 914067c15a Updated russian translation for Summary plugin section 2015-10-13 22:33:07 +06:00
Dan Cryer 8f3cdd0fb7 Merge pull request #1083 from REBELinBLUE/build_broken_failed
Added 2 new build stages
2015-10-13 16:39:26 +01:00
Dan Cryer 9c2cdbe3d1 Merge pull request #1032 from EmmanuelVella/php-cs-fixer
Update PhpCsFixer plugin
2015-10-13 16:36:21 +01:00
Dan Cryer a821072d27 Merge pull request #1082 from REBELinBLUE/hide_slack_attachment
Add the ability to hide the slack attachment
2015-10-13 16:36:12 +01:00
Stephen Ball 8f8009c30c Fixed parse error..... Apparently I shouldn't be allowed near a computer today 2015-10-13 16:35:27 +01:00
Dan Cryer 2f34c47656 Merge pull request #1076 from corpsee/feature-ru-update
Updated russian translation
2015-10-13 16:33:42 +01:00
Stephen Ball 3f71695013 Clean up PHPCS issue 2015-10-13 16:31:17 +01:00
corpsee 94b79860c5 Merge branch 'master' into feature-ru-update
Conflicts:
	PHPCI/Languages/lang.ru.php
2015-10-13 21:30:54 +06:00
Stephen Ball 4a5b1afb47 Clean up PHPCS issue 2015-10-13 16:28:37 +01:00
Stephen Ball 8e0122f6a0 Added a fixed and broken stage 2015-10-13 16:22:39 +01:00
Stephen Ball 2d667d477d Fix PHPCS error 2015-10-13 16:08:44 +01:00
Stephen Ball d2ab7b300d Add the ability to hide the slack attachment 2015-10-13 16:04:16 +01:00
Emmanuel Vella 6e5ede8073 Update PhpCsFixer plugin 2015-10-13 16:41:41 +02:00
Dan Cryer 6aea2bdb88 Merge pull request #1077 from GeneaLabs/feature/fix-arrangement-of-components
Fix Arrangement of Build Result Components
2015-10-13 15:33:33 +01:00
Dan Cryer 3aeef0650d Merge pull request #1078 from GeneaLabs/feature/fix-bootstrap-datepicker-locale
Fix Datepicker Locale File Include
2015-10-13 15:31:23 +01:00
Dan Cryer 5216270416 Merge pull request #1070 from cooperaj/master
Incorrect docblock
2015-10-13 15:26:57 +01:00
Dan Cryer ad27ca9037 Merge pull request #1025 from delormejonathan/patch-1
Fixed a css issue with Block8 logo
2015-10-13 15:14:59 +01:00
Dan Cryer 1385379f1a Merge pull request #1021 from mrobinsonuk/cleanup/spelling-corrections
Corrected a number of minor spelling errors.
2015-10-13 15:14:44 +01:00
Dan Cryer 10720656f9 Merge pull request #1019 from detain/mysql_plugin_host_support
Contribution Type: improvement / new feature
2015-10-13 15:13:55 +01:00
Dan Cryer 0fbae60f52 Merge pull request #998 from teemule11/bugfix-pdepend-1
Pdepend Module: make check for Pdepend output dir more robust.
2015-10-13 15:04:42 +01:00
Dan Cryer 3d21ad24e9 Merge pull request #993 from corpsee/feature-phpcpd-fix
Fixed GithubBuild::getDiffLineNumber method for correct phpcpd work
2015-10-13 15:04:13 +01:00
Dan Cryer d8cbe68705 Merge pull request #992 from corpsee/feature-phpunit-fixes
Fixed TapParser parse fail
2015-10-13 15:03:09 +01:00
Dan Cryer 6591ada85b Merge pull request #972 from memnuniyetsizim/master
Fixes default value for PHP Cs Fixer ( #833 )
2015-10-13 14:45:20 +01:00
Dan Cryer bee77a25c8 Merge pull request #942 from corpsee/feature-archived-fix
Separated strings for 'archived'/'archived_menu'
2015-10-13 14:33:07 +01:00
Dan Cryer 351b24c91d Merge pull request #939 from drydenmaker/master
adding windows batch file for console
2015-10-13 14:32:12 +01:00
Dan Cryer c49821adf1 Merge pull request #1080 from GeneaLabs/feature/add-logo-icon-images
Add Logo Icons
2015-10-13 14:18:19 +01:00
Dan Cryer ed35dee322 Merge branch 'master' of github.com:Block8/PHPCI 2015-10-13 10:00:17 +01:00
Dan Cryer 156c635af5 Updating deps 2015-10-13 09:59:48 +01:00
Mike Bronner a504789bd4 Merge branch 'master' into feature/add-logo-icon-images 2015-10-12 12:26:42 -07:00
Mike Bronner dc6e4ed6b4 Add logo icons 2015-10-12 12:23:55 -07:00
Dan Cryer c9f6946189 Merge pull request #1079 from GeneaLabs/feature/fix-missing-sprintf-map-file
Add Missing sprintf.min.map File
2015-10-12 16:06:34 +01:00
Mike Bronner 21b59ab4d4 Add missing sprintf.min.map file 2015-10-10 10:07:31 -07:00
Mike Bronner c474a5c73a Check if datepicker locale file exists 2015-10-10 09:54:01 -07:00
Mike Bronner 8845fe63d9 Move id attribute to outer div to hide the result component completely
This will allow the other non-hidden components to properly reflow on the page.
2015-10-10 09:22:53 -07:00
corpsee c9541d630b Updated russian translation 2015-10-10 18:16:07 +06:00
Dan Cryer 97216b0f41 Fixing login stuff 2015-10-09 11:10:14 +01:00
Dan Cryer 725ce70ae9 Fixing ordering on projects for @REBELinBLUE 2015-10-09 10:58:18 +01:00
Dan Cryer edcff1030d Merge pull request #1075 from Block8/dc/phpci-fixes
Fixing PHPCI Errors
2015-10-09 10:40:12 +01:00
Dan Cryer fbc3da59dd Fix 2015-10-09 10:37:50 +01:00
Dan Cryer f747371c6d Fixing tests #2 2015-10-09 10:29:21 +01:00
Dan Cryer 07b92fecf3 Fixing tests 2015-10-09 10:14:54 +01:00
Dan Cryer e61ce203a3 Docblocks 2015-10-09 09:38:55 +01:00
Dan Cryer a008358056 Cleaning up BuildWorker #1 2015-10-09 09:27:45 +01:00
Dan Cryer 68249d2f5d Cleanup of new executor changes. 2015-10-09 09:16:05 +01:00
Dan Cryer 4375c524a9 PHPMD Fix 2015-10-08 20:27:40 +01:00
Dan Cryer af90b94a3c PHPMD Fixes 2015-10-08 20:24:32 +01:00
Dan Cryer 2f859be369 PHPCS Fix 2015-10-08 20:22:43 +01:00
Dan Cryer 370eebd227 Fixing PHPCS error in HomeController 2015-10-08 20:20:42 +01:00
Dan Cryer ada9e33204 Restoring to login by email. 2015-10-08 20:15:20 +01:00
Dan Cryer 4e0325e887 Missing build bugfix. 2015-10-08 17:30:34 +01:00
Dan Cryer e871df80c2 Adding the ability to run branch-specific stages 2015-10-08 16:54:01 +01:00
Dan Cryer a7473eb250 Updating deps. 2015-10-08 16:53:39 +01:00
Dan Cryer 7ad1d317cd Updating builds to try database config first, and fall back to file config. 2015-10-08 16:52:44 +01:00
Dan Cryer 31165a6bfa General model / store cleanup 2015-10-08 16:52:19 +01:00
Dan Cryer 74d313862c Adding project groups 2015-10-08 16:33:01 +01:00
Dan Cryer e186874eba Removing the ability to install 'plugins' via the web interface. 2015-10-08 16:29:29 +01:00
Dan Cryer cf415a7c78 Merge branch 'master' of github.com:Block8/PHPCI 2015-10-08 09:49:20 +01:00
Dan Cryer 2380d2e472 Build worker should delete jobs in its queue that are not recognised. 2015-10-08 09:49:16 +01:00
Dan Cryer 69cd4789be Merge pull request #1073 from REBELinBLUE/add_commit_message_to_deploy_reason
Added the commit message to the BuildInterpolator
2015-10-07 15:08:52 +01:00
Stephen Ball 6f0945fb97 Added the commit message to the BuildInterpolator so it can be used as the default reason passed to deployer 2015-10-07 15:06:07 +01:00
Dan Cryer 857990b776 Update README.md 2015-10-06 19:10:11 +01:00
Dan Cryer 3f8bb1acc4 Merge pull request #1072 from REBELinBLUE/master
Update README.md
2015-10-06 19:09:00 +01:00
Stephen Ball 801a4f7309 Update README.md 2015-10-06 17:28:44 +01:00
Dan Cryer 06e3235960 Add "source" and "url" parameters to Deployer plugin. 2015-10-06 14:16:48 +01:00
Dan Cryer de6eb62367 Deployer plugin 2015-10-06 12:00:58 +01:00
Dan Cryer 7e2fee9504 Verify that jobs actually come from PHPCI 2015-10-06 11:38:09 +01:00
Adam Cooper 668ee67617 Incorrect docblock
The "optionally" is not true, the config file is now required.
2015-10-06 10:53:23 +01:00
Dan Cryer de1c058f83 Merge pull request #1067 from Block8/dc/workers
Adding support for a beanstalkd-based queue
2015-10-05 15:27:18 +01:00
Dan Cryer 90b4de453e Moving to new .phpci.yml filename 2015-10-05 15:25:45 +01:00
Dan Cryer 5062a58ba1 Merge pull request #1066 from REBELinBLUE/hide_yml_file
Adding support to check for .phpci.yml so the file can be 'hidden'
2015-10-05 15:23:20 +01:00
Dan Cryer 9dd6edc24a Fix 2015-10-05 15:07:25 +01:00
Dan Cryer 11445304d6 Making PHPMD happy. 2015-10-05 14:48:17 +01:00
Dan Cryer 771bee0aa3 Fixings 2015-10-05 14:41:13 +01:00
Dan Cryer 2858ce506a Merge branch 'master' into dc/workers 2015-10-05 14:17:23 +01:00
Dan Cryer ea1157066e Fixing new PHPCS errors. 2015-10-05 14:17:13 +01:00
Dan Cryer b2ed9f102b Docblock fixes 2015-10-05 14:11:43 +01:00
Dan Cryer 183d7d9e50 Making duplicate builds work again. 2015-10-05 14:07:48 +01:00
Dan Cryer 06204ef171 Adding support for beanstalkd-based workers. 2015-10-05 12:13:22 +01:00
Stephen Ball 647c0eb09c Update Build.php
Changed the order the files are loaded in
2015-10-05 10:17:04 +01:00
Dan Cryer 6c33417839 More composer.json cleanup 2015-10-05 09:57:50 +01:00
Dan Cryer c0b2ed0df0 Merge branch 'master' of github.com:Block8/PHPCI 2015-10-05 09:56:42 +01:00
Dan Cryer fa979f6a02 Fixing composer.json 2015-10-05 09:56:36 +01:00
Stephen Ball 9ee27bad37 Adding support to check for .phpci.yml so the file can be 'hidden' as with other CI systems such as Travis, StyleCI and Codeclimate 2015-10-04 17:38:03 +01:00
Dan Cryer b0482b191d Merge pull request #872 from REBELinBLUE/additional_interpolate
Additional interpolate
2015-10-02 22:14:14 +01:00
Dan Cryer 58a97e5a97 Merge pull request #869 from REBELinBLUE/technical_debt_cleanup
Cleanup technical debt
2015-10-02 22:12:50 +01:00
Dan Cryer b171a10759 Fixing Codeception plugin PHPCS errors. 2015-10-02 21:53:39 +01:00
Dan Cryer aaf93ddd7d Updating PHPCI to send more detailed commit statuses, for @REBELinBLUE. 2015-10-02 21:35:53 +01:00
Dariusz Ruminski dc6e63a7e7 PHP CS Fixer - fix name
Closed #1054
2015-10-02 13:54:25 +02:00
Mehmet Ali Ergut f55b336900 Fixes default value for PHP Cs Fixer ( #833 ) 2015-08-24 21:24:37 +03:00
Steve Robbins 92ee90998a Fixes notice in github builds
Closed #996
2015-08-13 14:28:08 +02:00
DELORME Jonathan 8a3d7605d5 Fixed a css issue with Block8 logo
In Chrome (Android L), when you focus an input, the Block8 logo overrides the view.
See : http://s10.postimg.org/d5ffp7dwp/2015_06_30_07_57_03.png
2015-06-30 11:43:25 +02:00
Mark Robinson d2c512d94b Corrected a number of minor spelling errors.
Originally observed that "successful" was misspelled "succesfull" on the build view page. While correcting that, a number of other spelling errors were also corrected.
2015-06-25 15:21:23 +01:00
Joe Huss 9efd8e06dc Contribution Type: improvement / new feature
Primary Area: plugins

Description of change: Implemented using the same changes mentioned here: https://www.phptesting.org/forums/topic/5-mysql-plugin-setup/
Allows you to specify a hostname for your mysql connection.  Not my original code just patching it into the current source and made a branchs/push for it.

(i.e. Created a new plugin named ToolX, used library X to implement, see link)
2015-06-25 07:48:26 -04:00
Adirelle d698b11673 Fixes "Undefined index: login_token".
Fixes https://github.com/Block8/PHPCI/issues/994.
2015-05-30 21:16:31 +02:00
mulleto 2672908225 Make check for Pdepend output dir more robust. Before this fix, the pdepend module would check for "is_writable", which returns false even when the directory does not exist. I suggest to a) attempt to crete the dir if it does not exist, and b) make the error message more explanatory in case the dir cannot be created or is not accessible. 2015-05-29 08:26:47 +02:00
Aleix Canal 3a6008db53 Bugfix: Default codeception xml path "tests/_output/" but now 100% configurable.
Closed #991
2015-05-28 12:18:24 +02:00
tankist 9ace15a55f Fix for #988
Added class::method fallback for feature entry to prevent empty report for Codeception plugin

Closed #989
2015-05-28 12:10:14 +02:00
mulleto 3784cc8ea9 Adding an option for Plugin::Composer to pass the no_dev option. If set to true, it will execute composer with the --no-dev option, which usually suffices for testing in most projects. Default is set to false.
Closed #987
2015-05-28 12:08:30 +02:00
mulleto d34818f029 Added missing strings in german translation
Closed #982
2015-05-28 12:05:58 +02:00
Stephen Ball 1eb5248319 Removed allowed_warnings as it is not used
Calling setOptions

Closed #975
2015-05-28 12:03:23 +02:00
Adirelle 3734d3bc9a Don't use an if and two return statements when one return is sufficient.
Don't use two if when one else does the same job.
Don't use convoluted calculations when one return statement is sufficient.
Don't call a method that doesn't exist.
Don't write a try-catch block that does nothing.
Do send exceptions when a abnormal situation occurs.

Closed #962
2015-05-28 12:00:43 +02:00
Adirelle b7d9af1e72 Update sensiolabs/ansi-to-html to fix the log background.
Closed #961
2015-05-28 11:59:17 +02:00
corpsee 5c6dd81a9a Extended shields.io status badge support
Closed #958
2015-05-28 11:50:57 +02:00
Petr Cervenka 7ff080971e Adding Flowdock integration
Closed #954
2015-05-28 11:47:57 +02:00
Adirelle ad29ba4cfd Track and display the build progression, for each stages and plugins.
Translations for the build summary.

Closed #944
2015-05-28 11:39:35 +02:00
Adirelle 8549ba30cf PHPUnit display: escape HTML code in test messages.
PHPUnit display: display data produced before the TapParser refactoring.

Closed #937
2015-05-28 11:14:20 +02:00
Adirelle 4edefee761 Reworked the DaemonCommand.
* Accepts options for PID and log file.
* Uses posix_kill whenever available.
* Checks that the daemon actually started or stopped.
* Try to terminate then kill the daemon.
* Uses the logger or output instead of "echo".

Added a ProcessControl interface and implementations.

Closed #908
2015-05-28 10:55:59 +02:00
Vaidas Zilionis 15b6917f68 Allow see project build status in cctray xml format
Refactoring is done for BuildStatus information.
- Fixed all phpcs, phpmd errors
- Added test for my code (hurray 100 tests already :D)

Closed #705
2015-05-28 10:50:29 +02:00
corpsee 853107027b Fixed GithubBuild::getDiffLineNumber method for correct phpcpd work 2015-05-24 14:20:51 +06:00
corpsee 3f02e63c92 Fixed TapParser::parseLine Cyclomatic Complexity 2015-05-24 12:43:43 +06:00
corpsee c20ee0533b Fixed TapParser::parseLine Cyclomatic Complexity 2015-05-24 12:39:27 +06:00
corpsee 1c864cebed Fixed TapParser parse fail with valid data + added tests 2015-05-23 15:40:49 +06:00
Victor 0887bd4bc4 Fix for strict standards issue in RebuildCommand.php
[ErrorException]
Runtime Notice: Only variables should be passed by reference in /var/www/phpci/PHPCI/Command/RebuildCommand.php line 78
2015-05-15 16:37:45 +02:00
Adirelle 8bf1d09afd Black-on-white color theme for the build log. 2015-04-28 14:14:25 +02:00
Adirelle 5cd29ca7fc Allow to specify a mail template ('short' or 'long') in phpci.yml.
Email plugin: checks if the custom template exists before trying to use it.

Closed #933
2015-04-28 14:09:23 +02:00
Adirelle 590ab5fae5 Build::removeBuildDirectory: do not try to remove build directory of not-yet-persisted builds. 2015-04-25 21:25:50 +02:00
corpsee 21bf104587 Separated strings for 'archived'/'archived_menu' 2015-04-25 09:54:08 +06:00
alton.crossley 5133d85b99 adding windows batch file for console 2015-04-23 14:35:15 -06:00
Adam Cooper 3ca1667f12 Revert CSS file change made in error as part of the codeception update
Close #935
2015-04-23 17:01:44 +02:00
Adirelle f46a8be648 LoggerConfig::getFor always returns the same instance of Logger for the same $name.
This avoid issues when push handlers/processors to that logger.
Use the Monolog\ErrorHandler to log errors and exceptions.
PHPCI/Logging/Handler becomes PHPCI/ErrorHandler.
And it only throws ErrorException for reported errors.
No need to initialize a second $loggerConfig in daemonise.

Close #892
2015-04-23 13:25:53 +02:00
Adirelle 5688d9c4c8 The manual build button creates build for the currently watched branch.
Close #927
2015-04-23 13:23:13 +02:00
Adam Cooper 408eb5b974 An attempt at making the codeception plugin a little more complete.
Codeception JS plugin and theme changes.
Improvements to the display. Extra total information plus some test file locations.

Close #588
2015-04-23 13:18:26 +02:00
Adirelle 209454c5f6 When starting a manual build, replace the "Manual" commit id with the HEAD hash.
Close #928
2015-04-23 13:13:29 +02:00
corpsee 634b246ed5 Fixed ru strings for create build command (https://github.com/Block8/PHPCI/pull/889)
Fixed ru strings for 'archived'

Close #932
2015-04-23 10:33:38 +02:00
corpsee 1b7f0bbb4b Improved login: now you can login using name or email
Close #873
2015-04-22 13:54:02 +02:00
Alexander Garzon c0568d3a4b Update lang.es.php
Missing translation for "archived"

Close #931
2015-04-22 12:26:51 +02:00
Adam Henley f7ca64bf6d SMTP Password not masked PR #921
Signed-off-by: Adam Henley <adamazing@gmail.com>

Close #923
2015-04-22 12:26:06 +02:00
rm3nchaca 81fbc6a5a0 fix file link in plugins
Running builds leave a file link with an error like "http://gitlab.example.com/root/project/blob/master/index.php#L6" but it is pointing to the actual file, not the file with a bug, example "97f0a6453d/index.php (L6)"

Close #915
2015-04-22 12:24:29 +02:00
Adirelle 290c34a27d Updated the php_codesniffer required version and added a default phpcs.xml.
Added a PHPMD configuration file.
Updated phpci.yml to use the configuration files.

Close #913
2015-04-22 12:22:28 +02:00
Adirelle f25b1d25dc Let CommandExecutor::findBinary throw an exception when the binary is missing.
Close #910
2015-04-22 12:19:05 +02:00
Lewis Wright 7f46b650dc Added check for invalid key
Close #895
2015-04-22 12:06:26 +02:00
Jérémy DECOOL 9261f24d25 Command to create a new build
Close #889
2015-04-22 12:00:38 +02:00
Angel Koilov 77ba61c8bc add pingback for IRC plugin
Close #886
2015-04-22 11:58:43 +02:00
Adirelle 452a5ba97c Enforce "en" lang in tests.
Some tests compare the result to english strings.

Do not test UnixCommandExecutor on Windows.

PharTest: explain why PHAR writing test are skipped.

InstallCommandTest: mock checkRequirements to allow the tests to run.

Run php_parallel_lint before all other tests.

Close #846
2015-04-22 11:49:26 +02:00
Adirelle 9590336c49 Added a new configuration variable, PHPCI_BUILD_ROOT_DI.
This variable allows to change where the build happens.
It defaults to PHPCI_DIR.'PHPCI/build/'.

Moved build path calculate and build removal into the Build class.

Also remove the build directory when deleting the build.

Close #834
2015-04-22 11:44:54 +02:00
Martin Sadovy 60131ae7b6 Github: Support pull private repository from pull request
Closes #832
2015-04-22 11:41:33 +02:00
zviryatko 067a60983f Fix archive link. 2015-04-22 11:37:38 +02:00
Marco Vito Moscaritolo 3626eabc2e Merge pull request #871 from REBELinBLUE/fix_wipe_error
Preventing the wipe plugin failing due to an undefined variable
2015-04-16 18:39:30 +02:00
Marco Vito Moscaritolo 0b0589557f Merge pull request #845 from MarkMaldaba/fix_paths_with_spaces
Fixed the install script, which bails-out with an error if the PHPCI path contains spaces.
2015-04-12 21:17:12 +02:00
Adirelle f3c1a98cf1 Detailed webhook responses.
Fixed docblocks.

Reworked WebhookController to enforce Json responses in ::handleAction.

Check the project type match the webhook.

When creating several builds, do not stop on first error.

Try to create every builds and report 'ok' if at least one succeeds.

CS fix.

Fixed Uses.

Fixed the types accepted by the git webhook.

Added some really basic test.
2015-04-09 13:09:03 +02:00
zviryatko 731fd65453 Change xmpp config and message files directory 2015-04-09 12:08:27 +02:00
Angel Koilov 524341a50b remove unnecessary code 2015-04-09 12:06:32 +02:00
Tobias van Beek 01911f11aa Add the --recursive parameter to the git clone to get the submodules 2015-04-09 12:03:08 +02:00
Adirelle 9d4116e3c9 Reworked TapParser to be compliant and more robust.
Added another test case from #571.

Updated the output of TapParser::processTestLine.

Broke TapParser::parse down in simpler methods.

TapParser: ignore leading garbage and properly complain on missing TAP log.

TapParser: detect and report duplicated TAP log.

TapParser: got rid of the "test" and "suite" values.

They are only available with PHPUnit.

TapParser: append the message from yaml diagnostic to existing message.

Reworked the dispaly of test results.

PHPUnit plugin: pretty print test data.
2015-04-09 12:00:10 +02:00
Nicolplaás 2c43cd1cac Add spanish laguage support 2015-04-09 11:57:46 +02:00
Adirelle d804438a87 Use sensiolabs/ansi-to-html to parse the build logs.
Added an AnsiConverter helper.

Use the AnsiConverter in the email and page templates that display the build log.

Use a dedicated stylesheet for the ANSI converter.

It can be customized.
It can be inlined in the notifications.

Do not use ProphecyTestCase when not needed.
2015-04-09 11:54:57 +02:00
Marco Vito Moscaritolo 039324c056 Merge pull request #842 from corpsee/feature-ui-improvements
UI improvements
2015-03-25 12:51:10 +01:00
corpsee 3a867eb9d5 Fixed 'start' string for ru lang
Fixed 'from' and 'to' strings for ru lang
2015-03-18 13:10:21 +01:00
LAHAXE Arnaud d8df6cab4a Fix french typo mistake 2015-03-18 12:26:27 +01:00
Adirelle ea3b0c219a Code style fixed. 2015-03-18 12:21:06 +01:00
Adirelle f29ff197c6 Generate an new session identifier on successful login to prevent session fixation attacks. 2015-03-18 12:21:06 +01:00
Adirelle 3467e77e74 Use a CSRF token on the login form to prevent CSRF attacks. 2015-03-18 12:21:05 +01:00
Mark Clements 1dd1af2443 Switching tabs to spaces as per style guide.
No functional changes.
2015-03-18 09:47:47 +00:00
Marco Vito Moscaritolo 9d6a65b415 Merge pull request #844 from MarkMaldaba/fix_space_after_colon
Fixed an inconsistency in the way the prompts in the install scripts were being output.
2015-03-18 09:58:21 +01:00
Stephen Ball fdaaa1ede4 Parsing variables in the code coverage output directory for PHPUnit 2015-03-16 11:10:03 +00:00
Stephen Ball 52b2f87df2 Parsing variables in the Wipe plugin 2015-03-16 11:09:45 +00:00
Stephen Ball 9ad0e90fa1 Preventing the plugin failing due to an undefined variable 2015-03-16 11:05:33 +00:00
Stephen Ball 70f0d2516f Removed log output so that it matches the other plugins which don't pollute the build log, and to prevent issues with the log output not being escaped 2015-03-13 13:31:38 +00:00
Dan Cryer ecc92b5f3e Fixing pull request builds. 2015-03-11 07:48:22 +00:00
Dan Cryer 5f2de9a679 Update to only build the latest commit from a Github pull request webhook. 2015-03-10 20:20:54 +00:00
vsguts a188afb0da Fixing symlink removal.
Closes #854
2015-03-10 19:11:43 +00:00
Gustavo Novaro 33fc50a0b5 Remove blank style tag in header
Remove the tag <style> the header because it was not used

Closes #863
2015-03-10 19:04:05 +00:00
corpsee e75ffe0b76 Fixed 'date' nl lang string 2015-03-10 15:44:33 +06:00
Igor Timoshenko 4e8dc7c87b Fixed typos in Ukrainian language 2015-03-10 10:15:50 +01:00
Adirelle 00b88630fb Display a green border in passing build notifications. 2015-03-10 09:53:36 +01:00
corpsee 942127ffe6 Added default value in profile language select (current language) 2015-03-10 09:51:22 +01:00
Leszek a7b40ce176 archived 2015-03-10 09:29:37 +01:00
Marco Vito Moscaritolo 3c83c01520 Merge pull request #857 from thomasfrei/remove-short-array-syntax
Remove short array syntax to keep backwards compatibility with php5.3
2015-03-07 20:00:37 +01:00
Thomas Frei 542d2a3545 Remove short array syntax to keep backwards compatibility with php5.3 2015-03-06 17:44:22 +01:00
James Inman 945524c520 Merge pull request #851 from njovin/master
Fix #840: Technical Debt plugin not storing data/displaying results.
2015-03-05 08:39:17 +00:00
Nathan Jovin 610d0991a8 Fix issue #840 Technical Debt not storing data nor displaying results in table 2015-03-05 00:12:42 -08:00
Mark Clements 8a96ec8551 Fixed the install script, which bails-out with an error if the PHPCI path contains spaces.
This occurs commonly on Windows, but from my reading of the code it would also be a problem on other platforms if spaces were present (though this is less likely, due to different naming conventions).

It has been fixed by using escapeshellarg() on both of the paths used in the command.

Fixes #698, which I've just noticed has a similar solution suggested in one of the comments, but was closed without anyone actually implementing it.
2015-03-02 22:49:22 +00:00
Mark Clements d2e6182a2f Fixed an inconsistency in the way the prompts in the install scripts were being output.
All the DB/host fields have a space after the colon, which is much better as it means the text you type is slightly separated from the prompt.  However, the admin user fields didn't include this space which was inconsistent and made the install script a little less professional.

I have therefore added the missing space for the prompts which didn't have it in the English language file, and have also updated all other language files to also use this format.  Most of them followed the same inconsistency as the English version, though some were consistent but without a space, and some which were differently inconsistent (both internally, and between languages).
2015-03-02 22:31:01 +00:00
corpsee f97089529c Fixed 'date' it lang string 2015-03-02 08:18:40 +06:00
corpsee 000aff9121 Code style fix 2015-02-28 23:51:04 +06:00
corpsee 9f53471186 Added Date column for builds table in project page. 2015-02-28 23:38:56 +06:00
corpsee da9be4930d Added total builds count to index and project page 2015-02-28 23:13:02 +06:00
Dan Cryer b8983b23a3 Fixing final PHPCS error. 2015-02-26 08:48:40 +00:00
Dan Cryer 86b9c05f98 Fixing PHPCS errors. 2015-02-26 08:45:42 +00:00
Dan Cryer ab4396e00d Hopefully fixing a bug where reporting errors back to Github causes an infinite loop. 2015-02-26 08:31:58 +00:00
Dan Cryer bfc56a753d Updating dependencies. 2015-02-26 08:08:45 +00:00
Dan Cryer 4a84aad327 Updating basic Dockerfile. 2015-02-26 08:08:12 +00:00
Dan Cryer 8ab098821b Updating Settings Controller to use the configured config file, rather than assuming config.yml 2015-02-25 14:18:05 +00:00
Dan Cryer e423c73c4e Fixing comparison where commit ID is Manual.
Fixes #823
2015-02-25 14:13:31 +00:00
Dan Cryer 18ff21174e Fixing dates: Stop all dates from appearing as the current date/time. Fixes #820 2015-02-25 10:33:11 +00:00
Dan Cryer db90f2ea11 Updating the UpdateCommand to check for a config key rather than a specific file. 2015-02-25 09:36:50 +00:00
zviryatko f4a0804100 Fix username style in user panel block. 2015-02-24 10:01:36 +02:00
Dan Cryer fba6f2372f Updating changelog. 2015-02-23 19:45:33 +00:00
Dan Cryer 1f0cd49142 Adding changelog. 2015-02-23 19:40:31 +00:00
Alex Davyskiba 1466ad06ef Allow projects to be archived.
Closes #771
2015-02-23 19:37:11 +00:00
Dan Cryer e98647bd97 Add support for Mercurial SSH-based clones. 2015-02-23 16:17:46 +00:00
nonlux 893deada33 Set the CommandExecutor buildPath property when a build is created.
Closes #556
2015-02-23 14:42:04 +00:00
Adirelle 4905679298 Email plugin: use "default_mailto_address" as a fallback only.
Closes #730
2015-02-23 14:16:35 +00:00
Matthew Leffler ea3109be67 Convert tapString to UTF-8, allowing UTF8 output from PHPUnit, etc.
Closes #738
2015-02-23 14:15:11 +00:00
Daniel Seif 610a0e57ef Fixed settings handling for symlink creation in local build
Closes #766
2015-02-23 14:07:42 +00:00
Àlex Corretgé 601318b97b Fix the problem when executing Phing out of the build dir.
Closes #778
Closes #748
2015-02-23 13:53:38 +00:00
Lee Willis 6420119f1a Make SSH key generation more robust.
Do not try and predict whether we will be able to create a key. Instead
try and create one and capture failure if it happens.

Closes #803
2015-02-23 13:49:29 +00:00
corpsee 4ffeec7767 Updated lang.ru file
Closes #807
2015-02-23 13:47:16 +00:00
Leszek 1a5ecb97b1 Update lang.pl.php
Closes #810
2015-02-23 13:46:41 +00:00
Dan Cryer dd58dd682f Adding support for commenting on Github diffs. 2015-02-23 13:40:34 +00:00
Dan Cryer 071e36a4e9 Slight cleanup to please PHPMD. 2015-02-20 14:24:37 +00:00
Dzhilkibaev Nadir 35a6d1f577 Add SVN support to PHPCI.
Closes #759
2015-02-20 14:14:36 +00:00
James Inman 9133c544d5 Adding output support to Behat plugin. 2015-02-20 13:38:42 +00:00
Dan Cryer 1f4fb58014 Update session cookie to last 12 hours. 2015-02-20 13:11:31 +00:00
Dan Cryer aca8155a43 Merge branch 'master' of github.com:Block8/PHPCI 2015-02-20 12:46:50 +00:00
Dan Cryer 69d05d6da8 Setup plugin failure should cease execution. Fixes #797 2015-02-20 12:46:43 +00:00
James Inman 6c8df9a8ce Fix missing return statement in Technical Debt. 2015-02-19 13:37:35 +00:00
Jon Gotlin bf6ac530a6 Create admin command cleanup 2015-02-19 07:31:00 +01:00
James Inman 5bb68507d8 Fixing Technical Debt error message. 2015-02-18 14:56:04 +00:00
James Inman d6f72b0b7e PHPCS/PHPMD fixes for Technical Debt plugin. 2015-02-18 14:44:04 +00:00
James Inman 2a5ac8ccbc PHPCS/DocBlock fixes to Technical Debt plugin. 2015-02-18 14:15:59 +00:00
James Inman 8f5d855193 Adding Technical Debt plugin. 2015-02-18 14:07:26 +00:00
Daniel Wolkenhauer 33f2ec172d Fatal error: Call to undefined method PHPCI\Helper\Email::setIsHtml() in ../Email.php on line 107 2015-02-16 18:51:05 +01:00
Tobias van Beek 7c4a926166 Render the public key on the project edit page. CLose #722 done by @leewillis77 2015-02-16 15:00:37 +01:00
Marco Vito Moscaritolo 2255767dc1 Fixed test that use genreated mail to see information. 2015-02-16 14:55:40 +01:00
Marco Vito Moscaritolo cbd98b6b46 Fixed typo. 2015-02-16 14:55:20 +01:00
Marco Vito Moscaritolo 885f947da8 Update loader config for test. 2015-02-16 14:55:17 +01:00
Marco Vito Moscaritolo 5b754fe07c Fixed config path for tests. 2015-02-16 14:54:41 +01:00
Marco Vito Moscaritolo 74b0513dd5 Remove unused code. 2015-02-16 14:54:41 +01:00
Marco Vito Moscaritolo 2d194de6d0 Fixed code in CC mails. 2015-02-16 14:54:41 +01:00
Marco Vito Moscaritolo 2aff5ab896 Fixed CS. 2015-02-16 14:54:41 +01:00
Marco Vito Moscaritolo 64bd64e07b Added more test case to validate subject, body, status code and mails on messages. 2015-02-16 14:54:38 +01:00
Marco Vito Moscaritolo f16395e45b Use more consistent project name loader to compose mail. 2015-02-16 14:52:48 +01:00
Marco Vito Moscaritolo 33ca150efb Added project mocking to allow using mail template on successfull build. 2015-02-16 14:52:45 +01:00
Marco Vito Moscaritolo 501ca58729 Remove unrequire parameters on constructur and fixed error on phpdoc. 2015-02-16 14:51:18 +01:00
Marco Vito Moscaritolo f192185e26 Refactor on mail sending to use Email helper and specific tempalte for successfull build. 2015-02-16 14:51:14 +01:00
Dan Cryer 4d142b61b6 Fixing other tests 2015-02-16 11:58:15 +00:00
Dan Cryer 0fc18503b2 Fixing install command tests. 2015-02-16 11:54:52 +00:00
Dan Cryer 691f2423f7 Fixing base store docblocks. 2015-02-16 11:20:18 +00:00
Igor Timoshenko 55b10948ef Added Codeception UI plugin 2015-02-16 11:47:07 +01:00
Dan Cryer 44c489dd22 Lots of cleanup. 2015-02-12 14:15:19 +00:00
Dan Cryer c20ca7c8ff Lots of cleanup. 2015-02-12 14:11:58 +00:00
Dan Cryer 5ca9d4606e Fixes 2015-02-12 13:44:16 +00:00
Dan Cryer 6576974584 Cleaning up permissions on a few files. 2015-02-12 13:42:07 +00:00
Dan Cryer 12f8d376bd Adding a default robots.txt file. 2015-02-12 13:34:15 +00:00
Dan Cryer dcbad55df8 Fixing FIXMEs 2015-02-12 13:30:32 +00:00
Dan Cryer dea615bf26 Cleanup 2015-02-12 13:20:08 +00:00
Dan Cryer 320b0efa71 Fixing run-builds. 2015-02-12 13:17:50 +00:00
Dan Cryer 54ab93373d Fixing some bugs related to the last round of changes. 2015-02-12 13:17:42 +00:00
Dan Cryer c986405861 Removing the now-unnecessary JSON.parse() call 2015-02-12 12:38:22 +00:00
Dan Cryer 489f71b8c2 Cleaning up unnecessary use of 'die' and 'exit' 2015-02-12 12:37:56 +00:00
Dan Cryer 36e3c622c8 Fixing missing use statements 2015-02-12 11:42:09 +00:00
Dan Cryer e5cbccecb5 Getting rid of debug code 2015-02-12 11:41:58 +00:00
Dan Cryer a4339fc1b6 Fixing two particularly dodgy queries in BuildStore. 2015-02-12 11:38:00 +00:00
Dan Cryer d481140ea2 Fixing issues related to LIMIT in Base Store files. 2015-02-12 11:08:45 +00:00
Dan Cryer 9379da1393 Fixing SensioLabs Insight 'Critical' violations. 2015-02-12 10:39:41 +00:00
vigo5190 4d91bd15e7 Update Slack plugin to support the latest version of the library it relies on.
Closes #742
Closes #747
2015-02-09 12:14:30 +00:00
Lee Willis 4f73063fb7 Redesigned build summary for the dashboard to include recent builds.
Closes #783
Closes #708
2015-02-09 11:34:25 +00:00
Luca 935ffe4473 Some Italian language translation improvements.
Closes #784
2015-02-09 11:24:21 +00:00
Àlex Corretgé f0d53638dc Allow modification of PHPCI variables without modifying versioned code.
Closes #786
Closes #781
2015-02-09 11:20:44 +00:00
Dan Cryer 4a1d62b44a Make build log and meta value columns use MEDIUMTEXT data type.
Closes #777
2015-02-09 11:18:34 +00:00
Daniel Seif e531c80718 Reset the status of a duplicated build to avoid strict-mode errors.
When using SQL strict mode, mysql would complain that no default value of the status column is set. Setting the status to 0 before duplicating fixes this.

Closes #725
2015-02-03 12:21:04 +00:00
Adirelle 353c4cafdb Remove duplicates from the list of recipients in the email plugin.
Closes #731
2015-02-03 11:58:18 +00:00
Adirelle 0be37b9e85 Franch translation updates.
Closes #733
2015-02-03 11:56:45 +00:00
Adirelle cd4ff6c4ea Localisation support for dates throughout the front-end using moment.js.
Closes #734
Closes #732
2015-02-03 11:53:12 +00:00
corpsee 5dced5f990 Fixing fatal error with $this->controller->layout in Application class.
Closes #736
2015-02-03 11:49:16 +00:00
corpsee 8d2c7045a4 Update the "Manual Build" string for the Russian translation.
Closes #737
2015-02-03 11:47:07 +00:00
Adam Cooper c441e72d0a Move CSS into separate file, fix width of plugins that use tables and adds table-responsive class for smaller screens.
Closes #755
2015-02-03 11:38:16 +00:00
Sergey Linnik 96b1df55b0 Add query interpolation in PostgreSQL and SQLite plugin.
Closes #757
2015-02-03 11:33:55 +00:00
Dan Cryer 9351e889e7 Fixing failing test 2015-02-03 11:20:46 +00:00
Sam Mousa 3ade895e30 Fix parameters used to check if ssh-keygen exists to prevent an indefinite hang.
Closes #764
2015-02-03 11:15:52 +00:00
Dan Cryer 731cdcce7d Fixing missing docblock error. 2015-02-03 11:10:22 +00:00
Dan Cryer 872d37b1e6 Updating dependencies. 2015-02-03 10:54:50 +00:00
Dan Cryer 9aadcce4ca Fixing tests bootstrap 2015-02-03 10:43:44 +00:00
Sebastiaan van Stijn 9387bde61b Fix undefined variable '$config' in /Tests/bootstrap.php
When no config-file was found, no instance of Config
was created as well, resulting in:

PHP Notice:  Undefined variable: config in /Tests/bootstrap.php on line 41

This changes /Tests/bootstrap.php to always create an
instance of b8\Config(), even if no file was found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Fixes #758
2015-02-03 10:30:51 +00:00
Alex Davyskiba a233c4e26c Escape commit message from XSS and broken markup.
Closes #769
2015-02-03 10:27:36 +00:00
Lee Willis 25358cdfd5 Move legends to below chart to avoid word wrapping issues
Closes #773
2015-02-03 10:12:36 +00:00
Nikolas Hagelstein 3ddc723e1f German language translation improvements.
Closes #774
2015-02-03 10:11:29 +00:00
Dan Cryer c5bdafeaa3 Fixing login is disabled checks 2015-01-22 09:17:58 +00:00
Dan Cryer c54f22985c Merge branch 'master' of github.com:Block8/PHPCI 2015-01-13 12:38:48 +00:00
Dan Cryer c93cdf7fe5 Fixing b8 logo and link on login screen. 2015-01-13 12:38:39 +00:00
Dan Cryer e9e0ba8593 Merge pull request #722 from REBELinBLUE/slack-bug-fix
Fixing issue with status overwriting message
2014-12-23 15:41:45 +00:00
Stephen Ball 44f1445bbe Fixing issue with status overwriting message 2014-12-23 15:30:09 +00:00
Dan Cryer 3235550267 Fixing Polish language name, docblocks in Lang helper. 2014-12-23 11:53:33 +00:00
Dan Cryer 5f11e1997c Trying to reduce complexity of language init method. 2014-12-23 11:36:01 +00:00
Dan Cryer 9599759ade Adding Ukranian language. 2014-12-22 16:23:29 +00:00
Dan Cryer 94bf5c2e1c Adding Italian language, closes #721 2014-12-22 16:23:20 +00:00
Marco Vito Moscaritolo 9e474d8e7e Update all IT config. 2014-12-22 16:18:53 +00:00
Marco Vito Moscaritolo 4adf48e974 Added translations for PHPCI application. 2014-12-22 16:18:53 +00:00
Marco Vito Moscaritolo 6d28d120e8 Initial IT translation (not complete) 2014-12-22 16:18:53 +00:00
Dan Cryer 0afc28cb69 Fixes 2014-12-22 16:18:33 +00:00
Stephen Ball f78b6ae9f9 Cleanup of the disabled login mode.
Hides user menu, the navigation user panel, etc.

Closes #718
2014-12-22 16:12:51 +00:00
Artjom Kurapov c2c51e376b Logarithmic vertical scale for charts
Since we have one diagram for multiple results, we may have PHPCS result giving 12000 errors, while PHPUnit gives 200 tests, and 1 failed test.. those numbers and their variation won't be very visible, unless we use logarithmic scale

Closes #686
2014-12-22 16:05:31 +00:00
Stephen Ball fd8f318401 Add a plugin to handle sending notifications to Slack (https://slack.com/)
Closes #720
2014-12-22 16:03:09 +00:00
Dan Cryer 094a84f9b4 Hopefully re-greening the build. 2014-12-22 15:48:35 +00:00
Dan Cryer 71addb95c3 Adding Greek and Polish language files. 2014-12-18 10:47:21 +00:00
Dan Cryer a6e2f835a6 Merge branch 'dc/languages' of github.com:Block8/PHPCI into dc/languages 2014-12-18 10:45:32 +00:00
Dan Cryer 72581aa01e Merge fixes 2014-12-18 10:45:21 +00:00
Dan Cryer d52e64d7f3 Merge fixes 2014-12-18 10:16:31 +00:00
Alex Davyskiba d2505dcef6 Update Gitlab URL parsing to no longer require a project namespace.
Closes #702
2014-12-18 10:02:43 +00:00
Lucas Gois e4bf5ee27d Added support for gitlab merge requests
Added function to verify if a gitlab merge request is sent.
If yes, then will create a build for the source branch of the request.

Closes #699
2014-12-18 09:51:09 +00:00
Stephen Ball 768a8a180c New plugin to support PHP TAL linting.
Closes #701
2014-12-18 09:45:17 +00:00
Guillaume Perréal a2e97c69ac Prepend the build path to ignored directories in PhpParallelLint.php.
Closes #710
2014-12-18 09:40:25 +00:00
Guillaume Perréal 0beb77113a Have the PhpUnit plugin reports an explicit error when no test are configured.
Closes #711
2014-12-18 09:38:36 +00:00
Guillaume Perréal f37c3450e3 In build view, only show meta of builds for the branch of the selected build. 2014-12-18 09:36:54 +00:00
Alex Davyskiba 67b2348a7a Fix word wrapping on public key.
Closes #703
2014-12-18 09:34:42 +00:00
Dan Cryer 965636efde Fix checking of environment variable for PHPCI config file. 2014-12-18 09:34:07 +00:00
Dan Cryer 977a37173d Update README.md 2014-12-12 14:57:19 +00:00
Dan Cryer 1bbdd5c3be Merge pull request #700 from matthiasmullie/dc/languages
Some minor Dutch translation improvements
2014-12-11 17:29:17 +00:00
Matthias Mullie b8a6f5255c Some minor Dutch translation improvements 2014-12-11 18:26:04 +01:00
Dan Cryer 28b24952ab Fixing Docblock checker issue 2014-12-11 17:09:55 +00:00
Dan Cryer c81c0311cb Fixing PHPMD errors 2014-12-11 17:07:06 +00:00
Dan Cryer 08ec6f8a62 Adding German language, thanks to @thormeier and @mikebronner 2014-12-11 17:01:32 +00:00
Dan Cryer 41d0138ef3 Adding Danish language, thanks to @NamelessCoder 2014-12-11 17:00:59 +00:00
Dan Cryer d2060ebe95 Adding Dutch language, thanks to @matthiasmullie 2014-12-11 17:00:12 +00:00
Dan Cryer 67b0453a30 Some language updates from Transifex 2014-12-11 16:59:27 +00:00
Dan Cryer c230d1c347 Allow admins to change the default language for their installation. 2014-12-11 16:32:42 +00:00
Dan Cryer b99b09d13c Allow users to change their Language via the Edit Profile page. 2014-12-11 16:26:09 +00:00
Dan Cryer 73ea94c7a2 Updating Gitlab to GitLab 2014-12-11 15:15:08 +00:00
Dan Cryer 9ef18f5580 Updating Github to GitHub, and MySQL name to MySQL database name 2014-12-11 15:14:11 +00:00
Dan Cryer 82ecb97fba Updating composer.lock 2014-12-11 14:35:16 +00:00
Dan Cryer 036501b363 Removing apparently redundant requirement for mcrypt. 2014-12-11 14:35:07 +00:00
Stéphane HULARD d59c0e1054 End of French translation
Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
2014-12-10 14:05:09 +00:00
Stéphane HULARD dff8e55b41 Add the first French translations 2014-12-10 14:05:08 +00:00
Dan Cryer bfcbeabb62 Adding UTF-8 charset to login page. 2014-12-10 14:04:16 +00:00
Dan Cryer a4e6134fde Fixing bootstrap 2014-12-08 15:09:57 +00:00
Dan Cryer c89d289408 Fixing tests 2014-12-08 15:04:44 +00:00
Dan Cryer a8ec69e6dd Commenting the language helper, also fixing the default language name. 2014-12-08 14:27:53 +00:00
Dan Cryer 9de19d6bbb Merging latest master 2014-12-08 14:18:57 +00:00
Dan Cryer 7f9a09fa29 Adding Docblocks throughout the project and lowering the missing docblock limit in phpci.yml to zero.
Closes #692
2014-12-08 14:12:01 +00:00
Marc Aschmann effd6909aa reimplemented disable user 2014-12-07 17:51:00 +01:00
Marc Aschmann 2df2ca5cb5 merged current upstream/master 2014-12-07 17:50:19 +01:00
Dan Cryer 5e7301d662 Switching to using moment.js for times in JS, rather than a custom solution. Fixes #688 2014-12-07 11:51:41 +00:00
Dan Cryer 3f15c0618a Moving languages to two letter locales where the four-letter equivalent is not necessary. 2014-12-07 11:39:33 +00:00
Nikolay Kirsh 061215deed Обновление русского языка
- укорочены слишком длинные строки
- исправлены орфографические ошибки
- доработаны склонения
2014-12-07 11:14:30 +00:00
Dan Cryer b593707ef4 Making JSON_UNESCAPED_UNICODE change apply to 5.4+, whilst still supporting 5.3. 2014-12-07 11:12:56 +00:00
Nikolay Kirsh 50ed5b7e07 fix unicode strings in json 2014-12-07 11:11:32 +00:00
corpsee e11f8744ac Fixed wrong text for add plugin action 2014-12-07 11:07:07 +00:00
corpsee bb9b068ea5 Deleted duplicate key in localization 2014-12-07 11:07:07 +00:00
Dan Cryer 44d775c79c Ignoring errors in lang files for PHPCI. 2014-12-04 19:39:07 +00:00
corpsee ea55e594b1 Improved Russian translation 2014-12-04 19:33:22 +00:00
corpsee 6fa08d7e44 Added Russian translation (+console) 2014-12-04 19:33:21 +00:00
corpsee f6dc3aad08 Added Russian translation 2014-12-04 19:33:21 +00:00
Dan Cryer 5dd42da9a0 Builder, build plugins 2014-12-04 15:48:52 +00:00
Dan Cryer 6e469b01ec Installer and Updater 2014-12-04 15:01:19 +00:00
Dan Cryer bfca6bc27a Plugins 2014-12-04 14:40:28 +00:00
Dan Cryer 5f3b1c0c53 Users and Settings 2014-12-04 14:30:43 +00:00
Dan Cryer cea124cfaa Login, forgot password and password reset. 2014-12-04 13:24:46 +00:00
Dan Cryer 4a03e01c3f View build 2014-12-04 13:08:48 +00:00
Dan Cryer 54765bf823 View Project 2014-12-04 12:19:06 +00:00
Dan Cryer cc58191048 Add/Edit/View Project languages 2014-12-04 11:42:21 +00:00
Dan Cryer f6e433a94d Dashboard updated to support languages 2014-12-04 11:14:04 +00:00
Dan Cryer 56bbf13f34 Merge branch 'master' of github.com:Block8/PHPCI into dc/languages 2014-12-04 10:23:16 +00:00
Dan Cryer 050fdda848 Initial commit 2014-12-04 10:23:10 +00:00
Dan Cryer a2d136e0f1 Fixes for date JS issues in Safari 2014-12-03 20:53:46 +00:00
Dan Cryer 60dab35f1e Fixing fatal error on dashboard, also adding slim view for installs with more than 10 projects 2014-12-03 20:26:32 +00:00
Dan Cryer 9eeaabc6fe Front-End Upgrade: New UI Based on Admin LTE.
Closes #673
2014-12-03 15:30:36 +00:00
Marc Aschmann a5d5be1a8b Merge remote-tracking branch 'block8/master' 2014-08-05 13:44:32 +02:00
Marc Aschmann 1dcc483ccb resolves #497 added feature to disable auth with a default user 2014-07-15 11:39:06 +02:00
1053 changed files with 213454 additions and 3979 deletions

41
.github/CONTRIBUTING.md vendored Normal file
View file

@ -0,0 +1,41 @@
Contributions to PHPCI are very much encouraged, and we do our best to make it as welcoming and simple as possible.
### Before You Start
Before you start, please make sure that you are aware of, and agree to, the following conditions of contribution:
* By making a contribution to PHPCI, you accept that you are granting copyright ownership for that contribution to Block 8 Limited - the company responsible for PHPCI. In countries where copyright reassignment is not permitted, you grant Block 8 Limited a perpetual, non-exclusive licence to use your contribution in any way and for any purpose.
* By making a contribution to PHPCI, you accept that your code will be released under the open-source [BSD 2-Clause Licence](https://github.com/Block8/PHPCI/blob/master/LICENSE.md).
Block 8 are committed to PHPCI being a truly free and open source project, providing easy to use continuous integration and testing to as many developers as possible. We may, at our sole discretion, provide paid services based upon PHPCI - but PHPCI will always remain free (as in cost, and freedom) and open source.
### The Contribution Process
1. If you are thinking of making a large change or feature addition, [open an issue](/Block8/PHPCI/issues) titled "Intent to implement: <Your Feature>". Describe your idea in detail and discuss it with the community. It might be that someone already has a plan, could help you out, or your idea may simply not be suitable for the project at this time.
2. Fork the PHPCI project on Github
3. Add a feature or fix a bug - We recommend that you do this on a branch within your repository.
4. Create a pull request containing just the one change you want to contribute back to PHPCI. If you have more than one feature or bug fix, please create separate branches within your repository, and then submit a separate pull request for each one. Your pull request should use the template detailed below.
5. We'll then review your pull request and give any necessary feedback, this could be:
* Suggestions to improve your implementation
* Questions
* Issues/bugs related to the change
* Coding standards pointers
6. Once everyone is happy with the submission, we'll merge it back into PHPCI. Your change will then be included in the next project release.
### Not sure what to start with?
We maintain two labels within our issue tracker that may be of interest to new contributors:
* [The "Easy Fix" List](https://github.com/Block8/PHPCI/labels/flag:easy-fix)
* [The "Priority" List](https://github.com/Block8/PHPCI/labels/flag:priority)
### Coding Standards
We require that all contributions meet at least the following guidelines:
* PSR-1 & PSR-2 compliance for all code
* Doc-blocks for all classes and methods
* All files must contain the standard file-level docblock, including the copyright, license and link tags.
All pull requests will be checked against these standards. If you're modifying a file as part of your change which does not comply with the above, please make the necessary changes to bring it into compliance prior to submitting the pull request.
### Other Requirements
When you're adding new features or functionality, or you're updating existing functionality, please ensure that the relevant documentation is also either created or updated on the Wiki.

28
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,28 @@
Before submitting your issue, please make sure that you've checked all of the checkboxes below.
- [ ] You're running the [latest release](https://github.com/Block8/PHPCI/releases/latest) version of PHPCI.
- [ ] Ensure that you're running at least PHP 5.3.6, you can check this by running `php -v`
- [ ] You've run `composer install --no-dev -o` from the root of your installation.
- [ ] You have set up either the PHPCI [Worker](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-a-Worker), [Daemon](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-a-Daemon) or [Cron Job](https://github.com/Block8/PHPCI/wiki/Run-Builds-Using-Cron) to run builds.
To help us better understand your issue, please answer the following.
### Expected behaviour
*Please describe what you're expecting to see happen.*
### Actual behaviour
*Please describe what you're actually seeing happen.*
### Steps to reproduce
*If your issue requires any specific steps to reproduce, please outline them here.*
### Environment info
Operating System:
PHP Version:
MySQL Version:
### Logs or other output that would be helpful
(If logs are large, please upload as attachment).

23
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,23 @@
Contribution Type: bug fix | new plugin | new feature | refactor | cosmetic
Link to Intent to Implement:
Link to Bug:
This pull request affects the following areas:
* [ ] Front-End
* [ ] Builder
* [ ] Build Plugins
**In raising this pull request, I confirm the following (please check boxes):**
- [ ] I have read and understood the [contributing guidelines](/.github/CONTRIBUTING.md)?
- [ ] I have checked that another pull request for this purpose does not exist.
- [ ] I have considered, and confirmed that this submission will be valuable to others.
- [ ] I have created or updated the relevant documentation for this change on the PHPCI Wiki.
- [ ] Do the PHPCI tests pass?
Detailed description of change:

2
.gitignore vendored
View file

@ -15,3 +15,5 @@ PHPCI/Model/Migration.php
PHPCI/Model/Base/MigrationBase.php
PHPCI/Store/MigrationStore.php
PHPCI/Store/Base/MigrationStoreBase.php
local_vars.php
Tests/PHPCI/config.yml

View file

@ -7,25 +7,32 @@ build_settings:
- "public/install.php" # PHPCS really doesn't like PHP mixed with HTML (and so it shouldn't)
- "PHPCI/Migrations" # Ignore the migrations directory, as both PHPMD and PHPCS can't cope with them.
- "PHPCI/Model/Base" # These files are auto-generated, and sometimes hit PHPMD complexity thresholds.
- "PHPCI/Languages" # PHPCS fails on character counts for non-Latin languages
- "public/assets" # If there are any PHP files in here, we didn't write them.
setup:
composer:
action: "install"
prefer_dist: false
test:
php_parallel_lint:
ignore:
# Only ignore vendor
- vendor/
php_mess_detector:
allowed_warnings: 0
rules:
- phpmd.xml
php_code_sniffer:
standard: "PSR2"
standard: phpcs.xml
allowed_warnings: 0
allowed_errors: 0
php_loc:
php_unit:
php_docblock_checker:
allowed_warnings: -1 # Allow unlimited warnings for now.
allowed_warnings: 0
failure:
broken:
email:
committer: true
cc: ["php-ci@googlegroups.com"]

View file

@ -7,7 +7,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C E5267A6C 0
RUN apt-get update
# Install PHP:
RUN apt-get install -qy git-core php5-common php5-cli php5-curl php5-imap php5-mcrypt php5-mysqlnd
RUN apt-get install -qy git-core php5-common php5-cli php5-curl php5-imap php5-mysqlnd
# Give Git some fake user details to prevent it asking when trying to test merges:
RUN git config --global user.name "PHPCI"
@ -15,4 +15,7 @@ RUN git config --global user.email "hello@php.ci"
ADD ./ /phpci
RUN php -r "readfile('https://getcomposer.org/installer');" | php
RUN mv composer.phar /phpci/composer
CMD /phpci/daemonise phpci:daemonise

View file

@ -6,4 +6,4 @@ Redistribution and use in source and binary forms, with or without modification,
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -21,6 +21,14 @@ use b8\View;
*/
class Application extends b8\Application
{
/**
* @var \PHPCI\Controller
*/
protected $controller;
/**
* Initialise PHPCI - Handles session verification, routing, etc.
*/
public function init()
{
$request =& $this->request;
@ -43,11 +51,13 @@ class Application extends b8\Application
return false;
};
$skipAuth = array($this, 'shouldSkipAuth');
// Handler for the route we're about to register, checks for a valid session where necessary:
$routeHandler = function (&$route, Response &$response) use (&$request, $validateSession) {
$routeHandler = function (&$route, Response &$response) use (&$request, $validateSession, $skipAuth) {
$skipValidation = in_array($route['controller'], array('session', 'webhook', 'build-status'));
if (!$skipValidation && !$validateSession()) {
if (!$skipValidation && !$validateSession() && (!is_callable($skipAuth) || !$skipAuth())) {
if ($request->isAjax()) {
$response->setResponseCode(401);
$response->setContent('');
@ -66,9 +76,12 @@ class Application extends b8\Application
$this->router->clearRoutes();
$this->router->register($route, $opts, $routeHandler);
}
/**
* Handle an incoming web request.
*/
* Handle an incoming web request.
*
* @return b8\b8\Http\Response|Response
*/
public function handleRequest()
{
try {
@ -91,18 +104,71 @@ class Application extends b8\Application
$this->response->setContent($view->render());
}
if (View::exists('layout') && $this->response->hasLayout()) {
$view = new View('layout');
$pageTitle = $this->config->get('page_title', null);
if ($this->response->hasLayout() && $this->controller->layout) {
$this->setLayoutVariables($this->controller->layout);
if (!is_null($pageTitle)) {
$view->title = $pageTitle;
}
$view->content = $this->response->getContent();
$this->response->setContent($view->render());
$this->controller->layout->content = $this->response->getContent();
$this->response->setContent($this->controller->layout->render());
}
return $this->response;
}
/**
* Loads a particular controller, and injects our layout view into it.
* @param $class
* @return mixed
*/
protected function loadController($class)
{
$controller = parent::loadController($class);
$controller->layout = new View('layout');
$controller->layout->title = 'PHPCI';
$controller->layout->breadcrumb = array();
return $controller;
}
/**
* Injects variables into the layout before rendering it.
* @param View $layout
*/
protected function setLayoutVariables(View &$layout)
{
$groups = array();
$groupStore = b8\Store\Factory::getStore('ProjectGroup');
$groupList = $groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
foreach ($groupList['items'] as $group) {
$thisGroup = array('title' => $group->getTitle());
$projects = b8\Store\Factory::getStore('Project')->getByGroupId($group->getId());
$thisGroup['projects'] = $projects['items'];
$groups[] = $thisGroup;
}
$layout->groups = $groups;
}
/**
* Check whether we should skip auth (because it is disabled)
* @return bool
*/
protected function shouldSkipAuth()
{
$config = b8\Config::getInstance();
$state = (bool)$config->get('phpci.authentication_settings.state', false);
$userId = $config->get('phpci.authentication_settings.user_id', 0);
if (false !== $state && 0 != (int)$userId) {
$user = b8\Store\Factory::getStore('User')
->getByPrimaryKey($userId);
if ($user) {
$_SESSION['phpci_user'] = $user;
return true;
}
}
return false;
}
}

View file

@ -36,35 +36,44 @@ class BuildFactory
/**
* Takes a generic build and returns a type-specific build model.
* @param Build $base The build from which to get a more specific build type.
* @param Build $build The build from which to get a more specific build type.
* @return Build
*/
public static function getBuild(Build $base)
public static function getBuild(Build $build)
{
switch($base->getProject()->getType())
{
case 'remote':
$type = 'RemoteGitBuild';
break;
case 'local':
$type = 'LocalBuild';
break;
case 'github':
$type = 'GithubBuild';
break;
case 'bitbucket':
$type = 'BitbucketBuild';
break;
case 'gitlab':
$type = 'GitlabBuild';
break;
case 'hg':
$type = 'MercurialBuild';
break;
$project = $build->getProject();
if (!empty($project)) {
switch ($project->getType()) {
case 'remote':
$type = 'RemoteGitBuild';
break;
case 'local':
$type = 'LocalBuild';
break;
case 'github':
$type = 'GithubBuild';
break;
case 'bitbucket':
$type = 'BitbucketBuild';
break;
case 'gitlab':
$type = 'GitlabBuild';
break;
case 'hg':
$type = 'MercurialBuild';
break;
case 'svn':
$type = 'SubversionBuild';
break;
default:
return $build;
}
$class = '\\PHPCI\\Model\\Build\\' . $type;
$build = new $class($build->getDataArray());
}
$type = '\\PHPCI\\Model\\Build\\' . $type;
return new $type($base->getDataArray());
return $build;
}
}

View file

@ -10,6 +10,7 @@
namespace PHPCI;
use PHPCI\Helper\BuildInterpolator;
use PHPCI\Helper\Lang;
use PHPCI\Helper\MailerFactory;
use PHPCI\Logging\BuildLogger;
use PHPCI\Model\Build;
@ -135,7 +136,7 @@ class Builder implements LoggerAwareInterface
public function setConfigArray($config)
{
if (is_null($config) || !is_array($config)) {
throw new \Exception('This project does not contain a phpci.yml file, or it is empty.');
throw new \Exception(Lang::get('missing_phpci_yml'));
}
$this->config = $config;
@ -187,6 +188,14 @@ class Builder implements LoggerAwareInterface
$this->build->sendStatusPostback();
$success = true;
$previous_build = $this->build->getProject()->getPreviousBuild($this->build->getBranch());
$previous_state = Build::STATUS_NEW;
if ($previous_build) {
$previous_state = $previous_build->getStatus();
}
try {
// Set up the build:
$this->setupBuild();
@ -204,34 +213,41 @@ class Builder implements LoggerAwareInterface
$this->build->setStatus(Build::STATUS_FAILED);
}
// Complete stage plugins are always run
$this->pluginExecutor->executePlugins($this->config, 'complete');
if ($success) {
$this->pluginExecutor->executePlugins($this->config, 'success');
$this->buildLogger->logSuccess('BUILD SUCCESSFUL!');
if ($previous_state == Build::STATUS_FAILED) {
$this->pluginExecutor->executePlugins($this->config, 'fixed');
}
$this->buildLogger->logSuccess(Lang::get('build_success'));
} else {
$this->pluginExecutor->executePlugins($this->config, 'failure');
$this->buildLogger->logFailure("BUILD FAILURE");
}
// Clean up:
$this->buildLogger->log('Removing build.');
if ($previous_state == Build::STATUS_SUCCESS || $previous_state == Build::STATUS_NEW) {
$this->pluginExecutor->executePlugins($this->config, 'broken');
}
$cmd = 'rm -Rf "%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s"';
$this->buildLogger->logFailure(Lang::get('build_failed'));
}
$this->executeCommand($cmd, $this->buildPath);
} catch (\Exception $ex) {
$this->build->setStatus(Build::STATUS_FAILED);
$this->buildLogger->logFailure('Exception: ' . $ex->getMessage());
$this->buildLogger->logFailure(Lang::get('exception') . $ex->getMessage());
}finally{
// Complete stage plugins are always run
$this->pluginExecutor->executePlugins($this->config, 'complete');
}
// Update the build in the database, ping any external services, etc.
$this->build->sendStatusPostback();
$this->build->setFinished(new \DateTime());
// Clean up:
$this->buildLogger->log(Lang::get('removing_build'));
$this->build->removeBuildDirectory();
$this->store->save($this->build);
}
@ -251,6 +267,10 @@ class Builder implements LoggerAwareInterface
return $this->commandExecutor->getLastOutput();
}
/**
* Specify whether exec output should be logged.
* @param bool $enableLog
*/
public function logExecOutput($enableLog = true)
{
$this->commandExecutor->logExecOutput = $enableLog;
@ -258,12 +278,14 @@ class Builder implements LoggerAwareInterface
/**
* Find a binary required by a plugin.
* @param $binary
* @param string $binary
* @param bool $quiet
*
* @return null|string
*/
public function findBinary($binary)
public function findBinary($binary, $quiet = false)
{
return $this->commandExecutor->findBinary($binary, $this->buildPath);
return $this->commandExecutor->findBinary($binary, $quiet = false);
}
/**
@ -282,8 +304,7 @@ class Builder implements LoggerAwareInterface
*/
protected function setupBuild()
{
$this->buildPath = PHPCI_DIR . 'PHPCI/build/' . $this->build->getId() . '/';
$this->build->currentBuildPath = $this->buildPath;
$this->buildPath = $this->build->getBuildPath();
$this->interpolator->setupInterpolationVars(
$this->build,
@ -291,9 +312,11 @@ class Builder implements LoggerAwareInterface
PHPCI_URL
);
$this->commandExecutor->setBuildPath($this->buildPath);
// Create a working copy of the project:
if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
throw new \Exception('Could not create a working copy.');
throw new \Exception(Lang::get('could_not_create_working'));
}
// Does the project's phpci.yml request verbose mode?
@ -306,7 +329,7 @@ class Builder implements LoggerAwareInterface
$this->ignore = $this->config['build_settings']['ignore'];
}
$this->buildLogger->logSuccess('Working copy created: ' . $this->buildPath);
$this->buildLogger->logSuccess(Lang::get('working_copy_created', $this->buildPath));
return true;
}
@ -321,6 +344,12 @@ class Builder implements LoggerAwareInterface
$this->buildLogger->setLogger($logger);
}
/**
* Write to the build log.
* @param $message
* @param string $level
* @param array $context
*/
public function log($message, $level = LogLevel::INFO, $context = array())
{
$this->buildLogger->log($message, $level, $context);

View file

@ -10,116 +10,73 @@
namespace PHPCI\Command;
use PHPCI\Service\UserService;
use PHPCI\Helper\Lang;
use PHPCI\Store\UserStore;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use b8\Store\Factory;
use PHPCI\Builder;
/**
* Create admin command - creates an admin user
* @author Wogan May (@woganmay)
* @package PHPCI
* @subpackage Console
*/
* Create admin command - creates an admin user
* @author Wogan May (@woganmay)
* @package PHPCI
* @subpackage Console
*/
class CreateAdminCommand extends Command
{
/**
* @var UserStore
*/
protected $userStore;
/**
* @param UserStore $userStore
*/
public function __construct(UserStore $userStore)
{
parent::__construct();
$this->userStore = $userStore;
}
protected function configure()
{
$this
->setName('phpci:create-admin')
->setDescription('Create an admin user');
->setDescription(Lang::get('create_admin_user'));
}
/**
* Creates an admin user in the existing PHPCI database
*/
* Creates an admin user in the existing PHPCI database
*
* {@inheritDoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$userStore = Factory::getStore('User');
$userService = new UserService($userStore);
$userService = new UserService($this->userStore);
require(PHPCI_DIR . 'bootstrap.php');
/** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */
$dialog = $this->getHelperSet()->get('dialog');
// Try to create a user account:
$adminEmail = $this->ask('Admin email address: ', true, FILTER_VALIDATE_EMAIL);
// Function to validate mail address.
$mailValidator = function ($answer) {
if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
}
if (empty($adminEmail)) {
return;
}
return $answer;
};
$adminPass = $this->ask('Admin password: ');
$adminName = $this->ask('Admin name: ');
$adminEmail = $dialog->askAndValidate($output, Lang::get('enter_email'), $mailValidator, false);
$adminName = $dialog->ask($output, Lang::get('enter_name'));
$adminPass = $dialog->askHiddenResponse($output, Lang::get('enter_password'));
try {
$userService->createUser($adminName, $adminEmail, $adminPass, 1);
print 'User account created!' . PHP_EOL;
} catch (\Exception $ex) {
print 'There was a problem creating your account. :(' . PHP_EOL;
print $ex->getMessage();
print PHP_EOL;
$userService->createUser($adminName, $adminEmail, $adminPass, true);
$output->writeln(Lang::get('user_created'));
} catch (\Exception $e) {
$output->writeln(sprintf('<error>%s</error>', Lang::get('failed_to_create')));
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
}
}
protected function ask($question, $emptyOk = false, $validationFilter = null)
{
print $question . ' ';
$rtn = '';
$stdin = fopen('php://stdin', 'r');
$rtn = fgets($stdin);
fclose($stdin);
$rtn = trim($rtn);
if (!$emptyOk && empty($rtn)) {
$rtn = $this->ask($question, $emptyOk, $validationFilter);
} elseif ($validationFilter != null && ! empty($rtn)) {
if (! $this -> controlFormat($rtn, $validationFilter, $statusMessage)) {
print $statusMessage;
$rtn = $this->ask($question, $emptyOk, $validationFilter);
}
}
return $rtn;
}
protected function controlFormat($valueToInspect, $filter, &$statusMessage)
{
$filters = !(is_array($filter))? array($filter) : $filter;
$statusMessage = '';
$status = true;
$options = array();
foreach ($filters as $filter) {
if (! is_int($filter)) {
$regexp = $filter;
$filter = FILTER_VALIDATE_REGEXP;
$options = array(
'options' => array(
'regexp' => $regexp,
)
);
}
if (! filter_var($valueToInspect, $filter, $options)) {
$status = false;
switch ($filter)
{
case FILTER_VALIDATE_URL:
$statusMessage = 'Incorrect url format.' . PHP_EOL;
break;
case FILTER_VALIDATE_EMAIL:
$statusMessage = 'Incorrect e-mail format.' . PHP_EOL;
break;
case FILTER_VALIDATE_REGEXP:
$statusMessage = 'Incorrect format.' . PHP_EOL;
break;
}
}
}
return $status;
}
}

View file

@ -0,0 +1,85 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Command;
use PHPCI\Helper\Lang;
use PHPCI\Service\BuildService;
use PHPCI\Store\ProjectStore;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Create build command - creates a build for a project
* @author Jérémy DECOOL (@jdecool)
* @package PHPCI
* @subpackage Console
*/
class CreateBuildCommand extends Command
{
/**
* @var ProjectStore
*/
protected $projectStore;
/**
* @var BuildService
*/
protected $buildService;
/**
* @param ProjectStore $projectStore
*/
public function __construct(ProjectStore $projectStore, BuildService $buildService)
{
parent::__construct();
$this->projectStore = $projectStore;
$this->buildService = $buildService;
}
/**
* {@inheritDoc}
*/
protected function configure()
{
$this
->setName('phpci:create-build')
->setDescription(Lang::get('create_build_project'))
->addArgument('projectId', InputArgument::REQUIRED, Lang::get('project_id_argument'))
->addOption('commit', null, InputOption::VALUE_OPTIONAL, Lang::get('commit_id_option'))
->addOption('branch', null, InputOption::VALUE_OPTIONAL, Lang::get('branch_name_option'));
}
/**
* {@inheritDoc}
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$projectId = $input->getArgument('projectId');
$commitId = $input->getOption('commit');
$branch = $input->getOption('branch');
$project = $this->projectStore->getById($projectId);
if (empty($project)) {
throw new \InvalidArgumentException('Project does not exist: ' . $projectId);
}
try {
$this->buildService->createBuild($project, $commitId, $branch);
$output->writeln(Lang::get('build_created'));
} catch (\Exception $e) {
$output->writeln(sprintf('<error>%s</error>', Lang::get('failed')));
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
}
}
}

View file

@ -1,4 +1,5 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
@ -10,33 +11,48 @@
namespace PHPCI\Command;
use Monolog\Logger;
use PHPCI\ProcessControl\Factory;
use PHPCI\ProcessControl\ProcessControlInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use b8\Store\Factory;
use PHPCI\Builder;
use PHPCI\BuildFactory;
/**
* Daemon that loops and call the run-command.
* @author Gabriel Baker <gabriel.baker@autonomicpilot.co.uk>
* @package PHPCI
* @subpackage Console
*/
* Daemon that loops and call the run-command.
* @author Gabriel Baker <gabriel.baker@autonomicpilot.co.uk>
* @package PHPCI
* @subpackage Console
*/
class DaemonCommand extends Command
{
/**
* @var \Monolog\Logger
* @var Logger
*/
protected $logger;
public function __construct(Logger $logger, $name = null)
/**
* @var string
*/
protected $pidFilePath;
/**
* @var string
*/
protected $logFilePath;
/**
* @var ProcessControlInterface
*/
protected $processControl;
public function __construct(Logger $logger, ProcessControlInterface $processControl = null, $name = null)
{
parent::__construct($name);
$this->logger = $logger;
$this->processControl = $processControl ?: Factory::getInstance();
}
protected function configure()
@ -45,17 +61,30 @@ class DaemonCommand extends Command
->setName('phpci:daemon')
->setDescription('Initiates the daemon to run commands.')
->addArgument(
'state',
InputArgument::REQUIRED,
'start|stop|status'
);
'state', InputArgument::REQUIRED, 'start|stop|status'
)
->addOption(
'pid-file', 'p', InputOption::VALUE_REQUIRED,
'Path of the PID file',
implode(DIRECTORY_SEPARATOR,
array(PHPCI_DIR, 'daemon', 'daemon.pid'))
)
->addOption(
'log-file', 'l', InputOption::VALUE_REQUIRED,
'Path of the log file',
implode(DIRECTORY_SEPARATOR,
array(PHPCI_DIR, 'daemon', 'daemon.log'))
);
}
/**
* Loops through running.
*/
* Loops through running.
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->pidFilePath = $input->getOption('pid-file');
$this->logFilePath = $input->getOption('log-file');
$state = $input->getArgument('state');
switch ($state) {
@ -66,64 +95,108 @@ class DaemonCommand extends Command
$this->stopDaemon();
break;
case 'status':
$this->statusDaemon();
$this->statusDaemon($output);
break;
default:
echo "Not a valid choice, please use start stop or status";
$this->output->writeln("<error>Not a valid choice, please use start, stop or status</error>");
break;
}
}
protected function startDaemon()
{
if (file_exists(PHPCI_DIR.'/daemon/daemon.pid')) {
echo "Already started\n";
$this->logger->warning("Daemon already started");
$pid = $this->getRunningPid();
if ($pid) {
$this->logger->notice("Daemon already started", array('pid' => $pid));
return "alreadystarted";
}
$logfile = PHPCI_DIR."/daemon/daemon.log";
$this->logger->info("Trying to start the daemon");
$cmd = "nohup %s/daemonise phpci:daemonise > %s 2>&1 &";
$command = sprintf($cmd, PHPCI_DIR, $logfile);
$this->logger->info("Daemon started");
exec($command);
$command = sprintf($cmd, PHPCI_DIR, $this->logFilePath);
$output = $exitCode = null;
exec($command, $output, $exitCode);
if ($exitCode !== 0) {
$this->logger->error(sprintf("daemonise exited with status %d", $exitCode));
return "notstarted";
}
for ($i = 0; !($pid = $this->getRunningPid()) && $i < 5; $i++) {
sleep(1);
}
if (!$pid) {
$this->logger->error("Could not start the daemon");
return "notstarted";
}
$this->logger->notice("Daemon started", array('pid' => $pid));
return "started";
}
protected function stopDaemon()
{
if (!file_exists(PHPCI_DIR.'/daemon/daemon.pid')) {
echo "Not started\n";
$this->logger->warning("Can't stop daemon as not started");
$pid = $this->getRunningPid();
if (!$pid) {
$this->logger->notice("Cannot stop the daemon as it is not started");
return "notstarted";
}
$cmd = "kill $(cat %s/daemon/daemon.pid)";
$command = sprintf($cmd, PHPCI_DIR);
exec($command);
$this->logger->info("Daemon stopped");
unlink(PHPCI_DIR.'/daemon/daemon.pid');
}
$this->logger->info("Trying to terminate the daemon", array('pid' => $pid));
$this->processControl->kill($pid);
protected function statusDaemon()
{
if (!file_exists(PHPCI_DIR.'/daemon/daemon.pid')) {
echo "Not running\n";
return "notrunning";
for ($i = 0; ($pid = $this->getRunningPid()) && $i < 5; $i++) {
sleep(1);
}
$pid = trim(file_get_contents(PHPCI_DIR.'/daemon/daemon.pid'));
$pidcheck = sprintf("/proc/%s", $pid);
if (is_dir($pidcheck)) {
echo "Running\n";
if ($pid) {
$this->logger->warning("The daemon is resiting, trying to kill it", array('pid' => $pid));
$this->processControl->kill($pid, true);
for ($i = 0; ($pid = $this->getRunningPid()) && $i < 5; $i++) {
sleep(1);
}
}
if (!$pid) {
$this->logger->notice("Daemon stopped");
return "stopped";
}
$this->logger->error("Could not stop the daemon");
}
protected function statusDaemon(OutputInterface $output)
{
$pid = $this->getRunningPid();
if ($pid) {
$output->writeln(sprintf('The daemon is running, PID: %d', $pid));
return "running";
}
unlink(PHPCI_DIR.'/daemon/daemon.pid');
echo "Not running\n";
$output->writeln('The daemon is not running');
return "notrunning";
}
/** Check if there is a running daemon
*
* @return int|null
*/
protected function getRunningPid()
{
if (!file_exists($this->pidFilePath)) {
return;
}
$pid = intval(trim(file_get_contents($this->pidFilePath)));
if($this->processControl->isRunning($pid, true)) {
return $pid;
}
// Not found, remove the stale PID file
unlink($this->pidFilePath);
}
}

View file

@ -12,9 +12,7 @@ namespace PHPCI\Command;
use Monolog\Logger;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@ -76,6 +74,7 @@ class DaemoniseCommand extends Command
$this->sleep = 0;
$runner = new RunCommand($this->logger);
$runner->setMaxBuilds(1);
$runner->setDaemon(true);
$emptyInput = new ArgvInput(array());
@ -86,7 +85,8 @@ class DaemoniseCommand extends Command
try {
$buildCount = $runner->run($emptyInput, $output);
} catch (\Exception $e) {
var_dump($e);
$output->writeln('<error>Exception: ' . $e->getMessage() . '</error>');
$output->writeln('<error>Line: ' . $e->getLine() . ' - File: ' . $e->getFile() . '</error>');
}
if (0 == $buildCount && $this->sleep < 15) {

View file

@ -10,9 +10,7 @@
namespace PHPCI\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use b8\Database;
use b8\Database\CodeGenerator;

View file

@ -13,15 +13,15 @@ use Exception;
use PDO;
use b8\Config;
use b8\Database;
use b8\Store\Factory;
use PHPCI\Helper\Lang;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Helper\DialogHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Helper\DialogHelper;
use PHPCI\Service\UserService;
use Symfony\Component\Console\Question\ConfirmationQuestion;
/**
* Install console command - Installs PHPCI.
@ -39,16 +39,19 @@ class InstallCommand extends Command
$this
->setName('phpci:install')
->addOption('url', null, InputOption::VALUE_OPTIONAL, 'PHPCI Installation URL')
->addOption('db-host', null, InputOption::VALUE_OPTIONAL, 'Database hostname')
->addOption('db-name', null, InputOption::VALUE_OPTIONAL, 'Database name')
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, 'Database username')
->addOption('db-pass', null, InputOption::VALUE_OPTIONAL, 'Database password')
->addOption('admin-name', null, InputOption::VALUE_OPTIONAL, 'Admin username')
->addOption('admin-pass', null, InputOption::VALUE_OPTIONAL, 'Admin password')
->addOption('admin-mail', null, InputOption::VALUE_OPTIONAL, 'Admin e-mail')
->addOption('config-path', null, InputOption::VALUE_OPTIONAL, 'Config file path', $defaultPath)
->setDescription('Install PHPCI.');
->addOption('url', null, InputOption::VALUE_OPTIONAL, Lang::get('installation_url'))
->addOption('db-host', null, InputOption::VALUE_OPTIONAL, Lang::get('db_host'))
->addOption('db-name', null, InputOption::VALUE_OPTIONAL, Lang::get('db_name'))
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, Lang::get('db_user'))
->addOption('db-pass', null, InputOption::VALUE_OPTIONAL, Lang::get('db_pass'))
->addOption('admin-name', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_name'))
->addOption('admin-pass', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_pass'))
->addOption('admin-mail', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_email'))
->addOption('config-path', null, InputOption::VALUE_OPTIONAL, Lang::get('config_path'), $defaultPath)
->addOption('queue-disabled', null, InputOption::VALUE_NONE, 'Don\'t ask for queue details')
->addOption('queue-server', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue server hostname')
->addOption('queue-name', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue name')
->setDescription(Lang::get('install_phpci'));
}
/**
@ -58,17 +61,19 @@ class InstallCommand extends Command
{
$this->configFilePath = $input->getOption('config-path');
$this->verifyNotInstalled($output);
if (!$this->verifyNotInstalled($output)) {
return;
}
$output->writeln('');
$output->writeln('<info>******************</info>');
$output->writeln('<info> Welcome to PHPCI</info>');
$output->writeln('<info> '.Lang::get('welcome_to_phpci').'</info>');
$output->writeln('<info>******************</info>');
$output->writeln('');
$this->checkRequirements($output);
$output->writeln('Please answer the following questions:');
$output->writeln(Lang::get('please_answer'));
$output->writeln('-------------------------------------');
$output->writeln('');
@ -95,7 +100,7 @@ class InstallCommand extends Command
$this->writeConfigFile($conf);
$this->setupDatabase($output);
$admin = $this->getAdminInforamtion($input, $output);
$admin = $this->getAdminInformation($input, $output);
$this->createAdminUser($admin, $output);
}
@ -111,19 +116,19 @@ class InstallCommand extends Command
$errors = false;
// Check PHP version:
if (!(version_compare(PHP_VERSION, '5.3.3') >= 0)) {
if (!(version_compare(PHP_VERSION, '5.3.8') >= 0)) {
$output->writeln('');
$output->writeln('<error>PHPCI requires at least PHP 5.3.3 to function.</error>');
$output->writeln('<error>'.Lang::get('phpci_php_req').'</error>');
$errors = true;
}
// Check required extensions are present:
$requiredExtensions = array('PDO', 'pdo_mysql', 'mcrypt');
$requiredExtensions = array('PDO', 'pdo_mysql');
foreach ($requiredExtensions as $extension) {
if (!extension_loaded($extension)) {
$output->writeln('');
$output->writeln('<error>'.$extension.' extension must be installed.</error>');
$output->writeln('<error>'.Lang::get('extension_required', $extension).'</error>');
$errors = true;
}
}
@ -134,22 +139,22 @@ class InstallCommand extends Command
foreach ($requiredFunctions as $function) {
if (!function_exists($function)) {
$output->writeln('');
$output->writeln('<error>PHPCI needs to be able to call the '.$function.'() function. Is it disabled in php.ini?</error>');
$output->writeln('<error>'.Lang::get('function_required', $function).'</error>');
$errors = true;
}
}
if (!function_exists('password_hash')) {
$output->writeln('');
$output->writeln('<error>PHPCI requires the password_hash() function available in PHP 5.4, or the password_compat library by ircmaxell.</error>');
$output->writeln('<error>'.Lang::get('function_required', $function).'</error>');
$errors = true;
}
if ($errors) {
throw new Exception('PHPCI cannot be installed, as not all requirements are met. Please review the errors above before continuing.');
throw new Exception(Lang::get('requirements_not_met'));
}
$output->writeln(' <info>OK</info>');
$output->writeln(' <info>'.Lang::get('ok').'</info>');
$output->writeln('');
}
@ -160,7 +165,7 @@ class InstallCommand extends Command
* @param OutputInterface $output
* @return array
*/
protected function getAdminInforamtion(InputInterface $input, OutputInterface $output)
protected function getAdminInformation(InputInterface $input, OutputInterface $output)
{
$admin = array();
@ -170,9 +175,9 @@ class InstallCommand extends Command
$dialog = $this->getHelperSet()->get('dialog');
// Function to validate mail address.
$mailValidator =function ($answer) {
$mailValidator = function ($answer) {
if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
throw new Exception('Must be a valid email address.');
throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
}
return $answer;
@ -181,13 +186,13 @@ class InstallCommand extends Command
if ($adminEmail = $input->getOption('admin-mail')) {
$adminEmail = $mailValidator($adminEmail);
} else {
$adminEmail = $dialog->askAndValidate($output, 'Your email address: ', $mailValidator, false);
$adminEmail = $dialog->askAndValidate($output, Lang::get('enter_email'), $mailValidator, false);
}
if (!$adminName = $input->getOption('admin-name')) {
$adminName = $dialog->ask($output, 'Enter your name: ');
$adminName = $dialog->ask($output, Lang::get('enter_name'));
}
if (!$adminPass = $input->getOption('admin-pass')) {
$adminPass = $dialog->askHiddenResponse($output, 'Enter your desired admin password: ');
$adminPass = $dialog->askHiddenResponse($output, Lang::get('enter_password'));
}
$admin['mail'] = $adminEmail;
@ -216,7 +221,7 @@ class InstallCommand extends Command
// FUnction do validate URL.
$urlValidator = function ($answer) {
if (!filter_var($answer, FILTER_VALIDATE_URL)) {
throw new Exception('Must be a valid URL');
throw new Exception(Lang::get('must_be_valid_url'));
}
return rtrim($answer, '/');
@ -225,14 +230,49 @@ class InstallCommand extends Command
if ($url = $input->getOption('url')) {
$url = $urlValidator($url);
} else {
$url = $dialog->askAndValidate($output, 'Your PHPCI URL ("http://phpci.local" for example): ', $urlValidator, false);
$url = $dialog->askAndValidate($output, Lang::get('enter_phpci_url'), $urlValidator, false);
}
$phpci['url'] = $url;
$phpci['worker'] = $this->getQueueInformation($input, $output, $dialog);
return $phpci;
}
/**
* If the user wants to use a queue, get the necessary details.
* @param InputInterface $input
* @param OutputInterface $output
* @param DialogHelper $dialog
* @return array
*/
protected function getQueueInformation(InputInterface $input, OutputInterface $output, DialogHelper $dialog)
{
if ($input->getOption('queue-disabled')) {
return null;
}
$rtn = [];
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Use beanstalkd to manage build queue? ', true);
if (!$helper->ask($input, $output, $question)) {
$output->writeln('<error>Skipping beanstalkd configuration.</error>');
return null;
}
if (!$rtn['host'] = $input->getOption('queue-server')) {
$rtn['host'] = $dialog->ask($output, 'Enter your beanstalkd hostname [localhost]: ', 'localhost');
}
if (!$rtn['queue'] = $input->getOption('queue-name')) {
$rtn['queue'] = $dialog->ask($output, 'Enter the queue (tube) name to use [phpci]: ', 'phpci');
}
return $rtn;
}
/**
* Load configuration for DB form CLI options or ask info to user.
*
@ -250,19 +290,19 @@ class InstallCommand extends Command
$dialog = $this->getHelperSet()->get('dialog');
if (!$dbHost = $input->getOption('db-host')) {
$dbHost = $dialog->ask($output, 'Please enter your MySQL host [localhost]: ', 'localhost');
$dbHost = $dialog->ask($output, Lang::get('enter_db_host'), 'localhost');
}
if (!$dbName = $input->getOption('db-name')) {
$dbName = $dialog->ask($output, 'Please enter your database name [phpci]: ', 'phpci');
$dbName = $dialog->ask($output, Lang::get('enter_db_name'), 'phpci');
}
if (!$dbUser = $input->getOption('db-user')) {
$dbUser = $dialog->ask($output, 'Please enter your database username [phpci]: ', 'phpci');
$dbUser = $dialog->ask($output, Lang::get('enter_db_user'), 'phpci');
}
if (!$dbPass = $input->getOption('db-pass')) {
$dbPass = $dialog->askHiddenResponse($output, 'Please enter your database password: ');
$dbPass = $dialog->askHiddenResponse($output, Lang::get('enter_db_pass'));
}
$db['servers']['read'] = $dbHost;
@ -295,10 +335,12 @@ class InstallCommand extends Command
)
);
unset($pdo);
return true;
} catch (Exception $ex) {
$output->writeln('<error>PHPCI could not connect to MySQL with the details provided. Please try again.</error>');
$output->writeln('<error>'.Lang::get('could_not_connect').'</error>');
$output->writeln('<error>' . $ex->getMessage() . '</error>');
}
@ -319,11 +361,13 @@ class InstallCommand extends Command
protected function setupDatabase(OutputInterface $output)
{
$output->write('Setting up your database... ');
$output->write(Lang::get('setting_up_db'));
shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"');
$phinxBinary = escapeshellarg(PHPCI_DIR . 'vendor/bin/phinx');
$phinxScript = escapeshellarg(PHPCI_DIR . 'phinx.php');
shell_exec($phinxBinary . ' migrate -c ' . $phinxScript);
$output->writeln('<info>OK</info>');
$output->writeln('<info>'.Lang::get('ok').'</info>');
}
/**
@ -341,11 +385,10 @@ class InstallCommand extends Command
$userService = new UserService($userStore);
$userService->createUser($admin['name'], $admin['mail'], $admin['pass'], 1);
$output->writeln('<info>User account created!</info>');
$output->writeln('<info>'.Lang::get('user_created').'</info>');
} catch (\Exception $ex) {
$output->writeln('<error>PHPCI failed to create your admin account.</error>');
$output->writeln('<error>'.Lang::get('failed_to_create').'</error>');
$output->writeln('<error>' . $ex->getMessage() . '</error>');
die;
}
}
@ -360,6 +403,7 @@ class InstallCommand extends Command
/**
* @param OutputInterface $output
* @return bool
*/
protected function verifyNotInstalled(OutputInterface $output)
{
@ -367,10 +411,12 @@ class InstallCommand extends Command
$content = file_get_contents($this->configFilePath);
if (!empty($content)) {
$output->writeln('<error>The PHPCI config file exists and is not empty.</error>');
$output->writeln('<error>If you were trying to update PHPCI, please use phpci:update instead.</error>');
die;
$output->writeln('<error>'.Lang::get('config_exists').'</error>');
$output->writeln('<error>'.Lang::get('update_instead').'</error>');
return false;
}
}
return true;
}
}

View file

@ -12,10 +12,9 @@ namespace PHPCI\Command;
use b8\Store\Factory;
use b8\HttpClient;
use Monolog\Logger;
use PHPCI\Helper\Lang;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Parser;
use PHPCI\Model\Build;
@ -43,7 +42,7 @@ class PollCommand extends Command
{
$this
->setName('phpci:poll-github')
->setDescription('Poll github to check if we need to start a build.');
->setDescription(Lang::get('poll_github'));
}
/**
@ -58,16 +57,16 @@ class PollCommand extends Command
$token = $this->settings['phpci']['github']['token'];
if (!$token) {
$this->logger->error("No github token found");
exit();
$this->logger->error(Lang::get('no_token'));
return;
}
$buildStore = Factory::getStore('Build');
$this->logger->addInfo("Finding projects to poll");
$this->logger->addInfo(Lang::get('finding_projects'));
$projectStore = Factory::getStore('Project');
$result = $projectStore->getWhere();
$this->logger->addInfo(sprintf("Found %d projects", count($result['items'])));
$this->logger->addInfo(Lang::get('found_n_projects', count($result['items'])));
foreach ($result['items'] as $project) {
$http = new HttpClient('https://api.github.com');
@ -77,11 +76,11 @@ class PollCommand extends Command
$last_committer = $commits['body'][0]['commit']['committer']['email'];
$message = $commits['body'][0]['commit']['message'];
$this->logger->info("Last commit to github for " . $project->getTitle() . " is " . $last_commit);
$this->logger->info(Lang::get('last_commit_is', $project->getTitle(), $last_commit));
if ($project->getLastCommit() != $last_commit && $last_commit != "") {
$this->logger->info(
"Last commit is different from database, adding new build for " . $project->getTitle()
Lang::get('adding_new_build')
);
$build = new Build();
@ -101,6 +100,6 @@ class PollCommand extends Command
}
}
$this->logger->addInfo("Finished processing builds");
$this->logger->addInfo(Lang::get('finished_processing_builds'));
}
}

View file

@ -0,0 +1,93 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Command;
use b8\Store\Factory;
use Monolog\Logger;
use PHPCI\Service\BuildService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Re-runs the last run build.
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
*/
class RebuildCommand extends Command
{
/**
* @var Logger
*/
protected $logger;
/**
* @var OutputInterface
*/
protected $output;
/**
* @var boolean
*/
protected $run;
/**
* @var int
*/
protected $sleep;
/**
* @param \Monolog\Logger $logger
* @param string $name
*/
public function __construct(Logger $logger, $name = null)
{
parent::__construct($name);
$this->logger = $logger;
}
protected function configure()
{
$this
->setName('phpci:rebuild')
->setDescription('Re-runs the last run build.');
}
/**
* Loops through running.
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$runner = new RunCommand($this->logger);
$runner->setMaxBuilds(1);
$runner->setDaemon(false);
/** @var \PHPCI\Store\BuildStore $store */
$store = Factory::getStore('Build');
$service = new BuildService($store);
$builds = $store->getLatestBuilds(null, 1);
$lastBuild = array_shift($builds);
$service->createDuplicateBuild($lastBuild);
$runner->run(new ArgvInput(array()), $output);
}
/**
* Called when log entries are made in Builder / the plugins.
* @see \PHPCI\Builder::log()
*/
public function logCallback($log)
{
$this->output->writeln($log);
}
}

View file

@ -0,0 +1,85 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Command;
use b8\Config;
use b8\Store\Factory;
use Monolog\Logger;
use PHPCI\BuildFactory;
use PHPCI\Helper\Lang;
use PHPCI\Logging\OutputLogHandler;
use PHPCI\Service\BuildService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
*/
class RebuildQueueCommand extends Command
{
/**
* @var OutputInterface
*/
protected $output;
/**
* @var Logger
*/
protected $logger;
/**
* @param \Monolog\Logger $logger
* @param string $name
*/
public function __construct(Logger $logger, $name = null)
{
parent::__construct($name);
$this->logger = $logger;
}
protected function configure()
{
$this
->setName('phpci:rebuild-queue')
->setDescription('Rebuilds the PHPCI worker queue.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->output = $output;
// For verbose mode we want to output all informational and above
// messages to the symphony output interface.
if ($input->hasOption('verbose') && $input->getOption('verbose')) {
$this->logger->pushHandler(
new OutputLogHandler($this->output, Logger::INFO)
);
}
$store = Factory::getStore('Build');
$result = $store->getByStatus(0);
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
$buildService = new BuildService($store);
while (count($result['items'])) {
$build = array_shift($result['items']);
$build = BuildFactory::getBuild($build);
$this->logger->addInfo('Added build #' . $build->getId() . ' to queue.');
$buildService->addBuildToQueue($build);
}
}
}

View file

@ -11,14 +11,12 @@ namespace PHPCI\Command;
use b8\Config;
use Monolog\Logger;
use PHPCI\Helper\Lang;
use PHPCI\Logging\BuildDBLogHandler;
use PHPCI\Logging\LoggedBuildContextTidier;
use PHPCI\Logging\OutputLogHandler;
use Psr\Log\LoggerAwareInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use b8\Store\Factory;
use PHPCI\Builder;
@ -46,7 +44,12 @@ class RunCommand extends Command
/**
* @var int
*/
protected $maxBuilds = null;
protected $maxBuilds = 100;
/**
* @var bool
*/
protected $isFromDaemon = false;
/**
* @param \Monolog\Logger $logger
@ -62,8 +65,7 @@ class RunCommand extends Command
{
$this
->setName('phpci:run-builds')
->setDescription('Run all pending PHPCI builds.')
->addOption('verbose', 'v', InputOption::VALUE_NONE);
->setDescription(Lang::get('run_all_pending'));
}
/**
@ -75,7 +77,7 @@ class RunCommand extends Command
// For verbose mode we want to output all informational and above
// messages to the symphony output interface.
if ($input->getOption('verbose')) {
if ($input->hasOption('verbose') && $input->getOption('verbose')) {
$this->logger->pushHandler(
new OutputLogHandler($this->output, Logger::INFO)
);
@ -84,20 +86,24 @@ class RunCommand extends Command
$running = $this->validateRunningBuilds();
$this->logger->pushProcessor(new LoggedBuildContextTidier());
$this->logger->addInfo("Finding builds to process");
$this->logger->addInfo(Lang::get('finding_builds'));
$store = Factory::getStore('Build');
$result = $store->getByStatus(0, $this->maxBuilds);
$this->logger->addInfo(sprintf("Found %d builds", count($result['items'])));
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
$builds = 0;
foreach ($result['items'] as $build) {
while (count($result['items'])) {
$build = array_shift($result['items']);
$build = BuildFactory::getBuild($build);
// Skip build (for now) if there's already a build running in that project:
if (in_array($build->getProjectId(), $running)) {
$this->logger->addInfo('Skipping Build #'.$build->getId() . ' - Project build already in progress.');
if (!$this->isFromDaemon && in_array($build->getProjectId(), $running)) {
$this->logger->addInfo(Lang::get('skipping_build', $build->getId()));
$result['items'][] = $build;
// Re-run build validator:
$running = $this->validateRunningBuilds();
continue;
}
@ -117,13 +123,14 @@ class RunCommand extends Command
$this->logger->popHandler($buildDbLog);
} catch (\Exception $ex) {
$build->setStatus(Build::STATUS_FAILED);
$build->setFinished(new \DateTime());
$build->setLog($build->getLog() . PHP_EOL . PHP_EOL . $ex->getMessage());
$store->save($build);
}
}
$this->logger->addInfo("Finished processing builds");
$this->logger->addInfo(Lang::get('finished_processing_builds'));
return $builds;
}
@ -133,6 +140,11 @@ class RunCommand extends Command
$this->maxBuilds = (int)$numBuilds;
}
public function setDaemon($fromDaemon)
{
$this->isFromDaemon = (bool)$fromDaemon;
}
protected function validateRunningBuilds()
{
/** @var \PHPCI\Store\BuildStore $store */
@ -150,10 +162,11 @@ class RunCommand extends Command
$start = $build->getStarted()->getTimestamp();
if (($now - $start) > $timeout) {
$this->logger->addInfo('Build #'.$build->getId().' marked as failed due to timeout.');
$this->logger->addInfo(Lang::get('marked_as_failed', $build->getId()));
$build->setStatus(Build::STATUS_FAILED);
$build->setFinished(new \DateTime());
$store->save($build);
$this->removeBuildDirectory($build);
$build->removeBuildDirectory();
continue;
}
@ -162,19 +175,4 @@ class RunCommand extends Command
return $rtn;
}
protected function removeBuildDirectory($build)
{
$buildPath = PHPCI_DIR . 'PHPCI/build/' . $build->getId() . '/';
if (is_dir($buildPath)) {
$cmd = 'rm -Rf "%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s"';
}
shell_exec($cmd);
}
}
}

View file

@ -9,12 +9,11 @@
namespace PHPCI\Command;
use b8\Config;
use Monolog\Logger;
use PHPCI\Helper\Lang;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@ -40,7 +39,7 @@ class UpdateCommand extends Command
{
$this
->setName('phpci:update')
->setDescription('Update the database to reflect modified models.');
->setDescription(Lang::get('update_phpci'));
}
/**
@ -48,28 +47,22 @@ class UpdateCommand extends Command
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->verifyInstalled($output);
if (!$this->verifyInstalled($output)) {
return;
}
$output->write('Updating PHPCI database: ');
$output->write(Lang::get('updating_phpci'));
shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"');
$output->writeln('<info>Done!</info>');
$output->writeln('<info>'.Lang::get('ok').'</info>');
}
protected function verifyInstalled(OutputInterface $output)
{
if (!file_exists(PHPCI_DIR . 'PHPCI/config.yml')) {
$output->writeln('<error>PHPCI does not appear to be installed.</error>');
$output->writeln('<error>Please install PHPCI via phpci:install instead.</error>');
die;
}
$config = Config::getInstance();
$phpciUrl = $config->get('phpci.url');
$content = file_get_contents(PHPCI_DIR . 'PHPCI/config.yml');
if (empty($content)) {
$output->writeln('<error>PHPCI does not appear to be installed.</error>');
$output->writeln('<error>Please install PHPCI via phpci:install instead.</error>');
die;
}
return !empty($phpciUrl);
}
}

View file

@ -0,0 +1,87 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Command;
use b8\Config;
use Monolog\Logger;
use PHPCI\Logging\OutputLogHandler;
use PHPCI\Worker\BuildWorker;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Worker Command - Starts the BuildWorker, which pulls jobs from beanstalkd
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
*/
class WorkerCommand extends Command
{
/**
* @var OutputInterface
*/
protected $output;
/**
* @var Logger
*/
protected $logger;
/**
* @param \Monolog\Logger $logger
* @param string $name
*/
public function __construct(Logger $logger, $name = null)
{
parent::__construct($name);
$this->logger = $logger;
}
protected function configure()
{
$this
->setName('phpci:worker')
->setDescription('Runs the PHPCI build worker.')
->addOption('debug', null, null, 'Run PHPCI in Debug Mode');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->output = $output;
// For verbose mode we want to output all informational and above
// messages to the symphony output interface.
if ($input->hasOption('verbose') && $input->getOption('verbose')) {
$this->logger->pushHandler(
new OutputLogHandler($this->output, Logger::INFO)
);
}
// Allow PHPCI to run in "debug mode"
if ($input->hasOption('debug') && $input->getOption('debug')) {
$output->writeln('<comment>Debug mode enabled.</comment>');
define('PHPCI_DEBUG_MODE', true);
}
$config = Config::getInstance()->get('phpci.worker', []);
if (empty($config['host']) || empty($config['queue'])) {
$error = 'The worker is not configured. You must set a host and queue in your config.yml file.';
throw new \Exception($error);
}
$worker = new BuildWorker($config['host'], $config['queue']);
$worker->setLogger($this->logger);
$worker->setMaxJobs(Config::getInstance()->get('phpci.worker.max_jobs', -1));
$worker->startWorker();
}
}

View file

@ -10,10 +10,15 @@
namespace PHPCI;
use b8\Config;
use b8\Exception\HttpException\ForbiddenException;
use b8\Http\Request;
use b8\Http\Response;
use b8\View;
/**
* PHPCI Base Controller
* @package PHPCI
*/
class Controller extends \b8\Controller
{
/**
@ -26,11 +31,24 @@ class Controller extends \b8\Controller
*/
protected $view;
/**
* @var \b8\View
*/
public $layout;
/**
* Initialise the controller.
*/
public function init()
{
// Extended by actual controllers.
}
/**
* @param Config $config
* @param Request $request
* @param Response $response
*/
public function __construct(Config $config, Request $request, Response $response)
{
parent::__construct($config, $request, $response);
@ -40,6 +58,9 @@ class Controller extends \b8\Controller
$this->setControllerView();
}
/**
* Set the view that this controller should use.
*/
protected function setControllerView()
{
if (View::exists($this->className)) {
@ -49,6 +70,10 @@ class Controller extends \b8\Controller
}
}
/**
* Set the view that this controller action should use.
* @param $action
*/
protected function setView($action)
{
if (View::exists($this->className . '/' . $action)) {
@ -56,11 +81,21 @@ class Controller extends \b8\Controller
}
}
/**
* Handle the incoming request.
* @param $action
* @param $actionParams
* @return \b8\b8\Http\Response|Response
*/
public function handleAction($action, $actionParams)
{
$this->setView($action);
$response = parent::handleAction($action, $actionParams);
if ($response instanceof Response) {
return $response;
}
if (is_string($response)) {
$this->controllerView->content = $response;
} elseif (isset($this->view)) {
@ -72,10 +107,23 @@ class Controller extends \b8\Controller
return $this->response;
}
/**
* Require that the currently logged in user is an administrator.
* @throws ForbiddenException
*/
protected function requireAdmin()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
if (!$this->currentUserIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
}
/**
* Check if the currently logged in user is an administrator.
* @return bool
*/
protected function currentUserIsAdmin()
{
return $_SESSION['phpci_user']->getIsAdmin();
}
}

View file

@ -11,8 +11,12 @@ namespace PHPCI\Controller;
use b8;
use b8\Exception\HttpException\NotFoundException;
use b8\Http\Response\JsonResponse;
use PHPCI\BuildFactory;
use PHPCI\Helper\AnsiConverter;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
use PHPCI\Model\Project;
use PHPCI\Service\BuildService;
/**
@ -32,7 +36,10 @@ class BuildController extends \PHPCI\Controller
* @var \PHPCI\Service\BuildService
*/
protected $buildService;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->buildStore = b8\Store\Factory::getStore('Build');
@ -51,17 +58,53 @@ class BuildController extends \PHPCI\Controller
}
if (empty($build)) {
throw new NotFoundException('Build with ID: ' . $buildId . ' does not exist.');
throw new NotFoundException(Lang::get('build_x_not_found', $buildId));
}
$this->view->plugins = $this->getUiPlugins();
$this->view->build = $build;
$this->view->data = $this->getBuildData($build);
$title = 'Build #' . $build->getId() . ' - ' . $build->getProjectTitle();
$this->config->set('page_title', $title);
$this->layout->title = Lang::get('build_n', $buildId);
$this->layout->subtitle = $build->getProjectTitle();
switch ($build->getStatus()) {
case 0:
$this->layout->skin = 'blue';
break;
case 1:
$this->layout->skin = 'yellow';
break;
case 2:
$this->layout->skin = 'green';
break;
case 3:
$this->layout->skin = 'red';
break;
}
$rebuild = Lang::get('rebuild_now');
$rebuildLink = PHPCI_URL . 'build/rebuild/' . $build->getId();
$delete = Lang::get('delete_build');
$deleteLink = PHPCI_URL . 'build/delete/' . $build->getId();
$actions = "<a class=\"btn btn-default\" href=\"{$rebuildLink}\">{$rebuild}</a> ";
if ($this->currentUserIsAdmin()) {
$actions .= " <a class=\"btn btn-danger\" href=\"{$deleteLink}\">{$delete}</a>";
}
$this->layout->actions = $actions;
}
/**
* Returns an array of the JS plugins to include.
* @return array
*/
protected function getUiPlugins()
{
$rtn = array();
@ -84,7 +127,17 @@ class BuildController extends \PHPCI\Controller
*/
public function data($buildId)
{
die($this->getBuildData(BuildFactory::getBuildById($buildId)));
$response = new JsonResponse();
$build = BuildFactory::getBuildById($buildId);
if (!$build) {
$response->setResponseCode(404);
$response->setContent(array());
return $response;
}
$response->setContent($this->getBuildData($build));
return $response;
}
/**
@ -98,16 +151,18 @@ class BuildController extends \PHPCI\Controller
$data = null;
if ($key && $build) {
$data = $this->buildStore->getMeta($key, $build->getProjectId(), $buildId, $numBuilds);
$data = $this->buildStore->getMeta($key, $build->getProjectId(), $buildId, $build->getBranch(), $numBuilds);
}
die(json_encode($data));
$response = new JsonResponse();
$response->setContent($data);
return $response;
}
/**
* Get build data from database and json encode it:
*/
protected function getBuildData($build)
protected function getBuildData(Build $build)
{
$data = array();
$data['status'] = (int)$build->getStatus();
@ -115,8 +170,21 @@ class BuildController extends \PHPCI\Controller
$data['created'] = !is_null($build->getCreated()) ? $build->getCreated()->format('Y-m-d H:i:s') : null;
$data['started'] = !is_null($build->getStarted()) ? $build->getStarted()->format('Y-m-d H:i:s') : null;
$data['finished'] = !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : null;
$data['duration'] = $build->getDuration();
return json_encode($data);
/** @var \PHPCI\Store\BuildErrorStore $errorStore */
$errorStore = b8\Store\Factory::getStore('BuildError');
$errors = $errorStore->getErrorsForBuild($build->getId(), $this->getParam('since', null));
$errorView = new b8\View('Build/errors');
$errorView->build = $build;
$errorView->errors = $errors;
$data['errors'] = $errorStore->getErrorTotalForBuild($build->getId());
$data['error_html'] = $errorView->render();
$data['since'] = (new \DateTime())->format('Y-m-d H:i:s');
return $data;
}
/**
@ -127,13 +195,18 @@ class BuildController extends \PHPCI\Controller
$copy = BuildFactory::getBuildById($buildId);
if (empty($copy)) {
throw new NotFoundException('Build with ID: ' . $buildId . ' does not exist.');
throw new NotFoundException(Lang::get('build_x_not_found', $buildId));
}
$build = $this->buildService->createDuplicateBuild($copy);
header('Location: '.PHPCI_URL.'build/view/' . $build->getId());
exit;
if ($this->buildService->queueError) {
$_SESSION['global_error'] = Lang::get('add_to_queue_failed');
}
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
return $response;
}
/**
@ -141,20 +214,19 @@ class BuildController extends \PHPCI\Controller
*/
public function delete($buildId)
{
if (empty($_SESSION['phpci_user']) || !$_SESSION['phpci_user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$this->requireAdmin();
$build = BuildFactory::getBuildById($buildId);
if (empty($build)) {
throw new NotFoundException('Build with ID: ' . $buildId . ' does not exist.');
throw new NotFoundException(Lang::get('build_x_not_found', $buildId));
}
$this->buildService->deleteBuild($build);
header('Location: '.PHPCI_URL.'project/view/' . $build->getProjectId());
exit;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'project/view/' . $build->getProjectId());
return $response;
}
/**
@ -162,10 +234,46 @@ class BuildController extends \PHPCI\Controller
*/
protected function cleanLog($log)
{
$log = str_replace('[0;32m', '<span style="color: green">', $log);
$log = str_replace('[0;31m', '<span style="color: red">', $log);
$log = str_replace('[0m', '</span>', $log);
return AnsiConverter::convert($log);
}
return $log;
/**
* Allows the UI to poll for the latest running and pending builds.
*/
public function latest()
{
$rtn = array(
'pending' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_NEW)),
'running' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_RUNNING)),
);
$response = new JsonResponse();
$response->setContent($rtn);
return $response;
}
/**
* Formats a list of builds into rows suitable for the dropdowns in the PHPCI header bar.
* @param $builds
* @return array
*/
protected function formatBuilds($builds)
{
Project::$sleepable = array('id', 'title', 'reference', 'type');
$rtn = array('count' => $builds['count'], 'items' => array());
foreach ($builds['items'] as $build) {
$item = $build->toArray(1);
$header = new b8\View('Build/header-row');
$header->build = $build;
$item['header_row'] = $header->render();
$rtn['items'][$item['id']] = $item;
}
ksort($rtn['items']);
return $rtn;
}
}

View file

@ -15,6 +15,7 @@ use b8\Store;
use PHPCI\BuildFactory;
use PHPCI\Model\Project;
use PHPCI\Model\Build;
use PHPCI\Service\BuildStatusService;
/**
* Build Status Controller - Allows external access to build status information / images.
@ -24,12 +25,14 @@ use PHPCI\Model\Build;
*/
class BuildStatusController extends \PHPCI\Controller
{
/**
* @var \PHPCI\Store\ProjectStore
*/
/* @var \PHPCI\Store\ProjectStore */
protected $projectStore;
/* @var \PHPCI\Store\BuildStore */
protected $buildStore;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->response->disableLayout();
@ -50,7 +53,7 @@ class BuildStatusController extends \PHPCI\Controller
$status = 'passing';
if (!$project->getAllowPublicStatus()) {
die();
return null;
}
if (isset($project) && $project instanceof Project) {
@ -67,18 +70,98 @@ class BuildStatusController extends \PHPCI\Controller
return $status;
}
/**
* Displays projects information in ccmenu format
*
* @param $projectId
* @return bool
* @throws \Exception
* @throws b8\Exception\HttpException
*/
public function ccxml($projectId)
{
/* @var Project $project */
$project = $this->projectStore->getById($projectId);
$xml = new \SimpleXMLElement('<Projects/>');
if (!$project instanceof Project || !$project->getAllowPublicStatus()) {
return $this->renderXml($xml);
}
try {
$branchList = $this->buildStore->getBuildBranches($projectId);
if (!$branchList) {
$branchList = array($project->getBranch());
}
foreach ($branchList as $branch) {
$buildStatusService = new BuildStatusService($branch, $project, $project->getLatestBuild($branch));
if ($attributes = $buildStatusService->toArray()) {
$projectXml = $xml->addChild('Project');
foreach ($attributes as $attributeKey => $attributeValue) {
$projectXml->addAttribute($attributeKey, $attributeValue);
}
}
}
} catch (\Exception $e) {
$xml = new \SimpleXMLElement('<projects/>');
}
return $this->renderXml($xml);
}
/**
* @param \SimpleXMLElement $xml
* @return bool
*/
protected function renderXml(\SimpleXMLElement $xml = null)
{
$this->response->setHeader('Content-Type', 'text/xml');
$this->response->setContent($xml->asXML());
$this->response->flush();
echo $xml->asXML();
return true;
}
/**
* Returns the appropriate build status image in SVG format for a given project.
*/
public function image($projectId)
{
$style = $this->getParam('style', 'plastic');
$label = $this->getParam('label', 'build');
$status = $this->getStatus($projectId);
if (is_null($status)) {
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', '/');
return $response;
}
$color = ($status == 'passing') ? 'green' : 'red';
header('Content-Type: image/svg+xml');
die(file_get_contents('http://img.shields.io/badge/build-' . $status . '-' . $color . '.svg'));
$image = file_get_contents(sprintf(
'http://img.shields.io/badge/%s-%s-%s.svg?style=%s',
$label,
$status,
$color,
$style
));
$this->response->disableLayout();
$this->response->setHeader('Content-Type', 'image/svg+xml');
$this->response->setContent($image);
return $this->response;
}
/**
* View the public status page of a given project, if enabled.
* @param $projectId
* @return string
* @throws \b8\Exception\HttpException\NotFoundException
*/
public function view($projectId)
{
$project = $this->projectStore->getById($projectId);

View file

@ -0,0 +1,120 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Controller;
use b8;
use b8\Form;
use b8\Store;
use PHPCI\Controller;
use PHPCI\Model\ProjectGroup;
/**
* Project Controller - Allows users to create, edit and view projects.
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Web
*/
class GroupController extends Controller
{
/**
* @var \PHPCI\Store\ProjectGroupStore
*/
protected $groupStore;
/**
* Set up this controller.
*/
public function init()
{
$this->groupStore = b8\Store\Factory::getStore('ProjectGroup');
}
/**
* List project groups.
*/
public function index()
{
$this->requireAdmin();
$groups = array();
$groupList = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
foreach ($groupList['items'] as $group) {
$thisGroup = array(
'title' => $group->getTitle(),
'id' => $group->getId(),
);
$projects = b8\Store\Factory::getStore('Project')->getByGroupId($group->getId());
$thisGroup['projects'] = $projects['items'];
$groups[] = $thisGroup;
}
$this->view->groups = $groups;
}
/**
* Add or edit a project group.
* @param null $groupId
* @return void|b8\Http\Response\RedirectResponse
*/
public function edit($groupId = null)
{
$this->requireAdmin();
if (!is_null($groupId)) {
$group = $this->groupStore->getById($groupId);
} else {
$group = new ProjectGroup();
}
if ($this->request->getMethod() == 'POST') {
$group->setTitle($this->getParam('title'));
$this->groupStore->save($group);
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'group');
return $response;
}
$form = new Form();
$form->setMethod('POST');
$form->setAction(PHPCI_URL . 'group/edit' . (!is_null($groupId) ? '/' . $groupId : ''));
$title = new Form\Element\Text('title');
$title->setContainerClass('form-group');
$title->setClass('form-control');
$title->setLabel('Group Title');
$title->setValue($group->getTitle());
$submit = new Form\Element\Submit();
$submit->setValue('Save Group');
$form->addField($title);
$form->addField($submit);
$this->view->form = $form;
}
/**
* Delete a project group.
* @param $groupId
* @return b8\Http\Response\RedirectResponse
*/
public function delete($groupId)
{
$this->requireAdmin();
$group = $this->groupStore->getById($groupId);
$this->groupStore->delete($group);
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'group');
return $response;
}
}

View file

@ -11,6 +11,8 @@ namespace PHPCI\Controller;
use b8;
use PHPCI\BuildFactory;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
/**
* Home Controller - Displays the PHPCI Dashboard.
@ -21,19 +23,28 @@ use PHPCI\BuildFactory;
class HomeController extends \PHPCI\Controller
{
/**
* @var \b8\Store\BuildStore
* @var \PHPCI\Store\BuildStore
*/
protected $buildStore;
/**
* @var \b8\Store\ProjectStore
* @var \PHPCI\Store\ProjectStore
*/
protected $projectStore;
/**
* @var \PHPCI\Store\ProjectGroupStore
*/
protected $groupStore;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->buildStore = b8\Store\Factory::getStore('Build');
$this->projectStore = b8\Store\Factory::getStore('Project');
$this->groupStore = b8\Store\Factory::getStore('ProjectGroup');
}
/**
@ -41,13 +52,15 @@ class HomeController extends \PHPCI\Controller
*/
public function index()
{
$projects = $this->projectStore->getWhere(array(), 50, 0, array(), array('title' => 'ASC'));
$this->layout->title = Lang::get('dashboard');
$builds = $this->buildStore->getLatestBuilds(null, 10);
$this->view->builds = $this->getLatestBuildsHtml();
$this->view->projects = $projects['items'];
$this->view->summary = $this->getSummaryHtml($projects);
foreach ($builds as &$build) {
$build = BuildFactory::getBuild($build);
}
$this->config->set('page_title', 'Dashboard');
$this->view->builds = $builds;
$this->view->groups = $this->getGroupInfo();
return $this->view->render();
}
@ -57,25 +70,59 @@ class HomeController extends \PHPCI\Controller
*/
public function latest()
{
die($this->getLatestBuildsHtml());
$this->response->disableLayout();
$this->response->setContent($this->getLatestBuildsHtml());
return $this->response;
}
/**
* Ajax request for the project overview section of the dashboard.
*/
public function summary()
{
$this->response->disableLayout();
$projects = $this->projectStore->getWhere(array(), 50, 0, array(), array('title' => 'ASC'));
die($this->getSummaryHtml($projects));
$this->response->setContent($this->getSummaryHtml($projects));
return $this->response;
}
/**
* Generate the HTML for the project overview section of the dashboard.
* @param $projects
* @return string
*/
protected function getSummaryHtml($projects)
{
$summaryBuilds = array();
foreach ($projects['items'] as $project) {
$successes = array();
$failures = array();
$counts = array();
foreach ($projects as $project) {
$summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($project->getId());
$count = $this->buildStore->getWhere(
array('project_id' => $project->getId()),
1,
0,
array(),
array('id' => 'DESC')
);
$counts[$project->getId()] = $count['count'];
$success = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_SUCCESS);
$failure = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_FAILED);
$successes[$project->getId()] = $success;
$failures[$project->getId()] = $failure;
}
$summaryView = new b8\View('SummaryTable');
$summaryView->projects = $projects['items'];
$summaryView->builds = $summaryBuilds;
$summaryView->projects = $projects;
$summaryView->builds = $summaryBuilds;
$summaryView->successful = $successes;
$summaryView->failed = $failures;
$summaryView->counts = $counts;
return $summaryView->render();
}
@ -96,4 +143,24 @@ class HomeController extends \PHPCI\Controller
return $view->render();
}
/**
* Get a summary of the project groups we have, and what projects they have in them.
* @return array
*/
protected function getGroupInfo()
{
$rtn = array();
$groups = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
foreach ($groups['items'] as $group) {
$thisGroup = array('title' => $group->getTitle());
$projects = $this->projectStore->getByGroupId($group->getId());
$thisGroup['projects'] = $projects['items'];
$thisGroup['summary'] = $this->getSummaryHtml($thisGroup['projects']);
$rtn[] = $thisGroup;
}
return $rtn;
}
}

View file

@ -10,7 +10,7 @@
namespace PHPCI\Controller;
use b8;
use PHPCI\Model\Build;
use PHPCI\Helper\Lang;
use PHPCI\Plugin\Util\ComposerPluginInformation;
use PHPCI\Plugin\Util\FilesPluginInformation;
use PHPCI\Plugin\Util\PluginInformationCollection;
@ -23,32 +23,16 @@ use PHPCI\Plugin\Util\PluginInformationCollection;
*/
class PluginController extends \PHPCI\Controller
{
protected $required = array(
'block8/b8framework',
'ircmaxell/password-compat',
'swiftmailer/swiftmailer',
'symfony/yaml',
'symfony/console',
'psr/log',
'monolog/monolog',
'pimple/pimple'
);
protected $canInstall;
protected $composerPath;
/**
* List all enabled plugins, installed and recommend packages.
* @return string
*/
public function index()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$this->view->canWrite = is_writable(APPLICATION_PATH . 'composer.json');
$this->view->required = $this->required;
$this->requireAdmin();
$json = $this->getComposerJson();
$this->view->installedPackages = $json['require'];
$this->view->suggestedPackages = $json['suggest'];
$pluginInfo = new PluginInformationCollection();
$pluginInfo->add(FilesPluginInformation::newFromDir(
@ -60,116 +44,18 @@ class PluginController extends \PHPCI\Controller
$this->view->plugins = $pluginInfo->getInstalledPlugins();
$this->config->set('page_title', 'Plugins');
$this->layout->title = Lang::get('plugins');
return $this->view->render();
}
public function remove()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$package = $this->getParam('package', null);
$json = $this->getComposerJson();
if (!in_array($package, $this->required)) {
unset($json['require'][$package]);
$this->setComposerJson($json);
header('Location: ' . PHPCI_URL . 'plugin?r=' . $package);
die;
}
header('Location: ' . PHPCI_URL);
die;
}
public function install()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$package = $this->getParam('package', null);
$version = $this->getParam('version', '*');
$json = $this->getComposerJson();
$json['require'][$package] = $version;
$this->setComposerJson($json);
header('Location: ' . PHPCI_URL . 'plugin?w=' . $package);
die;
}
/**
* Get the json-decoded contents of the composer.json file.
* @return mixed
*/
protected function getComposerJson()
{
$json = file_get_contents(APPLICATION_PATH . 'composer.json');
return json_decode($json, true);
}
/**
* Convert array to json and save composer.json
*
* @param $array
*/
protected function setComposerJson($array)
{
if (defined('JSON_PRETTY_PRINT')) {
$json = json_encode($array, JSON_PRETTY_PRINT);
} else {
$json = json_encode($array);
}
file_put_contents(APPLICATION_PATH . 'composer.json', $json);
}
protected function findBinary($binary)
{
if (is_string($binary)) {
$binary = array($binary);
}
foreach ($binary as $bin) {
// Check project root directory:
if (is_file(APPLICATION_PATH . $bin)) {
return APPLICATION_PATH . $bin;
}
// Check Composer bin dir:
if (is_file(APPLICATION_PATH . 'vendor/bin/' . $bin)) {
return APPLICATION_PATH . 'vendor/bin/' . $bin;
}
// Use "which"
$which = trim(shell_exec('which ' . $bin));
if (!empty($which)) {
return $which;
}
}
return null;
}
public function packagistSearch()
{
$searchQuery = $this->getParam('q', '');
$http = new \b8\HttpClient();
$http->setHeaders(array('User-Agent: PHPCI/1.0 (+https://www.phptesting.org)'));
$res = $http->get('https://packagist.org/search.json', array('q' => $searchQuery));
die(json_encode($res['body']));
}
public function packagistVersions()
{
$name = $this->getParam('p', '');
$http = new \b8\HttpClient();
$http->setHeaders(array('User-Agent: PHPCI/1.0 (+https://www.phptesting.org)'));
$res = $http->get('https://packagist.org/packages/'.$name.'.json');
die(json_encode($res['body']));
}
}

View file

@ -10,16 +10,14 @@
namespace PHPCI\Controller;
use b8;
use b8\Controller;
use b8\Form;
use b8\Exception\HttpException\ForbiddenException;
use b8\Exception\HttpException\NotFoundException;
use b8\Store;
use PHPCI;
use PHPCI\BuildFactory;
use PHPCI\Helper\Github;
use PHPCI\Helper\Lang;
use PHPCI\Helper\SshKey;
use PHPCI\Model\Build;
use PHPCI\Model\Project;
use PHPCI\Service\BuildService;
use PHPCI\Service\ProjectService;
@ -29,7 +27,7 @@ use PHPCI\Service\ProjectService;
* @package PHPCI
* @subpackage Web
*/
class ProjectController extends \PHPCI\Controller
class ProjectController extends PHPCI\Controller
{
/**
* @var \PHPCI\Store\ProjectStore
@ -51,6 +49,9 @@ class ProjectController extends \PHPCI\Controller
*/
protected $buildService;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->buildStore = Store\Factory::getStore('Build');
@ -62,12 +63,13 @@ class ProjectController extends \PHPCI\Controller
/**
* View a specific project.
*/
public function view($projectId, $branch = '')
public function view($projectId)
{
$branch = $this->getParam('branch', '');
$project = $this->projectStore->getById($projectId);
if (empty($project)) {
throw new NotFoundException('Project with id: ' . $projectId . ' not found');
throw new NotFoundException(Lang::get('project_x_not_found', $projectId));
}
$per_page = 10;
@ -76,18 +78,21 @@ class ProjectController extends \PHPCI\Controller
$pages = $builds[1] == 0 ? 1 : ceil($builds[1] / $per_page);
if ($page > $pages) {
throw new NotFoundException('Page with number: ' . $page . ' not found');
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'project/view/'.$projectId);
return $response;
}
$this->view->builds = $builds[0];
$this->view->total = $builds[1];
$this->view->project = $project;
$this->view->branch = urldecode($branch);
$this->view->branch = urldecode($branch);
$this->view->branches = $this->projectStore->getKnownBranches($projectId);
$this->view->page = $page;
$this->view->pages = $pages;
$this->config->set('page_title', $project->getTitle());
$this->layout->title = $project->getTitle();
$this->layout->subtitle = $this->view->branch;
return $this->view->render();
}
@ -105,14 +110,19 @@ class ProjectController extends \PHPCI\Controller
}
if (empty($project)) {
throw new NotFoundException('Project with id: ' . $projectId . ' not found');
throw new NotFoundException(Lang::get('project_x_not_found', $projectId));
}
$email = $_SESSION['phpci_user']->getEmail();
$build = $this->buildService->createBuild($project, null, urldecode($branch), $email);
header('Location: '.PHPCI_URL.'build/view/' . $build->getId());
exit;
if ($this->buildService->queueError) {
$_SESSION['global_error'] = Lang::get('add_to_queue_failed');
}
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
return $response;
}
/**
@ -120,24 +130,27 @@ class ProjectController extends \PHPCI\Controller
*/
public function delete($projectId)
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
$this->requireAdmin();
$project = $this->projectStore->getById($projectId);
$this->projectService->deleteProject($project);
header('Location: '.PHPCI_URL);
exit;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL);
return $response;
}
/**
* AJAX get latest builds.
*/
public function builds($projectId, $branch = '')
public function builds($projectId)
{
$branch = $this->getParam('branch', '');
$builds = $this->getLatestBuildsHtml($projectId, urldecode($branch));
die($builds[0]);
$this->response->disableLayout();
$this->response->setContent($builds[0]);
return $this->response;
}
/**
@ -173,7 +186,7 @@ class ProjectController extends \PHPCI\Controller
*/
public function add()
{
$this->config->set('page_title', 'Add Project');
$this->layout->title = Lang::get('add_project');
$this->requireAdmin();
$method = $this->request->getMethod();
@ -211,11 +224,14 @@ class ProjectController extends \PHPCI\Controller
'build_config' => $this->getParam('build_config', null),
'allow_public_status' => $this->getParam('allow_public_status', 0),
'branch' => $this->getParam('branch', null),
'group' => $this->getParam('group_id', null),
);
$project = $this->projectService->createProject($title, $type, $reference, $options);
header('Location: '.PHPCI_URL.'project/view/' . $project->getId());
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'project/view/' . $project->getId());
return $response;
}
}
@ -224,18 +240,17 @@ class ProjectController extends \PHPCI\Controller
*/
public function edit($projectId)
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
$this->requireAdmin();
$method = $this->request->getMethod();
$project = $this->projectStore->getById($projectId);
if (empty($project)) {
throw new NotFoundException('Project with id: ' . $projectId . ' not found');
throw new NotFoundException(Lang::get('project_x_not_found', $projectId));
}
$this->config->set('page_title', 'Edit: ' . $project->getTitle());
$this->layout->title = $project->getTitle();
$this->layout->subtitle = Lang::get('edit_project');
$values = $project->getDataArray();
$values['key'] = $values['ssh_private_key'];
@ -258,12 +273,12 @@ class ProjectController extends \PHPCI\Controller
$view->type = 'edit';
$view->project = $project;
$view->form = $form;
$view->key = null;
$view->key = $values['pubkey'];
return $view->render();
}
$title = $this->getParam('title', 'New Project');
$title = $this->getParam('title', Lang::get('new_project'));
$reference = $this->getParam('reference', null);
$type = $this->getParam('type', null);
@ -272,13 +287,16 @@ class ProjectController extends \PHPCI\Controller
'ssh_public_key' => $this->getParam('pubkey', null),
'build_config' => $this->getParam('build_config', null),
'allow_public_status' => $this->getParam('allow_public_status', 0),
'archived' => $this->getParam('archived', 0),
'branch' => $this->getParam('branch', null),
'group' => $this->getParam('group_id', null),
);
$project = $this->projectService->updateProject($project, $title, $type, $reference, $options);
header('Location: '.PHPCI_URL.'project/view/' . $project->getId());
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL.'project/view/' . $project->getId());
return $response;
}
/**
@ -293,17 +311,18 @@ class ProjectController extends \PHPCI\Controller
$form->addField(new Form\Element\Hidden('pubkey'));
$options = array(
'choose' => 'Select repository type...',
'github' => 'Github',
'bitbucket' => 'Bitbucket',
'gitlab' => 'Gitlab',
'remote' => 'Remote URL',
'local' => 'Local Path',
'hg' => 'Mercurial',
'choose' => Lang::get('select_repository_type'),
'github' => Lang::get('github'),
'bitbucket' => Lang::get('bitbucket'),
'gitlab' => Lang::get('gitlab'),
'remote' => Lang::get('remote'),
'local' => Lang::get('local'),
'hg' => Lang::get('hg'),
'svn' => Lang::get('svn'),
);
$field = Form\Element\Select::create('type', 'Where is your project hosted?', true);
$field->setPattern('^(github|bitbucket|gitlab|remote|local|hg)');
$field = Form\Element\Select::create('type', Lang::get('where_hosted'), true);
$field->setPattern('^(github|bitbucket|gitlab|remote|local|hg|svn)');
$field->setOptions($options);
$field->setClass('form-control')->setContainerClass('form-group');
$form->addField($field);
@ -311,45 +330,62 @@ class ProjectController extends \PHPCI\Controller
$container = new Form\ControlGroup('github-container');
$container->setClass('github-container');
$field = Form\Element\Select::create('github', 'Choose a Github repository:', false);
$field = Form\Element\Select::create('github', Lang::get('choose_github'), false);
$field->setClass('form-control')->setContainerClass('form-group');
$container->addField($field);
$form->addField($container);
$field = Form\Element\Text::create('reference', 'Repository Name / URL (Remote) or Path (Local)', true);
$field = Form\Element\Text::create('reference', Lang::get('repo_name'), true);
$field->setValidator($this->getReferenceValidator($values));
$field->setClass('form-control')->setContainerClass('form-group');
$form->addField($field);
$field = Form\Element\Text::create('title', 'Project Title', true);
$field = Form\Element\Text::create('title', Lang::get('project_title'), true);
$field->setClass('form-control')->setContainerClass('form-group');
$form->addField($field);
$title = 'Private key to use to access repository (leave blank for local and/or anonymous remotes)';
$field = Form\Element\TextArea::create('key', $title, false);
$field = Form\Element\TextArea::create('key', Lang::get('project_private_key'), false);
$field->setClass('form-control')->setContainerClass('form-group');
$field->setRows(6);
$form->addField($field);
$label = 'PHPCI build config for this project (if you cannot add a phpci.yml file in the project repository)';
$field = Form\Element\TextArea::create('build_config', $label, false);
$field = Form\Element\TextArea::create('build_config', Lang::get('build_config'), false);
$field->setClass('form-control')->setContainerClass('form-group');
$field->setRows(6);
$form->addField($field);
$field = Form\Element\Text::create('branch', 'Default branch name', true);
$field = Form\Element\Text::create('branch', Lang::get('default_branch'), true);
$field->setClass('form-control')->setContainerClass('form-group')->setValue('master');
$form->addField($field);
$label = 'Enable public status page and image for this project?';
$field = Form\Element\Checkbox::create('allow_public_status', $label, false);
$field = Form\Element\Select::create('group_id', 'Project Group', true);
$field->setClass('form-control')->setContainerClass('form-group')->setValue(1);
$groups = array();
$groupStore = b8\Store\Factory::getStore('ProjectGroup');
$groupList = $groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC'));
foreach ($groupList['items'] as $group) {
$groups[$group->getId()] = $group->getTitle();
}
$field->setOptions($groups);
$form->addField($field);
$field = Form\Element\Checkbox::create('allow_public_status', Lang::get('allow_public_status'), false);
$field->setContainerClass('form-group');
$field->setCheckedValue(1);
$field->setValue(0);
$form->addField($field);
$field = Form\Element\Checkbox::create('archived', Lang::get('archived'), false);
$field->setContainerClass('form-group');
$field->setCheckedValue(1);
$field->setValue(0);
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue('Save Project');
$field->setValue(Lang::get('save_project'));
$field->setContainerClass('form-group');
$field->setClass('btn-success');
$form->addField($field);
@ -364,9 +400,17 @@ class ProjectController extends \PHPCI\Controller
protected function githubRepositories()
{
$github = new Github();
die(json_encode($github->getRepositories()));
$response = new b8\Http\Response\JsonResponse();
$response->setContent($github->getRepositories());
return $response;
}
/**
* Get the validator to use to check project references.
* @param $values
* @return callable
*/
protected function getReferenceValidator($values)
{
return function ($val) use ($values) {
@ -375,30 +419,30 @@ class ProjectController extends \PHPCI\Controller
$validators = array(
'hg' => array(
'regex' => '/^(https?):\/\//',
'message' => 'Mercurial repository URL must be start with http:// or https://'
'message' => Lang::get('error_mercurial')
),
'remote' => array(
'regex' => '/^(git|https?):\/\//',
'message' => 'Repository URL must be start with git://, http:// or https://'
'message' => Lang::get('error_remote')
),
'gitlab' => array(
'regex' => '`^(.*)@(.*):(.*)/(.*)\.git`',
'message' => 'GitLab Repository name must be in the format "user@domain.tld:owner/repo.git"'
'message' => Lang::get('error_gitlab')
),
'github' => array(
'regex' => '/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-\.]+$/',
'message' => 'Repository name must be in the format "owner/repo"'
'message' => Lang::get('error_github')
),
'bitbucket' => array(
'regex' => '/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-\.]+$/',
'message' => 'Repository name must be in the format "owner/repo"'
'message' => Lang::get('error_bitbucket')
),
);
if (in_array($type, $validators) && !preg_match($validators[$type]['regex'], $val)) {
throw new \Exception($validators[$type]['message']);
} elseif ($type == 'local' && !is_dir($val)) {
throw new \Exception('The path you specified does not exist.');
throw new \Exception(Lang::get('error_path'));
}
return true;

View file

@ -11,6 +11,7 @@ namespace PHPCI\Controller;
use b8;
use PHPCI\Helper\Email;
use PHPCI\Helper\Lang;
/**
* Session Controller - Handles user login / logout.
@ -25,6 +26,9 @@ class SessionController extends \PHPCI\Controller
*/
protected $userStore;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->response->disableLayout();
@ -39,14 +43,23 @@ class SessionController extends \PHPCI\Controller
$isLoginFailure = false;
if ($this->request->getMethod() == 'POST') {
$user = $this->userStore->getByEmail($this->getParam('email'));
if ($user && password_verify($this->getParam('password', ''), $user->getHash())) {
$_SESSION['phpci_user_id'] = $user->getId();
header('Location: ' . $this->getLoginRedirect());
die;
} else {
$token = $this->getParam('token');
if (!isset($token, $_SESSION['login_token']) || $token !== $_SESSION['login_token']) {
$isLoginFailure = true;
} else {
unset($_SESSION['login_token']);
$user = $this->userStore->getByEmail($this->getParam('email'));
if ($user && password_verify($this->getParam('password', ''), $user->getHash())) {
session_regenerate_id(true);
$_SESSION['phpci_user_id'] = $user->getId();
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', $this->getLoginRedirect());
return $response;
} else {
$isLoginFailure = true;
}
}
}
@ -55,27 +68,33 @@ class SessionController extends \PHPCI\Controller
$form->setAction(PHPCI_URL.'session/login');
$email = new b8\Form\Element\Email('email');
$email->setLabel('Email Address');
$email->setLabel(Lang::get('email_address'));
$email->setRequired(true);
$email->setContainerClass('form-group');
$email->setClass('form-control');
$form->addField($email);
$pwd = new b8\Form\Element\Password('password');
$pwd->setLabel('Password');
$pwd->setLabel(Lang::get('password'));
$pwd->setRequired(true);
$pwd->setContainerClass('form-group');
$pwd->setClass('form-control');
$form->addField($pwd);
$pwd = new b8\Form\Element\Submit();
$pwd->setValue('Log in &raquo;');
$pwd->setValue(Lang::get('log_in'));
$pwd->setClass('btn-success');
$form->addField($pwd);
$tokenValue = $this->generateToken();
$_SESSION['login_token'] = $tokenValue;
$token = new b8\Form\Element\Hidden('token');
$token->setValue($tokenValue);
$form->addField($token);
$this->view->form = $form->render();
$this->view->failed = $isLoginFailure;
return $this->view->render();
}
@ -88,10 +107,16 @@ class SessionController extends \PHPCI\Controller
unset($_SESSION['phpci_user_id']);
session_destroy();
header('Location: ' . PHPCI_URL);
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL);
return $response;
}
/**
* Allows the user to request a password reset email.
* @return string
*/
public function forgotPassword()
{
if ($this->request->getMethod() == 'POST') {
@ -99,33 +124,18 @@ class SessionController extends \PHPCI\Controller
$user = $this->userStore->getByEmail($email);
if (empty($user)) {
$this->view->error = 'No user exists with that email address, please try again.';
$this->view->error = Lang::get('reset_no_user_exists');
return $this->view->render();
}
$key = md5(date('Y-m-d') . $user->getHash());
$url = PHPCI_URL;
$name = $user->getName();
$userId = $user->getId();
$message = <<<MSG
Hi {$name},
You have received this email because you, or someone else, has requested a password reset for PHPCI.
If this was you, please click the following link to reset your password: {$url}session/reset-password/{$userId}/{$key}
Otherwise, please ignore this email and no action will be taken.
Thank you,
PHPCI
MSG;
$message = Lang::get('reset_email_body', $user->getName(), $url, $user->getId(), $key);
$email = new Email();
$email->setEmailTo($user->getEmail(), $user->getName());
$email->setSubject('Password reset');
$email->setSubject(Lang::get('reset_email_title', $user->getName()));
$email->setBody($message);
$email->send();
@ -135,13 +145,19 @@ MSG;
return $this->view->render();
}
/**
* Allows the user to change their password after a password reset email.
* @param $userId
* @param $key
* @return string
*/
public function resetPassword($userId, $key)
{
$user = $this->userStore->getById($userId);
$userKey = md5(date('Y-m-d') . $user->getHash());
if (empty($user) || $key != $userKey) {
$this->view->error = 'Invalid password reset request.';
$this->view->error = Lang::get('reset_invalid');
return $this->view->render();
}
@ -152,8 +168,9 @@ MSG;
$_SESSION['phpci_user'] = $this->userStore->save($user);
$_SESSION['phpci_user_id'] = $user->getId();
header('Location: ' . PHPCI_URL);
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL);
return $response;
}
$this->view->id = $userId;
@ -162,6 +179,10 @@ MSG;
return $this->view->render();
}
/**
* Get the URL the user was trying to go to prior to being asked to log in.
* @return string
*/
protected function getLoginRedirect()
{
$rtn = PHPCI_URL;
@ -173,4 +194,20 @@ MSG;
return $rtn;
}
/** Generate a random token.
*
* @return string
*/
protected function generateToken()
{
if (function_exists('openssl_random_pseudo_bytes')) {
return bin2hex(openssl_random_pseudo_bytes(16));
}
return sprintf("%04x", mt_rand(0, 0xFFFF))
. sprintf("%04x", mt_rand(0, 0xFFFF))
. sprintf("%04x", mt_rand(0, 0xFFFF))
. sprintf("%04x", mt_rand(0, 0xFFFF));
}
}

View file

@ -13,36 +13,52 @@ use b8;
use b8\Form;
use b8\HttpClient;
use PHPCI\Controller;
use PHPCI\Model\Build;
use PHPCI\Helper\Lang;
use Symfony\Component\Yaml\Dumper;
use Symfony\Component\Yaml\Parser;
/**
* Settings Controller
*
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Web
*/
class SettingsController extends Controller
{
/**
* @var array
*/
protected $settings;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
parent::init();
$parser = new Parser();
$yaml = file_get_contents(APPLICATION_PATH . 'PHPCI/config.yml');
$parser = new Parser();
$yaml = file_get_contents(PHPCI_CONFIG_FILE);
$this->settings = $parser->parse($yaml);
}
/**
* Display settings forms.
* @return string
*/
public function index()
{
$this->requireAdmin();
$this->layout->title = Lang::get('settings');
$this->view->settings = $this->settings;
$emailSettings = array();
if (isset($this->settings['phpci']['email_settings'])) {
$emailSettings = $this->settings['phpci']['email_settings'];
$basicSettings = array();
if (isset($this->settings['phpci']['basic'])) {
$basicSettings = $this->settings['phpci']['basic'];
}
$buildSettings = array();
@ -50,9 +66,22 @@ class SettingsController extends Controller
$buildSettings = $this->settings['phpci']['build'];
}
$emailSettings = array();
if (isset($this->settings['phpci']['email_settings'])) {
$emailSettings = $this->settings['phpci']['email_settings'];
}
$authSettings = array();
if (isset($this->settings['phpci']['authentication_settings'])) {
$authSettings = $this->settings['phpci']['authentication_settings'];
}
$this->view->configFile = PHPCI_CONFIG_FILE;
$this->view->basicSettings = $this->getBasicForm($basicSettings);
$this->view->buildSettings = $this->getBuildForm($buildSettings);
$this->view->github = $this->getGithubForm();
$this->view->emailSettings = $this->getEmailForm($emailSettings);
$this->view->buildSettings = $this->getBuildForm($buildSettings);
$this->view->authenticationSettings = $this->getAuthenticationForm($authSettings);
$this->view->isWriteable = $this->canWriteConfig();
if (!empty($this->settings['phpci']['github']['token'])) {
@ -62,50 +91,115 @@ class SettingsController extends Controller
return $this->view->render();
}
/**
* Save Github settings.
*/
public function github()
{
$this->settings['phpci']['github']['id'] = $this->getParam('githubid', '');
$this->requireAdmin();
$this->settings['phpci']['github']['id'] = $this->getParam('githubid', '');
$this->settings['phpci']['github']['secret'] = $this->getParam('githubsecret', '');
$error = $this->storeSettings();
$error = $this->storeSettings();
$response = new b8\Http\Response\RedirectResponse();
if ($error) {
header('Location: ' . PHPCI_URL . 'settings?saved=2');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=2');
} else {
header('Location: ' . PHPCI_URL . 'settings?saved=1');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=1');
}
die;
return $response;
}
/**
* Save email settings.
*/
public function email()
{
$this->settings['phpci']['email_settings'] = $this->getParams();
$this->requireAdmin();
$this->settings['phpci']['email_settings'] = $this->getParams();
$this->settings['phpci']['email_settings']['smtp_encryption'] = $this->getParam('smtp_encryption', 0);
$error = $this->storeSettings();
$response = new b8\Http\Response\RedirectResponse();
if ($error) {
header('Location: ' . PHPCI_URL . 'settings?saved=2');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=2');
} else {
header('Location: ' . PHPCI_URL . 'settings?saved=1');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=1');
}
die;
return $response;
}
/**
* Save build settings.
*/
public function build()
{
$this->requireAdmin();
$this->settings['phpci']['build'] = $this->getParams();
$error = $this->storeSettings();
$response = new b8\Http\Response\RedirectResponse();
if ($error) {
header('Location: ' . PHPCI_URL . 'settings?saved=2');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=2');
} else {
header('Location: ' . PHPCI_URL . 'settings?saved=1');
$response->setHeader('Location', PHPCI_URL . 'settings?saved=1');
}
die;
return $response;
}
/**
* Save basic settings.
*/
public function basic()
{
$this->requireAdmin();
$this->settings['phpci']['basic'] = $this->getParams();
$error = $this->storeSettings();
$response = new b8\Http\Response\RedirectResponse();
if ($error) {
$response->setHeader('Location', PHPCI_URL . 'settings?saved=2');
} else {
$response->setHeader('Location', PHPCI_URL . 'settings?saved=1');
}
return $response;
}
/**
* Handle authentication settings
*/
public function authentication()
{
$this->requireAdmin();
$this->settings['phpci']['authentication_settings']['state'] = $this->getParam('disable_authentication', 0);
$this->settings['phpci']['authentication_settings']['user_id'] = $_SESSION['phpci_user_id'];
$error = $this->storeSettings();
$response = new b8\Http\Response\RedirectResponse();
if ($error) {
$response->setHeader('Location', PHPCI_URL . 'settings?saved=2');
} else {
$response->setHeader('Location', PHPCI_URL . 'settings?saved=1');
}
return $response;
}
/**
@ -113,14 +207,14 @@ class SettingsController extends Controller
*/
public function githubCallback()
{
$code = $this->getParam('code', null);
$code = $this->getParam('code', null);
$github = $this->settings['phpci']['github'];
if (!is_null($code)) {
$http = new HttpClient();
$url = 'https://github.com/login/oauth/access_token';
$http = new HttpClient();
$url = 'https://github.com/login/oauth/access_token';
$params = array('client_id' => $github['id'], 'client_secret' => $github['secret'], 'code' => $code);
$resp = $http->post($url, $params);
$resp = $http->post($url, $params);
if ($resp['success']) {
parse_str($resp['body'], $resp);
@ -128,25 +222,27 @@ class SettingsController extends Controller
$this->settings['phpci']['github']['token'] = $resp['access_token'];
$this->storeSettings();
header('Location: ' . PHPCI_URL . 'settings?linked=1');
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL . 'settings?linked=1');
return $response;
}
}
header('Location: ' . PHPCI_URL . 'settings?linked=2');
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL . 'settings?linked=2');
return $response;
}
/**
* Convert config to yaml and store to file.
*
* @return mixed
*/
protected function storeSettings()
{
$dumper = new Dumper();
$yaml = $dumper->dump($this->settings, 4);
file_put_contents(APPLICATION_PATH . 'PHPCI/config.yml', $yaml);
$yaml = $dumper->dump($this->settings, 4);
file_put_contents(PHPCI_CONFIG_FILE, $yaml);
if (error_get_last()) {
$error_get_last = error_get_last();
@ -154,6 +250,10 @@ class SettingsController extends Controller
}
}
/**
* Get the Github settings form.
* @return Form
*/
protected function getGithubForm()
{
$form = new Form();
@ -164,7 +264,7 @@ class SettingsController extends Controller
$field = new Form\Element\Text('githubid');
$field->setRequired(true);
$field->setPattern('[a-zA-Z0-9]+');
$field->setLabel('Application ID');
$field->setLabel(Lang::get('application_id'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
@ -176,7 +276,7 @@ class SettingsController extends Controller
$field = new Form\Element\Text('githubsecret');
$field->setRequired(true);
$field->setPattern('[a-zA-Z0-9]+');
$field->setLabel('Application Secret');
$field->setLabel(Lang::get('application_secret'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
@ -186,13 +286,18 @@ class SettingsController extends Controller
}
$field = new Form\Element\Submit();
$field->setValue('Save &raquo;');
$field->setValue(Lang::get('save'));
$field->setClass('btn btn-success pull-right');
$form->addField($field);
return $form;
}
/**
* Get the email settings form.
* @param array $values
* @return Form
*/
protected function getEmailForm($values = array())
{
$form = new Form();
@ -202,7 +307,7 @@ class SettingsController extends Controller
$field = new Form\Element\Text('smtp_address');
$field->setRequired(false);
$field->setLabel('SMTP Server');
$field->setLabel(Lang::get('smtp_server'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$field->setValue('localhost');
@ -211,7 +316,7 @@ class SettingsController extends Controller
$field = new Form\Element\Text('smtp_port');
$field->setRequired(false);
$field->setPattern('[0-9]+');
$field->setLabel('SMTP Port');
$field->setLabel(Lang::get('smtp_port'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$field->setValue(25);
@ -219,42 +324,42 @@ class SettingsController extends Controller
$field = new Form\Element\Text('smtp_username');
$field->setRequired(false);
$field->setLabel('SMTP Username');
$field->setLabel(Lang::get('smtp_username'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Text('smtp_password');
$field = new Form\Element\Password('smtp_password');
$field->setRequired(false);
$field->setLabel('SMTP Password');
$field->setLabel(Lang::get('smtp_password'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Email('from_address');
$field->setRequired(false);
$field->setLabel('From Email Address');
$field->setLabel(Lang::get('from_email_address'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Email('default_mailto_address');
$field->setRequired(false);
$field->setLabel('Default Notification Address');
$field->setLabel(Lang::get('default_notification_address'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Select('smtp_encryption');
$field->setOptions(['' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL']);
$field->setOptions(array('' => Lang::get('none'), 'tls' => Lang::get('tls'), 'ssl' => Lang::get('ssl')));
$field->setRequired(false);
$field->setLabel('Use SMTP encryption?');
$field->setLabel(Lang::get('use_smtp_encryption'));
$field->setContainerClass('form-group');
$field->setValue(1);
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue('Save &raquo;');
$field->setValue(Lang::get('save'));
$field->setClass('btn btn-success pull-right');
$form->addField($field);
@ -263,6 +368,11 @@ class SettingsController extends Controller
return $form;
}
/**
* Call Github API for our Github user object.
* @param $token
* @return mixed
*/
protected function getGithubUser($token)
{
$http = new HttpClient('https://api.github.com');
@ -271,11 +381,20 @@ class SettingsController extends Controller
return $user['body'];
}
/**
* Check if we can write the PHPCI config file.
* @return bool
*/
protected function canWriteConfig()
{
return is_writeable(APPLICATION_PATH . 'PHPCI/config.yml');
return is_writeable(PHPCI_CONFIG_FILE);
}
/**
* Get the Build settings form.
* @param array $values
* @return Form
*/
protected function getBuildForm($values = array())
{
$form = new Form();
@ -284,20 +403,87 @@ class SettingsController extends Controller
$field = new Form\Element\Select('failed_after');
$field->setRequired(false);
$field->setLabel('Consider a build failed after');
$field->setLabel(Lang::get('failed_after'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$field->setOptions([
300 => '5 Minutes',
900 => '15 Minutes',
1800 => '30 Minutes',
3600 => '1 Hour',
10800 => '3 Hours',
]);
$field->setOptions(array(
300 => Lang::get('5_mins'),
900 => Lang::get('15_mins'),
1800 => Lang::get('30_mins'),
3600 => Lang::get('1_hour'),
10800 => Lang::get('3_hours'),
));
$field->setValue(1800);
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue(Lang::get('save'));
$field->setClass('btn btn-success pull-right');
$form->addField($field);
$form->setValues($values);
return $form;
}
/**
* Get the Basic settings form.
* @param array $values
* @return Form
*/
protected function getBasicForm($values = array())
{
$form = new Form();
$form->setMethod('POST');
$form->setAction(PHPCI_URL . 'settings/basic');
$field = new Form\Element\Select('language');
$field->setRequired(true);
$field->setLabel(Lang::get('language'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$field->setOptions(Lang::getLanguageOptions());
$field->setValue(Lang::getLanguage());
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue(Lang::get('save'));
$field->setClass('btn btn-success pull-right');
$form->addField($field);
$form->setValues($values);
return $form;
}
/**
* Form for disabling user authentication while using a default user
*
* @param array $values
* @return Form
*/
protected function getAuthenticationForm($values = array())
{
$form = new Form();
$form->setMethod('POST');
$form->setAction(PHPCI_URL . 'settings/authentication');
$form->addField(new Form\Element\Csrf('csrf'));
$field = new Form\Element\Checkbox('disable_authentication');
$field->setCheckedValue(1);
$field->setRequired(false);
$field->setLabel('Disable Authentication?');
$field->setContainerClass('form-group');
$field->setValue(0);
if (isset($values['state'])) {
$field->setValue((int)$values['state']);
}
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue('Save &raquo;');
$field->setClass('btn btn-success pull-right');

View file

@ -10,11 +10,10 @@
namespace PHPCI\Controller;
use b8;
use b8\Exception\HttpException\ForbiddenException;
use b8\Exception\HttpException\NotFoundException;
use b8\Form;
use PHPCI\Controller;
use PHPCI\Model\User;
use PHPCI\Helper\Lang;
use PHPCI\Service\UserService;
/**
@ -35,6 +34,9 @@ class UserController extends Controller
*/
protected $userService;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->userStore = b8\Store\Factory::getStore('User');
@ -49,11 +51,15 @@ class UserController extends Controller
$users = $this->userStore->getWhere(array(), 1000, 0, array(), array('email' => 'ASC'));
$this->view->users = $users;
$this->config->set('page_title', 'Users');
$this->layout->title = Lang::get('manage_users');
return $this->view->render();
}
/**
* Allows the user to edit their profile.
* @return string
*/
public function profile()
{
$user = $_SESSION['phpci_user'];
@ -63,12 +69,29 @@ class UserController extends Controller
$email = $this->getParam('email', null);
$password = $this->getParam('password', null);
$currentLang = Lang::getLanguage();
$chosenLang = $this->getParam('language', $currentLang);
if ($chosenLang !== $currentLang) {
setcookie('phpcilang', $chosenLang, time() + (10 * 365 * 24 * 60 * 60), '/');
Lang::setLanguage($chosenLang);
}
$_SESSION['phpci_user'] = $this->userService->updateUser($user, $name, $email, $password);
$user = $_SESSION['phpci_user'];
$this->view->updated = 1;
}
$this->layout->title = $user->getName();
$this->layout->subtitle = Lang::get('edit_profile');
$values = $user->getDataArray();
if (array_key_exists('phpcilang', $_COOKIE)) {
$values['language'] = $_COOKIE['phpcilang'];
}
$form = new Form();
$form->setAction(PHPCI_URL.'user/profile');
$form->setMethod('POST');
@ -76,27 +99,36 @@ class UserController extends Controller
$name = new Form\Element\Text('name');
$name->setClass('form-control');
$name->setContainerClass('form-group');
$name->setLabel('Name');
$name->setLabel(Lang::get('name'));
$name->setRequired(true);
$form->addField($name);
$email = new Form\Element\Email('email');
$email->setClass('form-control');
$email->setContainerClass('form-group');
$email->setLabel('Email Address');
$email->setLabel(Lang::get('email_address'));
$email->setRequired(true);
$form->addField($email);
$password = new Form\Element\Password('password');
$password->setClass('form-control');
$password->setContainerClass('form-group');
$password->setLabel('Password (leave blank if you don\'t want to change it)');
$password->setLabel(Lang::get('password_change'));
$password->setRequired(false);
$form->addField($password);
$lang = new Form\Element\Select('language');
$lang->setClass('form-control');
$lang->setContainerClass('form-group');
$lang->setLabel(Lang::get('language'));
$lang->setRequired(true);
$lang->setOptions(Lang::getLanguageOptions());
$lang->setValue(Lang::getLanguage());
$form->addField($lang);
$submit = new Form\Element\Submit();
$submit->setClass('btn btn-success');
$submit->setValue('Save &raquo;');
$submit->setValue(Lang::get('save'));
$form->addField($submit);
$form->setValues($values);
@ -111,11 +143,9 @@ class UserController extends Controller
*/
public function add()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
$this->requireAdmin();
$this->config->set('page_title', 'Add User');
$this->layout->title = Lang::get('add_user');
$method = $this->request->getMethod();
@ -144,8 +174,9 @@ class UserController extends Controller
$this->userService->createUser($name, $email, $password, $isAdmin);
header('Location: '.PHPCI_URL.'user');
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL . 'user');
return $response;
}
/**
@ -153,17 +184,18 @@ class UserController extends Controller
*/
public function edit($userId)
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
$this->requireAdmin();
$method = $this->request->getMethod();
$user = $this->userStore->getById($userId);
if (empty($user)) {
throw new NotFoundException('User with ID: ' . $userId . ' does not exist.');
throw new NotFoundException(Lang::get('user_n_not_found', $userId));
}
$this->layout->title = $user->getName();
$this->layout->subtitle = Lang::get('edit_user');
$values = array_merge($user->getDataArray(), $this->getParams());
$form = $this->userForm($values, 'edit/' . $userId);
@ -183,8 +215,9 @@ class UserController extends Controller
$this->userService->updateUser($user, $name, $email, $password, $isAdmin);
header('Location: '.PHPCI_URL.'user');
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL . 'user');
return $response;
}
/**
@ -199,14 +232,14 @@ class UserController extends Controller
$field = new Form\Element\Email('email');
$field->setRequired(true);
$field->setLabel('Email Address');
$field->setLabel(Lang::get('email_address'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Text('name');
$field->setRequired(true);
$field->setLabel('Name');
$field->setLabel(Lang::get('name'));
$field->setClass('form-control');
$field->setContainerClass('form-group');
$form->addField($field);
@ -215,10 +248,10 @@ class UserController extends Controller
if ($type == 'add') {
$field->setRequired(true);
$field->setLabel('Password');
$field->setLabel(Lang::get('password'));
} else {
$field->setRequired(false);
$field->setLabel('Password (leave blank to keep current password)');
$field->setLabel(Lang::get('password_change'));
}
$field->setClass('form-control');
@ -228,12 +261,12 @@ class UserController extends Controller
$field = new Form\Element\Checkbox('is_admin');
$field->setRequired(false);
$field->setCheckedValue(1);
$field->setLabel('Is this user an administrator?');
$field->setLabel(Lang::get('is_user_admin'));
$field->setContainerClass('form-group');
$form->addField($field);
$field = new Form\Element\Submit();
$field->setValue('Save User');
$field->setValue(Lang::get('save_user'));
$field->setClass('btn-success');
$form->addField($field);
@ -246,19 +279,18 @@ class UserController extends Controller
*/
public function delete($userId)
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
$this->requireAdmin();
$user = $this->userStore->getById($userId);
if (empty($user)) {
throw new NotFoundException('User with ID: ' . $userId . ' does not exist.');
throw new NotFoundException(Lang::get('user_n_not_found', $userId));
}
$this->userService->deleteUser($user);
header('Location: '.PHPCI_URL.'user');
die;
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', PHPCI_URL . 'user');
return $response;
}
}

View file

@ -2,7 +2,7 @@
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @copyright Copyright 2014-2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
@ -11,35 +11,45 @@ namespace PHPCI\Controller;
use b8;
use b8\Store;
use Exception;
use PHPCI\BuildFactory;
use PHPCI\Model\Build;
use PHPCI\Model\Project;
use PHPCI\Service\BuildService;
use PHPCI\Store\BuildStore;
use PHPCI\Store\ProjectStore;
/**
* Webhook Controller - Processes webhook pings from BitBucket, Github, Gitlab, etc.
*
* @author Dan Cryer <dan@block8.co.uk>
* @author Sami Tikka <stikka@iki.fi>
* @author Alex Russell <alex@clevercherry.com>
* @author Guillaume Perréal <adirelle@gmail.com>
* @package PHPCI
* @subpackage Web
*
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
class WebhookController extends \PHPCI\Controller
class WebhookController extends \b8\Controller
{
/**
* @var \PHPCI\Store\BuildStore
* @var BuildStore
*/
protected $buildStore;
/**
* @var \PHPCI\Store\ProjectStore
* @var ProjectStore
*/
protected $projectStore;
/**
* @var \PHPCI\Service\BuildService
* @var BuildService
*/
protected $buildService;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
$this->buildStore = Store\Factory::getStore('Build');
@ -47,86 +57,147 @@ class WebhookController extends \PHPCI\Controller
$this->buildService = new BuildService($this->buildStore);
}
/**
* Called by Bitbucket POST service.
/** Handle the action, Ensuring to return a JsonResponse.
*
* @param string $action
* @param mixed $actionParams
*
* @return \b8\Http\Response
*/
public function bitbucket($project)
public function handleAction($action, $actionParams)
{
$response = new b8\Http\Response\JsonResponse();
try {
$data = parent::handleAction($action, $actionParams);
if (isset($data['responseCode'])) {
$response->setResponseCode($data['responseCode']);
unset($data['responseCode']);
}
$response->setContent($data);
} catch (Exception $ex) {
$response->setResponseCode(500);
$response->setContent(array('status' => 'failed', 'error' => $ex->getMessage()));
}
return $response;
}
/**
* Called by Bitbucket.
*/
public function bitbucket($projectId)
{
$project = $this->fetchProject($projectId, 'bitbucket');
// Support both old services and new webhooks
if ($payload = $this->getParam('payload')) {
return $this->bitbucketService(json_decode($payload, true), $project);
}
$payload = json_decode(file_get_contents("php://input"), true);
if (empty($payload['push']['changes'])) {
// Invalid event from bitbucket
return [
'status' => 'failed',
'commits' => []
];
}
return $this->bitbucketWebhook($payload, $project);
}
/**
* Bitbucket webhooks.
*/
protected function bitbucketWebhook($payload, $project)
{
$results = array();
$status = 'failed';
foreach ($payload['push']['changes'] as $commit) {
try {
$email = $commit['new']['target']['author']['raw'];
$email = substr($email, 0, strpos($email, '>'));
$email = substr($email, strpos($email, '<') + 1);
$results[$commit['new']['target']['hash']] = $this->createBuild(
$project,
$commit['new']['target']['hash'],
$commit['new']['name'],
$email,
$commit['new']['target']['message']
);
$status = 'ok';
} catch (Exception $ex) {
$results[$commit['new']['target']['hash']] = array('status' => 'failed', 'error' => $ex->getMessage());
}
}
return array('status' => $status, 'commits' => $results);
}
/**
* Bitbucket POST service.
*/
protected function bitbucketService($payload, $project)
{
$payload = json_decode($this->getParam('payload'), true);
$results = array();
$status = 'failed';
foreach ($payload['commits'] as $commit) {
try {
$email = $commit['raw_author'];
$email = substr($email, 0, strpos($email, '>'));
$email = substr($email, strpos($email, '<') + 1);
$this->createBuild($project, $commit['raw_node'], $commit['branch'], $email, $commit['message']);
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());
die('FAIL');
$results[$commit['raw_node']] = $this->createBuild(
$project,
$commit['raw_node'],
$commit['branch'],
$email,
$commit['message']
);
$status = 'ok';
} catch (Exception $ex) {
$results[$commit['raw_node']] = array('status' => 'failed', 'error' => $ex->getMessage());
}
}
die('OK');
return array('status' => $status, 'commits' => $results);
}
/**
* Called by POSTing to /webhook/git/<project_id>?branch=<branch>&commit=<commit>
*
* @param string $project
* @param string $projectId
*/
public function git($project)
public function git($projectId)
{
$branch = $this->getParam('branch');
$project = $this->fetchProject($projectId, array('local', 'remote'));
$branch = $this->getParam('branch', $project->getBranch());
$commit = $this->getParam('commit');
$commitMessage = $this->getParam('message');
$committer = $this->getParam('committer');
try {
if (empty($branch)) {
$branch = 'master';
}
if (empty($commit)) {
$commit = null;
}
if (empty($commitMessage)) {
$commitMessage = null;
}
if (empty($committer)) {
$committer = null;
}
$this->createBuild($project, $commit, $branch, $committer, $commitMessage);
} catch (\Exception $ex) {
header('HTTP/1.1 400 Bad Request');
header('Ex: ' . $ex->getMessage());
die('FAIL');
}
die('OK');
return $this->createBuild($project, $commit, $branch, $committer, $commitMessage);
}
/**
* Called by Github Webhooks:
*/
public function github($project)
public function github($projectId)
{
$project = $this->fetchProject($projectId, 'github');
switch ($_SERVER['CONTENT_TYPE']) {
case 'application/json':
$payload = json_decode(file_get_contents('php://input'), true);
break;
case 'application/x-www-form-urlencoded':
$payload = json_decode($this->getParam('payload'), true);
break;
default:
header('HTTP/1.1 400 Bad Request');
die('Request content type not supported');
return array('status' => 'failed', 'error' => 'Content type not supported.', 'responseCode' => 401);
}
// Handle Pull Request web hooks:
@ -139,151 +210,244 @@ class WebhookController extends \PHPCI\Controller
return $this->githubCommitRequest($project, $payload);
}
header('HTTP/1.1 200 OK');
die('This request type is not supported, this is not an error.');
return array('status' => 'ignored', 'message' => 'Unusable payload.');
}
protected function githubCommitRequest($project, array $payload)
/**
* Handle the payload when Github sends a commit webhook.
*
* @param Project $project
* @param array $payload
* @param b8\Http\Response\JsonResponse $response
*
* @return b8\Http\Response\JsonResponse
*/
protected function githubCommitRequest(Project $project, array $payload)
{
// Github sends a payload when you close a pull request with a
// non-existant commit. We don't want this.
// non-existent commit. We don't want this.
if (array_key_exists('after', $payload) && $payload['after'] === '0000000000000000000000000000000000000000') {
die('OK');
return array('status' => 'ignored');
}
try {
if (isset($payload['commits']) && is_array($payload['commits'])) {
// If we have a list of commits, then add them all as builds to be tested:
if (isset($payload['commits']) && is_array($payload['commits'])) {
// If we have a list of commits, then add them all as builds to be tested:
foreach ($payload['commits'] as $commit) {
if (!$commit['distinct']) {
continue;
}
$results = array();
$status = 'failed';
foreach ($payload['commits'] as $commit) {
if (!$commit['distinct']) {
$results[$commit['id']] = array('status' => 'ignored');
continue;
}
try {
$branch = str_replace('refs/heads/', '', $payload['ref']);
$committer = $commit['committer']['email'];
$this->createBuild($project, $commit['id'], $branch, $committer, $commit['message']);
$results[$commit['id']] = $this->createBuild(
$project,
$commit['id'],
$branch,
$committer,
$commit['message']
);
$status = 'ok';
} catch (Exception $ex) {
$results[$commit['id']] = array('status' => 'failed', 'error' => $ex->getMessage());
}
} elseif (substr($payload['ref'], 0, 10) == 'refs/tags/') {
// If we don't, but we're dealing with a tag, add that instead:
$branch = str_replace('refs/tags/', 'Tag: ', $payload['ref']);
$committer = $payload['pusher']['email'];
$message = $payload['head_commit']['message'];
$this->createBuild($project, $payload['after'], $branch, $committer, $message);
}
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());
die('FAIL');
return array('status' => $status, 'commits' => $results);
}
die('OK');
if (substr($payload['ref'], 0, 10) == 'refs/tags/') {
// If we don't, but we're dealing with a tag, add that instead:
$branch = str_replace('refs/tags/', 'Tag: ', $payload['ref']);
$committer = $payload['pusher']['email'];
$message = $payload['head_commit']['message'];
return $this->createBuild($project, $payload['after'], $branch, $committer, $message);
}
return array('status' => 'ignored', 'message' => 'Unusable payload.');
}
protected function githubPullRequest($projectId, array $payload)
/**
* Handle the payload when Github sends a Pull Request webhook.
*
* @param Project $project
* @param array $payload
*/
protected function githubPullRequest(Project $project, array $payload)
{
// We only want to know about open pull requests:
if (!in_array($payload['action'], array('opened', 'synchronize', 'reopened'))) {
die('OK');
return array('status' => 'ok');
}
try {
$headers = array();
$token = \b8\Config::getInstance()->get('phpci.github.token');
$headers = array();
$token = \b8\Config::getInstance()->get('phpci.github.token');
if (!empty($token)) {
$headers[] = 'Authorization: token ' . $token;
if (!empty($token)) {
$headers[] = 'Authorization: token ' . $token;
}
$url = $payload['pull_request']['commits_url'];
$http = new \b8\HttpClient();
$http->setHeaders($headers);
$response = $http->get($url);
// Check we got a success response:
if (!$response['success']) {
throw new Exception('Could not get commits, failed API request.');
}
$results = array();
$status = 'failed';
foreach ($response['body'] as $commit) {
// Skip all but the current HEAD commit ID:
$id = $commit['sha'];
if ($id != $payload['pull_request']['head']['sha']) {
$results[$id] = array('status' => 'ignored', 'message' => 'not branch head');
continue;
}
$url = $payload['pull_request']['commits_url'];
$http = new \b8\HttpClient();
$http->setHeaders($headers);
$response = $http->get($url);
// Check we got a success response:
if (!$response['success']) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: Could not get commits, failed API request.');
die('FAIL');
}
foreach ($response['body'] as $commit) {
try {
$branch = str_replace('refs/heads/', '', $payload['pull_request']['base']['ref']);
$committer = $commit['commit']['author']['email'];
$message = $commit['commit']['message'];
$remoteUrlKey = $payload['pull_request']['head']['repo']['private'] ? 'ssh_url' : 'clone_url';
$extra = array(
'build_type' => 'pull_request',
'pull_request_id' => $payload['pull_request']['id'],
'pull_request_number' => $payload['number'],
'remote_branch' => $payload['pull_request']['head']['ref'],
'remote_url' => $payload['pull_request']['head']['repo']['clone_url'],
'remote_url' => $payload['pull_request']['head']['repo'][$remoteUrlKey],
);
$this->createBuild($projectId, $commit['sha'], $branch, $committer, $message, $extra);
$results[$id] = $this->createBuild($project, $id, $branch, $committer, $message, $extra);
$status = 'ok';
} catch (Exception $ex) {
$results[$id] = array('status' => 'failed', 'error' => $ex->getMessage());
}
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());
die('FAIL');
}
die('OK');
return array('status' => $status, 'commits' => $results);
}
/**
* Called by Gitlab Webhooks:
*/
public function gitlab($project)
public function gitlab($projectId)
{
$project = $this->fetchProject($projectId, 'gitlab');
$payloadString = file_get_contents("php://input");
$payload = json_decode($payloadString, true);
try {
// build on merge request events
if (isset($payload['object_kind']) && $payload['object_kind'] == 'merge_request') {
$attributes = $payload['object_attributes'];
if ($attributes['state'] == 'opened' || $attributes['state'] == 'reopened') {
$branch = $attributes['source_branch'];
$commit = $attributes['last_commit'];
$committer = $commit['author']['email'];
if (isset($payload['commits']) && is_array($payload['commits'])) {
// If we have a list of commits, then add them all as builds to be tested:
return $this->createBuild($project, $commit['id'], $branch, $committer, $commit['message']);
}
}
foreach ($payload['commits'] as $commit) {
// build on push events
if (isset($payload['commits']) && is_array($payload['commits'])) {
// If we have a list of commits, then add them all as builds to be tested:
$results = array();
$status = 'failed';
foreach ($payload['commits'] as $commit) {
try {
$branch = str_replace('refs/heads/', '', $payload['ref']);
$committer = $commit['author']['email'];
$this->createBuild($project, $commit['id'], $branch, $committer, $commit['message']);
$results[$commit['id']] = $this->createBuild(
$project,
$commit['id'],
$branch,
$committer,
$commit['message']
);
$status = 'ok';
} catch (Exception $ex) {
$results[$commit['id']] = array('status' => 'failed', 'error' => $ex->getMessage());
}
}
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());
die('FAIL');
return array('status' => $status, 'commits' => $results);
}
die('OK');
return array('status' => 'ignored', 'message' => 'Unusable payload.');
}
protected function createBuild($projectId, $commitId, $branch, $committer, $commitMessage, $extra = null)
{
/**
* Wrapper for creating a new build.
*
* @param Project $project
* @param string $commitId
* @param string $branch
* @param string $committer
* @param string $commitMessage
* @param array $extra
*
* @return array
*
* @throws Exception
*/
protected function createBuild(
Project $project,
$commitId,
$branch,
$committer,
$commitMessage,
array $extra = null
) {
// Check if a build already exists for this commit ID:
$builds = $this->buildStore->getByProjectAndCommit($projectId, $commitId);
$builds = $this->buildStore->getByProjectAndCommit($project->getId(), $commitId);
if ($builds['count']) {
return true;
}
$project = $this->projectStore->getById($projectId);
if (empty($project)) {
throw new \Exception('Project does not exist:' . $projectId);
return array(
'status' => 'ignored',
'message' => sprintf('Duplicate of build #%d', $builds['items'][0]->getId())
);
}
// If not, create a new build job for it:
$build = $this->buildService->createBuild($project, $commitId, $branch, $committer, $commitMessage, $extra);
$build = BuildFactory::getBuild($build);
// Send a status postback if the build type provides one:
$build->sendStatusPostback();
return array('status' => 'ok', 'buildID' => $build->getID());
}
return true;
/**
* Fetch a project and check its type.
*
* @param int $projectId
* @param array|string $expectedType
*
* @return Project
*
* @throws Exception If the project does not exist or is not of the expected type.
*/
protected function fetchProject($projectId, $expectedType)
{
$project = $this->projectStore->getById($projectId);
if (empty($projectId)) {
throw new Exception('Project does not exist: ' . $projectId);
}
if (is_array($expectedType)
? !in_array($project->getType(), $expectedType)
: $project->getType() !== $expectedType
) {
throw new Exception('Wrong project type: ' . $project->getType());
}
return $project;
}
}

68
PHPCI/ErrorHandler.php Normal file
View file

@ -0,0 +1,68 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI;
/**
* Error Handler
*
* @package PHPCI\Logging
*/
class ErrorHandler
{
/**
* @var array
*/
protected $levels = array(
E_WARNING => 'Warning',
E_NOTICE => 'Notice',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
E_DEPRECATED => 'Deprecated',
E_USER_DEPRECATED => 'User Deprecated',
);
/**
* Registers an instance of the error handler to throw ErrorException.
*/
public static function register()
{
$handler = new static();
set_error_handler(array($handler, 'handleError'));
}
/**
* @param integer $level
* @param string $message
* @param string $file
* @param integer $line
*
* @throws \ErrorException
*
* @internal
*/
public function handleError($level, $message, $file, $line)
{
if (error_reporting() & $level === 0) {
return;
}
$exceptionLevel = isset($this->levels[$level]) ? $this->levels[$level] : $level;
throw new \ErrorException(
sprintf('%s: %s in %s line %d', $exceptionLevel, $message, $file, $line),
0,
$level,
$file,
$line
);
}
}

View file

@ -0,0 +1,55 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Helper;
use SensioLabs\AnsiConverter\AnsiToHtmlConverter;
/**
* Converts ANSI output to HTML.
*
* @package PHPCI\Helper
*/
final class AnsiConverter
{
static private $converter = null;
/**
* Initialize the singleton.
*
* @return AnsiToHtmlConverter
*/
private static function getInstance()
{
if (self::$converter === null) {
self::$converter = new AnsiToHtmlConverter(null, false);
}
return self::$converter;
}
/**
* Convert a text containing ANSI color sequences into HTML code.
*
* @param string $text The text to convert
*
* @return string The HTML code.
*/
public static function convert($text)
{
return self::getInstance()->convert($text);
}
/**
* Do not instantiate this class.
*/
private function __construct()
{
}
}

View file

@ -9,13 +9,18 @@
namespace PHPCI\Helper;
use \PHPCI\Logging\BuildLogger;
use Exception;
use PHPCI\Logging\BuildLogger;
use Psr\Log\LogLevel;
/**
* Handles running system commands with variables.
* @package PHPCI\Helper
*/
abstract class BaseCommandExecutor implements CommandExecutor
{
/**
* @var \PHPCI\Logging\BuildLogger
* @var BuildLogger
*/
protected $logger;
@ -57,9 +62,7 @@ abstract class BaseCommandExecutor implements CommandExecutor
$this->logger = $logger;
$this->quiet = $quiet;
$this->verbose = $verbose;
$this->lastOutput = array();
$this->rootDir = $rootDir;
}
@ -73,6 +76,7 @@ abstract class BaseCommandExecutor implements CommandExecutor
$this->lastOutput = array();
$command = call_user_func_array('sprintf', $args);
$this->logger->logDebug($command);
if ($this->quiet) {
$this->logger->log('Executing: ' . $command);
@ -86,8 +90,7 @@ abstract class BaseCommandExecutor implements CommandExecutor
);
$pipes = array();
$process = proc_open($command, $descriptorSpec, $pipes, dirname($this->buildPath), null);
$process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null);
if (is_resource($process)) {
fclose($pipes[0]);
@ -141,47 +144,46 @@ abstract class BaseCommandExecutor implements CommandExecutor
/**
* Find a binary required by a plugin.
* @param string $binary
* @param null $buildPath
* @param bool $quiet
* @return null|string
*/
public function findBinary($binary, $buildPath = null)
public function findBinary($binary, $quiet = false)
{
$binaryPath = null;
$composerBin = $this->getComposerBinDir(realpath($buildPath));
$composerBin = $this->getComposerBinDir(realpath($this->buildPath));
if (is_string($binary)) {
$binary = array($binary);
}
foreach ($binary as $bin) {
$this->logger->log("Looking for binary: " . $bin, LogLevel::DEBUG);
$this->logger->log(Lang::get('looking_for_binary', $bin), LogLevel::DEBUG);
if (is_dir($composerBin) && is_file($composerBin.'/'.$bin)) {
$this->logger->log("Found in ".$composerBin.": " . $bin, LogLevel::DEBUG);
$binaryPath = $composerBin . '/' . $bin;
break;
$this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG);
return $composerBin . '/' . $bin;
}
if (is_file($this->rootDir . $bin)) {
$this->logger->log("Found in root: " . $bin, LogLevel::DEBUG);
$binaryPath = $this->rootDir . $bin;
break;
$this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG);
return $this->rootDir . $bin;
}
if (is_file($this->rootDir . 'vendor/bin/' . $bin)) {
$this->logger->log("Found in vendor/bin: " . $bin, LogLevel::DEBUG);
$binaryPath = $this->rootDir . 'vendor/bin/' . $bin;
break;
$this->logger->log(Lang::get('found_in_path', 'vendor/bin', $bin), LogLevel::DEBUG);
return $this->rootDir . 'vendor/bin/' . $bin;
}
$findCmdResult = $this->findGlobalBinary($bin);
if (is_file($findCmdResult)) {
$this->logger->log("Found in " . $findCmdResult, LogLevel::DEBUG);
$binaryPath = $findCmdResult;
break;
$this->logger->log(Lang::get('found_in_path', '', $bin), LogLevel::DEBUG);
return $findCmdResult;
}
}
return $binaryPath;
if ($quiet) {
return;
}
throw new Exception(Lang::get('could_not_find', implode('/', $binary)));
}
/**
@ -213,4 +215,13 @@ abstract class BaseCommandExecutor implements CommandExecutor
}
return null;
}
/**
* Set the buildPath property.
* @param string $path
*/
public function setBuildPath($path)
{
$this->buildPath = $path;
}
}

View file

@ -17,6 +17,11 @@ namespace PHPCI\Helper;
*/
class Build
{
/**
* Returns a more human-friendly version of a plugin name.
* @param $name
* @return mixed
*/
public function formatPluginName($name)
{
return str_replace('Php', 'PHP', ucwords(str_replace('_', ' ', $name)));

View file

@ -11,6 +11,10 @@ namespace PHPCI\Helper;
use PHPCI\Model\Build;
/**
* The BuildInterpolator class replaces variables in a string with build-specific information.
* @package PHPCI\Helper
*/
class BuildInterpolator
{
/**
@ -32,21 +36,36 @@ class BuildInterpolator
$this->interpolation_vars = array();
$this->interpolation_vars['%PHPCI%'] = 1;
$this->interpolation_vars['%COMMIT%'] = $build->getCommitId();
$this->interpolation_vars['%SHORT_COMMIT%'] = substr($build->getCommitId(), 0, 7);
$this->interpolation_vars['%COMMIT_EMAIL%'] = $build->getCommitterEmail();
$this->interpolation_vars['%COMMIT_MESSAGE%'] = $build->getCommitMessage();
$this->interpolation_vars['%COMMIT_URI%'] = $build->getCommitLink();
$this->interpolation_vars['%BRANCH%'] = $build->getBranch();
$this->interpolation_vars['%BRANCH_URI%'] = $build->getBranchLink();
$this->interpolation_vars['%PROJECT%'] = $build->getProjectId();
$this->interpolation_vars['%BUILD%'] = $build->getId();
$this->interpolation_vars['%PROJECT_TITLE%'] = $build->getProjectTitle();
$this->interpolation_vars['%PROJECT_URI%'] = $phpCiUrl . "project/view/" . $build->getProjectId();
$this->interpolation_vars['%BUILD_PATH%'] = $buildPath;
$this->interpolation_vars['%BUILD_URI%'] = $phpCiUrl . "build/view/" . $build->getId();
$this->interpolation_vars['%PHPCI_COMMIT%'] = $this->interpolation_vars['%COMMIT%'];
$this->interpolation_vars['%PHPCI_SHORT_COMMIT%'] = $this->interpolation_vars['%SHORT_COMMIT%'];
$this->interpolation_vars['%PHPCI_COMMIT_MESSAGE%'] = $this->interpolation_vars['%COMMIT_MESSAGE%'];
$this->interpolation_vars['%PHPCI_COMMIT_EMAIL%'] = $this->interpolation_vars['%COMMIT_EMAIL%'];
$this->interpolation_vars['%PHPCI_COMMIT_URI%'] = $this->interpolation_vars['%COMMIT_URI%'];
$this->interpolation_vars['%PHPCI_PROJECT%'] = $this->interpolation_vars['%PROJECT%'];
$this->interpolation_vars['%PHPCI_BUILD%'] = $this->interpolation_vars['%BUILD%'];
$this->interpolation_vars['%PHPCI_PROJECT_TITLE%'] = $this->interpolation_vars['%PROJECT_TITLE%'];
$this->interpolation_vars['%PHPCI_PROJECT_URI%'] = $this->interpolation_vars['%PROJECT_URI%'];
$this->interpolation_vars['%PHPCI_BUILD_PATH%'] = $this->interpolation_vars['%BUILD_PATH%'];
$this->interpolation_vars['%PHPCI_BUILD_URI%'] = $this->interpolation_vars['%BUILD_URI%'];
putenv('PHPCI=1');
putenv('PHPCI_COMMIT=' . $this->interpolation_vars['%COMMIT%']);
putenv('PHPCI_SHORT_COMMIT=' . $this->interpolation_vars['%SHORT_COMMIT%']);
putenv('PHPCI_COMMIT_MESSAGE=' . $this->interpolation_vars['%COMMIT_MESSAGE%']);
putenv('PHPCI_COMMIT_EMAIL=' . $this->interpolation_vars['%COMMIT_EMAIL%']);
putenv('PHPCI_COMMIT_URI=' . $this->interpolation_vars['%COMMIT_URI%']);
putenv('PHPCI_PROJECT=' . $this->interpolation_vars['%PROJECT%']);
putenv('PHPCI_BUILD=' . $this->interpolation_vars['%BUILD%']);
putenv('PHPCI_PROJECT_TITLE=' . $this->interpolation_vars['%PROJECT_TITLE%']);

View file

@ -26,8 +26,17 @@ interface CommandExecutor
/**
* Find a binary required by a plugin.
* @param string $binary
* @param string $buildPath the current build path
* @param bool $quiet Returns null instead of throwing an execption.
*
* @return null|string
*
* @throws \Exception when no binary has been found and $quiet is false.
*/
public function findBinary($binary, $buildPath = null);
public function findBinary($binary, $quiet = false);
/**
* Set the buildPath property.
* @param string $path
*/
public function setBuildPath($path);
}

62
PHPCI/Helper/Diff.php Normal file
View file

@ -0,0 +1,62 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Helper;
use b8\Cache;
use b8\Config;
use b8\HttpClient;
/**
* Provides some basic diff processing functionality.
* @package PHPCI\Helper
*/
class Diff
{
/**
* Take a diff
* @param string $diff
* @return array
*/
public function getLinePositions($diff)
{
if (empty($diff)) {
return null;
}
$rtn = array();
$diffLines = explode(PHP_EOL, $diff);
while (count($diffLines)) {
$line = array_shift($diffLines);
if (substr($line, 0, 2) == '@@') {
array_unshift($diffLines, $line);
break;
}
}
$lineNumber = 0;
$position = 0;
foreach ($diffLines as $diffLine) {
if (preg_match('/@@\s+\-[0-9]+\,[0-9]+\s+\+([0-9]+)\,([0-9]+)/', $diffLine, $matches)) {
$lineNumber = (int)$matches[1] - 1;
}
$rtn[$lineNumber] = $position;
$lineNumber++;
$position++;
}
return $rtn;
}
}

View file

@ -12,6 +12,10 @@ namespace PHPCI\Helper;
use b8\Config;
use PHPCI\Helper\MailerFactory;
/**
* Helper class for sending emails using PHPCI's email configuration.
* @package PHPCI\Helper
*/
class Email
{
const DEFAULT_FROM = 'PHPCI <no-reply@phptesting.org>';
@ -23,11 +27,20 @@ class Email
protected $isHtml = false;
protected $config;
/**
* Create a new email object.
*/
public function __construct()
{
$this->config = Config::getInstance();
}
/**
* Set the email's To: header.
* @param string $email
* @param string|null $name
* @return $this
*/
public function setEmailTo($email, $name = null)
{
$this->emailTo[$email] = $name;
@ -35,6 +48,12 @@ class Email
return $this;
}
/**
* Add an address to the email's CC header.
* @param string $email
* @param string|null $name
* @return $this
*/
public function addCc($email, $name = null)
{
$this->emailCc[$email] = $name;
@ -42,6 +61,11 @@ class Email
return $this;
}
/**
* Set the email subject.
* @param string $subject
* @return $this
*/
public function setSubject($subject)
{
$this->subject = $subject;
@ -49,6 +73,11 @@ class Email
return $this;
}
/**
* Set the email body.
* @param string $body
* @return $this
*/
public function setBody($body)
{
$this->body = $body;
@ -56,13 +85,22 @@ class Email
return $this;
}
public function setIsHtml($isHtml = false)
/**
* Set whether or not the email body is HTML.
* @param bool $isHtml
* @return $this
*/
public function setHtml($isHtml = false)
{
$this->isHtml = $isHtml;
return $this;
}
/**
* Send the email.
* @return bool|int
*/
public function send()
{
$smtpServer = $this->config->get('phpci.email_settings.smtp_address');
@ -74,6 +112,10 @@ class Email
}
}
/**
* Sends the email via the built in PHP mail() function.
* @return bool
*/
protected function sendViaMail()
{
$headers = '';
@ -100,6 +142,10 @@ class Email
return mail($emailTo, $this->subject, $this->body, $headers);
}
/**
* Sends the email using SwiftMailer.
* @return int
*/
protected function sendViaSwiftMailer()
{
$factory = new MailerFactory($this->config->get('phpci'));
@ -121,6 +167,10 @@ class Email
return $mailer->send($message);
}
/**
* Get the from address to use for the email.
* @return mixed|string
*/
protected function getFrom()
{
$email = $this->config->get('phpci.email_settings.from_address', self::DEFAULT_FROM);

View file

@ -13,8 +13,18 @@ use b8\Cache;
use b8\Config;
use b8\HttpClient;
/**
* The Github Helper class provides some Github API call functionality.
* @package PHPCI\Helper
*/
class Github
{
/**
* Make a request to the Github API.
* @param $url
* @param $params
* @return mixed
*/
public function makeRequest($url, $params)
{
$http = new HttpClient('https://api.github.com');
@ -38,24 +48,18 @@ class Github
$res = $http->get($url, $params);
foreach ($res['body'] as $item) {
$results[] = $item;
}
foreach ($res['headers'] as $header) {
if (preg_match('/^Link: <([^>]+)>; rel="next"/', $header, $r)) {
$host = parse_url($r[1]);
parse_str($host['query'], $params);
$results = $this->makeRecursiveRequest($host['path'], $params, $results);
break;
}
}
return $results;
@ -69,7 +73,7 @@ class Github
$token = Config::getInstance()->get('phpci.github.token');
if (!$token) {
die(json_encode(null));
return null;
}
$cache = Cache::getCache(Cache::TYPE_APC);
@ -98,4 +102,74 @@ class Github
return $rtn;
}
/**
* Create a comment on a specific file (and commit) in a Github Pull Request.
* @param $repo
* @param $pullId
* @param $commitId
* @param $file
* @param $line
* @param $comment
* @return null
*/
public function createPullRequestComment($repo, $pullId, $commitId, $file, $line, $comment)
{
$token = Config::getInstance()->get('phpci.github.token');
if (!$token) {
return null;
}
$url = '/repos/' . strtolower($repo) . '/pulls/' . $pullId . '/comments';
$params = array(
'body' => $comment,
'commit_id' => $commitId,
'path' => $file,
'position' => $line,
);
$http = new HttpClient('https://api.github.com');
$http->setHeaders(array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($token . ':x-oauth-basic'),
));
$http->post($url, json_encode($params));
}
/**
* Create a comment on a Github commit.
* @param $repo
* @param $commitId
* @param $file
* @param $line
* @param $comment
* @return null
*/
public function createCommitComment($repo, $commitId, $file, $line, $comment)
{
$token = Config::getInstance()->get('phpci.github.token');
if (!$token) {
return null;
}
$url = '/repos/' . strtolower($repo) . '/commits/' . $commitId . '/comments';
$params = array(
'body' => $comment,
'path' => $file,
'position' => $line,
);
$http = new HttpClient('https://api.github.com');
$http->setHeaders(array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($token . ':x-oauth-basic'),
));
$http->post($url, json_encode($params));
}
}

200
PHPCI/Helper/Lang.php Normal file
View file

@ -0,0 +1,200 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Helper;
use b8\Config;
/**
* Languages Helper Class - Handles loading strings files and the strings within them.
*
* @package PHPCI\Helper
*/
class Lang
{
protected static $language = null;
protected static $strings = array();
protected static $languages = array();
/**
* Get a specific string from the language file.
*
* @param $string
* @return mixed|string
*/
public static function get($string)
{
$vars = func_get_args();
if (array_key_exists($string, self::$strings)) {
$vars[0] = self::$strings[$string];
return call_user_func_array('sprintf', $vars);
}
return '%%MISSING STRING: ' . $string . '%%';
}
/**
* Output a specific string from the language file.
*/
public static function out()
{
print call_user_func_array(array('PHPCI\Helper\Lang', 'get'), func_get_args());
}
/**
* Get the currently active language.
*
* @return string|null
*/
public static function getLanguage()
{
return self::$language;
}
/**
* Try and load a language, and if successful, set it for use throughout the system.
*
* @param $language
*
* @return bool
*/
public static function setLanguage($language)
{
if (in_array($language, self::$languages)) {
self::$language = $language;
self::$strings = self::loadLanguage();
return true;
}
return false;
}
/**
* Return a list of available languages and their names.
*
* @return array
*/
public static function getLanguageOptions()
{
$languages = array();
foreach (self::$languages as $language) {
$strings = array();
require(PHPCI_DIR . 'PHPCI/Languages/lang.' . $language . '.php');
$languages[$language] = $strings['language_name'];
}
return $languages;
}
/**
* Get the strings for the currently active language.
*
* @return string[]
*/
public static function getStrings()
{
return self::$strings;
}
/**
* Initialise the Language helper, try load the language file for the user's browser or the configured default.
*
* @param Config $config
*/
public static function init(Config $config)
{
self::loadAvailableLanguages();
// Try cookies first:
if (isset($_COOKIE) && array_key_exists('phpcilang', $_COOKIE) && self::setLanguage($_COOKIE['phpcilang'])) {
return;
}
// Try user language:
if (isset($_SERVER) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
$langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach ($langs as $lang) {
$parts = explode(';', $lang);
$language = strtolower($parts[0]);
if (self::setLanguage($language)) {
return;
}
}
}
// Try the installation default language:
$language = $config->get('phpci.basic.language', null);
if (self::setLanguage($language)) {
return;
}
// Fall back to English:
self::$language = 'en';
self::$strings = self::loadLanguage();
}
/**
* Load a specific language file.
*
* @return string[]|null
*/
protected static function loadLanguage()
{
$langFile = PHPCI_DIR . 'PHPCI/Languages/lang.' . self::$language . '.php';
if (!file_exists($langFile)) {
return null;
}
require($langFile);
if (is_null($strings) || !is_array($strings) || !count($strings)) {
return null;
}
return $strings;
}
/**
* Load the names of all available languages.
*/
protected static function loadAvailableLanguages()
{
$matches = array();
foreach (glob(PHPCI_DIR . 'PHPCI/Languages/lang.*.php') as $file) {
if (preg_match('/lang\.([a-z]{2}\-?[a-z]*)\.php/', $file, $matches)) {
self::$languages[] = $matches[1];
}
}
}
/**
* Create a time tag for localization.
*
* See http://momentjs.com/docs/#/displaying/format/ for a list of supported formats.
*
* @param \DateTime $dateTime The dateTime to represent.
* @param string $format The moment.js format to use.
*
* @return string The formatted tag.
*/
public static function formatDateTime(\DateTime $dateTime, $format = 'lll')
{
return sprintf(
'<time datetime="%s" data-format="%s">%s</time>',
$dateTime->format(\DateTime::ISO8601),
$format,
$dateTime->format(\DateTime::RFC2822)
);
}
}

View file

@ -0,0 +1,37 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Helper;
use b8\Config;
/**
* Login Is Disabled Helper - Checks if login is disabled in the view
* @author Stephen Ball <phpci@stephen.rebelinblue.com>
* @package PHPCI
* @subpackage Web
*/
class LoginIsDisabled
{
/**
* Checks if
* @param $method
* @param array $params
* @return mixed|null
*/
public function __call($method, $params = array())
{
unset($method, $params);
$config = Config::getInstance();
$state = (bool) $config->get('phpci.authentication_settings.state', false);
return (false !== $state);
}
}

View file

@ -9,7 +9,10 @@
namespace PHPCI\Helper;
/**
* Class MailerFactory helps to set up and configure a SwiftMailer object.
* @package PHPCI\Helper
*/
class MailerFactory
{
/**
@ -17,8 +20,16 @@ class MailerFactory
*/
protected $emailConfig;
public function __construct($config = null)
/**
* Set the mailer factory configuration.
* @param array $config
*/
public function __construct($config = array())
{
if (!is_array($config)) {
$config = array();
}
$this->emailConfig = isset($config['email_settings']) ? $config['email_settings'] : array();
}
@ -48,6 +59,11 @@ class MailerFactory
return \Swift_Mailer::newInstance($transport);
}
/**
* Return a specific configuration value by key.
* @param $configName
* @return null|string
*/
public function getMailConfig($configName)
{
if (isset($this->emailConfig[$configName]) && $this->emailConfig[$configName] != "") {
@ -55,7 +71,7 @@ class MailerFactory
} else {
// Check defaults
switch($configName) {
switch ($configName) {
case 'smtp_address':
return "localhost";
case 'default_mailto_address':

View file

@ -9,8 +9,16 @@
namespace PHPCI\Helper;
/**
* Helper class for dealing with SSH keys.
* @package PHPCI\Helper
*/
class SshKey
{
/**
* Uses ssh-keygen to generate a public/private key pair.
* @return array
*/
public function generate()
{
$tempPath = sys_get_temp_dir() . '/';
@ -31,9 +39,9 @@ class SshKey
$return = array('private_key' => '', 'public_key' => '');
if ($this->canGenerateKeys()) {
shell_exec('ssh-keygen -q -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@phpci"');
$output = @shell_exec('ssh-keygen -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@phpci"');
if (!empty($output)) {
$pub = file_get_contents($keyFile . '.pub');
$prv = file_get_contents($keyFile);
@ -48,12 +56,4 @@ class SshKey
return $return;
}
public function canGenerateKeys()
{
$keygen = @shell_exec('ssh-keygen -h');
$canGenerateKeys = !empty($keygen);
return $canGenerateKeys;
}
}

View file

@ -9,8 +9,17 @@
namespace PHPCI\Helper;
/**
* Unix/Linux specific extension of the CommandExecutor class.
* @package PHPCI\Helper
*/
class UnixCommandExecutor extends BaseCommandExecutor
{
/**
* Uses 'which' to find a system binary by name.
* @param string $binary
* @return null|string
*/
protected function findGlobalBinary($binary)
{
return trim(shell_exec('which ' . $binary));

View file

@ -17,6 +17,12 @@ namespace PHPCI\Helper;
*/
class User
{
/**
* Proxies method calls through to the current active user model.
* @param $method
* @param array $params
* @return mixed|null
*/
public function __call($method, $params = array())
{
$user = $_SESSION['phpci_user'];

View file

@ -9,10 +9,22 @@
namespace PHPCI\Helper;
/**
* Windows-specific extension of the CommandExecutor class.
* @package PHPCI\Helper
*/
class WindowsCommandExecutor extends BaseCommandExecutor
{
/**
* Use 'where' on Windows to find a binary, rather than 'which'
* @param string $binary
* @return null|string
*/
protected function findGlobalBinary($binary)
{
return trim(shell_exec('where ' . $binary));
$command = sprintf('where %s', $binary);
$result = shell_exec($command);
return trim($result);
}
}

397
PHPCI/Languages/lang.da.php Normal file
View file

@ -0,0 +1,397 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Dansk',
'language' => 'Sprog',
// Log in:
'log_in_to_phpci' => 'Log ind i PHPCI',
'login_error' => 'Forkert email-adresse eller adgangskode',
'forgotten_password_link' => 'Har du glemt din adgangskode?',
'reset_emailed' => 'Vi har sendt dig en email med et link til at nulstille din adgangskode.',
'reset_header' => '<strong>Bare rolig!</strong><br>Indtast blot din email-adresse, sender
vi dig et link til at nulstille din adgangskode.',
'reset_email_address' => 'Indtast din email-adresse:',
'reset_send_email' => 'Send nulstillings-link',
'reset_enter_password' => 'Indtast venligst en ny adgangskode',
'reset_new_password' => 'Ny adgangskode:',
'reset_change_password' => 'Skift adgangskode',
'reset_no_user_exists' => 'Der findes ingen bruger med den email-adresse, prøv igen.',
'reset_email_body' => 'Hej %s,
Du modtager denne email fordi du eller en anden person har anmodet om at nulstille din adgangskode til PHPCI.
Hvis det var dig kan du klikke følgende link for at nulstille din adgangskode: %ssession/reset-password/%d/%s
Hvis det ikke var dig kan du ignorere denne email og intet vil ske.
Tak,
PHPCI',
'reset_email_title' => 'PHPCI Adgangskode-nulstilling for %s',
'reset_invalid' => 'Ugyldig anmodning om adgangskode-nulstilling.',
'email_address' => 'Email-addresse',
'login' => 'Login / Email Address',
'password' => 'Adgangskode',
'log_in' => 'Log ind',
// Top Nav
'toggle_navigation' => 'Vis/skjul navigation',
'n_builds_pending' => '%d builds i køen',
'n_builds_running' => '%d builds kører',
'edit_profile' => 'Redigér profil',
'sign_out' => 'Log ud',
'branch_x' => 'Branch: %s',
'created_x' => 'Oprettet: %s',
'started_x' => 'Startet: %s',
// Sidebar
'hello_name' => 'Hej %s',
'dashboard' => 'Dashboard',
'admin_options' => 'Administrator-indstillinger',
'add_project' => 'Tilføj projekt',
'settings' => 'Indstillinger',
'manage_users' => 'Administrér brugere',
'plugins' => 'Plugins',
'view' => 'Vis',
'build_now' => 'Start build nu',
'edit_project' => 'Redigér projekt',
'delete_project' => 'Slet projekt',
// Project Summary:
'no_builds_yet' => 'Ingen builds pt.!',
'x_of_x_failed' => '%d af de sidste %d builds fejlede.',
'x_of_x_failed_short' => '%d / %d fejlede.',
'last_successful_build' => 'Sidste succesfulde build var %s.',
'never_built_successfully' => 'Dette projekt har indtil videre ingen succesfulde builds.',
'all_builds_passed' => 'All de sidste %d builds fejlede.',
'all_builds_passed_short' => '%d / %d lykkedes.',
'last_failed_build' => 'Det sidste mislykkede build var %s',
'never_failed_build' => 'Dette projekt er endnu ikke blevet kørt.',
'view_project' => 'Vis Projekt',
// Timeline:
'latest_builds' => 'Nyeste Builds',
'pending' => 'Venter',
'running' => 'Kører',
'success' => 'Succes',
'successful' => 'Lykkedes',
'failed' => 'Fejlede',
'manual_build' => 'Manuelt Build',
// Add/Edit Project:
'new_project' => 'Nyt Projekt',
'project_x_not_found' => 'Projektet med ID %d findes ikke.',
'project_details' => 'Projekt-detaljer',
'public_key_help' => 'For at gøre det lettere at starte har vi genereret en SSH-nøgle som du kan bruge til dette projekt. For at bruge den behøver du blot tilføje den følgende public key til "deployment keys" sektionen
i din foretrukne hosting-platform.',
'select_repository_type' => 'Vælg repository-type...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Ekstern URL',
'local' => 'Lokalt filsystem',
'hg' => 'Mercurial',
'where_hosted' => 'Hvor er dit projekt hosted?',
'choose_github' => 'Vælg et GitHub-repository:',
'repo_name' => 'Repository-navn / URL (ekstern) eller filsystem-sti (lokal)',
'project_title' => 'Projekt-titel',
'project_private_key' => 'Privat nøgle med adgang til dette repository
(tom for lokal nøgle og/eller anonym adgang)',
'build_config' => 'PHPCI build-konfiguration for dette projekt
(hvis du ikke har mulighed for at tilføje en phpci.yml fil i projektets repository)',
'default_branch' => 'Default branch navn',
'allow_public_status' => 'Tillad offentlig status-side og -billede for dette projekt?',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Gem Projekt',
'error_mercurial' => 'Mercurial repository-URL skal starte med http:// eller https://',
'error_remote' => 'Repository-URL skal starte med git://, http:// eller https://',
'error_gitlab' => 'GitLab repository-navn skal være i formatet "user@domæne.tld:ejernavn/repositorynavn.git"',
'error_github' => 'Repository-navn skal være i formatet "ejernavn/repositorynavn"',
'error_bitbucket' => 'Repository-navn skal være i formatet "ejernavn/repositorynavn"',
'error_path' => 'Stien du indtastede findes ikke.',
// View Project:
'all_branches' => 'Alle branches',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Date',
'project' => 'Projekt',
'commit' => 'Commit',
'branch' => 'Branch',
'status' => 'Status',
'prev_link' => '&laquo; Forrige',
'next_link' => 'Næste &raquo;',
'public_key' => 'Offentlig nøgle',
'delete_build' => 'Slet Build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'For at køre dette build automatisk når nye commits bliver pushed skal du tilføje nedenstående
URL som nyt "Webhook" i <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> under dit GitHub-repository.',
'webhooks_help_gitlab' => 'For at køre dette build automatisk når nye commits bliver pushed kan du tilføje nedenstående URL
som en "WebHook URL" i Web Hooks-sektionen i dit GitLab-repository.',
'webhooks_help_bitbucket' => 'For at køre dette build automatisk når nye commits bliver pushed skal du tilføje nedenstående
URL som "POST" service i
<a href="https://bitbucket.org/%s/admin/services">
Services</a> sektionen under dit Bitbucket-repository.',
// View Build
'build_x_not_found' => 'Build med ID %d findes ikke.',
'build_n' => 'Build %d',
'rebuild_now' => 'Gentag Build',
'committed_by_x' => 'Committed af %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Denne graf vises når buildet er færdigt.',
'build' => 'Build',
'lines' => 'Linjer',
'comment_lines' => 'Kommentar-linjer',
'noncomment_lines' => 'Ikke-kommentar-linjer',
'logical_lines' => 'Logiske linjer',
'lines_of_code' => 'Kode-linjer',
'build_log' => 'Build-log',
'quality_trend' => 'Kvalitets-trend',
'codeception_errors' => 'Codeception-fejl',
'phpmd_warnings' => 'PHPMD-advarsler',
'phpcs_warnings' => 'PHPCS-advarsler',
'phpcs_errors' => 'PHPCS-fejl',
'phplint_errors' => 'Lint-fejl',
'phpunit_errors' => 'PHPUnit-fejl',
'phpdoccheck_warnings' => 'Manglende Docblocks',
'issues' => 'Sager',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Manglende Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'file' => 'Fil',
'line' => 'Linje',
'class' => 'Klasse',
'method' => 'Funktion',
'message' => 'Besked',
'start' => 'Start',
'end' => 'Slut',
'from' => 'Fra',
'to' => 'Til',
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Tog %d sekunder',
'build_created' => 'Build Oprettet',
'build_started' => 'Build Startet',
'build_finished' => 'Build Afsluttet',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Navn',
'password_change' => 'Adgangskode (tom hvis du ikke ønsker at ændre koden)',
'save' => 'Gem &raquo;',
'update_your_details' => 'Opdatér oplysninger',
'your_details_updated' => 'Dine oplysninger blev gemt.',
'add_user' => 'Tilføj bruger',
'is_admin' => 'Administrator?',
'yes' => 'Ja',
'no' => 'Nej',
'edit' => 'Redigér',
'edit_user' => 'Redigér Bruger',
'delete_user' => 'Slet Bruger',
'user_n_not_found' => 'Brugeren med ID %d findes ikke.',
'is_user_admin' => 'Er denne bruger en administrator?',
'save_user' => 'Gem Bruger',
// Settings:
'settings_saved' => 'Dine indstillinger blev gemt.',
'settings_check_perms' => 'Dine indstillinger kunne ikke gemmes, kontrollér rettighederne på din config.yml fil.',
'settings_cannot_write' => 'PHPCI kan ikke skrive til din config.yml fil, indstillinger bliver muligvis ikke gemt korrekt før dette problem løses.',
'settings_github_linked' => 'Din GitHub-konto er nu tilsluttet.',
'settings_github_not_linked' => 'Din GitHub-konto kunne ikke tilsluttes.',
'build_settings' => 'Build-indstillinger',
'github_application' => 'GitHub-applikation',
'github_sign_in' => 'Før du kan bruge GitHub skal du <a href="%s">logge ind</a> og give PHPCI
adgang til din konto.',
'github_phpci_linked' => 'PHPCI blev tilsluttet din GitHub-konto.',
'github_where_to_find' => 'Hvor disse findes...',
'github_where_help' => 'Hvis du ejer applikationen du ønsker at bruge kan du finde denne information i
<a href="https://github.com/settings/applications">applications</a> under indstillinger.',
'email_settings' => 'Email-indstillinger',
'email_settings_help' => 'Før PHPCI kan sende build-notifikationer via email
skal du konfigurere nedenstående SMTP-indstillinger.',
'application_id' => 'Application ID',
'application_secret' => 'Application Secret',
'smtp_server' => 'SMTP-server',
'smtp_port' => 'SMTP-port',
'smtp_username' => 'SMTP-brugernavn',
'smtp_password' => 'SMTP-adgangskode',
'from_email_address' => 'Fra email-adresse',
'default_notification_address' => 'Default notifikations-email-adresse',
'use_smtp_encryption' => 'Brug SMTP-kryptering?',
'none' => 'Ingen',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Betragt et build som fejlet efter',
'5_mins' => '5 minutter',
'15_mins' => '15 minutter',
'30_mins' => '30 minutter',
'1_hour' => '1 time',
'3_hours' => '3 timer',
// Plugins
'cannot_update_composer' => 'PHPCI kan ikke opdatere composer.json da filen ikke kan skrives.',
'x_has_been_removed' => '%s er blevet slettet.',
'x_has_been_added' => '%s blev tilføjet til composer.json for dig og vil blive installeret næste gang
du kører composer update.',
'enabled_plugins' => 'Aktive plugins',
'provided_by_package' => 'Via pakke',
'installed_packages' => 'Installerede pakker',
'suggested_packages' => 'Forslag til pakker',
'title' => 'Titel',
'description' => 'Beskrivelse',
'version' => 'Version',
'install' => 'Installér &raquo;',
'remove' => 'Fjern &raquo;',
'search_packagist_for_more' => 'Søg på Packagist efter flere pakker',
'search' => 'Søg &raquo;',
// Installer
'installation_url' => 'PHPCI Installations-URL',
'db_host' => 'Database-hostnavn',
'db_name' => 'Database-navn',
'db_user' => 'Database-brugernavn',
'db_pass' => 'Database-adgangskode',
'admin_name' => 'Administrator-navn',
'admin_pass' => 'Administrator-adgangskode',
'admin_email' => 'Administrators email-adresse',
'config_path' => 'Konfigurations-fil',
'install_phpci' => 'Installér PHPCI',
'welcome_to_phpci' => 'Velkommen til PHPCI',
'please_answer' => 'Besvar venligst følgende spørgsmål:',
'phpci_php_req' => 'PHPCI kræver minimum PHP version 5.3.8 for at fungere.',
'extension_required' => 'Extension påkrævet: %s',
'function_required' => 'PHPCI behøver adgang til funktion %s() i PHP. Er den deaktiveret i php.ini?',
'requirements_not_met' => 'PHPCI kan ikke installeres da nogle krav ikke opfyldtes.
Kontrollér venligst nedenstående fejl før du fortsætter.',
'must_be_valid_email' => 'Skal være en gyldig email-adresse.',
'must_be_valid_url' => 'Skal være en gyldig URL.',
'enter_name' => 'Administrator-navn: ',
'enter_email' => 'Administrators email-adresse: ',
'enter_password' => 'Administrator-adgangskode: ',
'enter_phpci_url' => 'Din PHPCI URL (eksempelvis "http://phpci.local"): ',
'enter_db_host' => 'Indtast dit MySQL-hostnavn [localhost]: ',
'enter_db_name' => 'Indtast dit MySQL database-navn [phpci]: ',
'enter_db_user' => 'Indtast dit MySQL-brugernavn [phpci]: ',
'enter_db_pass' => 'Indtast dit MySQL-password: ',
'could_not_connect' => 'PHPCI kunne ikke forbinde til MySQL med de angivning oplysninger. Forsøg igen.',
'setting_up_db' => 'Indlæser database...',
'user_created' => 'Brugerkonto oprettet!',
'failed_to_create' => 'PHPCI kunne ikke oprette din administrator-konto.',
'config_exists' => 'PHPCI konfigurationsfilen findes og er ikke tom.',
'update_instead' => 'Hvis du forsøgte at opdatere PHPCI, forsøg da venligst med phpci:update istedet.',
// Update
'update_phpci' => 'Opdatér databasen med ændrede modeller',
'updating_phpci' => 'Opdaterer PHPCI-database:',
'not_installed' => 'PHPCI lader til ikke at være installeret.',
'install_instead' => 'Installér venligst PHPCI via phpci:install istedet.',
// Poll Command
'poll_github' => 'Check via GitHub om et build skal startes.',
'no_token' => 'GitHub-token findes ikke',
'finding_projects' => 'Finder projekter der kan forespørges',
'found_n_projects' => '%d projekter fundet',
'last_commit_is' => 'Sidste commit til GitHub for %s er %s',
'adding_new_build' => 'Sidste commit er forskellig fra databasen, tilføjer nyt build.',
'finished_processing_builds' => 'Kørsel af builds afsluttet.',
// Create Admin
'create_admin_user' => 'Tilføj en administrator',
'incorrect_format' => 'Forkert format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Kør alle PHPCI builds i køen.',
'finding_builds' => 'Finder builds der skal køres',
'found_n_builds' => '%d builds fundet',
'skipping_build' => 'Springer over Build %d - projektet kører et build lige nu.',
'marked_as_failed' => 'Build %d blev markeret som fejlet pga. timeout.',
// Builder
'missing_phpci_yml' => 'Dette projekt har ingen phpci.yml fil, eller filen er tom.',
'build_success' => 'BUILD SUCCES',
'build_failed' => 'BUILD FEJLET',
'removing_build' => 'Fjerner Build',
'exception' => 'Undtagelse:',
'could_not_create_working' => 'Kunne ikke oprette en arbejds-kopi.',
'working_copy_created' => 'Arbejds-kopi oprettet: %s',
'looking_for_binary' => 'Leder efter kommando: %s',
'found_in_path' => 'Fundet i %s: %s',
'running_plugin' => 'KØRER PLUGIN: %s',
'plugin_success' => 'PLUGIN: SUCCES',
'plugin_failed' => 'PLUGIN: FEJL',
'plugin_missing' => 'Plugin findes ikke: %s',
'tap_version' => 'TapParser understøtter kun TAP version 13.',
'tap_error' => 'Ugyldig TAP-streng, antallet af tests passer ikke med det angivne antal tests.',
// Build Plugins:
'no_tests_performed' => 'Ingen tests udført.',
'could_not_find' => 'Kunne ikke finde %s',
'no_campfire_settings' => 'Ingen forbindelses-oplysninger angivet i Campfire plugin',
'failed_to_wipe' => 'Kunne ikke slette eksisterende mappe %s før kopi',
'passing_build' => 'Succesfuldt Build',
'failing_build' => 'Fejlet Build',
'log_output' => 'Log-output:',
'n_emails_sent' => '%d emails afsendt.',
'n_emails_failed' => '%d emails kunne ikke afsendes.',
'unable_to_set_env' => 'Kunne ikke sætte environment-variabel',
'tag_created' => 'Tag oprettet af PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% bygget på %BUILD_URI%',
'hipchat_settings' => 'Angiv venligst rum og autoToken i hipchat_notify plugin',
'irc_settings' => 'Du skal som minimum indstille en server, et rum og et nicknavn.',
'invalid_command' => 'Ugyldig kommando',
'import_file_key' => 'Importen skal indeholde en \'file\' variabel',
'cannot_open_import' => 'Kunne ikke åbne SQL import-fil: %s',
'unable_to_execute' => 'Kunne ikke udføre instruktionerne i SQL-filen',
'phar_internal_error' => 'Phar Plugin Internal Error',
'build_file_missing' => 'Den angivne build-fil findes ikke.',
'property_file_missing' => 'Den angivne property-fil findes ikke',
'could_not_process_report' => 'Kunne ikke behandle rapporten, som dette værktøj genererede.',
'shell_not_enabled' => 'Shell-plugin er ikke aktiveret. Aktivér det via config.yml.'
);

433
PHPCI/Languages/lang.de.php Normal file
View file

@ -0,0 +1,433 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Deutsch',
'language' => 'Sprache',
// Log in:
'log_in_to_phpci' => 'In PHPCI einloggen',
'login_error' => 'Fehlerhafte Emailadresse oder fehlerhaftes Passwort',
'forgotten_password_link' => 'Passwort vergessen?',
'reset_emailed' => 'Wir haben Ihnen einen Link geschickt, um Ihr Passwort zurückzusetzen',
'reset_header' => '<strong>Keine Panik!</strong><br>Geben Sie einfach unten Ihre Emailadresse an
und wir senden Ihnen einen Link, um Ihr Passwort zurückzusetzen',
'reset_email_address' => 'Geben Sie Ihre Emailadresse an:',
'reset_send_email' => 'Link senden',
'reset_enter_password' => 'Bitte geben Sie ein neues Passwort ein',
'reset_new_password' => 'Neues Passwort:',
'reset_change_password' => 'Passwort ändern',
'reset_no_user_exists' => 'Es existiert kein User mit dieser Emailadresse, versuchen Sie es bitte noch einmal.',
'reset_email_body' => 'Hallo %s,
Sie haben diese Email erhalten, weil Sie, oder jemand anders, einen Link zum Zurücksetzen Ihres Passwortes für PHPCI verlangt hat.
Wenn Sie diesen Link verlangt haben, klicken Sie bitte hier, um Ihr Passwort zurückzusetzen: %ssession/reset-password/%d/%s
Falls nicht, ignorieren Sie diese Email bitte, und es wird nichts geändert.
Danke,
PHPCI',
'reset_email_title' => 'PHPCI Passwort zurücksetzen für %s',
'reset_invalid' => 'Fehlerhafte Anfrage für das Zurücksetzen eines Passwortes',
'email_address' => 'Emailadresse',
'login' => 'Login / Emailadresse',
'password' => 'Passwort',
'log_in' => 'Einloggen',
// Top Nav
'toggle_navigation' => 'Navigation umschalten',
'n_builds_pending' => '%d Builds ausstehend',
'n_builds_running' => '%d Builds werden ausgeführt',
'edit_profile' => 'Profil bearbeiten',
'sign_out' => 'Ausloggen',
'branch_x' => 'Branch: %s',
'created_x' => 'Erstellt: %s',
'started_x' => 'Gestartet: %s',
// Sidebar
'hello_name' => 'Hallo, %s',
'dashboard' => 'Dashboard',
'admin_options' => 'Administration',
'add_project' => 'Projekt hinzufügen',
'settings' => 'Einstellungen',
'manage_users' => 'Benutzereinstellungen',
'plugins' => 'Plugins',
'view' => 'Ansehen',
'build_now' => 'Jetzt bauen',
'edit_project' => 'Projekt bearbeiten',
'delete_project' => 'Projekt löschen',
// Project Summary:
'no_builds_yet' => 'Bisher noch keine Builds!',
'x_of_x_failed' => '%d der letzten %d Builds sind fehlgeschlagen.',
'x_of_x_failed_short' => '%d / %d fehlgeschlagen.',
'last_successful_build' => ' Der letzte erfolgreiche Build war %s.',
'never_built_successfully' => ' Dieses Projekt hatte bisher noch keinen erfolgreichen Build.',
'all_builds_passed' => 'Jeder der letzten %d Builds war erfolgreich.',
'all_builds_passed_short' => '%d / %d erfolgreich.',
'last_failed_build' => ' Der letzte fehlgeschlagene Build war %s.',
'never_failed_build' => ' Dieses Projekt hat keine fehlgeschlagenen Builds.',
'view_project' => 'Projekt ansehen',
// Timeline:
'latest_builds' => 'Die neusten Builds',
'pending' => 'Ausstehend',
'running' => 'Wird ausgeführt',
'success' => 'Erfolg',
'successful' => 'Erfolgreich',
'failed' => 'Fehlgeschlagen',
'manual_build' => 'Manueller Build',
// Add/Edit Project:
'new_project' => 'Neues Projekt',
'project_x_not_found' => 'Projekt mit ID %d existiert nicht.',
'project_details' => 'Projektdetails',
'public_key_help' => 'Um Ihnen den Einstieg zu erleichtern, haben wir ein SSH-Key-Paar für dieses Projekt
generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Abschnitt
"Deploy Keys" Ihrer bevorzugten Quellcodehostingplattform hinzu.',
'select_repository_type' => 'Wählen Sie den Typ des Repositories...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Externe URL',
'local' => 'Lokaler Pfad',
'hg' => 'Mercurial',
'svn' => 'Subversion',
'where_hosted' => 'Wo wird Ihr Projekt gehostet?',
'choose_github' => 'Wählen Sie ein GitHub Repository:',
'repo_name' => 'Name/URL (extern) oder Pfad (lokal) des Repositories',
'project_title' => 'Projekttitel',
'project_private_key' => 'Private Key für den Zugang zum Repository
(leer lassen für lokale und oder anonyme externe Zugriffe)',
'build_config' => 'PHPCI Buildkonfiguration für dieses Projekt
(falls Sie Ihrem Projektrepository kein phpci.yml hinzufügen können)',
'default_branch' => 'Name des Standardbranches',
'allow_public_status' => 'Öffentliche Statusseite und -bild für dieses Projekt einschalten?',
'archived' => 'Archiviert',
'archived_menu' => 'Archiviert',
'save_project' => 'Projekt speichern',
'error_mercurial' => 'Mercurial Repository-URL muss mit http://, oder https:// beginnen',
'error_remote' => 'Repository-URL muss mit git://, http://, oder https:// beginnen',
'error_gitlab' => 'GitLab Repositoryname muss im Format "user@domain.tld:owner/repo.git" sein',
'error_github' => 'Repositoryname muss im Format "besitzer/repo" sein',
'error_bitbucket' => 'Repositoryname muss im Format "besitzer/repo" sein',
'error_path' => 'Der angegebene Pfad existiert nicht',
// View Project:
'all_branches' => 'Alle Branches',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Datum',
'project' => 'Projekt',
'commit' => 'Commit',
'branch' => 'Branch',
'status' => 'Status',
'prev_link' => '&laquo; Vorherige',
'next_link' => 'Nächste &raquo;',
'public_key' => 'Public Key',
'delete_build' => 'Build löschen',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Um für dieses Projekt automatisch einen Build zu starten, wenn neue Commits gepushed
werden, fügen Sie die untenstehende URL in der
<a href="https://github.com/%s/settings/hooks">Webhooks and Services</a>-Sektion Ihres
GitHub Repositories als neuen "Webhook" hinzu.',
'webhooks_help_gitlab' => 'Um für dieses Projekt automatisch einen Build zu starten, wenn neue Commits gepushed werden, fügen Sie die untenstehende URL in der Web Hooks Sektion Ihres GitLab Repositories hinzu.',
'webhooks_help_bitbucket' => 'Um für dieses Projekt automatisch einen Build zu starten, wenn neue Commits gepushed werden, fügen Sie die untenstehende URL als "POST" Service in der <a href="https://bitbucket.org/%s/admin/services">Services</a>-Sektion Ihres Bitbucket Repositories hinzu.',
// View Build
'errors' => 'Fehler',
'information' => 'Information',
'build_x_not_found' => 'Build mit ID %d existiert nicht.',
'build_n' => 'Build %d',
'rebuild_now' => 'Build neu starten',
'committed_by_x' => 'Committed von %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Dieses Diagramm wird angezeigt, sobald der Build abgeschlossen ist.',
'build' => 'Build',
'lines' => 'Zeilen',
'comment_lines' => 'Kommentarzeilen',
'noncomment_lines' => 'Nicht-Kommentarzeilen',
'logical_lines' => 'Zeilen mit Logik',
'lines_of_code' => 'Anzahl Codezeilen',
'build_log' => 'Buildprotokoll',
'quality_trend' => 'Qualitätstrend',
'codeception_errors' => 'Codeception Errors',
'phpmd_warnings' => 'PHPMD Warnings',
'phpcs_warnings' => 'PHPCS Warnings',
'phpcs_errors' => 'PHPCS Errors',
'phplint_errors' => 'Lint Errors',
'phpunit_errors' => 'PHPUnit Errors',
'phpdoccheck_warnings' => 'Fehlende Docblocks',
'issues' => 'Probleme',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Fehlende Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'technical_debt' => 'Technische Schulden',
'behat' => 'Behat',
'codeception_feature' => 'Feature',
'codeception_suite' => 'Suite',
'codeception_time' => 'Zeit',
'codeception_synopsis' => '<strong>%1$d</strong> Tests in <strong>%2$f</strong> Sekunden ausgeführt.
<strong>%3$d</strong> Fehler.',
'file' => 'Datei',
'line' => 'Zeile',
'class' => 'Klasse',
'method' => 'Methode',
'message' => 'Nachricht',
'start' => 'Start',
'end' => 'Ende',
'from' => 'Von',
'to' => 'Bis',
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Benötigte %d Sekunden',
'build_created' => 'Build erstellt',
'build_started' => 'Build gestartet',
'build_finished' => 'Build abgeschlossen',
'test_message' => 'Nachricht',
'test_no_message' => 'Keine Nachricht',
'test_success' => 'Erfolgreich: %d',
'test_fail' => 'Fehlschläge: %d',
'test_skipped' => 'Übersprungen: %d',
'test_error' => 'Fehler: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d Test(s)',
// Users
'name' => 'Name',
'password_change' => 'Passwort (leerlassen, wenn Sie es nicht ändern möchten)',
'save' => 'Speichern &raquo;',
'update_your_details' => 'Aktualisieren Sie Ihre Details',
'your_details_updated' => 'Ihre Details wurden aktualisiert.',
'add_user' => 'Benutzer hinzufügen',
'is_admin' => 'Administrator?',
'yes' => 'Ja',
'no' => 'Nein',
'edit' => 'Bearbeiten',
'edit_user' => 'Benutzer bearbeiten',
'delete_user' => 'Benutzer löschen',
'user_n_not_found' => 'Benutzer mit ID %d existiert nicht.',
'is_user_admin' => 'Ist dieser Benutzer Administrator?',
'save_user' => 'Benutzer speichern',
// Settings:
'settings_saved' => 'Ihre Einstellungen wurden gespeichert.',
'settings_check_perms' => 'Ihre Einstellungen konnten nicht gespeichert werden, bitte überprüfen Sie die
Berechtigungen Ihrer config.yml-Datei',
'settings_cannot_write' => 'PHPCI konnte config.yml nicht schreiben. Einstellungen könnten nicht richtig gespeichert werden, bis das Problem behoben ist.',
'settings_github_linked' => 'Ihr GitHub-Konto wurde verknüpft.',
'settings_github_not_linked' => 'Ihr GitHub-Konto konnte nicht verknüpft werden.',
'build_settings' => 'Buildeinstellungen',
'github_application' => 'GitHub-Applikation',
'github_sign_in' => 'Bevor Sie anfangen GitHub zu verwenden, müssen Sie sich erst <a href="%s">einloggen</a> und PHPCI Zugriff auf Ihr Nutzerkonto gewähren',
'github_phpci_linked' => 'PHPCI wurde erfolgreich mit Ihrem GitHub-Konto verknüpft.',
'github_where_to_find' => 'Wo Sie diese finden...',
'github_where_help' => 'Wenn Sie der Besitzer der Applikation sind, die Sie gerne verwenden möchten, können Sie
diese Einstellungen in Ihrem "<a href="https://github.com/settings/applications">applications</a>
settings"-Bereich finden.',
'email_settings' => 'Emaileinstellungen',
'email_settings_help' => 'Bevor PHPCI E-Mails zum Buildstatus verschicken kann,
müssen Sie Ihre SMTP-Einstellungen unten konfigurieren',
'application_id' => 'Applikations-ID',
'application_secret' => 'Applikations-Secret',
'smtp_server' => 'SMTP Server',
'smtp_port' => 'SMTP Port',
'smtp_username' => 'SMTP Benutzername',
'smtp_password' => 'SMTP Passwort',
'from_email_address' => 'Absenderadresse',
'default_notification_address' => 'Standardadresse für Benachrichtigungen',
'use_smtp_encryption' => 'SMTP-Verschlüsselung verwenden?',
'none' => 'Keine',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Einen Build als fehlgeschlagen ansehen nach',
'5_mins' => '5 Minuten',
'15_mins' => '15 Minuten',
'30_mins' => '30 Minuten',
'1_hour' => '1 Stunde',
'3_hours' => '3 Stunden',
// Plugins
'cannot_update_composer' => 'PHPCI kann composer.json nicht für Sie aktualisieren, da Schreibrechte benötigt werden.',
'x_has_been_removed' => '%s wurde entfernt.',
'x_has_been_added' => '%s wurde für Sie dem composer.json hinzugefügt und wird installiert, sobald Sie das nächste mal composer update ausführen.',
'enabled_plugins' => 'Eingeschaltene Plugins',
'provided_by_package' => 'Von Package bereitgestellt',
'installed_packages' => 'Installierte Packages',
'suggested_packages' => 'Vorgeschlagene Packages',
'title' => 'Titel',
'description' => 'Beschreibung',
'version' => 'Version',
'install' => 'Installieren &raquo;',
'remove' => 'Entfernen &raquo;',
'search_packagist_for_more' => 'Packagist nach mehr Packages durchsuchen',
'search' => 'Suchen &raquo;',
// Summary plugin
'build-summary' => 'Zusammenfassung',
'stage' => 'Abschnitt',
'duration' => 'Dauer',
'plugin' => 'Plugin',
'stage_setup' => 'Vorbereitung',
'stage_test' => 'Test',
'stage_complete' => 'Vollständig',
'stage_success' => 'Erfolg',
'stage_failure' => 'Fehlschlag',
'stage_broken' => 'Defekt',
'stage_fixed' => 'Behoben',
// Installer
'installation_url' => 'PHPCI Installations-URL',
'db_host' => 'Datenbankserver',
'db_name' => 'Datenbankname',
'db_user' => 'Datenbankbenutzer',
'db_pass' => 'Datenbankpasswort',
'admin_name' => 'Administratorname',
'admin_pass' => 'Administratorpasswort',
'admin_email' => 'Emailadresse des Administrators',
'config_path' => 'Dateipfad für Konfiguration',
'install_phpci' => 'PHPCI installieren',
'welcome_to_phpci' => 'Willkommen bei PHPCI',
'please_answer' => 'Bitte beantworten Sie die folgenden Fragen:',
'phpci_php_req' => 'PHPCI benötigt mindestens PHP 5.3.8 um zu funktionieren.',
'extension_required' => 'Benötigte Extensions: %s',
'function_required' => 'PHPCI muss die Funktion %s() aufrufen können. Ist sie in php.ini deaktiviert?',
'requirements_not_met' => 'PHPCI konnte nicht installiert werden, weil nicht alle Bedingungen erfüllt sind.
Bitte überprüfen Sie die Fehler, bevor Sie fortfahren,',
'must_be_valid_email' => 'Muss eine gültige Emailadresse sein.',
'must_be_valid_url' => 'Muss eine valide URL sein.',
'enter_name' => 'Name des Administrators: ',
'enter_email' => 'Emailadresse des Administrators: ',
'enter_password' => 'Passwort des Administrators: ',
'enter_phpci_url' => 'Ihre PHPCI-URL (z.B. "http://phpci.local"): ',
'enter_db_host' => 'Bitte geben Sie Ihren MySQL-Host ein [localhost]: ',
'enter_db_name' => 'Bitte geben Sie Ihren MySQL-Namen ein [phpci]: ',
'enter_db_user' => 'Bitte geben Sie Ihren MySQL-Benutzernamen ein [phpci]: ',
'enter_db_pass' => 'Bitte geben Sie Ihr MySQL-Passwort ein: ',
'could_not_connect' => 'PHPCI konnte wegen folgender Details nicht mit MySQL verbinden. Bitte versuchen Sie es erneut.',
'setting_up_db' => 'Ihre Datenbank wird aufgesetzt... ',
'user_created' => 'Benutzerkonto wurde erstellt!',
'failed_to_create' => 'PHPCI konnte Ihr Administratorenkonto nicht erstellen.',
'config_exists' => 'Die PHPCI-Konfigurationsdatei existiert und ist nicht leer..',
'update_instead' => 'Falls Sie versucht haben PHPCI zu aktualisieren, benutzen Sie bitte stattdessen phpci:update.',
// Update
'update_phpci' => 'Datenbank wird aktualisiert, um den Änderungen der Models zu entsprechen.',
'updating_phpci' => 'Aktualisiere PHPCI-Datenbank:',
'not_installed' => 'PHPCI scheint nicht installiert zu sein.',
'install_instead' => 'Bitte installieren Sie PHPCI stattdessen via phpci:install.',
// Poll Command
'poll_github' => 'GitHub abfragen, um herauszufinden, ob ein Build gestartet werden muss.',
'no_token' => 'Kein GitHub-Token gefunden',
'finding_projects' => 'Suche Projekte, um diese abzufragen',
'found_n_projects' => '%d Projekte gefunden',
'last_commit_is' => 'Der letzte Commit zu GitHub für %s ist %s',
'adding_new_build' => 'Letzter Commit unterscheidet sich von der Datenbank, füge neuen Build hinzu.',
'finished_processing_builds' => 'Bearbeiten der Builds abgeschlossen.',
// Create Admin
'create_admin_user' => 'Administratorenbenutzer erstellen',
'incorrect_format' => 'Falsches Format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Führe alle ausstehenden PHPCI Builds aus.',
'finding_builds' => 'Suche verarbeitbare Builds',
'found_n_builds' => '%d Builds gefunden',
'skipping_build' => 'Überspringe Build %d - Es wird bereits ein Build auf diesem Projekt ausgeführt.',
'marked_as_failed' => 'Build %d wegen Zeitüberschreitung als fehlgeschlagen markiert.',
// Builder
'missing_phpci_yml' => 'Dieses Projekt beinhaltet keine phpci.yml-Datei, oder sie ist leer.',
'build_success' => 'BUILD ERFOLGREICH',
'build_failed' => 'BUILD FEHLGESCHLAGEN',
'removing_build' => 'Entferne Build.',
'exception' => 'Exception: ',
'could_not_create_working' => 'Konnte keine Arbeitskopie erstellen.',
'working_copy_created' => 'Arbeitskopie erstellt: %s',
'looking_for_binary' => 'Suche Binärdatei: %s',
'found_in_path' => 'Gefunden in %s: %s',
'running_plugin' => 'AUSGEFÜHRTES PLUGIN: %s',
'plugin_success' => 'PLUGIN: ERFOLGREICH',
'plugin_failed' => 'PLUGIN: FEHLGECHLAGEN',
'plugin_missing' => 'Plugin existiert nicht: %s',
'tap_version' => 'TapParser unterstützt nur TAP version 13',
'tap_error' => 'Ungültiger TAP String, Anzahl Tests entspricht nicht angegebener Testzahl.',
// Build Plugins:
'no_tests_performed' => 'Keine Tests wurden ausgeführt.',
'could_not_find' => '%s wurde nicht gefunden',
'no_campfire_settings' => 'Keine Verbindungsparameter für das Campfire plugin gefunden',
'failed_to_wipe' => 'Konnte Ordner %s nicht vor dem Kopieren leeren',
'passing_build' => 'Durchlaufender Build',
'failing_build' => 'Fehlschlagender Build',
'log_output' => 'Protokollausgabe: ',
'n_emails_sent' => '%d Emails verschickt.',
'n_emails_failed' => 'Konnte %d Emails nicht verschicken.',
'unable_to_set_env' => 'Konnte Umgebungsvariable nicht setzen',
'tag_created' => 'Tag erstellt durch PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% gebuildet auf %BUILD_URI%',
'hipchat_settings' => 'Bitte definieren Sie Room und AuthToken für das hipchat_notify-Plugin',
'irc_settings' => 'Sie müssen einen Server, Room und Nick definieren.',
'invalid_command' => 'Ungültiges Kommando',
'import_file_key' => 'Import-Statements müssen einen \'file\'-Key enthalten',
'cannot_open_import' => 'Konnte SQL-Importdatei nicht öffnen: %s',
'unable_to_execute' => 'Konnte SQL-Datei nicht ausführen',
'phar_internal_error' => 'Phar Plugin Interner Fehler',
'build_file_missing' => 'Angegebene Builddatei existiert nicht.',
'property_file_missing' => 'Angegebene Eigenschaftsdatei existiert nicht.',
'could_not_process_report' => 'Konnte den von diesem Tool erstellten Bericht nicht verarbeiten.',
'shell_not_enabled' => 'Das Shell-Plugin ist nicht aktiviert. Bitte aktivieren Sie es via config.yml.',
// Error Levels:
'critical' => 'Kritisch',
'high' => 'Hoch',
'normal' => 'Normal',
'low' => 'Niedrig',
// Plugins that generate errors:
'php_mess_detector' => 'PHP Mess Detector',
'php_code_sniffer' => 'PHP Code Sniffer',
'php_unit' => 'PHP Unit',
'php_cpd' => 'PHP Copy/Paste Detector',
'php_docblock_checker' => 'PHP Docblock Checker',
);

399
PHPCI/Languages/lang.el.php Normal file
View file

@ -0,0 +1,399 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Ελληνικά',
'language' => 'Γλώσσα',
// Log in:
'log_in_to_phpci' => 'Είσοδος στο PHPCI',
'login_error' => 'Λάθος διεύθυνση e-mail ή κωδικός πρόσβασης',
'forgotten_password_link' => 'Ξεχάσατε τον κωδικό σας;',
'reset_emailed' => 'Σας έχουμε αποσταλεί ένα σύνδεσμο για να επαναφέρετε τον κωδικό πρόσβασής σας.',
'reset_header' => '<strong> Μην ανησυχείτε! </strong> <br> Απλά εισάγετε το email σας παρακάτω και θα θα σας αποστείλουμε ένα email
με ένα σύνδεσμο για να επαναφέρετε τον κωδικό πρόσβασής σας.',
'reset_email_address' => 'Εισάγετε τη διεύθυνση e-mail σας:',
'reset_send_email' => 'Email επαναφοράς κωδικού πρόσβασης',
'reset_enter_password' => 'Παρακαλώ εισάγετε ένα νέο κωδικό πρόσβασης',
'reset_new_password' => 'Νέος κωδικός πρόσβασης:',
'reset_change_password' => 'Αλλαγή κωδικού πρόσβασης',
'reset_no_user_exists' => 'Δεν υπάρχει χρήστης με αυτή την διεύθυνση ηλεκτρονικού ταχυδρομείου, παρακαλώ προσπαθήστε ξανά.',
'reset_email_body' => 'Γεια %s,
Έχετε λάβει αυτό το μήνυμα επειδή εσείς, ή κάποιος άλλος, ζήτησε επαναφορά κωδικού πρόσβασης για το PHPCI.
Αν ήσασταν εσείς, παρακαλώ κάντε κλικ στον παρακάτω σύνδεσμο για να επαναφέρετε τον κωδικό πρόσβασής σας: %ssession/reset-password/%d/%s
Σε αντίθετη περίπτωση, παρακαλούμε να αγνοήσετε αυτό το μήνυμα και δεν πρόκεται να πραγματοποιηθεί η επαναφορά.
Σας ευχαριστούμε,
PHPCI',
'reset_email_title' => 'PHPCI Επαναφορά Κωδικού για %s',
'reset_invalid' => 'Μη έγκυρο αίτημα επαναφοράς κωδικού πρόσβασης.',
'email_address' => 'Διεύθυνση email',
'login' => 'Login / Email Address',
'password' => 'Κωδικός πρόσβασης',
'log_in' => 'Είσοδος',
// Top Nav
'toggle_navigation' => 'Εναλλαγή πλοήγησης',
'n_builds_pending' => '%d κατασκευές σε εκκρεμότητα',
'n_builds_running' => '%d τρέχοντες κατασκευές',
'edit_profile' => 'Επεξεργασία Προφίλ',
'sign_out' => 'Έξοδος',
'branch_x' => 'Διακλάδωση: %s',
'created_x' => 'Δημιουργήθηκε: %s',
'started_x' => 'Ξεκίνησε: %s',
// Sidebar
'hello_name' => 'Γειά, %s',
'dashboard' => 'Πίνακας ελέγχου',
'admin_options' => 'Επιλογές Διαχειριστή',
'add_project' => 'Προσθήκη έργου',
'settings' => 'Ρυθμίσεις',
'manage_users' => 'Διαχείριση χρηστών',
'plugins' => 'Πρόσθετα',
'view' => 'Προβολή',
'build_now' => 'Κατασκευή τώρα',
'edit_project' => 'Επεξεργασία Έργου',
'delete_project' => 'Διαγραφή Έργου',
// Project Summary:
'no_builds_yet' => 'Καμία κατασκευή ακόμα!',
'x_of_x_failed' => '%d από τις %d τελευταίες κατασκευές απέτυχαν',
'x_of_x_failed_short' => '%d / %d απέτυχαν.',
'last_successful_build' => 'Η τελευταία επιτυχής κατασκεύη ήταν %s.',
'never_built_successfully' => 'Αυτό το έργο δεν έχει ποτέ κατασκευαστεί με επιτυχία.',
'all_builds_passed' => 'Όλες από τις %d κατασκευές πέρασαν',
'all_builds_passed_short' => '%d / %d πέρασαν.',
'last_failed_build' => 'H τελευταία αποτυχημένη κατασκευή ήταν %s.',
'never_failed_build' => 'Το έργο αυτό δεν παρέλειψε ποτέ μια κατασκευή.',
'view_project' => 'Προβολή του έργου',
// Timeline:
'latest_builds' => 'Τελευταίες κατασκευές',
'pending' => 'Σε εκκρεμότητα',
'running' => 'Τρέχοντα',
'success' => 'Επιτυχία',
'successful' => 'Επιτυχής',
'failed' => 'Αποτυχία',
'manual_build' => 'Χειροκίνητη κατασκευή',
// Add/Edit Project:
'new_project' => 'Νέο έργο',
'project_x_not_found' => 'Το έργο με αριθμό %d δεν υπάρχει',
'project_details' => 'Στοιχεία Έργου',
'public_key_help' => 'Για να είναι πιο εύκολο να ξεκινήσετε, έχουμε δημιουργήσει ένα ζεύγος κλειδιών SSH για να χρησιμοποιήσετε
για το έργο αυτό. Για να τα χρησιμοποιήσετε, απλά προσθέστε το ακόλουθο δημόσιο κλειδί στο τμήμα "ανάπτυξη κλειδιών"
του επιλεγμένου πηγαίου κώδικα της πλατφόρμας φιλοξενίας σας.',
'select_repository_type' => 'Επιλέξτε τον τύπο του αποθετηρίου...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Απομακρυσμένη διεύθυνση URL',
'local' => 'Τοπική Διαδρομή',
'hg' => 'Ευμετάβλητο',
'where_hosted' => 'Πού φιλοξενείται το έργο σας;',
'choose_github' => 'Επιλέξτε ένα αποθετήριο GitHub:',
'repo_name' => 'Αποθετήριο Όνομα / διεύθυνση URL (Απομακρυσμένα) ή Διαδρομή (Τοπικά)',
'project_title' => 'Τίτλος Έργου',
'project_private_key' => 'Ιδιωτικό κλειδί για πρόσβαση σε αποθετήριο
(αφήστε κενό για την τοπική ή / και ανώνυμα απομακρυσμένα)',
'build_config' => 'Kατασκευή διαμόρφωσης PHPCI για αυτό το έργο
(αν δεν μπορείτε να προσθέσετε ένα αρχείο phpci.yml στο αποθετήριο έργων)',
'default_branch' => 'Προκαθορισμένο όνομα διακλάδωσης',
'allow_public_status' => 'Ενεργοποίηση της σελίδας δημόσιας κατάστασης και την εικόνα για το έργο αυτό;',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Αποθήκευση έργου',
'error_mercurial' => 'Ο σύνδεσμος URL του ευμετάβλητου αποθετηρίου πρέπει να ξεκινάει με http:// ή https://',
'error_remote' => 'Ο σύνδεσμος URL του αποθετηρίου πρέπει να ξεκινάει με git://, http:// ή https://',
'error_gitlab' => 'Το όνομα του αποθετηρίου GitLab πρέπει να είναι της μορφής "user@domain.tld:owner/repo.git"',
'error_github' => 'Το όνομα του αποθετηρίου θα πρέπει να είναι της μορφής "owner/repo" ιδιοκτήτης/αποθετήριο',
'error_bitbucket' => 'Το όνομα του αποθετηρίου θα πρέπει να είναι της μορφής "owner/repo" ιδιοκτήτης/αποθετήριο',
'error_path' => 'Η διαδρομή που καθορίσατε δεν υπάρχει.',
// View Project:
'all_branches' => 'Όλες οι διακλαδώσεις',
'builds' => 'Κατασκευές',
'id' => 'Αριθμός αναγνώρισης',
'date' => 'Date',
'project' => 'Έργο',
'commit' => 'Συνεισφορά',
'branch' => 'Διακλάδωση',
'status' => 'Κατάσταση',
'prev_link' => '&laquo; Προηγούμενο',
'next_link' => 'Επόμενο &laquo;',
'public_key' => 'Δημόσιο κλειδί',
'delete_build' => 'Διαγραφή κλειδιού',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Για την αυτόματη κατασκευή αυτού του έργου όταν υπάρχουν νέες συνεισφορές, προσθέστε τη διεύθυνση URL παρακάτω
ως ένα νέο "Webhook" στο τμήμα <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> του GitHub αποθετηρίου σας.',
'webhooks_help_gitlab' => 'Για την αυτόματη κατασκευή αυτού του έργου όταν υπάρχουν νέες συνεισφορές, προσθέστε την διεύθυνση URL παρακάτω
σαν "WebHook URL" στο τμήμα Web Hooks του GitLab αποθετηρίου σας.',
'webhooks_help_bitbucket' => 'Για την αυτόματη κατασκευή αυτού του έργου όταν υπάρχουν νέες συνεισφορές, προσθέστε τη διεύθυνση URL παρακάτω
ως μια υπηρεσία "POST" στο τμήμα <a href="https://bitbucket.org/%s/admin/services">
Services</a> του Bitbucket αποθετηρίου σας.',
// View Build
'build_x_not_found' => 'Η κατασκευή με αριθμό %d δεν υπάρχει',
'build_n' => 'Κατασκευή %d',
'rebuild_now' => 'Αναδόμηση τώρα',
'committed_by_x' => 'Έγινε συνεισφορά από %s',
'commit_id_x' => 'Συνεισφορά: %s',
'chart_display' => 'Αυτό το γράφημα θα εμφανιστεί μόλις η κατασκευή έχει ολοκληρωθεί.',
'build' => 'Κατασκευή',
'lines' => 'Γραμμές',
'comment_lines' => 'Γραμμές σχολίων',
'noncomment_lines' => 'Μη σχολιασμένες γραμμές',
'logical_lines' => 'Λογικές γραμμές',
'lines_of_code' => 'Γραμμές Κώδικα',
'build_log' => 'Αρχείο καταγραφής κατασκευών',
'quality_trend' => 'Ποιότητα τρέντ',
'codeception_errors' => 'Λάθη Codeception',
'phpmd_warnings' => 'Προειδοποιήσεις PHPMD',
'phpcs_warnings' => 'Προειδοποιήσεις PHPCS ',
'codeception_errors' => 'Λάθη Codeception',
'phpcs_errors' => 'Λάθη PHPCS',
'phplint_errors' => 'Λάθη Lint',
'phpunit_errors' => 'Λάθη PHPUnit ',
'phpdoccheck_warnings' => 'Χαμένα Docblocks',
'issues' => 'Θέματα',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Ανιχνευτής Αντιγραφής/Επικόλλησης',
'phpcs' => 'Sniffer Κώδικα PHP',
'phpdoccheck' => 'Χαμένα Docblocks',
'phpmd' => 'Aνιχνευτής PHP Mess',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'file' => 'Αρχείο',
'line' => 'Γραμμή',
'class' => 'Κατηγορία',
'method' => 'Μέθοδος',
'message' => 'Μήνυμα',
'start' => 'Έναρξη',
'end' => 'Τέλος',
'from' => 'Από',
'to' => 'Προς',
'result' => 'Αποτέλεσμα',
'ok' => 'ΟΚ',
'took_n_seconds' => 'Χρειάστηκαν %d δευτερόλεπτα',
'build_created' => 'Η κατασκευή δημιουργήθηκε',
'build_started' => 'Η κατασκευή άρχισε',
'build_finished' => 'Η κατασκευή ολοκληρώθηκε',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Όνομα',
'password_change' => 'Κωδικός πρόσβασης (αφήστε κενό αν δεν θέλετε να αλλάξετε)',
'save' => 'Αποθήκευση &raquo;',
'update_your_details' => 'Ενημερώστε τα στοιχεία σας',
'your_details_updated' => 'Τα στοιχεία σας έχουν ενημερωθεί.',
'add_user' => 'Προσθήκη χρήστη',
'is_admin' => 'Είναι διαχειριστής;',
'yes' => 'Ναι',
'no' => 'Όχι',
'edit' => 'Επεξεργασία',
'edit_user' => 'Επεξεργασία χρήστη',
'delete_user' => 'Διαγραφή χρήστη',
'user_n_not_found' => 'Ο χρήστης με αριθμό %d δεν υπάρχει.',
'is_user_admin' => 'Είναι αυτός ο χρήστης διαχειριστής;',
'save_user' => 'Αποθήκευση χρήστη',
// Settings:
'settings_saved' => 'Οι ρυθμίσεις σας έχουν αποθηκευτεί.',
'settings_check_perms' => 'Οι ρυθμίσεις σας δεν αποθηκεύτηκαν, ελέγξτε τα δικαιώματα του αρχείου σας config.yml.',
'settings_cannot_write' => 'Το PHPCI δεν μπορεί να γράψει στο αρχείο config.yml, οι ρυθμίσεις ενδέχεται να μην αποθηκευτούν σωστά
μέχρι να διορθωθεί.',
'settings_github_linked' => 'Ο λογαριασμός σας GitHub έχει συνδεθεί.',
'settings_github_not_linked' => 'Ο λογαριασμός σας Github δεν μπόρεσε να συνδεθεί.',
'build_settings' => 'Ρυθμίσεις κατασκευής',
'github_application' => 'GitHub Εφαρμογή',
'github_sign_in' => 'Πριν αρχίσετε να χρησιμοποιείτε το GitHub, θα πρέπει να <a href="%s"> συνδεθείται </a> και να δώσει
το PHPCI πρόσβαση στο λογαριασμό σας.',
'github_phpci_linked' => 'Το PHPCI συνδέθηκε με επιτυχία με το λογαριασμό Github.',
'github_where_to_find' => 'Πού να βρείτε αυτά ...',
'github_where_help' => 'Εάν έχετε στην κατοχή σας την εφαρμογή που θέλετε να χρησιμοποιήσετε, μπορείτε να βρείτε αυτές τις πληροφορίες στην περιοχή
<a href="https://github.com/settings/applications">Ρυθμίσεις εφαρμογών </a> ',
'email_settings' => 'Ρυθμίσεις email',
'email_settings_help' => 'Πριν το PHPCI μπορεί να στείλει μηνύματα ηλεκτρονικού ταχυδρομείου για την κατάσταση κατασκευής,
θα πρέπει να διαμορφώσετε τις ρυθμίσεις SMTP παρακάτω.',
'application_id' => 'Αναγνωριστικό εφαρμογής',
'application_secret' => 'Μυστική Εφαρμογή',
'smtp_server' => 'Διακομισής SMTP',
'smtp_port' => 'Θύρα SMTP',
'smtp_username' => 'Όνομα χρήστη SMTP',
'smtp_password' => 'Κωδικός πρόσβασης SMTP',
'from_email_address' => 'Εmail διεύθυνση αποστολέα',
'default_notification_address' => 'Προεπιλεγμένη διεύθυνση ειδοποίησης ηλεκτρονικού ταχυδρομείου ',
'use_smtp_encryption' => 'Εφαρμογή SMTP κρυπτογράφησης;',
'none' => 'Κανένα',
'ssl' => 'Κρυπτογράφηση SSL',
'tls' => 'Κρυπτογράφηση TLS',
'failed_after' => 'Να θεωρηθεί μια κατασκευή αποτυχημένη μετά ',
'5_mins' => '5 λεπτά',
'15_mins' => '15 λεπτά',
'30_mins' => '30 λεπτά',
'1_hour' => '1 ώρα',
'3_hours' => '3 ώρες',
// Plugins
'cannot_update_composer' => 'To PHPCI δεν μπορεί να ενημερώσει to composer.json για σας, γιατί δεν είναι εγγράψιμο.',
'x_has_been_removed' => '%s έχει αφαιρεθεί.',
'x_has_been_added' => '%s προσθέιηκε στο αρχείο composer.json για εσάς και θα εγκατασταθεί την επόμενη φορά
που θα τρέξετε την ενημέρωση για το composer.',
'enabled_plugins' => 'Ενεργοποιημένα πρόσθετα',
'provided_by_package' => 'Παρέχεται από πακέτο',
'installed_packages' => 'Εγκατεστημένα πακέτα',
'suggested_packages' => 'Προτεινόμενα πακέτα',
'title' => 'Τίτλος',
'description' => 'Περιγραφή',
'version' => 'Έκδοση',
'install' => 'Εγκατάσταση &raquo;',
'remove' => 'Αφαίρεση &raquo;',
'search_packagist_for_more' => 'Αναζήτηση στο Packagist για περισσότερα πακέτα',
'search' => 'Αναζήτηση &raquo;',
// Installer
'installation_url' => 'Σύνδεσμος URL εγκατάστασης του PHPCI',
'db_host' => 'Φιλοξενία βάσης δεδομένων',
'db_name' => 'Όνομα βάσης δεδομένων',
'db_user' => 'Όνομα χρήστη βάσης δεδομένων',
'db_pass' => 'Κωδικός πρόσβασης βάσης δεδομένων',
'admin_name' => 'Όνομα διαχειριστή',
'admin_pass' => 'Κωδικός πρόσβασης διαχειριστή',
'admin_email' => 'Διεύθυνση email διαχειριστή',
'config_path' => 'Διαδρομή αρχείου ρυθμίσεων',
'install_phpci' => 'Εγκατάσταση PHPCI',
'welcome_to_phpci' => 'Καλώς ήρθατε στο PHPCI',
'please_answer' => 'Παρακαλώ απαντήστε στις ακόλουθες ερωτήσεις:',
'phpci_php_req' => 'Το PHPCI απαιτεί τουλάχιστον την έκδοση PHP 5.3.8 για να λειτουργήσει',
'extension_required' => 'Απαιτούμενη επέκταση: %s ',
'function_required' => 'Το PHPCI πρέπει να είναι σε θέση να καλέσει την %s() συνάρτηση. Είναι απενεργοποιημένη στο php.ini;',
'requirements_not_met' => 'Το PHPCI δεν μπορεί να εγκατασταθεί, καθώς όλες οι απαιτήσεις δεν ικανοποιούνται.
Παρακαλούμε διαβάστε τα παραπάνω λάθη πριν συνεχίσετε.',
'must_be_valid_email' => 'Πρέπει να είναι μια έγκυρη διεύθυνση ηλεκτρονικού ταχυδρομείου.',
'must_be_valid_url' => 'Πρέπει να είναι μια έγκυρη διεύθυνση URL.',
'enter_name' => 'Όνομα διαχειριστή: ',
'enter_email' => 'Ηλ. Διεύθυνση διαχειριστή: ',
'enter_password' => 'Κωδικός πρόσβασης διαχειριστή: ',
'enter_phpci_url' => 'Ο URL σύνδεσμος σας για το PHPCI ("http://phpci.local" για παράδειγμα): ',
'enter_db_host' => 'Παρακαλώ εισάγετε τον MySQL οικοδεσπότη σας [localhost]: ',
'enter_db_name' => 'Παρακαλώ εισάγετε το όνομα της MySQL βάσης δεδομένων σας [phpci]: ',
'enter_db_user' => 'Παρακαλώ εισάγετε το όνομα χρήστη της MySQL σας [phpci]: ',
'enter_db_pass' => 'Παρακαλώ εισάγετε τον κωδικό χρήστη της MySQL σας: ',
'could_not_connect' => 'Το PHPCI δεν μπόρεσε να συνδεθεί με την MySQL με τα στοχεία που δώσατε. Παρακαλώ δοκιμάστε ξανά.',
'setting_up_db' => 'Γίνεται ρύθμιση της βάσης δεδομένων σας ...',
'user_created' => 'Λογαριασμός χρήστη δημιουργήθηκε!',
'failed_to_create' => 'Το PHPCI απέτυχε να δημιουργήσει το λογαριασμό διαχειριστή σας.',
'config_exists' => 'Το αρχείο ρυθμίσεων PHPCI υπάρχει και δεν είναι άδειο.',
'update_instead' => 'Εάν προσπαθούσατε να ενημερώσετε PHPCI, παρακαλούμε χρησιμοποιήστε καλύτερα το phpci:update αντ \'αυτού.',
// Update
'update_phpci' => 'Ενημέρωστε την βάση δεδομένων ώστε να αντικατοπτρίζει τροποποιημένα μοντέλα.',
'updating_phpci' => 'Γίνεται ενημέρωση της βάσης δεδομένων PHPCI:',
'not_installed' => 'Το PHPCI δεν φένεται να είναι εγκατεστημένο',
'install_instead' => 'Παρακαλούμε εγκαταστήστε το PHPCI καλύτερα με το phpci:install αντ \'αυτού.',
// Poll Command
'poll_github' => 'Δημοσκόπηση στο GitHub για να ελέγξετε αν θα πρέπει να ξεκινήσει μια κατασκευή.',
'no_token' => 'Δεν βρέθηκε GitHub token',
'finding_projects' => 'Αναζήτηση έργων για δημοσκόπηση',
'found_n_projects' => 'Βρέθηκαν %d έργα',
'last_commit_is' => 'H τελευταία συνεισφορά στο GitHub για %s είναι %s',
'adding_new_build' => 'Τελευταία συνεισφορά είναι διαφορετική από τη βάση δεδομένων, γίνεται προσθήκη νέας κατασκευής.',
'finished_processing_builds' => 'Ολοκληρώθηκε η επεξεργασία κατασκευής.',
// Create Admin
'create_admin_user' => 'Δημιουργήστε ένα χρήστη διαχειριστή',
'incorrect_format' => 'Λανθασμένη μορφοποίηση',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Εκτελέστε όλες τις εκκρεμείς PHPCI κατασκευές.',
'finding_builds' => 'Αναζήτηση κατασκευών για επεξεργασία',
'found_n_builds' => 'Βρέθηκαν %d κατασκευές',
'skipping_build' => 'Παράκαμψη κατασκευής %d - Η διαδικασία κατασκευής του έργου βρίσκεται ήδη σε εξέλιξη.',
'marked_as_failed' => 'Η κατασκεύη %d επισημάνθηκε ως αποτυχημένη λόγω χρονικού ορίου',
// Builder
'missing_phpci_yml' => 'Το έργο δεν περιέχει το αρχείο phpci.yml ή είναι άδειο.',
'build_success' => 'ΚΑΤΑΣΚΕΥΗ ΕΠΙΤΥΧΗΣ',
'build_failed' => 'ΚΑΤΑΣΚΕΥΗ ΑΠΕΤΥΧΕ',
'removing_build' => 'Γίνεται αφαίρεση κατασκευής',
'exception' => 'Εξαίρεση:',
'could_not_create_working' => 'Αδυναμία δημιουργίας αντίγραφου εργασίας.',
'working_copy_created' => 'Αντίγραφο εργασίας που δημιουργήθηκαν: %s',
'looking_for_binary' => 'Αναζήτηση για δυαδικό: %s',
'found_in_path' => 'Βρέθηκε στο %s: %s',
'running_plugin' => 'ΤΡΕΧΩΝ ΠΡΟΣΘΕΤΟ: %s',
'plugin_success' => 'ΠΡΟΣΘΕΤΟ: ΕΠΙΤΥΧΙΑ',
'plugin_failed' => 'ΠΡΟΣΘΕΤΟ: ΑΠΟΤΥΧΙΑ',
'plugin_missing' => 'Το πρόσθετο δεν υπάρχει: %s',
'tap_version' => 'Το TapParser υποστηρίζει μόνο το TAP έκδοση 13',
'tap_error' => 'Μη έγκυρη συμβολοσειρά TAP, ο αριθμός των δοκιμών δεν ταιριάζει με την καθορισμένη καταμέτρηση της δοκιμής.',
// Build Plugins:
'no_tests_performed' => 'Δεν έγιναν δοκιμές.',
'could_not_find' => 'Δεν ήταν δυνατή η εύρεση του %s',
'no_campfire_settings' => 'Δεν έχουν δωθεί παράμετροι της σύνδεσης για το πρόσθετο Campfire',
'failed_to_wipe' => 'Αποτυχία πλήρους διαγραφής του καταλόγου %s πριν την αντιγραφή',
'passing_build' => 'Επιτυχημένη κατασκευή',
'failing_build' => 'Αποτυχημένη κατασκευή',
'log_output' => 'Σύνδεση εξόδου:',
'n_emails_sent' => 'Στάλθηκαν %d emails ',
'n_emails_failed' => 'Δεν στάλθηκαν %d emails ',
'unable_to_set_env' => 'Δεν είναι δυνατός ο ορισμος μεταβλητής περιβάλλοντος',
'tag_created' => 'Ετικέτα δημιουργήθηκε από PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% χτισμένο σε %BUILD_URI%',
'hipchat_settings' => 'Παρακαλώ ορίστε δωμάτιο και authToken για το πρόσθετο hipchat_notify',
'irc_settings' => 'Θα πρέπει να ρυθμίσετε ένα διακομιστή, το δωμάτιο και το ψευδώνυμο.',
'invalid_command' => 'Μη έγκυρη εντολή',
'import_file_key' => 'Η δήλωση εισαγωγής πρέπει να περιέχει ένα κλειδί "αρχείο"',
'cannot_open_import' => 'Δεν είναι δυνατό το άνοιγμα του SQL αρχείο εισαγωγής: %s ',
'unable_to_execute' => 'Δεν είναι δυνατή η εκτέλεση του αρχείου SQL',
'phar_internal_error' => 'Phar Πρόσθετο Εσωτερικό σφάλμα',
'build_file_missing' => 'Καθορισμένο αρχείο κατασκευής δεν υπάρχει.',
'property_file_missing' => 'Καθορισμένο αρχείο ιδιοκτησίας δεν υπάρχει.',
'could_not_process_report' => 'Δεν ήταν δυνατή η επεξεργασία της έκθεσης που δημιουργείται από αυτό το εργαλείο.',
'shell_not_enabled' => 'Το πρόσθετο για το κέλυφος δεν είναι ενεργοποιημένο. Παρακαλούμε ενεργοποιήστε το μέσω του αρχείου config.yml.'
);

444
PHPCI/Languages/lang.en.php Normal file
View file

@ -0,0 +1,444 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'English',
'language' => 'Language',
// Log in:
'log_in_to_phpci' => 'Log in to PHPCI',
'login_error' => 'Incorrect email address or password',
'forgotten_password_link' => 'Forgotten your password?',
'reset_emailed' => 'We\'ve emailed you a link to reset your password.',
'reset_header' => '<strong>Don\'t worry!</strong><br>Just enter your email address below and we\'ll email
you a link to reset your password.',
'reset_email_address' => 'Enter your email address:',
'reset_send_email' => 'Email password reset',
'reset_enter_password' => 'Please enter a new password',
'reset_new_password' => 'New password:',
'reset_change_password' => 'Change password',
'reset_no_user_exists' => 'No user exists with that email address, please try again.',
'reset_email_body' => 'Hi %s,
You have received this email because you, or someone else, has requested a password reset for PHPCI.
If this was you, please click the following link to reset your password: %ssession/reset-password/%d/%s
Otherwise, please ignore this email and no action will be taken.
Thank you,
PHPCI',
'reset_email_title' => 'PHPCI Password Reset for %s',
'reset_invalid' => 'Invalid password reset request.',
'email_address' => 'Email Address',
'login' => 'Login / Email Address',
'password' => 'Password',
'log_in' => 'Log in',
// Top Nav
'toggle_navigation' => 'Toggle Navigation',
'n_builds_pending' => '%d builds pending',
'n_builds_running' => '%d builds running',
'edit_profile' => 'Edit Profile',
'sign_out' => 'Sign Out',
'branch_x' => 'Branch: %s',
'created_x' => 'Created: %s',
'started_x' => 'Started: %s',
// Sidebar
'hello_name' => 'Hello, %s',
'dashboard' => 'Dashboard',
'admin_options' => 'Admin Options',
'add_project' => 'Add Project',
'settings' => 'Settings',
'manage_users' => 'Manage Users',
'plugins' => 'Plugins',
'view' => 'View',
'build_now' => 'Build Now',
'edit_project' => 'Edit Project',
'delete_project' => 'Delete Project',
// Project Summary:
'no_builds_yet' => 'No builds yet!',
'x_of_x_failed' => '%d out of the last %d builds failed.',
'x_of_x_failed_short' => '%d / %d failed.',
'last_successful_build' => ' The last successful build was %s.',
'never_built_successfully' => ' This project has never built successfully.',
'all_builds_passed' => 'All of the last %d builds passed.',
'all_builds_passed_short' => '%d / %d passed.',
'last_failed_build' => ' The last failed build was %s.',
'never_failed_build' => ' This project has never failed a build.',
'view_project' => 'View Project',
// Timeline:
'latest_builds' => 'Latest Builds',
'pending' => 'Pending',
'running' => 'Running',
'success' => 'Success',
'successful' => 'Successful',
'failed' => 'Failed',
'manual_build' => 'Manual Build',
// Add/Edit Project:
'new_project' => 'New Project',
'project_x_not_found' => 'Project with ID %d does not exist.',
'project_details' => 'Project Details',
'public_key_help' => 'To make it easier to get started, we\'ve generated an SSH key pair for you to use
for this project. To use it, just add the following public key to the "deploy keys" section
of your chosen source code hosting platform.',
'select_repository_type' => 'Select repository type...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Remote URL',
'local' => 'Local Path',
'hg' => 'Mercurial',
'svn' => 'Subversion',
'where_hosted' => 'Where is your project hosted?',
'choose_github' => 'Choose a GitHub repository:',
'repo_name' => 'Repository Name / URL (Remote) or Path (Local)',
'project_title' => 'Project Title',
'project_private_key' => 'Private key to use to access repository
(leave blank for local and/or anonymous remotes)',
'build_config' => 'PHPCI build config for this project
(if you cannot add a phpci.yml file in the project repository)',
'default_branch' => 'Default branch name',
'allow_public_status' => 'Enable public status page and image for this project?',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Save Project',
'error_mercurial' => 'Mercurial repository URL must be start with http:// or https://',
'error_remote' => 'Repository URL must be start with git://, http:// or https://',
'error_gitlab' => 'GitLab Repository name must be in the format "user@domain.tld:owner/repo.git"',
'error_github' => 'Repository name must be in the format "owner/repo"',
'error_bitbucket' => 'Repository name must be in the format "owner/repo"',
'error_path' => 'The path you specified does not exist.',
// View Project:
'all_branches' => 'All Branches',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Date',
'project' => 'Project',
'commit' => 'Commit',
'branch' => 'Branch',
'status' => 'Status',
'prev_link' => '&laquo; Prev',
'next_link' => 'Next &raquo;',
'public_key' => 'Public Key',
'delete_build' => 'Delete Build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'To automatically build this project when new commits are pushed, add the URL below
as a new "Webhook" in the <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> section of your GitHub repository.',
'webhooks_help_gitlab' => 'To automatically build this project when new commits are pushed, add the URL below
as a "WebHook URL" in the Web Hooks section of your GitLab repository.',
'webhooks_help_bitbucket' => 'To automatically build this project when new commits are pushed, add the URL below
as a "POST" service in the
<a href="https://bitbucket.org/%s/admin/services">
Services</a> section of your Bitbucket repository.',
// View Build
'errors' => 'Errors',
'information' => 'Information',
'build_x_not_found' => 'Build with ID %d does not exist.',
'build_n' => 'Build %d',
'rebuild_now' => 'Rebuild Now',
'committed_by_x' => 'Committed by %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'This chart will display once the build has completed.',
'build' => 'Build',
'lines' => 'Lines',
'comment_lines' => 'Comment Lines',
'noncomment_lines' => 'Non-Comment Lines',
'logical_lines' => 'Logical Lines',
'lines_of_code' => 'Lines of Code',
'build_log' => 'Build Log',
'quality_trend' => 'Quality Trend',
'codeception_errors' => 'Codeception Errors',
'phpmd_warnings' => 'PHPMD Warnings',
'phpcs_warnings' => 'PHPCS Warnings',
'phpcs_errors' => 'PHPCS Errors',
'phplint_errors' => 'Lint Errors',
'phpunit_errors' => 'PHPUnit Errors',
'phpdoccheck_warnings' => 'Missing Docblocks',
'issues' => 'Issues',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Missing Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'technical_debt' => 'Technical Debt',
'behat' => 'Behat',
'codeception_feature' => 'Feature',
'codeception_suite' => 'Suite',
'codeception_time' => 'Time',
'codeception_synopsis' => '<strong>%1$d</strong> tests carried out in <strong>%2$f</strong> seconds.
<strong>%3$d</strong> failures.',
'file' => 'File',
'line' => 'Line',
'class' => 'Class',
'method' => 'Method',
'message' => 'Message',
'start' => 'Start',
'end' => 'End',
'from' => 'From',
'to' => 'To',
'result' => 'Result',
'ok' => 'OK',
'took_n_seconds' => 'Took %d seconds',
'build_created' => 'Build Created',
'build_started' => 'Build Started',
'build_finished' => 'Build Finished',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Name',
'password_change' => 'Password (leave blank if you don\'t want to change)',
'save' => 'Save &raquo;',
'update_your_details' => 'Update your details',
'your_details_updated' => 'Your details have been updated.',
'add_user' => 'Add User',
'is_admin' => 'Is Admin?',
'yes' => 'Yes',
'no' => 'No',
'edit' => 'Edit',
'edit_user' => 'Edit User',
'delete_user' => 'Delete User',
'user_n_not_found' => 'User with ID %d does not exist.',
'is_user_admin' => 'Is this user an administrator?',
'save_user' => 'Save User',
// Settings:
'settings_saved' => 'Your settings have been saved.',
'settings_check_perms' => 'Your settings could not be saved, check the permissions of your config.yml file.',
'settings_cannot_write' => 'PHPCI cannot write to your config.yml file, settings may not be saved properly
until this is rectified.',
'settings_github_linked' => 'Your GitHub account has been linked.',
'settings_github_not_linked' => 'Your GitHub account could not be linked.',
'build_settings' => 'Build Settings',
'github_application' => 'GitHub Application',
'github_sign_in' => 'Before you can start using GitHub, you need to <a href="%s">sign in</a> and grant
PHPCI access to your account.',
'github_phpci_linked' => 'PHPCI is successfully linked to GitHub account.',
'github_where_to_find' => 'Where to find these...',
'github_where_help' => 'If you own the application you would like to use, you can find this information within your
<a href="https://github.com/settings/applications">applications</a> settings area.',
'email_settings' => 'Email Settings',
'email_settings_help' => 'Before PHPCI can send build status emails,
you need to configure your SMTP settings below.',
'application_id' => 'Application ID',
'application_secret' => 'Application Secret',
'smtp_server' => 'SMTP Server',
'smtp_port' => 'SMTP Port',
'smtp_username' => 'SMTP Username',
'smtp_password' => 'SMTP Password',
'from_email_address' => 'From Email Address',
'default_notification_address' => 'Default Notification Email Address',
'use_smtp_encryption' => 'Use SMTP Encryption?',
'none' => 'None',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Consider a build failed after',
'5_mins' => '5 Minutes',
'15_mins' => '15 Minutes',
'30_mins' => '30 Minutes',
'1_hour' => '1 Hour',
'3_hours' => '3 Hours',
// Plugins
'cannot_update_composer' => 'PHPCI cannot update composer.json for you as it is not writable.',
'x_has_been_removed' => '%s has been removed.',
'x_has_been_added' => '%s has been added to composer.json for you and will be installed next time
you run composer update.',
'enabled_plugins' => 'Enabled Plugins',
'provided_by_package' => 'Provided By Package',
'installed_packages' => 'Installed Packages',
'suggested_packages' => 'Suggested Packages',
'title' => 'Title',
'description' => 'Description',
'version' => 'Version',
'install' => 'Install &raquo;',
'remove' => 'Remove &raquo;',
'search_packagist_for_more' => 'Search Packagist for more packages',
'search' => 'Search &raquo;',
// Summary plugin
'build-summary' => 'Summary',
'stage' => 'Stage',
'duration' => 'Duration',
'plugin' => 'Plugin',
'stage_setup' => 'Setup',
'stage_test' => 'Test',
'stage_complete' => 'Complete',
'stage_success' => 'Success',
'stage_failure' => 'Failure',
'stage_broken' => 'Broken',
'stage_fixed' => 'Fixed',
// Installer
'installation_url' => 'PHPCI Installation URL',
'db_host' => 'Database Host',
'db_name' => 'Database Name',
'db_user' => 'Database Username',
'db_pass' => 'Database Password',
'admin_name' => 'Admin Name',
'admin_pass' => 'Admin Password',
'admin_email' => 'Admin Email Address',
'config_path' => 'Config File Path',
'install_phpci' => 'Install PHPCI',
'welcome_to_phpci' => 'Welcome to PHPCI',
'please_answer' => 'Please answer the following questions:',
'phpci_php_req' => 'PHPCI requires at least PHP 5.3.8 to function.',
'extension_required' => 'Extension required: %s',
'function_required' => 'PHPCI needs to be able to call the %s() function. Is it disabled in php.ini?',
'requirements_not_met' => 'PHPCI cannot be installed, as not all requirements are met.
Please review the errors above before continuing.',
'must_be_valid_email' => 'Must be a valid email address.',
'must_be_valid_url' => 'Must be a valid URL.',
'enter_name' => 'Admin Name: ',
'enter_email' => 'Admin Email: ',
'enter_password' => 'Admin Password: ',
'enter_phpci_url' => 'Your PHPCI URL ("http://phpci.local" for example): ',
'enter_db_host' => 'Please enter your MySQL host [localhost]: ',
'enter_db_name' => 'Please enter your MySQL database name [phpci]: ',
'enter_db_user' => 'Please enter your MySQL username [phpci]: ',
'enter_db_pass' => 'Please enter your MySQL password: ',
'could_not_connect' => 'PHPCI could not connect to MySQL with the details provided. Please try again.',
'setting_up_db' => 'Setting up your database... ',
'user_created' => 'User account created!',
'failed_to_create' => 'PHPCI failed to create your admin account.',
'config_exists' => 'The PHPCI config file exists and is not empty.',
'update_instead' => 'If you were trying to update PHPCI, please use phpci:update instead.',
// Update
'update_phpci' => 'Update the database to reflect modified models.',
'updating_phpci' => 'Updating PHPCI database: ',
'not_installed' => 'PHPCI does not appear to be installed.',
'install_instead' => 'Please install PHPCI via phpci:install instead.',
// Poll Command
'poll_github' => 'Poll GitHub to check if we need to start a build.',
'no_token' => 'No GitHub token found',
'finding_projects' => 'Finding projects to poll',
'found_n_projects' => 'Found %d projects',
'last_commit_is' => 'Last commit to GitHub for %s is %s',
'adding_new_build' => 'Last commit is different to database, adding new build.',
'finished_processing_builds' => 'Finished processing builds.',
// Create Admin
'create_admin_user' => 'Create an admin user',
'incorrect_format' => 'Incorrect format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens
when PHPCI is set to use a beanstalkd server that does not exist,
or your beanstalkd server has stopped.',
// Run Command
'run_all_pending' => 'Run all pending PHPCI builds.',
'finding_builds' => 'Finding builds to process',
'found_n_builds' => 'Found %d builds',
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
// Builder
'missing_phpci_yml' => 'This project does not contain a phpci.yml file, or it is empty.',
'build_success' => 'BUILD SUCCESS',
'build_failed' => 'BUILD FAILED',
'removing_build' => 'Removing Build.',
'exception' => 'Exception: ',
'could_not_create_working' => 'Could not create a working copy.',
'working_copy_created' => 'Working copy created: %s',
'looking_for_binary' => 'Looking for binary: %s',
'found_in_path' => 'Found in %s: %s',
'running_plugin' => 'RUNNING PLUGIN: %s',
'plugin_success' => 'PLUGIN: SUCCESS',
'plugin_failed' => 'PLUGIN: FAILED',
'plugin_missing' => 'Plugin does not exist: %s',
'tap_version' => 'TapParser only supports TAP version 13',
'tap_error' => 'Invalid TAP string, number of tests does not match specified test count.',
// Build Plugins:
'no_tests_performed' => 'No tests have been performed.',
'could_not_find' => 'Could not find %s',
'no_campfire_settings' => 'No connection parameters given for Campfire plugin',
'failed_to_wipe' => 'Failed to wipe existing directory %s before copy',
'passing_build' => 'Passing Build',
'failing_build' => 'Failing Build',
'log_output' => 'Log Output: ',
'n_emails_sent' => '%d emails sent.',
'n_emails_failed' => '%d emails failed to send.',
'unable_to_set_env' => 'Unable to set environment variable',
'tag_created' => 'Tag created by PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% built at %BUILD_URI%',
'hipchat_settings' => 'Please define room and authToken for hipchat_notify plugin',
'irc_settings' => 'You must configure a server, room and nick.',
'invalid_command' => 'Invalid command',
'import_file_key' => 'Import statement must contain a \'file\' key',
'cannot_open_import' => 'Cannot open SQL import file: %s',
'unable_to_execute' => 'Unable to execute SQL file',
'phar_internal_error' => 'Phar Plugin Internal Error',
'build_file_missing' => 'Specified build file does not exist.',
'property_file_missing' => 'Specified property file does not exist.',
'could_not_process_report' => 'Could not process the report generated by this tool.',
'shell_not_enabled' => 'The shell plugin is not enabled. Please enable it via config.yml.',
// Error Levels:
'critical' => 'Critical',
'high' => 'High',
'normal' => 'Normal',
'low' => 'Low',
// Plugins that generate errors:
'php_mess_detector' => 'PHP Mess Detector',
'php_code_sniffer' => 'PHP Code Sniffer',
'php_unit' => 'PHP Unit',
'php_cpd' => 'PHP Copy/Paste Detector',
'php_docblock_checker' => 'PHP Docblock Checker',
'behat' => 'Behat',
'technical_debt' => 'Technical Debt',
);

387
PHPCI/Languages/lang.es.php Normal file
View file

@ -0,0 +1,387 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Español',
'language' => 'Lenguaje',
// Log in:
'log_in_to_phpci' => 'Ingresar a PHPCI',
'login_error' => 'Email o contraseña incorrectos',
'forgotten_password_link' => '¿Olvidaste tu contraseña?',
'reset_emailed' => 'Te hemos enviado un email para reiniciar tu contraseña.',
'reset_header' => '<strong>¡No te preocupes!</strong><br>Solo tienes que ingresar tu dirección de email
y te enviaremos por email un enlace para reiniciar tu contraseña.',
'reset_email_address' => 'Ingresa tu dirección de email:',
'reset_send_email' => 'Enviar enlace',
'reset_enter_password' => 'Ingresa una nueva contraseña',
'reset_new_password' => 'Nueva contraseña:',
'reset_change_password' => 'Cambiar contraseña',
'reset_no_user_exists' => 'No existe ningún usuario con ese email, por favor intenta nuevamente.',
'reset_email_body' => 'Hola %s,
Has recibido este correo porque , o alguien más, ha solicitado reiniciar la contraseña de PHPCI
Si fuiste , por favor haz click en el siguiente enlace para reiniciar tu contraseña: %ssession/reset-password/%d/%s
De lo contrario, por favor ignora este correo y ninguna acción será realizada.
Gracias,
PHPCI',
'reset_email_title' => 'Reiniciar contraseña de PHPCI para %s',
'reset_invalid' => 'Pedido inválido.',
'email_address' => 'Dirección de email',
'password' => 'Contraseña',
'log_in' => 'Ingresar',
// Top Nav
'toggle_navigation' => 'Activar navegación',
'n_builds_pending' => '%d builds pendientes',
'n_builds_running' => '%d builds ejecutándose',
'edit_profile' => 'Editar Perfil',
'sign_out' => 'Cerrar Sesión',
'branch_x' => 'Rama: %s',
'created_x' => 'Creada el: %s',
'started_x' => 'Comenzó: %s',
// Sidebar
'hello_name' => 'Hola, %s',
'dashboard' => 'Escritorio',
'admin_options' => 'Opciones de Admin.',
'add_project' => 'Agregar Proyecto',
'settings' => 'Configuración',
'manage_users' => 'Administrar Usuarios',
'plugins' => 'Plugins',
'view' => 'Vista',
'build_now' => 'Ejecutar Build',
'edit_project' => 'Editar Proyecto',
'delete_project' => 'Eliminar Proyecto',
// Project Summary:
'no_builds_yet' => '¡No existen builds aún!',
'x_of_x_failed' => '%d de los últimos %d builds fallaron.',
'x_of_x_failed_short' => '%d / %d fallaron.',
'last_successful_build' => ' El último build exitoso fue %s.',
'never_built_successfully' => ' Este proyecto nunca tuvo un build exitoso.',
'all_builds_passed' => 'Todos los últimos %d builds pasaron.',
'all_builds_passed_short' => '%d / %d pasaron.',
'last_failed_build' => ' El último build en fallar fue %s.',
'never_failed_build' => ' Este proyecto no tiene ningún build fallido.',
'view_project' => 'Ver Proyecto',
// Timeline:
'latest_builds' => 'Últimos builds',
'pending' => 'Pediente',
'running' => 'Ejecutando',
'success' => 'Éxito',
'successful' => 'Exitoso',
'failed' => 'Falló',
'manual_build' => 'Build Manual',
// Add/Edit Project:
'new_project' => 'Nuevo Proyecto',
'project_x_not_found' => 'El Proyecto con ID %d no existe.',
'project_details' => 'Detalles del Proyecto',
'public_key_help' => 'Para facilitarte, hemos generado un par de llaves SSH para que uses en este proyecto.
Para usarlo, sólo agrega la siguiente llave pública a la sección de "deploy keys"
de tu plataforma de hosting de versionado de código.',
'select_repository_type' => 'Selecciona tipo de repositorio...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL Remota',
'local' => 'Path local',
'hg' => 'Mercurial',
'svn' => 'Subversion',
'where_hosted' => '¿Dónde está alojado tu proyecto?',
'choose_github' => 'Selecciona un repositorio de GitHub:',
'repo_name' => 'Nombre del repositorio / URL (Remoto) o Ruta (Local)',
'project_title' => 'Titulo del proyecto',
'project_private_key' => 'Clave privada a usar para acceder al repositorio
(dejar en blanco para remotos locales o anónimos)',
'build_config' => 'Configuración PHPCI para builds del proyecto
(en caso que no puedas agregar el archivo phpci.yml al repositorio)',
'default_branch' => 'Nombre de la rama por defecto',
'allow_public_status' => '¿Activar página pública con el estado del proyecto?',
'archived' => 'Archivado',
'archived_menu' => 'Archivado',
'save_project' => 'Guardar Proyecto',
'error_mercurial' => 'La URL del repositorio de Mercurial debe comenzar con http:// or https://',
'error_remote' => 'La URL del repositorio debe comenzar con git://, http:// or https://',
'error_gitlab' => 'El nombre del repositorio de GitLab debe tener el formato "user@domain.tld:owner/repo.git"',
'error_github' => 'El nombre del repositorio debe tener el formato "owner/repo"',
'error_bitbucket' => 'El nombre del repo debe tener el formato "owner/repo"',
'error_path' => 'La ruta especificada no existe.',
// View Project:
'all_branches' => 'Todas las ramas',
'builds' => 'Builds',
'id' => 'ID',
'project' => 'Proyecto',
'commit' => 'Commit',
'branch' => 'Rama',
'status' => 'Estado',
'prev_link' => '&laquo; Anterior',
'next_link' => 'Siguiente &raquo;',
'public_key' => 'Llave pública',
'delete_build' => 'Eliminar Build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Para compilar automáticamente este proyecto cada vez que se realiza un commit, agreagar la siguiente URL
como un nuevo "webhook" en la sección <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> de tu repositorio en GitHub.',
'webhooks_help_gitlab' => 'Para compilar automáticamente este proyecto, cada vez que se realiza un commit, agreagar la siguiente URL
como una "WebHook URL" en la sección "web hooks" de tu repositorio en GitLab.',
'webhooks_help_bitbucket' => 'Para compilar automáticamente este proyecto, cada vez que se realiza un commit, agreagar la siguiente URL
como un servicio "POST" en la sección
<a href="https://bitbucket.org/%s/admin/services">
Services</a> de tu repositorio en Bitbucket.',
// View Build
'build_x_not_found' => 'El build con ID %d no existe.',
'build_n' => 'Build %d',
'rebuild_now' => 'Rebuild Ahora',
'committed_by_x' => 'Commit hecho por %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Este gráfico será mostrado una vez que el build se haya completado.',
'build' => 'Build',
'lines' => 'Líneas',
'comment_lines' => 'Líneas de comentario',
'noncomment_lines' => 'Líneas no comentario',
'logical_lines' => 'Líneas lógicas',
'lines_of_code' => 'Líneas de código',
'build_log' => 'Log',
'quality_trend' => 'Tendencia de calidad',
'codeception_errors' => 'Errores de Codeception',
'phpmd_warnings' => 'PHPMD Warnings',
'phpcs_warnings' => 'PHPCS Warnings',
'phpcs_errors' => 'PHPCS Errors',
'phplint_errors' => 'Lint Errors',
'phpunit_errors' => 'PHPUnit Errors',
'phpdoccheck_warnings' => 'Docblocks faltantes',
'issues' => 'Incidencias',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Missing Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'technical_debt' => 'Deuda Técnica',
'behat' => 'Behat',
'file' => 'Archivo',
'line' => 'Línea',
'class' => 'Clase',
'method' => 'Método',
'message' => 'Mensaje',
'start' => 'Inicio',
'end' => 'Fin',
'from' => 'De',
'to' => 'Para',
'suite' => 'Suite',
'test' => 'Test',
'result' => 'Resultado',
'ok' => 'OK',
'took_n_seconds' => 'Tomó %d segundos',
'build_created' => 'Build Creado',
'build_started' => 'Build Comenzado',
'build_finished' => 'Build Terminado',
// Users
'name' => 'Nombre',
'password_change' => 'Contraseña (dejar en blanco si no quiere cambiarla)',
'save' => 'Guardar &raquo;',
'update_your_details' => 'Actualizar los detalles',
'your_details_updated' => 'Tus detalles han sido actualizados.',
'add_user' => 'Agregar Usuario',
'is_admin' => '¿Es Admin?',
'yes' => 'Si',
'no' => 'No',
'edit' => 'Editar',
'edit_user' => 'Editar Usuario',
'delete_user' => 'Delete Usuario',
'user_n_not_found' => 'Usuario con ID %d no existe.',
'is_user_admin' => '¿Es un usuario administrador?',
'save_user' => 'Guardar Usuario',
// Settings:
'settings_saved' => 'Tu configuración ha sido guardada.',
'settings_check_perms' => 'Tu configuración no fue guardada, verificar los permisos del archivo config.yml.',
'settings_cannot_write' => 'PHPCI no puede escribir en el archivo config.yml file, la configuración no será guardada correctamente
hasta no corregir esto.',
'settings_github_linked' => 'Tu cuenta GitHub ha sido conectada.',
'settings_github_not_linked' => 'No se pudo conectar a tu cuenta GitHub.',
'build_settings' => 'Configuración del Build ',
'github_application' => 'Aplicación GitHub',
'github_sign_in' => 'Antes de comenzar a utilizar GitHub, tienes que <a href="%s">ingresar</a> y permitir
el acceso a tu cuenta a PHPCI.',
'github_phpci_linked' => 'PHPCI ha sido conectado a tu cuenta GitHub.',
'github_where_to_find' => 'Donde encontrar estos...',
'github_where_help' => 'Si eres priopietario de la aplicaión que quieres usar, puedes encontrar esta información en
el área de configuración de <a href="https://github.com/settings/applications">aplicaciones</a>.',
'email_settings' => 'Configuraciones de Email',
'email_settings_help' => 'Para que PHPCI pueda enviar email con el status de los builds,
debes configurar las siguientes propiedades SMTP.',
'application_id' => 'ID de aplicación',
'application_secret' => 'Application Secret',
'smtp_server' => 'Servidor SMTP',
'smtp_port' => 'Puerto SMTP',
'smtp_username' => 'Usuario SMTP',
'smtp_password' => 'Contraseña SMTP',
'from_email_address' => 'Dirección de email DE',
'default_notification_address' => 'Dirección de correo de notificación por defecto',
'use_smtp_encryption' => 'Usar encriptación SMTP?',
'none' => 'None',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Considerar el build como fallido luego de ',
'5_mins' => '5 Minutos',
'15_mins' => '15 Minutos',
'30_mins' => '30 Minutos',
'1_hour' => '1 Hora',
'3_hours' => '3 Horas',
// Plugins
'cannot_update_composer' => 'PHPCI no puede actualizar composer.json porque no tiene permisos de escritura.',
'x_has_been_removed' => '%s ha sido elimiando.',
'x_has_been_added' => '%s ha sido agregado a composer.json y será instalado la próxima vez que ejecutes composer update.',
'enabled_plugins' => 'Activar Plugins',
'provided_by_package' => 'Provisto por Paquete',
'installed_packages' => 'Paquetes Instalados',
'suggested_packages' => 'Paquetes Sugeridos',
'title' => 'Título',
'description' => 'Descripción',
'version' => 'Versión',
'install' => 'Instalar &raquo;',
'remove' => 'Eliminar &raquo;',
'search_packagist_for_more' => 'Buscar más paquetes en Packagist',
'search' => 'Buscar &raquo;',
// Installer
'installation_url' => 'URL de la instalación PHPCI',
'db_host' => 'Host',
'db_name' => 'Nombre de la base de datos',
'db_user' => 'Usuario de la base de datos',
'db_pass' => 'Clave de la base de datos',
'admin_name' => 'Nombre del Admin',
'admin_pass' => 'Clave del Admin',
'admin_email' => 'Email de Admin',
'config_path' => 'Ruta al archivo config',
'install_phpci' => 'Instalar PHPCI',
'welcome_to_phpci' => 'Bienvenido a PHPCI',
'please_answer' => 'Por favor, responde las siguientes preguntas:',
'phpci_php_req' => 'PHPCI requiere al menos PHP 5.3.8 para funcionar.',
'extension_required' => 'Extensión requerida: %s',
'function_required' => 'PHPCI debe poder invocar la función %s(). Está deshabilitada en php.ini?',
'requirements_not_met' => 'PHPCI no pudo ser instalado, ya que no se cumplen todos los requerimientos.
Por favor, corrige los errores antes de continuar.',
'must_be_valid_email' => 'Debe ser una dirección de correos válida.',
'must_be_valid_url' => 'Debe ser una URL válida.',
'enter_name' => 'Nombre del Admin:',
'enter_email' => 'Email del Admin:',
'enter_password' => 'Contraseña de Admin:',
'enter_phpci_url' => 'La URL de PHPCI ("Por ejemplo: http://phpci.local"): ',
'enter_db_host' => 'Por favor, ingresa el servidor MySQL [localhost]: ',
'enter_db_name' => 'Por favor, ingresa el nombre de la base de datos MySQL [phpci]: ',
'enter_db_user' => 'Por favor, ingresa el usuario MySQL [phpci]: ',
'enter_db_pass' => 'Por favor, ingresa la contraseña MySQL: ',
'could_not_connect' => 'PHPCI no pudo conectarse a MySQL con los datos dados. Por favor, intenta nuevamente.',
'setting_up_db' => 'Configurando base de datos... ',
'user_created' => '¡Cuenta de usuario creada!',
'failed_to_create' => 'PHPCI no pudo crear la cuenta de admin.',
'config_exists' => 'El archivo config de PHPCI ya existe y no es vacío.',
'update_instead' => 'Si está intentando actualizar PHPCI, por favor, utiliza phpci:update.',
// Update
'update_phpci' => 'Actuliza la base de datos para reflejar los modelos actualizados.',
'updating_phpci' => 'Actualizando base de datos PHPCI: ',
'not_installed' => 'PHPCI no está instalado.',
'install_instead' => 'Por favor, instala PHPCI via phpci:install.',
// Poll Command
'poll_github' => 'Chequear en GitHub si se necesita comenzar un Build.',
'no_token' => 'No se encontró ningún token GitHub',
'finding_projects' => 'Buscando proyectos para chequear',
'found_n_projects' => 'Se encontraron %d proyectos',
'last_commit_is' => 'El último commit en GitHub para %s es %s',
'adding_new_build' => 'Último commit es diferente a la base de datos, agregando nuevo build.',
'finished_processing_builds' => 'Fin de procesamiento de builds.',
// Create Admin
'create_admin_user' => 'Crear un usuario Admin',
'incorrect_format' => 'Formato incorrecto',
// Run Command
'run_all_pending' => 'Ejecutar todos los builds PHPCI pendientes.',
'finding_builds' => 'Buscando builds a procesar',
'found_n_builds' => 'Se encontraron %d builds',
'skipping_build' => 'Saltando Build %d - Build del proyecto ya en ejecución.',
'marked_as_failed' => 'Build %d falló debido a timeout.',
// Builder
'missing_phpci_yml' => 'Este proyecto no contiene el archivo phpci.yml o está vacío.',
'build_success' => 'BUILD EXITOSO',
'build_failed' => 'BUILD FALLIDO',
'removing_build' => 'Eliminando Build.',
'exception' => 'Excepción: ',
'could_not_create_working' => 'Imposible crear copia de trabajo.',
'working_copy_created' => 'Copia de trabajo creada: %s',
'looking_for_binary' => 'Buscando binario: %s',
'found_in_path' => 'Encontrado en %s: %s',
'running_plugin' => 'EJECUTANDO PLUGIN: %s',
'plugin_success' => 'PLUGIN: EXITO',
'plugin_failed' => 'PLUGIN: FALLÓ',
'plugin_missing' => 'No existe el plugin: %s',
'tap_version' => 'TapParser únicamente soporta la verisón 13 de TAP',
'tap_error' => 'Cadena de caracteres TAP inválida, el número de tests no coincide con la cuenta de tests declarada.',
// Build Plugins:
'no_tests_performed' => 'No se ejecutaron tests.',
'could_not_find' => 'No se encontró %s',
'no_campfire_settings' => 'No se especificaron parámetros de conexión para el plugin Campfire',
'failed_to_wipe' => 'Imposible eliminar directorio existente %s antes de copiarlo',
'passing_build' => 'Build Exitoso',
'failing_build' => 'Build Fallido',
'log_output' => 'Log de Salida: ',
'n_emails_sent' => '%d emails enviados.',
'n_emails_failed' => '%d emails no pudieron ser enviados.',
'unable_to_set_env' => 'Imposible setear variable de entorno',
'tag_created' => 'Tag creado por PHPCI: %s',
'x_built_at_x' => 'Build de %PROJECT_TITLE% en %BUILD_URI%',
'hipchat_settings' => 'Por favor, definir room y authToken para el plugin hipchat_notify',
'irc_settings' => 'Debes configurar un servidor, room y apodo.',
'invalid_command' => 'Comando inválido',
'import_file_key' => 'Sentencia de importación debe contener una llave \'file\'',
'cannot_open_import' => 'Imposible abrir archivo de importación SQL: %s',
'unable_to_execute' => 'Imposible ejecutar archivo SQL',
'phar_internal_error' => 'Error interno en plugin Phar',
'build_file_missing' => 'El archivo de build especificado no existe.',
'property_file_missing' => 'El archivo de propiedades especificado no existe.',
'could_not_process_report' => 'Imposible procesar el reporte generado por la herramienta.',
'shell_not_enabled' => 'El plugin shell no está habilitado. Por favor, habilitalo desde config.yml.'
);

410
PHPCI/Languages/lang.fr.php Normal file
View file

@ -0,0 +1,410 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Français',
'language' => 'Langue',
// Log in:
'log_in_to_phpci' => 'Connectez-vous à PHPCI',
'login_error' => 'Adresse email ou mot de passe invalide',
'forgotten_password_link' => 'Mot de passe oublié&nbsp;?',
'reset_emailed' => 'Nous vous avons envoyé un email avec un lien pour réinitialiser votre mot de passe.',
'reset_header' => '<strong>Pas d\'inquiétude</strong><br>Entrez simplement votre adresse email ci-dessous
et nous vous enverrons un message avec un lien pour réinitialiser votre mot de passe.',
'reset_email_address' => 'Entrez votre adresse email:',
'reset_send_email' => 'Envoyer le mail',
'reset_enter_password' => 'Veuillez entrer un nouveau mot de passe',
'reset_new_password' => 'Nouveau mot de passe&nbsp;:',
'reset_change_password' => 'Modifier le mot de passe',
'reset_no_user_exists' => 'Il n\'existe aucun utilisateur avec cette adresse email, merci de réessayer.',
'reset_email_body' => 'Bonjour %s,
Vous avez reçu cet email parce qu\'une demande de réinitialisation de mot de passe a été faite pour votre compte PHPCI.
Si c\'est bien vous, merci de cliquer sur le lien suivant pour réinitialiser votre mot de passe&nbsp;: %ssession/reset-password/%d/%s
Sinon, merci d\'ignorer ce message.
Merci,
PHPCI',
'reset_email_title' => 'Réinitialisation du mot de passe PHPCI pour %s',
'reset_invalid' => 'Requête de réinitialisation de mot de passe invalide.',
'email_address' => 'Adresse email',
'login' => 'Login / Email Address',
'password' => 'Mot de passe',
'log_in' => 'Connexion',
// Top Nav
'toggle_navigation' => 'Afficher/cacher la navigation',
'n_builds_pending' => '%d builds en attente',
'n_builds_running' => '%d builds en cours d\'exécution',
'edit_profile' => 'Éditer le profil',
'sign_out' => 'Déconnexion',
'branch_x' => 'Branche&nbsp;: %s',
'created_x' => 'Créé à&nbsp;: %s',
'started_x' => 'Démarré à&nbsp;: %s',
// Sidebar
'hello_name' => 'Salut %s',
'dashboard' => 'Tableau de bord',
'admin_options' => 'Options d\'administration',
'add_project' => 'Ajouter un projet',
'settings' => 'Paramètres',
'manage_users' => 'Gérer les utilisateurs',
'plugins' => 'Plugins',
'view' => 'Voir',
'build_now' => 'Démarrer le build',
'edit_project' => 'Éditer le projet',
'delete_project' => 'Supprimer le projet',
// Project Summary:
'no_builds_yet' => 'Aucun build pour le moment&nbsp;!',
'x_of_x_failed' => '%d des %d derniers builds ont échoué.',
'x_of_x_failed_short' => '%d échecs / %d.',
'last_successful_build' => ' Le dernier build réussi date du %s.',
'never_built_successfully' => ' Aucun build de ce projet n\'a réussi.',
'all_builds_passed' => 'Les %d derniers builds ont réussi.',
'all_builds_passed_short' => '%d réussites / %d.',
'last_failed_build' => ' Le dernier build en échec date du %s.',
'never_failed_build' => ' Aucun build de ce projet n\'a échoué.',
'view_project' => 'Voir le projet',
// Timeline:
'latest_builds' => 'Derniers builds',
'pending' => 'En attente',
'running' => 'En cours',
'success' => 'Terminé',
'successful' => 'Réussi',
'failed' => 'Échoué',
'manual_build' => 'Build manuel',
// Add/Edit Project:
'new_project' => 'Nouveau Projet',
'project_x_not_found' => 'Il n\'existe pas de Projet avec l\'ID %d.',
'project_details' => 'Détails du Projet',
'public_key_help' => 'Pour pouvoir démarrer plus facilement, nous avons généré une paire de clés SSH à utiliser avec ce projet.
Pour l\'utiliser, il faut simplement ajouter la clé publique dans la section "Clés de déploiement"
de votre outil d\'hébergement de code.',
'select_repository_type' => 'Sélectionnez le type de dépôt...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL distante',
'local' => 'Chemin local',
'hg' => 'Mercurial',
'where_hosted' => 'Où est hébergé votre projet&nbsp;?',
'choose_github' => 'Choisissez un dépôt GitHub&nbsp;:',
'repo_name' => 'Nom du dépôt / URL (distance) ou chemin (local)',
'project_title' => 'Titre du projet',
'project_private_key' => 'Clé privée à utiliser pour accéder au dépôt
(laissez le champ vide pour les dépôts locaux ou les URLs distantes anonymes)',
'build_config' => 'Configuration PHPCI spécifique pour ce projet
(si vous ne pouvez pas ajouter de fichier phpci.yml à la racine du dépôt)',
'default_branch' => 'Nom de la branche par défaut',
'allow_public_status' => 'Activer la page de statut publique et l\'image pour ce projet&nbsp;?',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Enregistrer le projet',
'error_mercurial' => 'Les URLs de dépôt Mercurial doivent commencer par http:// ou https://',
'error_remote' => 'Les URLs de dépôt doivent commencer par git://, http:// ou https://',
'error_gitlab' => 'Le nom du dépôt GitLab doit avoir le format "user@domain.tld:owner/repo.git"',
'error_github' => 'Le nom du dépôt doit être dans le format "proprietaire/dépôt"',
'error_bitbucket' => 'Le nom du dépôt doit être dans le format "proprietaire/dépôt"',
'error_path' => 'Le chemin que vous avez spécifié n\'existe pas.',
// View Project:
'all_branches' => 'Toutes les branches',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Date',
'project' => 'Projet',
'commit' => 'Commit',
'branch' => 'Branche',
'status' => 'Statut',
'prev_link' => '&laquo; Précédent',
'next_link' => 'Suivant &raquo;',
'public_key' => 'Clé Publique',
'delete_build' => 'Supprimer le build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Pour générer un build quand de nouveaux commits sont poussés, ajouter l\'url suivante
en tant que new "Webhook" dans la section <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> de votre dépôt GitHub.',
'webhooks_help_gitlab' => 'Pour générer un build quand de nouveaux commits sont poussés, ajouter l\'url suivante
and tant que "WebHook URL" dans la section Web Hooks de votre dépôt GitLab.',
'webhooks_help_bitbucket' => 'Pour générer un build quand de nouveaux commits sont poussés, ajouter l\'url suivante
en tant que service "POST" dans la section
<a href="https://bitbucket.org/%s/admin/services">
Services</a> de votre dépôt Bitbucket.',
// View Build
'build_x_not_found' => 'Le Build avec l\'ID %d n\'existe pas.',
'build_n' => 'Build %d',
'rebuild_now' => 'Relancer maintenant',
'committed_by_x' => 'Committé par %s',
'commit_id_x' => 'Commit&nbsp;: %s',
'chart_display' => 'Ce graphique s\'affichera une fois que le build sera terminé.',
'build' => 'Build',
'lines' => 'Lignes',
'comment_lines' => 'Lignes de commentaires',
'noncomment_lines' => 'Lignes qui ne sont pas des commentaires',
'logical_lines' => 'Lignes logiques',
'lines_of_code' => 'Lignes de code',
'build_log' => 'Log du build',
'quality_trend' => 'Tendance de la qualité',
'codeception_errors' => 'Erreurs Codeception',
'phpmd_warnings' => 'Alertes PHPMD',
'phpcs_warnings' => 'Alertes PHPCS',
'phpcs_errors' => 'Erreurs PHPCS',
'phplint_errors' => 'Erreurs de Lint',
'phpunit_errors' => 'Erreurs PHPUnit',
'phpdoccheck_warnings' => 'Blocs de documentation manquants',
'issues' => 'Tickets',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Missing Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'file' => 'Fichier',
'line' => 'Ligne',
'class' => 'Classe',
'method' => 'Méthode',
'message' => 'Message',
'start' => 'Démarrage',
'end' => 'Fin',
'from' => 'À partir de',
'to' => 'jusque',
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Exécuté en %d secondes',
'build_created' => 'Build créé',
'build_started' => 'Build démarré',
'build_finished' => 'Build terminé',
'test_message' => 'Message',
'test_no_message' => 'Pas de message',
'test_success' => 'Réussi(s): %d',
'test_fail' => 'Echec(s): %d',
'test_skipped' => 'Passé(s): %d',
'test_error' => 'Erreurs: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Nom',
'password_change' => 'Mot de passe (laissez vide si vous ne voulez pas le changer)',
'save' => 'Sauvegarder &raquo;',
'update_your_details' => 'Mettre à jour vos préférences',
'your_details_updated' => 'Vos préférences ont été bien mises à jour.',
'add_user' => 'Ajouter un utilisateur',
'is_admin' => 'Est-il administrateur&nbsp;?',
'yes' => 'Oui',
'no' => 'Non',
'edit' => 'Éditer',
'edit_user' => 'Éditer l\'utilisateur',
'delete_user' => 'Supprimer l\'utilisateur',
'user_n_not_found' => 'L\'utilisateur avec l\'ID %d n\'existe pas.',
'is_user_admin' => 'Est-ce que cet utilisateur est administrateur?',
'save_user' => 'Sauvegarder l\'utilisateur',
// Settings:
'settings_saved' => 'Vos paramètres ont été sauvegardés.',
'settings_check_perms' => 'Vos paramètres n\'ont pas pu être sauvegardés, vérifiez les permissions sur le fichier config.yml.',
'settings_cannot_write' => 'PHPCI ne peut pas écrire dans votre fichier config.yml, les paramètres ne pourront pas être sauvegardés correctement
tant que ce ne sera pas corrigé.',
'settings_github_linked' => 'Votre compte GitHub n\'a pas été lié.',
'settings_github_not_linked' => 'Votre compte GitHub ne peut pas être lié.',
'build_settings' => 'Configuration du Build',
'github_application' => 'Application GitHub',
'github_sign_in' => 'Avant de commencer à utiliser GitHub, vous devez vous <a href="%s">connecter</a> et autoriser
PHPCI à accéder à votre compte.',
'github_phpci_linked' => 'PHPCI s\'est connecté avec succès au compte GitHub.',
'github_where_to_find' => 'Où trouver ces informations...',
'github_where_help' => 'Si vous souhaitez utiliser une application qui vous appartient, vous pouvez trouver ces informations dans
la zone de paramètres <a href="https://github.com/settings/applications">applications</a>.',
'email_settings' => 'Configuration Email',
'email_settings_help' => 'Avant que PHPCI puisse envoyer des emails concernant les statuts de build,
vous devez entrer les configurations SMTP ci-dessous.',
'application_id' => 'Identifiant d\'application',
'application_secret' => 'Clé secrète de l\'application',
'smtp_server' => 'Serveur SMTP',
'smtp_port' => 'Port SMTP',
'smtp_username' => 'Nom d\'utilisateur SMTP',
'smtp_password' => 'Mot de passe SMTP',
'from_email_address' => 'Adresse à partir de laquelle sont envoyés les emails',
'default_notification_address' => 'Adresse de notification par défaut',
'use_smtp_encryption' => 'Est-ce que vous voulez utiliser le chiffrement SMTP',
'none' => 'Non',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Considérer qu\'un build a échoué après',
'5_mins' => '5 Minutes',
'15_mins' => '15 Minutes',
'30_mins' => '30 Minutes',
'1_hour' => '1 Heure',
'3_hours' => '3 Heures',
// Plugins
'cannot_update_composer' => 'PHPCI ne peut pas mettre à jour le fichier composer.json pour vous, il n\'est pas modifiable.',
'x_has_been_removed' => '%s a été supprimé.',
'x_has_been_added' => '%s a été ajouté au fichier composer.json pour vous et il sera installé la prochaine fois
que vous lancerez "composer update".',
'enabled_plugins' => 'Plugins activés',
'provided_by_package' => 'Fournis par le paquet',
'installed_packages' => 'Paquets installés',
'suggested_packages' => 'Paquets suggérés',
'title' => 'Titre',
'description' => 'Description',
'version' => 'Version',
'install' => 'Installer &raquo;',
'remove' => 'Supprimer &raquo;',
'search_packagist_for_more' => 'Rechercher sur Packagist pour trouver plus de paquets',
'search' => 'Rechercher &raquo;',
// Summary plugin
'build-summary' => 'Résumé',
'stage' => 'Étape',
'duration' => 'Durée',
'plugin' => 'Plugin',
'stage_setup' => 'Préparation',
'stage_test' => 'Test',
'stage_complete' => 'Terminé',
'stage_success' => 'Succes',
'stage_failure' => 'Échec',
// Installer
'installation_url' => 'URL d\'installation de PHPCI',
'db_host' => 'Hôte de la BDD',
'db_name' => 'Nom de la BDD',
'db_user' => 'Nom d\'utilisateur de la BDD',
'db_pass' => 'Mot de passe de la BDD',
'admin_name' => 'Nom de l\'admin',
'admin_pass' => 'Mot de passe admin',
'admin_email' => 'Adresse email de l\'admin',
'config_path' => 'Chemin vers le fichier de configuration',
'install_phpci' => 'Installer PHPCI',
'welcome_to_phpci' => 'Bienvenue sur PHPCI',
'please_answer' => 'Merci de répondre aux questions suivantes :',
'phpci_php_req' => 'PHPCI requiert au moins PHP 5.3.8 pour fonctionner.',
'extension_required' => 'Extensions requises : %s',
'function_required' => 'PHPCI doit être capable d\'appeler la fonction %s(). Est-ce qu\'elle est désactivée dans votre php.ini?',
'requirements_not_met' => 'PHPCI ne peut pas être installé parce que toutes les conditions requises ne sont pas respectées.
Merci de corriger les erreurs ci-dessus avant de continuer.',
'must_be_valid_email' => 'Doit être une adresse email valide.',
'must_be_valid_url' => 'Doit être une URL valide.',
'enter_name' => 'Nom de l\'admin: ',
'enter_email' => 'Email de l\'admin: ',
'enter_password' => 'Mot de passe de l\'admin: ',
'enter_phpci_url' => 'Votre URL vers PHPCI (par exemple "http://phpci.local"): ',
'enter_db_host' => 'Merci d\'entrer le nom d\'hôte MySQL [localhost]: ',
'enter_db_name' => 'Merci d\'entrer le nom de la base MySQL [phpci]: ',
'enter_db_user' => 'Merci d\'entrer le nom d\'utilisateur MySQL [phpci]: ',
'enter_db_pass' => 'Merci d\'entrer le mot de passe MySQL: ',
'could_not_connect' => 'PHPCI ne peut pas se connecter à MySQL à partir des informations fournies. Veuillez réessayer..',
'setting_up_db' => 'Paramétrage de la base de données... ',
'user_created' => 'Le compte utilisateur a été créé !',
'failed_to_create' => 'PHPCI n\'a pas réussi à créer votre compte admin.',
'config_exists' => 'Le fichier de configuration PHPCI existe et n\'est pas vide.',
'update_instead' => 'Si vous essayez de mettre à jour PHPCI, merci d\'utiliser la commande phpci:update.',
// Update
'update_phpci' => 'Mise à jour de la base de données pour refléter les modifications apportées aux modèles.',
'updating_phpci' => 'Mise à jour de la base de données PHPCI : ',
'not_installed' => 'PHPCI n\'a pas l\'air d\'être installé.',
'install_instead' => 'Merci d\'installer PHPCI grâce à la commande phpci:install.',
// Poll Command
'poll_github' => 'Demander à GitHub de vérifier si nous devons démarrer un build.',
'no_token' => 'Aucun token GitHub n\'a été trouvé',
'finding_projects' => 'Recherche des projets à sonder',
'found_n_projects' => '%d projets trouvés',
'last_commit_is' => 'Le dernier commit sur GitHub pour %s est %s',
'adding_new_build' => 'Le dernier commit est différent de celui présent en base de données, ajout d\'un nouveau build.',
'finished_processing_builds' => 'Traitement des builds terminé.',
// Create Admin
'create_admin_user' => 'Créer un utilisateur admin',
'incorrect_format' => 'Format incorrect',
// Create Build Command
'create_build_project' => 'Créer un build projet',
'project_id_argument' => 'ID du projet',
'commit_id_option' => 'ID du commit',
'branch_name_option' => 'Branche',
// Run Command
'run_all_pending' => 'Démarrage de tout les builds PHPCI en attente.',
'finding_builds' => 'Découverte des builds à traiter',
'found_n_builds' => '%d builds trouvés',
'skipping_build' => 'Saut du build %d - Un build sur le projet est déjà en cours.',
'marked_as_failed' => 'Le build %d a été marqué échoué à cause d\'un timeout.',
// Builder
'missing_phpci_yml' => 'Ce projet ne contient pas de fichier phpci.yml, ou il est vide.',
'build_success' => 'BUILD RÉUSSI',
'build_failed' => 'BUILD ÉCHOUÉ',
'removing_build' => 'Suppression du build.',
'exception' => 'Exception: ',
'could_not_create_working' => 'Impossible de créer un copie de travail.',
'working_copy_created' => 'Copie de travail créée: %s',
'looking_for_binary' => 'Recherche du binaire: %s',
'found_in_path' => 'Trouver dans %s: %s',
'running_plugin' => 'EXÉCUTION DU PLUGIN: %s',
'plugin_success' => 'PLUGIN: RÉUSSI',
'plugin_failed' => 'PLUGIN: ÉCHOUÉ',
'plugin_missing' => 'Le plugins n\'existe pas: %s',
'tap_version' => 'TapParser supporte seulement les TAP version 13',
'tap_error' => 'Chaîne de TAP invalide, le nombre de tests ne correspond pas à celui spécifié.',
// Build Plugins:
'no_tests_performed' => 'Aucun test n\'a été exécuté.',
'could_not_find' => 'Impossible de trouver %s',
'no_campfire_settings' => 'Aucune information de connexion n\'a été fournie pour le plugin Campfire',
'failed_to_wipe' => 'Impossible de supprimer le dossier %s avant de copier',
'passing_build' => 'Passing Build',
'failing_build' => 'Failing Build',
'log_output' => 'Sortie de log : ',
'n_emails_sent' => '%d emails envoyés.',
'n_emails_failed' => '%d emails dont l\'envoi a échoué.',
'unable_to_set_env' => 'Impossible d\'initialiser la variable d\'environnement',
'tag_created' => 'Tag créé par PHPCI : %s',
'x_built_at_x' => '%PROJECT_TITLE% construit à %BUILD_URI%',
'hipchat_settings' => 'Merci de définir une "room" et un "authToken" pour le plugin hipchat_notify',
'irc_settings' => 'Vous devez configurer un serveur, une "room" et un "nick".',
'invalid_command' => 'Commande invalide',
'import_file_key' => 'La déclaration d\'import doit contenir un \'fichier\' clé',
'cannot_open_import' => 'Impossible d\'importer le ficher SQL : %s',
'unable_to_execute' => 'Impossible d\'exécuter le ficher SQL',
'phar_internal_error' => 'Erreur interne au plugin Phar',
'build_file_missing' => 'Le fichier de build spécifié n\'existe pas.',
'property_file_missing' => 'Le fichier de propriété spécifié n\'existe pas.',
'could_not_process_report' => 'Impossible de traiter le rapport généré par cet outil.',
'shell_not_enabled' => 'Le plugn shell n\'est pas activé. Merci de l\'activer via le fichier config.yml.'
);

401
PHPCI/Languages/lang.it.php Normal file
View file

@ -0,0 +1,401 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Italiano',
'language' => 'Lingua',
// Log in:
'log_in_to_phpci' => 'Accedi a PHPCI',
'login_error' => 'Indirizzo email o password errati',
'forgotten_password_link' => 'Hai dimenticato la tua password?',
'reset_emailed' => 'Ti abbiamo inviato un link via email per ripristinare la tua password.',
'reset_header' => '<strong>Non preoccuparti!</strong><br>E\' sufficiente inserire il tuo indirizzo email di seguito e ti invieremo una email con il link per il ripristino della tua password.',
'reset_email_address' => 'Inserisci il tuo indirizzo email:',
'reset_send_email' => 'Invia il link di reset della password',
'reset_enter_password' => 'Per favore inserisci la nuova password',
'reset_new_password' => 'Nuova password:',
'reset_change_password' => 'Cambia password',
'reset_no_user_exists' => 'Non esiste nessun utente con questo indirizzo email, per favore prova ancora.',
'reset_email_body' => 'Ciao %s,
hai ricevuto questa email perché tu, o qualcun\'altro, ha richiesto un reset della password per PHPCI.
Se questa mail è tua, per favore apri il seguente link per ripristinare la tua password: %ssession/reset-password/%d/%s
altrimenti, per favore, ignora questa email e nessuna azione verrà intrapresa.
Grazie,
PHPCI',
'reset_email_title' => 'Ripristino della password di PHPCI per %s',
'reset_invalid' => 'Richeista di ripristino password non valida.',
'email_address' => 'Indirizzo Email',
'login' => 'Login / Email Address',
'password' => 'Password',
'log_in' => 'Accedi',
// Top Nav
'toggle_navigation' => 'Alterna navigazione',
'n_builds_pending' => '%d build in attesa',
'n_builds_running' => '%d build in corso',
'edit_profile' => 'Modifica il Profilo',
'sign_out' => 'Disconnettiti',
'branch_x' => 'Branch: %s',
'created_x' => 'Creato: %s',
'started_x' => 'Avviato: %s',
// Sidebar
'hello_name' => 'Ciao, %s',
'dashboard' => 'Dashboard',
'admin_options' => 'Opzioni di amministrazione',
'add_project' => 'Aggiungi un Progetto',
'settings' => 'Impostazioni',
'manage_users' => 'Gestisci Utenti',
'plugins' => 'Plugins',
'view' => 'Visualizzazione',
'build_now' => 'Avvia una build ora',
'edit_project' => 'Modifica il Progetto',
'delete_project' => 'Cancella il Progetto',
// Project Summary:
'no_builds_yet' => 'Ancora nessuna build!',
'x_of_x_failed' => '%d delle ultime %d build sono fallite.',
'x_of_x_failed_short' => '%d / %d fallite.',
'last_successful_build' => ' L\'ultima build è %s.',
'never_built_successfully' => ' Questo progetto non ha nessuna build eseguita con successo.',
'all_builds_passed' => 'Tutte le ultime %d build sono valide.',
'all_builds_passed_short' => '%d / %d valide.',
'last_failed_build' => ' L\'ultima build è %s.',
'never_failed_build' => ' Questo progetto non ha nessuna build fallita.',
'view_project' => 'Visualizza il Progetto',
// Timeline:
'latest_builds' => 'Ultime Build',
'pending' => 'In attesa',
'running' => 'In corso',
'success' => 'Successo',
'successful' => 'Con successo',
'failed' => 'Fallita',
'manual_build' => 'Build Manuale',
// Add/Edit Project:
'new_project' => 'Nuovo Progetto',
'project_x_not_found' => 'Progetto con ID %d non esistente.',
'project_details' => 'Dettagli del Progetto',
'public_key_help' => 'Per rendere più facile la procedura, abbiamo generato una chiave SSH per te da
usare per questo progetto. Per usarla, aggiungi la chiave pubblica alle "deploy keys"
della piattaforma di gestione del codice che hai scelto.',
'select_repository_type' => 'Seleziona il tipo di repository...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL Remoto',
'local' => 'Percorso Locale',
'hg' => 'Mercurial',
'where_hosted' => 'Dove è archiviato il tuo progetto?',
'choose_github' => 'Scegli il repository di GitHub:',
'repo_name' => 'Nome del Repository / URL (Remoto) o Percorso (Locale)',
'project_title' => 'Titolo del Progetto',
'project_private_key' => 'Chiave provata da usare per accedere al repository
(lascia vuota per repository locali o remoti con accesso anonimo)',
'build_config' => 'condigurazione della build di PHPCI per questo progetto
(se non puoi aggiungere il file phpci.yml nel repository di questo progetto)',
'default_branch' => 'Nome del branch di default',
'allow_public_status' => 'Vuoi rendere pubblica la pagina dello stato e l\'immagine per questo progetto?',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Salva il Progetto',
'error_mercurial' => 'L\'URL del repository Mercurial URL deve iniziare con http:// o https://',
'error_remote' => 'L\'URL del repository deve iniziare con git://, http:// o https://',
'error_gitlab' => 'Il nome del repository di GitLab deve essere nel seguente formato "utente@dominio.tld:proprietario/repository.git"',
'error_github' => 'Il nome del repository deve essere nel formato "proprietario/repository"',
'error_bitbucket' => 'Il nome del repository deve essere nel formato "proprietario/repository"',
'error_path' => 'The path you specified does not exist.',
'error_path' => 'Il percorso che hai indicato non esiste.',
// View Project:
'all_branches' => 'Tutti i Branche',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Data',
'project' => 'Progetto',
'commit' => 'Commit',
'branch' => 'Branch',
'status' => 'Stato',
'prev_link' => '&laquo; Precedente',
'next_link' => 'Successivo &raquo;',
'public_key' => 'Chiave pubblica',
'delete_build' => 'Rimuovi build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Per effettuare la build automatica di questo progetto quando vengono inseriti nuovi commit,
aggiungi l\'URL seguente come "Webhook" nella sezione
<a href="https://github.com/%s/settings/hooks">Webhooks and Services</a> del tuo
repository su GitHub.',
'webhooks_help_gitlab' => 'Per effettuare la build automatica di questo progetto quando vengono inseriti nuovi commit,
aggiungi l\'URL seguente come "Webhook URL" nella sezione "WebHook URL" del tuo
repository GitLab.',
'webhooks_help_bitbucket' => 'Per effettuare la build automatica di questo progetto quando vengono inseriti nuovi
commit, aggiungi l\'URL seguente come serizio "POST" nella sezione
<a href="https://bitbucket.org/%s/admin/services">Services</a> del tuo repository su
BITBUCKET.',
// View Build
'build_x_not_found' => 'La build con ID %d non esite.',
'build_n' => 'Build %d',
'rebuild_now' => 'Esegui nuovamente la build ora',
'committed_by_x' => 'Inviato da %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Questo grafico verrà mostrato una volta terminata la build.',
'build' => 'Build',
'lines' => 'Linee',
'comment_lines' => 'Linee di commenti',
'noncomment_lines' => 'Linee che non sono commenti',
'logical_lines' => 'Linee di logica',
'lines_of_code' => 'Linee di codice',
'build_log' => 'Log della build',
'quality_trend' => 'Trend della qualità',
'codeception_errors' => 'Errori di Codeception',
'phpmd_warnings' => 'Avvisi di PHPMD',
'phpcs_warnings' => 'Avvisi di PHPCS',
'phpcs_errors' => 'Errori di PHPCS',
'phplint_errors' => 'Errori di Lint',
'phpunit_errors' => 'Errori di PHPUnit',
'phpdoccheck_warnings' => 'Docblocks mancanti',
'issues' => 'Segnalazioni',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Docblocks mancanti',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'file' => 'File',
'line' => 'Lina',
'class' => 'Classe',
'method' => 'Metodo',
'message' => 'Messaggio',
'start' => 'Inizia',
'end' => 'Finisci',
'from' => 'Da',
'to' => 'A',
'result' => 'Risultati',
'ok' => 'OK',
'took_n_seconds' => 'Sono stati impiegati %d seconds',
'build_created' => 'Build Creata',
'build_started' => 'Build Avviata',
'build_finished' => 'Build Terminata',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Nome',
'password_change' => 'Password (lascia vuota se non vuoi modificarla)',
'save' => 'Salva &raquo;',
'update_your_details' => 'Aggiorna le tue informazioni',
'your_details_updated' => 'Le tue informazioni sono state aggiornate.',
'add_user' => 'Aggiung utent',
'is_admin' => 'E\' amministratore?',
'yes' => 'Si',
'no' => 'No',
'edit' => 'Modifica',
'edit_user' => 'Modifica utente',
'delete_user' => 'Cancella utente',
'user_n_not_found' => 'L\'utente con ID %d non esiste.',
'is_user_admin' => 'Questo utente è un amministratore?',
'save_user' => 'Salva utente',
// Settings:
'settings_saved' => 'Le configurazioni sono state salvate.',
'settings_check_perms' => 'Le configurazioni non possono essere salvate, controlla i permessi del filer config.yml.',
'settings_cannot_write' => 'PHPCI non può scrivere il file config.yml, le configurazioni potrebbero non essere
salvate correttamente fintanto che il problema non verrà risolto.',
'settings_github_linked' => 'Il tuo account GitHub è stato collegato.',
'settings_github_not_linked' => 'Il tuo account GitHub non può essere collegato.',
'build_settings' => 'Configurazioni della build',
'github_application' => 'Applicazione GitHub',
'github_sign_in' => 'Prima di poter iniziare ad usare GitHub, è necessario <a href="%s">collegarsi</a> e garantire
a PHPCI l\'accesso al tuo account.',
'github_phpci_linked' => 'PHPCI è stato collegato correttamente al tuo account GitHub.',
'github_where_to_find' => 'Dove trovare queste...',
'github_where_help' => 'Se sei il proprietario dell\'applicazione, puoi trovare queste informazioni nell\'area delle
configurazioni dell\'<a href="https://github.com/settings/applications">applicazione</a>.',
'email_settings' => 'Impostazioni Email',
'email_settings_help' => 'Prima che possa inviare le email con lo status PHPCI, devi configurare l\'SMTP qui sotto.',
'application_id' => 'ID dell\'Applicazione',
'application_secret' => 'Secret dell\'Applicazione',
'smtp_server' => 'Server SMTP',
'smtp_port' => 'Porta SMTP',
'smtp_username' => 'Username SMTP',
'smtp_password' => 'Password SMTP',
'from_email_address' => 'Indirizzio Email del mittente',
'default_notification_address' => 'Indirizzo email delle notifiche predefinito',
'use_smtp_encryption' => 'Utilizzare l\'Encrypting per SMTP?',
'none' => 'No',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Considera la build fallita dopo',
'5_mins' => '5 Minuti',
'15_mins' => '15 Minuti',
'30_mins' => '30 Minuti',
'1_hour' => '1 Ora',
'3_hours' => '3 Ore',
// Plugins
'cannot_update_composer' => 'PHPCI non può aggiornare composer.json per te non essendo scrivibile.',
'x_has_been_removed' => '%s è stato rimosso.',
'x_has_been_added' => '%s è stato aggiunto al file composer.json per te, verrà installato la prossima volta che eseguirai
composer update.',
'enabled_plugins' => 'Plugins attivati',
'provided_by_package' => 'Fornito dal pacchetto',
'installed_packages' => 'Pacchetti installati',
'suggested_packages' => 'Paccehtti suggeriti',
'title' => 'Titolo',
'description' => 'Descrizione',
'version' => 'Versione',
'install' => 'Installa &raquo;',
'remove' => 'Rimuovi &raquo;',
'search_packagist_for_more' => 'Cerca altri pacchetti su Packagist',
'search' => 'Cerca &raquo;',
// Installer
'installation_url' => 'URL di installazione di PHPCI',
'db_host' => 'Host del Database',
'db_name' => 'Nome del Database',
'db_user' => 'Username del Database',
'db_pass' => 'Password del Database',
'admin_name' => 'Nome dell\'amministratore',
'admin_pass' => 'Password dell\'amministratore',
'admin_email' => 'Email dell\'amministratore',
'config_path' => 'Percorso del file di configurazione',
'install_phpci' => 'Installa PHPCI',
'welcome_to_phpci' => 'Benvenuto in PHPCI',
'please_answer' => 'Per favore rispondi alle seguenti domande:',
'phpci_php_req' => 'PHPCI richiede come minimo PHP 5.3.8 per funzionare.',
'extension_required' => 'Le estensioni richieste sono: %s',
'function_required' => 'PHPCI richiede di poter chiamare la funzione %s(). Questa funzionalità è disabibiltata nel
php.ini?',
'requirements_not_met' => 'PHPCI non può essere installato, non tutti i requisiti sono soddisfatti.
Per favore controlla gli errori riportati prima di proseguire.',
'must_be_valid_email' => 'Deve essere un indirizzo email valido.',
'must_be_valid_url' => 'Deve essere un URL valido.',
'enter_name' => 'Nome dell\'amministratore: ',
'enter_email' => 'Email dell\'amministratore: ',
'enter_password' => 'Password dell\'amministratore: ',
'enter_phpci_url' => 'L\'URL di PHPCI ("http://phpci.locale" ad esempio): ',
'enter_db_host' => 'Per favore inserisci l\'host MySQL [localhost]: ',
'enter_db_name' => 'Per favore inserisci il nome MySQL [phpci]: ',
'enter_db_user' => 'Per favore inserisci l\'username MySQL [phpci]: ',
'enter_db_pass' => 'Per favore inserisci la password MySQL: ',
'could_not_connect' => 'PHPCI non può connettersi a MySQL con le informazioni fornite. Per favore prova ancora.',
'setting_up_db' => 'Configurzione del tuo database... ',
'user_created' => 'Account utente creato!',
'failed_to_create' => 'PHPCI non è riuscito a creare il tuo account amministrativo.',
'config_exists' => 'Il file di configurazione di PHPCI esiste e non è vuoto.',
'update_instead' => 'Se stai cercando di aggiornare PHPCI, per favore usa phpci:update.',
// Update
'update_phpci' => 'Aggiorna il database per riflettere le modifiche ai model.',
'updating_phpci' => 'Aggiornamenti del database di PHPCI: ',
'not_installed' => 'PHPCI sembra non essere installato.',
'install_instead' => 'Per favore installa PHPCI tramite phpci:install.',
// Poll Command
'poll_github' => 'Richiesta a GitHub per verificare se è necessario avviare una build.',
'no_token' => 'Nessuno token per GitHub trovato',
'finding_projects' => 'Ricerca dei progetti da aggiornare',
'found_n_projects' => 'Trovati %d progetti',
'last_commit_is' => 'Ultimo commit su GitHub per %s è %s',
'adding_new_build' => 'L\'ultimo commit è diverso da quello registrato, new build aggiunta.',
'finished_processing_builds' => 'Terminato di processare le build.',
// Create Admin
'create_admin_user' => 'Crea un nuovo utente amministrarore',
'incorrect_format' => 'Formato errato',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Esegui tutte le build in attesa su PHPCI.',
'finding_builds' => 'Ricerca delel build da processare',
'found_n_builds' => 'Trovate %d build',
'skipping_build' => 'Saltata la build %d - La build del progetto è già in corso.',
'marked_as_failed' => 'Build %d è stata contrassegnata come fallita per un timeout.',
// Builder
'missing_phpci_yml' => 'Questo progetto non contiene il file phpci.yml, o il file è vuoto.',
'build_success' => 'BUILD PASSATA',
'build_failed' => 'BUILD FALLITA',
'removing_build' => 'Rimozione build.',
'exception' => 'Eccezione: ',
'could_not_create_working' => 'Non può essere creata una copia di lavoro.',
'working_copy_created' => 'Copia di lavoro creata: %s',
'looking_for_binary' => 'Ricerca per il binario: %s',
'found_in_path' => 'Trovato in %s: %s',
'running_plugin' => 'PLUGIN IN ESECUZIONE: %s',
'plugin_success' => 'PLUGIN: PASSATO',
'plugin_failed' => 'PLUGIN: FALLITO',
'plugin_missing' => 'Plugin non esistente: %s',
'tap_version' => 'TapParser supporta solo la versione TAP 13',
'tap_error' => 'Stringa TAP non valida, il numero dei test non corrisponde con il numero di test contati.',
// Build Plugins:
'no_tests_performed' => 'Nessun test è stato eseguito.',
'could_not_find' => 'Non posso trovare %s',
'no_campfire_settings' => 'Nessun parametro di connessione trovato per il plugin Campfire.',
'failed_to_wipe' => 'Errore nel pulire la cartella %s prima di effettuare la copia',
'passing_build' => 'Build passata',
'failing_build' => 'Build fallita',
'log_output' => 'Log: ',
'n_emails_sent' => '%d email inviate.',
'n_emails_failed' => '%d email da inviare fallite.',
'unable_to_set_env' => 'Errore nel settare la variabile di ambiente',
'tag_created' => 'Tag creato da PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% buildato in %BUILD_URI%',
'hipchat_settings' => 'Per favore definire la stanza e authToken per il plugin hipchat_notify',
'irc_settings' => 'Devi configurare server, stanza e nick.',
'invalid_command' => 'Comando non valido',
'import_file_key' => 'L\'import deve contenrere la chiave \'file\'',
'cannot_open_import' => 'Impossobile aprire il file SQL da importare: %s',
'unable_to_execute' => 'Impossibile eseguire il file SQL',
'phar_internal_error' => 'Errore interno del plugin Phar',
'build_file_missing' => 'Il file di build specificato non esiste.',
'property_file_missing' => 'Il file di proprietà specificato non esiste.',
'could_not_process_report' => 'Non è possibile processare il report generato da questo tool.',
'shell_not_enabled' => 'Il plugin shell non è attivato. Per favore attivalo tramite config.yml.'
);

399
PHPCI/Languages/lang.nl.php Normal file
View file

@ -0,0 +1,399 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Nederlands',
'language' => 'Taal',
// Log in:
'log_in_to_phpci' => 'Log in op PHPCI',
'login_error' => 'Incorrect e-mailadres of wachtwoord',
'forgotten_password_link' => 'Wachtwoord vergeten?',
'reset_emailed' => 'We hebben je een link gemaild om je wachtwoord opnieuw in te stellen.',
'reset_header' => '<strong>Geen zorgen!</strong><br>Vul hieronder gewoon je e-mailadres in en we sturen
je een link on je wachtwoord te resetten.',
'reset_email_address' => 'Vul je e-mailadres in:',
'reset_send_email' => 'Verstuur wachtwoord reset',
'reset_enter_password' => 'Gelieve een nieuw wachtwoord in te voeren',
'reset_new_password' => 'Nieuw wachtwoord:',
'reset_change_password' => 'Wijzig wachtwoord',
'reset_no_user_exists' => 'Er bestaat geen gebruiker met dit e-mailadres, gelieve opnieuw te proberen.',
'reset_email_body' => 'Hallo %s,
Je ontvangt deze email omdat jij, of iemand anders, je wachtwoord voor PHPCI opnieuw wenst in te stellen.
Indien jij dit was, klik op deze link op je wachtwoord opnieuw in te stellen: %ssession/reset-password/%d/%s
Zoniet, negeer deze e-mail en er zal geen verdere actie ondernomen worden.
Bedankt,
PHPCI',
'reset_email_title' => 'PHPCI wachtwoord reset voor %s',
'reset_invalid' => 'Ongeldig wachtwoord reset verzoek',
'email_address' => 'E-mailadres',
'login' => 'Login / Email Address',
'password' => 'Wachtwoord',
'log_in' => 'Log in',
// Top Nav
'toggle_navigation' => 'Wissel Navigatie',
'n_builds_pending' => '%d builds wachtend',
'n_builds_running' => '%d builds lopende',
'edit_profile' => 'Wijzig profiel',
'sign_out' => 'Uitloggen',
'branch_x' => 'Branch: %s',
'created_x' => 'Aangemaakt: %s',
'started_x' => 'Gestart: %s',
// Sidebar
'hello_name' => 'Hallo, %s',
'dashboard' => 'Startpagina',
'admin_options' => 'Administratie opties',
'add_project' => 'Project toevoegen',
'settings' => 'Instellingen',
'manage_users' => 'Gebruikers beheren',
'plugins' => 'Plugins',
'view' => 'Bekijk',
'build_now' => 'Build nu',
'edit_project' => 'Wijzig project',
'delete_project' => 'Verwijder project',
// Project Summary:
'no_builds_yet' => 'Nog geen builds!',
'x_of_x_failed' => '%d van de laatste %d builds faalden.',
'x_of_x_failed_short' => '%d / %d faalden.',
'last_successful_build' => 'De laatste succesvolle build was %s.',
'never_built_successfully' => 'Dit project heeft geen succesvolle build gehad.',
'all_builds_passed' => 'Elk van de laatste %d builds slaagden.',
'all_builds_passed_short' => '%d / %d slaagden.',
'last_failed_build' => 'De laatste gefaalde build was %s.',
'never_failed_build' => 'Dit project heeft geen gefaalde build gehad.',
'view_project' => 'Bekijk project',
// Timeline:
'latest_builds' => 'Laatste builds',
'pending' => 'In afwachting',
'running' => 'Lopende',
'success' => 'Succes',
'successful' => 'Succesvol',
'failed' => 'Gefaald',
'manual_build' => 'Manuele build',
// Add/Edit Project:
'new_project' => 'Nieuw project',
'project_x_not_found' => 'Project met ID %d bestaat niet.',
'project_details' => 'Project details',
'public_key_help' => 'Om eenvoudiger te kunnen starten, hebben we een SSH sleutelpaar gegenereerd
voor dit project. Om het te gebruiken, voeg onderstaande public key toe aan de "deploy keys" sectie
van je gekozen source code hosting platform',
'select_repository_type' => 'Selecteer repository type...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Externe URL',
'local' => 'Lokaal pad',
'hg' => 'Mercurial',
'where_hosted' => 'Waar wordt je project gehost?',
'choose_github' => 'Selecteer een GitHub repository:',
'repo_name' => 'Repository naam / URL (extern) of pad (lokaal)',
'project_title' => 'Projecttitel',
'project_private_key' => 'Private key voor toegang tot repository
(laat leeg voor lokaal en/of anonieme externen)',
'build_config' => 'PHPCI build configuratie voor dit project
(indien je geen phpci.yml bestand aan de project repository kan toevoegen)',
'default_branch' => 'Standaard branch naam',
'allow_public_status' => 'Publieke statuspagina en afbeelding beschikbaar maken voor dit project?',
'archived' => 'Archived',
'archived_menu' => 'Archived',
'save_project' => 'Project opslaan',
'error_mercurial' => 'Mercurial repository URL dient te starten met http:// of https://',
'error_remote' => 'Repository URL dient te starten met git://, http:// of https://',
'error_gitlab' => 'GitLab repository naam dient in het formaat "gebruiker@domain.tld/eigenaar/repo.git" te zijn',
'error_github' => 'Repository naam dient in het formaat "eigenaar/repo" te zijn',
'error_bitbucket' => 'Repository naam dient in het formaat "eigenaar/repo" te zijn',
'error_path' => 'Het opgegeven pad bestaat niet.',
// View Project:
'all_branches' => 'Alle brances',
'builds' => 'Builds',
'id' => 'ID',
'date' => 'Datum',
'project' => 'Project',
'commit' => 'Commit',
'branch' => 'Branch',
'status' => 'Status',
'prev_link' => '&laquo; Vorig',
'next_link' => 'Volgend &raquo;',
'public_key' => 'Public Key',
'delete_build' => 'Verwijder build',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Voor automatische builds wanneer nieuwe commits worden gepusht, dient onderstaande URL
als nieuwe "Webhook" in de <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> sectie van je GitHub repository toegevoegd worden.',
'webhooks_help_gitlab' => 'Voor automatische builds wanneer nieuwe commits worden gepusht, dient onderstaande URL
als nieuwe "Webhook URL" in de Web Hooks sectie van je GitLab repository toegevoegd worden.',
'webhooks_help_bitbucket' => 'Voor automatische builds wanneer nieuwe commits worden gepusht, dient onderstaande URL
als "POST" service in de in de
<a href="https://bitbucket.org/%s/admin/services">
Services</a> sectie van je Bitbucket repository toegevoegd worden.',
// View Build
'build_x_not_found' => 'Build met ID %d bestaat niet.',
'build_n' => 'Build %d',
'rebuild_now' => 'Rebuild nu',
'committed_by_x' => 'Committed door %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Deze grafiek wordt getoond zodra de build compleet is.',
'build' => 'Build',
'lines' => 'Lijnen',
'comment_lines' => 'Commentaarlijnen',
'noncomment_lines' => 'Niet-commentaarlijnen',
'logical_lines' => 'Logische lijnen',
'lines_of_code' => 'Lijnen code',
'build_log' => 'Build Log',
'quality_trend' => 'Kwaliteitstrend',
'codeception_errors' => 'Codeception Fouten',
'phpmd_warnings' => 'PHPMD Waarschuwingen',
'phpcs_warnings' => 'PHPCS Waarschuwingen',
'phpcs_errors' => 'PHPCS Fouten',
'phplint_errors' => 'Lint Fouten',
'phpunit_errors' => 'PHPUnit Fouten',
'phpdoccheck_warnings' => 'Ontbrekende Docblocks',
'issues' => 'Problemen',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Ontbrekende Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHPUnit',
'file' => 'Bestand',
'line' => 'Lijn',
'class' => 'Class',
'method' => 'Method',
'message' => 'Boodschap',
'start' => 'Start',
'end' => 'Einde',
'from' => 'Van',
'to' => 'Tot',
'result' => 'Resultaat',
'ok' => 'OK',
'took_n_seconds' => 'Duurde %d seconden',
'build_created' => 'Build aangemaakt',
'build_started' => 'Build gestart',
'build_finished' => 'Build beëindigd',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Naam',
'password_change' => 'Wachtwoord (laat leeg indien je niet wenst te veranderen)',
'save' => 'Opslaan &raquo;',
'update_your_details' => 'Wijzig je gegevens',
'your_details_updated' => 'Je gegevens werden gewijzigd',
'add_user' => 'Gebruiker toevoegen',
'is_admin' => 'Is administrator?',
'yes' => 'Ja',
'no' => 'Nee',
'edit' => 'Wijzig',
'edit_user' => 'Gebruiker wijzigen',
'delete_user' => 'Gebruiker wissen',
'user_n_not_found' => 'Gebruiker met ID %d bestaat niet.',
'is_user_admin' => 'Is deze gebruiker administrator?',
'save_user' => 'Gebruiker opslaan',
// Settings:
'settings_saved' => 'Je instellingen werden opgeslagen.',
'settings_check_perms' => 'Je instellingen konden niet worden opgeslagen, controleer de permissies van je config.yml bestand.',
'settings_cannot_write' => 'PHPCI kan niet schrijven naar je config.yml bestand, instellingen worden mogelijks
niet goed opgeslagen tot dit opgelost is.',
'settings_github_linked' => 'Je GitHub account werd gelinkt.',
'settings_github_not_linked' => 'Je GitHub account kon niet gelinkt worden.',
'build_settings' => 'Build instellingen',
'github_application' => 'GitHub toepassing',
'github_sign_in' => 'Vooraleer je GitHub kan gebruiken, dien je <a href="%s">in te loggen</a> en
PHPCI toegang te verlenen tot je account.',
'github_phpci_linked' => 'PHP werd succesvol gelinkt aan je GitHub account.',
'github_where_to_find' => 'Waar zijn deze te vinden...',
'github_where_help' => 'Indien je eigenaar bent van de toepassing die je wens te gebruiken, kan je deze informatie
in je <a href="https://github.com/settings/applications">applications</a> instellingen pagina vinden.',
'email_settings' => 'E-mail instellingen',
'email_settings_help' => 'Vooraleer PHPCI je build status e-mails kan sturen,
dien je eerst je SMTP instellingen te configureren.',
'application_id' => 'Toepassings ID',
'application_secret' => 'Toepassings geheime code',
'smtp_server' => 'SMTP Server',
'smtp_port' => 'SMTP Poort',
'smtp_username' => 'SMTP Gebruikersnaam',
'smtp_password' => 'SMTP Wachtwoord',
'from_email_address' => 'Van e-mailadres',
'default_notification_address' => 'Standaard melding e-mailadres',
'use_smtp_encryption' => 'SMTP Encryptie gebruiken?',
'none' => 'Geen',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Beschouw een build gefaald na',
'5_mins' => '5 minuten',
'15_mins' => '15 minuten',
'30_mins' => '30 minuten',
'1_hour' => '1 uur',
'3_hours' => '3 uur',
// Plugins
'cannot_update_composer' => 'PHPCI kan composer.json niet aanpassen gezien het niet schrijfbaar is.',
'x_has_been_removed' => '%s werd verwijderd.',
'x_has_been_added' => '%s werd toegevoegd aan composer.json en zal geïnstalleerd worden de volgende
keer je composer update uitvoert.',
'enabled_plugins' => 'Ingeschakelde plugins',
'provided_by_package' => 'Voorzien door package',
'installed_packages' => 'Geinstalleerde packages',
'suggested_packages' => 'Voorgestelde packages',
'title' => 'Titel',
'description' => 'Beschrijving',
'version' => 'Versie',
'install' => 'Installeer &raquo;',
'remove' => 'Verwijder &raquo;',
'search_packagist_for_more' => 'Doorzoek Packagist naar meer packages',
'search' => 'Zoek &raquo;',
// Installer
'installation_url' => 'PHPCI installatie URL',
'db_host' => 'Database host',
'db_name' => 'Database naam',
'db_user' => 'Database gebruikersnaam',
'db_pass' => 'Database wachtwoord',
'admin_name' => 'Administrator naam',
'admin_pass' => 'Administrator wachtwoord',
'admin_email' => 'Administrator e-mailadres',
'config_path' => 'Pad naar configuratiebestand',
'install_phpci' => 'Installeer PHPCI',
'welcome_to_phpci' => 'Welkom bij PHPCI',
'please_answer' => 'Gelieve onderstaande vragen te beantwoorden:',
'phpci_php_req' => 'PHPCI heeft ten minste PHP 5.3.8 nodig om te werken.',
'extension_required' => 'Extensie benodigd: %s',
'function_required' => 'PHPCI moet functie %s() kunnen aanroepen. Is deze uitgeschakeld in php.ini?',
'requirements_not_met' => 'PHPCI kan niet worden geïnstalleerd omdat niet aan alle vereisten is voldaan.
Gelieve de fouten na te kijken vooraleer verder te gaan.',
'must_be_valid_email' => 'Moet een geldig e-mailadres zijn.',
'must_be_valid_url' => 'Moet een geldige URL zijn.',
'enter_name' => 'Administrator naam: ',
'enter_email' => 'Administrator e-mailadres: ',
'enter_password' => 'Administrator wachtwoord: ',
'enter_phpci_url' => 'Je PHPCI URL (bijvoorbeeld "http://phpci.local"): ',
'enter_db_host' => 'Vul je MySQL host in [localhost]: ',
'enter_db_name' => 'Vul je MySQL databasenaam in [phpci]: ',
'enter_db_user' => 'Vul je MySQL gebruikersnaam in [phpci]: ',
'enter_db_pass' => 'Vul je MySQL watchtwoord in: ',
'could_not_connect' => 'PHPCI kon met deze gegevens geen verbinding maken met MySQL. Gelieve opnieuw te proberen.',
'setting_up_db' => 'Database wordt aangemaakt...',
'user_created' => 'Gebruikersprofiel aangemaakt!',
'failed_to_create' => 'PHPCI kon je administratorprofiel niet aanmaken.',
'config_exists' => 'Het PHPCI configuratiebestand bestaat en is niet leeg.',
'update_instead' => 'Liever phpci:update te gebruiken indien je PHPCI probeerde te updaten, ',
// Update
'update_phpci' => 'Update de database naar het beeld van gewijzigde modellen.',
'updating_phpci' => 'PHPCI database wordt geüpdatet:',
'not_installed' => 'PHPCI lijkt niet geïnstalleerd te zijn.',
'install_instead' => 'Gelieve PHPCI via phpci:install te installeren.',
// Poll Command
'poll_github' => 'Poll GitHub om te controleren of we een build moeten starten.',
'no_token' => 'Geen GitHub token gevonden',
'finding_projects' => 'Vind projecten om te pollen',
'found_n_projects' => '%d projecten gevonden',
'last_commit_is' => 'Laatste commit naar GitHub voor %s is %s',
'adding_new_build' => 'Laatste commit verschilt van database, nieuwe build wordt toegevoegd',
'finished_processing_builds' => 'Verwerking builds voltooid.',
// Create Admin
'create_admin_user' => 'Administrator-gebruiker aanmaken',
'incorrect_format' => 'Incorrect formaat',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Voer alle wachtende PHPCI builds uit.',
'finding_builds' => 'Zoekt builds om te verwerken',
'found_n_builds' => '%d builds gevonden',
'skipping_build' => 'Build %d overslaan - Project build reeds aan de gang.',
'marked_as_failed' => 'Build %d gemarkeerd als falende door timeout.',
// Builder
'missing_phpci_yml' => 'Dit project bevat geen phpci.yml bestand, of het is leeg.',
'build_success' => 'BUILD SUCCES',
'build_failed' => 'BUILD GEFAALD',
'removing_build' => 'Build wordt verwijderd.',
'exception' => 'Uitzondering:',
'could_not_create_working' => 'Kon geen werkende kopie maken.',
'working_copy_created' => 'Werkende kopie aangemaakt: %s',
'looking_for_binary' => 'Zoekend naar binary: %s',
'found_in_path' => 'Gevonden in %s: %s',
'running_plugin' => 'UITVOEREN PLUGIN: %s',
'plugin_success' => 'PLUGIN: SUCCES',
'plugin_failed' => 'PLUGIN: GEFAALD',
'plugin_missing' => 'Plugin bestaat niet: %s',
'tap_version' => 'TapParser ondersteunt enkel TAP versie 13',
'tap_error' => 'Ongeldige TAP string, aantal tests niet in overeenstemming met opgegeven aantal.',
// Build Plugins:
'no_tests_performed' => 'Er werden geen tests uitgevoerd.',
'could_not_find' => 'Kon %s niet vinden',
'no_campfire_settings' => 'Geen verbindingsparameters opgegeven voor Campfire plugin',
'failed_to_wipe' => 'Kon bestaande map %s niet wissen voor kopie',
'passing_build' => 'Slagende build',
'failing_build' => 'Falende build',
'log_output' => 'Log output:',
'n_emails_sent' => '%d e-mails versuurd.',
'n_emails_failed' => '%d e-mails faalden te versturen.',
'unable_to_set_env' => 'Niet geslaagd om environment variable in te stellen',
'tag_created' => 'Tag aangemaakt door PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% built op %BUILD_URI%',
'hipchat_settings' => 'Gelieve kamer & authToken voor hipchat_notify plugin te definiëren',
'irc_settings' => 'Je dient server, kamer & nick op te geven.',
'invalid_command' => 'Ongeldig commando',
'import_file_key' => 'Import statement moet \'file\' key bevatten',
'cannot_open_import' => 'Het is niet mogelijk om het SQL bestand %s te openen',
'unable_to_execute' => 'Het is niet mogelijk om het SQL bestand uit te voeren',
'phar_internal_error' => 'Er is iets fout gegaan in de Phar Plugin',
'build_file_missing' => 'Opgegeven build bestand bestaat niet.',
'property_file_missing' => 'Opgegeven bestand bestaat niet',
'could_not_process_report' => 'Het is niet mogelijk om het gegenereerde rapport van deze tool te verwerken.',
'shell_not_enabled' => 'De shell plugin is niet ingeschakeld, schakel deze a.u.b. in via het config.yml bestand.'
);

400
PHPCI/Languages/lang.pl.php Normal file
View file

@ -0,0 +1,400 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Polski',
'language' => 'Język',
// Log in:
'log_in_to_phpci' => 'Zaloguj się do PHPCI',
'login_error' => 'Nieprawidłowy email lub hasło',
'forgotten_password_link' => 'Zapomniałeś hasła?',
'reset_emailed' => 'Email z linkiem resetującym hasło został wysłany.',
'reset_header' => '<strong>Spokojnie!</strong><br>Wpisz swój adres email w polu poniżej a my wyślemy Ci link
resetujący hasło.',
'reset_email_address' => 'Podaj swój adres email:',
'reset_send_email' => 'Wyślij reset hasła emailem',
'reset_enter_password' => 'Wpisz nowe hasło',
'reset_new_password' => 'Nowe hasło:',
'reset_change_password' => 'Zmień hasło',
'reset_no_user_exists' => 'Użytkownik o takim emailu nie istnieje. Spróbuj jeszcze raz.',
'reset_email_body' => 'Witaj %s,
Otrzymałeś ten email ponieważ Ty, lub ktoś inny, wysłał prośbę o zmianę hasła w PHPCI.
Jeśli to faktycznie Ty, kliknij w następujący link aby zresetować hasło: %ssession/reset-password/%d/%s
Jeśli nie, zignoruj tego emaila i wszystko pozostanie bez zmian,
Pozdrawiamy,
PHPCI',
'reset_email_title' => 'Reset Hasła PHPCI dla %s',
'reset_invalid' => 'Prośba o zmianę hasła jest nieważna.',
'email_address' => 'Adres email',
'login' => 'Login / Email Address',
'password' => 'Hasło',
'log_in' => 'Zaloguj się',
// Top Nav
'toggle_navigation' => 'Otwórz/zamknij nawigację',
'n_builds_pending' => '%d budowań w kolejce',
'n_builds_running' => '%d budowań w toku',
'edit_profile' => 'Edytuj Profil',
'sign_out' => 'Wyloguj się',
'branch_x' => 'Gałąź: %s',
'created_x' => 'Utworzono: %s',
'started_x' => 'Rozpoczęto: %s',
// Sidebar
'hello_name' => 'Witaj, %s',
'dashboard' => 'Panel administracyjny',
'admin_options' => 'Opcje Administratora',
'add_project' => 'Dodaj Projekt',
'settings' => 'Ustawienia',
'manage_users' => 'Zarządaj Uzytkownikami',
'plugins' => 'Pluginy',
'view' => 'Podgląd',
'build_now' => 'Zbuduj',
'edit_project' => 'Edytuj Projekt',
'delete_project' => 'Usuń Projekt',
// Project Summary:
'no_builds_yet' => 'Brak budowań!',
'x_of_x_failed' => '%d z ostatnich %d budowań nie powiodło się',
'x_of_x_failed_short' => '%d / %d nie powiodło się',
'last_successful_build' => 'Ostatnie budowanie zakończone sukesem odbyło się %s',
'never_built_successfully' => 'Projekt nie został zbudowany z powodzeniem.',
'all_builds_passed' => 'Wszystkie z ostatnich %d budowań przeszły.',
'all_builds_passed_short' => '%d / %d przeszło.',
'last_failed_build' => 'Ostatnie budowanie zakończone niepowodzeniam było %s.',
'never_failed_build' => 'Ten projekt nigdy nie zakończył się niepowodzeniem budowania',
'view_project' => 'Podgląd Projektu',
// Timeline:
'latest_builds' => 'Ostatnie Budowania',
'pending' => 'Oczekujące',
'running' => 'W toku',
'success' => 'Sukces',
'successful' => 'Zakończone sukcesem',
'failed' => 'Nieudane',
'manual_build' => 'Budowanie Manualne',
// Add/Edit Project:
'new_project' => 'Nowy Projekt',
'project_x_not_found' => 'Projekt o ID %d nie istnieje.',
'project_details' => 'Szczegóły Projektu',
'public_key_help' => 'Aby łatwiej zacząć, wygenerowaliśmy parę kluczy SSH, które możesz użyć
do tego projektu. Żeby je użyć, wystarczy dodać następujący klucz publiczny do sekcji "wdrożyć klucze"
od wybranego kodu źródłowego platformy hostingowej.',
'select_repository_type' => 'Wybierz typ repozytorium...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Zdalny URL ',
'local' => 'Lokalna Ścieżka ',
'hg' => 'Mercurial',
'svn' => 'Subversion',
'where_hosted' => 'Gdzie hostowany jest Twój projekt?',
'choose_github' => 'Wybierz repozytorium GitHub:',
'repo_name' => 'Nazwa repozytorium / URL (Zdalne) lub Ścieżka (Lokalne)',
'project_title' => 'Tytuł Projektu',
'project_private_key' => 'Prywanty klucz dostępu do repozytoriów
(pozostaw puste pole dla zdalnych lokalnych i/lub anonimowych)',
'build_config' => 'PHPCI zbudowało config dla tego projektu
(jeśli nie możesz dodać pliku phpci.yml do repozytorium projektu)',
'default_branch' => 'Domyślna nazwa gałęzi',
'allow_public_status' => 'Włączyć status publiczny dla tego projektu?',
'archived' => 'W archiwum',
'archived_menu' => 'W archiwum',
'save_project' => 'Zachowaj Projekt',
'error_mercurial' => 'URL repozytorium Mercurialnego powinno zaczynać się od http:// and https://',
'error_remote' => 'URL repozytorium powinno zaczynać się od git://, http:// lub https://',
'error_gitlab' => 'Nazwa Repozytorium GitLab powinna być w następującym formacie: "user@domain.tld:owner/repo.git"',
'error_github' => 'Nazwa repozytorium powinna być w formacie: "użytkownik/repo"',
'error_bitbucket' => 'Nazwa repozytorium powinna być w formacie: " użytkownik/repo\'',
'error_path' => 'Wybrana sieżka nie istnieje',
// View Project:
'all_branches' => 'Wszystkie Gałęzie',
'builds' => 'Budowania',
'id' => 'ID',
'date' => 'Data',
'project' => 'Projekt',
'commit' => 'Commit',
'branch' => 'Gałąź',
'status' => 'Status',
'prev_link' => '&laquo; Poprzedni',
'next_link' => 'Następny &raquo;',
'public_key' => 'Klucz Publiczny',
'delete_build' => 'Usuń Budowanie',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Aby automatycznie uruchomić nową budowę po wysłaniu commitów dodaj poniższy adres URL
jako nowy "WebHook" w sekcji <a href="https://github.com/%s/settings/hooks">Webhooks and Services</a>
Twojego repozytoria GitLab.',
'webhooks_help_gitlab' => 'Aby automatycznie uruchomić nową budowę po wysłaniu commitów dodaj poniższy adres URL
jako "WebHook URL" w sekcji Web Hook Twojego repozytoria GitLab.',
'webhooks_help_bitbucket' => 'Aby automatycznie uruchomić nową budowę po wysłaniu commitów, dodaj poniższy adres URL
jako usługę "POST" w sekcji
<a href="https://bitbucket.org/%s/admin/services">
Services</a> repozytoria Bitbucket.',
// View Build
'build_x_not_found' => 'Budowanie o ID %d nie istnieje.',
'build_n' => 'Budowanie %d',
'rebuild_now' => 'Przebuduj Teraz',
'committed_by_x' => 'Commitowane przez %s',
'commit_id_x' => 'Commit: %s',
'chart_display' => 'Ten wykres wyświetli się po zakończeniu budowy.',
'build' => 'Budowanie',
'lines' => 'Linie',
'comment_lines' => 'Linie Komentarza',
'noncomment_lines' => 'Linie Bez Komentarza',
'logical_lines' => 'Lokalne Linie',
'lines_of_code' => 'Linie Kodu',
'build_log' => 'Log Budowania',
'quality_trend' => 'Trend Jakości',
'codeception_errors' => 'Błędy Codeception',
'phpmd_warnings' => 'Alerty PHPMD',
'phpcs_warnings' => 'Alerty PHPCS',
'phpcs_errors' => 'Błędy PHPCS',
'phplint_errors' => 'Błędy Lint',
'phpunit_errors' => 'Błędy PHPUnit',
'phpdoccheck_warnings' => 'Brakuje sekcji DocBlock',
'issues' => 'Problemy',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Brakuje sekcji DocBlock',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHPSpec',
'phpunit' => 'PHPUnit',
'technical_debt' => 'Dług technologiczny',
'behat' => 'Behat',
'file' => 'Plik',
'line' => 'Linia',
'class' => 'Klasa',
'method' => 'Metoda',
'message' => 'Wiadomość',
'start' => 'Początek',
'end' => 'Koniec',
'from' => 'Od',
'to' => 'Do',
'result' => 'Wynik',
'ok' => 'OK',
'took_n_seconds' => 'Zajęło %d sekund',
'build_created' => 'Budowanie Stworzone',
'build_started' => 'Budowanie Rozpoczęte',
'build_finished' => 'Budowanie Zakończone',
'test_message' => 'Wiadomość',
'test_no_message' => 'Brak wiadomości',
'test_success' => 'Powodzenie: %d',
'test_fail' => 'Niepowodzenia: %d',
'test_skipped' => 'Pominęte: %d',
'test_error' => 'Błędy: %d',
'test_todo' => 'Do zrobienia: %d',
'test_total' => '%d test(ów)',
// Users
'name' => 'Nazwa',
'password_change' => 'Hasło (pozostaw puste jeśli nie chcesz zmienić hasła)',
'save' => 'Zapisz &raquo;',
'update_your_details' => 'Aktualizuj swoje dane',
'your_details_updated' => 'Twoje dane zostały zaktualizowane.',
'add_user' => 'Dodaj Użytkownika',
'is_admin' => 'Jest Adminem?',
'yes' => 'Tak',
'no' => 'Nie',
'edit' => 'Edytuj',
'edit_user' => 'Edytuj Użytkownika',
'delete_user' => 'Usuń Użytkownika',
'user_n_not_found' => 'Użytkownik z ID %d nie istnieje.',
'is_user_admin' => 'Czy użytkownik jest administratorem?',
'save_user' => 'Zapisz Użytkownika',
// Settings:
'settings_saved' => 'Ustawienia zostały zapisane.',
'settings_check_perms' => 'Twoje ustawienia nie mogły zostać zapisane. Sprawdź uprawnienia do pliku config.yml.',
'settings_cannot_write' => 'PHPCI nie może zapisać do pliku config.yml. Dopóty nie będzie można poprawnie zachować ustawie,
dopóki nie będzie to naprawione.',
'settings_github_linked' => 'Połaczono z Twoim kontem Github',
'settings_github_not_linked' => 'Nie udało się połaczyć z Twoim kontem Github',
'build_settings' => 'Ustawienia budowania',
'github_application' => 'Aplikacja GitHub',
'github_sign_in' => 'Zanim będzie można zacząć korzystać z GitHub, musisz najpierw <a href="%s">Sign in</a>, a następnie udzielić dostęp dla PHPCI do Twojego konta.',
'github_phpci_linked' => 'PHPCI zostało pomyślnie połączone z konten GitHub.',
'github_where_to_find' => 'Gdzie można znaleźć...',
'github_where_help' => 'Jeśli to jest Twoja aplikacjia i chcesz jej użyć to więcej informacji znajdziesz w sekcji ustawień:
<a href="https://github.com/settings/applications">applications</a>',
'email_settings' => 'Ustawienia Email',
'email_settings_help' => 'Aby PHPCI mógł wysyłać emaile z stanem budowy, musisz najpierw skonfigurować poniższe ustawienia SMTP.',
'application_id' => 'ID Aplikacji',
'application_secret' => 'Klucz Secret aplikacji',
'smtp_server' => 'Serwer SMTP',
'smtp_port' => 'Port SMTP',
'smtp_username' => 'SMTP Login',
'smtp_password' => 'Hasło SMTP',
'from_email_address' => 'E-mail adres Od:',
'default_notification_address' => 'Domyślny adres email powiadamiania',
'use_smtp_encryption' => 'Użyć szyfrowane SMTP?',
'none' => 'Żadne',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Uznaj, że budowanie nie powiodło się po',
'5_mins' => '5 Minutach',
'15_mins' => '15 Minutach',
'30_mins' => '30 Minutach',
'1_hour' => '1 Godzinie',
'3_hours' => '3 Godzinach',
// Plugins
'cannot_update_composer' => 'PHPCI nie może zaktualizować copmposer.json, ponieważ nie ma uprawnień do zapisu.',
'x_has_been_removed' => 'Usunięto %s. ',
'x_has_been_added' => 'Dodano %s do composer.json. Zostanie zainstalowane po
wywołaniu polecenia composer update.',
'enabled_plugins' => 'Aktywne Pluginy',
'provided_by_package' => 'Dostarczone w pakiecie',
'installed_packages' => 'Zainstalowane Pakiety',
'suggested_packages' => 'Sugerowane Pakiety',
'title' => 'Tytuł',
'description' => 'Opis',
'version' => 'Wersja',
'install' => 'Zainstaluj &raquo;',
'remove' => 'Usuń &raquo;',
'search_packagist_for_more' => 'Przeszukaj Packagist po więcej pakietów',
'search' => 'Szukaj &raquo;',
// Installer
'installation_url' => 'URL instalacyjny PHPCI',
'db_host' => 'Host Bazy Danych',
'db_name' => 'Nazwa Bazy Danych',
'db_user' => 'Nazwa Użytkownika Bazy Danych',
'db_pass' => 'Hasło Bazy Danych',
'admin_name' => 'Imię Admina',
'admin_pass' => 'Hasło Admina',
'admin_email' => 'Adres Email Admina',
'config_path' => 'Ścieżka Pliku Config',
'install_phpci' => 'Zainstaluj PHPCI',
'welcome_to_phpci' => 'Witaj w PHPCI',
'please_answer' => 'Odpowiedz na poniższe pytania:',
'phpci_php_req' => 'PHPCI wymaga przynajmniej PHP 5.3.8 do prawidłowego funkcjonowania.',
'extension_required' => 'Wymagane rozszerzenie: %s',
'function_required' => 'PHPCI musi mieć możliwość wywołania funkcji %s(). Czy ona jest wyłączona w php.ini?',
'requirements_not_met' => 'Nie można zainstalować PHPCI, ponieważ nie wszystkie wymagania zostały spełnione.
Przejrzyj powyższą listę błędów przed kontynuowaniem.',
'must_be_valid_email' => 'Poprawny adres email jest wymagany.',
'must_be_valid_url' => 'Poprawny URL jest wymagany.',
'enter_name' => 'Imię Admina: ',
'enter_email' => 'Email Admina: ',
'enter_password' => 'Hasło Admina: ',
'enter_phpci_url' => 'URL PHPCI (na przykład "http://phpci.local"): ',
'enter_db_host' => 'Wpisz hosta MySQL [host lokalny]: ',
'enter_db_name' => 'Wpisz nazwę bazy danych MySQL [phpci]: ',
'enter_db_user' => 'Wpisz nazwę użytkownika MySQL [phpci]: ',
'enter_db_pass' => 'Wpisz hasło MySQL: ',
'could_not_connect' => 'Z podanymi ustawieniami PHPCI nie udało się połączyć z MySQL. Spróbuj ponownie.',
'setting_up_db' => 'Ustawianie Twojej bazy danych...',
'user_created' => 'Utworzono konto użytkownika!',
'failed_to_create' => 'PHPCI nie udało się założyc Twojego konta administratora.',
'config_exists' => 'Plik konfiguracji PHPCI istnieje i nie jest pusty.',
'update_instead' => 'Jeśli próbowałeś zaktualizować PHPCI, użyj phpci:update.',
// Update
'update_phpci' => 'Zaktualizuj bazę danych zgodnie ze zmodyfikowanymi modelami.',
'updating_phpci' => 'Aktualizacja bazy danych PHPCI:',
'not_installed' => 'Wygląda na to, że PHPCI nie jest zainstalowane.',
'install_instead' => 'Proszę zainstalować PHPCI poprzez phpci:install',
// Poll Command
'poll_github' => 'Odpytuj GitHub, aby sprawdzić czy należy uruchomić budowę.',
'no_token' => 'Nie znaleziono tokena GitHub',
'finding_projects' => 'Szukanie projektów do odpytywania',
'found_n_projects' => 'Znaleziono %d projektów',
'last_commit_is' => 'Ostatni commit do GitHuba dla %s to %s',
'adding_new_build' => 'Ostatni commit jest inny w bazie danych, dodaję nową budowę.',
'finished_processing_builds' => 'Ukończono przetwarzanie budów.',
// Create Admin
'create_admin_user' => 'Utwórz admina',
'incorrect_format' => 'Niepoprawny format',
// Create Build Command
'create_build_project' => 'Utwórz budowanie dla projektu',
'project_id_argument' => 'ID projektu',
'commit_id_option' => 'ID Commita do budowania',
'branch_name_option' => 'Gałąź do budowania',
// Run Command
'run_all_pending' => 'Uruchom wszystkie oczekujące budowy w PHPCI',
'finding_builds' => 'Szukam budów do przetwarzania.',
'found_n_builds' => 'Znaleziono %d budowań',
'skipping_build' => 'Budowanie %d jest pomijane - Budowanie projektu jest już w toku',
'marked_as_failed' => 'Budowanie %d nie powiodło się z powodu przekroczenia limitu czasu.',
// Builder
'missing_phpci_yml' => 'Projekt nie zawiera pliku phpci.yml lub projekt jest pusty.',
'build_success' => 'BUDOWANIE ZAKOŃCZONE SUKCESEM',
'build_failed' => 'BUDOWANIE NIE POWIODŁO SIĘ',
'removing_build' => 'Usuwanie Budowania.',
'exception' => 'Wyjątek:',
'could_not_create_working' => 'Nie można utworzyć wersji roboczej.',
'working_copy_created' => 'Stworzono wersję roboczą: %s',
'looking_for_binary' => 'Szukam binarek: %s',
'found_in_path' => 'Znaleziono w %s: %s',
'running_plugin' => 'Uruchomiony Plugin: %s',
'plugin_success' => 'Plugin: Sukces',
'plugin_failed' => 'Plugin: Niepowodzenie',
'plugin_missing' => 'Plugin nie istnieje: %s',
'tap_version' => 'TapParser obsługuje tylko TAP w wersji 13',
'tap_error' => 'Nieprawidłowy łańcuch TAP, liczba testów nie zgadza się z policzoną ilością testów.',
// Build Plugins:
'no_tests_performed' => 'Nie przeprowadzono żadnych testów.',
'could_not_find' => 'Nie znaleziono %s',
'no_campfire_settings' => 'Nie zdefiniowano parametrów połączenia dla pluginu Campfire',
'failed_to_wipe' => 'Nie udało się wyczyścić istniejącego katalogu %s przed kopiowaniem',
'passing_build' => 'Pomijanie Budowania',
'failing_build' => 'Niepowodzenie Budowania',
'log_output' => 'Log Wyjściowy:',
'n_emails_sent' => 'Wysłano %d emaili.',
'n_emails_failed' => 'Nie wysłano %d emaili.',
'unable_to_set_env' => 'Nie można ustawić zmiennej środowiskowej',
'tag_created' => 'Tag stworzony przez PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% zbudowano pod %BUILD_URI%',
'hipchat_settings' => 'Proszę podać pokój i authToken dla pluginu hipchat_notify.',
'irc_settings' => 'Musisz skonfigurować serwer, pokój i swoją nazwę.',
'invalid_command' => 'Nieprawidłowe polecenie',
'import_file_key' => 'Potwierdzenie importu musi zawierać klucz "plik"',
'cannot_open_import' => 'Nie można otworzyć importowanego pliku SQL: %s',
'unable_to_execute' => 'Nie można wykonać pliku SQL',
'phar_internal_error' => 'Wewnętrzny Błąd Pluginu Phar',
'build_file_missing' => 'Podany plik budowy nie istnieje.',
'property_file_missing' => 'Podany plik właściwości nie istnieje.',
'could_not_process_report' => 'Nie udało się przetworzyć raportu wygenerowanego przez to narzędzie.',
'shell_not_enabled' => 'Plugin powłoki jest nieaktywny. Aktywuj go poprzez config.yml.'
);

412
PHPCI/Languages/lang.ru.php Normal file
View file

@ -0,0 +1,412 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Pусский',
'language' => 'язык',
// Log in:
'log_in_to_phpci' => 'Войти в PHPCI',
'login_error' => 'Неправильный email или пароль',
'forgotten_password_link' => 'Забыли пароль?',
'reset_emailed' => 'Вы получите письмо со ссылкой на сброс пароля.',
'reset_header' => '<strong>Не волнуйтесь!</strong><br>Просто введите ваш email, и вам придет письмо со ссылкой на сброс пароля.',
'reset_email_address' => 'Введите ваш email:',
'reset_send_email' => 'Сброс пароля',
'reset_enter_password' => 'Пожалуйста, введите новый пароль',
'reset_new_password' => 'Новый пароль:',
'reset_change_password' => 'Сменить пароль',
'reset_no_user_exists' => 'Пользователь с таким email-адресом не найден, пожалуйста, попробуйте еще раз.',
'reset_email_body' => 'Привет %s,
Вы получили это письмо, потому что вы или кто-то другой запросили сброс пароля в PHPCI.
Если это были вы, пожалуйста, перейдите по ссылке для сброса пароля: %ssession/reset-password/%d/%s,
иначе игнорируйте это письмо и ничего не предпринимайте.
Спасибо,
PHPCI',
'reset_email_title' => 'Сброс пароля PHPCI для %s',
'reset_invalid' => 'Некорректный запрос на сброс пароля.',
'email_address' => 'Email',
'login' => 'Логин / Email',
'password' => 'Пароль',
'log_in' => 'Войти',
// Top Nav
'toggle_navigation' => 'Скрыть/показать панель навигации',
'n_builds_pending' => '%d сборок ожидает',
'n_builds_running' => '%d сборок запущено',
'edit_profile' => 'Редактировать профиль',
'sign_out' => 'Выйти',
'branch_x' => 'Ветка: %s',
'created_x' => 'Создан: %s',
'started_x' => 'Запущен: %s',
// Sidebar
'hello_name' => 'Привет, %s',
'dashboard' => 'Панель управления',
'admin_options' => 'Меню администратора',
'add_project' => 'Добавить проект',
'settings' => 'Настройки',
'manage_users' => 'Пользователи',
'plugins' => 'Плагины',
'view' => 'Отчет',
'build_now' => 'Собрать',
'edit_project' => 'Редактировать проект',
'delete_project' => 'Удалить проект',
// Project Summary:
'no_builds_yet' => 'Нет сборок!',
'x_of_x_failed' => '%d из последних %d сборок были провалены.',
'x_of_x_failed_short' => '%d / %d провалены.',
'last_successful_build' => ' Последняя успешная сборка была %s.',
'never_built_successfully' => ' Этот проект никогда не собирался успешно.',
'all_builds_passed' => 'Все последние сборки (%d) прошли успешно.',
'all_builds_passed_short' => '%d / %d успешные.',
'last_failed_build' => ' Последней проваленной сборкой была %s.',
'never_failed_build' => ' У этого проекта никогда не было проваленных сборок.',
'view_project' => 'Обзор проекта',
// Timeline:
'latest_builds' => 'Последние сборки',
'pending' => 'Ожидает',
'running' => 'Запущена',
'success' => 'Успешно',
'successful' => 'Успешна',
'failed' => 'Провалена',
'manual_build' => 'Запущена вручную',
// Add/Edit Project:
'new_project' => 'Новый проект',
'project_x_not_found' => 'Проекта с ID %d не существует.',
'project_details' => 'Подробности проекта',
'public_key_help' => 'Чтобы было легче начать, мы сгенерировали пару SSH-ключей для использования в вашем проекте.
Для их использования, просто добавьте эту публичную часть ключа в поле "deploy keys" на выбранном вами хостинге исходного кода.',
'select_repository_type' => 'Выберите тип репозитория...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Внешний URL',
'local' => 'Локальный путь',
'hg' => 'Mercurial',
'svn' => 'Subversion',
'where_hosted' => 'Расположение проекта',
'choose_github' => 'Выберите GitHub репозиторий:',
'repo_name' => 'Репозиторий / Внешний URL / Локальный путь',
'project_title' => 'Название проекта',
'project_private_key' => 'Приватный ключ для доступа к репозиторию
(оставьте поле пустым для локального использования и/или анонимного доступа)',
'build_config' => 'Конфигурация сборки проекта для PHPCI
(если вы не добавили файл phpci.yml в репозиторий вашего проекта)',
'default_branch' => 'Ветка по умолчанию',
'allow_public_status' => 'Разрешить публичный статус и изображение (статуса) для проекта',
'archived' => 'Архивный',
'archived_menu' => 'Архив',
'save_project' => 'Сохранить проект',
'error_mercurial' => 'URL репозитория Mercurial должен начинаться с http:// или https://',
'error_remote' => 'URL репозитория должен начинаться с git://, http:// или https://',
'error_gitlab' => 'Имя репозитория в GitLab должно иметь формат: "user@domain.tld:owner/repo.git"',
'error_github' => 'Имя репозитория должно иметь формат: "owner/repo"',
'error_bitbucket' => 'Имя репозитория должно иметь формат: "owner/repo"',
'error_path' => 'Пути, который вы указали, не существует.',
// View Project:
'all_branches' => 'Все ветки',
'builds' => 'Сборки',
'id' => 'ID',
'date' => 'Дата',
'project' => 'Проект',
'commit' => 'Коммит',
'branch' => 'Ветка',
'status' => 'Статус',
'prev_link' => '&laquo; Пред.',
'next_link' => 'След. &raquo;',
'public_key' => 'Публичный ключ',
'delete_build' => 'Удалить сборку',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Чтобы Автоматически собирать этот проект при публикации новых коммитов, добавьте URL ниже в качестве нового хука в разделе настроек <a href="https://github.com/%s/settings/hooks">Webhooks
and Services</a> вашего GitHub репозитория.',
'webhooks_help_gitlab' => 'Чтобы Автоматически собирать этот проект при публикации новых коммитов, добавьте URL ниже в качестве "WebHook URL"
в разделе "Web Hooks" вашего GitLab репозитория.',
'webhooks_help_bitbucket' => 'Чтобы Автоматически собирать этот проект при публикации новых коммитов, добавьте URL ниже как "POST" сервис в разделе <a href="https://bitbucket.org/%s/admin/services">
Services</a> вашего Bitbucket репозитория.',
// View Build
'build_x_not_found' => 'Сборки с ID %d не существует.',
'build_n' => 'Сборка %d',
'rebuild_now' => 'Пересобрать сейчас',
'committed_by_x' => 'Отправил %s',
'commit_id_x' => 'Коммит: %s',
'chart_display' => 'Этот график будет показан после окончания сборки.',
'build' => 'Сборка',
'lines' => 'Строк',
'comment_lines' => 'Строк комментариев',
'noncomment_lines' => 'Строк некомментариев',
'logical_lines' => 'Строк логики',
'lines_of_code' => 'Строк кода',
'build_log' => 'Лог сборки',
'quality_trend' => 'Тенденция качества',
'codeception_errors' => 'Ошибки Codeception',
'phpmd_warnings' => 'Предупреждения PHPMD',
'phpcs_warnings' => 'Предупреждения PHPCS',
'phpcs_errors' => 'Ошибки PHPCS',
'phplint_errors' => 'Ошибки Lint',
'phpunit_errors' => 'Ошибки PHPUnit',
'phpdoccheck_warnings' => 'Пропущенные Docblocks',
'issues' => 'Проблемы',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Missing Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'technical_debt' => 'Технические долги',
'behat' => 'Behat',
'codeception_feature' => 'Свойство',
'codeception_suite' => 'Набор',
'codeception_time' => 'Время',
'codeception_synopsis' => 'Тестов выполнено: <strong>%1$d</strong> (за <strong>%2$f</strong> сек.). Провалов: <strong>%3$d</strong>.',
'file' => 'Файл',
'line' => 'Строка',
'class' => 'Класс',
'method' => 'Метод',
'message' => 'Сообщение',
'start' => 'Начало',
'end' => 'Конец',
'from' => 'Из',
'to' => 'В',
'result' => 'Результат',
'ok' => 'OK',
'took_n_seconds' => 'Заняло секунд: %d',
'build_created' => 'Сборка создана',
'build_started' => 'Сборка запущена',
'build_finished' => 'Сборка окончена',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Успешно: %d',
'test_fail' => 'Провалено: %d',
'test_skipped' => 'Пропущено: %d',
'test_error' => 'Ошибок: %d',
'test_todo' => 'Todo: %d',
'test_total' => 'Тестов: %d',
// Users
'name' => 'Имя',
'password_change' => 'Пароль (оставьте поле пустым, если не собираетесь менять его)',
'save' => 'Сохранить &raquo;',
'update_your_details' => 'Обновить свои данные',
'your_details_updated' => 'Ваши данные были обновлены.',
'add_user' => 'Добавить пользователя',
'is_admin' => 'Является администратором',
'yes' => 'Да',
'no' => 'Нет',
'edit' => 'Править',
'edit_user' => 'Редактировать пользователя',
'delete_user' => 'Удалить пользователя',
'user_n_not_found' => 'Пользователя с ID %d не существует.',
'is_user_admin' => 'Этот пользователь является администратором',
'save_user' => 'Сохранить пользователя',
// Settings:
'settings_saved' => 'Ваши настройки были сохранены.',
'settings_check_perms' => 'Ваши настройки не могут быть сохранены, проверьте права на файл настроек config.yml.',
'settings_cannot_write' => 'PHPCI не может записать config.yml файл, настройки не могут быть сохранены корректно, пока это не будет исправлено.',
'settings_github_linked' => 'Ваш GitHub аккаунт привязан.',
'settings_github_not_linked' => 'Ваш GitHub аккаунт не может быть привязан.',
'build_settings' => 'Настройки сборки',
'github_application' => 'GitHub приложение',
'github_sign_in' => 'Перед тем как начать использовать GitHub аккаунт, вам необходимо <a href="%s">войти</a> и разрешить доступ для
PHPCI до вашего аккаунта.',
'github_phpci_linked' => 'PHPCI успешно привязал GitHub аккаунт.',
'github_where_to_find' => 'Где это найти...',
'github_where_help' => 'Если вы владелец приложения, которое вы хотели бы использовать, то вы можете найти информацию об этом в разделе
<a href="https://github.com/settings/applications">applications</a> настроек.',
'email_settings' => 'Настройки email',
'email_settings_help' => 'Перед тем, как PHPCI начнет отсылать статус сборок по почте,
вам необходимо настроить параметры SMTP ниже.',
'application_id' => 'ID приложения',
'application_secret' => 'Секретный ключ приложения',
'smtp_server' => 'SMTP сервер',
'smtp_port' => 'SMTP порт',
'smtp_username' => 'SMTP пользователь',
'smtp_password' => 'SMTP пароль',
'from_email_address' => 'Отправлять с email',
'default_notification_address' => 'Email по умолчанию для оповещений',
'use_smtp_encryption' => 'Использовать SMTP шифрование',
'none' => 'Нет',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Признать сборку проваленной по прошествии',
'5_mins' => '5 минут',
'15_mins' => '15 минут',
'30_mins' => '30 минут',
'1_hour' => '1 часа',
'3_hours' => '3 часов',
// Plugins
'cannot_update_composer' => 'PHPCI не может обновить composer.json, если он недоступен на запись.',
'x_has_been_removed' => '%s был удален.',
'x_has_been_added' => '%s был добавлен в composer.json и будет установлен, как только вы запустите composer update.',
'enabled_plugins' => 'Включенные плагины',
'provided_by_package' => 'Предоставляется пакетом',
'installed_packages' => 'Установленные пакеты',
'suggested_packages' => 'Рекомендуемые пакеты',
'title' => 'Название',
'description' => 'Описание',
'version' => 'Версия',
'install' => 'Установить &raquo;',
'remove' => 'Удалить &raquo;',
'search_packagist_for_more' => 'Искать на Packagist',
'search' => 'Искать &raquo;',
// Summary plugin
'build-summary' => 'Сводка',
'stage' => 'Этап',
'duration' => 'Продолжительность',
'plugin' => 'Плагин',
'stage_setup' => 'Установка',
'stage_test' => 'тестирование',
'stage_complete' => 'Завершение',
'stage_success' => 'Успешное завершение',
'stage_failure' => 'Провал',
'stage_broken' => 'Поломка',
'stage_fixed' => 'Исправление',
// Installer
'installation_url' => 'URL-адрес PHPCI для установки',
'db_host' => 'Хост базы данных',
'db_name' => 'Имя базы данных',
'db_user' => 'Пользователь базы данных',
'db_pass' => 'Пароль базы данных',
'admin_name' => 'Имя администратора',
'admin_pass' => 'Пароль администратора',
'admin_email' => 'Email администратора',
'config_path' => 'Путь до файла конфигурации',
'install_phpci' => 'Установить PHPCI',
'welcome_to_phpci' => 'Добро пожаловать в PHPCI',
'please_answer' => 'Пожалуйста, ответьте на несколько вопросов:',
'phpci_php_req' => 'PHPCI необходима для работы версия PHP не ниже 5.3.8.',
'extension_required' => 'Требуется расширение PHP: %s',
'function_required' => 'PHPCI необходима возможность вызывать %s() функцию. Она выключена в php.ini?',
'requirements_not_met' => 'PHPCI не может быть установлен, пока не все требования выполнены.
Пожалуйста, просмотрите возникшие ошибки перед тем, как продолжить.',
'must_be_valid_email' => 'Должен быть корректным email-адресом.',
'must_be_valid_url' => 'Должен быть корректным URL-адресом.',
'enter_name' => 'Имя администратора: ',
'enter_email' => 'Email администратора: ',
'enter_password' => 'Пароль администратора: ',
'enter_phpci_url' => 'URL-адрес вашего PHPCI (например: "http://phpci.local"): ',
'enter_db_host' => 'Пожалуйста, введите хост MySQL [localhost]: ',
'enter_db_name' => 'Пожалуйста, введите имя базы данных MySQL [phpci]: ',
'enter_db_user' => 'Пожалуйста, введите пользователя MySQL [phpci]: ',
'enter_db_pass' => 'Пожалуйста, введите пароль MySQL: ',
'could_not_connect' => 'PHPCI не может подключится к MySQL с переданными параметрами. Пожалуйста, попробуйте еще раз.',
'setting_up_db' => 'Установка базы данных... ',
'user_created' => 'Аккаунт пользователя создан!',
'failed_to_create' => 'PHPCI не удалось создать аккаунт администратора.',
'config_exists' => 'Файл конфигурации PHPCI уже существует, и он не пустой.',
'update_instead' => 'Если вы собираетесь обновить PHPCI, пожалуйста, используйте команду phpci:update.',
// Update
'update_phpci' => 'Обновите базу данных с учетом обновленных моделей.',
'updating_phpci' => 'Обновление базы данных PHPCI: ',
'not_installed' => 'PHPCI не может быть установлен.',
'install_instead' => 'Пожалуйста, установите PHPCI с помощью команды phpci:install.',
// Poll Command
'poll_github' => 'Опрос GitHub для проверки запуска сборки.',
'no_token' => 'GitHub токен не найден',
'finding_projects' => 'Поиск проектов для опроса',
'found_n_projects' => 'Найдено проектов: %d',
'last_commit_is' => 'Последний коммит на GitHub для %s - %s',
'adding_new_build' => 'Последний коммит имеет различия с базой данных, создана сборка.',
'finished_processing_builds' => 'Процесс сборки завершен.',
// Create Admin
'create_admin_user' => 'Добавить аккаунт администратора',
'incorrect_format' => 'Неверный формат',
// Create Build Command
'create_build_project' => 'Создать сборку проекта',
'project_id_argument' => 'ID проекта',
'commit_id_option' => 'ID коммита для сборки',
'branch_name_option' => 'Ветка для сборки',
// Run Command
'run_all_pending' => 'Запустить все ожидающие PHPCI сборки.',
'finding_builds' => 'Поиск сборок для запуска',
'found_n_builds' => 'Найдено сборок: %d',
'skipping_build' => 'Сборка %d пропущена - Сборка проекта уже идет.',
'marked_as_failed' => 'Сборка %d отмечена как неудавшаяся из-за превышения лимита времени.',
// Builder
'missing_phpci_yml' => 'Этот проект не содержит файла phpci.yml, или файл пустой.',
'build_success' => 'СБОРКА УСПЕШНА',
'build_failed' => 'СБОРКА ПРОВАЛЕНА',
'removing_build' => 'Удаление сборки.',
'exception' => 'Исключение: ',
'could_not_create_working' => 'Не удалось создать рабочую копию.',
'working_copy_created' => 'Рабочая копия создана: %s',
'looking_for_binary' => 'Поиск пакета: %s',
'found_in_path' => 'Найден в %s: %s',
'running_plugin' => 'ЗАПУЩЕН ПЛАГИН: %s',
'plugin_success' => 'ПЛАГИН: УСПЕШНО',
'plugin_failed' => 'ПЛАГИН: ПРОВАЛ',
'plugin_missing' => 'Плагина не существует: %s',
'tap_version' => 'TapParser поддерживает только TAP версии 13',
'tap_error' => 'Некорректная TAP-строка, количество тестов не совпадает с заявленным.',
// Build Plugins:
'no_tests_performed' => 'Никакие тесты не были запущены.',
'could_not_find' => 'Не удается найти %s',
'no_campfire_settings' => 'Не переданы параметры подключения для плагина Campfire',
'failed_to_wipe' => 'Не удалось уничтожить существующую директорию %s перед копированием',
'passing_build' => 'Успех сборки',
'failing_build' => 'Провал сборки',
'log_output' => 'Вывод лога: ',
'n_emails_sent' => 'Писем отправлено: %d.',
'n_emails_failed' => 'Писем не удалось отправить: %d.',
'unable_to_set_env' => 'Невозможно установить переменную окружения',
'tag_created' => 'Метка создана PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% собран: %BUILD_URI%',
'hipchat_settings' => 'Пожалуйста, укажите комнату и токен (authToken) для плагина hipchat_notify',
'irc_settings' => 'Вы должны задать сервер, комнату и ник.',
'invalid_command' => 'Некорректная команда',
'import_file_key' => 'Выражение импорта должно содержать ключ \'file\'',
'cannot_open_import' => 'Не удалось открыть файл SQL для импорта: %s',
'unable_to_execute' => 'Невозможно выполнить файл SQL',
'phar_internal_error' => 'Внутренняя ошибка плагина Phar',
'build_file_missing' => 'Указанного файла сборки не существует.',
'property_file_missing' => 'Указанного файла сборки не существует.',
'could_not_process_report' => 'Невозможно обработать отчет этой утилиты.',
'shell_not_enabled' => 'Плагин shell не включен. Пожалуйста, включите его в файле config.yml.'
);

399
PHPCI/Languages/lang.uk.php Normal file
View file

@ -0,0 +1,399 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
$strings = array(
'language_name' => 'Українська',
'language' => 'Мова',
// Log in:
'log_in_to_phpci' => 'Увійти до PHPCI',
'login_error' => 'Невірний email або пароль',
'forgotten_password_link' => 'Забули свій пароль?',
'reset_emailed' => 'Ми відправили вам посилання для скидання вашого паролю.',
'reset_header' => '<strong>Не хвилюйтесь!</strong><br>Просто введіть ваш email
і вам буде надіслано листа із посиланням на скидання паролю.',
'reset_email_address' => 'Введіть свою email адресу:',
'reset_send_email' => 'Скидання пароля',
'reset_enter_password' => 'Введіть, будь ласка, новий пароль',
'reset_new_password' => 'Новий пароль:',
'reset_change_password' => 'Змінити пароль',
'reset_no_user_exists' => 'Не існує користувача з такою email адресою, будь ласка, повторіть знову.',
'reset_email_body' => 'Привіт, %s,
Ви отримали цей лист, тому що ви або хтось інший запросили скидання пароля в PHPCI.
Якщо це були ви, будь ласка, перейдіть за посиланням нижче для скидання пароля: %ssession/reset-password/%d/%s,
або ж проігноруйте цей лист та нічого не робіть.
Дякуємо,
PHPCI',
'reset_email_title' => 'Скидання пароль PHPCI для %s',
'reset_invalid' => 'Невірний запит скидання паролю.',
'email_address' => 'Email адреса',
'login' => 'Логин / Email адреса',
'password' => 'Пароль',
'log_in' => 'Увійти',
// Top Nav
'toggle_navigation' => 'Сховати/відобразити панель навігації',
'n_builds_pending' => '%d збірок очікує',
'n_builds_running' => '%d збірок виконується',
'edit_profile' => 'Редагувати профіль',
'sign_out' => 'Вийти',
'branch_x' => 'Гілка: %s',
'created_x' => 'Створено: %s',
'started_x' => 'Розпочато: %s',
// Sidebar
'hello_name' => 'Привіт, %s',
'dashboard' => 'Панель управління',
'admin_options' => 'Меню адміністратора',
'add_project' => 'Додати проект',
'settings' => 'Налаштування',
'manage_users' => 'Управління користувачами',
'plugins' => 'Плагіни',
'view' => 'Переглянути',
'build_now' => 'Зібрати',
'edit_project' => 'Редагувати проект',
'delete_project' => 'Видалити проект',
// Project Summary:
'no_builds_yet' => 'Немає збірок!',
'x_of_x_failed' => '%d із останніх %d збірок були провалені.',
'x_of_x_failed_short' => '%d / %d провалені.',
'last_successful_build' => 'Останнью успішною збіркою була %s.',
'never_built_successfully' => 'У цього проекта ніколи не було успішних збірок.',
'all_builds_passed' => 'Усі із останніх %d збірок успішні.',
'all_builds_passed_short' => '%d / %d успішні.',
'last_failed_build' => 'Останньою проваленою збіркою була %s.',
'never_failed_build' => 'У цього проекта ніколи не було провалених збірок.',
'view_project' => 'Переглянути проект',
// Timeline:
'latest_builds' => 'Останні збірки',
'pending' => 'Очікує',
'running' => 'Виконується',
'success' => 'Успіх',
'successful' => 'Успішно',
'failed' => 'Провалена',
'manual_build' => 'Ручна збірка',
// Add/Edit Project:
'new_project' => 'Новий проект',
'project_x_not_found' => 'Проект із ID %d не існує.',
'project_details' => 'Деталі проекта',
'public_key_help' => 'Для полегшення початку, ми згенерували пару SSH-ключів для вас для використання в цьому проекті.
Для їх використання - просто додайте наступний публічний ключ у розділ "deploy keys" обраної вами системи зберігання програмного коду.',
'select_repository_type' => 'Оберіть тип репозиторію...',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Віддалений URL',
'local' => 'Локальний шлях',
'hg' => 'Mercurial',
'where_hosted' => 'Де зберігається ваш проект?',
'choose_github' => 'Оберіть GitHub репозиторій:',
'repo_name' => 'Ім’я репозиторія / URL (зовнішній) / Шлях (локальний)',
'project_title' => 'Заголовок проекту',
'project_private_key' => 'Приватний ключ доступу до репозиторія
(залишити поле порожнім для локального використання та/або анонімного доступу)',
'build_config' => 'Конфігурація збірки цього проекта для PHPCI
(якщо ви не додали файл phpci.yml до репозиторію вашого проекту)',
'default_branch' => 'Назва гілки за замовчуванням',
'allow_public_status' => 'Увімкнути публічну сторінку статусу та зображення для цього проекта?',
'archived' => 'Архівний',
'archived_menu' => 'Архів',
'save_project' => 'Зберегти проект',
'error_mercurial' => 'URL репозиторію Mercurial повинен починатись із http:// або https://',
'error_remote' => 'URL репозиторію повинен починатись із git://, http:// або https://',
'error_gitlab' => 'Ім’я репозиторія GitLab повинно бути у форматі "user@domain.tld:owner/repo.git"',
'error_github' => 'Ім’я репозиторія повинно відповідати формату "owner/repo"',
'error_bitbucket' => 'Ім’я репозиторія повинно відповідати формату "owner/repo"',
'error_path' => 'Вказаний шлях не існує.',
// View Project:
'all_branches' => 'Усі гілки',
'builds' => 'Збірки',
'id' => 'ID',
'date' => 'Дата',
'project' => 'Проект',
'commit' => 'Комміт',
'branch' => 'Гілка',
'status' => 'Статус',
'prev_link' => '&laquo; Попер.',
'next_link' => 'Наст. &raquo;',
'public_key' => 'Публічний ключ',
'delete_build' => 'Видалити збірку',
'webhooks' => 'Webhooks',
'webhooks_help_github' => 'Для автоматичної збірки цього проекту, при надходженні нових комітів, додайте наступний URL
у якості нового "Webhook" у розділі налаштувань
<a href="https://github.com/%s/settings/hooks">Webhooks and Services</a>
вашого GitHub репозиторію.',
'webhooks_help_gitlab' => 'Для автоматичної збірки цього проекту, при надходженні нових комітів, додайте наступний URL
у якості нового "WebHook URL" у розділі "Web Hooks" вашого GitLab репозиторію.',
'webhooks_help_bitbucket' => 'Для автоматичної збірки цього проекту, при надходженні нових комітів, додайте наступний URL
у якості нового "POST" сервісу у розділі
<a href="https://bitbucket.org/%s/admin/services">Services</a>
вашого Bitbucket репозиторію.',
// View Build
'build_x_not_found' => 'Збірка із ID %d не існує.',
'build_n' => 'Збірка %d',
'rebuild_now' => 'Перезібрати зараз',
'committed_by_x' => 'Комміт від %s',
'commit_id_x' => 'Комміт: %s',
'chart_display' => 'Цей графік відобразиться після завершення збірки.',
'build' => 'Збірка',
'lines' => 'Рядків',
'comment_lines' => 'Рядків коментарів',
'noncomment_lines' => 'Рядків не коментарів',
'logical_lines' => 'Рядків логіки',
'lines_of_code' => 'Рядки коду',
'build_log' => 'Лог збірки',
'quality_trend' => 'Тенденція якості',
'codeception_errors' => 'Помилки Codeception',
'phpmd_warnings' => 'Попередження PHPMD',
'phpcs_warnings' => 'Попередження PHPCS',
'phpcs_errors' => 'Помилки PHPCS',
'phplint_errors' => 'Помилки Lint',
'phpunit_errors' => 'Помилки PHPUnit',
'phpdoccheck_warnings' => 'Відсутні Docblocks',
'issues' => 'Проблеми',
'codeception' => 'Codeception',
'phpcpd' => 'PHP Copy/Paste Detector',
'phpcs' => 'PHP Code Sniffer',
'phpdoccheck' => 'Відсутні Docblocks',
'phpmd' => 'PHP Mess Detector',
'phpspec' => 'PHP Spec',
'phpunit' => 'PHP Unit',
'file' => 'Файл',
'line' => 'Рядок',
'class' => 'Клас',
'method' => 'Метод',
'message' => 'Повідомлення',
'start' => 'Запуск',
'end' => 'Кінець',
'from' => 'Від',
'to' => 'До',
'result' => 'Результат',
'ok' => 'OK',
'took_n_seconds' => 'Зайняло %d секунд',
'build_created' => 'Збірка створена',
'build_started' => 'Збірка розпочата',
'build_finished' => 'Збірка завершена',
'test_message' => 'Message',
'test_no_message' => 'No message',
'test_success' => 'Successful: %d',
'test_fail' => 'Failures: %d',
'test_skipped' => 'Skipped: %d',
'test_error' => 'Errors: %d',
'test_todo' => 'Todos: %d',
'test_total' => '%d test(s)',
// Users
'name' => 'Ім’я',
'password_change' => 'Пароль (залишити порожнім, якщо не бажаєте змінювати його)',
'save' => 'Зберегти &raquo;',
'update_your_details' => 'Оновити ваші деталі',
'your_details_updated' => 'Ваші деталі були оновлені.',
'add_user' => 'Додати користувача',
'is_admin' => 'Адміністратор?',
'yes' => 'Так',
'no' => 'Ні',
'edit' => 'Редагувати',
'edit_user' => 'Редагувати користувача',
'delete_user' => 'Видалити користувача',
'user_n_not_found' => 'Користувач із ID %d не існує.',
'is_user_admin' => 'Чи є цей користувач адміністратором?',
'save_user' => 'Зберегти користувача',
// Settings:
'settings_saved' => 'Ваші налаштування були збережені.',
'settings_check_perms' => 'Ваші налаштування не можуть бути збережені, перевірте права на ваш файл налаштувань config.yml.',
'settings_cannot_write' => 'PHPCI не може записати файл config.yml, налаштування не будуть коректно збережені,
доки це не буде виправлено.',
'settings_github_linked' => 'Ваш GitHub аккаунт було підключено.',
'settings_github_not_linked' => 'Ваш GitHub аккаунт не може бути підключеним.',
'build_settings' => 'Налаштування збірки',
'github_application' => 'GitHub додаток',
'github_sign_in' => 'Перед початком користування GitHub, вам необхідно <a href="%s">увійти</a> та надати
доступ для PHPCI до вашого аккаунту.',
'github_phpci_linked' => 'PHPCI успішно зв\'язаний з аккаунтом GitHub.',
'github_where_to_find' => 'Де це знайти...',
'github_where_help' => 'Якщо ви є власником додатку, який би ви хотіли використовувати, то ви можете знайти інформацію про це у розділі
налаштувань ваших <a href="https://github.com/settings/applications">додатків</a>.',
'email_settings' => 'Налаштування Email',
'email_settings_help' => 'Перед тим, як PHPCI почне надсилати статуси збірок на email,
вам необхідно налаштувати параметри SMTP нижче.',
'application_id' => 'ID додатка',
'application_secret' => 'Таємний ключ додатка',
'smtp_server' => 'Сервер SMTP',
'smtp_port' => 'Порт SMTP',
'smtp_username' => 'Ім’я користувача SMTP',
'smtp_password' => 'Пароль SMTP',
'from_email_address' => 'Відправляти з Email',
'default_notification_address' => 'Email для повідомлень за замовчуванням',
'use_smtp_encryption' => 'Використовувати SMTP шифрування?',
'none' => 'Ні',
'ssl' => 'SSL',
'tls' => 'TLS',
'failed_after' => 'Вважати збірку проваленою після',
'5_mins' => '5 хвилин',
'15_mins' => '15 хвилин',
'30_mins' => '30 хвилин',
'1_hour' => '1 година',
'3_hours' => '3 години',
// Plugins
'cannot_update_composer' => 'PHPCI не може оновити composer.json, оскільки він не є доступним для запису.',
'x_has_been_removed' => '%s було видалено.',
'x_has_been_added' => '%s був доданий до composer.json і буде встановлений, як тільки
ви виконаєте composer update.',
'enabled_plugins' => 'Увімкнені плагіни',
'provided_by_package' => 'Наданий пакетом',
'installed_packages' => 'Встановлені пакети',
'suggested_packages' => 'Запропоновані пакети',
'title' => 'Заголовок',
'description' => 'Опис',
'version' => 'Версія',
'install' => 'Встановити &raquo;',
'remove' => 'Видалити &raquo;',
'search_packagist_for_more' => 'Знайти більше пакетів на Packagist',
'search' => 'Знайти &raquo;',
// Installer
'installation_url' => 'URL встановлення PHPCI',
'db_host' => 'Хост бази даних',
'db_name' => 'Назва бази даних',
'db_user' => 'Ім’я користувача бази даних',
'db_pass' => 'Пароль бази даних',
'admin_name' => 'Ім’я адміністратора',
'admin_pass' => 'Пароль адміністратора',
'admin_email' => 'Email адреса адміністратора',
'config_path' => 'Шлях до файла конфігурації',
'install_phpci' => 'Встановити PHPCI',
'welcome_to_phpci' => 'Ласкаво просимо до PHPCI',
'please_answer' => 'Будь ласка, дайте відповідь на наступні питання:',
'phpci_php_req' => 'PHPCI вимагає для роботи, принаймні, версію PHP 5.3.8.',
'extension_required' => 'Необхідне розширення: %s',
'function_required' => 'PHPCI необхідна можливість викликати функцію %s(). Вона відключена у php.ini?',
'requirements_not_met' => 'Неможливо встановити PHPCI, оскільки не всі вимоги виконані.
Будь ласка, продивіться наявні помилки перед тим, як продовжити.',
'must_be_valid_email' => 'Повинно бути коректною email адресою.',
'must_be_valid_url' => 'Повинно бути коректним URL.',
'enter_name' => 'Ім’я адміністратора: ',
'enter_email' => 'Email адміністратора: ',
'enter_password' => 'Пароль адміністратора: ',
'enter_phpci_url' => 'URL адреса вашого PHPCI (наприклад, "http://phpci.local"): ',
'enter_db_host' => 'Будь ласка, введіть хост MySQL [localhost]: ',
'enter_db_name' => 'Будь ласка, введить ім’я бази даних MySQL [phpci]: ',
'enter_db_user' => 'Будь ласка, введить ім’я користувача MySQL [phpci]: ',
'enter_db_pass' => 'Будь ласка, введить ваш пароль MySQL: ',
'could_not_connect' => 'PHPCI не може підключитися до MySQL із наданими параметрами. Будь ласка, спробуйте ще раз.',
'setting_up_db' => 'Налаштування вашої бази даних...',
'user_created' => 'Аккаунт користувача створено!',
'failed_to_create' => 'PHPCI не вдалося створити ваш аккаунт адміністратора.',
'config_exists' => 'Файл конфігурації PHPCI вже існує та не є порожнім.',
'update_instead' => 'Якщо ви збираєтесь оновити PHPCI, будь ласка, використовуйте команду phpci:update.',
// Update
'update_phpci' => 'Оновити базу даних для відображення змінених моделей.',
'updating_phpci' => 'Оновлення бази даних PHPCI:',
'not_installed' => 'Неможливо встановити PHPCI.',
'install_instead' => 'Будь ласка, встановіть PHPCI через команду phpci:install.',
// Poll Command
'poll_github' => 'Зробити запит до GitHub для перевірки запуску збірки.',
'no_token' => 'GitHub токен не знайдено',
'finding_projects' => 'Пошук проектів для запиту',
'found_n_projects' => 'Знайдено %d проектів',
'last_commit_is' => 'Останній коміт на GitHub для %s - %s',
'adding_new_build' => 'Останній коміт має відмінності із базою даних, створена нова збірка.',
'finished_processing_builds' => 'Завершено обробку збірок.',
// Create Admin
'create_admin_user' => 'Створити аккаунт адміністратора',
'incorrect_format' => 'Невірний формат',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Запустити всі PHPCI збірки, які очікують.',
'finding_builds' => 'Пошук збірок для обробки',
'found_n_builds' => 'Знайдено %d збірок',
'skipping_build' => 'Збірка %d пропущена - Збірка проекта вже у процесі.',
'marked_as_failed' => 'Збірка %d відмічена як невдала через перевищення ліміту часу.',
// Builder
'missing_phpci_yml' => 'Цей проект не містить файл phpci.yml або він є порожнім.',
'build_success' => 'ЗБІРКА УСПІШНА',
'build_failed' => 'ЗБІРКА НЕВДАЛА',
'removing_build' => 'Видалення збірки.',
'exception' => 'Виключення:',
'could_not_create_working' => 'Не вдалося створити робочу копію.',
'working_copy_created' => 'Робоча копія створена: %s',
'looking_for_binary' => 'Пошук бінарного пакета: %s',
'found_in_path' => 'Знайдено у %s: %s',
'running_plugin' => 'ВИКОНУЄТЬСЯ ПЛАГІН: %s',
'plugin_success' => 'ПЛАГІН: УСПІШНО',
'plugin_failed' => 'ПЛАГІН: НЕВДАЛО',
'plugin_missing' => 'Плагін не існує: %s',
'tap_version' => 'TapParser підтримує тільки TAP версії 13',
'tap_error' => 'Некоректний TAP-рядок, кількість тестів не співпадає із вказаними.',
// Build Plugins:
'no_tests_performed' => 'Жодних тестів не було запущено.',
'could_not_find' => 'Неможливо знайти %s',
'no_campfire_settings' => 'Не вказані параметри з’єднання для плагіна Campfire',
'failed_to_wipe' => 'Не вдалося знищити існуючу директорію %s перед копіюванням',
'passing_build' => 'Успішно збірка',
'failing_build' => 'Невдала збірка',
'log_output' => 'Вивід лога:',
'n_emails_sent' => '%d листів відправлено.',
'n_emails_failed' => '%d листів не вдалося відправити.',
'unable_to_set_env' => 'Неможливо встановити змінну оточення',
'tag_created' => 'Тег, створений PHPCI: %s',
'x_built_at_x' => '%PROJECT_TITLE% зібрано у %BUILD_URI%',
'hipchat_settings' => 'Будь ласка, вкажіть кімнату та "authToken" параметр для плагіна hipchat_notify',
'irc_settings' => 'Ви повинні вказати сервер, кімнату та нік.',
'invalid_command' => 'Невірна команда',
'import_file_key' => 'Вираз імпорту повинен містити ключ \'file\'',
'cannot_open_import' => 'Неможливо відкрити файл імпорту SQL: %s',
'unable_to_execute' => 'Неможливо виконати файл SQL',
'phar_internal_error' => 'Внутрішня помилка плагіну Phar',
'build_file_missing' => 'Вказаний файл збірки не існує.',
'property_file_missing' => 'Вказаний файл властивості не існує.',
'could_not_process_report' => 'Неможливо обробити звіт, згенерований цією утилітою.',
'shell_not_enabled' => 'Плагін shell не увімкнений. Будь ласка, увімкніть його через config.yml.'
);

View file

@ -12,7 +12,12 @@ namespace PHPCI\Logging;
use b8\Store\Factory;
use Monolog\Handler\AbstractProcessingHandler;
use PHPCI\Model\Build;
use Psr\Log\LogLevel;
/**
* Class BuildDBLogHandler writes the build log to the database.
* @package PHPCI\Logging
*/
class BuildDBLogHandler extends AbstractProcessingHandler
{
/**
@ -22,6 +27,11 @@ class BuildDBLogHandler extends AbstractProcessingHandler
protected $logValue;
/**
* @param Build $build
* @param bool $level
* @param bool $bubble
*/
public function __construct(
Build $build,
$level = LogLevel::INFO,
@ -33,6 +43,10 @@ class BuildDBLogHandler extends AbstractProcessingHandler
$this->logValue = $build->getLog();
}
/**
* Write a log entry to the build log.
* @param array $record
*/
protected function write(array $record)
{
$message = (string)$record['message'];

View file

@ -14,6 +14,10 @@ use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
/**
* Class BuildLogger
* @package PHPCI\Logging
*/
class BuildLogger implements LoggerAwareInterface
{
/**
@ -26,6 +30,11 @@ class BuildLogger implements LoggerAwareInterface
*/
protected $build;
/**
* Set up the BuildLogger class.
* @param LoggerInterface $logger
* @param Build $build
*/
public function __construct(LoggerInterface $logger, Build $build)
{
$this->logger = $logger;
@ -58,7 +67,7 @@ class BuildLogger implements LoggerAwareInterface
}
}
/**
/**
* Add a success-coloured message to the log.
* @param string
*/
@ -89,6 +98,17 @@ class BuildLogger implements LoggerAwareInterface
);
}
/**
* Add a debug message to the log.
* @param string
*/
public function logDebug($message)
{
if (defined('PHPCI_DEBUG_MODE') && PHPCI_DEBUG_MODE) {
$this->log("\033[0;33m" . $message . "\033[0m");
}
}
/**
* Sets a logger instance on the object
*

View file

@ -11,6 +11,10 @@ namespace PHPCI\Logging;
use Psr\Log\LoggerInterface;
/**
* Base Log Handler
* @package PHPCI\Logging
*/
class Handler
{
/**
@ -33,11 +37,18 @@ class Handler
*/
protected $logger;
/**
* @param LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger = null)
{
$this->logger = $logger;
}
/**
* Register a new log handler.
* @param LoggerInterface $logger
*/
public static function register(LoggerInterface $logger = null)
{
$handler = new static($logger);
@ -59,7 +70,6 @@ class Handler
public function handleError($level, $message, $file, $line)
{
if (error_reporting() & $level) {
$exception_level = isset($this->levels[$level]) ? $this->levels[$level] : $level;
throw new \ErrorException(
@ -122,10 +132,13 @@ class Handler
$this->log($exception);
}
/**
* Write to the build log.
* @param \Exception $exception
*/
protected function log(\Exception $exception)
{
if (null !== $this->logger) {
$message = sprintf(
'%s: %s (uncaught exception) at %s line %s',
get_class($exception),

View file

@ -11,8 +11,15 @@ namespace PHPCI\Logging;
use PHPCI\Model\Build;
/**
* Class LoggedBuildContextTidier cleans up build log entries.
* @package PHPCI\Logging
*/
class LoggedBuildContextTidier
{
/**
* @return array
*/
public function __invoke()
{
return $this->tidyLoggedBuildContext(func_get_arg(0));

View file

@ -9,14 +9,18 @@
namespace PHPCI\Logging;
use Monolog\ErrorHandler;
use Monolog\Logger;
/**
* Class LoggerConfig
* @package PHPCI\Logging
*/
class LoggerConfig
{
const KEY_ALWAYS_LOADED = "_";
private $config;
private $cache = array();
/**
* The filepath is expected to return an array which will be
@ -54,11 +58,27 @@ class LoggerConfig
*/
public function getFor($name)
{
if (isset($this->cache[$name])) {
return $this->cache[$name];
}
$handlers = $this->getHandlers(self::KEY_ALWAYS_LOADED);
$handlers = array_merge($handlers, $this->getHandlers($name));
return new Logger($name, $handlers);
if ($name !== self::KEY_ALWAYS_LOADED) {
$handlers = array_merge($handlers, $this->getHandlers($name));
}
$logger = new Logger($name, $handlers);
ErrorHandler::register($logger);
$this->cache[$name] = $logger;
return $logger;
}
/**
* Return an array of enabled log handlers.
* @param $key
* @return array|mixed
*/
protected function getHandlers($key)
{
$handlers = array();

View file

@ -13,6 +13,10 @@ use Monolog\Handler\AbstractProcessingHandler;
use Psr\Log\LogLevel;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class OutputLogHandler outputs the build log to the terminal.
* @package PHPCI\Logging
*/
class OutputLogHandler extends AbstractProcessingHandler
{
/**
@ -20,6 +24,11 @@ class OutputLogHandler extends AbstractProcessingHandler
*/
protected $output;
/**
* @param OutputInterface $output
* @param bool|string $level
* @param bool $bubble
*/
public function __construct(
OutputInterface $output,
$level = LogLevel::INFO,
@ -29,6 +38,10 @@ class OutputLogHandler extends AbstractProcessingHandler
$this->output = $output;
}
/**
* Write a log entry to the terminal.
* @param array $record
*/
protected function write(array $record)
{
$this->output->writeln((string)$record['formatted']);

View file

@ -23,4 +23,4 @@ class ChangeBuildKeysMigration extends AbstractMigration
$project->renameColumn('ssh_private_key', 'git_key');
$project->renameColumn('ssh_public_key', 'public_key');
}
}
}

View file

@ -37,4 +37,4 @@ class ChooseBranch extends AbstractMigration
$project = $this->table('project');
$project->removeColumn('branch')->save();
}
}
}

View file

@ -9,11 +9,18 @@ class FixDatabaseColumns extends AbstractMigration
*/
public function up()
{
$dbAdapter = $this->getAdapter();
if ($dbAdapter instanceof \Phinx\Db\Adapter\PdoAdapter) {
$pdo = $dbAdapter->getConnection();
$pdo->exec('SET foreign_key_checks = 0');
}
$build = $this->table('build');
$build->changeColumn('project_id', 'integer', array('null' => false));
$build->changeColumn('commit_id', 'string', array('limit' => 50, 'null' => false));
$build->changeColumn('status', 'integer', array('null' => false));
$build->changeColumn('log', 'text', array('null' => true, 'default' => ''));
$build->changeColumn('log', 'text', array('null' => true));
$build->changeColumn('branch', 'string', array('limit' => 50, 'null' => false, 'default' => 'master'));
$build->changeColumn('created', 'datetime', array('null' => true));
$build->changeColumn('started', 'datetime', array('null' => true));
@ -45,5 +52,10 @@ class FixDatabaseColumns extends AbstractMigration
$user->changeColumn('hash', 'string', array('limit' => 250, 'null' => false));
$user->changeColumn('is_admin', 'integer', array('null' => false, 'default' => 0));
$user->changeColumn('name', 'string', array('limit' => 250, 'null' => false));
if ($dbAdapter instanceof \Phinx\Db\Adapter\PdoAdapter) {
$pdo = $dbAdapter->getConnection();
$pdo->exec('SET foreign_key_checks = 1');
}
}
}

View file

@ -0,0 +1,26 @@
<?php
use Phinx\Migration\AbstractMigration;
class ArchiveProject extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$project = $this->table('project');
$project->addColumn('archived', 'boolean');
$project->save();
}
/**
* Migrate Down.
*/
public function down()
{
$project = $this->table('project');
$project->removeColumn('archived');
$project->save();
}
}

View file

@ -0,0 +1,27 @@
<?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class FixColumnTypes extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
// Update the build log column to MEDIUMTEXT:
$build = $this->table('build');
$build->changeColumn('log', 'text', array(
'null' => true,
'limit' => MysqlAdapter::TEXT_MEDIUM,
));
// Update the build meta value column to MEDIUMTEXT:
$buildMeta = $this->table('build_meta');
$buildMeta->changeColumn('meta_value', 'text', array(
'null' => false,
'limit' => MysqlAdapter::TEXT_MEDIUM,
));
}
}

View file

@ -0,0 +1,30 @@
<?php
use Phinx\Migration\AbstractMigration;
class UniqueEmailAndNameUserFields extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$user_table = $this->table('user');
$user_table
->addIndex('email', array('unique' => true))
->addIndex('name', array('unique' => true))
->save();
}
/**
* Migrate Down.
*/
public function down()
{
$user_table = $this->table('user');
$user_table
->removeIndex('email', array('unique' => true))
->removeIndex('name', array('unique' => true))
->save();
}
}

View file

@ -0,0 +1,29 @@
<?php
use Phinx\Migration\AbstractMigration;
class AddProjectGroups extends AbstractMigration
{
public function change()
{
$table = $this->table('project_group');
$table->addColumn('title', 'string', array('limit' => 100, 'null' => false));
$table->save();
$group = new \PHPCI\Model\ProjectGroup();
$group->setTitle('Projects');
/** @var \PHPCI\Model\ProjectGroup $group */
$group = \b8\Store\Factory::getStore('ProjectGroup')->save($group);
$table = $this->table('project');
$table->addColumn('group_id', 'integer', array(
'signed' => true,
'null' => false,
'default' => $group->getId(),
));
$table->addForeignKey('group_id', 'project_group', 'id', array('delete'=> 'RESTRICT', 'update' => 'CASCADE'));
$table->save();
}
}

View file

@ -0,0 +1,40 @@
<?php
use Phinx\Migration\AbstractMigration;
class RemoveUniqueNameIndex extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$user = $this->table('user');
if ($user->hasIndex('name', array('unique' => true))) {
$user->removeIndex('name', array('unique' => true));
$user->save();
}
$user->addIndex('name', array('unique' => false));
$user->save();
}
}

View file

@ -0,0 +1,24 @@
<?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class ErrorsTable extends AbstractMigration
{
public function change()
{
$table = $this->table('build_error');
$table->addColumn('build_id', 'integer', array('signed' => true));
$table->addColumn('plugin', 'string', array('limit' => 100));
$table->addColumn('file', 'string', array('limit' => 250, 'null' => true));
$table->addColumn('line_start', 'integer', array('signed' => false, 'null' => true));
$table->addColumn('line_end', 'integer', array('signed' => false, 'null' => true));
$table->addColumn('severity', 'integer', array('signed' => false, 'limit' => MysqlAdapter::INT_TINY));
$table->addColumn('message', 'string', array('limit' => 250));
$table->addColumn('created_date', 'datetime');
$table->addIndex(array('build_id', 'created_date'), array('unique' => false));
$table->addForeignKey('build_id', 'build', 'id', array('delete'=> 'CASCADE', 'update' => 'CASCADE'));
$table->save();
}
}

View file

@ -0,0 +1,183 @@
<?php
use Phinx\Migration\AbstractMigration;
use PHPCI\Model\BuildMeta;
use PHPCI\Model\BuildError;
class ConvertErrors extends AbstractMigration
{
/**
* @var \PHPCI\Store\BuildMetaStore
*/
protected $metaStore;
/**
* @var \PHPCI\Store\BuildErrorStore
*/
protected $errorStore;
public function change()
{
$count = 100;
$this->metaStore = \b8\Store\Factory::getStore('BuildMeta');
$this->errorStore = \b8\Store\Factory::getStore('BuildError');
while ($count == 100) {
$data = $this->metaStore->getErrorsForUpgrade(100);
$count = count($data);
/** @var \PHPCI\Model\BuildMeta $meta */
foreach ($data as $meta) {
try {
switch ($meta->getMetaKey()) {
case 'phpmd-data':
$this->processPhpMdMeta($meta);
break;
case 'phpcs-data':
$this->processPhpCsMeta($meta);
break;
case 'phpdoccheck-data':
$this->processPhpDocCheckMeta($meta);
break;
case 'phpcpd-data':
$this->processPhpCpdMeta($meta);
break;
case 'technicaldebt-data':
$this->processTechnicalDebtMeta($meta);
break;
}
} catch (\Exception $ex) {}
$this->metaStore->delete($meta);
}
}
}
protected function processPhpMdMeta(BuildMeta $meta)
{
$data = json_decode($meta->getMetaValue(), true);
if (is_array($data) && count($data)) {
foreach ($data as $error) {
$buildError = new BuildError();
$buildError->setBuildId($meta->getBuildId());
$buildError->setPlugin('php_mess_detector');
$buildError->setCreatedDate(new \DateTime());
$buildError->setFile($error['file']);
$buildError->setLineStart($error['line_start']);
$buildError->setLineEnd($error['line_end']);
$buildError->setSeverity(BuildError::SEVERITY_HIGH);
$buildError->setMessage($error['message']);
$this->errorStore->save($buildError);
}
}
}
protected function processPhpCsMeta(BuildMeta $meta)
{
$data = json_decode($meta->getMetaValue(), true);
if (is_array($data) && count($data)) {
foreach ($data as $error) {
$buildError = new BuildError();
$buildError->setBuildId($meta->getBuildId());
$buildError->setPlugin('php_code_sniffer');
$buildError->setCreatedDate(new \DateTime());
$buildError->setFile($error['file']);
$buildError->setLineStart($error['line']);
$buildError->setLineEnd($error['line']);
$buildError->setMessage($error['message']);
switch ($error['type']) {
case 'ERROR':
$buildError->setSeverity(BuildError::SEVERITY_HIGH);
break;
case 'WARNING':
$buildError->setSeverity(BuildError::SEVERITY_LOW);
break;
}
$this->errorStore->save($buildError);
}
}
}
protected function processPhpDocCheckMeta(BuildMeta $meta)
{
$data = json_decode($meta->getMetaValue(), true);
if (is_array($data) && count($data)) {
foreach ($data as $error) {
$buildError = new BuildError();
$buildError->setBuildId($meta->getBuildId());
$buildError->setPlugin('php_docblock_checker');
$buildError->setCreatedDate(new \DateTime());
$buildError->setFile($error['file']);
$buildError->setLineStart($error['line']);
$buildError->setLineEnd($error['line']);
switch ($error['type']) {
case 'method':
$buildError->setMessage($error['class'] . '::' . $error['method'] . ' is missing a docblock.');
$buildError->setSeverity(BuildError::SEVERITY_NORMAL);
break;
case 'class':
$buildError->setMessage('Class ' . $error['class'] . ' is missing a docblock.');
$buildError->setSeverity(BuildError::SEVERITY_LOW);
break;
}
$this->errorStore->save($buildError);
}
}
}
protected function processPhpCpdMeta(BuildMeta $meta)
{
$data = json_decode($meta->getMetaValue(), true);
if (is_array($data) && count($data)) {
foreach ($data as $error) {
$buildError = new BuildError();
$buildError->setBuildId($meta->getBuildId());
$buildError->setPlugin('php_cpd');
$buildError->setCreatedDate(new \DateTime());
$buildError->setFile($error['file']);
$buildError->setLineStart($error['line_start']);
$buildError->setLineEnd($error['line_end']);
$buildError->setSeverity(BuildError::SEVERITY_NORMAL);
$buildError->setMessage('Copy and paste detected.');
$this->errorStore->save($buildError);
}
}
}
protected function processTechnicalDebtMeta(BuildMeta $meta)
{
$data = json_decode($meta->getMetaValue(), true);
if (is_array($data) && count($data)) {
foreach ($data as $error) {
$buildError = new BuildError();
$buildError->setBuildId($meta->getBuildId());
$buildError->setPlugin('technical_debt');
$buildError->setCreatedDate(new \DateTime());
$buildError->setFile($error['file']);
$buildError->setLineStart($error['line']);
$buildError->setSeverity(BuildError::SEVERITY_NORMAL);
$buildError->setMessage($error['message']);
$this->errorStore->save($buildError);
}
}
}
}

View file

@ -0,0 +1,18 @@
<?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class ProjectTableDefaults extends AbstractMigration
{
public function change()
{
$this->table('project')
->changeColumn('build_config', MysqlAdapter::PHINX_TYPE_TEXT, array('null' => true))
->changeColumn('archived', MysqlAdapter::PHINX_TYPE_INTEGER, array(
'length' => MysqlAdapter::INT_TINY,
'default' => 0,
))
->save();
}
}

View file

@ -9,6 +9,10 @@
namespace PHPCI;
/**
* PHPCI Base Model.
* @package PHPCI
*/
abstract class Model extends \b8\Model
{

View file

@ -110,16 +110,15 @@ class BuildBase extends Model
'commit_id' => array(
'type' => 'varchar',
'length' => 50,
'nullable' => true,
'default' => null,
),
'status' => array(
'type' => 'tinyint',
'length' => 4,
'type' => 'int',
'length' => 11,
'default' => null,
),
'log' => array(
'type' => 'longtext',
'type' => 'mediumtext',
'nullable' => true,
'default' => null,
),
@ -155,7 +154,7 @@ class BuildBase extends Model
'default' => null,
),
'extra' => array(
'type' => 'longtext',
'type' => 'text',
'nullable' => true,
'default' => null,
),
@ -382,10 +381,12 @@ class BuildBase extends Model
/**
* Set the value of CommitId / commit_id.
*
* Must not be null.
* @param $value string
*/
public function setCommitId($value)
{
$this->_validateNotNull('CommitId', $value);
$this->_validateString('CommitId', $value);
if ($this->data['commit_id'] === $value) {
@ -620,6 +621,18 @@ class BuildBase extends Model
return $this->setProjectId($value->getId());
}
/**
* Get BuildError models by BuildId for this Build.
*
* @uses \PHPCI\Store\BuildErrorStore::getByBuildId()
* @uses \PHPCI\Model\BuildError
* @return \PHPCI\Model\BuildError[]
*/
public function getBuildBuildErrors()
{
return Factory::getStore('BuildError', 'PHPCI')->getByBuildId($this->getId());
}
/**
* Get BuildMeta models by BuildId for this Build.
*

View file

@ -0,0 +1,503 @@
<?php
/**
* BuildError base model for table: build_error
*/
namespace PHPCI\Model\Base;
use PHPCI\Model;
use b8\Store\Factory;
/**
* BuildError Base Model
*/
class BuildErrorBase extends Model
{
/**
* @var array
*/
public static $sleepable = array();
/**
* @var string
*/
protected $tableName = 'build_error';
/**
* @var string
*/
protected $modelName = 'BuildError';
/**
* @var array
*/
protected $data = array(
'id' => null,
'build_id' => null,
'plugin' => null,
'file' => null,
'line_start' => null,
'line_end' => null,
'severity' => null,
'message' => null,
'created_date' => null,
);
/**
* @var array
*/
protected $getters = array(
// Direct property getters:
'id' => 'getId',
'build_id' => 'getBuildId',
'plugin' => 'getPlugin',
'file' => 'getFile',
'line_start' => 'getLineStart',
'line_end' => 'getLineEnd',
'severity' => 'getSeverity',
'message' => 'getMessage',
'created_date' => 'getCreatedDate',
// Foreign key getters:
'Build' => 'getBuild',
);
/**
* @var array
*/
protected $setters = array(
// Direct property setters:
'id' => 'setId',
'build_id' => 'setBuildId',
'plugin' => 'setPlugin',
'file' => 'setFile',
'line_start' => 'setLineStart',
'line_end' => 'setLineEnd',
'severity' => 'setSeverity',
'message' => 'setMessage',
'created_date' => 'setCreatedDate',
// Foreign key setters:
'Build' => 'setBuild',
);
/**
* @var array
*/
public $columns = array(
'id' => array(
'type' => 'int',
'length' => 11,
'primary_key' => true,
'auto_increment' => true,
'default' => null,
),
'build_id' => array(
'type' => 'int',
'length' => 11,
'default' => null,
),
'plugin' => array(
'type' => 'varchar',
'length' => 100,
'default' => null,
),
'file' => array(
'type' => 'varchar',
'length' => 250,
'nullable' => true,
'default' => null,
),
'line_start' => array(
'type' => 'int',
'length' => 11,
'nullable' => true,
'default' => null,
),
'line_end' => array(
'type' => 'int',
'length' => 11,
'nullable' => true,
'default' => null,
),
'severity' => array(
'type' => 'tinyint',
'length' => 3,
'default' => null,
),
'message' => array(
'type' => 'varchar',
'length' => 250,
'default' => null,
),
'created_date' => array(
'type' => 'datetime',
'default' => null,
),
);
/**
* @var array
*/
public $indexes = array(
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
'build_id' => array('columns' => 'build_id, created_date'),
);
/**
* @var array
*/
public $foreignKeys = array(
'build_error_ibfk_1' => array(
'local_col' => 'build_id',
'update' => 'CASCADE',
'delete' => 'CASCADE',
'table' => 'build',
'col' => 'id'
),
);
/**
* Get the value of Id / id.
*
* @return int
*/
public function getId()
{
$rtn = $this->data['id'];
return $rtn;
}
/**
* Get the value of BuildId / build_id.
*
* @return int
*/
public function getBuildId()
{
$rtn = $this->data['build_id'];
return $rtn;
}
/**
* Get the value of Plugin / plugin.
*
* @return string
*/
public function getPlugin()
{
$rtn = $this->data['plugin'];
return $rtn;
}
/**
* Get the value of File / file.
*
* @return string
*/
public function getFile()
{
$rtn = $this->data['file'];
return $rtn;
}
/**
* Get the value of LineStart / line_start.
*
* @return int
*/
public function getLineStart()
{
$rtn = $this->data['line_start'];
return $rtn;
}
/**
* Get the value of LineEnd / line_end.
*
* @return int
*/
public function getLineEnd()
{
$rtn = $this->data['line_end'];
return $rtn;
}
/**
* Get the value of Severity / severity.
*
* @return int
*/
public function getSeverity()
{
$rtn = $this->data['severity'];
return $rtn;
}
/**
* Get the value of Message / message.
*
* @return string
*/
public function getMessage()
{
$rtn = $this->data['message'];
return $rtn;
}
/**
* Get the value of CreatedDate / created_date.
*
* @return \DateTime
*/
public function getCreatedDate()
{
$rtn = $this->data['created_date'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
}
/**
* Set the value of Id / id.
*
* Must not be null.
* @param $value int
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
}
$this->data['id'] = $value;
$this->_setModified('id');
}
/**
* Set the value of BuildId / build_id.
*
* Must not be null.
* @param $value int
*/
public function setBuildId($value)
{
$this->_validateNotNull('BuildId', $value);
$this->_validateInt('BuildId', $value);
if ($this->data['build_id'] === $value) {
return;
}
$this->data['build_id'] = $value;
$this->_setModified('build_id');
}
/**
* Set the value of Plugin / plugin.
*
* Must not be null.
* @param $value string
*/
public function setPlugin($value)
{
$this->_validateNotNull('Plugin', $value);
$this->_validateString('Plugin', $value);
if ($this->data['plugin'] === $value) {
return;
}
$this->data['plugin'] = $value;
$this->_setModified('plugin');
}
/**
* Set the value of File / file.
*
* @param $value string
*/
public function setFile($value)
{
$this->_validateString('File', $value);
if ($this->data['file'] === $value) {
return;
}
$this->data['file'] = $value;
$this->_setModified('file');
}
/**
* Set the value of LineStart / line_start.
*
* @param $value int
*/
public function setLineStart($value)
{
$this->_validateInt('LineStart', $value);
if ($this->data['line_start'] === $value) {
return;
}
$this->data['line_start'] = $value;
$this->_setModified('line_start');
}
/**
* Set the value of LineEnd / line_end.
*
* @param $value int
*/
public function setLineEnd($value)
{
$this->_validateInt('LineEnd', $value);
if ($this->data['line_end'] === $value) {
return;
}
$this->data['line_end'] = $value;
$this->_setModified('line_end');
}
/**
* Set the value of Severity / severity.
*
* Must not be null.
* @param $value int
*/
public function setSeverity($value)
{
$this->_validateNotNull('Severity', $value);
$this->_validateInt('Severity', $value);
if ($this->data['severity'] === $value) {
return;
}
$this->data['severity'] = $value;
$this->_setModified('severity');
}
/**
* Set the value of Message / message.
*
* Must not be null.
* @param $value string
*/
public function setMessage($value)
{
$this->_validateNotNull('Message', $value);
$this->_validateString('Message', $value);
if ($this->data['message'] === $value) {
return;
}
$this->data['message'] = $value;
$this->_setModified('message');
}
/**
* Set the value of CreatedDate / created_date.
*
* Must not be null.
* @param $value \DateTime
*/
public function setCreatedDate($value)
{
$this->_validateNotNull('CreatedDate', $value);
$this->_validateDate('CreatedDate', $value);
if ($this->data['created_date'] === $value) {
return;
}
$this->data['created_date'] = $value;
$this->_setModified('created_date');
}
/**
* Get the Build model for this BuildError by Id.
*
* @uses \PHPCI\Store\BuildStore::getById()
* @uses \PHPCI\Model\Build
* @return \PHPCI\Model\Build
*/
public function getBuild()
{
$key = $this->getBuildId();
if (empty($key)) {
return null;
}
$cacheKey = 'Cache.Build.' . $key;
$rtn = $this->cache->get($cacheKey, null);
if (empty($rtn)) {
$rtn = Factory::getStore('Build', 'PHPCI')->getById($key);
$this->cache->set($cacheKey, $rtn);
}
return $rtn;
}
/**
* Set Build - Accepts an ID, an array representing a Build or a Build model.
*
* @param $value mixed
*/
public function setBuild($value)
{
// Is this an instance of Build?
if ($value instanceof \PHPCI\Model\Build) {
return $this->setBuildObject($value);
}
// Is this an array representing a Build item?
if (is_array($value) && !empty($value['id'])) {
return $this->setBuildId($value['id']);
}
// Is this a scalar value representing the ID of this foreign key?
return $this->setBuildId($value);
}
/**
* Set Build - Accepts a Build model.
*
* @param $value \PHPCI\Model\Build
*/
public function setBuildObject(\PHPCI\Model\Build $value)
{
return $this->setBuildId($value->getId());
}
}

View file

@ -91,17 +91,15 @@ class BuildMetaBase extends Model
'build_id' => array(
'type' => 'int',
'length' => 11,
'nullable' => true,
'default' => null,
),
'meta_key' => array(
'type' => 'varchar',
'length' => 255,
'length' => 250,
'default' => null,
),
'meta_value' => array(
'type' => 'longtext',
'nullable' => true,
'type' => 'mediumtext',
'default' => null,
),
);
@ -238,10 +236,12 @@ class BuildMetaBase extends Model
/**
* Set the value of BuildId / build_id.
*
* Must not be null.
* @param $value int
*/
public function setBuildId($value)
{
$this->_validateNotNull('BuildId', $value);
$this->_validateInt('BuildId', $value);
if ($this->data['build_id'] === $value) {
@ -276,10 +276,12 @@ class BuildMetaBase extends Model
/**
* Set the value of MetaValue / meta_value.
*
* Must not be null.
* @param $value string
*/
public function setMetaValue($value)
{
$this->_validateNotNull('MetaValue', $value);
$this->_validateString('MetaValue', $value);
if ($this->data['meta_value'] === $value) {

View file

@ -38,12 +38,14 @@ class ProjectBase extends Model
'reference' => null,
'branch' => null,
'ssh_private_key' => null,
'ssh_public_key' => null,
'type' => null,
'access_information' => null,
'last_commit' => null,
'build_config' => null,
'ssh_public_key' => null,
'allow_public_status' => null,
'archived' => null,
'group_id' => null,
);
/**
@ -56,14 +58,17 @@ class ProjectBase extends Model
'reference' => 'getReference',
'branch' => 'getBranch',
'ssh_private_key' => 'getSshPrivateKey',
'ssh_public_key' => 'getSshPublicKey',
'type' => 'getType',
'access_information' => 'getAccessInformation',
'last_commit' => 'getLastCommit',
'build_config' => 'getBuildConfig',
'ssh_public_key' => 'getSshPublicKey',
'allow_public_status' => 'getAllowPublicStatus',
'archived' => 'getArchived',
'group_id' => 'getGroupId',
// Foreign key getters:
'Group' => 'getGroup',
);
/**
@ -76,14 +81,17 @@ class ProjectBase extends Model
'reference' => 'setReference',
'branch' => 'setBranch',
'ssh_private_key' => 'setSshPrivateKey',
'ssh_public_key' => 'setSshPublicKey',
'type' => 'setType',
'access_information' => 'setAccessInformation',
'last_commit' => 'setLastCommit',
'build_config' => 'setBuildConfig',
'ssh_public_key' => 'setSshPublicKey',
'allow_public_status' => 'setAllowPublicStatus',
'archived' => 'setArchived',
'group_id' => 'setGroupId',
// Foreign key setters:
'Group' => 'setGroup',
);
/**
@ -109,23 +117,18 @@ class ProjectBase extends Model
),
'branch' => array(
'type' => 'varchar',
'length' => 250,
'default' => null,
'length' => 50,
'default' => 'master',
),
'ssh_private_key' => array(
'type' => 'text',
'nullable' => true,
'default' => null,
),
'ssh_public_key' => array(
'type' => 'text',
'nullable' => true,
'default' => null,
),
'type' => array(
'type' => 'varchar',
'length' => 50,
'default' => 1,
'default' => null,
),
'access_information' => array(
'type' => 'varchar',
@ -144,9 +147,24 @@ class ProjectBase extends Model
'nullable' => true,
'default' => null,
),
'ssh_public_key' => array(
'type' => 'text',
'nullable' => true,
'default' => null,
),
'allow_public_status' => array(
'type' => 'int',
'length' => 11,
),
'archived' => array(
'type' => 'tinyint',
'length' => 4,
'length' => 1,
'default' => null,
),
'group_id' => array(
'type' => 'int',
'length' => 11,
'default' => 1,
),
);
@ -156,12 +174,20 @@ class ProjectBase extends Model
public $indexes = array(
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
'idx_project_title' => array('columns' => 'title'),
'group_id' => array('columns' => 'group_id'),
);
/**
* @var array
*/
public $foreignKeys = array(
'project_ibfk_1' => array(
'local_col' => 'group_id',
'update' => 'CASCADE',
'delete' => '',
'table' => 'project_group',
'col' => 'id'
),
);
/**
@ -224,18 +250,6 @@ class ProjectBase extends Model
return $rtn;
}
/**
* Get the value of SshPublicKey / ssh_public_key.
*
* @return string
*/
public function getSshPublicKey()
{
$rtn = $this->data['ssh_public_key'];
return $rtn;
}
/**
* Get the value of Type / type.
*
@ -284,6 +298,18 @@ class ProjectBase extends Model
return $rtn;
}
/**
* Get the value of SshPublicKey / ssh_public_key.
*
* @return string
*/
public function getSshPublicKey()
{
$rtn = $this->data['ssh_public_key'];
return $rtn;
}
/**
* Get the value of AllowPublicStatus / allow_public_status.
*
@ -296,6 +322,30 @@ class ProjectBase extends Model
return $rtn;
}
/**
* Get the value of Archived / archived.
*
* @return int
*/
public function getArchived()
{
$rtn = $this->data['archived'];
return $rtn;
}
/**
* Get the value of GroupId / group_id.
*
* @return int
*/
public function getGroupId()
{
$rtn = $this->data['group_id'];
return $rtn;
}
/**
* Set the value of Id / id.
*
@ -394,24 +444,6 @@ class ProjectBase extends Model
$this->_setModified('ssh_private_key');
}
/**
* Set the value of SshPublicKey / ssh_public_key.
*
* @param $value string
*/
public function setSshPublicKey($value)
{
$this->_validateString('SshPublicKey', $value);
if ($this->data['ssh_public_key'] === $value) {
return;
}
$this->data['ssh_public_key'] = $value;
$this->_setModified('ssh_public_key');
}
/**
* Set the value of Type / type.
*
@ -486,6 +518,24 @@ class ProjectBase extends Model
$this->_setModified('build_config');
}
/**
* Set the value of SshPublicKey / ssh_public_key.
*
* @param $value string
*/
public function setSshPublicKey($value)
{
$this->_validateString('SshPublicKey', $value);
if ($this->data['ssh_public_key'] === $value) {
return;
}
$this->data['ssh_public_key'] = $value;
$this->_setModified('ssh_public_key');
}
/**
* Set the value of AllowPublicStatus / allow_public_status.
*
@ -506,6 +556,103 @@ class ProjectBase extends Model
$this->_setModified('allow_public_status');
}
/**
* Set the value of Archived / archived.
*
* Must not be null.
* @param $value int
*/
public function setArchived($value)
{
$this->_validateNotNull('Archived', $value);
$this->_validateInt('Archived', $value);
if ($this->data['archived'] === $value) {
return;
}
$this->data['archived'] = $value;
$this->_setModified('archived');
}
/**
* Set the value of GroupId / group_id.
*
* Must not be null.
* @param $value int
*/
public function setGroupId($value)
{
$this->_validateNotNull('GroupId', $value);
$this->_validateInt('GroupId', $value);
if ($this->data['group_id'] === $value) {
return;
}
$this->data['group_id'] = $value;
$this->_setModified('group_id');
}
/**
* Get the ProjectGroup model for this Project by Id.
*
* @uses \PHPCI\Store\ProjectGroupStore::getById()
* @uses \PHPCI\Model\ProjectGroup
* @return \PHPCI\Model\ProjectGroup
*/
public function getGroup()
{
$key = $this->getGroupId();
if (empty($key)) {
return null;
}
$cacheKey = 'Cache.ProjectGroup.' . $key;
$rtn = $this->cache->get($cacheKey, null);
if (empty($rtn)) {
$rtn = Factory::getStore('ProjectGroup', 'PHPCI')->getById($key);
$this->cache->set($cacheKey, $rtn);
}
return $rtn;
}
/**
* Set Group - Accepts an ID, an array representing a ProjectGroup or a ProjectGroup model.
*
* @param $value mixed
*/
public function setGroup($value)
{
// Is this an instance of ProjectGroup?
if ($value instanceof \PHPCI\Model\ProjectGroup) {
return $this->setGroupObject($value);
}
// Is this an array representing a ProjectGroup item?
if (is_array($value) && !empty($value['id'])) {
return $this->setGroupId($value['id']);
}
// Is this a scalar value representing the ID of this foreign key?
return $this->setGroupId($value);
}
/**
* Set Group - Accepts a ProjectGroup model.
*
* @param $value \PHPCI\Model\ProjectGroup
*/
public function setGroupObject(\PHPCI\Model\ProjectGroup $value)
{
return $this->setGroupId($value->getId());
}
/**
* Get Build models by ProjectId for this Project.
*

View file

@ -0,0 +1,168 @@
<?php
/**
* ProjectGroup base model for table: project_group
*/
namespace PHPCI\Model\Base;
use PHPCI\Model;
use b8\Store\Factory;
/**
* ProjectGroup Base Model
*/
class ProjectGroupBase extends Model
{
/**
* @var array
*/
public static $sleepable = array();
/**
* @var string
*/
protected $tableName = 'project_group';
/**
* @var string
*/
protected $modelName = 'ProjectGroup';
/**
* @var array
*/
protected $data = array(
'id' => null,
'title' => null,
);
/**
* @var array
*/
protected $getters = array(
// Direct property getters:
'id' => 'getId',
'title' => 'getTitle',
// Foreign key getters:
);
/**
* @var array
*/
protected $setters = array(
// Direct property setters:
'id' => 'setId',
'title' => 'setTitle',
// Foreign key setters:
);
/**
* @var array
*/
public $columns = array(
'id' => array(
'type' => 'int',
'length' => 11,
'primary_key' => true,
'auto_increment' => true,
'default' => null,
),
'title' => array(
'type' => 'varchar',
'length' => 100,
'default' => null,
),
);
/**
* @var array
*/
public $indexes = array(
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
);
/**
* @var array
*/
public $foreignKeys = array(
);
/**
* Get the value of Id / id.
*
* @return int
*/
public function getId()
{
$rtn = $this->data['id'];
return $rtn;
}
/**
* Get the value of Title / title.
*
* @return string
*/
public function getTitle()
{
$rtn = $this->data['title'];
return $rtn;
}
/**
* Set the value of Id / id.
*
* Must not be null.
* @param $value int
*/
public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
}
$this->data['id'] = $value;
$this->_setModified('id');
}
/**
* Set the value of Title / title.
*
* Must not be null.
* @param $value string
*/
public function setTitle($value)
{
$this->_validateNotNull('Title', $value);
$this->_validateString('Title', $value);
if ($this->data['title'] === $value) {
return;
}
$this->data['title'] = $value;
$this->_setModified('title');
}
/**
* Get Project models by GroupId for this ProjectGroup.
*
* @uses \PHPCI\Store\ProjectStore::getByGroupId()
* @uses \PHPCI\Model\Project
* @return \PHPCI\Model\Project[]
*/
public function getGroupProjects()
{
return Factory::getStore('Project', 'PHPCI')->getByGroupId($this->getId());
}
}

View file

@ -90,14 +90,12 @@ class UserBase extends Model
'default' => null,
),
'is_admin' => array(
'type' => 'tinyint',
'length' => 1,
'default' => null,
'type' => 'int',
'length' => 11,
),
'name' => array(
'type' => 'varchar',
'length' => 250,
'nullable' => true,
'default' => null,
),
);
@ -108,6 +106,8 @@ class UserBase extends Model
public $indexes = array(
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
'idx_email' => array('unique' => true, 'columns' => 'email'),
'email' => array('unique' => true, 'columns' => 'email'),
'name' => array('columns' => 'name'),
);
/**
@ -259,10 +259,12 @@ class UserBase extends Model
/**
* Set the value of Name / name.
*
* Must not be null.
* @param $value string
*/
public function setName($value)
{
$this->_validateNotNull('Name', $value);
$this->_validateString('Name', $value);
if ($this->data['name'] === $value) {

View file

@ -28,7 +28,7 @@ class Build extends BuildBase
const STATUS_SUCCESS = 2;
const STATUS_FAILED = 3;
public $currentBuildPath = null;
public $currentBuildPath;
/**
* Get link to commit from another source (i.e. Github)
@ -46,6 +46,10 @@ class Build extends BuildBase
return '#';
}
/**
* Return a template to use to generate a link to a specific file.
* @return null
*/
public function getFileLinkTemplate()
{
return null;
@ -95,16 +99,21 @@ class Build extends BuildBase
{
$build_config = null;
// Try phpci.yml first:
if (is_file($buildPath . '/phpci.yml')) {
$build_config = file_get_contents($buildPath . '/phpci.yml');
}
// Try getting the project build config from the database:
if (empty($build_config)) {
$build_config = $this->getProject()->getBuildConfig();
}
// Try .phpci.yml
if (is_file($buildPath . '/.phpci.yml')) {
$build_config = file_get_contents($buildPath . '/.phpci.yml');
}
// Try phpci.yml first:
if (empty($build_config) && is_file($buildPath . '/phpci.yml')) {
$build_config = file_get_contents($buildPath . '/phpci.yml');
}
// Fall back to zero config plugins:
if (empty($build_config)) {
$build_config = $this->getZeroConfigPlugins($builder);
@ -119,6 +128,11 @@ class Build extends BuildBase
return true;
}
/**
* Get an array of plugins to run if there's no phpci.yml file.
* @param Builder $builder
* @return array
*/
protected function getZeroConfigPlugins(Builder $builder)
{
$pluginDir = PHPCI_DIR . 'PHPCI/Plugin/';
@ -165,6 +179,11 @@ class Build extends BuildBase
return $config;
}
/**
* Return a value from the build's "extra" JSON array.
* @param null $key
* @return mixed|null|string
*/
public function getExtra($key = null)
{
$data = json_decode($this->data['extra'], true);
@ -179,4 +198,104 @@ class Build extends BuildBase
return $rtn;
}
/**
* Returns the commit message for this build.
* @return string
*/
public function getCommitMessage()
{
$rtn = htmlspecialchars($this->data['commit_message']);
return $rtn;
}
/**
* Allows specific build types (e.g. Github) to report violations back to their respective services.
* @param Builder $builder
* @param $plugin
* @param $message
* @param int $severity
* @param null $file
* @param null $lineStart
* @param null $lineEnd
* @return BuildError
*/
public function reportError(
Builder $builder,
$plugin,
$message,
$severity = BuildError::SEVERITY_NORMAL,
$file = null,
$lineStart = null,
$lineEnd = null
) {
unset($builder);
$error = new BuildError();
$error->setBuild($this);
$error->setCreatedDate(new \DateTime());
$error->setPlugin($plugin);
$error->setMessage($message);
$error->setSeverity($severity);
$error->setFile($file);
$error->setLineStart($lineStart);
$error->setLineEnd($lineEnd);
return Factory::getStore('BuildError')->save($error);
}
/**
* Return the path to run this build into.
*
* @return string|null
*/
public function getBuildPath()
{
if (!$this->getId()) {
return null;
}
if (empty($this->currentBuildPath)) {
$buildDirectory = $this->getId() . '_' . substr(md5(microtime(true)), 0, 5);
$this->currentBuildPath = PHPCI_BUILD_ROOT_DIR . $buildDirectory . DIRECTORY_SEPARATOR;
}
return $this->currentBuildPath;
}
/**
* Removes the build directory.
*/
public function removeBuildDirectory()
{
$buildPath = $this->getBuildPath();
if (!$buildPath || !is_dir($buildPath)) {
return;
}
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath));
}
/**
* Get the number of seconds a build has been running for.
* @return int
*/
public function getDuration()
{
$start = $this->getStarted();
if (empty($start)) {
return 0;
}
$end = $this->getFinished();
if (empty($end)) {
$end = new \DateTime();
}
return $end->getTimestamp() - $start->getTimestamp();
}
}

View file

@ -10,6 +10,8 @@
namespace PHPCI\Model\Build;
use PHPCI\Builder;
use PHPCI\Helper\Diff;
use PHPCI\Helper\Github;
use PHPCI\Model\Build\RemoteGitBuild;
/**
@ -43,39 +45,52 @@ class GithubBuild extends RemoteGitBuild
{
$token = \b8\Config::getInstance()->get('phpci.github.token');
if (empty($token)) {
if (empty($token) || empty($this->data['id'])) {
return;
}
$project = $this->getProject();
if (empty($project)) {
return;
}
$url = 'https://api.github.com/repos/'.$project->getReference().'/statuses/'.$this->getCommitId();
$http = new \b8\HttpClient();
switch($this->getStatus())
{
switch ($this->getStatus()) {
case 0:
case 1:
$status = 'pending';
$description = 'PHPCI build running.';
break;
case 2:
$status = 'success';
$description = 'PHPCI build passed.';
break;
case 3:
$status = 'failure';
$description = 'PHPCI build failed.';
break;
default:
$status = 'error';
$description = 'PHPCI build failed to complete.';
break;
}
$phpciUrl = \b8\Config::getInstance()->get('phpci.url');
$params = array( 'state' => $status,
'target_url' => $phpciUrl . '/build/view/' . $this->getId());
$params = array(
'state' => $status,
'target_url' => $phpciUrl . '/build/view/' . $this->getId(),
'description' => $description,
'context' => 'PHPCI',
);
$headers = array(
'Authorization: token ' . $token,
'Content-Type: application/x-www-form-urlencoded'
);
);
$http->setHeaders($headers);
$http->request('POST', $url, json_encode($params));
@ -95,18 +110,31 @@ class GithubBuild extends RemoteGitBuild
}
}
/**
* Get a parsed version of the commit message, with links to issues and commits.
* @return string
*/
public function getCommitMessage()
{
$rtn = $this->data['commit_message'];
$rtn = parent::getCommitMessage($this->data['commit_message']);
$reference = $this->getProject()->getReference();
$commitLink = '<a target="_blank" href="https://github.com/' . $reference . '/issues/$1">#$1</a>';
$rtn = preg_replace('/\#([0-9]+)/', $commitLink, $rtn);
$rtn = preg_replace('/\@([a-zA-Z0-9_]+)/', '<a target="_blank" href="https://github.com/$1">@$1</a>', $rtn);
$project = $this->getProject();
if (!is_null($project)) {
$reference = $project->getReference();
$commitLink = '<a target="_blank" href="https://github.com/' . $reference . '/issues/$1">#$1</a>';
$rtn = preg_replace('/\#([0-9]+)/', $commitLink, $rtn);
$rtn = preg_replace('/\@([a-zA-Z0-9_]+)/', '<a target="_blank" href="https://github.com/$1">@$1</a>', $rtn);
}
return $rtn;
}
/**
* Get a template to use for generating links to files.
* e.g. https://github.com/block8/phpci/blob/master/{FILE}#L{LINE}
* @return string
*/
public function getFileLinkTemplate()
{
$reference = $this->getProject()->getReference();
@ -114,7 +142,7 @@ class GithubBuild extends RemoteGitBuild
if ($this->getExtra('build_type') == 'pull_request') {
$matches = array();
preg_match('/\/([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
preg_match('/[\/:]([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
$reference = $matches[1];
$branch = $this->getExtra('remote_branch');
@ -123,11 +151,17 @@ class GithubBuild extends RemoteGitBuild
$link = 'https://github.com/' . $reference . '/';
$link .= 'blob/' . $branch . '/';
$link .= '{FILE}';
$link .= '#L{LINE}';
$link .= '#L{LINE}-L{LINE_END}';
return $link;
}
/**
* Handle any post-clone tasks, like applying a pull request patch on top of the branch.
* @param Builder $builder
* @param $cloneTo
* @return bool
*/
protected function postCloneSetup(Builder $builder, $cloneTo)
{
$buildType = $this->getExtra('build_type');
@ -152,4 +186,69 @@ class GithubBuild extends RemoteGitBuild
return $success;
}
/**
* @inheritDoc
*/
public function reportError(
Builder $builder,
$plugin,
$message,
$severity = BuildError::SEVERITY_NORMAL,
$file = null,
$lineStart = null,
$lineEnd = null
) {
$diffLineNumber = $this->getDiffLineNumber($builder, $file, $lineStart);
if (!is_null($diffLineNumber)) {
$helper = new Github();
$repo = $this->getProject()->getReference();
$prNumber = $this->getExtra('pull_request_number');
$commit = $this->getCommitId();
if (!empty($prNumber)) {
$helper->createPullRequestComment($repo, $prNumber, $commit, $file, $diffLineNumber, $message);
} else {
$helper->createCommitComment($repo, $commit, $file, $diffLineNumber, $message);
}
}
return parent::reportError($builder, $plugin, $message, $severity, $file, $lineStart, $lineEnd);
}
/**
* Uses git diff to figure out what the diff line position is, based on the error line number.
* @param Builder $builder
* @param $file
* @param $line
* @return int|null
*/
protected function getDiffLineNumber(Builder $builder, $file, $line)
{
$line = (integer)$line;
$builder->logExecOutput(false);
$prNumber = $this->getExtra('pull_request_number');
$path = $builder->buildPath;
if (!empty($prNumber)) {
$builder->executeCommand('cd %s && git diff origin/%s "%s"', $path, $this->getBranch(), $file);
} else {
$commitId = $this->getCommitId();
$compare = $commitId == 'Manual' ? 'HEAD' : $commitId;
$builder->executeCommand('cd %s && git diff %s^^ "%s"', $path, $compare, $file);
}
$builder->logExecOutput(true);
$diff = $builder->getLastOutput();
$helper = new Diff();
$lines = $helper->getLinePositions($diff);
return isset($lines[$line]) ? $lines[$line] : null;
}
}

View file

@ -47,7 +47,7 @@ class GitlabBuild extends RemoteGitBuild
'http://%s/%s/blob/%s/{FILE}#L{LINE}',
$this->getProject()->getAccessInformation("domain"),
$this->getProject()->getReference(),
$this->getBranch()
$this->getCommitId()
);
}

View file

@ -35,12 +35,14 @@ class LocalBuild extends Build
return $this->handleConfig($builder, $buildPath) !== false;
}
$buildSettings = $this->handleConfig($builder, $reference);
$configHandled = $this->handleConfig($builder, $reference);
if ($buildSettings === false) {
if ($configHandled === false) {
return false;
}
$buildSettings = $builder->getConfig('build_settings');
if (isset($buildSettings['prefer_symlink']) && $buildSettings['prefer_symlink'] === true) {
return $this->handleSymlink($builder, $reference, $buildPath);
} else {
@ -54,6 +56,13 @@ class LocalBuild extends Build
return true;
}
/**
* Check if this is a "bare" git repository, and if so, unarchive it.
* @param Builder $builder
* @param $reference
* @param $buildPath
* @return bool
*/
protected function handleBareRepository(Builder $builder, $reference, $buildPath)
{
$gitConfig = parse_ini_file($reference.'/config', true);
@ -68,6 +77,13 @@ class LocalBuild extends Build
return false;
}
/**
* Create a symlink if required.
* @param Builder $builder
* @param $reference
* @param $buildPath
* @return bool
*/
protected function handleSymlink(Builder $builder, $reference, $buildPath)
{
if (is_link($buildPath) && is_file($buildPath)) {

View file

@ -13,36 +13,87 @@ use PHPCI\Model\Build;
use PHPCI\Builder;
/**
* Mercurial Build Model
* @author Pavel Gopanenko <pavelgopanenko@gmail.com>
* @package PHPCI
* @subpackage Core
*/
* Mercurial Build Model
* @author Pavel Gopanenko <pavelgopanenko@gmail.com>
* @package PHPCI
* @subpackage Core
*/
class MercurialBuild extends Build
{
/**
* Get the URL to be used to clone this remote repository.
*/
* Get the URL to be used to clone this remote repository.
*/
protected function getCloneUrl()
{
return $this->getProject()->getReference();
}
/**
* Create a working copy by cloning, copying, or similar.
*/
* Create a working copy by cloning, copying, or similar.
*/
public function createWorkingCopy(Builder $builder, $buildPath)
{
$this->cloneByHttp($builder, $buildPath);
$key = trim($this->getProject()->getSshPublicKey());
if (!empty($key) && strpos($this->getProject()->getReference(), 'ssh') > -1) {
$success = $this->cloneBySsh($builder, $buildPath);
} else {
$success = $this->cloneByHttp($builder, $buildPath);
}
if (!$success) {
$builder->logFailure('Failed to clone remote git repository.');
return false;
}
return $this->handleConfig($builder, $buildPath);
}
/**
* Use an mercurial clone.
*/
* Use a HTTP-based Mercurial clone.
*/
protected function cloneByHttp(Builder $builder, $cloneTo)
{
return $builder->executeCommand('hg clone %s "%s" -r %s', $this->getCloneUrl(), $cloneTo, $this->getBranch());
}
/**
* Use an SSH-based Mercurial clone.
*/
protected function cloneBySsh(Builder $builder, $cloneTo)
{
$keyFile = $this->writeSshKey();
// Do the git clone:
$cmd = 'hg clone --ssh "ssh -i '.$keyFile.'" %s "%s"';
$success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo);
if ($success) {
$success = $this->postCloneSetup($builder, $cloneTo);
}
// Remove the key file:
unlink($keyFile);
return $success;
}
/**
* Handle post-clone tasks (switching branch, etc.)
* @param Builder $builder
* @param $cloneTo
* @return bool
*/
protected function postCloneSetup(Builder $builder, $cloneTo)
{
$success = true;
$commit = $this->getCommitId();
// Allow switching to a specific branch:
if (!empty($commit) && $commit != 'Manual') {
$cmd = 'cd "%s" && hg checkout %s';
$success = $builder->executeCommand($cmd, $cloneTo, $this->getBranch());
}
return $success;
}
}

View file

@ -54,7 +54,7 @@ class RemoteGitBuild extends Build
*/
protected function cloneByHttp(Builder $builder, $cloneTo)
{
$cmd = 'git clone ';
$cmd = 'git clone --recursive ';
$depth = $builder->getConfig('clone_depth');
@ -84,7 +84,7 @@ class RemoteGitBuild extends Build
}
// Do the git clone:
$cmd = 'git clone ';
$cmd = 'git clone --recursive ';
$depth = $builder->getConfig('clone_depth');
@ -113,21 +113,27 @@ class RemoteGitBuild extends Build
return $success;
}
/**
* Handle any post-clone tasks, like switching branches.
* @param Builder $builder
* @param $cloneTo
* @return bool
*/
protected function postCloneSetup(Builder $builder, $cloneTo)
{
$success = true;
$commit = $this->getCommitId();
$chdir = IS_WIN ? 'cd /d "%s"' : 'cd "%s"';
if (!empty($commit) && $commit != 'Manual') {
$cmd = 'cd "%s"';
$cmd = $chdir . ' && git checkout %s --quiet';
$success = $builder->executeCommand($cmd, $cloneTo, $commit);
}
if (IS_WIN) {
$cmd = 'cd /d "%s"';
}
$cmd .= ' && git checkout %s --quiet';
$success = $builder->executeCommand($cmd, $cloneTo, $this->getCommitId());
// Always update the commit hash with the actual HEAD hash
if ($builder->executeCommand($chdir . ' && git rev-parse HEAD', $cloneTo)) {
$this->setCommitId(trim($builder->getLastOutput()));
}
return $success;

View file

@ -0,0 +1,182 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Model\Build;
use PHPCI\Model\Build;
use PHPCI\Builder;
/**
* Remote Subversion Build Model
* @author Nadir Dzhilkibaev <imam.sharif@gmail.com>
* @package PHPCI
* @subpackage Core
*/
class SubversionBuild extends Build
{
protected $svnCommand = 'svn export -q --non-interactive ';
/**
* Get the URL to be used to clone this remote repository.
*/
protected function getCloneUrl()
{
$url = $this->getProject()->getReference();
if (substr($url, -1) != '/') {
$url .= '/';
}
$branch = $this->getBranch();
if (empty($branch) || $branch == 'trunk') {
$url .= 'trunk';
} else {
$url .= 'branches/' . $branch;
}
return $url;
}
/**
* @param Builder $builder
*
* @return void
*/
protected function extendSvnCommandFromConfig(Builder $builder)
{
$cmd = $this->svnCommand;
$svn = $builder->getConfig('svn');
if ($svn) {
foreach ($svn as $key => $value) {
$cmd .= " --$key $value ";
}
}
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
}
$this->svnCommand = $cmd;
}
/**
* Create a working copy by cloning, copying, or similar.
*/
public function createWorkingCopy(Builder $builder, $buildPath)
{
$this->handleConfig($builder, $buildPath);
$this->extendSvnCommandFromConfig($builder);
$key = trim($this->getProject()->getSshPrivateKey());
if (!empty($key)) {
$success = $this->cloneBySsh($builder, $buildPath);
} else {
$success = $this->cloneByHttp($builder, $buildPath);
}
if (!$success) {
$builder->logFailure('Failed to export remote subversion repository.');
return false;
}
return $this->handleConfig($builder, $buildPath);
}
/**
* Use an HTTP-based svn export.
*/
protected function cloneByHttp(Builder $builder, $cloneTo)
{
$cmd = $this->svnCommand;
if ($this->getCommitId() != 'Manual') {
$cmd .= ' -r %s %s "%s"';
$success = $builder->executeCommand($cmd, $this->getCommitId(), $this->getCloneUrl(), $cloneTo);
} else {
$cmd .= ' %s "%s"';
$success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo);
}
return $success;
}
/**
* Use an SSH-based svn export.
*/
protected function cloneBySsh(Builder $builder, $cloneTo)
{
$cmd = $this->svnCommand . ' %s "%s"';
if (!IS_WIN) {
$keyFile = $this->writeSshKey($cloneTo);
$sshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
$cmd = 'export SVN_SSH="' . $sshWrapper . '" && ' . $cmd;
}
$success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo);
if (!IS_WIN) {
// Remove the key file and svn wrapper:
unlink($keyFile);
unlink($sshWrapper);
}
return $success;
}
/**
* Create an SSH key file on disk for this build.
* @param $cloneTo
* @return string
*/
protected function writeSshKey($cloneTo)
{
$keyPath = dirname($cloneTo . '/temp');
$keyFile = $keyPath . '.key';
// Write the contents of this project's svn key to the file:
file_put_contents($keyFile, $this->getProject()->getSshPrivateKey());
chmod($keyFile, 0600);
// Return the filename:
return $keyFile;
}
/**
* Create an SSH wrapper script for Svn to use, to disable host key checking, etc.
* @param $cloneTo
* @param $keyFile
* @return string
*/
protected function writeSshWrapper($cloneTo, $keyFile)
{
$path = dirname($cloneTo . '/temp');
$wrapperFile = $path . '.sh';
$sshFlags = '-o CheckHostIP=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o PasswordAuthentication=no';
// Write out the wrapper script for this build:
$script = <<<OUT
#!/bin/sh
ssh {$sshFlags} -o IdentityFile={$keyFile} $*
OUT;
file_put_contents($wrapperFile, $script);
shell_exec('chmod +x "' . $wrapperFile . '"');
return $wrapperFile;
}
}

View file

@ -0,0 +1,63 @@
<?php
/**
* BuildError model for table: build_error
*/
namespace PHPCI\Model;
use PHPCI\Model\Base\BuildErrorBase;
/**
* BuildError Model
* @uses PHPCI\Model\Base\BuildErrorBase
*/
class BuildError extends BuildErrorBase
{
const SEVERITY_CRITICAL = 0;
const SEVERITY_HIGH = 1;
const SEVERITY_NORMAL = 2;
const SEVERITY_LOW = 3;
/**
* Get the language string key for this error's severity level.
* @return string
*/
public function getSeverityString()
{
switch ($this->getSeverity()) {
case self::SEVERITY_CRITICAL:
return 'critical';
case self::SEVERITY_HIGH:
return 'high';
case self::SEVERITY_NORMAL:
return 'normal';
case self::SEVERITY_LOW:
return 'low';
}
}
/**
* Get the class to apply to HTML elements representing this error.
* @return string
*/
public function getSeverityClass()
{
switch ($this->getSeverity()) {
case self::SEVERITY_CRITICAL:
return 'danger';
case self::SEVERITY_HIGH:
return 'warning';
case self::SEVERITY_NORMAL:
return 'info';
case self::SEVERITY_LOW:
return 'default';
}
}
}

View file

@ -22,6 +22,12 @@ use b8\Store;
*/
class Project extends ProjectBase
{
/**
* Return the latest build from a specific branch, of a specific status, for this project.
* @param string $branch
* @param null $status
* @return mixed|null
*/
public function getLatestBuild($branch = 'master', $status = null)
{
$criteria = array('branch' => $branch, 'project_id' => $this->getId());
@ -44,6 +50,33 @@ class Project extends ProjectBase
return null;
}
/**
* Return the previous build from a specific branch, for this project.
* @param string $branch
* @return mixed|null
*/
public function getPreviousBuild($branch = 'master')
{
$criteria = array('branch' => $branch, 'project_id' => $this->getId());
$order = array('id' => 'DESC');
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 1, array(), $order);
if (is_array($builds['items']) && count($builds['items'])) {
$previous = array_shift($builds['items']);
if (isset($previous) && $previous instanceof Build) {
return $previous;
}
}
return null;
}
/**
* Store this project's access_information data
* @param string|array $value
*/
public function setAccessInformation($value)
{
if (is_array($value)) {
@ -53,12 +86,17 @@ class Project extends ProjectBase
parent::setAccessInformation($value);
}
/**
* Get this project's access_information data. Pass a specific key or null for all data.
* @param string|null $key
* @return mixed|null|string
*/
public function getAccessInformation($key = null)
{
$info = $this->data['access_information'];
// Handle old-format (serialized) access information first:
if (!empty($info) && substr($info, 0, 1) != '{') {
if (!empty($info) && !in_array(substr($info, 0, 1), array('{', '['))) {
$data = unserialize($info);
} else {
$data = json_decode($info, true);
@ -88,4 +126,32 @@ class Project extends ProjectBase
return $this->data['branch'];
}
}
/**
* Return the name of a FontAwesome icon to represent this project, depending on its type.
* @return string
*/
public function getIcon()
{
switch ($this->getType()) {
case 'github':
$icon = 'github';
break;
case 'bitbucket':
$icon = 'bitbucket';
break;
case 'git':
case 'gitlab':
$icon = 'git';
break;
default:
$icon = 'cog';
break;
}
return $icon;
}
}

View file

@ -0,0 +1,18 @@
<?php
/**
* ProjectGroup model for table: project_group
*/
namespace PHPCI\Model;
use PHPCI\Model\Base\ProjectGroupBase;
/**
* ProjectGroup Model
* @uses PHPCI\Model\Base\ProjectGroupBase
*/
class ProjectGroup extends ProjectGroupBase
{
// This class has been left blank so that you can modify it - changes in this file will not be overwritten.
}

View file

@ -9,8 +9,6 @@
namespace PHPCI;
use PHPCI\Model\Build;
/**
* PHPCI Plugin Interface - Used by all build plugins.
* @author Dan Cryer <dan@block8.co.uk>

View file

@ -10,14 +10,25 @@
namespace PHPCI\Plugin;
use PHPCI\Builder;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
/**
* Atoum plugin, runs Atoum tests within a project.
* @package PHPCI\Plugin
*/
class Atoum implements \PHPCI\Plugin
{
private $args;
private $config;
private $directory;
/**
* Set up the plugin, configure options, etc.
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
@ -42,6 +53,10 @@ class Atoum implements \PHPCI\Plugin
}
}
/**
* Run the Atoum plugin.
* @return bool
*/
public function execute()
{
$cmd = $this->executable;
@ -67,7 +82,7 @@ class Atoum implements \PHPCI\Plugin
}
if (count($output) == 0) {
$status = false;
$this->phpci->log("No test have been performed!");
$this->phpci->log(Lang::get('no_tests_performed'));
}
return $status;

View file

@ -10,7 +10,9 @@
namespace PHPCI\Plugin;
use PHPCI\Builder;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
use PHPCI\Model\BuildError;
/**
* Behat BDD Plugin
@ -24,6 +26,18 @@ class Behat implements \PHPCI\Plugin
protected $build;
protected $features;
/**
* Standard Constructor
*
* $options['directory'] Output Directory. Default: %BUILDPATH%
* $options['filename'] Phar Filename. Default: build.phar
* $options['regexp'] Regular Expression Filename Capture. Default: /\.php$/
* $options['stub'] Stub Content. No Default Value
*
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
@ -52,13 +66,73 @@ class Behat implements \PHPCI\Plugin
$behat = $this->executable;
if (!$behat) {
$this->phpci->logFailure('Could not find behat.');
$this->phpci->logFailure(Lang::get('could_not_find', 'behat'));
return false;
}
$success = $this->phpci->executeCommand($behat . ' %s', $this->features);
chdir($curdir);
list($errorCount, $data) = $this->parseBehatOutput();
$this->build->storeMeta('behat-warnings', $errorCount);
$this->build->storeMeta('behat-data', $data);
return $success;
}
/**
* Parse the behat output and return details on failures
*
* @return array
*/
public function parseBehatOutput()
{
$output = $this->phpci->getLastOutput();
$parts = explode('---', $output);
if (count($parts) <= 1) {
return array(0, array());
}
$lines = explode(PHP_EOL, $parts[1]);
$storeFailures = false;
$data = array();
foreach ($lines as $line) {
$line = trim($line);
if ($line == 'Failed scenarios:') {
$storeFailures = true;
continue;
}
if (strpos($line, ':') === false) {
$storeFailures = false;
}
if ($storeFailures) {
$lineParts = explode(':', $line);
$data[] = array(
'file' => $lineParts[0],
'line' => $lineParts[1]
);
$this->build->reportError(
$this->phpci,
'behat',
'Behat scenario failed.',
BuildError::SEVERITY_HIGH,
$lineParts[0],
$lineParts[1]
);
}
}
$errorCount = count($data);
return array($errorCount, $data);
}
}

View file

@ -10,6 +10,7 @@
namespace PHPCI\Plugin;
use PHPCI\Builder;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
/**
@ -28,30 +29,41 @@ class Campfire implements \PHPCI\Plugin
private $verbose;
private $roomId;
/**
* Set up the plugin, configure options, etc.
* @param Builder $phpci
* @param Build $build
* @param array $options
* @throws \Exception
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->message = $options['message'];
$this->phpci = $phpci;
$this->build = $build;
$this->message = $options['message'];
$this->userAgent = "PHPCI/1.0 (+http://www.phptesting.org/)";
$this->cookie = "phpcicookie";
$this->cookie = "phpcicookie";
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['campfire'])) {
$campfire = $buildSettings['campfire'];
$this->url = $campfire['url'];
$campfire = $buildSettings['campfire'];
$this->url = $campfire['url'];
$this->authToken = $campfire['authToken'];
$this->roomId = $campfire['roomId'];
$this->roomId = $campfire['roomId'];
} else {
throw new \Exception("No connection parameters given for Campfire plugin");
throw new \Exception(Lang::get('no_campfire_settings'));
}
}
/**
* Run the Campfire plugin.
* @return bool|mixed
*/
public function execute()
{
$url = PHPCI_URL."build/view/".$this->build->getId();
$url = PHPCI_URL . "build/view/" . $this->build->getId();
$message = str_replace("%buildurl%", $url, $this->message);
$this->joinRoom($this->roomId);
$status = $this->speak($message, $this->roomId);
@ -61,19 +73,35 @@ class Campfire implements \PHPCI\Plugin
}
/**
* Join a Campfire room.
* @param $roomId
*/
public function joinRoom($roomId)
{
$this->getPageByPost('/room/'.$roomId.'/join.json');
}
/**
* Leave a Campfire room.
* @param $roomId
*/
public function leaveRoom($roomId)
{
$this->getPageByPost('/room/'.$roomId.'/leave.json');
}
/**
* Send a message to a campfire room.
* @param $message
* @param $roomId
* @param bool $isPaste
* @return bool|mixed
*/
public function speak($message, $roomId, $isPaste = false)
{
$page = '/room/'.$roomId.'/speak.json';
if ($isPaste) {
$type = 'PasteMessage';
} else {
@ -84,6 +112,12 @@ class Campfire implements \PHPCI\Plugin
}
/**
* Make a request to Campfire.
* @param $page
* @param null $data
* @return bool|mixed
*/
private function getPageByPost($page, $data = null)
{
$url = $this->url . $page;
@ -110,12 +144,13 @@ class Campfire implements \PHPCI\Plugin
// We tend to get one space with an otherwise blank response
$output = trim($output);
if (strlen($output)) {
/* Responses are JSON. Decode it to a data structure */
return json_decode($output);
}
// Simple 200 OK response (such as for joining a room)
// TODO: check for other result codes here
return true;
}
}

View file

@ -25,11 +25,23 @@ class CleanBuild implements \PHPCI\Plugin
protected $phpci;
protected $build;
/**
* Standard Constructor
*
* $options['directory'] Output Directory. Default: %BUILDPATH%
* $options['filename'] Phar Filename. Default: build.phar
* $options['regexp'] Regular Expression Filename Capture. Default: /\.php$/
* $options['stub'] Stub Content. No Default Value
*
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->remove = isset($options['remove']) && is_array($options['remove']) ? $options['remove'] : array();
$this->phpci = $phpci;
$this->build = $build;
$this->remove = isset($options['remove']) && is_array($options['remove']) ? $options['remove'] : array();
}
/**
@ -45,7 +57,7 @@ class CleanBuild implements \PHPCI\Plugin
$this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock');
$success = true;
foreach ($this->remove as $file) {
$ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file);

View file

@ -10,92 +10,154 @@
namespace PHPCI\Plugin;
use PHPCI\Builder;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser;
use Psr\Log\LogLevel;
/**
* Codeception Plugin - Enables full acceptance, unit, and functional testing.
* @author Don Gilbert <don@dongilbert.net>
* @author Igor Timoshenko <contact@igortimoshenko.com>
* @author Adam Cooper <adam@networkpie.co.uk>
* @package PHPCI
* @subpackage Plugins
*/
class Codeception implements \PHPCI\Plugin
class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
{
/**
* @var string
*/
/** @var string */
protected $args = '';
/**
* @var Builder
*/
/** @var Builder */
protected $phpci;
/** @var Build */
protected $build;
/**
* @var string|string[] $xmlConfigFile The path (or array of paths) of an xml config for PHPUnit
* @var string $ymlConfigFile The path of a yml config for Codeception
*/
protected $xmlConfigFile;
protected $ymlConfigFile;
/**
* @var string $path The path to the codeception tests folder.
*/
protected $path;
/**
* @param $stage
* @param Builder $builder
* @param Build $build
* @return bool
*/
public static function canExecute($stage, Builder $builder, Build $build)
{
return $stage == 'test' && !is_null(self::findConfigFile($builder->buildPath));
}
/**
* Try and find the codeception YML config file.
* @param $buildPath
* @return null|string
*/
public static function findConfigFile($buildPath)
{
if (file_exists($buildPath . 'codeception.yml')) {
return 'codeception.yml';
}
if (file_exists($buildPath . 'codeception.dist.yml')) {
return 'codeception.dist.yml';
}
return null;
}
/**
* Set up the plugin, configure options, etc.
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->path = 'tests' . DIRECTORY_SEPARATOR . '_output' . DIRECTORY_SEPARATOR;
if (isset($options['config'])) {
$this->xmlConfigFile = $options['config'];
if (empty($options['config'])) {
$this->ymlConfigFile = self::findConfigFile($this->phpci->buildPath);
} else {
$this->ymlConfigFile = $options['config'];
}
if (isset($options['args'])) {
$this->args = (string) $options['args'];
}
if (isset($options['path'])) {
$this->path = $options['path'];
}
}
/**
* Runs Codeception tests, optionally using specified config file(s).
* Runs Codeception tests
*/
public function execute()
{
$success = true;
if (empty($this->ymlConfigFile)) {
throw new \Exception("No configuration file found");
}
// Run any config files first. This can be either a single value or an array.
if ($this->xmlConfigFile !== null) {
$success &= $this->runConfigFile($this->xmlConfigFile);
}
return $success;
return $this->runConfigFile($this->ymlConfigFile);
}
/**
* Run tests from a Codeception config file.
* @param $configPath
* @return bool|mixed
* @throws \Exception
*/
protected function runConfigFile($configPath)
{
if (is_array($configPath)) {
return $this->recurseArg($configPath, array($this, "runConfigFile"));
} else {
$this->phpci->logExecOutput(false);
$codecept = $this->phpci->findBinary('codecept');
$codecept = $this->phpci->findBinary('codecept');
if (!$codecept) {
$this->phpci->logFailure('Could not find codeception.');
return false;
}
if (!$codecept) {
$this->phpci->logFailure(Lang::get('could_not_find', 'codecept'));
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
if (IS_WIN) {
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
}
$configPath = $this->phpci->buildPath . $configPath;
$success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);
return $success;
return false;
}
}
protected function recurseArg($array, $callable)
{
$success = true;
foreach ($array as $subItem) {
$success &= call_user_func($callable, $subItem);
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;
if (IS_WIN) {
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;
}
$configPath = $this->phpci->buildPath . $configPath;
$success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);
$this->phpci->log(
'Codeception XML path: '. $this->phpci->buildPath . $this->path . 'report.xml',
Loglevel::DEBUG
);
$xml = file_get_contents($this->phpci->buildPath . $this->path . 'report.xml', false);
$parser = new Parser($this->phpci, $xml);
$output = $parser->parse();
$meta = array(
'tests' => $parser->getTotalTests(),
'timetaken' => $parser->getTotalTimeTaken(),
'failures' => $parser->getTotalFailures()
);
$this->build->storeMeta('codeception-meta', $meta);
$this->build->storeMeta('codeception-data', $output);
$this->build->storeMeta('codeception-errors', $parser->getTotalFailures());
$this->phpci->logExecOutput(true);
return $success;
}
}

Some files were not shown because too many files have changed in this diff Show more