CLI debugging question

Permalink
I have a few C5 scripts that run on the CL and there, therefore, use the C5 program caller of ..

concrete/bin/concrete5 c5:exec src/myscript.php


this works ok, but it makes it impossible to debug as I can't run the script from within my IDE (NetBeans).

Once upon a time, I had a PHP template that properly loaded all the stuff C5 needs and in there I could put my code and run the script directly. I don't have it anymore, and it would be quite outdated by now. I am wondering if anyone has such a template or knows how to make one.
Thanks

ntisithoj
 
ntisithoj replied on at Permalink Best Answer Reply
ntisithoj
I figure it out. Posting here in case someone, someday, has teh same issues

#!/usr/bin/env php
<?php
$DIR_BASE="/my/working/dir/";
require $DIR_BASE . '/concrete/bootstrap/configure.php';
require $DIR_BASE. '/concrete/bootstrap/autoload.php';
$app = require $DIR_BASE . '/concrete/bootstrap/start.php';
use \Core as Core;
use \Config as Config;
use \Page as Page;
...
<additional "use" commands>
...
<rest of your code>


Note: with this addition usign only

use Core;


throws a warning about useless args or something... you need to use "use" thusly

use \Core as Core;