PHPackages                             faxity/di-sorcery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. faxity/di-sorcery

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

faxity/di-sorcery
=================

An Anax module to load configuration, views and DI modules directly from the vendor folder.

v1.0.2(6y ago)073MITPHPPHP ^7.2

Since Dec 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iFaxity/di-sorcery)[ Packagist](https://packagist.org/packages/faxity/di-sorcery)[ RSS](/packages/faxity-di-sorcery/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

faxity/di-sorcery
=================

[](#faxitydi-sorcery)

[![Build Status](https://github.com/iFaxity/di-sorcery/workflows/Build/badge.svg)](https://github.com/iFaxity/di-sorcery/workflows/Build/badge.svg)[![Build Status](https://camo.githubusercontent.com/25e1f250c3ba05eac701768215fc14520c22a4a9099949bdd5f5af45470ba066/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f694661786974792f64692d736f72636572792f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/iFaxity/di-sorcery/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/b049325a6ea2177b50199867584d1b3c2817a8d3320996def8c5a3c8f9722b8e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f694661786974792f64692d736f72636572792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/iFaxity/di-sorcery/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/05b7e42d43a235babb48886166f885c333dc34e1451e8193d0687d8282c92966/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f694661786974792f64692d736f72636572792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/iFaxity/di-sorcery/?branch=master)

This is an extension for Anax to load configuration, views and DI modules directly from the vendor folder.

Installation
------------

[](#installation)

To install the package using composer:

`composer require faxity/di-sorcery`

Then after that you need to update the `htdocs/index.php` file to use DISorcery like this:

```
// Replace or comment out the current DIFactory config
// Add all framework services to $di
//$di = new Anax\DI\DIFactoryConfig();
//$di->loadServices(ANAX_INSTALL_PATH . "/config/di");

// Add all framework services to $di
$di = new \Faxity\DI\DISorcery(ANAX_INSTALL_PATH, ANAX_INSTALL_PATH . "/vendor");
$di->initialize("config/sorcery.php");
```

Then create the file `sorcery.php` in the `config` folder. In this file you can enter the paths where configuration, views and DI modules are resolved from. A relative path is resolved to the path in the second argument of the constructor, or first argument + "/vendor".

```
