"Hello World!" - Extension & Skeleton Tool

Discussion forum for Extension Writers regarding Extension Development.
User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: "Hello World!" - Extension

Post by Lumpy Burgertushie » Mon Dec 14, 2015 3:29 am

but the point is, that the fact that the install folder needs to be deleted after install has nothing to do with installing extensions. extensions do not have a folder named install in them.

if you are installing phpbb then you would normally read the instructions for installing.

therefore, you would have already seen the instruction to delete that folder and it would not be there after you had installed a extension.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

AesirHod
Registered User
Posts: 13
Joined: Wed Nov 25, 2015 4:42 pm

Re: "Hello World!" - Extension

Post by AesirHod » Mon Dec 14, 2015 11:32 am

I initially thought the folder only needed deleting at the point where the board needs to be available to the public. Since this was just a local install for me to experiment and try things out, and I didn't know if I'd need it later on, I left it alone. I figured out the problem quickly enough and just posted here to help save time for others.

Speaking of experimentation, I'm struggling to find the part of this extension that actually stores the "Hello World" string and handles the click so I can experiment with changing the functionality. There was mention of a link to phpBB/app.php/demo/world, but I couldn't find which file contained that.

User avatar
posey
Registered User
Posts: 515
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Contact:

Re: "Hello World!" - Extension

Post by posey » Mon Dec 14, 2015 11:57 am

It's through the config/routing.yml. There the {name} variable is set. So what ever is put there is the name.

Then in controller/main.php there is this function.

Code: Select all

public function handle($name)
	{
		$l_message = !$this->config['acme_demo_goodbye'] ? 'DEMO_HELLO' : 'DEMO_GOODBYE';
		$this->template->assign_var('DEMO_MESSAGE', $this->user->lang($l_message, $name));
		return $this->helper->render('demo_body.html', $name);
	}
$l_message checks if we're saying "Hello" or "Goodbye", set from the ACP.
Then assigning a single template var, the 'DEMO_MESSAGE'.
Which holds the value of $this->user->lang($l_message, $name). Note that coding it like this is pretty much the same as: sprintf($this->user->lang['DEMO_HELLO'], $name), it's just easier as you don't have to use the sprintf part.
Then the return 'sets' the template. First parameter is the template file and the second is the Page Title.

Hope this helps ;)
Ultimate Extensions:
Image Ultimate Blog | Image Ultimate Points

''I'm pretty sure there's a lot more to life than being really, really, ridiculously good looking. And I plan on finding out what that is.''

LaxSlash1993
Registered User
Posts: 120
Joined: Sat Sep 22, 2012 2:20 am

Re: "Hello World!" - Extension

Post by LaxSlash1993 » Tue Dec 29, 2015 3:55 am

As per this tutorial relating to this extension: https://area51.phpbb.com/docs/dev/31x/e ... migrations

Code: Select all

<?php
/**
 *
 * This file is part of the phpBB Forum Software package.
 *
 * @copyright (c) phpBB Limited <https://www.phpbb.com>
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 * For full copyright and license information, please see
 * the docs/CREDITS.txt file.
 *
 */

namespace acme\demo\migrations;

use phpbb\db\migration\migration;

class add_module extends migration
{
    public function effectively_installed()
    {
        return isset($this->config['acme_demo_goodbye']);
    }

    static public function depends_on()
    {
        return array('\phpbb\db\migration\data\v31x\v314');
    }

    public function update_data()
    {
        return array(
            array('config.add', array('acme_demo_goodbye', 0)),

            array('module.add', array(
                'acp',
                'ACP_CAT_DOT_MODS',
                'ACP_DEMO_TITLE'
            )),

            array('module.add', array(
                'acp',
                'ACP_DEMO_TITLE',
                array(
                    'module_basename'       => '\acme\demo\acp\main_module',
                    'modes'                         => array('settings'),
                ),
            )),
        );
    }
}
returns:

Code: Select all

mod_fcgid: stderr: PHP Fatal error:  Cannot redeclare class acme\\demo\\migrations\\add_module in /var/www/clients/client0/web2/web/forum/ext/acme/demo/migrations/migration.php on line 51

Sajaki
Registered User
Posts: 1314
Joined: Mon Mar 02, 2009 1:41 pm
Name: Andreas
Contact:

Re: "Hello World!" - Extension

Post by Sajaki » Sun Jan 31, 2016 9:54 am

For the visually inclined like me, i tried to picture the logic flow involved in acme.demo.
acme.demo.png

mike2003
Registered User
Posts: 83
Joined: Sun Mar 20, 2016 12:10 am

Re: "Hello World!" - Extension & Skeleton Tool

Post by mike2003 » Mon Apr 04, 2016 7:12 am

does not work?
Fatal error: Class 'Symfony\Component\Finder\Finder' not found in C:\xampp\htdocs\phpBB32\ext\phpbb\skeleton\helper\packager.php on line 201
after Submit

User avatar
david63
Jr. Extension Validator
Posts: 12971
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: "Hello World!" - Extension & Skeleton Tool

Post by david63 » Mon Apr 04, 2016 7:52 am

mike2003 wrote:does not work?
Fatal error: Class 'Symfony\Component\Finder\Finder' not found in C:\xampp\htdocs\phpBB32\ext\phpbb\skeleton\helper\packager.php on line 201
after Submit
Known issue - see viewtopic.php?f=64&t=2366391
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email or as they will be ignored

mike2003
Registered User
Posts: 83
Joined: Sun Mar 20, 2016 12:10 am

Re: "Hello World!" - Extension & Skeleton Tool

Post by mike2003 » Mon Apr 04, 2016 8:01 am

i am use 3.1.8 not 3.2

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20365
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: "Hello World!" - Extension & Skeleton Tool

Post by RMcGirr83 » Mon Apr 04, 2016 10:03 am

Finder is not within 3.1.8, it is only in 3.2.*
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

mike2003
Registered User
Posts: 83
Joined: Sun Mar 20, 2016 12:10 am

Re: "Hello World!" - Extension & Skeleton Tool

Post by mike2003 » Mon Apr 04, 2016 10:14 am

this ext in 3.1.*
Image
why??

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20365
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: "Hello World!" - Extension & Skeleton Tool

Post by RMcGirr83 » Mon Apr 04, 2016 11:05 am

Do you see a 3.2 forum?
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

mike2003
Registered User
Posts: 83
Joined: Sun Mar 20, 2016 12:10 am

Re: "Hello World!" - Extension & Skeleton Tool

Post by mike2003 » Mon Apr 04, 2016 11:48 am

How is it run on a 3.1.8?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20365
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: "Hello World!" - Extension & Skeleton Tool

Post by RMcGirr83 » Mon Apr 04, 2016 3:07 pm

Currently, you have to install composer and then run composer update to get the dependencies. Not for the faint of heart nor for those less knowledgeable.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

mike2003
Registered User
Posts: 83
Joined: Sun Mar 20, 2016 12:10 am

Re: "Hello World!" - Extension & Skeleton Tool

Post by mike2003 » Mon Apr 04, 2016 3:31 pm

About which "composer" you talking about?
I have this EXT and phpbb 3.1.8

User avatar
david63
Jr. Extension Validator
Posts: 12971
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: "Hello World!" - Extension & Skeleton Tool

Post by david63 » Mon Apr 04, 2016 3:35 pm

mike2003 wrote:About which "composer" you talking about?
I have this EXT and phpbb 3.1.8
If you do not know about "Composer" then I would suggest that you Google it.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email or as they will be ignored

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests

cron