first import
1
sites/all/modules/development/devel/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
FirePHPCore*
|
274
sites/all/modules/development/devel/LICENSE.txt
Normal file
@@ -0,0 +1,274 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
|
||||
verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users. This General Public License
|
||||
applies to most of the Free Software Foundation's software and to any other
|
||||
program whose authors commit to using it. (Some other Free Software
|
||||
Foundation software is covered by the GNU Library General Public License
|
||||
instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the
|
||||
freedom to distribute copies of free software (and charge for this service if
|
||||
you wish), that you receive source code or can get it if you want it, that you
|
||||
can change the software or use pieces of it in new free programs; and that
|
||||
you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These restrictions
|
||||
translate to certain responsibilities for you if you distribute copies of the
|
||||
software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for
|
||||
a fee, you must give the recipients all the rights that you have. You must make
|
||||
sure that they, too, receive or can get the source code. And you must show
|
||||
them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If the
|
||||
software is modified by someone else and passed on, we want its recipients
|
||||
to know that what they have is not the original, so that any problems
|
||||
introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will individually
|
||||
obtain patent licenses, in effect making the program proprietary. To prevent
|
||||
this, we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
|
||||
MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice
|
||||
placed by the copyright holder saying it may be distributed under the terms
|
||||
of this General Public License. The "Program", below, refers to any such
|
||||
program or work, and a "work based on the Program" means either the
|
||||
Program or any derivative work under copyright law: that is to say, a work
|
||||
containing the Program or a portion of it, either verbatim or with
|
||||
modifications and/or translated into another language. (Hereinafter, translation
|
||||
is included without limitation in the term "modification".) Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running the Program is
|
||||
not restricted, and the output from the Program is covered only if its contents
|
||||
constitute a work based on the Program (independent of having been made
|
||||
by running the Program). Whether that is true depends on what the Program
|
||||
does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source
|
||||
code as you receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this License
|
||||
and to the absence of any warranty; and give any other recipients of the
|
||||
Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it,
|
||||
thus forming a work based on the Program, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that
|
||||
you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in
|
||||
part contains or is derived from the Program or any part thereof, to be
|
||||
licensed as a whole at no charge to all third parties under the terms of this
|
||||
License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run,
|
||||
you must cause it, when started running for such interactive use in the most
|
||||
ordinary way, to print or display an announcement including an appropriate
|
||||
copyright notice and a notice that there is no warranty (or else, saying that
|
||||
you provide a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this License.
|
||||
(Exception: if the Program itself is interactive but does not normally print such
|
||||
an announcement, your work based on the Program is not required to print
|
||||
an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be
|
||||
reasonably considered independent and separate works in themselves, then
|
||||
this License, and its terms, do not apply to those sections when you distribute
|
||||
them as separate works. But when you distribute the same sections as part
|
||||
of a whole which is a work based on the Program, the distribution of the
|
||||
whole must be on the terms of this License, whose permissions for other
|
||||
licensees extend to the entire whole, and thus to each and every part
|
||||
regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to
|
||||
work written entirely by you; rather, the intent is to exercise the right to
|
||||
control the distribution of derivative or collective works based on the
|
||||
Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of a
|
||||
storage or distribution medium does not bring the other work under the scope
|
||||
of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under
|
||||
Section 2) in object code or executable form under the terms of Sections 1
|
||||
and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source
|
||||
code, which must be distributed under the terms of Sections 1 and 2 above
|
||||
on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give
|
||||
any third party, for a charge no more than your cost of physically performing
|
||||
source distribution, a complete machine-readable copy of the corresponding
|
||||
source code, to be distributed under the terms of Sections 1 and 2 above on
|
||||
a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute
|
||||
corresponding source code. (This alternative is allowed only for
|
||||
noncommercial distribution and only if you received the program in object
|
||||
code or executable form with such an offer, in accord with Subsection b
|
||||
above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source code
|
||||
means all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation and
|
||||
installation of the executable. However, as a special exception, the source
|
||||
code distributed need not include anything that is normally distributed (in
|
||||
either source or binary form) with the major components (compiler, kernel,
|
||||
and so on) of the operating system on which the executable runs, unless that
|
||||
component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to
|
||||
copy from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place counts as distribution of the source code,
|
||||
even though third parties are not compelled to copy the source along with the
|
||||
object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as
|
||||
expressly provided under this License. Any attempt otherwise to copy,
|
||||
modify, sublicense or distribute the Program is void, and will automatically
|
||||
terminate your rights under this License. However, parties who have received
|
||||
copies, or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it.
|
||||
However, nothing else grants you permission to modify or distribute the
|
||||
Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the
|
||||
Program (or any work based on the Program), you indicate your acceptance
|
||||
of this License to do so, and all its terms and conditions for copying,
|
||||
distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute or modify the Program subject to these terms and
|
||||
conditions. You may not impose any further restrictions on the recipients'
|
||||
exercise of the rights granted herein. You are not responsible for enforcing
|
||||
compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues), conditions
|
||||
are imposed on you (whether by court order, agreement or otherwise) that
|
||||
contradict the conditions of this License, they do not excuse you from the
|
||||
conditions of this License. If you cannot distribute so as to satisfy
|
||||
simultaneously your obligations under this License and any other pertinent
|
||||
obligations, then as a consequence you may not distribute the Program at all.
|
||||
For example, if a patent license would not permit royalty-free redistribution
|
||||
of the Program by all those who receive copies directly or indirectly through
|
||||
you, then the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or
|
||||
other property right claims or to contest validity of any such claims; this
|
||||
section has the sole purpose of protecting the integrity of the free software
|
||||
distribution system, which is implemented by public license practices. Many
|
||||
people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose
|
||||
that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original copyright
|
||||
holder who places the Program under this License may add an explicit
|
||||
geographical distribution limitation excluding those countries, so that
|
||||
distribution is permitted only in or among countries not thus excluded. In such
|
||||
case, this License incorporates the limitation as if written in the body of this
|
||||
License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will be
|
||||
similar in spirit to the present version, but may differ in detail to address new
|
||||
problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies
|
||||
a version number of this License which applies to it and "any later version",
|
||||
you have the option of following the terms and conditions either of that
|
||||
version or of any later version published by the Free Software Foundation. If
|
||||
the Program does not specify a version number of this License, you may
|
||||
choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs
|
||||
whose distribution conditions are different, write to the author to ask for
|
||||
permission. For software which is copyrighted by the Free Software
|
||||
Foundation, write to the Free Software Foundation; we sometimes make
|
||||
exceptions for this. Our decision will be guided by the two goals of
|
||||
preserving the free status of all derivatives of our free software and of
|
||||
promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
|
||||
PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
|
||||
AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
|
||||
ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
|
||||
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
|
||||
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
|
||||
OR DATA BEING RENDERED INACCURATE OR LOSSES
|
||||
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
|
||||
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
|
||||
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
56
sites/all/modules/development/devel/README.txt
Normal file
@@ -0,0 +1,56 @@
|
||||
README.txt
|
||||
==========
|
||||
|
||||
A module containing helper functions for Drupal developers and
|
||||
inquisitive admins. This module can print a log of
|
||||
all database queries for each page request at the bottom of each page. The
|
||||
summary includes how many times each query was executed on a page, and how long
|
||||
each query took.
|
||||
|
||||
It also offers
|
||||
- a block for running custom PHP on a page
|
||||
- a block for quickly accessing devel pages
|
||||
- a block for masquerading as other users (useful for testing)
|
||||
- reports memory usage at bottom of page
|
||||
- A mail-system class which redirects outbound email to files
|
||||
- more
|
||||
|
||||
This module is safe to use on a production site. Just be sure to only grant
|
||||
'access development information' permission to developers.
|
||||
|
||||
Also a dpr() function is provided, which pretty prints arrays and strings.
|
||||
Useful during development. Many other nice functions like dpm(), dvm().
|
||||
|
||||
AJAX developers in particular ought to install FirePHP Core from
|
||||
http://www.firephp.org/ and put it in the devel directory.
|
||||
This happens automatically when you enable via drush. You may also
|
||||
use a drush command to download the library. If downloading by hand,
|
||||
your path to fb.php should look like devel/FirePHPCore/lib/FirePHPCore/fb.php.
|
||||
You can use svn checkout http://firephp.googlecode.com/svn/trunk/trunk/Libraries/FirePHPCore.
|
||||
Then you can log php variables to the Firebug console. Is quite useful.
|
||||
|
||||
Included in this package is also:
|
||||
|
||||
- devel_node_access module which prints out the node_access records for a given node. Also offers hook_node_access_explain for all node access modules to implement. Handy.
|
||||
- devel_generate.module which bulk creates nodes, users, comment, terms for development
|
||||
|
||||
Some nifty drush integration ships with devel and devel_generate. See drush help for details.
|
||||
|
||||
COMPATIBILITY NOTES
|
||||
==================
|
||||
- Modules that use AHAH may have incompatibility with the query log and other
|
||||
footer info. Consider setting $GLOBALS['devel_shutdown'] = FALSE if you run into
|
||||
any issues.
|
||||
|
||||
DRUSH UNIT TEST
|
||||
==================
|
||||
See develDrushTest.php for an example of unit testing of the Drush integration.
|
||||
This uses Drush's own test framework, based on PHPUnit. To run the tests, use
|
||||
phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc. Note that we must name a file
|
||||
under /tests there.
|
||||
|
||||
AUTHOR/MAINTAINER
|
||||
======================
|
||||
-moshe weitzman <weitzman at tejasa DOT com>
|
||||
http://cyrve.com
|
||||
Hans Salvisberg <drupal at salvisberg DOT com>
|
@@ -0,0 +1,42 @@
|
||||
README
|
||||
======
|
||||
|
||||
This module contains tools for developers using access control modules
|
||||
to restrict access to some nodes. It is intended to help catch some
|
||||
common mistakes and provide feedback to confirm that restricted nodes
|
||||
are in fact visible only to the intended users.
|
||||
|
||||
Provides a summary page which queries the node_access table and
|
||||
reports common mistakes such as the presence of Drupal's default entry
|
||||
which grants all users read access to all nodes. Also reports the
|
||||
presence of nodes not represented in node_access table. This may
|
||||
occur when an access control module is installed after nodes have
|
||||
already been created.
|
||||
|
||||
Provides a block which shows all node_access entries for the nodes
|
||||
shown on a given page. This gives developers a quick check to see
|
||||
that grants are provided as they should be. This block auto-enables
|
||||
to the footer region. You may move it as desired.
|
||||
|
||||
If Views module is installed, allows browsing of nodes by realm,
|
||||
including those nodes not in the node_access table (NULL realm).
|
||||
|
||||
WISHLIST
|
||||
========
|
||||
|
||||
Things I'd like to see but haven't had time to do:
|
||||
|
||||
* Automatically solve common problems. I.e. delete the "all" realm
|
||||
entry, and automatically save all nodes not in the node_access table.
|
||||
|
||||
* Nicer feedback indicating whether nodes are visible to the public or
|
||||
not. I.e. use color coding or icons.
|
||||
|
||||
* Summary does not differentiate between view grants and other types
|
||||
of grants. I personally use node_access only for view grants so I'm
|
||||
not sure exactly what else it should show.
|
||||
|
||||
AUTHOR
|
||||
======
|
||||
|
||||
Dave Cohen AKA yogadex on drupal.org
|
8
sites/all/modules/development/devel/devel-rtl.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.dev-query, .dev-timer, .dev-memory-usage {
|
||||
align: left;
|
||||
direction: ltr;
|
||||
padding-top: inherit;
|
||||
}
|
||||
.dev-query, .dev-timer, .dev-memory-usage table {
|
||||
direction: ltr;
|
||||
}
|
142
sites/all/modules/development/devel/devel.admin.inc
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
function devel_admin_settings() {
|
||||
$form['queries'] = array('#type' => 'fieldset', '#title' => t('Query log'));
|
||||
|
||||
$description = t('Display a log of the database queries needed to generate the current page, and the execution time for each. Also, queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching.');
|
||||
if (!devel_is_compatible_optimizer()) {
|
||||
$description = t('You must disable or upgrade the php Zend Optimizer extension in order to enable this feature. The minimum required version is 3.2.8. Earlier versions of Zend Optimizer are <a href="!url">horribly buggy and segfault your Apache</a> ... ', array('!url' => url('http://drupal.org/node/126098'))) . $description;
|
||||
}
|
||||
$form['queries']['devel_query_display'] = array('#type' => 'checkbox',
|
||||
'#title' => t('Display query log'),
|
||||
'#default_value' => variable_get('devel_query_display', 0),
|
||||
'#description' => $description,
|
||||
'#disabled' => !devel_is_compatible_optimizer(),
|
||||
);
|
||||
$form['queries']['settings'] = array(
|
||||
'#type' => 'container',
|
||||
'#states' => array(
|
||||
// Hide the query log settings when not displaying query log.
|
||||
'invisible' => array(
|
||||
'input[name="devel_query_display"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['queries']['settings']['devel_query_sort'] = array('#type' => 'radios',
|
||||
'#title' => t('Sort query log'),
|
||||
'#default_value' => variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE),
|
||||
'#options' => array(t('by source'), t('by duration')),
|
||||
'#description' => t('The query table can be sorted in the order that the queries were executed or by descending duration.'),
|
||||
);
|
||||
$form['queries']['settings']['devel_execution'] = array('#type' => 'textfield',
|
||||
'#title' => t('Slow query highlighting'),
|
||||
'#default_value' => variable_get('devel_execution', 5),
|
||||
'#size' => 4,
|
||||
'#maxlength' => 4,
|
||||
'#description' => t('Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibly inefficient query, or a candidate for caching.'),
|
||||
);
|
||||
|
||||
$form['xhprof'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'XHProf',
|
||||
'#description' => t('XHProf is a php extension which is essential for profiling your Drupal site. It pinpoints slow functions, and also memory hogging functions.'),
|
||||
);
|
||||
$description = extension_loaded('xhprof') ? t('Profile requests with the xhprof php extension.') : '<span class="warning">' . t('You must enable the <a href="!url">xhprof php extension</a> to use this feature.', array('!url' => url('http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/'))) . '</span>';
|
||||
$form['xhprof']['devel_xhprof_enabled'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable profiling of all page views and <a href="!drush">drush</a> requests.', array('!drush' => url('http://drush.ws'))),
|
||||
'#default_value' => variable_get('devel_xhprof_enabled', FALSE),
|
||||
'#description' => $description,
|
||||
'#disabled' => !extension_loaded('xhprof'),
|
||||
);
|
||||
$form['xhprof']['settings'] = array(
|
||||
'#type' => 'container',
|
||||
'#states' => array(
|
||||
'invisible' => array(
|
||||
'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['xhprof']['settings']['devel_xhprof_directory'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => 'xhprof directory',
|
||||
'#description' => t('Location of the xhprof source code on your system, usually somewhere in /usr/local/share or /usr/share, include the leading forward slash.'),
|
||||
'#default_value' => variable_get('devel_xhprof_directory', ''),
|
||||
'#states' => array(
|
||||
'invisible' => array(
|
||||
'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['xhprof']['settings']['devel_xhprof_url'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => 'XHProf URL',
|
||||
'#description' => t('Path to the publically accessible xhprof_html - required to display profiler reports. You will need to set this up outside Drupal, for example at http://xhprof.localhost/xhprof_html'),
|
||||
'#default_value' => variable_get('devel_xhprof_url', ''),
|
||||
'#states' => array(
|
||||
'invisible' => array(
|
||||
'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$form['devel_api_url'] = array('#type' => 'textfield',
|
||||
'#title' => t('API Site'),
|
||||
'#default_value' => variable_get('devel_api_url', 'api.drupal.org'),
|
||||
'#description' => t('The base URL for your developer documentation links. You might change this if you run <a href="!url">api.module</a> locally.', array('!url' => url('http://drupal.org/project/api'))));
|
||||
$form['dev_timer'] = array('#type' => 'checkbox',
|
||||
'#title' => t('Display page timer'),
|
||||
'#default_value' => variable_get('dev_timer', 0),
|
||||
'#description' => t('Display page execution time in the query log box.'),
|
||||
);
|
||||
|
||||
$form['dev_mem'] = array('#type' => 'checkbox',
|
||||
'#title' => t('Display memory usage'),
|
||||
'#default_value' => variable_get('dev_mem', 0),
|
||||
'#description' => t('Display how much memory is used to generate the current page. This will show memory usage when devel_init() is called and when devel_exit() is called.'),
|
||||
);
|
||||
$form['devel_redirect_page'] = array('#type' => 'checkbox',
|
||||
'#title' => t('Display redirection page'),
|
||||
'#default_value' => variable_get('devel_redirect_page', 0),
|
||||
'#description' => t('When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page.'),
|
||||
);
|
||||
$form['devel_page_alter'] = array('#type' => 'checkbox',
|
||||
'#title' => t('Display $page array'),
|
||||
'#default_value' => variable_get('devel_page_alter', FALSE),
|
||||
'#description' => t('Display $page array from <a href="http://api.drupal.org/api/function/hook_page_alter/7">hook_page_alter()</a> in the messages area of each page.'),
|
||||
);
|
||||
$form['devel_error_handler'] = array('#type' => 'radios',
|
||||
'#title' => t('Error handler'),
|
||||
'#default_value' => variable_get('devel_error_handler', DEVEL_ERROR_HANDLER_STANDARD),
|
||||
'#options' => array(DEVEL_ERROR_HANDLER_NONE => t('None'), DEVEL_ERROR_HANDLER_STANDARD => t('Standard drupal')),
|
||||
'#description' => t('Choose an error handler for your site. <em>Backtrace</em> prints nice debug information when an error is noticed, and you <a href="@choose">choose to show errors on screen</a>. <strong>Backtrace requires the <a href="@krumo">krumo library</a></strong>. <em>None</em> is a good option when stepping through the site in your debugger.', array('@krumo' => url('http://krumo.sourceforge.net'), '@choose' => url('admin/config/development/logging'))),
|
||||
);
|
||||
if (has_krumo()) {
|
||||
$form['devel_error_handler']['#options'][DEVEL_ERROR_HANDLER_BACKTRACE] = t('Backtrace');
|
||||
}
|
||||
|
||||
$options = drupal_map_assoc(array('default', 'blue', 'green', 'orange', 'white', 'disabled'));
|
||||
$form['devel_krumo_skin'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Krumo display'),
|
||||
'#description' => t('Select a skin for your debug messages or select <em>disabled</em> to display object and array output in standard PHP format.'),
|
||||
'#options' => $options,
|
||||
'#default_value' => variable_get('devel_krumo_skin', 'default'),
|
||||
);
|
||||
|
||||
$form['devel_rebuild_theme_registry'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Rebuild the theme registry on every page load'),
|
||||
'#description' => t('While creating new templates and theme_ overrides the theme registry needs to be rebuilt.'),
|
||||
'#default_value' => variable_get('devel_rebuild_theme_registry', FALSE),
|
||||
);
|
||||
|
||||
$form['devel_use_uncompressed_jquery'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use uncompressed jQuery'),
|
||||
'#default_value' => variable_get('devel_use_uncompressed_jquery', FALSE),
|
||||
'#description' => t("Use a human-readable version of jQuery instead of the minified version that ships with Drupal, to make JavaScript debugging easier."),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
102
sites/all/modules/development/devel/devel.css
Normal file
@@ -0,0 +1,102 @@
|
||||
.dev-query, .dev-timer, .dev-memory-usage {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.devel-obj-output .field {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.devel-obj-output dd {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query summary
|
||||
*/
|
||||
div.dev-query {
|
||||
font-size:11px;
|
||||
background:#fff;
|
||||
border-top:3px solid #ccc;
|
||||
color:#333;
|
||||
/*padding:.5em;*/
|
||||
}
|
||||
|
||||
div.dev-query .marker {
|
||||
color: #f00;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Querylog
|
||||
*/
|
||||
div.devel-querylog {
|
||||
color:#333;
|
||||
border-bottom:1px solid #eee;
|
||||
font-size:11px;
|
||||
line-height:100%;
|
||||
padding-left:30em;
|
||||
padding-right:2em;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
div.devel-querylog .marker {
|
||||
color: #f00;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.devel-querylog-header {
|
||||
border-top:3px solid #ccc;
|
||||
background:#fff;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
div.devel-querylog-even {
|
||||
background:#fff;
|
||||
}
|
||||
|
||||
div.devel-querylog-odd {
|
||||
background:#f8f8f8;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell {
|
||||
overflow:hidden;
|
||||
padding: 1em .5em;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell-1 {
|
||||
position:absolute;
|
||||
left:0px;
|
||||
width:4em;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell-2 {
|
||||
position:absolute;
|
||||
left:4em;
|
||||
width:3em;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell-3 {
|
||||
position:absolute;
|
||||
left:6em;
|
||||
width:19em;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell-4 {
|
||||
position:absolute;
|
||||
left:26em;
|
||||
width:4em;
|
||||
}
|
||||
|
||||
div.devel-querylog-even div.cell-5,
|
||||
div.devel-querylog-odd div.cell-5 {
|
||||
/*max-height:18em;*/
|
||||
font-family: 'Andale Mono', monospace;
|
||||
}
|
||||
|
||||
div.devel-querylog div.cell-6 {
|
||||
position:absolute;
|
||||
right:0em;
|
||||
top:0em;
|
||||
/*width:9em;*/
|
||||
}
|
208
sites/all/modules/development/devel/devel.drush.inc
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Drush integration for the devel module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_drush_command().
|
||||
*/
|
||||
function devel_drush_command() {
|
||||
$items['devel-download'] = array(
|
||||
'description' => dt('Downloads the FirePHP library from http://firephp.org/.'),
|
||||
'arguments' => array(
|
||||
'path' => dt('Optional. A path to the download folder. If omitted Drush will use the default location (sites/all/libraries/firephp).'),
|
||||
),
|
||||
);
|
||||
$items['devel-reinstall'] = array(
|
||||
'description' => dt('Disable, Uninstall, and Install a list of projects.'),
|
||||
'arguments' => array(
|
||||
'projects' => dt('A space-separated list of project names.'),
|
||||
),
|
||||
'aliases' => array('dre'),
|
||||
);
|
||||
$items['fn-hook'] = array(
|
||||
'description' => 'List implementations of a given hook and explore source of specified one.',
|
||||
'arguments' => array(
|
||||
'hook' => 'The name of the hook to explore.'
|
||||
),
|
||||
'aliases' => array('fnh', 'hook'),
|
||||
);
|
||||
$items['fn-view'] = array(
|
||||
'description' => 'Show the source of specified function or method.',
|
||||
'arguments' => array(
|
||||
'function' => 'The name of the function or method to view.',
|
||||
),
|
||||
'options' => array(
|
||||
'--pipe' => 'Output just the filename of the function',
|
||||
),
|
||||
'examples' => array(
|
||||
'fn-view drupal_set_breadcrumb' => 'View the source code for function "drupal_set_breadcrumb"',
|
||||
'vi `drush --pipe fn-view user_access`' => 'Edit the file that contains the function "user_access"',
|
||||
'fn-view NodeController::load' => 'View the source code for method load in the class NodeController'
|
||||
),
|
||||
'aliases' => array('fnv'),
|
||||
);
|
||||
$items['devel-token'] = array(
|
||||
'description' => dt('List available tokens'),
|
||||
'aliases' => array('token'),
|
||||
'core' => array(7), // Remove once 3.0 is released.
|
||||
);
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* A command callback. This is faster than 3 separate bootstraps.
|
||||
*/
|
||||
function drush_devel_reinstall() {
|
||||
$projects = func_get_args();
|
||||
|
||||
$args = array_merge(array('pm-disable'), $projects);
|
||||
call_user_func_array('drush_invoke', $args);
|
||||
|
||||
$args = array_merge(array('pm-uninstall'), $projects);
|
||||
call_user_func_array('drush_invoke', $args);
|
||||
|
||||
$args = array_merge(array('pm-enable'), $projects);
|
||||
call_user_func_array('drush_invoke', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* A command callback.
|
||||
*/
|
||||
function drush_devel_download() {
|
||||
$args = func_get_args();
|
||||
if (isset($args[0])) {
|
||||
$path = $args[0];
|
||||
}
|
||||
else {
|
||||
$path = drush_get_context('DRUSH_DRUPAL_ROOT');
|
||||
if (module_exists('libraries')) {
|
||||
$path .= '/' . libraries_get_path('FirePHPCore') . '/FirePHPCore';
|
||||
}
|
||||
else {
|
||||
$path .= '/' . drupal_get_path('module', 'devel') . '/FirePHPCore';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_dir($path)) {
|
||||
drush_log('FirePHP already present. No download required.', 'ok');
|
||||
}
|
||||
elseif (drush_shell_exec('svn export http://firephp.googlecode.com/svn/branches/Library-FirePHPCore-0.3 ' . $path)) {
|
||||
drush_log(dt('FirePHP has been exported via svn to @path.', array('@path' => $path)), 'success');
|
||||
}
|
||||
else {
|
||||
drush_log(dt('Drush was unable to export FirePHP to @path.', array('@path' => $path)), 'error');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements drush_MODULE_post_COMMAND().
|
||||
*/
|
||||
function drush_devel_post_pm_enable() {
|
||||
$extensions = func_get_args();
|
||||
// Deal with comma delimited extension list.
|
||||
if (strpos($extensions[0], ',') !== FALSE) {
|
||||
$extensions = explode(',', $extensions[0]);
|
||||
}
|
||||
|
||||
if (in_array('devel', $extensions) && !drush_get_option('skip')) {
|
||||
drush_devel_download();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler. Show hook implementations.
|
||||
*/
|
||||
function drush_devel_fn_hook($hook) {
|
||||
// Get implementations in the .install files as well.
|
||||
include_once './includes/install.inc';
|
||||
drupal_load_updates();
|
||||
|
||||
if ($hook_implementations = module_implements($hook)) {
|
||||
if ($choice = drush_choice(array_combine($hook_implementations, $hook_implementations), 'Enter the number of the hook implementation you wish to view.')) {
|
||||
return drush_devel_fn_view($choice . "_$hook");
|
||||
}
|
||||
}
|
||||
else {
|
||||
drush_log(dt('No implementations.'), 'ok');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler. Show source code of specified function or method.
|
||||
*/
|
||||
function drush_devel_fn_view($function_name) {
|
||||
// Get implementations in the .install files as well.
|
||||
include_once './includes/install.inc';
|
||||
drupal_load_updates();
|
||||
|
||||
if (strpos($function_name, '::') === FALSE) {
|
||||
if (!function_exists($function_name)) {
|
||||
return drush_set_error(dt('Function not found'));
|
||||
}
|
||||
$reflect = new ReflectionFunction($function_name);
|
||||
}
|
||||
else {
|
||||
list($class, $method) = explode('::', $function_name);
|
||||
if (!method_exists($class, $method)) {
|
||||
return drush_set_error(dt('Method not found'));
|
||||
}
|
||||
$reflect = new ReflectionMethod($class, $method);
|
||||
}
|
||||
$func_info = array('!file' => $reflect->getFileName(), '!startline' => $reflect->getStartLine(), '!endline' => $reflect->getEndLine());
|
||||
//drush_print_pipe(dt("!file -line !startline", $func_info));
|
||||
drush_print_pipe($reflect->getFileName());
|
||||
drush_print(dt("// file: !file, lines !startline-!endline", $func_info));
|
||||
|
||||
_drush_devel_print_function($reflect->getFileName(), $reflect->getStartLine(), $reflect->getEndLine());
|
||||
}
|
||||
|
||||
/**
|
||||
* Command callback. List available tokens.
|
||||
*/
|
||||
function drush_devel_token() {
|
||||
$rows[] = array(dt('Group'), dt('Token'), dt('Name'));
|
||||
$all = token_info();
|
||||
foreach ($all['tokens'] as $group => $tokens) {
|
||||
foreach ($tokens as $key => $token) {
|
||||
$rows[] = array($group, $key, $token['name']);
|
||||
}
|
||||
}
|
||||
drush_print_table($rows, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print the specified function, including any
|
||||
* doxygen-style comments that come before it.
|
||||
*/
|
||||
function _drush_devel_print_function($file, $start_line, $end_line) {
|
||||
$line_num = 0;
|
||||
$doxygen = NULL;
|
||||
$fp = fopen( $file, 'r' );
|
||||
|
||||
while (!feof($fp) && ($line_num < ($start_line - 1))) {
|
||||
$line = fgets($fp);
|
||||
++$line_num;
|
||||
|
||||
if (substr($line,0,3) == '/**') {
|
||||
$doxygen = $line;
|
||||
}
|
||||
elseif (isset($doxygen)) {
|
||||
$doxygen .= $line;
|
||||
if ($line_num + 1 == $start_line) {
|
||||
drush_print(rtrim($doxygen));
|
||||
}
|
||||
if (strstr($line, '*/') !== FALSE) {
|
||||
$doxygen = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (!feof($fp) && ($line_num < $end_line)) {
|
||||
$line = fgets($fp);
|
||||
++$line_num;
|
||||
drush_print(rtrim($line));
|
||||
}
|
||||
}
|
15
sites/all/modules/development/devel/devel.info
Normal file
@@ -0,0 +1,15 @@
|
||||
name = Devel
|
||||
description = Various blocks, pages, and functions for developers.
|
||||
package = Development
|
||||
core = 7.x
|
||||
configure = admin/config/development/devel
|
||||
tags[] = developer
|
||||
files[] = devel.test
|
||||
files[] = devel.mail.inc
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-07-22
|
||||
version = "7.x-1.2"
|
||||
core = "7.x"
|
||||
project = "devel"
|
||||
datestamp = "1311355316"
|
||||
|
88
sites/all/modules/development/devel/devel.install
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implements hook_enable().
|
||||
*/
|
||||
function devel_enable() {
|
||||
$t = get_t();
|
||||
|
||||
// New module weights in core: put devel as the very last in the chain.
|
||||
db_update('system')
|
||||
->fields(array(
|
||||
'weight' => 88,
|
||||
))
|
||||
->condition('type', 'module')
|
||||
->condition('name', 'devel')
|
||||
->execute();
|
||||
|
||||
// Create a custom menu, if Menu module is enabled.
|
||||
// @see devel_modules_installed()
|
||||
if (module_exists('menu')) {
|
||||
$menu = array(
|
||||
'menu_name' => 'devel',
|
||||
'title' => $t('Development'),
|
||||
'description' => $t('Development link'),
|
||||
);
|
||||
menu_save($menu);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_uninstall().
|
||||
*/
|
||||
function devel_uninstall() {
|
||||
variable_del('devel_form_weights');
|
||||
variable_del('devel_execution');
|
||||
variable_del('dev_timer');
|
||||
variable_del('devel_query_display');
|
||||
variable_del('devel_redirect_page');
|
||||
variable_del('devel_api_url');
|
||||
variable_del('dev_mem');
|
||||
variable_del('devel_error_handler');
|
||||
variable_del('devel_switch_user_list_size');
|
||||
variable_del('devel_switch_user_include_anon');
|
||||
variable_del('devel_switch_user_show_form');
|
||||
|
||||
// Delete the development menu.
|
||||
if (module_exists('menu')) {
|
||||
if ($devel_menu = menu_load('devel')) {
|
||||
menu_delete($devel_menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove feature for storing queries. Cleanup deprecated tables and variables.
|
||||
*/
|
||||
function devel_update_7000() {
|
||||
db_drop_table('devel_queries');
|
||||
db_drop_table('devel_times');
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild the menus since everything is defined by devel_menu().
|
||||
*/
|
||||
function devel_update_7001() {
|
||||
db_delete('menu_links')
|
||||
->condition('module', 'devel')
|
||||
->execute();
|
||||
variable_set('menu_rebuild_needed', TRUE);
|
||||
return t('Devel module menu links will be rebuilt.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove deprecated variables - dev_query, devel_code_coverage
|
||||
*/
|
||||
function devel_update_7002() {
|
||||
variable_del('dev_query'); // Sad trombone. http://drupalcode.org/viewvc/drupal/drupal/includes/database.mysql.inc?revision=1.2&view=markup
|
||||
variable_del('devel_code_coverage');
|
||||
}
|
||||
|
||||
/**
|
||||
* As per issue #813132: change schablon.com to white for krumo.
|
||||
*/
|
||||
function devel_update_7003() {
|
||||
if (variable_get('devel_krumo_skin', 'white') == 'schablon.com') {
|
||||
variable_set('devel_krumo_skin', 'white');
|
||||
}
|
||||
}
|
45
sites/all/modules/development/devel/devel.js
Normal file
@@ -0,0 +1,45 @@
|
||||
(function ($) {
|
||||
|
||||
// Explain link in query log
|
||||
Drupal.behaviors.devel_explain = {
|
||||
attach: function() {
|
||||
$('a.dev-explain').click(function () {
|
||||
qid = $(this).attr("qid");
|
||||
cell = $('#devel-query-' + qid);
|
||||
$('.dev-explain', cell).load(Drupal.settings.basePath + '?q=devel/explain/' + Drupal.settings.devel.request_id + '/' + qid).show();
|
||||
$('.dev-placeholders', cell).hide();
|
||||
$('.dev-arguments', cell).hide();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Arguments link in query log
|
||||
Drupal.behaviors.devel_arguments = {
|
||||
attach: function() {
|
||||
$('a.dev-arguments').click(function () {
|
||||
qid = $(this).attr("qid");
|
||||
cell = $('#devel-query-' + qid);
|
||||
$('.dev-arguments', cell).load(Drupal.settings.basePath + '?q=devel/arguments/' + Drupal.settings.devel.request_id + '/' + qid).show();
|
||||
$('.dev-placeholders', cell).hide();
|
||||
$('.dev-explain', cell).hide();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Placeholders link in query log
|
||||
Drupal.behaviors.devel_placeholders = {
|
||||
attach: function() {
|
||||
$('a.dev-placeholders').click(function () {
|
||||
qid = $(this).attr("qid");
|
||||
cell = $('#devel-query-' + qid);
|
||||
$('.dev-explain', cell).hide();
|
||||
$('.dev-arguments', cell).hide();
|
||||
$('.dev-placeholders', cell).show();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
79
sites/all/modules/development/devel/devel.mail.inc
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* MailSystemInterface for logging mails to the filesystem.
|
||||
*
|
||||
* To enable, save a variable in settings.php (or otherwise) whose value
|
||||
* can be as simple as:
|
||||
*
|
||||
* $conf['mail_system'] = array(
|
||||
* 'default-system' => 'DevelMailLog',
|
||||
*);
|
||||
*
|
||||
* Saves to temporary://devel-mails dir by default. Can be changed using
|
||||
* 'devel_debug_mail_directory' variable. Filename pattern controlled by
|
||||
* 'devel_debug_mail_file_format' variable.
|
||||
*
|
||||
*/
|
||||
|
||||
class DevelMailLog extends DefaultMailSystem {
|
||||
|
||||
public function composeMessage($message) {
|
||||
$mimeheaders = array();
|
||||
$message['headers']['To'] = $message['to'];
|
||||
foreach ($message['headers'] as $name => $value) {
|
||||
$mimeheaders[] = $name . ': ' . mime_header_encode($value);
|
||||
}
|
||||
|
||||
$line_endings = variable_get('mail_line_endings', MAIL_LINE_ENDINGS);
|
||||
$output = join($line_endings, $mimeheaders) . $line_endings;
|
||||
$output .= $message['subject'] . $line_endings;
|
||||
$output .= preg_replace('@\r?\n@', $line_endings, $message['body']);
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function getFileName($message) {
|
||||
$output_directory = $this->getOutputDirectory();
|
||||
$this->makeOutputDirectory($output_directory);
|
||||
|
||||
$output_file_format = variable_get('devel_debug_mail_file_format', '%to-%subject-%datetime.mail.txt');
|
||||
$tokens = array(
|
||||
'%to' => $message['to'],
|
||||
'%subject' => $message['subject'],
|
||||
'%datetime' => date('y-m-d_his'),
|
||||
);
|
||||
return $output_directory . '/' . $this->dirify(str_replace(array_keys($tokens), array_values($tokens), $output_file_format));
|
||||
}
|
||||
|
||||
private function dirify($string) {
|
||||
return preg_replace('/[^a-zA-Z0-9_\-\.@]/', '_', $string);
|
||||
}
|
||||
/**
|
||||
* Save an e-mail message to a file, using Drupal variables and default settings.
|
||||
*
|
||||
* @see http://php.net/manual/en/function.mail.php
|
||||
* @see drupal_mail()
|
||||
*
|
||||
* @param $message
|
||||
* A message array, as described in hook_mail_alter().
|
||||
* @return
|
||||
* TRUE if the mail was successfully accepted, otherwise FALSE.
|
||||
*/
|
||||
public function mail(array $message) {
|
||||
$output = $this->composeMessage($message);
|
||||
$output_file = $this->getFileName($message);
|
||||
|
||||
return file_put_contents($output_file, $output);
|
||||
}
|
||||
|
||||
protected function makeOutputDirectory($output_directory) {
|
||||
if (!file_prepare_directory($output_directory, FILE_CREATE_DIRECTORY)) {
|
||||
throw new Exception("Unable to continue sending mail, $output_directory is not writable");
|
||||
}
|
||||
}
|
||||
|
||||
public function getOutputDirectory() {
|
||||
return variable_get('devel_debug_mail_directory', 'temporary://devel-mails');
|
||||
}
|
||||
}
|
||||
?>
|
1764
sites/all/modules/development/devel/devel.module
Normal file
301
sites/all/modules/development/devel/devel.pages.inc
Normal file
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
|
||||
// Menu callback that shows menu item.
|
||||
function devel_menu_item() {
|
||||
$item = menu_get_item($_GET['path']);
|
||||
return kdevel_print_object($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all currently defined user functions in the current
|
||||
* request lifecycle, with links their documentation.
|
||||
*/
|
||||
function devel_function_reference() {
|
||||
$functions = get_defined_functions();
|
||||
$version = devel_get_core_version(VERSION);
|
||||
$ufunctions = $functions['user'];
|
||||
sort($ufunctions);
|
||||
$api = variable_get('devel_api_url', 'api.drupal.org');
|
||||
foreach ($ufunctions as $function) {
|
||||
$links[] = l($function, "http://$api/api/$version/function/$function");
|
||||
}
|
||||
return theme('item_list', array('items' => $links));
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback; clears all caches, then redirects to the previous page.
|
||||
*/
|
||||
function devel_cache_clear() {
|
||||
drupal_flush_all_caches();
|
||||
|
||||
drupal_set_message('Cache cleared.');
|
||||
|
||||
drupal_goto();
|
||||
}
|
||||
|
||||
// A menu callback. Called by the AJAX link in query log.
|
||||
function devel_querylog_explain($request_id, $qid) {
|
||||
if (!is_numeric($request_id)) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
$path = "temporary://devel_querylog/$request_id.txt";
|
||||
$path = file_stream_wrapper_uri_normalize($path);
|
||||
$queries = json_decode(file_get_contents($path));
|
||||
$query = $queries[$qid];
|
||||
$result = db_query('EXPLAIN ' . $query->query, (array)$query->args)->fetchAllAssoc('table');
|
||||
$i = 1;
|
||||
foreach ($result as $row) {
|
||||
$row = (array)$row;
|
||||
if ($i == 1) {
|
||||
$header = array_keys($row);
|
||||
}
|
||||
$rows[] = array_values($row);
|
||||
$i++;
|
||||
}
|
||||
// Print and return nothing thus avoiding page wrapper.
|
||||
$output = theme('table', array('header' => $header, 'rows' => $rows));
|
||||
print $output;
|
||||
$GLOBALS['devel_shutdown'] = FALSE;
|
||||
}
|
||||
|
||||
// A menu callback. Called by the AJAX link in query log.
|
||||
function devel_querylog_arguments($request_id, $qid) {
|
||||
if (!is_numeric($request_id)) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
$path = "temporary://devel_querylog/$request_id.txt";
|
||||
$path = file_stream_wrapper_uri_normalize($path);
|
||||
$queries = json_decode(file_get_contents($path));
|
||||
$query = $queries[$qid];
|
||||
$conn = Database::getConnection();
|
||||
$quoted = array();
|
||||
foreach ((array)$query->args as $key => $val) {
|
||||
$quoted[$key] = $conn->quote($val);
|
||||
}
|
||||
$output = strtr($query->query, $quoted);
|
||||
|
||||
// print and return nothing thus avoiding page wrapper.
|
||||
print $output;
|
||||
$GLOBALS['devel_shutdown'] = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback; clear the database, resetting the menu to factory defaults.
|
||||
*/
|
||||
function devel_menu_rebuild() {
|
||||
menu_rebuild();
|
||||
drupal_set_message(t('The menu router has been rebuilt.'));
|
||||
drupal_goto();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a dropdown of installed modules with the option to reinstall them.
|
||||
*/
|
||||
function devel_reinstall($form, &$form_state) {
|
||||
$output = '';
|
||||
$modules = module_list();
|
||||
sort($modules);
|
||||
$options = drupal_map_assoc($modules);
|
||||
$form['list'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#options' => $options,
|
||||
'#description' => t('Uninstall and then install the selected modules. <code>hook_uninstall()</code> and <code>hook_install()</code> will be executed and the schema version number will be set to the most recent update number. You may have to manually clear out any existing tables first if the module doesn\'t implement <code>hook_uninstall()</code>.'),
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#value' => t('Reinstall'),
|
||||
'#type' => 'submit',
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process reinstall menu form submissions.
|
||||
*/
|
||||
function devel_reinstall_submit($form, &$form_state) {
|
||||
// require_once './includes/install.inc';
|
||||
$modules = array_filter($form_state['values']['list']);
|
||||
module_disable($modules, FALSE);
|
||||
drupal_uninstall_modules($modules);
|
||||
module_enable($modules, FALSE);
|
||||
drupal_set_message(t('Uninstalled and installed: %names.', array('%names' => implode(', ', $modules))));
|
||||
}
|
||||
|
||||
// Menu callback.
|
||||
function devel_theme_registry() {
|
||||
drupal_theme_initialize();
|
||||
$hooks = theme_get_registry();
|
||||
ksort($hooks);
|
||||
return kprint_r($hooks, TRUE);
|
||||
}
|
||||
|
||||
// Menu callback. $entity_type argument not currently used in the UI.
|
||||
function devel_entity_info_page($entity_type = NULL) {
|
||||
$info = entity_get_info($entity_type);
|
||||
ksort($info);
|
||||
return kprint_r($info, TRUE);
|
||||
}
|
||||
|
||||
// Menu callback.
|
||||
function devel_field_info_page() {
|
||||
$info = field_info_fields();
|
||||
$output = kprint_r($info, TRUE, t('Fields'));
|
||||
$info = field_info_instances();
|
||||
$output .= kprint_r($info, TRUE, t('Instances'));
|
||||
$info = field_info_bundles();
|
||||
$output .= kprint_r($info, TRUE, t('Bundles'));
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback; display all variables.
|
||||
*/
|
||||
function devel_variable_page() {
|
||||
// We return our own $page so as to avoid blocks.
|
||||
$output = drupal_get_form('devel_variable_form');
|
||||
drupal_set_page_content($output);
|
||||
$page = element_info('page');
|
||||
return $page;
|
||||
}
|
||||
|
||||
function devel_variable_form() {
|
||||
$header = array(
|
||||
'name' => array('data' => t('Name'), 'field' => 'name', 'sort' => 'asc'),
|
||||
'value' => array('data' => t('Value'), 'field' => 'value'),
|
||||
'length' => array('data' => t('Length'), 'field' => 'length'),
|
||||
'edit' => array('data' => t('Operations')),
|
||||
);
|
||||
// TODO: we could get variables out of $conf but that would include hard coded ones too. ideally i would highlight overrridden/hard coded variables
|
||||
$query = db_select('variable', 'v')->extend('TableSort');
|
||||
$query->fields('v', array('name', 'value'));
|
||||
switch (db_driver()) {
|
||||
case 'mssql':
|
||||
$query->addExpression("LEN(v.value)", 'length');
|
||||
break;
|
||||
default:
|
||||
$query->addExpression("LENGTH(v.value)", 'length');
|
||||
break;
|
||||
}
|
||||
$result = $query
|
||||
->orderByHeader($header)
|
||||
->execute();
|
||||
|
||||
foreach ($result as $row) {
|
||||
// $variables[$row->name] = '';
|
||||
$options[$row->name]['name'] = check_plain($row->name);
|
||||
if (merits_krumo($row->value)) {
|
||||
$value = krumo_ob(variable_get($row->name, NULL));
|
||||
}
|
||||
else {
|
||||
if (drupal_strlen($row->value) > 70) {
|
||||
$value = check_plain(drupal_substr($row->value, 0, 65)) .'...';
|
||||
}
|
||||
else {
|
||||
$value = check_plain($row->value);
|
||||
}
|
||||
}
|
||||
$options[$row->name]['value'] = $value;
|
||||
$options[$row->name]['length'] = $row->length;
|
||||
$options[$row->name]['edit'] = l(t('Edit'), "devel/variable/edit/$row->name");
|
||||
}
|
||||
$form['variables'] = array(
|
||||
'#type' => 'tableselect',
|
||||
'#header' => $header,
|
||||
'#options' => $options,
|
||||
'#empty' => t('No variables.'),
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Delete'),
|
||||
);
|
||||
|
||||
// krumo($form);
|
||||
return $form;
|
||||
}
|
||||
|
||||
function devel_variable_form_submit($form, &$form_state) {
|
||||
$deletes = array_filter($form_state['values']['variables']);
|
||||
array_walk($deletes, 'variable_del');
|
||||
if (count($deletes)) {
|
||||
drupal_set_message(format_plural(count($deletes), 'One variable deleted.', '@count variables deleted.'));
|
||||
}
|
||||
}
|
||||
|
||||
function devel_variable_edit($form, &$form_state, $name) {
|
||||
$value = variable_get($name, 'not found');
|
||||
$form['name'] = array(
|
||||
'#type' => 'value',
|
||||
'#value' => $name
|
||||
);
|
||||
$form['value'] = array(
|
||||
'#type' => 'item',
|
||||
'#title' => t('Old value'),
|
||||
'#markup' => dpr($value, TRUE),
|
||||
);
|
||||
if (is_string($value) || is_numeric($value)) {
|
||||
$form['new'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('New value'),
|
||||
'#default_value' => $value
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Submit'),
|
||||
);
|
||||
}
|
||||
else {
|
||||
$api = variable_get('devel_api_url', 'api.drupal.org');
|
||||
$form['new'] = array(
|
||||
'#type' => 'item',
|
||||
'#title' => t('New value'),
|
||||
'#value' => t('Sorry, complex variable types may not be edited yet. Use the <em>Execute PHP</em> block and the <a href="@variable-set-doc">variable_set()</a> function.', array('@variable-set-doc' => "http://$api/api/HEAD/function/variable_set"))
|
||||
);
|
||||
}
|
||||
drupal_set_title($name);
|
||||
return $form;
|
||||
}
|
||||
|
||||
function devel_variable_edit_submit($form, &$form_state) {
|
||||
variable_set($form_state['values']['name'], $form_state['values']['new']);
|
||||
drupal_set_message(t('Saved new value for %name.', array('%name' => $form_state['values']['name'])));
|
||||
'devel/variable';
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback: display the session.
|
||||
*/
|
||||
function devel_session() {
|
||||
global $user;
|
||||
$output = kprint_r($_SESSION, TRUE);
|
||||
$headers = array(t('Session name'), t('Session ID'));
|
||||
$output .= theme('table', array('headers' => $headers, 'rows' => array(array(session_name(), session_id()))));
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback; prints the loaded structure of the current node/user.
|
||||
*/
|
||||
function devel_load_object($type, $object, $name = NULL) {
|
||||
$name = isset($name) ? $name : $type;
|
||||
return kdevel_print_object($object, '$'. $name .'->');
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback; prints the render structure of the current object (currently node or user).
|
||||
*/
|
||||
function devel_render_object($type, $object, $name = NULL) {
|
||||
$name = isset($name) ? $name : $type;
|
||||
$function = $type . '_view';
|
||||
$build = $function($object);
|
||||
return kdevel_print_object($build, '$'. $name .'->');
|
||||
}
|
||||
|
||||
function devel_elements_page() {
|
||||
return kdevel_print_object(module_invoke_all('element_info'));
|
||||
}
|
||||
|
||||
function devel_phpinfo() {
|
||||
print phpinfo();
|
||||
drupal_exit();
|
||||
}
|
24
sites/all/modules/development/devel/devel.rules.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implements hook_rules_action_info().
|
||||
*/
|
||||
function devel_rules_action_info() {
|
||||
return array(
|
||||
'devel_debug' => array(
|
||||
'base' => 'devel_rules_debug_action',
|
||||
'label' => t('Debug value'),
|
||||
'group' => t('Devel'),
|
||||
'parameter' => array(
|
||||
'value' => array('type' => 'unknown', 'label' => t('Value to debug')),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rules action for debugging values.
|
||||
*/
|
||||
function devel_rules_debug_action($value) {
|
||||
dpm($value);
|
||||
}
|
52
sites/all/modules/development/devel/devel.test
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Tests for devel module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test devel mail functionality.
|
||||
*/
|
||||
class DevelMailTest extends DrupalWebTestCase {
|
||||
protected $profile = 'testing';
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'Devel Mail interface',
|
||||
'description' => 'Test sending mails with debug interface',
|
||||
'group' => 'Devel',
|
||||
);
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test mail logging functionality.
|
||||
*/
|
||||
function testMail() {
|
||||
require_once ('devel.mail.inc');
|
||||
$message = array();
|
||||
$message['to'] = 'drupal@example.com';
|
||||
$message['subject'] = 'Test mail';
|
||||
$message['headers'] = array(
|
||||
'From' => 'postmaster@example.com',
|
||||
'X-stupid' => 'dumb',
|
||||
);
|
||||
$message['body'] = "I am the body of this message";
|
||||
$d = new DevelMailLog();
|
||||
|
||||
$filename = $d->getFileName($message);
|
||||
$content = $d->composeMessage($message);
|
||||
$expected_filename = $d->getOutputDirectory() . '/drupal@example.com-Test_mail-' . date('y-m-d_his') . '.mail.txt';
|
||||
$this->assertEqual($filename, $expected_filename);
|
||||
$this->assertEqual($content, 'From: postmaster@example.com
|
||||
X-stupid: dumb
|
||||
To: drupal@example.com
|
||||
Test mail
|
||||
I am the body of this message');
|
||||
}
|
||||
|
||||
}
|
25
sites/all/modules/development/devel/develDrushTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @file
|
||||
* PHPUnit Tests for devel. This uses Drush's own test framework, based on PHPUnit.
|
||||
* To run the tests, use phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc.
|
||||
* Note that we are pointing to the drush_testcase.inc file under /tests subdir in drush.
|
||||
*/
|
||||
class develCase extends Drush_CommandTestCase {
|
||||
|
||||
public function testFnView() {
|
||||
$sites = $this->setUpDrupal(1, TRUE);
|
||||
$options = array(
|
||||
'root' => $this->webroot(),
|
||||
'uri' => key($sites),
|
||||
);
|
||||
$this->drush('pm-download', array('devel'), $options + array('cache' => NULL));
|
||||
$this->drush('pm-enable', array('devel'), $options + array('skip' => NULL, 'yes' => NULL));
|
||||
|
||||
$this->drush('fn-view', array('drush_main'), $options);
|
||||
$output = $this->getOutput();
|
||||
$this->assertContains('@return', $output, 'Output contain @return Doxygen.');
|
||||
$this->assertContains('function drush_main() {', $output, 'Output contains function drush_main() declaration');
|
||||
}
|
||||
}
|
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Generate content, taxonomy, menu, and users via drush framework.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of hook_drush_command().
|
||||
*/
|
||||
function devel_generate_drush_command() {
|
||||
$items['generate-users'] = array(
|
||||
'description' => 'Create users.',
|
||||
'arguments' => array(
|
||||
'number_users' => 'Number of users to generate.',
|
||||
),
|
||||
'options' => array(
|
||||
'kill' => 'Delete all users before generating new ones.',
|
||||
'roles' => 'A comma delimited list of role IDs which should be granted to the new users. No need to specify authenticated user role.',
|
||||
),
|
||||
'aliases' => array('genu'),
|
||||
);
|
||||
$items['generate-terms'] = array(
|
||||
'description' => 'Create terms in specified vocabulary.',
|
||||
'arguments' => array(
|
||||
'machine_name' => 'Vocabulary machine name into which new terms will be inserted.',
|
||||
'number_terms' => 'Number of terms to insert. Defaults to 10.',
|
||||
),
|
||||
'options' => array(
|
||||
'kill' => 'Delete all terms in specified vocabulary before generating.',
|
||||
'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500',
|
||||
),
|
||||
'aliases' => array('gent'),
|
||||
|
||||
);
|
||||
$items['generate-vocabs'] = array(
|
||||
'description' => 'Create vocabularies.',
|
||||
'arguments' => array(
|
||||
'num_vocabs' => 'Number of vocabularies to create. Defaults to 1.',
|
||||
),
|
||||
'options' => array(
|
||||
'kill' => 'Delete all vocabularies before generating.',
|
||||
),
|
||||
'aliases' => array('genv'),
|
||||
);
|
||||
$items['generate-content'] = array(
|
||||
'description' => 'Create content.',
|
||||
'drupal dependencies' => array('devel_generate'),
|
||||
'arguments' => array(
|
||||
'number_nodes' => 'Number of nodes to generate.',
|
||||
'maximum_comments' => 'Maximum number of comments to generate.',
|
||||
),
|
||||
'options' => array(
|
||||
'kill' => 'Delete all content before generating new content.',
|
||||
'types' => 'A comma delimited list of content types to create. Defaults to page,article.',
|
||||
'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500',
|
||||
'skip-fields' => 'A comma delimited list of fields to omit when generating random values',
|
||||
'languages' => 'A comma-separated list of language codes',
|
||||
),
|
||||
'aliases' => array('genc'),
|
||||
);
|
||||
$items['generate-menus'] = array(
|
||||
'description' => 'Create menus and menu items.',
|
||||
'drupal dependencies' => array('devel_generate'), // Remove these once devel.module is moved down a directory. http://drupal.org/node/925246
|
||||
'arguments' => array(
|
||||
'number_menus' => 'Number of menus to generate. Defaults to 2.',
|
||||
'number_links' => 'Number of links to generate. Defaults to 50.',
|
||||
'max_depth' => 'Max link depth. Defaults to 3',
|
||||
'max_width' => 'Max width of first level of links. Defaults to 8.',
|
||||
),
|
||||
'options' => array(
|
||||
'kill' => 'Delete all previously generated menus and links before generating new menus and links.',
|
||||
),
|
||||
'aliases' => array('genm'),
|
||||
);
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Command callback. Generate a number of users.
|
||||
*/
|
||||
function drush_devel_generate_users($num_users = NULL) {
|
||||
if (drush_generate_is_number($num_users) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', t('Invalid number of users.'));
|
||||
}
|
||||
drush_generate_include_devel();
|
||||
$roles = drush_get_option('roles') ? explode(',', drush_get_option('roles')) : array();
|
||||
devel_create_users($num_users, drush_get_option('kill'), 0, $roles);
|
||||
drush_log(t('Generated @number users.', array('@number' => $num_users)), 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Command callback. Generate a number of terms in given vocabs.
|
||||
*/
|
||||
function drush_devel_generate_terms($vname = NULL, $num_terms = 10) {
|
||||
// Try to convert machine name to a vocab ID
|
||||
if (!$vocab = taxonomy_vocabulary_machine_name_load($vname)) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid vocabulary name: !name', array('!name' => $vname)));
|
||||
}
|
||||
if (drush_generate_is_number($num_terms) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of terms: !num', array('!num' => $num_terms)));
|
||||
}
|
||||
|
||||
drush_generate_include_devel();
|
||||
$vocabs[$vocab->vid] = $vocab;
|
||||
devel_generate_term_data($vocabs, $num_terms, '12', drush_get_option('kill'));
|
||||
drush_log(dt('Generated @num_terms terms.', array('@num_terms' => $num_terms)), 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Command callback. Generate a number of vocabularies.
|
||||
*/
|
||||
function drush_devel_generate_vocabs($num_vocab = 1) {
|
||||
if (drush_generate_is_number($num_vocab) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of vocabularies: !num.', array('!num' => $num_vocab)));
|
||||
}
|
||||
drush_generate_include_devel();
|
||||
devel_generate_vocab_data($num_vocab, '12', drush_get_option('kill'));
|
||||
drush_log(dt('Generated @num_vocab vocabularies.', array('@num_vocab' => $num_vocab)), 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Command callback. Generate a number of nodes and comments.
|
||||
*/
|
||||
function drush_devel_generate_content($num_nodes = NULL, $max_comments = NULL) {
|
||||
if (drush_generate_is_number($num_nodes) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of nodes'));
|
||||
}
|
||||
if (!empty($max_comments) && drush_generate_is_number($max_comments) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of comments.'));
|
||||
}
|
||||
|
||||
$add_language = drush_get_option('languages');
|
||||
if (!empty($add_language)) {
|
||||
$add_language = explode(',', str_replace(' ', '', $add_language));
|
||||
// Intersect with the enabled languages to make sure the language args
|
||||
// passed are actually enabled.
|
||||
$values['values']['add_language'] = array_intersect($add_language, array_keys(locale_language_list()));
|
||||
}
|
||||
|
||||
// Load user 1; is needed for creating *published* comments.
|
||||
if ($max_comments) {
|
||||
global $user;
|
||||
$user_one = user_load(1);
|
||||
$user = $user_one;
|
||||
drupal_save_session(FALSE);
|
||||
}
|
||||
|
||||
$values['values']['kill_content'] = drush_get_option('kill');
|
||||
$values['values']['title_length'] = 6;
|
||||
$values['values']['num_nodes'] = $num_nodes;
|
||||
$values['values']['max_comments'] = $max_comments;
|
||||
$values['values']['node_types'] = drupal_map_assoc(explode(',', drush_get_option('types', 'page,article')));
|
||||
drush_generate_include_devel();
|
||||
devel_generate_content($values);
|
||||
drush_log(t('Generated @num_nodes nodes, @max_comments comments (or less) per node.', array('@num_nodes' => (int)$num_nodes, '@max_comments' => (int)$max_comments)), 'success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Command callback. Generate a number of menus and menu links.
|
||||
*/
|
||||
function drush_devel_generate_menus($number_menus = 2, $number_links = 50, $max_depth = 3, $max_width = 8) {
|
||||
if (drush_generate_is_number($number_menus) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of menus'));
|
||||
}
|
||||
if (drush_generate_is_number($number_links) == FALSE) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of links'));
|
||||
}
|
||||
if (drush_generate_is_number($max_depth) == FALSE || $max_depth > 9 || $max_depth < 1) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum link depth. Use a value between 1 and 9'));
|
||||
}
|
||||
if (drush_generate_is_number($max_width) == FALSE || $max_width < 1) {
|
||||
return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum menu width. Use a positive numeric value.'));
|
||||
}
|
||||
|
||||
global $user;
|
||||
$user_one = user_load(1);
|
||||
$user = $user_one;
|
||||
drupal_save_session(FALSE);
|
||||
|
||||
$kill = drush_get_option('kill');
|
||||
drush_generate_include_devel();
|
||||
$link_types = drupal_map_assoc(array('node', 'front', 'external'));
|
||||
devel_generate_menu_data($number_menus, array(), $number_links, 12, $link_types, $max_depth, $max_width, $kill);
|
||||
drush_log(t('Generated @number_menus menus, @number_links links.', array('@number_menus' => (int)$number_menus, '@number_links' => (int)$number_links)), 'success');
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
|
||||
// Verify if param is a number.
|
||||
function drush_generate_is_number($number) {
|
||||
if ($number == NULL) return FALSE;
|
||||
if (!is_numeric($number)) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Include devel_generate.inc.
|
||||
function drush_generate_include_devel() {
|
||||
$path = drupal_get_path('module', 'devel_generate');
|
||||
require_once($path .'/devel_generate.inc');
|
||||
}
|
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Functions needed for devel_generate Fields API integration.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enrich the $object that is about to be saved with arbitrary
|
||||
* information in each of its fields.
|
||||
**/
|
||||
function devel_generate_fields(&$object, $obj_type, $bundle) {
|
||||
$field_types = field_info_field_types();
|
||||
$instances = field_info_instances($obj_type, $bundle);
|
||||
$skips = function_exists('drush_get_option') ? drush_get_option('skip-fields', '') : @$_REQUEST['skip-fields'];
|
||||
foreach (explode(',', $skips) as $skip) {
|
||||
unset($instances[$skip]);
|
||||
}
|
||||
foreach ($instances as $instance) {
|
||||
$field_name = $instance['field_name'];
|
||||
$field = field_info_field($field_name);
|
||||
|
||||
$object_field = array();
|
||||
// If module handles own multiples, then only call its hook once.
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
$max = 0;
|
||||
}
|
||||
else {
|
||||
switch ($field['cardinality']) {
|
||||
case FIELD_CARDINALITY_UNLIMITED:
|
||||
$max = rand(0, 3); //just an arbitrary number for 'unlimited'
|
||||
break;
|
||||
default:
|
||||
$max = $field['cardinality'] - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for ($i = 0; $i <= $max; $i++) {
|
||||
$module = $field_types[$field['type']]['module'];
|
||||
|
||||
// Include any support file that might exist for this field.
|
||||
if (in_array($module, array('file', 'image', 'taxonomy', 'number', 'text', 'comment', 'list'))) {
|
||||
// devel_generate implements on behalf of core and special friends.
|
||||
module_load_include('inc', 'devel_generate', "$module.devel_generate");
|
||||
}
|
||||
else {
|
||||
module_load_include('inc', $module, "$module.devel_generate");
|
||||
}
|
||||
$function = $module . '_devel_generate';
|
||||
if (function_exists($function)) {
|
||||
if ($result = $function($object, $field, $instance, $bundle)) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
// Fields that handle their own multiples will add their own deltas.
|
||||
$object_field = $result;
|
||||
}
|
||||
else {
|
||||
// When multiples are handled by the content module, add a delta for each result.
|
||||
$object_field[$i] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: Completely overriding any existing $object->{$field['field_name']}
|
||||
// is necessary here because the forum module has a bug where it
|
||||
// initializes the property with incorrect data.
|
||||
// @see http://drupal.org/node/652176
|
||||
$object->{$field['field_name']} = array(
|
||||
$object->language => $object_field,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple function to return multiple values for fields that use
|
||||
* custom multiple value widgets but don't need any other special multiple
|
||||
* values handling. This will call the field generation function
|
||||
* a random number of times and compile the results into a node array.
|
||||
*/
|
||||
function devel_generate_multiple($function, $object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
if (function_exists($function)) {
|
||||
switch ($field['cardinality']) {
|
||||
case FIELD_CARDINALITY_UNLIMITED:
|
||||
$max = rand(0, 3); //just an arbitrary number for 'unlimited'
|
||||
break;
|
||||
default:
|
||||
$max = $field['cardinality'] - 1;
|
||||
break;
|
||||
}
|
||||
for ($i = 0; $i <= $max; $i++) {
|
||||
$result = $function($object, $field, $instance, $bundle);
|
||||
if (!empty($result)) {
|
||||
$object_field[$i] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $object_field;
|
||||
}
|
@@ -0,0 +1,711 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Generate some random users.
|
||||
*
|
||||
* @param $num
|
||||
* Number of users to generate.
|
||||
* @param $kill
|
||||
* Boolean that indicates if existing users should be removed first.
|
||||
* @param $age
|
||||
* The max age of each randomly-generated user, in seconds.
|
||||
* @param $roles
|
||||
* An array of role IDs that the users should receive.
|
||||
*/
|
||||
function devel_create_users($num, $kill, $age = 0, $roles = array()) {
|
||||
$url = parse_url($GLOBALS['base_url']);
|
||||
if ($kill) {
|
||||
$uids = db_select('users', 'u')
|
||||
->fields('u', array('uid'))
|
||||
->condition('uid', 1, '>')
|
||||
->execute()
|
||||
->fetchAllAssoc('uid');
|
||||
user_delete_multiple(array_keys($uids));
|
||||
drupal_set_message(format_plural(count($uids), '1 user deleted', '@count users deleted.'));
|
||||
}
|
||||
// Determine if we should create user pictures.
|
||||
$pic_config = FALSE;
|
||||
module_load_include('inc', 'system', 'image.gd');
|
||||
if (variable_get('user_pictures', 0) && function_exists('image_gd_check_settings') && image_gd_check_settings()) {
|
||||
$pic_config['path'] = variable_get('user_picture_path', 'pictures');
|
||||
list($pic_config['width'], $pic_config['height']) = explode('x', variable_get('user_picture_dimensions', '85x85'));
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
$names = array();
|
||||
while (count($names) < $num) {
|
||||
$name = devel_generate_word(mt_rand(6, 12));
|
||||
$names[$name] = '';
|
||||
}
|
||||
|
||||
if (empty($roles)) {
|
||||
$roles = array(DRUPAL_AUTHENTICATED_RID);
|
||||
}
|
||||
foreach ($names as $name => $value) {
|
||||
$edit = array(
|
||||
'uid' => NULL,
|
||||
'name' => $name,
|
||||
'pass' => NULL, // No password avoids user_hash_password() which is expensive.
|
||||
'mail' => $name . '@' . $url['host'],
|
||||
'status' => 1,
|
||||
'created' => REQUEST_TIME - mt_rand(0, $age),
|
||||
'roles' => drupal_map_assoc($roles),
|
||||
);
|
||||
|
||||
// Populate all core fields on behalf of field.module
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate.fields');
|
||||
$edit = (object) $edit;
|
||||
$edit->language = LANGUAGE_NONE;
|
||||
devel_generate_fields($edit, 'user', 'user');
|
||||
$edit = (array) $edit;
|
||||
|
||||
$account = user_save(drupal_anonymous_user(), $edit);
|
||||
|
||||
if ($pic_config) {
|
||||
// Since the image.module should scale the picture just pick an
|
||||
// arbitrary size that it's too big for our font.
|
||||
$im = imagecreatetruecolor(200, 200);
|
||||
|
||||
// Randomize the foreground using the md5 of the user id, then invert it
|
||||
// for the background color so there's enough contrast to read the text.
|
||||
$parts = array_map('hexdec', str_split(md5($account->uid), 2));
|
||||
$fg = imagecolorallocate($im, $parts[1], $parts[3], $parts[5]);
|
||||
$bg = imagecolorallocate($im, 255 - $parts[0], 255 - $parts[1], 255 - $parts[2]);
|
||||
|
||||
// Fill the background then print their user info.
|
||||
imagefill($im, 0, 0, $bg);
|
||||
imagestring($im, 5, 5, 5, "#" . $account->uid, $fg);
|
||||
imagestring($im, 5, 5, 25, $account->name, $fg);
|
||||
|
||||
|
||||
// Create an empty, managed file where we want the user's picture to
|
||||
// be so we can have GD overwrite it with the image.
|
||||
$picture_directory = variable_get('file_default_scheme', 'public') . '://' . variable_get('user_picture_path', 'pictures');
|
||||
file_prepare_directory($picture_directory, FILE_CREATE_DIRECTORY);
|
||||
$destination = file_stream_wrapper_uri_normalize($picture_directory . '/picture-' . $account->uid . '.png');
|
||||
$file = file_save_data('', $destination);
|
||||
|
||||
// GD doesn't like stream wrapped paths so convert the URI to a normal
|
||||
// file system path.
|
||||
if (isset($file) && $wrapper = file_stream_wrapper_get_instance_by_uri($file->uri)) {
|
||||
imagepng($im, $wrapper->realpath());
|
||||
}
|
||||
imagedestroy($im);
|
||||
|
||||
// Clear the cached filesize, set the owner and MIME-type then re-save
|
||||
// the file.
|
||||
clearstatcache();
|
||||
$file->uid = $account->uid;
|
||||
$file->filemime = 'image/png';
|
||||
$file = file_save($file);
|
||||
|
||||
// Save the user record with the new picture.
|
||||
$edit = (array) $account;
|
||||
$edit['picture'] = $file;
|
||||
user_save($account, $edit);
|
||||
}
|
||||
}
|
||||
}
|
||||
drupal_set_message(t('!num_users created.', array('!num_users' => format_plural($num, '1 user', '@count users'))));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The main API function for creating content.
|
||||
*
|
||||
* See devel_generate_content_form() for the supported keys in $form_state['values'].
|
||||
* Other modules may participate by form_alter() on that form and then handling their data during hook_nodeapi('pre_save') or in own submit handler for the form.
|
||||
*
|
||||
* @param string $form_state
|
||||
* @return void
|
||||
*/
|
||||
function devel_generate_content($form_state) {
|
||||
if (!empty($form_state['values']['kill_content'])) {
|
||||
devel_generate_content_kill($form_state['values']);
|
||||
}
|
||||
|
||||
if (count($form_state['values']['node_types'])) {
|
||||
// Generate nodes.
|
||||
devel_generate_content_pre_node($form_state['values']);
|
||||
$start = time();
|
||||
for ($i = 1; $i <= $form_state['values']['num_nodes']; $i++) {
|
||||
devel_generate_content_add_node($form_state['values']);
|
||||
if (function_exists('drush_log') && $i % drush_get_option('feedback', 1000) == 0) {
|
||||
$now = time();
|
||||
drush_log(dt('Completed !feedback nodes (!rate nodes/min)', array('!feedback' => drush_get_option('feedback', 1000), '!rate' => (drush_get_option('feedback', 1000)*60)/($now-$start))), 'ok');
|
||||
$start = $now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
devel_generate_set_message(format_plural($form_state['values']['num_nodes'], '1 node created.', 'Finished creating @count nodes'));
|
||||
}
|
||||
|
||||
function devel_generate_add_comments($node, $users, $max_comments, $title_length = 8) {
|
||||
$num_comments = mt_rand(1, $max_comments);
|
||||
for ($i = 1; $i <= $num_comments; $i++) {
|
||||
$comment = new stdClass;
|
||||
$comment->nid = $node->nid;
|
||||
$comment->cid = NULL;
|
||||
$comment->name = 'devel generate';
|
||||
$comment->mail = 'devel_generate@example.com';
|
||||
$comment->timestamp = mt_rand($node->created, REQUEST_TIME);
|
||||
|
||||
switch ($i % 3) {
|
||||
case 1:
|
||||
$comment->pid = db_query_range("SELECT cid FROM {comment} WHERE pid = 0 AND nid = :nid ORDER BY RAND()", 0, 1, array(':nid' => $comment->nid))->fetchField();
|
||||
break;
|
||||
case 2:
|
||||
$comment->pid = db_query_range("SELECT cid FROM {comment} WHERE pid > 0 AND nid = :nid ORDER BY RAND()", 0, 1, array(':nid' => $comment->nid))->fetchField();
|
||||
break;
|
||||
default:
|
||||
$comment->pid = 0;
|
||||
}
|
||||
|
||||
// The subject column has a max character length of 64
|
||||
// See bug: http://drupal.org/node/1024340
|
||||
$comment->subject = substr(devel_create_greeking(mt_rand(2, $title_length), TRUE), 0, 63);
|
||||
$comment->uid = $users[array_rand($users)];
|
||||
$comment->language = LANGUAGE_NONE;
|
||||
// Populate all core fields on behalf of field.module
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate.fields');
|
||||
devel_generate_fields($comment, 'comment', 'comment_node_' . $node->type);
|
||||
comment_save($comment);
|
||||
}
|
||||
}
|
||||
|
||||
function devel_generate_vocabs($records, $maxlength = 12, $types = array('page', 'article')) {
|
||||
$vocs = array();
|
||||
|
||||
// Insert new data:
|
||||
for ($i = 1; $i <= $records; $i++) {
|
||||
$voc = new stdClass();
|
||||
$voc->name = devel_generate_word(mt_rand(2, $maxlength));
|
||||
$voc->machine_name = drupal_strtolower($voc->name);
|
||||
$voc->description = "description of ". $voc->name;
|
||||
// TODO: not working
|
||||
$voc->nodes = array_flip(array($types[array_rand($types)]));
|
||||
foreach ($voc->nodes as $key => $value) {
|
||||
$voc->nodes[$key] = $key;
|
||||
}
|
||||
|
||||
$voc->multiple = 1;
|
||||
$voc->required = 0;
|
||||
$voc->relations = 1;
|
||||
$voc->hierarchy = 1;
|
||||
$voc->weight = mt_rand(0,10);
|
||||
$voc->language = LANGUAGE_NONE;
|
||||
|
||||
taxonomy_vocabulary_save($voc);
|
||||
$vocs[] = $voc->name;
|
||||
|
||||
unset($voc);
|
||||
}
|
||||
return $vocs;
|
||||
}
|
||||
|
||||
function devel_generate_terms($records, $vocabs, $maxlength = 12) {
|
||||
$terms = array();
|
||||
|
||||
// Insert new data:
|
||||
$max = db_query('SELECT MAX(tid) FROM {taxonomy_term_data}')->fetchField();
|
||||
$start = time();
|
||||
for ($i = 1; $i <= $records; $i++) {
|
||||
$term = new stdClass;
|
||||
switch ($i % 2) {
|
||||
case 1:
|
||||
// Set vid and vocabulary_machine_name properties.
|
||||
$vocab = $vocabs[array_rand($vocabs)];
|
||||
$term->vid = $vocab->vid;
|
||||
$term->vocabulary_machine_name = $vocab->machine_name;
|
||||
// Don't set a parent. Handled by taxonomy_save_term()
|
||||
// $term->parent = 0;
|
||||
break;
|
||||
default:
|
||||
while (TRUE) {
|
||||
// Keep trying to find a random parent.
|
||||
$candidate = mt_rand(1, $max);
|
||||
$query = db_select('taxonomy_term_data', 't');
|
||||
$query->innerJoin('taxonomy_vocabulary', 'v', 't.vid = v.vid');
|
||||
$parent = $query
|
||||
->fields('t', array('tid', 'vid'))
|
||||
->fields('v', array('machine_name'))
|
||||
->condition('v.vid', array_keys($vocabs), 'IN')
|
||||
->condition('t.tid', $candidate, '>=')
|
||||
->range(0,1)
|
||||
->execute()
|
||||
->fetchAssoc();
|
||||
if ($parent['tid']) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$term->parent = $parent['tid'];
|
||||
// Slight speedup due to this property being set.
|
||||
$term->vocabulary_machine_name = $parent['machine_name'];
|
||||
$term->vid = $parent['vid'];
|
||||
break;
|
||||
}
|
||||
|
||||
$term->name = devel_generate_word(mt_rand(2, $maxlength));
|
||||
$term->description = "description of ". $term->name;
|
||||
$term->format = filter_fallback_format();
|
||||
$term->weight = mt_rand(0, 10);
|
||||
$term->language = LANGUAGE_NONE;
|
||||
|
||||
// Populate all core fields on behalf of field.module
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate.fields');
|
||||
devel_generate_fields($term, 'term', $term->vocabulary_machine_name);
|
||||
|
||||
if ($status = taxonomy_term_save($term)) {
|
||||
$max += 1;
|
||||
if (function_exists('drush_log')) {
|
||||
$feedback = drush_get_option('feedback', 1000);
|
||||
if ($i % $feedback == 0) {
|
||||
$now = time();
|
||||
drush_log(dt('Completed !feedback terms (!rate terms/min)', array('!feedback' => $feedback, '!rate' => $feedback*60 / ($now-$start) )), 'ok');
|
||||
$start = $now;
|
||||
}
|
||||
}
|
||||
|
||||
// Limit memory usage. Only report first 20 created terms.
|
||||
if ($i < 20) {
|
||||
$terms[] = $term->name;
|
||||
}
|
||||
|
||||
unset($term);
|
||||
}
|
||||
}
|
||||
return $terms;
|
||||
}
|
||||
|
||||
// TODO: use taxonomy_get_entries once that exists.
|
||||
function devel_generate_get_terms($vids) {
|
||||
return db_select('taxonomy_term_data', 'td')
|
||||
->fields('td', array('tid'))
|
||||
->condition('vid', $vids, 'IN')
|
||||
->orderBy('tid', 'ASC')
|
||||
->execute()
|
||||
->fetchCol('tid');
|
||||
}
|
||||
|
||||
function devel_generate_term_data($vocabs, $num_terms, $title_length, $kill) {
|
||||
if ($kill) {
|
||||
foreach (devel_generate_get_terms(array_keys($vocabs)) as $tid) {
|
||||
taxonomy_term_delete($tid);
|
||||
}
|
||||
drupal_set_message(t('Deleted existing terms.'));
|
||||
}
|
||||
|
||||
$new_terms = devel_generate_terms($num_terms, $vocabs, $title_length);
|
||||
if (!empty($new_terms)) {
|
||||
drupal_set_message(t('Created the following new terms: !terms', array('!terms' => theme('item_list', array('items' => $new_terms)))));
|
||||
}
|
||||
}
|
||||
|
||||
function devel_generate_vocab_data($num_vocab, $title_length, $kill) {
|
||||
|
||||
if ($kill) {
|
||||
foreach (taxonomy_get_vocabularies() as $vid => $vocab) {
|
||||
taxonomy_vocabulary_delete($vid);
|
||||
}
|
||||
drupal_set_message(t('Deleted existing vocabularies.'));
|
||||
}
|
||||
|
||||
$new_vocs = devel_generate_vocabs($num_vocab, $title_length);
|
||||
if (!empty($new_vocs)) {
|
||||
drupal_set_message(t('Created the following new vocabularies: !vocs', array('!vocs' => theme('item_list', array('items' => $new_vocs)))));
|
||||
}
|
||||
}
|
||||
|
||||
function devel_generate_menu_data($num_menus, $existing_menus, $num_links, $title_length, $link_types, $max_depth, $max_width, $kill) {
|
||||
// Delete menus and menu links.
|
||||
if ($kill) {
|
||||
if (module_exists('menu')) {
|
||||
foreach (menu_get_menus(FALSE) as $menu => $menu_title) {
|
||||
if (strpos($menu, 'devel-') === 0) {
|
||||
$menu = menu_load($menu);
|
||||
menu_delete($menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Delete menu links generated by devel.
|
||||
$result = db_select('menu_links', 'm')
|
||||
->fields('m', array('mlid'))
|
||||
->condition('m.menu_name', 'devel', '<>')
|
||||
// Look for the serialized version of 'devel' => TRUE.
|
||||
->condition('m.options', '%' . db_like('s:5:"devel";b:1') . '%', 'LIKE')
|
||||
->execute();
|
||||
foreach ($result as $link) {
|
||||
menu_link_delete($link->mlid);
|
||||
}
|
||||
drupal_set_message(t('Deleted existing menus and links.'));
|
||||
}
|
||||
|
||||
// Generate new menus.
|
||||
$new_menus = devel_generate_menus($num_menus, $title_length);
|
||||
if (!empty($new_menus)) {
|
||||
drupal_set_message(t('Created the following new menus: !menus', array('!menus' => theme('item_list', array('items' => $new_menus)))));
|
||||
}
|
||||
|
||||
// Generate new menu links.
|
||||
$menus = $new_menus + $existing_menus;
|
||||
$new_links = devel_generate_links($num_links, $menus, $title_length, $link_types, $max_depth, $max_width);
|
||||
drupal_set_message(t('Created @count new menu links.', array('@count' => count($new_links))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates new menus.
|
||||
*/
|
||||
function devel_generate_menus($num_menus, $title_length = 12) {
|
||||
$menus = array();
|
||||
|
||||
if (!module_exists('menu')) {
|
||||
$num_menus = 0;
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= $num_menus; $i++) {
|
||||
$menu = array();
|
||||
$menu['title'] = devel_generate_word(mt_rand(2, $title_length));
|
||||
$menu['menu_name'] = 'devel-' . drupal_strtolower($menu['title']);
|
||||
$menu['description'] = t('Description of @name', array('@name' => $menu['title']));
|
||||
menu_save($menu);
|
||||
$menus[$menu['menu_name']] = $menu['title'];
|
||||
}
|
||||
|
||||
return $menus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates menu links in a tree structure.
|
||||
*/
|
||||
function devel_generate_links($num_links, $menus, $title_length, $link_types, $max_depth, $max_width) {
|
||||
$links = array();
|
||||
$menus = array_keys(array_filter($menus));
|
||||
$link_types = array_keys(array_filter($link_types));
|
||||
|
||||
$nids = array();
|
||||
for ($i = 1; $i <= $num_links; $i++) {
|
||||
// Pick a random menu.
|
||||
$menu_name = $menus[array_rand($menus)];
|
||||
// Build up our link.
|
||||
$link = array(
|
||||
'menu_name' => $menu_name,
|
||||
'options' => array('devel' => TRUE),
|
||||
'weight' => mt_rand(-50, 50),
|
||||
'mlid' => 0,
|
||||
'link_title' => devel_generate_word(mt_rand(2, $title_length)),
|
||||
);
|
||||
$link['options']['attributes']['title'] = t('Description of @title.', array('@title' => $link['link_title']));
|
||||
|
||||
// For the first $max_width items, make first level links.
|
||||
if ($i <= $max_width) {
|
||||
$depth = 0;
|
||||
}
|
||||
else {
|
||||
// Otherwise, get a random parent menu depth.
|
||||
$depth = mt_rand(1, $max_depth - 1);
|
||||
}
|
||||
// Get a random parent link from the proper depth.
|
||||
do {
|
||||
$link['plid'] = db_select('menu_links', 'm')
|
||||
->fields('m', array('mlid'))
|
||||
->condition('m.menu_name', $menus, 'IN')
|
||||
->condition('m.depth', $depth)
|
||||
->range(0, 1)
|
||||
->orderRandom()
|
||||
->execute()
|
||||
->fetchField();
|
||||
$depth--;
|
||||
} while (!$link['plid'] && $depth > 0);
|
||||
if (!$link['plid']) {
|
||||
$link['plid'] = 0;
|
||||
}
|
||||
|
||||
$link_type = array_rand($link_types);
|
||||
switch ($link_types[$link_type]) {
|
||||
case 'node':
|
||||
// Grab a random node ID.
|
||||
$select = db_select('node', 'n')
|
||||
->fields('n', array('nid', 'title'))
|
||||
->condition('n.status', 1)
|
||||
->range(0, 1)
|
||||
->orderRandom();
|
||||
// Don't put a node into the menu twice.
|
||||
if (!empty($nids[$menu_name])) {
|
||||
$select->condition('n.nid', $nids[$menu_name], 'NOT IN');
|
||||
}
|
||||
$node = $select->execute()->fetchAssoc();
|
||||
if (isset($node['nid'])) {
|
||||
$nids[$menu_name][] = $node['nid'];
|
||||
$link['link_path'] = $link['router_path'] = 'node/' . $node['nid'];
|
||||
$link['link_title'] = $node['title'];
|
||||
break;
|
||||
}
|
||||
case 'external':
|
||||
$link['link_path'] = 'http://www.example.com/';
|
||||
break;
|
||||
case 'front':
|
||||
$link['link_path'] = $link['router_path'] = '<front>';
|
||||
break;
|
||||
default:
|
||||
$link['devel_link_type'] = $link_type;
|
||||
break;
|
||||
}
|
||||
|
||||
menu_link_save($link);
|
||||
|
||||
$links[$link['mlid']] = $link['link_title'];
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
function devel_generate_word($length){
|
||||
mt_srand((double)microtime()*1000000);
|
||||
|
||||
$vowels = array("a", "e", "i", "o", "u");
|
||||
$cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr",
|
||||
"cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr", "sl", "cl", "sh");
|
||||
|
||||
$num_vowels = count($vowels);
|
||||
$num_cons = count($cons);
|
||||
$word = '';
|
||||
|
||||
while(strlen($word) < $length){
|
||||
$word .= $cons[mt_rand(0, $num_cons - 1)] . $vowels[mt_rand(0, $num_vowels - 1)];
|
||||
}
|
||||
|
||||
return substr($word, 0, $length);
|
||||
}
|
||||
|
||||
function devel_create_content($type = NULL) {
|
||||
$nparas = mt_rand(1,12);
|
||||
$type = empty($type) ? mt_rand(0,3) : $type;
|
||||
|
||||
$output = "";
|
||||
switch($type % 3) {
|
||||
// MW: This appears undesireable. Was giving <p> in text fields
|
||||
// case 1: // html
|
||||
// for ($i = 1; $i <= $nparas; $i++) {
|
||||
// $output .= devel_create_para(mt_rand(10,60),1);
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// case 2: // brs only
|
||||
// for ($i = 1; $i <= $nparas; $i++) {
|
||||
// $output .= devel_create_para(mt_rand(10,60),2);
|
||||
// }
|
||||
// break;
|
||||
|
||||
default: // plain text
|
||||
for ($i = 1; $i <= $nparas; $i++) {
|
||||
$output .= devel_create_para(mt_rand(10,60)) ."\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function devel_create_para($words, $type = 0) {
|
||||
$output = '';
|
||||
switch ($type) {
|
||||
case 1:
|
||||
$output .= "<p>" . devel_create_greeking($words) . "</p>";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$output .= devel_create_greeking($words) . "<br />";
|
||||
break;
|
||||
|
||||
default:
|
||||
$output .= devel_create_greeking($words);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function devel_create_greeking($word_count, $title = FALSE) {
|
||||
$dictionary = array("abbas", "abdo", "abico", "abigo", "abluo", "accumsan",
|
||||
"acsi", "ad", "adipiscing", "aliquam", "aliquip", "amet", "antehabeo",
|
||||
"appellatio", "aptent", "at", "augue", "autem", "bene", "blandit",
|
||||
"brevitas", "caecus", "camur", "capto", "causa", "cogo", "comis",
|
||||
"commodo", "commoveo", "consectetuer", "consequat", "conventio", "cui",
|
||||
"damnum", "decet", "defui", "diam", "dignissim", "distineo", "dolor",
|
||||
"dolore", "dolus", "duis", "ea", "eligo", "elit", "enim", "erat",
|
||||
"eros", "esca", "esse", "et", "eu", "euismod", "eum", "ex", "exerci",
|
||||
"exputo", "facilisi", "facilisis", "fere", "feugiat", "gemino",
|
||||
"genitus", "gilvus", "gravis", "haero", "hendrerit", "hos", "huic",
|
||||
"humo", "iaceo", "ibidem", "ideo", "ille", "illum", "immitto",
|
||||
"importunus", "imputo", "in", "incassum", "inhibeo", "interdico",
|
||||
"iriure", "iusto", "iustum", "jugis", "jumentum", "jus", "laoreet",
|
||||
"lenis", "letalis", "lobortis", "loquor", "lucidus", "luctus", "ludus",
|
||||
"luptatum", "macto", "magna", "mauris", "melior", "metuo", "meus",
|
||||
"minim", "modo", "molior", "mos", "natu", "neo", "neque", "nibh",
|
||||
"nimis", "nisl", "nobis", "nostrud", "nulla", "nunc", "nutus", "obruo",
|
||||
"occuro", "odio", "olim", "oppeto", "os", "pagus", "pala", "paratus",
|
||||
"patria", "paulatim", "pecus", "persto", "pertineo", "plaga", "pneum",
|
||||
"populus", "praemitto", "praesent", "premo", "probo", "proprius",
|
||||
"quadrum", "quae", "qui", "quia", "quibus", "quidem", "quidne", "quis",
|
||||
"ratis", "refero", "refoveo", "roto", "rusticus", "saepius",
|
||||
"sagaciter", "saluto", "scisco", "secundum", "sed", "si", "similis",
|
||||
"singularis", "sino", "sit", "sudo", "suscipere", "suscipit", "tamen",
|
||||
"tation", "te", "tego", "tincidunt", "torqueo", "tum", "turpis",
|
||||
"typicus", "ulciscor", "ullamcorper", "usitas", "ut", "utinam",
|
||||
"utrum", "uxor", "valde", "valetudo", "validus", "vel", "velit",
|
||||
"veniam", "venio", "vereor", "vero", "verto", "vicis", "vindico",
|
||||
"virtus", "voco", "volutpat", "vulpes", "vulputate", "wisi", "ymo",
|
||||
"zelus");
|
||||
$dictionary_flipped = array_flip($dictionary);
|
||||
|
||||
$greeking = '';
|
||||
|
||||
if (!$title) {
|
||||
$words_remaining = $word_count;
|
||||
while ($words_remaining > 0) {
|
||||
$sentence_length = mt_rand(3, 10);
|
||||
$words = array_rand($dictionary_flipped, $sentence_length);
|
||||
$sentence = implode(' ', $words);
|
||||
$greeking .= ucfirst($sentence) . '. ';
|
||||
$words_remaining -= $sentence_length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use slightly different method for titles.
|
||||
$words = array_rand($dictionary_flipped, $word_count);
|
||||
$words = is_array($words) ? implode(' ', $words) : $words;
|
||||
$greeking = ucwords($words);
|
||||
}
|
||||
|
||||
// Work around possible php garbage collection bug. Without an unset(), this
|
||||
// function gets very expensive over many calls (php 5.2.11).
|
||||
unset($dictionary, $dictionary_flipped);
|
||||
return trim($greeking);
|
||||
}
|
||||
|
||||
function devel_generate_add_terms(&$node) {
|
||||
$vocabs = taxonomy_get_vocabularies($node->type);
|
||||
foreach ($vocabs as $vocab) {
|
||||
$sql = "SELECT tid FROM {taxonomy_term_data} WHERE vid = :vid ORDER BY RAND()";
|
||||
$result = db_query_range($sql, 0, 5 , array(':vid' => $vocab->vid));
|
||||
foreach($result as $row) {
|
||||
$node->taxonomy[] = $row->tid;
|
||||
if (!$vocab->multiple) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function devel_get_users() {
|
||||
$users = array();
|
||||
$result = db_query_range("SELECT uid FROM {users}", 0, 50);
|
||||
foreach ($result as $record) {
|
||||
$users[] = $record->uid;
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate statistics information for a node.
|
||||
*
|
||||
* @param $node
|
||||
* A node object.
|
||||
*/
|
||||
function devel_generate_add_statistics($node) {
|
||||
$statistic = array(
|
||||
'nid' => $node->nid,
|
||||
'totalcount' => mt_rand(0, 500),
|
||||
'timestamp' => REQUEST_TIME - mt_rand(0, $node->created),
|
||||
);
|
||||
$statistic['daycount'] = mt_rand(0, $statistic['totalcount']);
|
||||
db_insert('node_counter')->fields($statistic)->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the devel_generate_content_form request to kill all of the content.
|
||||
* This is used by both the batch and non-batch branches of the code.
|
||||
*
|
||||
* @param $num
|
||||
* array of options obtained from devel_generate_content_form.
|
||||
*/
|
||||
function devel_generate_content_kill($values) {
|
||||
$results = db_select('node', 'n')
|
||||
->fields('n', array('nid'))
|
||||
->condition('type', $values['node_types'], 'IN')
|
||||
->execute();
|
||||
foreach ($results as $result) {
|
||||
$nids[] = $result->nid;
|
||||
}
|
||||
|
||||
if (!empty($nids)) {
|
||||
node_delete_multiple($nids);
|
||||
drupal_set_message(t('Deleted %count nodes.', array('%count' => count($nids))));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-process the devel_generate_content_form request. This is needed so
|
||||
* batch api can get the list of users once. This is used by both the batch
|
||||
* and non-batch branches of the code.
|
||||
*
|
||||
* @param $num
|
||||
* array of options obtained from devel_generate_content_form.
|
||||
*/
|
||||
function devel_generate_content_pre_node(&$results) {
|
||||
// Get user id.
|
||||
$users = devel_get_users();
|
||||
$users = array_merge($users, array('0'));
|
||||
$results['users'] = $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create one node. Used by both batch and non-batch code branches.
|
||||
*
|
||||
* @param $num
|
||||
* array of options obtained from devel_generate_content_form.
|
||||
*/
|
||||
function devel_generate_content_add_node(&$results) {
|
||||
$node = new stdClass();
|
||||
$node->nid = NULL;
|
||||
|
||||
// Insert new data:
|
||||
$node->type = array_rand($results['node_types']);
|
||||
node_object_prepare($node);
|
||||
$users = $results['users'];
|
||||
$node->uid = $users[array_rand($users)];
|
||||
$type = node_type_get_type($node);
|
||||
$node->title = $type->has_title ? devel_create_greeking(mt_rand(2, $results['title_length']), TRUE) : '';
|
||||
$node->revision = mt_rand(0,1);
|
||||
$node->promote = mt_rand(0, 1);
|
||||
// Avoid NOTICE.
|
||||
if (!isset($results['time_range'])) {
|
||||
$results['time_range'] = 0;
|
||||
}
|
||||
|
||||
devel_generate_set_language($results, $node);
|
||||
|
||||
$node->created = REQUEST_TIME - mt_rand(0, $results['time_range']);
|
||||
|
||||
// A flag to let hook_nodeapi() implementations know that this is a generated node.
|
||||
$node->devel_generate = $results;
|
||||
|
||||
// Populate all core fields on behalf of field.module
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate.fields');
|
||||
devel_generate_fields($node, 'node', $node->type);
|
||||
|
||||
// See devel_generate_nodeapi() for actions that happen before and after this save.
|
||||
node_save($node);
|
||||
}
|
||||
|
||||
/*
|
||||
* Populate $object->language based on $results
|
||||
*/
|
||||
function devel_generate_set_language($results, $object) {
|
||||
if (isset($results['add_language'])) {
|
||||
$languages = $results['add_language'];
|
||||
$object->language = $languages[array_rand($languages)];
|
||||
}
|
||||
else {
|
||||
$default = language_default('language');
|
||||
$object->language = $default == 'en' ? LANGUAGE_NONE : $default;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
name = Devel generate
|
||||
description = Generate dummy users, nodes, and taxonomy terms.
|
||||
package = Development
|
||||
core = 7.x
|
||||
dependencies[] = devel
|
||||
tags[] = developer
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-07-22
|
||||
version = "7.x-1.2"
|
||||
core = "7.x"
|
||||
project = "devel"
|
||||
datestamp = "1311355316"
|
||||
|
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implements hook_menu().
|
||||
*/
|
||||
function devel_generate_menu() {
|
||||
$items = array();
|
||||
|
||||
$items['admin/config/development/generate/user'] = array(
|
||||
'title' => 'Generate users',
|
||||
'description' => 'Generate a given number of users. Optionally delete current users.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('devel_generate_users_form'),
|
||||
'access arguments' => array('administer users'),
|
||||
);
|
||||
$items['admin/config/development/generate/content'] = array(
|
||||
'title' => 'Generate content',
|
||||
'description' => 'Generate a given number of nodes and comments. Optionally delete current items.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('devel_generate_content_form'),
|
||||
'access arguments' => array('administer nodes'),
|
||||
);
|
||||
if (module_exists('taxonomy')) {
|
||||
$items['admin/config/development/generate/taxonomy'] = array(
|
||||
'title' => 'Generate terms',
|
||||
'description' => 'Generate a given number of terms. Optionally delete current terms.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('devel_generate_term_form'),
|
||||
'access arguments' => array('administer taxonomy'),
|
||||
);
|
||||
$items['admin/config/development/generate/vocabs'] = array(
|
||||
'title' => 'Generate vocabularies',
|
||||
'description' => 'Generate a given number of vocabularies. Optionally delete current vocabularies.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('devel_generate_vocab_form'),
|
||||
'access arguments' => array('administer taxonomy'),
|
||||
);
|
||||
}
|
||||
$items['admin/config/development/generate/menu'] = array(
|
||||
'title' => 'Generate menus',
|
||||
'description' => 'Generate a given number of menus and menu links. Optionally delete current menus.',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('devel_generate_menu_form'),
|
||||
'access arguments' => array('administer menu'),
|
||||
);
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates users using FormAPI.
|
||||
*/
|
||||
function devel_generate_users_form() {
|
||||
$form['num'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('How many users would you like to generate?'),
|
||||
'#default_value' => 50,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['kill_users'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Delete all users (except user id 1) before generating new users.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$options = user_roles(TRUE);
|
||||
unset($options[DRUPAL_AUTHENTICATED_RID]);
|
||||
$form['roles'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Which roles should the users receive?'),
|
||||
'#description' => t('Users always receive the <em>authenticated user</em> role.'),
|
||||
'#options' => $options,
|
||||
);
|
||||
|
||||
$options = array(1 => t('Now'));
|
||||
foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) {
|
||||
$options[$interval] = format_interval($interval, 1) . ' ' . t('ago');
|
||||
}
|
||||
$form['time_range'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('How old should user accounts be?'),
|
||||
'#description' => t('User ages will be distributed randomly from the current time, back to the selected time.'),
|
||||
'#options' => $options,
|
||||
'#default_value' => 604800,
|
||||
);
|
||||
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Generate'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* FormAPI submission to generate users.
|
||||
*/
|
||||
function devel_generate_users_form_submit($form_id, &$form_state) {
|
||||
module_load_include('inc', 'devel_generate');
|
||||
$values = $form_state['values'];
|
||||
devel_create_users($values['num'], $values['kill_users'], $values['time_range'], $values['roles']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates nodes using FormAPI.
|
||||
*/
|
||||
function devel_generate_content_form() {
|
||||
$options = array();
|
||||
|
||||
if (module_exists('content')) {
|
||||
$types = content_types();
|
||||
foreach ($types as $type) {
|
||||
$warn = '';
|
||||
if (count($type['fields'])) {
|
||||
$warn = t('. This type contains CCK fields which will only be populated by fields that implement the content_generate hook.');
|
||||
}
|
||||
$options[$type['type']] = t($type['name']). $warn;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$types = node_type_get_types();
|
||||
$suffix = '';
|
||||
foreach ($types as $type) {
|
||||
if (module_exists('comment')) {
|
||||
$default = variable_get('comment_' . $type->type, COMMENT_NODE_OPEN);
|
||||
$map = array(t('Hidden'), t('Closed'), t('Open'));
|
||||
$suffix = '<small>. ' . t('Comments: ') . $map[$default]. '</small>';
|
||||
}
|
||||
$options[$type->type] = t($type->name) . $suffix;
|
||||
}
|
||||
}
|
||||
// we cannot currently generate valid polls.
|
||||
unset($options['poll']);
|
||||
|
||||
if (empty($options)) {
|
||||
drupal_set_message(t('You do not have any content types that can be generated. <a href="@create-type">Go create a new content type</a> already!</a>', array('@create-type' => url('admin/structure/types/add'))), 'error', FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
$form['node_types'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Content types'),
|
||||
'#options' => $options,
|
||||
'#default_value' => array_keys($options),
|
||||
);
|
||||
if (module_exists('checkall')) $form['node_types']['#checkall'] = TRUE;
|
||||
$form['kill_content'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('<strong>Delete all content</strong> in these content types before generating new content.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$form['num_nodes'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('How many nodes would you like to generate?'),
|
||||
'#default_value' => 50,
|
||||
'#size' => 10,
|
||||
);
|
||||
|
||||
$options = array(1 => t('Now'));
|
||||
foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) {
|
||||
$options[$interval] = format_interval($interval, 1) . ' ' . t('ago');
|
||||
}
|
||||
$form['time_range'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('How far back in time should the nodes be dated?'),
|
||||
'#description' => t('Node creation dates will be distributed randomly from the current time, back to the selected time.'),
|
||||
'#options' => $options,
|
||||
'#default_value' => 604800,
|
||||
);
|
||||
|
||||
$form['max_comments'] = array(
|
||||
'#type' => module_exists('comment') ? 'textfield' : 'value',
|
||||
'#title' => t('Maximum number of comments per node.'),
|
||||
'#description' => t('You must also enable comments for the content types you are generating. Note that some nodes will randomly receive zero comments. Some will receive the max.'),
|
||||
'#default_value' => 0,
|
||||
'#size' => 3,
|
||||
'#access' => module_exists('comment'),
|
||||
);
|
||||
$form['title_length'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Max word length of titles'),
|
||||
'#default_value' => 4,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['add_alias'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#disabled' => !module_exists('path'),
|
||||
'#description' => t('Requires path.module'),
|
||||
'#title' => t('Add an url alias for each node.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$form['add_statistics'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Add statistics for each node (node_counter table).'),
|
||||
'#default_value' => TRUE,
|
||||
'#access' => module_exists('statistics'),
|
||||
);
|
||||
|
||||
unset($options);
|
||||
$options[LANGUAGE_NONE] = t('Language neutral');
|
||||
if (module_exists('locale')) {
|
||||
$options += locale_language_list();
|
||||
}
|
||||
$form['add_language'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Set language on nodes'),
|
||||
'#multiple' => TRUE,
|
||||
'#disabled' => !module_exists('locale'),
|
||||
'#description' => t('Requires locale.module'),
|
||||
'#options' => $options,
|
||||
'#default_value' => array(LANGUAGE_NONE),
|
||||
);
|
||||
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Generate'),
|
||||
);
|
||||
$form['#redirect'] = FALSE;
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* FormAPI submission to generate nodes.
|
||||
*/
|
||||
function devel_generate_content_form_submit($form_id, &$form_state) {
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate');
|
||||
$form_state['values']['node_types'] = array_filter($form_state['values']['node_types']);
|
||||
if ($form_state['values']['num_nodes'] <= 50 && $form_state['values']['max_comments'] <= 10) {
|
||||
module_load_include('inc', 'devel_generate');
|
||||
devel_generate_content($form_state);
|
||||
}
|
||||
else {
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate_batch');
|
||||
devel_generate_batch_content($form_state);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates taxonomy terms using FormAPI.
|
||||
*/
|
||||
function devel_generate_term_form() {
|
||||
$options = array();
|
||||
foreach (taxonomy_get_vocabularies() as $vid => $vocab) {
|
||||
$options[$vid] = $vocab->machine_name;
|
||||
}
|
||||
$form['vids'] = array(
|
||||
'#type' => 'select',
|
||||
'#multiple' => TRUE,
|
||||
'#title' => t('Vocabularies'),
|
||||
'#required' => TRUE,
|
||||
'#options' => $options,
|
||||
'#description' => t('Restrict terms to these vocabularies.'),
|
||||
);
|
||||
$form['num_terms'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Number of terms?'),
|
||||
'#default_value' => 10,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['title_length'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Max word length of term names'),
|
||||
'#default_value' => 12,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['kill_taxonomy'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Delete existing terms in specified vocabularies before generating new terms.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Generate'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates taxonomy vocabularies using FormAPI.
|
||||
*/
|
||||
function devel_generate_vocab_form() {
|
||||
$form['num_vocabs'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Number of vocabularies?'),
|
||||
'#default_value' => 1,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['title_length'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Max word length of vocabulary names'),
|
||||
'#default_value' => 12,
|
||||
'#size' => 10,
|
||||
);
|
||||
$form['kill_taxonomy'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Delete existing vocabularies before generating new ones.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Generate'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* FormAPI submission to generate taxonomy terms.
|
||||
*/
|
||||
function devel_generate_term_form_submit($form_id, &$form_state) {
|
||||
module_load_include('inc', 'devel_generate');
|
||||
$vocabs = taxonomy_vocabulary_load_multiple($form_state['values']['vids']);
|
||||
devel_generate_term_data($vocabs, $form_state['values']['num_terms'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']);
|
||||
}
|
||||
|
||||
/**
|
||||
* FormAPI submission to generate taxonomy vocabularies.
|
||||
*/
|
||||
function devel_generate_vocab_form_submit($form_id, &$form_state) {
|
||||
module_load_include('inc', 'devel_generate');
|
||||
devel_generate_vocab_data($form_state['values']['num_vocabs'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts nodes properly based on generation options.
|
||||
*
|
||||
* @param $node
|
||||
* The base node created on submit. Inspects $node->devel_generate.
|
||||
*/
|
||||
function devel_generate_node_insert($node) {
|
||||
if (isset($node->devel_generate)) {
|
||||
$results = $node->devel_generate;
|
||||
|
||||
if (!empty($results['max_comments']) && $node->comment >= COMMENT_NODE_OPEN) {
|
||||
devel_generate_add_comments($node, $results['users'], $results['max_comments'], $results['title_length']);
|
||||
}
|
||||
|
||||
|
||||
// Add an url alias. Cannot happen before save because we don't know the nid.
|
||||
if (!empty($results['add_alias'])) {
|
||||
$path = array(
|
||||
'source' => 'node/' . $node->nid,
|
||||
'alias' => 'node-' . $node->nid . '-' . $node->type,
|
||||
);
|
||||
path_save($path);
|
||||
}
|
||||
|
||||
// Add node statistics.
|
||||
if (!empty($results['add_statistics']) && module_exists('statistics')) {
|
||||
devel_generate_add_statistics($node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a message for either drush or the web interface.
|
||||
*
|
||||
* @param $msg
|
||||
* The message to display.
|
||||
* @param $type
|
||||
* The message type, as defined by drupal_set_message().
|
||||
*
|
||||
* @return
|
||||
* Context-appropriate message output.
|
||||
*/
|
||||
function devel_generate_set_message($msg, $type = 'status') {
|
||||
$function = function_exists('drush_log') ? 'drush_log' : 'drupal_set_message';
|
||||
$function($msg, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates menus using FormAPI.
|
||||
*/
|
||||
function devel_generate_menu_form() {
|
||||
$menu_enabled = module_exists('menu');
|
||||
if ($menu_enabled) {
|
||||
$menus = array('__new-menu__' => t('Create new menu(s)')) + menu_get_menus();
|
||||
}
|
||||
else {
|
||||
$menus = menu_list_system_menus();
|
||||
}
|
||||
$form['existing_menus'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Generate links for these menus'),
|
||||
'#options' => $menus,
|
||||
'#default_value' => array('__new-menu__'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
if ($menu_enabled) {
|
||||
$form['num_menus'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Number of new menus to create'),
|
||||
'#default_value' => 2,
|
||||
'#size' => 10,
|
||||
'#states' => array(
|
||||
'visible' => array(
|
||||
':input[name=existing_menus[__new-menu__]]' => array('checked' => TRUE),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
$form['num_links'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Number of links to generate'),
|
||||
'#default_value' => 50,
|
||||
'#size' => 10,
|
||||
'#required' => TRUE,
|
||||
);
|
||||
$form['title_length'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Max word length of menu and menu link names'),
|
||||
'#default_value' => 12,
|
||||
'#size' => 10,
|
||||
'#required' => TRUE,
|
||||
);
|
||||
$form['link_types'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Types of links to generate'),
|
||||
'#options' => array(
|
||||
'node' => t('Nodes'),
|
||||
'front' => t('Front page'),
|
||||
'external' => t('External'),
|
||||
),
|
||||
'#default_value' => array('node', 'front', 'external'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
$form['max_depth'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Maximum link depth'),
|
||||
'#options' => range(0, MENU_MAX_DEPTH),
|
||||
'#default_value' => floor(MENU_MAX_DEPTH / 2),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
unset($form['max_depth']['#options'][0]);
|
||||
$form['max_width'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum menu width'),
|
||||
'#default_value' => 6,
|
||||
'#size' => 10,
|
||||
'#description' => t("Limit the width of the generated menu's first level of links to a certain number of items."),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
$form['kill'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Delete existing custom generated menus and menu links before generating new ones.'),
|
||||
'#default_value' => FALSE,
|
||||
);
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Generate'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* FormAPI submission to generate menus.
|
||||
*/
|
||||
function devel_generate_menu_form_submit($form_id, &$form_state) {
|
||||
// If the create new menus checkbox is off, set the number of new menus to 0.
|
||||
if (!isset($form_state['values']['existing_menus']['__new-menu__']) || !$form_state['values']['existing_menus']['__new-menu__']) {
|
||||
$form_state['values']['num_menus'] = 0;
|
||||
}
|
||||
module_load_include('inc', 'devel_generate');
|
||||
devel_generate_menu_data($form_state['values']['num_menus'], $form_state['values']['existing_menus'], $form_state['values']['num_links'], $form_state['values']['title_length'], $form_state['values']['link_types'], $form_state['values']['max_depth'], $form_state['values']['max_width'], $form_state['values']['kill']);
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Devel Generate batch handling functions using the BatchAPI
|
||||
*/
|
||||
|
||||
/**
|
||||
* Functions called from FAPI:
|
||||
*/
|
||||
|
||||
function devel_generate_batch_content($form_state) {
|
||||
$operations = array();
|
||||
|
||||
// Setup the batch operations and save the variables.
|
||||
$operations[] = array('devel_generate_batch_content_pre_node', array($form_state['values']));
|
||||
|
||||
// add the kill operation
|
||||
if ($form_state['values']['kill_content']) {
|
||||
$operations[] = array('devel_generate_batch_content_kill', array());
|
||||
}
|
||||
|
||||
// add the operations to create the nodes
|
||||
for ($num = 0; $num < $form_state['values']['num_nodes']; $num ++) {
|
||||
$operations[] = array('devel_generate_batch_content_add_node', array());
|
||||
}
|
||||
|
||||
// start the batch
|
||||
$batch = array(
|
||||
'title' => t('Generating Content'),
|
||||
'operations' => $operations,
|
||||
'finished' => 'devel_generate_batch_finished',
|
||||
'file' => drupal_get_path('module', 'devel_generate') . '/devel_generate_batch.inc',
|
||||
);
|
||||
batch_set($batch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Content Batch Functions:
|
||||
*/
|
||||
|
||||
function devel_generate_batch_content_kill(&$context) {
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate');
|
||||
devel_generate_content_kill($context['results']);
|
||||
}
|
||||
|
||||
function devel_generate_batch_content_pre_node($vars, &$context) {
|
||||
$context['results'] = $vars;
|
||||
$context['results']['num_nids'] = 0;
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate');
|
||||
devel_generate_content_pre_node($context['results']);
|
||||
}
|
||||
|
||||
function devel_generate_batch_content_add_node(&$context) {
|
||||
module_load_include('inc', 'devel_generate', 'devel_generate');
|
||||
devel_generate_content_add_node($context['results']);
|
||||
$context['results']['num_nids'] ++;
|
||||
}
|
||||
|
||||
function devel_generate_batch_finished($success, $results, $operations) {
|
||||
if ($success) {
|
||||
$message = t('Finished @num_nids nodes created successfully.', array('@num_nids' => $results['num_nids']));
|
||||
}
|
||||
else {
|
||||
$message = t('Finished with an error.');
|
||||
}
|
||||
drupal_set_message($message);
|
||||
}
|
||||
|
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
function file_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_file_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _file_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
|
||||
function _file_devel_generate($object, $field, $instance, $bundle) {
|
||||
static $file;
|
||||
|
||||
if (empty($file)) {
|
||||
if ($path = devel_generate_textfile()) {
|
||||
$source->uri = $path;
|
||||
$source->uid = 1; // TODO: randomize? use case specific.
|
||||
$source->filemime = 'text/plain';
|
||||
$destination = $field['settings']['uri_scheme'] . '://' . $instance['settings']['file_directory'] . '/' . basename($path);
|
||||
$file = file_move($source, $destination);
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
$object_field['fid'] = $file->fid;
|
||||
$object_field['display'] = $field['settings']['display_default'];
|
||||
$object_field['description'] = devel_create_greeking(10);
|
||||
|
||||
return $object_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Private function for generating a random text file.
|
||||
*/
|
||||
function devel_generate_textfile($filesize = 1024) {
|
||||
if ($tmp_file = drupal_tempnam('temporary://', 'filefield_')) {
|
||||
$destination = $tmp_file . '.txt';
|
||||
file_unmanaged_move($tmp_file, $destination);
|
||||
|
||||
$fp = fopen($destination, 'w');
|
||||
fwrite($fp, str_repeat('01', $filesize/2));
|
||||
fclose($fp);
|
||||
|
||||
return $destination;
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
define('DEVEL_GENERATE_IMAGE_MAX', 5);
|
||||
|
||||
function image_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (function_exists('imagejpeg')) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_image_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _image_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _image_devel_generate($object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
static $images = array();
|
||||
|
||||
$min_resolution = empty($instance['settings']['min_resolution']) ? '100x100' : $instance['settings']['min_resolution'];
|
||||
$max_resolution = empty($instance['settings']['max_resolution']) ? '600x600' : $instance['settings']['max_resolution'];
|
||||
$extensions = array_intersect(explode(' ', $instance['settings']['file_extensions']), array('png', 'jpg'));
|
||||
$extension = array_rand(drupal_map_assoc($extensions));
|
||||
|
||||
// Generate a max of 5 different images.
|
||||
if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= DEVEL_GENERATE_IMAGE_MAX) {
|
||||
if ($path = devel_generate_image($extension, $min_resolution, $max_resolution)) {
|
||||
$source = new stdClass();
|
||||
$source->uri = $path;
|
||||
$source->uid = 1; // TODO: randomize? Use case specific.
|
||||
$source->filemime = 'image/' . pathinfo($path, PATHINFO_EXTENSION);
|
||||
$destination_dir = $field['settings']['uri_scheme'] . '://' . $instance['settings']['file_directory'];
|
||||
file_prepare_directory($destination_dir, FILE_CREATE_DIRECTORY);
|
||||
$destination = $destination_dir . '/' . basename($path);
|
||||
$file = file_move($source, $destination, FILE_CREATE_DIRECTORY);
|
||||
$images[$extension][$min_resolution][$max_resolution][$file->fid] = $file;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Select one of the images we've already generated for this field.
|
||||
$file = new stdClass();
|
||||
$file->fid = array_rand($images[$extension][$min_resolution][$max_resolution]);
|
||||
}
|
||||
|
||||
$object_field['fid'] = $file->fid;
|
||||
$object_field['alt'] = devel_create_greeking(4);
|
||||
$object_field['title'] = devel_create_greeking(4);
|
||||
return $object_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Private function for creating a random image.
|
||||
*
|
||||
* This function only works with the GD toolkit. ImageMagick is not supported.
|
||||
*/
|
||||
function devel_generate_image($extension = 'png', $min_resolution, $max_resolution) {
|
||||
if ($tmp_file = drupal_tempnam('temporary://', 'imagefield_')) {
|
||||
$destination = $tmp_file . '.' . $extension;
|
||||
file_unmanaged_move($tmp_file, $destination, FILE_CREATE_DIRECTORY);
|
||||
|
||||
$min = explode('x', $min_resolution);
|
||||
$max = explode('x', $max_resolution);
|
||||
|
||||
$width = rand((int)$min[0], (int)$max[0]);
|
||||
$height = rand((int)$min[0], (int)$max[0]);
|
||||
|
||||
// Make a image split into 4 sections with random colors.
|
||||
$im = imagecreate($width, $height);
|
||||
for ($n = 0; $n < 4; $n++) {
|
||||
$color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255));
|
||||
$x = $width/2 * ($n % 2);
|
||||
$y = $height/2 * (int) ($n >= 2);
|
||||
imagefilledrectangle($im, $x, $y, $x + $width/2, $y + $height/2, $color);
|
||||
}
|
||||
|
||||
// Make a perfect circle in the image middle.
|
||||
$color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255));
|
||||
$smaller_dimension = min($width, $height);
|
||||
$smaller_dimension = ($smaller_dimension % 2) ? $smaller_dimension : $smaller_dimension;
|
||||
imageellipse($im, $width/2, $height/2, $smaller_dimension, $smaller_dimension, $color);
|
||||
|
||||
$save_function = 'image'. ($extension == 'jpg' ? 'jpeg' : $extension);
|
||||
$save_function($im, drupal_realpath($destination));
|
||||
|
||||
$images[$extension][$min_resolution][$max_resolution][$destination] = $destination;
|
||||
}
|
||||
return $destination;
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// Id$
|
||||
|
||||
function list_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_list_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _list_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
|
||||
function _list_devel_generate($object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
if ($allowed_values = list_allowed_values($field)) {
|
||||
$keys = array_keys($allowed_values);
|
||||
$object_field['value'] = $keys[mt_rand(0, count($allowed_values) - 1)];
|
||||
}
|
||||
return $object_field;
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
// Id$
|
||||
|
||||
function number_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_number_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _number_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
|
||||
function _number_devel_generate($object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
// Make sure the instance settings are all set.
|
||||
foreach (array('min', 'max', 'precision', 'scale') as $key) {
|
||||
if (empty($instance['settings'][$key])) {
|
||||
$instance['settings'][$key] = NULL;
|
||||
}
|
||||
}
|
||||
$min = is_numeric($instance['settings']['min']) ? $instance['settings']['min'] : 0;
|
||||
switch ($field['type']) {
|
||||
case 'number_integer':
|
||||
$max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : 10000;
|
||||
$decimal = 0;
|
||||
$scale = 0;
|
||||
break;
|
||||
|
||||
case 'number_decimal':
|
||||
$precision = is_numeric($instance['settings']['precision']) ? $instance['settings']['precision'] : 10;
|
||||
$scale = is_numeric($instance['settings']['scale']) ? $instance['settings']['scale'] : 2;
|
||||
$max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : pow(10, ($precision - $scale));
|
||||
$decimal = rand(0, (10 * $scale)) / 100;
|
||||
break;
|
||||
|
||||
case 'number_float':
|
||||
$precision = rand(10, 32);
|
||||
$scale = rand(0, 2);
|
||||
$decimal = rand(0, (10 * $scale)) / 100;
|
||||
$max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : pow(10, ($precision - $scale));
|
||||
break;
|
||||
}
|
||||
$object_field['value'] = round((rand($min, $max) + $decimal), $scale);
|
||||
return $object_field;
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
function taxonomy_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_taxonomy_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _taxonomy_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
|
||||
function _taxonomy_devel_generate($object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
// TODO: For free tagging vocabularies that do not already have terms, this
|
||||
// will not result in any tags being added.
|
||||
$machine_name = $field['settings']['allowed_values'][0]['vocabulary'];
|
||||
$vocabulary = taxonomy_vocabulary_machine_name_load($machine_name);
|
||||
if ($max = db_query('SELECT MAX(tid) FROM {taxonomy_term_data} WHERE vid = :vid', array(':vid' => $vocabulary->vid))->fetchField()) {
|
||||
$candidate = mt_rand(1, $max);
|
||||
$query = db_select('taxonomy_term_data', 't');
|
||||
$tid = $query
|
||||
->fields('t', array('tid'))
|
||||
->condition('t.vid', $vocabulary->vid, '=')
|
||||
->condition('t.tid', $candidate, '>=')
|
||||
->range(0,1)
|
||||
->execute()
|
||||
->fetchField();
|
||||
// If there are no terms for the taxonomy, the query will fail, in which
|
||||
// case we return NULL.
|
||||
if ($tid === FALSE) {
|
||||
return NULL;
|
||||
}
|
||||
$object_field['tid'] = (int) $tid;
|
||||
return $object_field;
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
function text_devel_generate($object, $field, $instance, $bundle) {
|
||||
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
|
||||
return devel_generate_multiple('_text_devel_generate', $object, $field, $instance, $bundle);
|
||||
}
|
||||
else {
|
||||
return _text_devel_generate($object, $field, $instance, $bundle);
|
||||
}
|
||||
}
|
||||
|
||||
function _text_devel_generate($object, $field, $instance, $bundle) {
|
||||
$object_field = array();
|
||||
if (!empty($instance['settings']['text_processing'])) {
|
||||
$formats = filter_formats();
|
||||
$format = array_rand($formats);
|
||||
}
|
||||
else {
|
||||
$format = filter_fallback_format();
|
||||
}
|
||||
|
||||
if ($instance['widget']['type'] != 'text_textfield') {
|
||||
// Textarea handling
|
||||
$object_field['value'] = devel_create_content($format);
|
||||
if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['display_summary'])) {
|
||||
$object_field['summary'] = devel_create_content($format);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Textfield handling.
|
||||
// Generate a value that respects max_length.
|
||||
if (empty($field['settings']['max_length'])) {
|
||||
$field['settings']['max_length'] = 12;
|
||||
}
|
||||
$object_field['value'] = user_password($field['settings']['max_length']);
|
||||
}
|
||||
$object_field['format'] = $format;
|
||||
return $object_field;
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Hook provided by the Devel Node Access module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup hooks
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Explain your records in the {node_access} table.
|
||||
*
|
||||
* In order to help developers and administrators understand the forces
|
||||
* that control access to any given node, the DNA module provides the
|
||||
* Devel Node Access block, which lists all the grant records in the
|
||||
* {node_access} table for that node.
|
||||
*
|
||||
* However, every Node Access module is free in how it defines and uses the
|
||||
* 'realm' and 'gid' fields in its records in the {node_access} table, and
|
||||
* it's often difficult to interpret them. This hook passes each record
|
||||
* that DNA wants to display, and the owning module is expected to return
|
||||
* an explanation of that record.
|
||||
*
|
||||
* The explanation should not be localized (not be passed through t()), so
|
||||
* that administrators seeking help can present English explanations.
|
||||
*
|
||||
* @param $row
|
||||
* The record from the {node_access} table, as object. The member fields are:
|
||||
* nid, gid, realm, grant_view, grant_update, grant_delete.
|
||||
*
|
||||
* @return
|
||||
* A string with a (short!) explanation of the given {node_access} row,
|
||||
* to be displayed in DNA's 'Devel Node Access' block. It will be displayed
|
||||
* as HTML; any variable parts must already be sanitized.
|
||||
*
|
||||
* @see hook_node_access_records()
|
||||
* @see devel_node_access_node_access_explain()
|
||||
*
|
||||
* @ingroup node_access
|
||||
*/
|
||||
function hook_node_access_explain($row) {
|
||||
if ($row->realm == 'mymodule_myrealm') {
|
||||
if ($row->grant_view) {
|
||||
$role = user_role_load($row->gid);
|
||||
return 'Role ' . drupal_placeholder($role->name) . ' may view this node.';
|
||||
}
|
||||
else {
|
||||
return 'No access.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Acknowledge ownership of 'alien' grant records.
|
||||
*
|
||||
* Some node access modules store grant records directly into the {node_access}
|
||||
* table rather than returning them through hook_node_access_records(). This
|
||||
* practice is not recommended and DNA will flag all such records as 'alien'.
|
||||
*
|
||||
* If this is unavoidable, a module can confess to being the owner of these
|
||||
* grant records, so that DNA can properly attribute them.
|
||||
*
|
||||
* @see hook_node_access_records()
|
||||
*
|
||||
* @ingroup node_access
|
||||
*/
|
||||
function hook_node_access_acknowledge($grant) {
|
||||
if ($grant['realm'] == 'mymodule_all' && $grant['nid'] == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup hooks".
|
||||
*/
|
14
sites/all/modules/development/devel/devel_node_access.info
Normal file
@@ -0,0 +1,14 @@
|
||||
name = Devel node access
|
||||
description = Developer blocks and page illustrating relevant node_access records.
|
||||
package = Development
|
||||
dependencies[] = menu
|
||||
core = 7.x
|
||||
configure = admin/config/development/devel
|
||||
tags[] = developer
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-07-22
|
||||
version = "7.x-1.2"
|
||||
core = "7.x"
|
||||
project = "devel"
|
||||
datestamp = "1311355316"
|
||||
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implements hook_uninstall().
|
||||
*/
|
||||
function devel_node_access_uninstall() {
|
||||
variable_del('devel_node_access_debug_mode');
|
||||
|
||||
if (!module_exists('devel') && ($devel_menu = menu_load('devel'))) {
|
||||
// Delete the development menu.
|
||||
menu_delete($devel_menu);
|
||||
}
|
||||
}
|
64
sites/all/modules/development/devel/devel_node_access.js
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @file devel_node_access.js.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
* Perform the access by user ajax request.
|
||||
*/
|
||||
function devel_node_access_user_ajax(context) {
|
||||
// Get the cell ID for the first .dna-permission that isn't processed.
|
||||
var cell = $('td.dna-permission', context)
|
||||
.not('.ajax-processed', context)
|
||||
.attr('id');
|
||||
if (cell !== undefined) {
|
||||
// Generate the URI from the basePath, path, data type, cell ID, and a
|
||||
// random token to bypass caching.
|
||||
var url = Drupal.settings.basePath
|
||||
+ "?q="
|
||||
+ 'devel/node_access/by_user/json/'
|
||||
+ cell
|
||||
+ '/'
|
||||
+ Math.floor((1000000000 * Math.random())).toString(16);
|
||||
// Execute Ajax callback and handle the response.
|
||||
$.getJSON(url, function(data) {
|
||||
$('#' + cell, context).html(data).addClass('ajax-processed');
|
||||
// Call this function again.
|
||||
devel_node_access_user_ajax(context);
|
||||
});
|
||||
// Ajax fails silently on error, mark bad requests with an error message.
|
||||
// If the request is just slow this will update when the request succeeds.
|
||||
setTimeout(
|
||||
function() {
|
||||
if ($('#' + cell, context).hasClass('ajax-processed') == false) {
|
||||
$('#' + cell, context)
|
||||
.html(
|
||||
'<span class="error">'
|
||||
+ '<a href="' + url.replace('/json/', '/html/') + '">'
|
||||
+ Drupal.t('Error: could not explain access')
|
||||
+ '</a>'
|
||||
+ '</span>'
|
||||
)
|
||||
.addClass('ajax-processed');
|
||||
// Call this function again.
|
||||
devel_node_access_user_ajax(context);
|
||||
}
|
||||
},
|
||||
3000
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach the access by user behavior which initiates ajax.
|
||||
*/
|
||||
Drupal.behaviors.develNodeAccessUserAjax = {
|
||||
attach: function(context) {
|
||||
// Start the ajax.
|
||||
devel_node_access_user_ajax(context);
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
1355
sites/all/modules/development/devel/devel_node_access.module
Normal file
7179
sites/all/modules/development/devel/jquery-1.4.4-uncompressed.js
Normal file
32
sites/all/modules/development/devel/krumo/INSTALL
Normal file
@@ -0,0 +1,32 @@
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
SETUP: How to install Krumo ?
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
In order to use Krumo you have to put it on your (development) server, and
|
||||
include it in your script. You can put it somewhere in the INCLUDE_PATH, or
|
||||
specify the full path to the "class.krumo.php" file.
|
||||
|
||||
You have to modify the "krumo.ini" file too. It is the configuration file for
|
||||
Krumo. The first option is choosing a skin:
|
||||
|
||||
[skin]
|
||||
selected = "orange"
|
||||
|
||||
The value for this setting has to be the name of one of the sub-folders from the
|
||||
"Krumo/skins/" folder. If the value provided for the skin results in not finding
|
||||
the skin, the `default` skin will be used instead.
|
||||
|
||||
The second option is used to set the correct web path to the folder where Krumo
|
||||
is installed. This is used in order to make the images from Krumo's CSS skins
|
||||
web-accessible.
|
||||
|
||||
[css]
|
||||
url = "http://www.example.com/Krumo/"
|
||||
|
||||
So far those two are the only configuration options.
|
||||
|
||||
All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the
|
||||
proper permissions in order to be readable from Krumo. Same applies for
|
||||
"krumo.ini" and "krumo.js" files.
|
504
sites/all/modules/development/devel/krumo/LICENSE
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
103
sites/all/modules/development/devel/krumo/README
Normal file
@@ -0,0 +1,103 @@
|
||||
=============================================================================
|
||||
|
||||
Krumo
|
||||
version 0.2.1a
|
||||
|
||||
=============================================================================
|
||||
|
||||
You probably got this package from...
|
||||
http://www.sourceforge.net/projects/krumo/
|
||||
|
||||
If there is no licence agreement with this package please download
|
||||
a version from the location above. You must read and accept that
|
||||
licence to use this software. The file is titled simply LICENSE.
|
||||
|
||||
OVERVIEW
|
||||
------------------------------------------------------------------------------
|
||||
To put it simply, Krumo is a replacement for print_r() and var_dump(). By
|
||||
definition Krumo is a debugging tool (for PHP5), which displays structured
|
||||
information about any PHP variable.
|
||||
|
||||
A lot of developers use print_r() and var_dump() in the means of debugging
|
||||
tools. Although they were intended to present human readble information about a
|
||||
variable, we can all agree that in general they are not. Krumo is an
|
||||
alternative: it does the same job, but it presents the information beautified
|
||||
using CSS and DHTML.
|
||||
|
||||
EXAMPLES
|
||||
------------------------------------------------------------------------------
|
||||
Here's a basic example, which will return a report on the array variable passed
|
||||
as argument to it:
|
||||
|
||||
krumo(array('a1'=> 'A1', 3, 'red'));
|
||||
|
||||
You can dump simultaneously more then one variable - here's another example:
|
||||
|
||||
krumo($_SERVER, $_REQUEST);
|
||||
|
||||
You probably saw from the examples above that some of the nodes are expandable,
|
||||
so if you want to inspect the nested information, click on them and they will
|
||||
expand; if you do not need that information shown simply click again on it to
|
||||
collapse it. Here's an example to test this:
|
||||
|
||||
$x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10';
|
||||
krumo($x1);
|
||||
|
||||
The krumo() is the only standalone function from the package, and this is
|
||||
because basic dumps about variables (like print_r() or var_dump()) are the most
|
||||
common tasks such functionality is used for. The rest of the functionality can
|
||||
be called using static calls to the Krumo class. Here are several more examples:
|
||||
|
||||
// print a debug backgrace
|
||||
krumo::backtrace();
|
||||
|
||||
// print all the included(or required) files
|
||||
krumo::includes();
|
||||
|
||||
// print all the included functions
|
||||
krumo::functions();
|
||||
|
||||
// print all the declared classes
|
||||
krumo::classes();
|
||||
|
||||
// print all the defined constants
|
||||
krumo::defines();
|
||||
|
||||
... and so on, etc.
|
||||
|
||||
A full PHPDocumenter API documentation exists both in this package and at the
|
||||
project's website.
|
||||
|
||||
INSTALL
|
||||
------------------------------------------------------------------------------
|
||||
Read the INSTALL file.
|
||||
|
||||
DOCUMENTATION
|
||||
------------------------------------------------------------------------------
|
||||
As I said, a full PHPDocumenter API documentation can be found both in this
|
||||
package and at the project's website.
|
||||
|
||||
SKINS
|
||||
------------------------------------------------------------------------------
|
||||
There are several skins pre-installed with this package, but if you wish you can
|
||||
create skins of your own. The skins are simply CSS files that are prepended to
|
||||
the result that Krumo prints. If you want to use images in your CSS (for
|
||||
background, list-style, etc), you have to put "%URL%" in front of the image URL
|
||||
in order hook it up to the skin folder and make the image web-accessible.
|
||||
|
||||
Here's an example:
|
||||
|
||||
ul.krumo-first {background: url(%url%bg.gif);}
|
||||
|
||||
TODO
|
||||
------------------------------------------------------------------------------
|
||||
You can find the list of stuff that is going to be added to this project in the
|
||||
TODO file from this very package.
|
||||
|
||||
CONTRIBUTION
|
||||
-----------------------------------------------------------------------------
|
||||
If you download and use and possibly even extend this tool, please let us know.
|
||||
Any feedback, even bad, is always welcome and your suggestions are going to be
|
||||
considered for our next release. Please use our SourceForge page for that:
|
||||
|
||||
http://www.sourceforge.net/projects/krumo/
|
24
sites/all/modules/development/devel/krumo/TODO
Normal file
@@ -0,0 +1,24 @@
|
||||
******************************************************************************
|
||||
|
||||
Krumo: TODO
|
||||
|
||||
******************************************************************************
|
||||
|
||||
BUGS
|
||||
----------------
|
||||
- watch the SourceForge.net Bug Tracker
|
||||
|
||||
Features: PHP
|
||||
----------------
|
||||
- Try to detect anonymous (lambda) functions
|
||||
- Try to detect whether an array is indexed or associated
|
||||
- Add var_export support for arrays and objects
|
||||
- Add JSON support for arrays and objects
|
||||
|
||||
Features: GUI
|
||||
----------------
|
||||
- Nicer and friendlier skin(s)
|
||||
- Add top-level links for collapsing and expanding the whole tree
|
||||
- Add object & array -level links for collapsing and expanding all the
|
||||
nested nodes
|
||||
- Print all parent classes for the rendered objects
|
1
sites/all/modules/development/devel/krumo/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.2.1a
|
1315
sites/all/modules/development/devel/krumo/class.krumo.php
Normal file
@@ -0,0 +1,267 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title>Docs for page class.krumo.php</title>
|
||||
<link rel="stylesheet" href="../media/stylesheet.css" />
|
||||
<script src="../media/lib/classTree.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var imgPlus = new Image();
|
||||
var imgMinus = new Image();
|
||||
imgPlus.src = "../media/images/plus.png";
|
||||
imgMinus.src = "../media/images/minus.png";
|
||||
|
||||
function showNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgMinus.src;
|
||||
oTable.style.display = "block";
|
||||
}
|
||||
|
||||
function hideNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgPlus.src;
|
||||
oTable.style.display = "none";
|
||||
}
|
||||
|
||||
function nodeIsVisible(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
break;
|
||||
}
|
||||
return (oTable && oTable.style.display == "block");
|
||||
}
|
||||
|
||||
function toggleNodeVisibility(Node){
|
||||
if (nodeIsVisible(Node)){
|
||||
hideNode(Node);
|
||||
}else{
|
||||
showNode(Node);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-body">
|
||||
<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/class.krumo.php</h2>
|
||||
|
||||
<a name="sec-description"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Description</div>
|
||||
<div class="nav-bar">
|
||||
<span class="disabled">Description</span> |
|
||||
<a href="#sec-classes">Classes</a>
|
||||
| <a href="#sec-constants">Constants</a>
|
||||
| <a href="#sec-functions">Functions</a>
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Krumo: Structured information display solution</p>
|
||||
<p class="description"><p>Krumo is a debugging tool (PHP5 only), which displays structured information about any PHP variable. It is a nice replacement for print_r() or var_dump() which are used by a lot of PHP developers.</p></p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">author:</span> Kaloyan K. Tsvetkov <<a href="mailto:kaloyan@kaloyan.info">kaloyan@kaloyan.info</a>></li>
|
||||
<li><span class="field">version:</span> $Id$</li>
|
||||
<li><span class="field">license:</span> <a href="http://opensource.org/licenses/lgpl-license.php">GNU Lesser General Public License Version 2.1</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="sec-classes"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Classes</div>
|
||||
<div class="nav-bar">
|
||||
<a href="#sec-description">Description</a> |
|
||||
<span class="disabled">Classes</span>
|
||||
| <a href="#sec-constants">Constants</a>
|
||||
| <a href="#sec-functions">Functions</a>
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<table cellpadding="2" cellspacing="0" class="class-table">
|
||||
<tr>
|
||||
<th class="class-table-header">Class</th>
|
||||
<th class="class-table-header">Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
|
||||
<img src="../media/images/Class.png"
|
||||
alt=" class"
|
||||
title=" class"/>
|
||||
<a href="../Krumo/krumo.html">krumo</a>
|
||||
</td>
|
||||
<td>
|
||||
Krumo API
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a name="sec-constants"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Constants</div>
|
||||
<div class="nav-bar">
|
||||
<a href="#sec-description">Description</a> |
|
||||
<a href="#sec-classes">Classes</a>
|
||||
| <span class="disabled">Constants</span>
|
||||
| <a href="#sec-functions">Functions</a>
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<a name="defineDIR_SEP"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div>
|
||||
<img src="../media/images/Constant.png" />
|
||||
<span class="const-title">
|
||||
<span class="const-name">DIR_SEP</span> = DIRECTORY_SEPARATOR
|
||||
(line <span class="line-number">22</span>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">backward compatibility: the DIR_SEP constant isn't used anymore</p>
|
||||
|
||||
|
||||
</div>
|
||||
<a name="defineKRUMO_DIR"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div>
|
||||
<img src="../media/images/Constant.png" />
|
||||
<span class="const-title">
|
||||
<span class="const-name">KRUMO_DIR</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
|
||||
(line <span class="line-number">39</span>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<a name="defineKRUMO_TRUNCATE_LENGTH"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div>
|
||||
<img src="../media/images/Constant.png" />
|
||||
<span class="const-title">
|
||||
<span class="const-name">KRUMO_TRUNCATE_LENGTH</span> = 50
|
||||
(line <span class="line-number">48</span>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<a name="definePATH_SEPARATOR"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div>
|
||||
<img src="../media/images/Constant.png" />
|
||||
<span class="const-title">
|
||||
<span class="const-name">PATH_SEPARATOR</span> = OS_WINDOWS?';':':'
|
||||
(line <span class="line-number">28</span>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a name="sec-functions"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Functions</div>
|
||||
<div class="nav-bar">
|
||||
<a href="#sec-description">Description</a> |
|
||||
<a href="#sec-classes">Classes</a>
|
||||
| <a href="#sec-constants">Constants</a>
|
||||
| <span class="disabled">Functions</span>
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<a name="functionkrumo" id="functionkrumo"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div>
|
||||
<img src="../media/images/Function.png" />
|
||||
<span class="method-title">krumo</span> (line <span class="line-number">1295</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Alias of <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">see:</span> <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></li>
|
||||
</ul>
|
||||
<div class="method-signature">
|
||||
<span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
krumo
|
||||
</span>
|
||||
([<span class="var-type">mixed</span> <span class="var-name">$data,...</span> = <span class="var-default"></span>])
|
||||
</div>
|
||||
|
||||
<ul class="parameters">
|
||||
<li>
|
||||
<span class="var-type">mixed</span>
|
||||
<span class="var-name">$data,...</span> </li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="notes" id="credit">
|
||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
||||
</p>
|
||||
</div></body>
|
||||
</html>
|
900
sites/all/modules/development/devel/krumo/docs/Krumo/krumo.html
Normal file
@@ -0,0 +1,900 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title>Docs For Class krumo</title>
|
||||
<link rel="stylesheet" href="../media/stylesheet.css" />
|
||||
<script src="../media/lib/classTree.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var imgPlus = new Image();
|
||||
var imgMinus = new Image();
|
||||
imgPlus.src = "../media/images/plus.png";
|
||||
imgMinus.src = "../media/images/minus.png";
|
||||
|
||||
function showNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgMinus.src;
|
||||
oTable.style.display = "block";
|
||||
}
|
||||
|
||||
function hideNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgPlus.src;
|
||||
oTable.style.display = "none";
|
||||
}
|
||||
|
||||
function nodeIsVisible(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
break;
|
||||
}
|
||||
return (oTable && oTable.style.display == "block");
|
||||
}
|
||||
|
||||
function toggleNodeVisibility(Node){
|
||||
if (nodeIsVisible(Node)){
|
||||
hideNode(Node);
|
||||
}else{
|
||||
showNode(Node);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-body">
|
||||
<h2 class="class-name"><img src="../media/images/Class_logo.png"
|
||||
alt=" Class"
|
||||
title=" Class"
|
||||
style="vertical-align: middle"> krumo</h2>
|
||||
|
||||
<a name="sec-description"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Description</div>
|
||||
<div class="nav-bar">
|
||||
<span class="disabled">Description</span> |
|
||||
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
|
||||
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Krumo API</p>
|
||||
<p class="description"><p>This class stores the Krumo API for rendering and displaying the structured information it is reporting</p></p>
|
||||
<p class="notes">
|
||||
Located in <a class="field" href="_class.krumo.php.html">/class.krumo.php</a> (line <span class="field">61</span>)
|
||||
</p>
|
||||
|
||||
|
||||
<pre></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="sec-method-summary"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Method Summary</span></div>
|
||||
<div class="nav-bar">
|
||||
<a href="#sec-description">Description</a> |
|
||||
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<div class="method-summary">
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#backtrace" title="details" class="method-name">backtrace</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#classes" title="details" class="method-name">classes</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#conf" title="details" class="method-name">conf</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#cookie" title="details" class="method-name">cookie</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#defines" title="details" class="method-name">defines</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">boolean</span>
|
||||
<a href="#disable" title="details" class="method-name">disable</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#dump" title="details" class="method-name">dump</a>
|
||||
(<span class="var-type"></span> <span class="var-name">$data</span>, <span class="var-type">mixed</span> <span class="var-name">$data,...</span>)
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">boolean</span>
|
||||
<a href="#enable" title="details" class="method-name">enable</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#env" title="details" class="method-name">env</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#extensions" title="details" class="method-name">extensions</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#functions" title="details" class="method-name">functions</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#get" title="details" class="method-name">get</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#headers" title="details" class="method-name">headers</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#includes" title="details" class="method-name">includes</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#ini" title="details" class="method-name">ini</a>
|
||||
(<span class="var-type">string</span> <span class="var-name">$ini_file</span>)
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#interfaces" title="details" class="method-name">interfaces</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#path" title="details" class="method-name">path</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#phpini" title="details" class="method-name">phpini</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#post" title="details" class="method-name">post</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#request" title="details" class="method-name">request</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#server" title="details" class="method-name">server</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">void</span>
|
||||
<a href="#session" title="details" class="method-name">session</a>
|
||||
()
|
||||
</div>
|
||||
|
||||
<div class="method-definition">
|
||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
||||
static <span class="method-result">string</span>
|
||||
<a href="#version" title="details" class="method-name">version</a>
|
||||
()
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a name="sec-methods"></a>
|
||||
<div class="info-box">
|
||||
<div class="info-box-title">Methods</div>
|
||||
<div class="nav-bar">
|
||||
<a href="#sec-description">Description</a> |
|
||||
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
|
||||
|
||||
</div>
|
||||
<div class="info-box-body">
|
||||
<A NAME='method_detail'></A>
|
||||
<a name="methodbacktrace" id="backtrace"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static backtrace</span> (line <span class="line-number">82</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a debug backtrace</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
backtrace
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodclasses" id="classes"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static classes</span> (line <span class="line-number">101</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently declared classes.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
classes
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodconf" id="conf"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static conf</span> (line <span class="line-number">297</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all your configuration settings.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
conf
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodcookie" id="cookie"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static cookie</span> (line <span class="line-number">441</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
cookie
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methoddefines" id="defines"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static defines</span> (line <span class="line-number">197</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently declared constants.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
defines
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methoddisable" id="disable"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static disable</span> (line <span class="line-number">747</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Disable Krumo</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">boolean</span>
|
||||
<span class="method-name">
|
||||
disable
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methoddump" id="dump"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static dump</span> (line <span class="line-number">548</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Dump information about a variable</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
dump
|
||||
</span>
|
||||
(<span class="var-type"></span> <span class="var-name">$data</span>, <span class="var-type">mixed</span> <span class="var-name">$data,...</span>)
|
||||
</div>
|
||||
|
||||
<ul class="parameters">
|
||||
<li>
|
||||
<span class="var-type">mixed</span>
|
||||
<span class="var-name">$data,...</span> </li>
|
||||
<li>
|
||||
<span class="var-type"></span>
|
||||
<span class="var-name">$data</span> </li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodenable" id="enable"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static enable</span> (line <span class="line-number">736</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Enable Krumo</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">boolean</span>
|
||||
<span class="method-name">
|
||||
enable
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodenv" id="env"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static env</span> (line <span class="line-number">465</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_ENV</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
env
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodextensions" id="extensions"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static extensions</span> (line <span class="line-number">221</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently loaded PHP extensions.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
extensions
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodfunctions" id="functions"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static functions</span> (line <span class="line-number">173</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently declared functions.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
functions
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodget" id="get"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static get</span> (line <span class="line-number">369</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_GET</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
get
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodheaders" id="headers"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static headers</span> (line <span class="line-number">245</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all HTTP request headers.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
headers
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodincludes" id="includes"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static includes</span> (line <span class="line-number">149</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently included (or required) files.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
includes
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodini" id="ini"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static ini</span> (line <span class="line-number">515</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from an INI file.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
ini
|
||||
</span>
|
||||
(<span class="var-type">string</span> <span class="var-name">$ini_file</span>)
|
||||
</div>
|
||||
|
||||
<ul class="parameters">
|
||||
<li>
|
||||
<span class="var-type">string</span>
|
||||
<span class="var-name">$ini_file</span> </li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodinterfaces" id="interfaces"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static interfaces</span> (line <span class="line-number">125</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all currently declared interfaces (PHP5 only).</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
interfaces
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodpath" id="path"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static path</span> (line <span class="line-number">321</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of the specified directories under your <em>include_path</em> option.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
path
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodphpini" id="phpini"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static phpini</span> (line <span class="line-number">269</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of the configuration settings read from <em>php.ini</em></p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
phpini
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodpost" id="post"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static post</span> (line <span class="line-number">393</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_POST</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
post
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodrequest" id="request"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static request</span> (line <span class="line-number">345</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
request
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodserver" id="server"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static server</span> (line <span class="line-number">417</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_SERVER</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
server
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodsession" id="session"><!-- --></a>
|
||||
<div class="oddrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static session</span> (line <span class="line-number">489</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Prints a list of all the values from the <em>$_SESSION</em> array.</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">void</span>
|
||||
<span class="method-name">
|
||||
session
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<a name="methodversion" id="version"><!-- --></a>
|
||||
<div class="evenrow">
|
||||
|
||||
<div class="method-header">
|
||||
<img src="../media/images/StaticMethod.png" />
|
||||
<span class="method-title">static version</span> (line <span class="line-number">70</span>)
|
||||
</div>
|
||||
|
||||
<!-- ========== Info from phpDoc block ========= -->
|
||||
<p class="short-description">Return Krumo version</p>
|
||||
<ul class="tags">
|
||||
<li><span class="field">access:</span> public</li>
|
||||
</ul>
|
||||
|
||||
<div class="method-signature">
|
||||
static <span class="method-result">string</span>
|
||||
<span class="method-name">
|
||||
version
|
||||
</span>
|
||||
()
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="notes" id="credit">
|
||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
||||
</p>
|
||||
</div></body>
|
||||
</html>
|
13
sites/all/modules/development/devel/krumo/docs/blank.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Krumo</title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
||||
</head>
|
||||
<body>
|
||||
<div align="center"><h1>Krumo</h1></div>
|
||||
<b>Welcome to Krumo!</b><br />
|
||||
<br />
|
||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.0a2</a><br />
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Start of Class Data -->
|
||||
<H2>
|
||||
|
||||
</H2>
|
||||
<h2>Root class krumo</h2>
|
||||
<ul>
|
||||
<li><a href="Krumo/krumo.html">krumo</a></li></ul>
|
||||
|
||||
<p class="notes" id="credit">
|
||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
392
sites/all/modules/development/devel/krumo/docs/elementindex.html
Normal file
@@ -0,0 +1,392 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="top"></a>
|
||||
<h2>Full index</h2>
|
||||
<h3>Package indexes</h3>
|
||||
<ul>
|
||||
<li><a href="elementindex_Krumo.html">Krumo</a></li>
|
||||
</ul>
|
||||
<br />
|
||||
<div class="index-letter-menu">
|
||||
<a class="index-letter" href="elementindex.html#b">b</a>
|
||||
<a class="index-letter" href="elementindex.html#c">c</a>
|
||||
<a class="index-letter" href="elementindex.html#d">d</a>
|
||||
<a class="index-letter" href="elementindex.html#e">e</a>
|
||||
<a class="index-letter" href="elementindex.html#f">f</a>
|
||||
<a class="index-letter" href="elementindex.html#g">g</a>
|
||||
<a class="index-letter" href="elementindex.html#h">h</a>
|
||||
<a class="index-letter" href="elementindex.html#i">i</a>
|
||||
<a class="index-letter" href="elementindex.html#k">k</a>
|
||||
<a class="index-letter" href="elementindex.html#p">p</a>
|
||||
<a class="index-letter" href="elementindex.html#r">r</a>
|
||||
<a class="index-letter" href="elementindex.html#s">s</a>
|
||||
<a class="index-letter" href="elementindex.html#v">v</a>
|
||||
</div>
|
||||
|
||||
<a name="b"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">b</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">backtrace</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a debug backtrace</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="c"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">c</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Page.png" alt="Page" title="Page" /></title>
|
||||
<span class="include-title">class.krumo.php</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html">class.krumo.php</a> in class.krumo.php</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">classes</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared classes.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">conf</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all your configuration settings.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">cookie</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="d"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">d</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">defines</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared constants.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">DIR_SEP</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">disable</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Disable Krumo</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">dump</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Dump information about a variable</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="e"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">e</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">enable</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Enable Krumo</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">env</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">extensions</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="f"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">f</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">functions</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared functions.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="g"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">g</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">get</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="h"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">h</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">headers</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all HTTP request headers.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="i"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">i</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">includes</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently included (or required) files.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">ini</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from an INI file.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">interfaces</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="k"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">k</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Function.png" alt="Function" title="Function" /></title>
|
||||
<span class="method-title">krumo</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Class.png" alt="Class" title="Class" /></title>
|
||||
krumo
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Krumo API</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">KRUMO_DIR</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="p"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">p</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">path</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">PATH_SEPARATOR</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">phpini</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">post</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="r"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">r</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">request</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="s"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">s</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">server</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">session</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="v"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">v</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">version</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Return Krumo version</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<div class="index-letter-menu">
|
||||
<a class="index-letter" href="elementindex.html#b">b</a>
|
||||
<a class="index-letter" href="elementindex.html#c">c</a>
|
||||
<a class="index-letter" href="elementindex.html#d">d</a>
|
||||
<a class="index-letter" href="elementindex.html#e">e</a>
|
||||
<a class="index-letter" href="elementindex.html#f">f</a>
|
||||
<a class="index-letter" href="elementindex.html#g">g</a>
|
||||
<a class="index-letter" href="elementindex.html#h">h</a>
|
||||
<a class="index-letter" href="elementindex.html#i">i</a>
|
||||
<a class="index-letter" href="elementindex.html#k">k</a>
|
||||
<a class="index-letter" href="elementindex.html#p">p</a>
|
||||
<a class="index-letter" href="elementindex.html#r">r</a>
|
||||
<a class="index-letter" href="elementindex.html#s">s</a>
|
||||
<a class="index-letter" href="elementindex.html#v">v</a>
|
||||
</div>
|
@@ -0,0 +1,389 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="top"></a>
|
||||
<h2>[Krumo] element index</h2>
|
||||
<a href="elementindex.html">All elements</a>
|
||||
<br />
|
||||
<div class="index-letter-menu">
|
||||
<a class="index-letter" href="elementindex_Krumo.html#b">b</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#c">c</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#d">d</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#e">e</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#f">f</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#g">g</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#h">h</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#i">i</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#k">k</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#p">p</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#r">r</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#s">s</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#v">v</a>
|
||||
</div>
|
||||
|
||||
<a name="b"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">b</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">backtrace</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a debug backtrace</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="c"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">c</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Page.png" alt="Page" title="Page" /></title>
|
||||
<span class="include-title">class.krumo.php</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html">class.krumo.php</a> in class.krumo.php</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">classes</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared classes.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">conf</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all your configuration settings.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">cookie</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="d"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">d</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">defines</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared constants.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">DIR_SEP</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">disable</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Disable Krumo</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">dump</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Dump information about a variable</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="e"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">e</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">enable</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Enable Krumo</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">env</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">extensions</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="f"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">f</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">functions</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared functions.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="g"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">g</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">get</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="h"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">h</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">headers</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all HTTP request headers.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="i"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">i</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">includes</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently included (or required) files.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">ini</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from an INI file.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">interfaces</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="k"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">k</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Function.png" alt="Function" title="Function" /></title>
|
||||
<span class="method-title">krumo</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Class.png" alt="Class" title="Class" /></title>
|
||||
krumo
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Krumo API</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">KRUMO_DIR</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="p"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">p</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">path</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
||||
<span class="const-title">PATH_SEPARATOR</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/_class.krumo.php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">phpini</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">post</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="r"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">r</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">request</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="s"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">s</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">server</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
|
||||
</dd>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">session</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="v"></a>
|
||||
<div class="index-letter-section">
|
||||
<div style="float: left" class="index-letter-title">v</div>
|
||||
<div style="float: right"><a href="#top">top</a></div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<dl>
|
||||
<dt class="field">
|
||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
||||
<span class="method-title">version</span>
|
||||
</dt>
|
||||
<dd class="index-item-body">
|
||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
|
||||
<div class="index-item-description">Return Krumo version</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<div class="index-letter-menu">
|
||||
<a class="index-letter" href="elementindex_Krumo.html#b">b</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#c">c</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#d">d</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#e">e</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#f">f</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#g">g</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#h">h</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#i">i</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#k">k</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#p">p</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#r">r</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#s">s</a>
|
||||
<a class="index-letter" href="elementindex_Krumo.html#v">v</a>
|
||||
</div>
|
15
sites/all/modules/development/devel/krumo/docs/errors.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title>phpDocumentor Parser Errors and Warnings</title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a href="#Post-parsing">Post-parsing</a><br>
|
||||
<p class="notes" id="credit">
|
||||
Documentation generated on Sun, 02 Dec 2007 09:43:25 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
||||
</p>
|
||||
</body>
|
24
sites/all/modules/development/devel/krumo/docs/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- Generated by phpDocumentor on Sun, 02 Dec 2007 09:43:23 +0200 -->
|
||||
<title>Krumo</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
||||
</head>
|
||||
|
||||
<FRAMESET rows='120,*'>
|
||||
<FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
|
||||
<FRAMESET cols='25%,*'>
|
||||
<FRAME src='li_Krumo.html' name='left_bottom' frameborder="1" bordercolor="#999999">
|
||||
<FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
|
||||
</FRAMESET>
|
||||
<NOFRAMES>
|
||||
<H2>Frame Alert</H2>
|
||||
<P>This document is designed to be viewed using the frames feature.
|
||||
If you see this message, you are using a non-frame-capable web client.</P>
|
||||
</NOFRAMES>
|
||||
</FRAMESET>
|
||||
</HTML>
|
155
sites/all/modules/development/devel/krumo/docs/li_Krumo.html
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<!-- template designed by Marco Von Ballmoos -->
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
||||
<script src="media/lib/classTree.js"></script>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var imgPlus = new Image();
|
||||
var imgMinus = new Image();
|
||||
imgPlus.src = "media/images/plus.png";
|
||||
imgMinus.src = "media/images/minus.png";
|
||||
|
||||
function showNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgMinus.src;
|
||||
oTable.style.display = "block";
|
||||
}
|
||||
|
||||
function hideNode(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
var oImg = document.layers["img" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
var oImg = document.all["img" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
var oImg = document.getElementById("img" + Node);
|
||||
break;
|
||||
}
|
||||
oImg.src = imgPlus.src;
|
||||
oTable.style.display = "none";
|
||||
}
|
||||
|
||||
function nodeIsVisible(Node){
|
||||
switch(navigator.family){
|
||||
case 'nn4':
|
||||
// Nav 4.x code fork...
|
||||
var oTable = document.layers["span" + Node];
|
||||
break;
|
||||
case 'ie4':
|
||||
// IE 4/5 code fork...
|
||||
var oTable = document.all["span" + Node];
|
||||
break;
|
||||
case 'gecko':
|
||||
// Standards Compliant code fork...
|
||||
var oTable = document.getElementById("span" + Node);
|
||||
break;
|
||||
}
|
||||
return (oTable && oTable.style.display == "block");
|
||||
}
|
||||
|
||||
function toggleNodeVisibility(Node){
|
||||
if (nodeIsVisible(Node)){
|
||||
hideNode(Node);
|
||||
}else{
|
||||
showNode(Node);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3 class="package-title">Krumo</h3>
|
||||
<div class="tree">
|
||||
<script language="Javascript">
|
||||
if (document.getElementById) {
|
||||
var tree = new WebFXTree('<span class="package">Krumo</span>');
|
||||
tree.setBehavior('classic');
|
||||
tree.openIcon = 'media/images/package.png';
|
||||
tree.icon = 'media/images/package.png';
|
||||
|
||||
|
||||
var class_trees = new WebFXTreeItem('Class trees', 'classtrees_Krumo.html');
|
||||
class_trees.openIcon = 'media/images/Index.png';
|
||||
class_trees.icon = 'media/images/Index.png';
|
||||
tree.add(class_trees);
|
||||
|
||||
var elements = new WebFXTreeItem('Index of elements', 'elementindex_Krumo.html');
|
||||
elements.openIcon = 'media/images/Index.png';
|
||||
elements.icon = 'media/images/Index.png';
|
||||
tree.add(elements);
|
||||
|
||||
var parent_node;
|
||||
|
||||
|
||||
|
||||
var tree_classe = new WebFXTreeItem('Class(es)', '');
|
||||
tree_classe.openIcon = 'media/images/class_folder.png';
|
||||
tree_classe.icon = 'media/images/class_folder.png';
|
||||
|
||||
var classe = new WebFXTreeItem('krumo', 'Krumo/krumo.html');
|
||||
classe.openIcon = 'media/images/Class.png';
|
||||
classe.icon = 'media/images/Class.png';
|
||||
tree_classe.add(classe);
|
||||
|
||||
tree.add(tree_classe);
|
||||
|
||||
var tree_function = new WebFXTreeItem('Function(s)', '');
|
||||
tree_function.openIcon = 'media/images/function_folder.png';
|
||||
tree_function.icon = 'media/images/function_folder.png';
|
||||
|
||||
var fic = new WebFXTreeItem('krumo', 'Krumo/_class.krumo.php.html#functionkrumo');
|
||||
fic.openIcon = 'media/images/Function.png';
|
||||
fic.icon = 'media/images/Function.png';
|
||||
tree_function.add(fic);
|
||||
|
||||
tree.add(tree_function);
|
||||
|
||||
var tree_file = new WebFXTreeItem('File(s)', '');
|
||||
tree_file.openIcon = 'media/images/folder.png';
|
||||
tree_file.icon = 'media/images/folder.png';
|
||||
|
||||
var file = new WebFXTreeItem('class.krumo.php', 'Krumo/_class.krumo.php.html');
|
||||
file.openIcon = 'media/images/Page.png';
|
||||
file.icon = 'media/images/Page.png';
|
||||
tree_file.add(file);
|
||||
|
||||
tree.add(tree_file);
|
||||
|
||||
|
||||
document.write(tree);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<p class="notes">
|
||||
Generated by
|
||||
<a href="http://www.phpdoc.org" target="_blank">phpDocumentor <span class="field">1.4.0a2</span></a>
|
||||
</p>
|
||||
</body>
|
@@ -0,0 +1,32 @@
|
||||
body
|
||||
{
|
||||
background-color: #EEEEEE;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Banner (top bar) classes */
|
||||
|
||||
.banner { }
|
||||
|
||||
.banner-menu
|
||||
{
|
||||
clear: both;
|
||||
padding: .5em;
|
||||
border-top: 2px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.banner-title
|
||||
{
|
||||
text-align: right;
|
||||
font-size: 20pt;
|
||||
font-weight: bold;
|
||||
margin: .2em;
|
||||
}
|
||||
|
||||
.package-selector
|
||||
{
|
||||
background-color: #DDDDDD;
|
||||
border: 1px solid #AAAAAA;
|
||||
color: #000090;
|
||||
}
|
After Width: | Height: | Size: 620 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 874 B |
After Width: | Height: | Size: 570 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 865 B |
After Width: | Height: | Size: 956 B |
After Width: | Height: | Size: 596 B |
After Width: | Height: | Size: 712 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 219 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 772 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 688 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 688 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 90 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 605 B |
After Width: | Height: | Size: 54 B |
After Width: | Height: | Size: 657 B |
After Width: | Height: | Size: 543 B |
After Width: | Height: | Size: 668 B |
After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 56 B |
After Width: | Height: | Size: 644 B |
After Width: | Height: | Size: 541 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 431 B |