auraphp / aura.framework Goto Github PK
View Code? Open in Web Editor NEWComposes the various aura v1 packages into v1 framework.
Home Page: http://auraphp.com/manuals/v1/
License: BSD 2-Clause "Simplified" License
Composes the various aura v1 packages into v1 framework.
Home Page: http://auraphp.com/manuals/v1/
License: BSD 2-Clause "Simplified" License
Right now, the only time the 'default' system-level config file is loaded is when the mode is 'default'. If the mode is (e.g.) 'dev', only the 'dev' system-level config file gets loaded. The problem is in Aura\Framework\Boostrap\Factory::prep(), ~ lines 128 to 148.
When you look into https://github.com/auraphp/Aura.Framework/tree/develop/cli
We can notice we have a bunch of cli scripts .
When we look into the code of any class we can notice the code is same.
<?php
require dirname(dirname(__DIR__)) . '/Aura.Framework/src/Aura/Framework/Bootstrap/Factory.php';
$factory = new \Aura\Framework\Bootstrap\Factory;
$cli = $factory->newInstance('cli');
$return = $cli->exec(__FILE__);
exit($return);
But just the value passed as its dynamic the __FILE__
value is changing .
That means I wished if we can change the script to something like accepting from the command line itself the options .
I assume the system has a cli
folder with the aura
script and which can be run as
Eg :
php cli/aura something
Show some help and also list all the available
$di->params['Aura\Framework\Cli\Factory']['map']
array values removing the path and making it something like vendor.package.cli-name
which
$di->params['Aura\Framework\Cli\Factory']['map']["vendor.package.cli-name"]
than as in ["$system/package/Aura.Framework/cli/server"]
This removes so many scripts in the Aura.Framework/cli/
, make length written than the current one as
php package/Aura.Framework/cli/server
to
php cli/aura
Don't need the same scripts.
Thoughts.
When running via php 's own development server ,
the method in class Aura\Framework\Web\Front
public function request()
{
// match to a route
$path = $this->context->getServer('PATH_INFO', '/');
public function request()
{
// match to a route
$path = $this->context->getServer('REQUEST_URI', '/');
needs some change to route the corresponding routes . PATH_INFO
is only available for apache see http://php.net/manual/en/reserved.variables.server.php
I feel REQUEST_URI
works fine. @pmjones thoughts ? I can make the changes and push , let me know if its ok .
The assets has been moved to onhold.
We should need that for a release for framework level.
Currently Aura.Framework 's view ends with name <action-name>.php
Eg : https://github.com/auraphp/Aura.Framework/blob/develop/src/Aura/Framework/Web/Hello/views/world.php .
I was wondering what will happen if we want to render a json value.
I think its implemented ( https://github.com/auraphp/Aura.View/blob/develop/src/Aura/View/TwoStep.php#L512 ) , but I am still trying to figure out how to make use of it.
May I know how this is going to happen for I can also check on Mustache, Twig etc .
@pmjones , I Hope we had a discussion about using different templates from different packages. Not sure or remember we had it .
Currently setView()
method of Aura\Framework\Web\AbstractPage
set the path to the package controllers views and layouts .
I feel if we can set something like Package.Vendor:Controller:template
( This is something similar to Symfony2 is doing , not exactly :-) ) and then add this path , it makes life easier for the template finder to load.
Or do you think there is some other good way to do this ?
Also there can be a problem is the order the paths are set :P ( Not sure that will come when we do like these sort of rendering and sometimes may need to resolve this also )
Take Aura\Framework\Inflect
out, so it acts as a separate one.
Probably something called utilities ?
I have been using Inflector in various projects.
Hi Paul ,
Yesterday I was trying to figure out an error thrown as
404 Not Found
No controller found for '/fb/login'
Please check that your config has:
An Aura\Router\Map route for the path '/'
A ['values']['controller'] value for the mapped route
A $di->params['Aura\Framework\Web\Controller\Factory']['map'] entry for the controller value.
You can see I did added the path as
$di->get('router_map')->add('fb_login', 'fb/login', [
'values' => [
'controller' => 'facebook',
'action' => 'login',
],
]);
But you can see /
is missing.
Can we add more information or look into the system itself for the name and give a right answer ?
setInnerData
of TwoStep view is being called twice and data getting lost
$this->view->setInnerData( ['authors' => 'Hello World'] );
$this->view->setInnerView('list');
$this->view->setOuterView('layout');
@pmjones I was creating a ModelFactory
to get injected to the controller .
And I noticed the functionality is similar to the one we have in Aura\Framework\Web\Controller\Factory
. Wondering why not we make this class as a generic factory so we can inject this object to which all class we need.
Create a sample project probably a Blog example itself and document it on making use of the Aura components.
Problems faced
For Later :
Zend\Acl
for its removed in 2.0 with something different which we don't even know as in their Beta5 . So we need our own Aura.Security ?I feel there is a need of Priority based loading of the Aura Package config files.
Else many of the configurations will break.
Running package/Aura.Framework/cli/make-test
without arguments results in multiple PHP notice errors and a TestFileNotCreated
exception
Hey Paul,
I recently noticed a use case like rendering the view of an action inside the view.
$this->action('action-name', 'controller-name', 'module-name');
Which will call the action of the controller in the module. Do you think this approach is a good one to create widgets ?
The Aura.Di container not able to load, for the Aura\Di
is not registered in autoloader .
Catchable fatal error: Argument 1 passed to Aura\View\TwoStep::__construct() must be an instance of Aura\View\Template, null given in /media/Linux/aurasystem/package/Aura.View/src/Aura/View/TwoStep.php on line 142 Call Stack: 0.0001 125536 1. {main}() /media/Linux/aurasystem/web/index.php:0 0.0248 958816 2. Aura\Framework\Bootstrap\Web->exec() /media/Linux/aurasystem/web/index.php:12 0.0248 958868 3. Aura\Framework\Web\Controller\Front->exec() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Bootstrap/Web.php:71 0.0248 959196 4. Aura\Framework\Web\Controller\Front->request() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:166 0.0260 1009128 5. Aura\Framework\Web\Controller\Factory->newInstance() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:217 0.0260 1009356 6. Aura\Di\Forge->newInstance() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Factory.php:96 0.0290 1141808 7. Aura\Di\Lazy->__invoke() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Forge.php:96 0.0290 1141808 8. Aura\Di\Container->Aura\Di{closure}() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Lazy.php:55 0.0290 1141824 9. Aura\Di\Forge->newInstance() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Container.php:378 0.0297 1167152 10. Aura\Di\Lazy->__invoke() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Forge.php:96 0.0297 1167152 11. Aura\Di\Container->Aura\Di{closure}() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Lazy.php:55 0.0297 1167168 12. Aura\Di\Forge->newInstance() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Container.php:378 0.0302 1202036 13. call_user_func_array() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Forge.php:105 0.0302 1202400 14. Aura\View\TwoStep->__construct() /media/Linux/aurasystem/package/Aura.Di/src/Aura/Di/Forge.php:0
The version 1 have been broken for quite some time even after the merge on #52 .
It will be nice if a release is made for the same for if some tries let them see a Hello World .
When we try to remove the directory with rmdir()
,
https://github.com/auraphp/Aura.Framework/blob/master/tests/Aura/Framework/Mock/System.php#L41
and if the directory contains file , it will not remove the directory .
Why not use
exec( "rm -Rf " . $path->__toString() );
See build failure over
http://travis-ci.org/#!/harikt/system/builds/687058
phpunit in my system is not working :( , so not able to test it .
Hi @pmjones ,
There is a problem with the way we are autoloading the composer stuffs.
/media/Linux/aurasystem [develop] $ ls vendor/composer/
autoload_classmap.php autoload_namespaces.php autoload_real.php ClassLoader.php installed.json
You can notice autoload_real.php
. When I installed nette/nette
, the problem I noticed is nette uses its own loader.
"autoload": {
"files": ["Nette/loader.php"]
},
https://github.com/nette/nette/blob/debugger/composer.json#L27
Which is written in autoload_real.php
.
And the https://github.com/auraphp/Aura.Framework/blob/develop/src/Aura/Framework/Autoload/Loader.php#L34 will not load for we are only checking classmap
and namespace
. Wondering whether it is a good idea to completely relay on vendor/autoload.php
Thought ?
It may be good if we can make the config/_packages as
http://php.net/manual/en/function.parse-ini-file.php
This help us to comment the packages in ;
.
Currently it uses file
which gets things as array.
Else ;Hari.Sample
will throw error running package/Aura.Framework/cli/cache-classmap
etc.
Hello,
I try to execute cli commands as per statement on http://auraphp.com/manuals/v1/en/installation/.
Erroroutput:
$ php package/Aura.Framework/cli/server
Fatal error: Uncaught exception 'Aura\Framework\Exception\NoClassForController' with message 'D:\xampp\xampp\htdocs\mass\package\Aura.Framework\cli\server' in
mpp\htdocs\mass\package\Aura.Framework\src\Aura\Framework\Cli\Factory.php on line 72
Aura\Framework\Exception\NoClassForController: D:\xampp\xampp\htdocs\mass\package\Aura.Framework\cli\server in D:\xampp\xampp\htdocs\mass\package\Aura.Framewor
Framework\Cli\Factory.php on line 72
Call Stack:
0.0246 125208 1. {main}() D:\xampp\xampp\htdocs\mass\package\Aura.Framework\cli\server:0
0.0735 678024 2. Aura\Framework\Bootstrap\Cli->exec() D:\xampp\xampp\htdocs\mass\package\Aura.Framework\cli\server:5
0.0736 678240 3. Aura\Framework\Cli\Factory->newInstance() D:\xampp\xampp\htdocs\mass\package\Aura.Framework\src\Aura\Framework\Bootstrap\Cli.php:76
There is an issue I found trying to incorporate Mustache
Array
(
[Aura\Framework\Web\Controller\AbstractPage] => Aura\Framework\Web\Controller\AbstractPage
[Aura\Web\Controller\AbstractPage] => Aura\Web\Controller\AbstractPage
[Aura\Web\Controller\AbstractController] => Aura\Web\Controller\AbstractController
)
So I feel we need to remove one more array_pop($stack);
. I can send a PR for this if its confirmed or you can make the necessary changes..
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.