Comments (3)
Possible solution
#Loader::loadClass
public static function loadClass($class) {
$class_file = str_replace('\\', '/', str_replace('_', '/', $class)).'.php';
foreach (self::$dirs as $dir) {
$file = $dir.'/'.$class_file;
if (file_exists($file)) {
require $file;
return;
}
}
trigger_error(sprintf('Class %s not found', $class), E_USER_ERROR); #handle class not found
# throw new \ErrorException(sprintf('Class %s not found', $class), E_USER_ERROR);
}
from core.
Flight intentionally does not throw an error when it can't find a class. This is because PHP class_exists
function tries to autoload class by default and throwing an error causes issues with third party libraries. This seems like more of an issue with the router or dispatcher. I'll take a look.
from core.
Now fixed in commit 6696c0d. It should now throw an exception for invalid callbacks.
from core.
Related Issues (20)
- Handling of URLs with encoded slashes (/)
- Have URL parameters available when setting streaming headers HOT 2
- Upgrade from 3.2.0 to 3.6.1 breaks Flight::json ? HOT 2
- [Docs > Routing] Method Routing HOT 6
- [Refactor] Flight::get() need to be renamed HOT 2
- [Views] register method : no autocomplete / intelsense HOT 3
- get_input_data HOT 3
- Comments before begin php tag returns json with garbage HOT 4
- FYI, minor bug with streamWithHeaders() HOT 11
- Multiple renders keeps the previous state When I render multiple views as components, they keep the state of previous arguments passed to them instead of reinitialize with default value each render.
- Inject Middleware constructor arguments using the DI Container HOT 4
- Proposal of compact syntax for Flight::route HOT 11
- View class steroids 🙌🏽 HOT 1
- How to stop the request process when there is an issue in the Middleware? HOT 8
- Named Parameters Are Actually In Order... HOT 9
- Simplify PHP version constraint HOT 4
- Flight::group lacks nesting support for organizing routes hierarchically. Adding this feature will enhance route management flexibility. HOT 3
- Wrong request method response HOT 2
- Including version number of Flight in Flight.php root file HOT 3
- How to show custom page for 500 error? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.