Sample application

151 views
Skip to first unread message

Hari K T

unread,
Jun 20, 2013, 12:41:10 PM6/20/13
to aur...@googlegroups.com
Hi guys,

It has been quite a long time, I have been planning to push a sample application.

But took quite some time to do it. So finally I moved to propel for generating a quick model and integrating it with aura .

The application is located at
There are still more things to be changed / worked on .

I will be working in my free time for the same. If you have any queries feel free to ask in github or here .

Thanks

Jeff Surgeson

unread,
Jun 20, 2013, 4:07:12 PM6/20/13
to aur...@googlegroups.com
Hi Hari

Nice one, thanks for the example.
Small request, a bit more direction on getting the database up and running, propel?

Regards
JeffS

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hari K T

unread,
Jun 20, 2013, 9:45:26 PM6/20/13
to aur...@googlegroups.com
I tried to cover it in the read me. Doesn't it helped ?

The data folder contains bookstore.sql . You can open the file and run in your favourite  tool like phpmyadmin or adminer or from cli itself .

Change the settings such as database , username and password in the config/runtime-conf.xml .

And run the command as in the readme .

../../vendor/bin/propel config:convert-xml --output-dir=config --input-dir=config

I assume you are in the directory Hari.Sample .

That's it .

start

php -S localhost:8000 web/index.php ;) .

Thanks

Jeff Surgeson

unread,
Jun 21, 2013, 1:43:48 AM6/21/13
to aur...@googlegroups.com
Hi Hari

> I tried to cover it in the read me. Doesn't it helped ?

