wuding/anfora

Class File Loader

Maintainers

Details

github.com/wuding/anfora

Source

Issues

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/wuding/anfora

1.0.1 2019-04-16 09:14 UTC

This package is auto-updated.

Last update: 2025-09-28 01:33:36 UTC


README

PHP Class Files Loader

Install

composer require wuding/anfora

Usage

web/index.php

<?php
define('BASE_DIR', __DIR__ . '/..');
define('VENDOR_DIR', __DIR__ . '/../vendor');
# define('COMPOSER_JSON', __DIR__ . '/../composer.json');

$autoload = require __DIR__ . '/../src/autoload.php';
$anfora = new Anfora(__DIR__ . '/../app/config.php');

vendor/composer/ 目录下

autoload_classmap, autoload_namespaces, autoload_files, autoload_psr4

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

替换为

include __DIR__ . '/../../app/composer.php';

app/config.php

添加常量定义以禁用 autoload_static

define('HHVM_VERSION', '-1');

或修改 vendor/composer/autoload_static.php

__DIR__ . '/../..' 替换为 BASE_DIR

__DIR__ . '/..' 替换为 VENDOR_DIR