Jump to content

Hari KT

Members
  • Posts

    126
  • Joined

  • Last visited

Posts posted by Hari KT

  1. Hi all,

    Have you guys came across http://github.com/puli/ ? I am not sure how processwire is going to make use of composer in 3.0 apart from namespace ( I didn't noticed in the newsletter or probably missed in the blog posts ) . But I believe the concept of  http://docs.puli.io/ combined with PSR-7 and composer will be a revolution in the PHP ( yet to see though ) .

    I wished if processwire in 3.0 would take some of the good concepts to make things smooth and easy.

  2. Hey Marcus, 

    Yes as dependency is a hell it is good to leave it to composer ;) . And as you know installing modules is simple as 

    composer require <vendor/packagename>

    The only thing to do is to keep a composer.json file for all the modules

    {
        "name": "vendor/package-name",
        "type": "pw-module",
        "description": "Your module what it does",
        "keywords": [ "keywords", "comma", "seprated"],
        "homepage": "https://github.com/harikt",
        "license": "BSD-2-Clause",
        "authors": [
            {
                "name": "Contributors",
                "homepage": "https://github.com/harikt"
            }
        ],
        "require": {
            "hari/pw-module": "~0.0.1"
        }
    }

    and add to packagist. The only things to note in composer.json is the 

    "type": "pw-module",

    and 

    "require": {
        "hari/pw-module": "~0.0.1"
    }
    

    We are all done. 

    Happy PhPing!

    • Like 2
  3. Hey @marcus 

    Regarding the module downloads, I am not sure if you noticed my earlier posts

    http://harikt.com/blog/2013/11/16/composer-support-for-processwire-modules/

    http://harikt.com/blog/2013/11/19/composer-support-for-processwire-part-2/

    That way we can install modules on the site/modules folder as we are doing with just composer.

    I am also missing how processwire will support composer in the future, if anyone can give some insights / links it may also help.

    EDIT : I am happy to change the vendor name and give to processwire if Ryan likes it.

    Thank you

    • Like 2
  4. @Kongondo sure. I will update here.

    Quick things : 

    * The ok() , err() methods were changed to log to PSR-3 logger.

    * All the $_POST values were changed to accept from the method. Eg dbSaveConfig($post) .

    $installer = new Installer($psr3logger);
    $installer->
    $installer->dbSaveConfig($post);
    

    As it is not using global values like `$_POST` and `$_SERVER` all values are passed to methods. Hope this helps!

    • Like 1
  5. Hi, 

    I was trying to build a command line installer for processwire . The script basically uses the install.php .

    case 0: 
        $this->initProfile(); 
        break;
    case 1: 
        $this->compatibilityCheck(); 
        break;
    case 2: 
        $this->dbConfig();  
        break;
    case 4: 
        $this->dbSaveConfig();  
        break;
    case 5: 
        require("./index.php"); 
        $this->adminAccountSave($wire); 
        break;
    

    What I am having trouble is at step 5 where it tries to create the user account. 

    It throws an exception

    Error: Exception: You do not have permission to execute this module - ProcessPageView (in /var/www/pwtest/hello/wire/core/Modules.php line 875)

    when 

    require 'index.php';
    

    is called. Is there something special to make the `index.php` throwing without an error ?

    Thank you

  6. Hi, 

    I was trying to show the system template on Selectorfield as asked over : https://processwire.com/talk/topic/9026-show-system-templates-on-selectorfield/

    Is there a way to make a hook like this work?

    public function init()
    {
        $this->addHookBefore('InputfieldSelector::render', $this, 'selectorField');
    }
    
    public function selectorField($event)
    {
        $inputSelector = $event->object;
        if ($event->object->name == 'field1') {
            $inputSelector->allowSystemTemplates = true;
            $event->return = $inputSelector;
            return $event->return;
        }    
    }
    

    Though I did this, it seems not working properly :( .

  7. Hi,

    Is there a way we can make the Selectorfield to choose system templates ?

    Currently I have created a Selectorfield and added to a template. Now when I create the page, the selector only shows the templates that are not system templates.

    I would like to show the system templates also in the list if possible.

  8. Was going through the ajax request. Below is the error I have got 

     TemplateFile: SQLSTATE[HY000]: General error: could not call class constructor
    
     #0 /var/www/ProcessWire/wire/core/Pages.php(0): PDOStatement->fetchObject()
     #1 /var/www/ProcessWire/wire/core/Pages.php(229): Pages->getById(Array, Array)
     #2 [internal function]: Pages->___find('parent_id=1, st...', Array)
     #3 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #4 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('find', Array)
     #5 /var/www/ProcessWire/wire/core/PageTraversal.php(78): Wire->__call('find', Array)
     #6 /var/www/ProcessWire/wire/core/PageTraversal.php(78): Pages->find('parent_id=1, st...', Array)
     #7 /var/www/ProcessWire/wire/core/Page.php(1033): PageTraversal->children(Object(Page), 'start=0, limit=...', Array)
     #8 /var/www/ProcessWire/wire/modules/Process/ProcessPageList/ProcessPageList.module(178): Page->children('start=0, limit=...')
     #9 [internal function]: ProcessPageList->___find('start=0, limit=...', Object(Page))
     #10 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #11 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('find', Array)
     #12 /var/www/ProcessWire/wire/modules/Process/ProcessPageList/ProcessPageList.module(165): Wire->__call('find', Array)
     #13 /var/www/ProcessWire/wire/modules/Process/ProcessPageList/ProcessPageList.module(165): ProcessPageList->find('start=0, limit=...', Object(Page))
     #14 /var/www/ProcessWire/wire/modules/Process/ProcessPageList/ProcessPageList.module(109): ProcessPageList->render()
     #15 [internal function]: ProcessPageList->___execute()
     #16 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #17 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('execute', Array)
     #18 /var/www/ProcessWire/wire/core/ProcessController.php(213): Wire->__call('execute', Array)
     #19 /var/www/ProcessWire/wire/core/ProcessController.php(213): ProcessPageList->execute()
     #20 [internal function]: ProcessController->___execute()
     #21 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #22 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('execute', Array)
     #23 /var/www/ProcessWire/wire/core/admin.php(85): Wire->__call('execute', Array)
     #24 /var/www/ProcessWire/wire/core/admin.php(85): ProcessController->execute()
     #25 /var/www/ProcessWire/site/modules/AdminThemeThinktag/controller.php(13): require('/var/www/Proces...')
     #26 /var/www/ProcessWire/site/templates/admin.php(13): require('/var/www/Proces...')
     #27 /var/www/ProcessWire/wire/core/TemplateFile.php(169): require('/var/www/Proces...')
     #28 [internal function]: TemplateFile->___render()
     #29 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #30 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('render', Array)
     #31 /var/www/ProcessWire/wire/modules/PageRender.module(356): Wire->__call('render', Array)
     #32 /var/www/ProcessWire/wire/modules/PageRender.module(356): TemplateFile->render()
     #33 [internal function]: PageRender->___renderPage(Object(HookEvent))
     #34 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #35 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('renderPage', Array)
     #36 /var/www/ProcessWire/wire/core/Wire.php(387): Wire->__call('renderPage', Array)
     #37 /var/www/ProcessWire/wire/core/Wire.php(387): PageRender->renderPage(Object(HookEvent))
     #38 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('render', Array)
     #39 /var/www/ProcessWire/wire/modules/Process/ProcessPageView.module(172): Wire->__call('render', Array)
     #40 /var/www/ProcessWire/wire/modules/Process/ProcessPageView.module(172): Page->render()
     #41 [internal function]: ProcessPageView->___execute()
     #42 /var/www/ProcessWire/wire/core/Wire.php(365): call_user_func_array(Array, Array)
     #43 /var/www/ProcessWire/wire/core/Wire.php(320): Wire->runHooks('execute', Array)
     #44 /var/www/ProcessWire/index.php(195): Wire->__call('execute', Array)
     #45 /var/www/ProcessWire/index.php(195): ProcessPageView->execute()
     #46 {main}
    
×
×
  • Create New...