I need a documentation system for a PHP project and I wanted it to be able to integrate external documentation (use cases, project scope etc.) with the documentation generated from code comments. It seems that phpDocumentor has exactly the right feature set, but external documentation must be written in DocBook which is too complex for our team.
If it were in python, sphinx would be just about perfect for this job (ReST is definitely simpler than docbook). Is there any way I can integrate external ReST documentation with the docs extracted from phpdoc? Should I just separate the external documentation (eg. use ReST for external and phpdoc for internal)? Or do you have a better suggestion for managing the external documentation?
You can convert ReST to DocBook using pandoc.
convert wordpress posts in DocBook style. here is the sample.
http://hashfold.com/techfold/wordpress-how-to-generate-docbook-style-posts/
Related
I just find one framework of AT&T to build ABAC.
This framework use XACML following XML format to create rules. But this framework just implement for Java.
However, I 'm working with PHP and I am using JSON to write rules.
Is my solution correct? May you suggest some frameworks or solutions supporting for PHP?
To complete David's answer regarding AuthzForce: it is open source, XACML 3.0 compliant and provides both a Java API (AuthzForce Core) and REST API for PAP and PDP. So you could use the REST API from your PHP program. The API supports XML and JSON format for both PAP and PDP interfaces. However, we are not using the JSON profile of XACML for PDP. Instead, for the whole API, we are using the mapped convention provided by Apache CXF. Such convention allows automatic translation from XML (more precisely the internal XML-derived model used in the implementation code) to JSON, and vice versa automatically.
EDIT (2018-02-26):
AuthzForce Core and Server now both support the standard JSON Profile of XACML for the PDP. AuthzForce also provides a minimal RESTful PDP based on the Core, either packaged as a Spring-boot app, or simply the JAX-RS implementation for reuse in any JAX-RS framework.
The AT&T framework was an R&D framework designed by AT&T a few years ago and then released to Apache. According to github, it is still active. I am not aware of any commercial use of the product (though I suspect AT&T use it themselves).
The three main frameworks used out there are:
WSO2 Balana. This is an open-source Java PDP. It is also bundled as part of WSO2 Identity Server. Most open source users use Balana.
SunXACML: this is the original XACML 3.0 implementation. It is pretty old but sturdy (it's been around for 10 years or so). It is also open-source and Java.
Axiomatics Policy Server. This is a commercial solution (disclaimer: I work for Axiomatics). It is the most prevalent commercial solution out there. It is also implemented in Java but supports integration for PHP too.
You can find this information on XACML's wikipedia page. There is another interesting engine called AuthZForce but I have little experience with it.
All these engines, AFAIK, use XACML's XML format to store policies. You claim you need JSON. There is no Policy profile of XACML in JSON. There was a question on the topic which you can read here.
Given The Axiomatics Policy Server is exposed as a JSON API, you can use it to integrate with PHP. Other engines probably have a similar approach. If you use Amazon AWS, you can request a copy of the Axiomatics Policy Server AMI.
ABAC is technology-neutral meaning it is not specific to Java, Ruby, .NET, PHP or any other language. What the PDP engine is written in is irrelevant to what your application is written in so long as you can integrate the two together.
I hope this helps,
David.
The TYPO3 Access Control component implements ABAC supporting a simple but expressive access control policy language based on Jiang, Hao & Bouabdallah, Ahmed (2017) and is written in PHP.
Checkout the JSON schema to get an quick impression about the access control policy language. The component is lean and flexible. It's neither opinionated about the format nor about the expression language of the policy language. For example you could use YAML and Symfony expression language. As such a policy could look like this:
description: 'Root policy set.'
algorithm: highestPriority
policies:
Admin:
target: 'hasAuthority("typo3:security:principal:admin")'
description: 'Administrator policy'
priority: 100
rules:
-
effect: permit
Default:
description: 'Deny everything per default.'
rules:
-
obligation:
deny:
Feedback: ['Access denied.']
I am not familiar with PHP and having a background in C#.
I would like to know if PHP offers a way to share custom code among projects natively in the language (targeting the latest version of PHP)?
As in C# there is the possibility to create a custom DLL, that can be included in other projects when needed in order to reuse some code.
Does PHP offer a similar feature?
Does PHP packages related on that?
Can PHP namespace be useful in this scenario?
What bout the use of include?
If PHP does not offer this support, which project/library can be used?
I understand there is the possibility to share common code from a versioning system such SVN and checkout sharedcode in each related project (as described in other answer on SO), but I am interested in the possibility in the language itself.
I think with phar archives and composer you get as close to assemblies and nuget as you can get.
You should try a php framework like Laravel or Zend Framework. If you don't want to try a framework, there are couple of ways.
You can create a class of functions and then you can include that class wherever you want in your scripts. This is a simplest example.
namespaces are your friends. I highly recommend yo to have a look at here for PHP and here for a PHP framework.
You can share code with composers packages, more on:
https://packagist.org/
https://getcomposer.org/
I have a REST webservice using Codeigniter and using this lib : https://github.com/chriskacerguis/codeigniter-restserver
I want to generate documentation for this web service. I look to use Swagger UI to generate this documentation. But, I didn't find any documentation how to use Swagger with Codeigniter.
The only project using this two technologies is this one, but don't have a good documentation : https://github.com/panxp/codeigniter-swagger
Can someone paste an example using this two technologies or give me a link to a good documentation ?
Of course, if there is another good lib to generate documentation, I'll take it if it's usable with Codeigniter.
In past projects I have used http://apidocjs.com/ which I find pretty easy to use and straightforward to generate from in multiple environments. It took me like 15-20 minutes to get going and looking how I wanted with it having npm already installed. This one doesn't really care about directory or code structure, just your supplied info in the doc blocks.
You Can use https://github.com/manish29ify/codeigniter3-restapi-with-swagger Still it is under development but you can use Swagger with PHP rest server very easily
I want to build an app using ExtJS 4 and PHP.
I will follow the MVC pattern with ExtJS 4.
However, I want to use RESTful webservices with PHP.
Yet I am not sure how to proceed.
How can I call for Web Services that are PHP functions?
How am I going to give the directory like structure to my links?
You can obviously use Ext.Ajax.request() to craft any RESTful URls that you want. However, be sure to check out the REST proxy that's built into Ext JS's data package. By connecting this to your store/model, you can dynamically generate RESTful URLs which can be used for the vast majority of your generic CRUD operations.
RE: the PHP side, that's a big question. Fortunately, there are literally a billion turtorials on creating RESTful services in PHP, so I'd dust off your Google-fu and start there. Here's a very simple introduction that just happens to use PHP: http://code.tutsplus.com/tutorials/a-beginners-guide-to-http-and-rest--net-16340
You are most likely looking for Ext.Ajax.request.
There are some examples of Ext.Ajax.request from this stack overflow article.
I'm looking for a script (there has to be one) that help me to let me user translate my getText based PHP project.
Right now, I don't have time to create a solution on my one, so I were looking for some proper open-source solution using Google Search, but I could not find anything.
There are a lot of commercial solutions for this, but I would like to use a simple PHP alternative on my own server. It does not have to have a lot of features; I just want to select the languages I need and let the people translate and check translations.
I don't know of any solutions in PHP, but there are several open source projects for web-based translation tools. For example:
Weblate is based on Python/Django and supports Git integration. I think it is used by phpMyAdmin, so it should be suitable for PHP projects.
Zanata is written in Java and used by JBoss.
I also found SimplePO on Google Code which is written in PHP, but it does not seem to support plural forms. There is also a more recently updated fork on GitHub.