CakePHP 3 Equivalent of Containable - cakephp-3.0

The Containable behavior was very useful in the preceding versions of CakePHP. Is there a replacement for Containable in version 3?

The functionality "Containable" used to provide is now built-in into the Query objects.
Check the ORM migration guide for more details: http://book.cakephp.org/3.0/en/appendices/orm-migration.html#recursive-and-containablebehavior-removed

Related

Ignore IllegalTokenText warning in Checkstyle 3.0 version

I'm using checkstyle 3.0 version and getting following error:
Consider using special escape sequence instead of octal value or
Unicode escaped value. [IllegalTokenText]
I want to ignore/suppress this warning(IllegalTokenText). I have tried using supressionCommentFilter but I think it works for checkstyle release 3.2 and above.
Please guide me how can I ignore/suppress checkstyle warnings in 3.0 version.
Cheers :)
Like others have been saying 3.0 is very very old, and no filters were around back then.
Since your client doesn't want to upgrade Checkstyle, your only options are:
1) Remove IllegalTokenText (or set its severity to ignore) in your configuration
2) Convince them to upgrade. Many improvements, bug fixes, and new checks have been added since then all of which they are missing out on.
3)
I am assuming (since I am not that familiar with the old code) that Checkstyle is still expandable back in that day like it is now. You could try to create a custom listener to act like a filter in the old Checkstyle to suppress the violation you want to ignore. 3.0 didn't have filter support back then, and you can't add it in. First make sure you can add a listener through the configuration, otherwise, this may not even be an option.
Checkstyle 3.0 source: https://github.com/checkstyle/checkstyle/tree/release3_0
How to write a listener: http://checkstyle.sourceforge.net/writinglisteners.html (Note this is the newer version documentation)
4)
Similar to the writting a custom listener, write a custom IllegalTokenText with suppression support.
How to write a check: http://checkstyle.sourceforge.net/writingchecks.html (Note this is the newer version documentation)
I don't see any other options then these.

checkstyle module name ConstantName vs ConstantNameCheck

I have a question to ask regarding checkstyle.
It seems that the checkstyle api accepts both module name,
ConstantName and ConstantNameCheck (ConstantName with Check concatenated) for the configuration file, checkstyle.xml.
I would like to ask why is there a double standard here even though documentations on http://checkstyle.sourceforge.net/ only promotes ConstantName module and what is the difference between using either of them? Will either one of them gets deprecated in future?
Thanks!
Behind the scenes, the ConstantName check is implemented by a Java class called
com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.
You could actually refer to the module in checkstyle.xml by this so-called "fully qualified" name. The other notations are shorthand offered by Checkstyle for convenience. ConstantNameCheck is the simple name of the implementing Java class, and ConstantName is still shorter. Checkstyle will try all three variants when looking for the module in your checkstyle.xml. So, there is no difference between these notations.
The recommended way is to use the most concise form, ConstantName, but as far as I know, none of the other forms is going to get deprecated any time soon.

When did MySQL start supporting XML functions?

How long have the MySQL XML functions like ExtractValue() and UpdateXML() been supported?
A rough version number will do.
5.1.5.
MySql 5.1 documentation Section 11.11 XML Functions
Beginning with MySQL 5.1.5, two functions providing basic XPath 1.0 (XML Path Language, version 1.0) capabilities are available. Some basic information about XPath syntax and usage is provided later in this section; however, an in-depth discussion...

How to consolidate documentation across different languages/environments?

I am designing a class library designed to solve a wide scope of problems. One thing about this library is that it will be usable by several different languages and environments natively. For example, there will be a C++ version written entirely in C++, a .NET version written in C# and a Java version written in Java, without any dependencies on each other... as opposed to writing the core library in C++ and simply providing .NET and Java bindings to it.
The library in each of its different forms sets out to solve a different but sometimes very similar set of problems. For example, there might be many classes whose members will be functionally identical in each language, and there will also be many classes that will be present in only one or two language-versions of the library, but not the others. Take a class or struct representing a program's version number. .NET already has such as class (System.Version) so I would not include it in my .NET version but the C++ and Java libraries would provide one.
The problem I am facing is that for classes which will exist in most or all versions of the library, the documentation will remain relatively the same (obviously). The brief text for both the C++ and Java version for a Version struct would be something like "Represents a software version number in the form major.minor.build.revision"... as would the detailed class description, and all the members' documentation, etc. As you know, .NET, Java and C++ all have their own documentation syntax. Is there any way I can attempt to consolidate documentation in a language-neutral way (WITHOUT writing the documentation separately from the source code - e.g. manual documentation as opposed to generating it using doxygen/sandcastle/javadoc) or am I stuck copying and pasting the same text into the source files of each version?
I was having the same issues and decided there were just two options for me:
Using the same documentation generator in all languages. If you use doxygen (or ROBODoc, or whatever) for all of them, you would have just one doc syntax for all languages. This means that you have to break with language-specific conventions, though.
Write your own doc parser. Which is hard work, especially for a language with quite complex syntactic rules (as C++.)
We are currently using doxygen for such projects.

Database binding for OCaml?

I'm trying to find a library to access a database from an OCaml program. After trying ocaml-sqlite, I'm not satisfied, since it's somewhat slow.
I've seen a MySQL module, but it doesn't seem to be maintained.
Have you checked the Caml Hump? It has links to plenty of database bindings.
Good, mature, bindings that I can recommend are PG'OCaml by Richard Jones and postgresql-ocaml by Markus Mottl. They are both targeted at Postgresql (which is a probably a better choice for you considering you're into Ocaml).
ocaml-mysql works without problems here - mysql api for connect/query/fetch doesn't change that much :)
It lacks prepared statements though, had to implement mysql_stmt_* wrappers myself.
I'm quite surprised that you find the ocaml-sqlite bindings slow. sqlite is fast on its own, and I believe the sqlite bindings are very well written. You should make sure you're using the up-to-date binding from Markus Mottl's page
If your database is PostgreSQL, I recommend ocaml-postgresql. (There is also ocaml-sql, which makes some SQL operations more convenient when using ocaml-postgresql.)
Since PG'OCaml heavily relies on the OCaml's compile-time type system, it is impossible to compose queries at runtime, which makes it, in my opinion, not useful in most real-world scenarios.