solar php更新至1.1.0

终于迎来了solar的再次更新,不过本此更新主要针对命令行doc生成。官方也把手册更新到第7章了。请看更新说明:

The biggest set of changes is related to API documentation generation. We now have a Markdown set that will convert inline API documentation to DocBook, and the `make-docs` command now support building DocBook files from class and package wiki docs. Look for this to be used on the solarphp.com class and package documentation pages when I update the site later today. (One bonus from using DocBook is that we will now have downloadable API docs.)

New Classes =========

Solar\_Cli\_MakeDocbook: Class to convert wiki-based docs to DocBook files.

Solar\_Markdown\_Apidoc: Transformation classes for converting apidoc

wiki markup to DocBook.

Solar\_View\_Helper\_Foot: Class to collect scripts for the foot of the

document; thanks, Bedrich Rios, for the request that lead to this feature.

Changes =====

script/solar


[FIX] Use realpath() on --config value so we know in advance if it exists

or not.

[REF] Convert from a procedural script to a class for easier maintenance.

Solar


[CHG] Forcibly cast $params to array for call\_user\_func\_array().

Solar\_Access\_Adapter


[CHG] Method isAllowed() now allows an object as its first param (to specify

the object class being controlled) instead of only a string class name.

Solar\_Cache\_Adapter\_File


[ADD] Method \_deleteAll() as a support method for recursively deleting

subdirectories. Thanks, Lee, for the report and initial patch.

[CHG] Method deleteAll(), when hashing is turned off, now recursively

deletes cache subdirectories.

Solar\_Cli\_LinkPublic


[CHG] Better error reporting when symlink creation fails.

Solar\_Cli\_LinkVendor


[CHG] Better error reporting when symlink creation fails.

Solar\_Cli\_MakeDocs


[FIX] Method writeClassOverview() now sets the package name correctly. (This

was due to the change from @package being only a name, to being a name and an optional summary.)

[CHG] Method writePackageIndex() now structures the index file as a table,

rather than as a pipe-separated values file.

[CHG] Method writeClassesIndex() now structures the index file as a table,

rather than as a pipe-separated values file.

[DEL] Throughout, removed all instances of \_title1(). This means that page

titles need to be generated by the display software now.

[CHG] In class overview, change how properties, methods, constants, and

config keys so that they link directly to their anchors on the proper pages.

[CHG] Method writeClassConstants() now puts each constant under its own

section header, with corollary ID for independent targeting.

[CHG] Throughout, use new anchor IDs.

[DEL] Method \_title4(), as it was never used.

[CHG] On the class page for Constants, only show a summary if it exists.

[ADD] Option flag `--docbook-dir`.

[ADD] Property $\_docbook\_dir to retain the value of --docbook-dir.

[CHG] Method \_exec(), when $\_docbook\_dir is specified, now automatically

converts the wiki-based docs to DocBook via `make-docbook`.

[FIX] Package index now properly generates a link to the package overview.

[CHG] Class index now generates a link to the class overview.

[CHG] Method synopsis now displays Class::method(), instead of just method().

[CHG] Show package index as a list, not a table.

[FIX] In method \_write(), if a file exists where a directory needs to be

created, throw an exception. Thanks, zined, for the report and patch.

Solar\_Cli\_MakeModel


[ADD] Method \_execMulti(). When you call "make-model Vendor\_Model\_*", the

\_exec() method will recognize the trailing "\_*" and interpret it as a command to make one model class for each table in the database. Thanks, Anthony Gentile, for the report that led to this feature.

Solar\_Cache\_Adapter


[FIX] Methods fetchOrSave() and fetchOrAdd() now pass the custom $life

parameter. Thanks, probd, for the report and patch.

Solar\_Controller\_Command


[CHG] Methods \_out(), \_outln(), \_err(), and \_errln() no longer use fwrite()

directly. Instead, they use Solar\_Vt100::write() so that escape codes are honored or stripped depending on the output handle type. This means escape codes will no longer show up in non-TTY environments. Thanks, Abu Bakar Al-Idrus, for the report that led to this change.

Solar\_Docs\_Apiref


[ADD] Support for docblocks on constants:

[CHG] Method addClass() now takes a second param, $file, which gives the

path to the file that defines the class. This is needed for reading the file contents to parse the docblocks for its constants.

