https://github.com/dflydev/dflydev-core-php
Provides basic bootstrapping functionality such as resource locating and class loading.
https://github.com/dflydev/dflydev-core-php
Last synced: about 1 year ago
JSON representation
Provides basic bootstrapping functionality such as resource locating and class loading.
- Host: GitHub
- URL: https://github.com/dflydev/dflydev-core-php
- Owner: dflydev
- License: other
- Created: 2011-06-12T05:07:37.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-06-13T02:34:39.000Z (about 15 years ago)
- Last Synced: 2025-01-26T07:11:14.825Z (over 1 year ago)
- Language: PHP
- Homepage: http://redmine.dflydev.com/projects/dflydev-core-php
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dragonfly Development PHP Core Library #
Provides basic bootstrapping functionality such as resource locating and
class loading.
## Dependencies ##
None.
This package is likely a dependency for many Dragonfly Development libraries.
At the very least, the dflydev\core\ClassLoader is likely to be suggested
for a lack of a [better solution](https://github.com/symfony/ClassLoader).
## Usage ##
### Class Loader ###
Simple class loader based on the [Symfony UniversalClassLoader](https://github.com/symfony/ClassLoader)
that can be used to load classes following the [PSR-0 autoloader interoperability standard](http://groups.google.com/group/php-standards/web/psr-0-final-proposal).
$classLoader = new ClassLoader();
$classLoader->registerNamespaces(array(
// 'namespace' => '/path/to/namespace/root'
'dflydev\\core' => __DIR__.'/src',
));
$classLoader->activate();
This class loader is provided as a fallback that can be used if a project
does not already have a PSR-0 capable class loader.
### Resource Loader ###
use dflydev\core\io\FileSystemResourceLoader
$resourceLoader = new FileSystemResourceLoader('/tmp');
try {
$resource = $resourceLoader->load('somefile.txt');
} catch (dflydev\core\io\exception\ResourceNotFoundException $e) {
// somefile.txt must not have been able to be located
// in the specified directory/directories.
}
## More Information ##
More information can be found on the [d2code Redmine](http://redmine.dflydev.com/projects/dflydev-core-php).