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

API Remove deprecated CIConfig functionality #10598

Merged
Merged
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
50 changes: 15 additions & 35 deletions src/Core/BaseKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Core\Manifest\ModuleManifest;
use SilverStripe\Dev\DebugView;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Logging\ErrorHandler;
use SilverStripe\View\PublicThemes;
use SilverStripe\View\SSViewer;
Expand Down Expand Up @@ -179,26 +178,17 @@ protected function bootPHP()
*/
protected function bootManifests($flush)
{
// Setup autoloader
$ignoredCIConfigs = Deprecation::withNoReplacement(function () {
return $this->getIgnoredCIConfigs();
});

Deprecation::withNoReplacement(function () use ($flush, $ignoredCIConfigs) {
$this->getClassLoader()->init(
$this->getIncludeTests(),
$flush,
$ignoredCIConfigs
);

// Find modules
$this->getModuleLoader()->init(
$this->getIncludeTests(),
$flush,
$ignoredCIConfigs
);
});

$this->getClassLoader()->init(
$this->getIncludeTests(),
$flush
);

// Find modules
$this->getModuleLoader()->init(
$this->getIncludeTests(),
$flush
);

// Flush config
if ($flush) {
$config = $this->getConfigLoader()->getManifest();
Expand All @@ -215,13 +205,10 @@ protected function bootManifests($flush)
$defaultSet->setProject(
ModuleManifest::config()->get('project')
);
Deprecation::withNoReplacement(function () use ($defaultSet, $flush, $ignoredCIConfigs) {
$defaultSet->init(
$this->getIncludeTests(),
$flush,
$ignoredCIConfigs
);
});
$defaultSet->init(
$this->getIncludeTests(),
$flush
);
}
}

Expand All @@ -230,15 +217,8 @@ protected function bootManifests($flush)
*/
protected function bootConfigs()
{
global $project;
$projectBefore = $project;
$config = ModuleManifest::config();
// After loading all other app manifests, include _config.php files
$this->getModuleLoader()->getManifest()->activateConfig();
if ($project && $project !== $projectBefore) {
Deprecation::notice('5.0', '$project global is deprecated');
$config->set('project', $project);
}
}

/**
Expand Down
20 changes: 1 addition & 19 deletions src/Core/Manifest/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

namespace SilverStripe\Core\Manifest;

use SilverStripe\Core\ClassInfo;
use SilverStripe\Dev\Deprecation;

/**
* A class that handles loading classes and interfaces from a class manifest
* instance.
Expand Down Expand Up @@ -126,24 +123,9 @@ public function init($includeTests = false, $forceRegen = false)
foreach ($this->manifests as $manifest) {
/** @var ClassManifest $instance */
$instance = $manifest['instance'];
Deprecation::withNoReplacement(function () use ($instance, $includeTests, $forceRegen, $ignoredCIConfigs) {
$instance->init($includeTests, $forceRegen, $ignoredCIConfigs);
});
$instance->init($includeTests, $forceRegen);
}

$this->registerAutoloader();
}

/**
* Returns true if a class or interface name exists in the manifest.
*
* @param string $class
* @return bool
* @deprecated 4.0.1 Use ClassInfo::exists() instead
*/
public function classExists($class)
{
Deprecation::notice('4.0.1', 'Use ClassInfo::exists() instead');
return ClassInfo::exists($class);
}
}
4 changes: 1 addition & 3 deletions src/Core/Manifest/ClassManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ public function init($includeTests = false, $forceRegen = false)
}

// Build
Deprecation::withNoReplacement(function () use ($includeTests, $ignoredCIConfigs) {
$this->regenerate($includeTests, $ignoredCIConfigs);
});
$this->regenerate($includeTests);
}

/**
Expand Down