You did, just did not read and look first properly :(
Thanks

Jeff Surgeson

unread,
Jun 21, 2013, 2:31:09 AM6/21/13
to aur...@googlegroups.com
Hari, when running composer require hari/sample I get the following
error, what am I doing wrong?

Please provide a version constraint for the hari/sample requirement: dev
composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package hari/sample dev could not be found.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to
your minimum-stability setting
see
<https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion>
for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for
further common problems.

Installation failed, reverting composer.json to its original content.
jeff@jeffs:/var/www/sandbox/auraphp/sampleproject$

Hari K T

unread,
Jun 21, 2013, 9:55:48 AM6/21/13
to aur...@googlegroups.com
Hey ,

Sorry for that. Do like this

composer require hari/sample dev-master

Hope that helps!
--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+unsubscribe@googlegroups.com.

Jeff Surgeson

unread,
Jun 21, 2013, 10:07:30 AM6/21/13
to aur...@googlegroups.com
Hi Hari

Now get the following:

jeff@jeffs:/var/www/sandbox/auraphp/sampleproject$ composer require
hari/sample dev-master
composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for hari/sample dev-master -> satisfiable by
hari/sample[dev-master].
- Conclusion: remove aura/framework dev-develop
- hari/sample dev-master requires aura/framework >=1.0.0-beta7 ->
satisfiable by aura/framework[1.0.0-beta7, dev-master].
- Can only install one of: aura/framework[dev-develop, 1.0.0-beta7].
- Can only install one of: aura/framework[dev-master, dev-develop].
- Installation request for aura/framework dev-develop ->
satisfiable by aura/framework[dev-develop].


Installation failed, reverting composer.json to its original content.
jeff@jeffs:/var/www/sandbox/auraphp/sampleproject$

> composer require hari/sample dev-master

Hari K T

unread,
Jun 21, 2013, 10:50:45 AM6/21/13
to aur...@googlegroups.com
can you show me the composer.json of the system ?

Jeff Surgeson

unread,
Jun 21, 2013, 2:15:14 PM6/21/13
to aur...@googlegroups.com
{
"minimum-stability": "dev",
"require": {
"aura/installer-system" : "1.0.0",
"aura/framework" : "dev-develop",
"aura/demo" : "dev-develop"

Hari K T

unread,
Jun 21, 2013, 9:50:37 PM6/21/13
to aur...@googlegroups.com
Hi Jeff,

a work around for the time.

In your composer add

{

    "minimum-stability": "dev",
    "require": {
        "aura/installer-system" : "1.0.0",
        "aura/framework"        : "dev-develop",
        "propel/propel": "2.0.0-alpha1",
        "hari/sample"             : "dev-master"
    }
}

composer update

If this doesn't work, please remove hari/sample, so your composer will look like

{

    "minimum-stability": "dev",
    "require": {
        "aura/installer-system" : "1.0.0",
        "aura/framework"        : "dev-develop",
        "propel/propel": "2.0.0-alpha1"
    }
}

composer update

and now clone the repo .

cd package

The data folder contains the bookstore.sql , please import it via phpmyadmin , and also change the settings in runtime-conf.xml and run the commands as in the README.md

Hope that helps.

On Fri, Jun 21, 2013 at 11:45 PM, Jeff Surgeson <je...@3hex.co.za> wrote:
{

Hari K T

unread,
Jun 22, 2013, 12:16:35 AM6/22/13
to aur...@googlegroups.com
Thank you Jeff for reporting the issue.

I understood the problem is for require hari/sample will not be installed by composer for there is no stable version and also the propel is in alpha. So the minimal stability flag is needed . For the aura/framework I used >=beta7 which also conflicts  with the one dev-develop .

So the best way is to add to the composer.json hari/sample .


{
    "minimum-stability": "dev",
    "require": {
        "aura/installer-system" : "1.0.0",
        "aura/framework"        : "dev-develop",
        "hari/sample"             : "dev-master"
    }
}

and run

composer update

Thanks

Jeff Surgeson

unread,
Jun 22, 2013, 4:31:14 AM6/22/13
to aur...@googlegroups.com
Hi Hari

Thanks that seemed to work, loaded lots of sympony and other stuff, is
the a requirement?
Anyway I am able to run the app except that trying to acces the posts
table results in this, does it make sense to you?

Fatal error: Uncaught exception 'Aura\Autoload\Exception\NotReadable'
with message 'Hari\Sample\Model\PostTableMap #0:
/var/www/sandbox/auraphp/sampleproject/package/Hari.Sample/src
#1/var/www/sandbox/auraphp/sampleproject/include:.:/usr/share/php:/usr/share/pear'
in
/var/www/sandbox/auraphp/sampleproject/package/Aura.Autoload/src/Aura/Autoload/Loader.php:342
Stack trace: #0 [internal function]:
Aura\Autoload\Loader->load('Hari\Sample\Mod...') #1 [internal function]:
spl_autoload_call('Hari\Sample\Mod...') #2
/var/www/sandbox/auraphp/sampleproject/vendor/propel/propel/src/Propel/Runtime/Map/DatabaseMap.php(178):
class_exists('Hari\Sample\Mod...') #3
/var/www/sandbox/auraphp/sampleproject/vendor/propel/propel/src/Propel/Runtime/ActiveQuery/BaseModelCriteria.php(144):
Propel\Runtime\Map\DatabaseMap->getTableByPhpName('Hari\Sample\Mod...')
#4
/var/www/sandbox/auraphp/sampleproject/vendor/propel/propel/src/Propel/Runtime/ActiveQuery/BaseModelCriteria.php(40):
Propel\Runtime\ActiveQuery\BaseModelCriteria->setModelName('\Hari\S in
/var/www/sandbox/auraphp/sampleproject/package/Aura.Web/src/Aura/Web/Controller/AbstractPage.php
on line 327

Hari K T

unread,
Jun 22, 2013, 11:19:32 AM6/22/13
to aur...@googlegroups.com
Propel uses many of the Symfony components.

About your problem loading the files. I think it is with the read permission issue .

A quick hack : can you run

chmod -R 644 package/Hari.Sample/src

If you don't have permission , run as super user. ie

sudo chmod -R 644 package/Hari.Sampl/src

Jeff Surgeson

unread,
Jun 22, 2013, 3:37:12 PM6/22/13
to aur...@googlegroups.com
Hi Hari

Not a permissions problem, all dir's are 775 and owned by www-data

Hari K T

unread,
Jun 23, 2013, 12:54:30 AM6/23/13
to aur...@googlegroups.com
Thanks man for reporting the issue.

Just run composer update .

Here is the fix what I did

$loader->setMode(\Aura\Autoload\Loader::MODE_SILENT);

Add to

package/Hari.Sample/config/default.php

If you still got the error .

add

require dirname(__DIR__) . '/vendor/autoload.php';

in your web/index.php

Thanks and experiment it ;) .

Jeff Surgeson

unread,
Jun 23, 2013, 3:12:26 AM6/23/13
to aur...@googlegroups.com
Hi Hari

composer update got rid of autoloader error
I see that you now have to add user/pass/dbname in 2 places now, runtime-conf and config?

Question: should I be able to login and add a post with existing code?
If so, i manualy added a user/pass to user table, logging in does not appear to work, doe not generate any error.
Post option does not display any form to add post

Hari K T

unread,
Jun 23, 2013, 12:11:18 PM6/23/13
to aur...@googlegroups.com
Hey,
composer update got rid of autoloader error

cool .
 
I see that you now have to add user/pass/dbname in 2 places now, runtime-conf and config?

You can change in the runtime-conf.xml and the /vendor/bin/propel command can generate the config/config.php file .


Question: should I be able to login and add a post with existing code?

You can register a user from

/register

page .
 
If so, i manualy added a user/pass to user table, logging in does not appear to work, doe not generate any error.

If you manually enter the username and password, it will not get hashed with bcrypt as that of ircmaxwell/password_* library .
 
Post option does not display any form to add post


/post/add once you logged in will give you,


Thanks
 
Thanks man for reporting the issue.

Just run composer update .

Here is the fix what I did

$loader->setMode(\Aura\Autoload\Loader::MODE_SILENT);

Add to

package/Hari.Sample/config/default.php

If you still got the error .

add

require dirname(__DIR__) . '/vendor/autoload.php';

in your web/index.php

Thanks and experiment it ;) .

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.

Jeff Surgeson

unread,
Jun 23, 2013, 12:47:16 PM6/23/13
to aur...@googlegroups.com
Hi Hari

Thanks, have php5.4.9 installed, password_hash() needs >=5.5
But appears everything should work once that is sorted.

Question, why are you using so many "other" tools for the db stuff, what it missing with the default Aura stuff
that stops you?

Thanks again for all your effort, and sorry to be such a pain :)

Hari K T

unread,
Jun 24, 2013, 1:20:24 AM6/24/13
to aur...@googlegroups.com
Hi Jeff,

Thanks, have php5.4.9 installed, password_hash() needs >=5.5

no. I am using ircmaxell/password_compat library which is forward compatibility .


See the read me https://github.com/ircmaxell/password_compat#password_compat
 
But appears everything should work once that is sorted.

So this should work :-) .


Question, why are you using so many "other" tools for the db stuff, what it missing with the default Aura stuff
that stops you?

I am not too good in making model, or I feel there needs a better model implementation when you show an example.

I am not interested to say it can be written better, for that is really a good way to teach people for it is our lack of information we hide.

I am also not sure how the better way to in-corporate Aura.Marshal and Aura.Sql even though I have already did the same in some examples.

https://github.com/harikt/HariSample/tree/master/src/Hari/Sample/Model

Note that the name is HariSample and missing the dot .

At some point of time I will try to bring Aura.Sql with Aura.Marshal .
 

Thanks again for all your effort, and sorry to be such a pain :)


