Genreate phpDoc automatically - php

I would like to be able to integrate a the documentation generator from within my web interface.
I had a look at the docbuilderproject which is a web-based generator provided with phpDoc itself, but I could not identify for sure what was the command that was actually triggering the beginning of the process.
Do you know where I could get some help finding how to execute the phpDoc script programmatically?
PS: I am running PHP on IIS.

Docs should be generated by the integration system, i.e. Jenkins or phpUnderControl. They provide tasks for it.

Related

How to implement version control inside a web app?

I'm building DMS (Document management system) using PHP framework Laravel.
One of the requirements is allowing users to version control files, close to what google docs does.
I've been searching for days without any clue, I don't want to re-impalement the wheel, there's a lot of really good VCS already including git which I'm thinking of utilizing it using php to implement the versioning features.
I just don't know how to start or even my way of thinking is valid!
What you need is real-time system (achieved via socket programming) so that everyone is updated about the contents in realtime; also who is doing what: Like if there are two users A and B and they have opened the same file then A should know what the B is doing and vice versa; you would use client events for that. Have a look here:
https://laracasts.com/series/get-real-with-laravel-echo
Or
Look into Web RTC: https://webrtc.org/
GIT is a different thing given your requirements what I understood.

Symfony Console tab completion

I have an application with a Symfony Console based CLI. The application does not use the Symfony framework, just the Symfony Console component.
When I execute
php app/myapp
I get the usual overview with the name, version, options and registered commands shown. Suppose I just have one command, called "displaykittens". What I want to be able to do is
php app/myapp d <TAB>
And have it complete to
php app/myapp displaykittens
As is kinda expected in a modern unix environment. Unfortunately there appears to be no tab completion whatsoever. The Console Component itself provides an utility that allows doing something along these lines in commands themselves. That does not help me with getting tab completion for the commands though. Is this possible somehow?
You might like this extension https://github.com/stecman/symfony-console-completion
It allows you to set up both active commands and our own suggestions
Symfony 5.4+ has autocompletion natively.
You can get more information about autocompletion with bin/console completion --help.
For example with bash you can add this in your ~/.bashrc.
eval "$(/var/www/app/bin/console completion bash)"
Official announcement: https://symfony.com/blog/new-in-symfony-5-4-console-autocompletion
I don't know if it is possible with the normal bash shell. But if you use zsh you can install oh-my-zsh. There is a great plugin that does exactly what you ask for: Oh-My-ZSH Symfony2 plugin
The Application class of the Console component can be wrapped in a Shell class, provided by the same component. That provides some amount of auto completion.
According to people on the #symfony IRC on freenode, there is no way to have the console app provide autocompletion out of the box, since changes to the shell config need to be made.

Continuous Integration Server: Hudson or Sismo?

We're considering using a CI server soon.
From my reading, I've found that Sismo and Hudson were available for PHP project.
Considering that we're actually using GIT and PHPUnit, what are the big difference between Hudson and Sismo that we should know in order to make the best choice for our situation ?
Thanks
The language match is not key in your hunt for the best CI server; it's all the features around:
source control
concurrent build
trigger build
notification
Even for simple project, Jenkins (the new name for Hudson) is easy to use and quick to install. Then it is really easy to scale Jenkins up by adding more nodes (satellite machine that can execute build) when you need to. Also Jenkins has hundreds of plugin for numerous task.
Have a look at Bamboo, Jenkins, TeamCity, and CruiseControl Features to compare some of the features of the big names (you might actually want to consider Bamboo, TeamCity or Cruise Control over Jenkins)
I would lean towards Sismo since it matches the language of the project you are developing (PHP) and can be ran from just a single PHP and config file. Then you don't have to deal with having a java environment just for Hudson.
There is a really good php-integration for Jenkins by the phpunit inventor Sebastian Bergmann. You should really have a look at it.
As far as I see the biggest downside of Sismo is, that is not a "real" CI server, but more a build-and-report-environment, because you need to trigger the builds yourself (or let something trigger it).
I'll preface this by saying that I haven't used sismo.
We use Hudson with applications being built & tested in both Java and PHP. It has a nice plugin system, and getting it up and running on a centOS box took about 15 minutes yesterday. (We had to move it from one box to another).
For PHP Hudson integrates with both PHPUnit and Selenium so we run both unit tests and functional tests against the same codebase. Hudson has a great 'one-click' plugin system that really lets you customize your installation.
One thing we had to get a plugin for was sending an email on every build whether successful or not. Hudson by default will only email when your build goes from good (tests pass) to bad, from bad to good, or repeatedly bad. This means it will not send an email for every build if 2 builds in a row were successful. The email plugin solves this but it was confusing to uncover that.

PHP Automated Deployment and Testing

I asked a question here on automated deployment of automatically deploying java code.
Our back-end Java API is accessed by a PHP web app. It would be nice to be able to automatically deploy this web app (along with static files like CSS, JS and images) to our web server while performing automatic testing on PHP code. Is there something similar to this for PHP?
I also wonder if as part of this automated testing you can check that each actual page loads without a fatal error. I am sure I read about a google project which allows you to write page tests e.g. click on link a, go to page b etc etc.
Thanks
You may want to look into using Phing for deployment which has features that allow testing with PHPUnit and/or SimpleTest
Maybe this question handling deployment strategies can help you.
Additionally, but maybe gone too far, tools like cruise control may help you to apply continuous integration, too.
PHPUnit with ant was my way to go for automated testing, which could be a vaild option for you, too since you're obviously using some java already :)
Since you're working with Java, you might consider using Hudson (also mentioned in your other question), which has the ability to execute build tasks consisting of several 'steps' One step step could be unit testing your Java App, another unit testing a PHP app, yet another deployinhg Java app, and another deploying a PHP app (and you could add some more ;P )
It has a Maven plugin, so you could actually use your existing Maven scripts.

Generate PHP code from WSDL (for service replacement)

We have few Web Services witch now are handled by an external application, and we plan to replace them as an new own implementation.
Is there some tool/class witch will generate stock php interface and structures 100% compatible with those WSDL's we have now?
I'll have to re-implement this wsdl interface, and i have to be sure, that interface itself (not a logic implementation), will not change in any way (even WSDL location have to stay as is)
I have found some projects like: http://code.google.com/p/wsdl2php-interpreter
If any of You have used some things like that, please share with me tips, tools recommendations etc.
PS
re-implementation will be made on top of Yii framework and CWebService class
wsdl2php-interpreter is limited -- it doesn't handle attributes and doesn't seem to handle simpleTypes.
I have used http://code.google.com/p/wsdl2php-interpreter and based on generated code wrote an web service controllers following a Yii giude and everything works fine and as expected :)

Categories