[CHG] Method \_addConstants() now takes a second param, $file, which

gives the path to the file that defines the class. This is needed for reading the file contents to parse the docblocks for its constants.

[CHG] Method \_addConstants() now reads the class file and parses it

manually to find the docblocks on constants and retain the summary, narrative, and technical information. (Does not yet support discovery of inherited constants.)

Solar\_Mail\_Message


[ADD] Methods setTo(), setCc(), and setBcc() to set the recipients for those

types, replacing any previous recipients. Thanks, Rodrigo Moraes, for the feature request that led to this addition.

Solar\_Markdown\_Extra\_Deflist


[ADD] Properties $\_dt\_open, $\_dt\_close, $\_dd\_open, and $\_dd\_close. These

hold the tags for opening and closing terms and definitions.

[CHG] Throughout, use the new tag properties instead of hard-coded strings.

Solar\_Markdown\_Plugin\_List


[ADD] Properties $\_ul\_open, $\_ul\_close, $\_ol\_open, $\_ol\_close, $\_li\_item,

and $\_li\_close. These hold the opening and closing tags for lists and items.

[CHG] Throughout, use the new tag properties instead of hard-coded strings.

Solar\_Markdown\_Plugin\_Uri


[FIX] Method \_parseEmail() now correctly converts the parsed email address

to a HTML token so that it doesn't get double-escaped. Thanks, Lee, for the report and patch. Fixes #154.

Solar\_Markdown\_Wiki\_MethodSynopsis


[ADD] Config key 'param\_void' to indicate the template for when a method

has no parameters.

[CHG] Method \_parse() now honors 'param\_void'.

[CHG] Config values for 'param' and 'param\_default' now have the `$`

hard-coded in them.

Solar\_Request


[FIX] Remove empty string index when HTTPS\_* values are passed in $\_SERVER.

Thanks, Robert Gonzalez, for the report and patch.

[ADD] Method isSsl() to check if the request is HTTPS or on port 443.

Solar\_Sql\_Adapter


[FIX] Method \_selectSingle() now wraps the FROM clause in parentheses; this

forces MySQL to use the correct precedence and not confuse the last FROM element with any follwing JOIN clauses. Thanks, John Elofson, for the report and patch.

Solar\_Symlink


[FIX] Method \_make() now redirects STDERR to STDOUT so that if the last line

is an error line, exec() will return it.

Solar\_Uri


[CHG] Method set() now uses $request->isSsl() to determine the scheme.

[ADD] Method \_\_toString() to represent the object as its full URI string.

Thanks, Luke Visinoni, for the patch. fixes #276

Solar\_View\_Helper\_(Date|Time|Timestamp)


[CHG] Now displays empty/null options (shown as "--") when the value is

empty and not required. When the value is empty and is required, it still defaults to the current timestamp.

Solar\_View\_Helper\_Form


[CHG] Rename method \_addCsrfElement() to \_modCsrfElement().

[FIX] In method \_modCsrfElement(), add logic to remove a CSRF element that's

not needed (i.e., in GET forms). This prevents GET forms from failing due to the presence of a spurious CSRF element. Thanks, Jon Elofson, for the report that led to this fix.

[FIX] Method reset() no longer resets the $\_id\_count property. This is

because the form() helper might be used for two or more forms on the same page, and those forms might have identical element names, so they need to be deconflicted from each other for W3C validation. Thanks, dmytrok, for the report that led to this fix.

[ADD] Method addHtml() to add arbitrary HTML as part of the stack (i.e., not

as an element in the form). Thanks, Eric Parent, for the report and patch.

Solar\_View\_Helper\_Head


[ADD] Method setTitleRaw() and property $\_title\_raw to turn off/on title

escaping at fetch() time. Thanks, Bedrich Rios, for the report that led to this change.

[CHG] Method fetch() honors the value of $\_title\_raw.

Solar\_View\_Helper\_Pager


[FIX] Method pager() now honors the configuration values for 'prev' and

'next'. Thanks, Dmytrok, for the report.

Solar\_View\_Helper\_Title


[ADD] Method title() now has second parameter $raw; when true, will output

the title without escaping it (default false).

Solar\_Vt100


[ADD] Method plain() to strip escape codes from a string.

[ADD] Method write() that looks at the output file handle to honor or strip

escape codes using posix\_isatty().