Not at all . I am alright to answer anything what I know.

Thanks for your time, testing and asking me to make it better.

Jeff Surgeson

unread,
Jun 24, 2013, 2:11:50 AM6/24/13
to aur...@googlegroups.com
Hi Hari,

no. I am using ircmaxell/password_compat library which is forward compatibility .
See the read me https://github.com/ircmaxell/password_compat#password_compat

Was the password_compat lib installed with the other libs?
It appears not, as I get:

wtf ? Fatal error: Call to undefined function password_hash() in /var/www/sandbox/auraphp/sampleproject/package/Hari.Sample/src/Hari/Sample/Model/User.php on line 13

I assume that I should install it myself?

Question, why are you using so many "other" tools for the db stuff, what it missing with the default Aura stuff
that stops you?

I am also not sure how the better way to in-corporate Aura.Marshal and Aura.Sql even though I have already did the same in some examples.
https://github.com/harikt/HariSample/tree/master/src/Hari/Sample/Model
Note that the name is HariSample and missing the dot .
At some point of time I will try to bring Aura.Sql with Aura.Marshal .

What i am really trying to establish, is Aura capable of doing what you have done with this example, on its own, just using its own sql classes, without propel and all the other external propel stuff you used?

Hari K T

unread,
Jun 24, 2013, 4:08:35 AM6/24/13
to aur...@googlegroups.com
Hi ,

>
> Was the password_compat lib installed with the other libs?
> It appears not, as I get:
>
> wtf ? Fatal error: Call to undefined function password_hash() in
> /var/www/sandbox/auraphp/sampleproject/package/Hari.Sample/src/Hari/Sample/Model/User.php
> on line 13

Actually it should . See
https://github.com/harikt/Hari.Sample/blob/master/composer.json#L29

>
> I assume that I should install it myself?

Hm, the problem here is with Aura.Autoload not able to load the
password library by itself .

Please add the one line to

dirname(__DIR__) . '/vendor/autoload.php';

in web/index.php

See the issue https://github.com/auraphp/Aura.Framework/issues/39

>
>> Question, why are you using so many "other" tools for the db stuff, what
>> it missing with the default Aura stuff
>> that stops you?
>
>
> I am also not sure how the better way to in-corporate Aura.Marshal and
> Aura.Sql even though I have already did the same in some examples.
> https://github.com/harikt/HariSample/tree/master/src/Hari/Sample/Model
> Note that the name is HariSample and missing the dot .
> At some point of time I will try to bring Aura.Sql with Aura.Marshal .
>
>
> What i am really trying to establish, is Aura capable of doing what you have
> done with this example, on its own, just using its own sql classes, without
> propel and all the other external propel stuff you used?

okey.

Hari K T

unread,
Jun 24, 2013, 4:11:32 AM6/24/13
to aur...@googlegroups.com
Probably I missed to write something.

