aedart / model-vendor-path
此包已被废弃,不再维护。未建议替代包。
供应商路径的获取器和设置器包。此包是 'Aedart\Model' 命名空间的一部分;访问 https://bitbucket.org/aedart/model 了解更多关于项目的信息。官方子包网站(https://bitbucket.org/aedart/model-vendor-path)。
1.1.0
2015-06-21 17:47 UTC
Requires
- php: >=5.5.9
- aedart/validate: >=0.9.1 <2.0
Requires (Dev)
- aedart/license: 1.*
- aedart/license-file-manager: 1.*
- codeception/codeception: 2.0.*
- fzaninotto/faker: 1.5.*
Suggests
- aedart/overload: Provides means to dynamically deal with inaccessible properties, by implementing PHP’s magic methods; __get(), __set(), __isset(), and __unset().
This package is auto-updated.
Last update: 2022-02-01 12:46:21 UTC
README
供应商路径的获取器和设置器包。
此包是 'Aedart\Model' 命名空间的一部分;访问 https://bitbucket.org/aedart/model 了解更多关于项目的信息。
官方子包网站(https://bitbucket.org/aedart/model-vendor-path)。
内容
[目录]
何时使用此包
当您的组件(s)需要知道供应商路径时
如何安装
#!console
composer require aedart/model-vendor-path 1.*
此包使用 composer。如果您不知道这是什么或它是如何工作的,我在尝试使用此包之前建议您阅读一些关于它的信息。
快速入门
假设您有一个接口,例如为安装程序,您可以扩展供应商路径感知接口;
#!php
<?php
use Aedart\Model\Vendor\Path\Interfaces\VendorPathAware;
interface IInstaller extends VendorPathAware {
// ... Remaining interface implementation not shown ...
}
在您的具体实现中,您只需使用供应商路径特性;
#!php
<?php
use Aedart\Model\Vendor\Path\Traits\VendorPathTrait;
class MyInstaller implements IInstaller {
use VendorPathTrait;
// ... Remaining implementation not shown ...
}
Composer的供应商目录
默认情况下,VendorPathTrait
不包含任何默认供应商路径。但是,如果您需要引用 composer 的 vendor-dir
,则可以使用 ComposerVendorPathTrait
,它根据 composer 的 ClassLoader
文件的文件系统位置猜测供应商目录的完整路径。
#!php
<?php
use Aedart\Model\Vendor\Path\Traits\ComposerVendorPathTrait;
class MyInstaller implements IInstaller {
use ComposerVendorPathTrait;
// ... Remaining implementation not shown ...
}
许可证
BSD-3-Clause,阅读此包中包含的 LICENSE 文件