-
Notifications
You must be signed in to change notification settings - Fork 4
Cakephp 5 upgrade #327
Closed
+175,487
−134,232
Closed
Cakephp 5 upgrade #327
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /composer.lock | ||
| /composer.phar | ||
| /phpunit.xml | ||
| /.phpunit.result.cache | ||
| /phpunit.phar | ||
| /config/Migrations/schema-dump-default.lock | ||
| /vendor/ | ||
| /.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # LdapConnector plugin for CakePHP | ||
|
|
||
| ## Installation | ||
|
|
||
| You can install this plugin into your CakePHP application using [composer](https://getcomposer.org). | ||
|
|
||
| The recommended way to install composer packages is: | ||
|
|
||
| ``` | ||
| composer require your-name-here/ldap-connector | ||
| ``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "name": "your-name-here/ldap-connector", | ||
| "description": "LdapConnector plugin for CakePHP", | ||
| "type": "cakephp-plugin", | ||
| "license": "MIT", | ||
| "require": { | ||
| "php": ">=7.2", | ||
| "cakephp/cakephp": "4.6.*" | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^8.5 || ^9.3" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "LdapConnector\\": "src/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "LdapConnector\\Test\\": "tests/", | ||
| "Cake\\Test\\": "vendor/cakephp/cakephp/tests/" | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <phpunit | ||
| colors="true" | ||
| processIsolation="false" | ||
| stopOnFailure="false" | ||
| bootstrap="tests/bootstrap.php" | ||
| > | ||
| <php> | ||
| <ini name="memory_limit" value="-1"/> | ||
| <ini name="apc.enable_cli" value="1"/> | ||
| </php> | ||
|
|
||
| <!-- Add any additional test suites you want to run here --> | ||
| <testsuites> | ||
| <testsuite name="LdapConnector"> | ||
| <directory>tests/TestCase/</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
|
|
||
| <!-- Setup fixture extension --> | ||
| <extensions> | ||
| <extension class="Cake\TestSuite\Fixture\PHPUnitExtension" /> | ||
| </extensions> | ||
|
|
||
| <filter> | ||
| <whitelist> | ||
| <directory suffix=".php">src/</directory> | ||
| </whitelist> | ||
| </filter> | ||
| </phpunit> |
10 changes: 10 additions & 0 deletions
10
app/availableplugins/LdapConnector/src/Controller/AppController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| namespace LdapConnector\Controller; | ||
|
|
||
| use App\Controller\AppController as BaseController; | ||
|
|
||
| class AppController extends BaseController | ||
| { | ||
| } |
93 changes: 93 additions & 0 deletions
93
app/availableplugins/LdapConnector/src/LdapConnectorPlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| namespace LdapConnector; | ||
|
|
||
| use Cake\Console\CommandCollection; | ||
| use Cake\Core\BasePlugin; | ||
| use Cake\Core\ContainerInterface; | ||
| use Cake\Core\PluginApplicationInterface; | ||
| use Cake\Http\MiddlewareQueue; | ||
| use Cake\Routing\RouteBuilder; | ||
|
|
||
| /** | ||
| * Plugin for LdapConnector | ||
| */ | ||
| class LdapConnectorPlugin extends BasePlugin | ||
| { | ||
| /** | ||
| * Load all the plugin configuration and bootstrap logic. | ||
| * | ||
| * The host application is provided as an argument. This allows you to load | ||
| * additional plugin dependencies, or attach events. | ||
| * | ||
| * @param \Cake\Core\PluginApplicationInterface $app The host application | ||
| * @return void | ||
| */ | ||
| public function bootstrap(PluginApplicationInterface $app): void | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * Add routes for the plugin. | ||
| * | ||
| * If your plugin has many routes and you would like to isolate them into a separate file, | ||
| * you can create `$plugin/config/routes.php` and delete this method. | ||
| * | ||
| * @param \Cake\Routing\RouteBuilder $routes The route builder to update. | ||
| * @return void | ||
| */ | ||
| public function routes(RouteBuilder $routes): void | ||
| { | ||
| $routes->plugin( | ||
| 'LdapConnector', | ||
| ['path' => '/ldap-connector'], | ||
| function (RouteBuilder $builder) { | ||
| // Add custom routes here | ||
|
|
||
| $builder->fallbacks(); | ||
| } | ||
| ); | ||
| parent::routes($routes); | ||
| } | ||
|
|
||
| /** | ||
| * Add middleware for the plugin. | ||
| * | ||
| * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update. | ||
| * @return \Cake\Http\MiddlewareQueue | ||
| */ | ||
| public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue | ||
| { | ||
| // Add your middlewares here | ||
|
|
||
| return $middlewareQueue; | ||
| } | ||
|
|
||
| /** | ||
| * Add commands for the plugin. | ||
| * | ||
| * @param \Cake\Console\CommandCollection $commands The command collection to update. | ||
| * @return \Cake\Console\CommandCollection | ||
| */ | ||
| public function console(CommandCollection $commands): CommandCollection | ||
| { | ||
| // Add your commands here | ||
|
|
||
| $commands = parent::console($commands); | ||
|
|
||
| return $commands; | ||
| } | ||
|
|
||
| /** | ||
| * Register application container services. | ||
| * | ||
| * @param \Cake\Core\ContainerInterface $container The Container to update. | ||
| * @return void | ||
| * @link https://book.cakephp.org/4/en/development/dependency-injection.html#dependency-injection | ||
| */ | ||
| public function services(ContainerInterface $container): void | ||
| { | ||
| // Add your services here | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * Test suite bootstrap for LdapConnector. | ||
| * | ||
| * This function is used to find the location of CakePHP whether CakePHP | ||
| * has been installed as a dependency of the plugin, or the plugin is itself | ||
| * installed as a dependency of an application. | ||
| */ | ||
| $findRoot = function ($root) { | ||
| do { | ||
| $lastRoot = $root; | ||
| $root = dirname($root); | ||
| if (is_dir($root . '/vendor/cakephp/cakephp')) { | ||
| return $root; | ||
| } | ||
| } while ($root !== $lastRoot); | ||
|
|
||
| throw new Exception('Cannot find the root of the application, unable to run tests'); | ||
| }; | ||
| $root = $findRoot(__FILE__); | ||
| unset($findRoot); | ||
|
|
||
| chdir($root); | ||
|
|
||
| require_once $root . '/vendor/autoload.php'; | ||
|
|
||
| /** | ||
| * Define fallback values for required constants and configuration. | ||
| * To customize constants and configuration remove this require | ||
| * and define the data required by your plugin here. | ||
| */ | ||
| require_once $root . '/vendor/cakephp/cakephp/tests/bootstrap.php'; | ||
|
|
||
| if (file_exists($root . '/config/bootstrap.php')) { | ||
| require $root . '/config/bootstrap.php'; | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| /** | ||
| * Load schema from a SQL dump file. | ||
| * | ||
| * If your plugin does not use database fixtures you can | ||
| * safely delete this. | ||
| * | ||
| * If you want to support multiple databases, consider | ||
| * using migrations to provide schema for your plugin, | ||
| * and using \Migrations\TestSuite\Migrator to load schema. | ||
| */ | ||
| use Cake\TestSuite\Fixture\SchemaLoader; | ||
|
|
||
| // Load a schema dump file. | ||
| (new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| -- Test database schema for LdapConnector |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LdapConnector is not currently a thing so this plugin should probably not be in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done