Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FIX: Don't use realpath() for module and base path #43

Open
wants to merge 8 commits into
base: 1.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@ cache:

matrix:
include:
- php: 5.6
- php: 7.2
- php: 7.1
env:
- COMPOSER_SELFUPDATE_ARG=--1
- COMPOSER_ARG=--prefer-lowest
- php: 7.3
env:
- COMPOSER_SELFUPDATE_ARG=--1
- php: 7.4
env:
- COMPOSER_SELFUPDATE_ARG=--preview
- php: nightly
env:
- COMPOSER_ARG=--ignore-platform-reqs
- COMPOSER_SELFUPDATE_ARG=--preview

fast_finish: true

before_script:
- phpenv rehash
- export PATH=~/.composer/vendor/bin:$PATH
- composer self-update $COMPOSER_SELFUPDATE_ARG
- composer validate
- composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- composer update --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile $COMPOSER_ARG

script:
- vendor/bin/phpunit
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"lint": "phpcs src/ tests/",
"lint-clean": "phpcbf src/ tests/"
},
"minimum-stability": "dev",
"require": {
"composer/installers": "^1.4",
"composer-plugin-api": "^1.1"
"composer-plugin-api": "^1.1 || ^2",
"php": "^7.1 || ^8"
},
"require-dev": {
"composer/composer": "^1.5",
"phpunit/phpunit": "^5.7"
"composer/composer": "^1.5 || ^2@rc",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3"
}
}
3 changes: 2 additions & 1 deletion src/Console/VendorExposeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$modules = $this->getAllLibraries();
if (empty($modules)) {
$io->write("No modules to expose");
return;
return 0;
}

// Query first library for base destination
Expand All @@ -53,6 +53,7 @@ public function execute(InputInterface $input, OutputInterface $output)

// Success
$io->write("All modules updated!");
return 0;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class Library
*/
public function __construct($basePath, $libraryPath, $name = null)
{
$this->basePath = realpath($basePath);
$this->path = realpath($libraryPath);
$this->basePath = $basePath;
$this->path = $libraryPath;
$this->name = $name;
}

Expand Down
14 changes: 14 additions & 0 deletions src/VendorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,18 @@ protected function installLibrary(IOInterface $IO, Library $library)
);
$task->process($IO, [$library]);
}

/**
* Required by the composer 2 plugin interface
*/
public function deactivate(Composer $composer, IOInterface $io)
{
}

/**
* Required by the composer 2 plugin interface
*/
public function uninstall(Composer $composer, IOInterface $io)
{
}
}
17 changes: 17 additions & 0 deletions tests/VendorPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace SilverStripe\VendorPlugin\Tests;

use PHPUnit\Framework\TestCase;
use SilverStripe\VendorPlugin\VendorPlugin;

class VendorPluginTest extends TestCase
{
/**
* The simplest possible test, check that the plugin can be instantiated
*/
public function testInstantiation(): void
{
new VendorPlugin();
}
}