Pagekit CLI

  • Hi,

    the provider of one of my customers does not allow to run php scripts in php-cli-mode. :cursing:

    I wanted to call some command by cronjob. At first glance this is not possible.

    Now i have following idea to create an workarround for that.

    I would copy the index.php from the pagekit root directroy to an folder that's protected by .htaccesslike this:

    1. deny from all

    With that config, the file is not reachable from the web. Then i would change the index.php to this:

    What do you think about that? Is that an Security Problem?

  • Hm... I don't really get what you want to archive. You can not run PHP-CLI. Okay... So you created an index.php and changed the environment to console, right?

    After that, you deleted…b/develop/index.php#L7-L9. Alright... But I don't really get what you'd like to archive... You would like to run a CLI script without parameters changing the environment? Why? ;)

    For me, this is quite... well... smelly :D Changing the provider isn't an option?

  • Pagekit itself has implemented a check that ensures that php pagekit can only be called in CLI mode. Since the provider does not support this, I would like to build an alternative entry point that bypasses the CLI check.

    Because when I call my provider in the shell php pagekit, I always get the message that it has to be called in the command line.

    I would then put the new entry point into a directory of my component and protect it with an .htaccess file from outside. So I can only call it from the shell.