Page 2 of 6

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 2:46 pm
by manu
No. I start the XAMPP control panel which starts the httpd Service.
I don't have a better idea than just write a little setpath.bat batch file which I start first when the phing thing doesn't run as expected:

Code: Select all

set path=vendor\bin;node_modules\.bin;%PATH%

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 2:52 pm
by cmb
manu wrote:I don't have a better idea than just write a little setpath.bat batch file which I start first when the phing thing doesn't run as expected:
That's an option.
manu wrote:No. I start the XAMPP control panel which starts the httpd Service.
Okay, but how do you start the command shell?

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 4:38 pm
by manu
cmb wrote:Okay, but how do you start the command shell?
SHIFT+right click on the XH working directory "open command line here"

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 5:15 pm
by cmb
manu wrote:
cmb wrote:Okay, but how do you start the command shell?
SHIFT+right click on the XH working directory "open command line here"
Well, if you start cmd.exe directly, the value of PATH is determined by the setting of environment variables only. At first comes the system wide PATH, followed by the user specific PATH. Both can be viewed and modified in the same dialog (or the registry). If you want a certain directory to be searched first, simply prepend it to the system wide PATH setting.

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 5:38 pm
by manu
Do you have a better idea to do this?
Also, do you have additional info to get PhpDocumentor running. I got it running a while ago but I deleted and forgot, sigh. PhpDocumentor is runnig as preinstalled in XAMPP, but I might have to adapt a phpDocumentor.ini somewhere.. and set a pear data_dir...

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 23, 2014 6:13 pm
by cmb
manu wrote:Do you have a better idea to do this?
You mean modifying the PATH? Not really; I just do it everytime I open a new shell.
manu wrote:Also, do you have additional info to get PhpDocumentor running.
PhpDocumentor 1 is a problem, I agree. Actually, we should switch to phpDocumentor 2 which can be installed via Composer and is maintained. But even 2.8.1 doesn't support @global tags, it seems. A dilemma!

Did you try running PhpDocumentor form the XAMPP shell (control panel -> shell)? This sets several environment variables which might be missing otherwise. And/or maybe you have to reinstall it via PEAR?

Re: how I ride the bullet - how I set up a testing environme

Posted: Wed Dec 24, 2014 1:05 am
by cmb
I actually did some tests with phpDocumentor 2, and all in all I think it's a nice improvement compared to PhpDocumentor 1. In particular, I very much like the interactive features of the "responsive-twig" template, such as toggling members by visibility and by inheritance. And of course it looks much more modern (You eat with your eyes!). A demo is available at http://demo.phpdoc.org/Responsive/, BTW.

It seems to me that it makes sense to upgrade to phpDocumentor 2 when we drop PHP 4 support and use PHP 5 features, because the documentation would hugely benefit of the improved support for member visibility and the documentation of exceptions (@throws). The missing support for @global is a problem, but maybe somebody will tackle it in the meantime (even a partial implementation might suffice for our purposes), and IMO we should get rid of the many global variables ASAP, anyway[1].

I intend to upgrade to phpDocumentor 2 for at least some of my plugins in the near future -- probably that brings more insights.

[1] IMO the biggest problem with global variables in CMSimple_XH isn't so much the "global state is bad" argument, but rather that plugins can do with them what they want, without the core having a chance to even notice that, let alone intercepting (e.g. by triggering a deprecated notice, or rejecting/correcting unsound values, loading of content.htm, configs and language files on demand, etc.) To make it short, consider the following code snippet:

Code: Select all

if ($adm = true) {...} 

Re: how I ride the bullet - how I set up a testing environme

Posted: Mon Dec 29, 2014 10:10 am
by manu
cmb wrote:PhpDocumentor 1 is a problem, I agree. ...
I don't know exactly what problems you refer to. In my standard XAMPP Win7x64 Installation I never got PhpDocumentor run properly. I uninstalled PhpDocumentor and never got it installed again. At the end I just installed pear again with standard settings. For this I opened the command line at xampp/php and did:

Code: Select all

php go-pear.phar
Even if I choose "local" as setting (I assume to c:\\xampp\) a c:\\php\pear directory is added. But thats another story. Next I installed PhpDocumentor with the pear command line:

Code: Select all

pear install PhpDocumentor
After this the phing commands just hereto seem to work as expected.
Why do I write this down so detailed? On a closer look many things on the ready-to-go-standard-xampp installation are pretty confusing. I hope this is a help for other to establish the desired testing environment and I hope it helps myself to remember. Or how do you know to do a proper php update, as - as far I know - Apache friend dont provide XAMPP updates, just new versions.

Re: how I ride the bullet - how I set up a testing environme

Posted: Mon Dec 29, 2014 10:59 am
by cmb
manu wrote:
cmb wrote:PhpDocumentor 1 is a problem, I agree. ...
I don't know exactly what problems you refer to.
It was more the general problem that PhpDocumentor 1 can neither be installed with Composer nor as a Phar archive.
manu wrote:On a closer look many things on the ready-to-go-standard-xampp installation are pretty confusing. I hope this is a help for other to establish the desired testing environment and I hope it helps myself to remember.
Yes, that may be very helpful. :)

I had problems running PhpDocumentor 1 under XAMPP 1.8.2, too. For me the following got it working:

Code: Select all

pear channel-update pear.php.net
pear uninstall PhpDocumentor
pear install PhpDocumentor
manu wrote:Or how do you know to do a proper php update, as - as far I know - Apache friend dont provide XAMPP updates, just new versions.
It might be sufficient to replace the contents of the xampp/php/ folder with the new PHP version.

Re: how I ride the bullet - how I set up a testing environme

Posted: Tue Dec 30, 2014 10:57 am
by manu
Ok, one step further again:
For the test suites, a system wide environment variable CMSIMPLEDIR has to be set:

Code: Select all

set CMSIMPLEDIR=/dir.to.testsuite/
with the command line or preset in the batchfile mentioned earlier.
When running the attack-test on php5.5 there are a strange error msg repeating:

Code: Select all

  [phpunit] testAttack with data set #14 ERROR
  [phpunit] curl_setopt_array(): The usage of the @filename API for file uploadi
ng is deprecated. Please use the CURLFile class instead
Christoph, do you know what this is?
phing all-tests seem to stop after unit-tests
phing coverage doesn't write anything.
regards
manu