>> What i am really trying to establish, is Aura capable of doing what you have
>> done with this example, on its own, just using its own sql classes, without
>> propel and all the other external propel stuff you used?
>

Propel is not that bad :-) . You should see the power of behaviours ;-) .

and I agree what you mean by not using Propel, but my time is limited
and not working with aura at office.

I am just trying to push when I get some free time in between family and all .

Thanks

Jeff Surgeson

unread,
Jun 24, 2013, 4:28:47 AM6/24/13
to aur...@googlegroups.com
Hi Hari
> Hm, the problem here is with Aura.Autoload not able to load the
> password library by itself .
> Please add the one line to
> dirname(__DIR__) . '/vendor/autoload.php';
> in web/index.php
Sorry did not fix the problem :(

Hari K T

unread,
Jun 24, 2013, 4:52:57 AM6/24/13
to aur...@googlegroups.com
can you share

ls -la vendor

If there is no ircmaxwell folder .

Try removing composer.lock and re run

composer update

Hope that will install it.

Thanks

Jeff Surgeson

unread,
Jun 24, 2013, 5:09:19 AM6/24/13
to aur...@googlegroups.com
On 24/06/2013 10:52, Hari K T wrote:
> can you share
> ls -la vendor
aura
autoload.php
bin
composer
ircmaxwell
.placeholder
propel
psr
symfony

All libs appear to be installed and dir's contain the libs
> If there is no ircmaxwell folder .
Yes there is
> Try removing composer.lock and re run
> composer update
> Hope that will install it.
No change
error is now just:
wtf ?

Jeff Surgeson

unread,
Jun 24, 2013, 5:14:06 AM6/24/13
to aur...@googlegroups.com
Hi Hari, dont know if it makes any sense to you but:

With - require dirname(__DIR__) . '/vendor/autoload.php'; added to
web/index.php the error is just:
wtf?

If you remove that line the error is:

Hari K T

unread,
Jun 24, 2013, 5:21:57 AM6/24/13
to aur...@googlegroups.com
Oh man ,

sorry I was wondering why you was sending me wtf the whole time :P .

Just noticed .

https://github.com/harikt/Hari.Sample/blob/master/src/Hari/Sample/Web/User/Page.php#L67

I will remove the exit and echo :-) .

It got added accidently .

Hari K T

unread,
Jun 24, 2013, 5:58:15 AM6/24/13
to aur...@googlegroups.com
I got you.

Sorry for all the troubles.

https://github.com/harikt/Hari.Sample/commit/f69c4f5dbf541b91483c81e9d3ac228217c1a585

I have verified my self to check whether this works!

Jeff Surgeson

unread,
Jun 24, 2013, 6:13:25 AM6/24/13
to aur...@googlegroups.com
Hi Hari

Seems to have done the trick, can register, login and add post
Just a small thing top navbar still shows "logged in as username", not
my user name

Good work:)

Hari K T

unread,
Jun 24, 2013, 6:33:27 AM6/24/13
to aur...@googlegroups.com


Hey
 

Seems to have done the trick, can register, login and add post

Good ;) .
 
Just a small thing top navbar still shows "logged in as username", not
my user name

he he not implemented yet. Just pushed too fast seeing many comments like

http://colabti.org/irclogger/irclogger_log/auraphp?date=2013-06-19#l81

and many places.

Consider adding a view helper which can inject the session handler and show login / logout and showing the logged in user name if the user login.
 

Jeff Surgeson

unread,
Jun 24, 2013, 6:56:20 AM6/24/13
to aur...@googlegroups.com
Hi Hari

I agree, for me the biggest problem with aura (at this point) is the
lack of real world examples, so this example
you have just done goes a long way to changing that.

Having said that, in my humble opinion the examples should be purely
Aura based, no optional components, or
at least show Aura only solutions to real world examples with optional
examples that make use of other components.

Until Aura can do everything a framework needs to do, or at very least
as much as Solar framework can do, it is going to
be difficult for us mere mortals to work with, unlike the magicians like
Paul and yourself that can conjure up just about
anything using anything.

I prefer not to mix and match components.

Hari K T

unread,
Jun 24, 2013, 8:54:24 AM6/24/13
to aur...@googlegroups.com
> I prefer not to mix and match components.

I too love to see a complete implementation based on aura components itself.

Looking through my eyes, I feel it will take quite some time to see a
complete implementation of aura framework for I feel many of the
components 2.0 will come once fig moves to PSR-X autoloader or may be
something different.

Jeff Surgeson

unread,
Jun 24, 2013, 9:06:26 AM6/24/13
to aur...@googlegroups.com
Pity, I would really like to start using it now in place of my Solar
framework.
I just wish I was able and contribute code at the required level to help
moves things along.
All the same Paul and the the rest of you guys are doing an awesome job,
keep it up.


Reply all
Reply to author
Forward
0 new messages