PHP process based on choosing specific sample data in Joomla! 3.x installer

46 views
Skip to first unread message

Soheil Novinfard

unread,
Nov 3, 2012, 8:37:41 AM11/3/12
to Joomla! General Development
hello dears,

As you know, you can add some extra sample data to Joomla! installer
in 3.x version. But the only process based on choosing specific sample
data is running one sql file (for example: sample_blog.sql). But I
want to have some PHP process based on choosing specific sample data;
for example deleting some templates or extracting some zip files. Is
it possible in Joomla! 3.0 ?

Thanks
Novinfard

Mark Dexter

unread,
Nov 3, 2012, 11:26:25 AM11/3/12
to Joomla! General Development
Interesting idea. I don't think it is possible at this time. One approach would be to package sample data as an extension. Then we could use the normal installation process, including pre-flight and post-flight PHP programming (as well as SQL). That might tie into a feature we really want which is to install sample data from a list of remote sites (instead of having them included in the archive package). 

So we would just need a way to install extensions from remote sites during installation. Or perhaps just include extension installation as a last step in the normal installation process. Could tie in nicely to the idea of an extension marketplace, with sample data just being one part of the marketplace.

Going to an extension shopping cart is a natural thing to do right after installation imo, and the sample data could fit into that.

Of course a simpler approach for the short run would be to package the sample data as an extension and trigger an extension install where we currently do the sample data install. We could use the install from url option and thus no longer require the sample data files to be included in the archive package.

Some interesting possibilities here. Just needs someone to do some work and propose some code...

Mark


Novinfard

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.


Paul Orwig

unread,
Nov 3, 2012, 11:41:49 AM11/3/12
to joomla-de...@googlegroups.com
Lots of great ideas here!

Would it make sense to extend the work that's been done for the backend Language Manager to support features like this?

paul

Soheil Novinfard

unread,
Nov 3, 2012, 3:34:14 PM11/3/12
to joomla-dev-general
In basic level of this idea, we can just add something like script.php that we already had in extension installation. It means that we could have some class definition for each sample sql file and then event is called when sample data step is completed. 

for example suppose we have sample_blog.sql . we would add sample_blog.php in same folder and have something like this in these file:

class BlogInstallerSample
{
/**
* method to install the sample content
*
* @return void
*/
function BeforeSQLExec($parent) 
{
// All processes before executing related sample data SQL queries
}
function AfterSQLExec($parent)
{
// All processes after executing related sample data SQL queries
}
}

elin

unread,
Nov 5, 2012, 3:11:49 PM11/5/12
to joomla-de...@googlegroups.com
@Paul

We definitely see the language work as the proof of concept for the sample data as well as some other items we might want to install from remote.

@Soheil

I'm not sure why it's not easier to package the sample data the way you want it. Adding and removing things,depending what they are, is not simple especially as we move toward treating more and more items as assets.
That said you can just run a cli job to do all the changes you want as long as you use the correct apis. 

Elin
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

Thomas PAPIN

unread,
Nov 5, 2012, 4:04:45 PM11/5/12
to joomla-de...@googlegroups.com
I like the idea of a "joomla store" :-) or joomla repository.

One other idea, would be to create an "export function" to be able to create "sample data" file. We should be able to choose what we want to export, users, categories, contents, ACL,etc..
And it will be a most but quite complicated to provide an API to export any third party component. This API will ask component for the list of SQL tables and files to save in a generic way.

Thomas


2012/11/5 elin <elin....@gmail.com>
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/noPXxHcx1LYJ.

To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

elin

unread,
Nov 5, 2012, 11:09:23 PM11/5/12
to joomla-de...@googlegroups.com
It's a bit more complicated than that. But you can already do that pretty easily, what we need is for the platform maintainers to agree that it's a bug that data are not exported along with structure and also for someone to write the exporter for sql srv.

I made a page in the wiki about how to do it manually which is a lot less time than writing a component to do it.  But if you want to write that component it would be a great contribution to the community a would a perhaps simpler platform application for doinfg that.

Elin

2012/11/5 elin <elin....@gmail.com>

To unsubscribe from this group, send email to joomla-dev-general+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.

To unsubscribe from this group, send email to joomla-dev-general+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.

To unsubscribe from this group, send email to joomla-dev-general+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/noPXxHcx1LYJ.

To post to this group, send an email to joomla-de...@googlegroups.com.

Thomas PAPIN

unread,
Nov 6, 2012, 8:20:51 AM11/6/12
to joomla-de...@googlegroups.com
Do you have a direct link on the wiki for that ?



2012/11/6 elin <elin....@gmail.com>
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/mXvUM4LZsIIJ.

To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

elin

unread,
Nov 7, 2012, 6:13:21 PM11/7/12
to joomla-de...@googlegroups.com
http://docs.joomla.org/Create_sample_data  very first result in google "joomla create sample data"

Elin


2012/11/6 elin <elin....@gmail.com>
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/mXvUM4LZsIIJ.

To post to this group, send an email to joomla-de...@googlegroups.com.

piotr_cz

unread,
Nov 8, 2012, 7:20:52 AM11/8/12
to Joomla! General Development
Along with different sample data, one would select one of bundles of
core extensions to install (packed as packages).

On Nov 3, 4:26 pm, Mark Dexter <dextercow...@gmail.com> wrote:
> Interesting idea. I don't think it is possible at this time. One approach
> would be to package sample data as an extension. Then we could use the
> normal installation process, including pre-flight and post-flight PHP
> programming (as well as SQL). That might tie into a feature we really want
> which is to install sample data from a list of remote sites (instead of
> having them included in the archive package).
>
> So we would just need a way to install extensions from remote sites during
> installation. Or perhaps just include extension installation as a last step
> in the normal installation process. Could tie in nicely to the idea of an
> extension marketplace, with sample data just being one part of the
> marketplace.
>
> Going to an extension shopping cart is a natural thing to do right after
> installation imo, and the sample data could fit into that.
>
> Of course a simpler approach for the short run would be to package the
> sample data as an extension and trigger an extension install where we
> currently do the sample data install. We could use the install from url
> option and thus no longer require the sample data files to be included in
> the archive package.
>
> Some interesting possibilities here. Just needs someone to do some work and
> propose some code...
>
> Mark
>
Reply all
Reply to author
Forward
0 new messages