epicwhale / ninja Goto Github PK
View Code? Open in Web Editor NEWWriting php apps like a ninja!
License: Other
Writing php apps like a ninja!
License: Other
/**
* Define the memory usage at the start of the application, used for profiling.
*/
define('NINJA_START_MEMORY', memory_get_usage());
Ideally in production mode, page not found's should not be logged as it can cause flooding of the file logging the error.
Presently error logs do not show the request URL under which the log entry appeared. Adding it to the log entry will allow re-creation of bugs much better.
Kohana has a file called install.php that exists in the root of the website and performs Environment Tests + Optional Tests. This is a completely independent file that helps check if a server is compatible with Ninja or not. We need this too as it will ensure that the developer is working & deploying on a fully compatible platform. See it here: http://kohanaframework.org/3.2/guide/kohana/install#installation
Refer to: https://github.com/kohana/kohana/blob/3.2/master/index.php for the simplistic code & layout they use. We will adapt the same and later on re-touch the design.
There might be some requirements we don't need to check while there would be some requirements which should add in addition to what Kohana does. Suggest such additions / deletions.
Presently, all controllers can be accessed publicly as long as they have an action which maps to the requested URL. This should not be the case if the controller is 'Abstract'. This way AbstractControllers can be placed which are inherited by other controllers without the risk of being exposed to public access.
We can do this by prefixing all Abstract controller classnames with the word 'Abstract'. This retains general naming convention found in libraries like Doctrine, etc too.
<?php
namespace Controller;
abstract class AbstractFoo extends \Ninja\Controller
{
public function hello()
{
echo "yaa";
}
}
Reverse Routing allows you to create links to named routes. When creating links just use the route's name and Ninja will automatically insert the correct URI. This allows you to change your routes at a later time and Ninja will update all of the relevant links site-wide.
Looking for good references of such an implementation.. CI, Laravel, Kohana?
\Ninja\Resource::getSessionNamespace(..) must be getZendSessionNamespace()
\Ninja\Resource::getDb() should be ::getDoctrineDBALConnection()
This is in principle with keeping everything verbose.
Presently, page not found errors are being logged in production mode. This is not a problem, but undesirable behavior. Should be fix as early as possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.