arout / diamondphp Goto Github PK
View Code? Open in Web Editor NEWDiamond PHP is a fully featured framework built for PHP 7 and offers extreme performance, a modular architecture, elegant syntax and an easy to use philosophy.
License: MIT License
Diamond PHP is a fully featured framework built for PHP 7 and offers extreme performance, a modular architecture, elegant syntax and an easy to use philosophy.
License: MIT License
Example use case:
// Controller file
$data = [ 'name' => ['John', 'Doe' ], 'address' => [ '123 Main St.', 'Springfield', 'MO' ] ]
$user = $this->toolbox('sanitize)->xss($data);
foreach( $user as $info )
{
echo $info['name'][0] . ' ' . $info['name'][1];
}
In https://github.com/arout/diamondphp/blob/master/app/code/core/system/global.php#L6, a global declare(strict_types=1);
is called. This command, however, works on a per-file basis and should therefor be the first operation in every single PHP file in the repo to take any effect.
Currently, it only affects calls to methods and functions declared inside app/code/core/system/global.php
, but there aren't any there.
For more information, please refer to http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration.strict
Hello
It would be a good idea to adhere to the standards dictated by the PHP-FIG group; specifically the PSR-2 standard: http://www.php-fig.org/psr/psr-2/
It will be way easier to read the code :)
Since composer.json
and composer.lock
. Will keep your dependencies up-to-date I would recommend ignoring the vendor directory with .gitignore
.
See here for more information on this:
https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
At this time, access to the core/module code is mitigated by having an index.html
file in each module, but this is far from secure - anyone with knowledge of the project's structure could reach arbitrary files by simply typing their path into the address bar of their browser.
Ideally, this would mean having a separate web root that does not contain any core/module code and/or templates, but instead only contains the index.php
file and whatever frontend assets need to be reachable from the client's browser.
Instead of having a static configuration per project you could make use of an environment file that populates generic Config settings.
Example:
Project A will be released under a different branch name, now you have to clone the repo and commit configuration changes, or adjust them manually. Database credentials is a perfect example.
Using a (generated) environment file you don't have this inside your codebase.
Take a look at: https://github.com/vlucas/phpdotenv.
or, if still alive: https://github.com/hassankhan/config
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.