What is the correct syntax for the CLI to exclude multiple folders in ApiGen?
I tried separating them with comma, but that's ignored (probably read as one path):
H:\SERVER>php apigen.phar generate --source [PATH] --destination [PATH] --exclude [PATH]*,[PATH]*
Using the terminal, I suppose you could do:
php apigen.phar generate --source xxx --destination xxx --exclude folder_to_excluse --exlude yet_another_folder
(its the same behavior with multiple sources)
I'm trying to exclude multiple folders in a .conf file, when I have the answer I'll update this answer :D, hope it helps.
-- Update --
To add multiple sources and/or multiple exclude references from a config file:
# Source file or directory to parse
source:
# ../PASTA
- ../sys
- ../anotherfolder
# Directory where to save the generated documentation
destination: 'C:\xampp\htdocs\yourfolder'
# List of allowed file extensions
extensions: [php]
# Mask to exclude file or directory from processing
exclude:
- '../sys/vendor'
- '..sys/core'
#next elements of the config file.
And to run the config file:
apigen generate --config file.conf
Use the next syntax, for example to skip the directories (Vendor, Config and X)
For windows:
php apigen.phar generate --source [YOUR-SOURCE-PATH] --destination [DESTINATION-PATH] --skip-doc-path "*/Vendor*" --skip-doc-path "*/Config*" --skip-doc-path "*/Docs/X*"
Linux:
apigen generate -s [YOUR-SOURCE-PATH] -d [DESTINATION-PATH] --skip-doc-path "*/Vendor*" --skip-doc-path "*/Config*" --skip-doc-path "*/Docs/X*"
The correct way to exclude folders from APIGEN documentation is to specify the following option:
--exclude /path/to/folder
NOTE that there is no trailing slash and no wildcard beyond the name of the folder. If you specify --exclude /path/to/folder/ it will not work and if you do --exclude /path/to/folder/* it will only exclude the first file in the specified folder.
Use your paths relative to --source. For example if your sources are located at /Users/abc/www and you want to exclude /Users/abc/www/a and /Users/abc/www/b folders and let's say /Users/abc/www/tests/test.php file, use the command like below:
php apigen.phar generate --source /Users/abc/www --destination /Users/abc/docs --exclude a,b,tests/test.php
no trailing slash or wildcard. seperate them with commas.
worked for me.
Related
I have been trying and failing for a week to get Kalabox working with a WordPress install that has a nested web root with Pantheon. I've found some great resources, but many of them are for Drupal and they don't seem to translate to the WP installs, like the great post by Tandem here: https://www.thinktandem.io/blog/2017/05/20/using-pantheon-s-nested-docroot-with-kalabox/
Does anyone have a quick walkthrough that would work? Thanks!
I figured it out! Here's what it took:
1. Setup A Site In Pantheon
Create Sites
2. Clone the Site to your local machine using Kalabox
Make sure you've installed Kalabox on your machine. This will also install Docker, if you haven't already installed it. Now, open your terminal.
mkdir -p ~/Kalabox
cd ~/Kalabox
kbox create pantheon
# follow the prompts to clone down your Pantheon site
3. Add Your Site Code
This is where the real work starts. Make sure you're in the main Kalabox directory. I'm using the excellent Advanced Wordpress On Pantheon as the boilerplate for this app. But you can use whatever you'd like.
# replace text in < > with your site name
cd ~/Kalabox/<your-site-name>
rm -rf code/
# Clone this or copy your own site code into the code directory
git clone https://github.com/ataylorme/advanced-wordpress-on-pantheon.git code
If you're using the Advanced WordPress install above, type the following lines, as well:
cd code/
./bin/local-build.sh
Make certain you added your code into the ~/Kalabox/<your-site-name>/code/ directory.
You can visit your site now at http://.kbox.site on your browser, but if you have a nested web root, you'll likely see an Nginx 500 error. This is the problem we're trying to fix!
4. Edit The Kalabox Setup to Allow A Nested Web Root
This part is the secret sauce. We have to get into the Docker container that Kalabox has setup and change the nginx configuration files. If all that sounds like non-sense to you, don't worry. These simple instructions should help you do it! Back to the terminal!
docker ps
This dumps a table with a list of the running Docker containers. Find the one that says nginix under the Image column. Look immediately to the left in the Container ID column. Note, copy and/or write down the first four-or-so letters of that container ID. You'll use those in the <container-id> part of this next command:
docker exec -i -t <container-id> bash
This opens a pseudo remote shell with your nginx container. Yay! Now we can edit the nginx files and get our site up-and-running! The command line probably changed a bit, showing your user as root#<your-site-name>. That means it worked.
The nginx container doesn't have a text editor downloaded by default. So, we'll download a tiny little text editor called Nano.
apt-get update
apt-get install nano
Once those commands are finished running, we can edit the config file:
nano /etc/nginx/conf.d/default.conf
This opens the Nano editor with the configuration file we're trying to edit. Look and change the following lines:
# This one is near the top of the file
# Before
root /code;
# After
root /code/web;
# These next two are near the bottom of the file.
# This exact line appears twice--once in the `location ~ ^/simplesaml/`
# block, and once in the `location ~ \.php$` block. Edit it in
# BOTH locations.
#
# Before
fastcgi_param SCRIPT_FILENAME /code/$fastcgi_script_name;
# After
fastcgi_param SCRIPT_FILENAME /code/web/$fastcgi_script_name;
When you're done with that, type <Ctrl-o> <Enter> <Ctrl-x> to save your work and exit. You're back at the pseudo shell for your Docker container. Type exit to go back to your normal command line.
5. Rebuild Kalabox & Test It Out!
Make sure you're in the ~/Kalabox/<your-site-name> directory, and type kbox restart just to make sure you've got everything cleared out of the Kalabox caches. Kalabox will stop and restart your site for you. Once it's done, visit http://.kbox.site in your browser to see your work!
Extra Goodies
Upgrade to PHP 7: Open ~/Kalabox/<your-site-name>/kalabox.yml in your favorite editor, and change line 33 to php: 70.
Remove Undefined Index: NONCE_KEY error: open ~/Kalabox/<your-site-name>/config/php/prepend.php and go to roughly line 55 which reads $_ENV['NONCE_SALT'] = getenv('NONCE_SALT');. Below it, add a similar line: $_ENV['NONCE_KEY'] = getenv('NONCE_KEY');
The PHP framework I use needs OpenSSL for various features, but when executing anything related to OpenSSL, I get the following error: "Can't find ordinal 372 in DLL-file C:\wamp64\bin\apache\apache2.4.17\bin\openssl.exe".
I don't know how to correct this at all, I looked everywhere already. I'd appreciate the help, as I don't know how to fix this.
To fix the issue, two things are needed:
1) Make sure that you don't have symbolic links for libeay32.dll and ssleay32.dll in your Apache bin directory
(For example, mine is: C:\wamp64\bin\apache\apache2.4.23\bin)
If you do have symbolic links (i.e. the file size are 0 bytes), you need to download the dlls from Apache Lounge.
For example, I grabbed the two .dll files from the 64-bit version of Apache 2.4.23 hosted at https://www.apachelounge.com/download/
2) Once you have the actual .dll files restored, you need to make sure that WampServer isn't overwriting them. WampServer 3 has a configuration script that runs every time it starts. In that script it will overwrite those .dlls with symbolic links. You must DISABLE that functionality. To do so, comment out the references to those two files in: C:\wamp64\scripts\config.inc.php (mine were located at lines 133 and 139).
That should allow you to enable the mod_ssl module in Apache. You'll also need to uncomment the "Include conf/extra/httpd-ssl.conf" after you get Apache booting properly with mod_ssl enabled. (However, you'll likely need to delete most of whats in there and start over since it includes lots of hardcoded paths and bugs)
... "Can't find ordinal 372 in DLL-file C:\wamp64\bin\apache\apache2.4.17\bin\openssl.exe"
I'm speculating its PEM_SealInit or SSL_CONF_cmd_argv from OpenSSL 1.0.2; or ASN1_i2d_fp or SSL_SESSION_set1_id_context from OpenSSL 1.1.0.
# OpenSSL 1.1.0
$ find $PWD -type f -iname '*.num' -exec grep " 372" {} \;
ASN1_i2d_fp 372 1_1_0 EXIST::FUNCTION:STDIO
SSL_SESSION_set1_id_context 372 1_1_0 EXIST::FUNCTION:
...
# OpenSSL 1.0.2
$ find $PWD -type f -iname '*.num' -exec grep " 372" {} \;
PEM_SealInit 372 EXIST::FUNCTION:RSA
SSL_CONF_cmd_argv 372 EXIST::FUNCTION:
...
You will need to verify it by using dumpbin or Dependency Walker. Also see How can I find the exported function name from ordinal (export by ordinal)? on Stack Overflow.
The ordinals are created using <openssl src>\util\mkdef.pl. You can see the source code from OpenSSL's GitHub presence. Here is 1.0.2 and here is 1.1.0.
Here are the head comments for the file:
#!/usr/local/bin/perl -w
#
# generate a .def file
#
# It does this by parsing the header files and looking for the
# prototyped functions: it then prunes the output.
#
# Intermediary files are created, call libcrypto.num and libssl.num,
# The format of these files is:
#
# routine-name nnnn vers info
#
# The "nnnn" and "vers" fields are the numeric id and version for the symbol
# respectively. The "info" part is actually a colon-separated string of fields
# with the following meaning:
#
# existence:platform:kind:algorithms
#
# - "existence" can be "EXIST" or "NOEXIST" depending on if the symbol is
# found somewhere in the source,
# - "platforms" is empty if it exists on all platforms, otherwise it contains
# comma-separated list of the platform, just as they are if the symbol exists
# for those platforms, or prepended with a "!" if not. This helps resolve
# symbol name variants for platforms where the names are too long for the
# compiler or linker, or if the systems is case insensitive and there is a
# clash, or the symbol is implemented differently (see
# EXPORT_VAR_AS_FUNCTION). This script assumes renaming of symbols is found
# in the file crypto/symhacks.h.
# The semantics for the platforms is that every item is checked against the
# environment. For the negative items ("!FOO"), if any of them is false
# (i.e. "FOO" is true) in the environment, the corresponding symbol can't be
# used. For the positive itms, if all of them are false in the environment,
# the corresponding symbol can't be used. Any combination of positive and
# negative items are possible, and of course leave room for some redundancy.
# - "kind" is "FUNCTION" or "VARIABLE". The meaning of that is obvious.
# - "algorithms" is a comma-separated list of algorithm names. This helps
# exclude symbols that are part of an algorithm that some user wants to
# exclude.
I just encountered the same problem, on Windows and using xampp instead of Wamp.
Doing what's described in the commentaries of this page solved it : PHP cURL Installation.
I copied the 3 .dll files from the PHP installation directory to the apache/bin directory and rebooted xampp.
Using Laravel 5.x. or 5.1.x
What would be the basic recommended configuration for the .hgignore file?
Pulling from the .gitignore this is what I have:
syntax: glob
.env
.gitignore
.gitattributes
.idea
vendor/
node_modules/
Homestead.yaml
Homestead.json
Online I see for version 4 something about /bootstrap/compiled.php
Should I include /bootstrap/cache ?
I use negative lookahead to include the empty folder structure:
## Laravel specific
^\.env$
^vendor
## General
\.DS_Store$
[Tt]humbs\.db$
## Keep these folders, but ignore their content
^bootstrap/cache/(?!\.gitignore).+$
^storage/logs/(?!\.gitignore).+$
^storage/app/(?!\.gitignore).+$
^storage/framework/views/(?!\.gitignore).+$
^storage/framework/sessions/(?!\.gitignore).+$
^storage/framework/cache/(?!\.gitignore).+$
When I run php from the command line (on Windows), I receive the following message
Failed loading C:\Users\Nickey K\Documents\AMD APP\bin\x86_64;C:\Users\Nickey K\
Documents\AMD APP\bin\x86;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program F
iles (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Window
s Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Prog
ram Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C
:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program F
iles (x86)\Calibre2\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files
(x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-
Static;C:\Program Files (x86)\EasyPHP-12.0\php\php544x120715104042;\php\php544x1
20715104042\php_xdebug-2.2.0-5.4-vc9.dll
x_debug seems to be installed properly based on phpinfo, and I have the following line in php.ini
zend_extension = "C:\Program Files (x86)\EasyPHP-12.0\php\php544x120715104042\php_xdebug-2.2.0-5.4-vc9.dll"
I've put the dll file in both the above the the ...\ext directory and tried a few variants of the above line, but I'm unable to get rid of this error message.
Any ideas?
The regular command line PHP from EasyPHP did not work as is. The problem is EasyPHP replaces the PATH variable with its own. That is just dumb that it doesn't use a different variable.
But, the following worked for me after some experimentations. I created a batch file php5.bat and placed it in C:\Windows\Sytem32 for easier access, with the following code (where C:\Program Files (x86)\EasyPHP-12.1\php\php548x121030011600 is the location my easyPHP php.exe was).
#echo off
REM Set the path for easy PHP and then start PHP.
set OLD_PATH=%PATH%
set PATH=C:\Program Files (x86)\EasyPHP-12.1
set PHP_DIR=C:\Program Files (x86)\EasyPHP-12.1\php\php548x121030011600
call "%PHP_DIR%\php.exe" -c "%PHP_DIR%\php.ini" %*
set PATH=%OLD_PATH%
#echo on
And then calling the batch file php5 -v will give you the php version. You might need to copy some DLLs from the Apache folder into the PHP folder as it will complain the DLLs are not found.
lets try to use zend_extension_tc instead of zend_extension if you're using window.
I'm trying to get Netbeans for Mac to integrate with DocBlox for documentation generation. I followed the instructions on the docblox site for integrating with netbeans, but when I actually try to generate documentation I get no output, and the following appears in the output window:
DocBlox version 0.17.2
PHP Warning: mkdir(): Permission denied in /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php on line 120
PHP Stack trace:
PHP 1. {main}() /usr/local/php5-20111115-115202/bin/docblox:0
PHP 2. DocBlox_Task_Project_Run->execute() /usr/local/php5-20111115-115202/bin/docblox:55
PHP 3. DocBlox_Task_Project_Parse->execute() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Run.php:141
PHP 4. DocBlox_Task_Project_Parse->getTarget() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php:270
PHP 5. mkdir() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php:120
Warning: mkdir(): Permission denied in /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php on line 120
Call Stack:
0.0004 655768 1. {main}() /usr/local/php5-20111115-115202/bin/docblox:0
0.0227 3376320 2. DocBlox_Task_Project_Run->execute() /usr/local/php5-20111115-115202/bin/docblox:55
0.0246 3538264 3. DocBlox_Task_Project_Parse->execute() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Run.php:141
0.0546 3867832 4. DocBlox_Task_Project_Parse->getTarget() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php:270
0.0546 3868056 5. mkdir() /usr/local/php5-20111115-115202/lib/php/DocBlox/src/DocBlox/Task/Project/Parse.php:120
ERROR: The given location "Reefknot" is not a folder
DocBlox creates documentation from PHP source files. The simplest way to use it is:
$ docblox run -d <directory to parse> -t <output directory>
This will parse every file ending with .php, .php3 and .phtml in <directory to parse> and then
output a HTML site containing easily readable documentation in <output directory>.
DocBlox will try to look for a docblox.dist.xml or docblox.xml file in your current working directory
and use that to override the default settings if present. In the configuration file can you specify the
same settings (and more) as the command line provides.
Usage:
docblox project:run [options]
-h [--help] Show this help message
-q [--quiet] Silences the output and logging
-c [--config] [STRING] Configuration filename OR "none", when this option is omitted DocBlox tries to load the docblox.xml or docblox.dist.xml from the current working directory
-f [--filename] STRING Comma-separated list of files to parse. The wildcards ? and * are supported
-d [--directory] STRING Comma-separated list of directories to (recursively) parse.
-t [--target] [STRING] Path where to store the generated output (optional, defaults to "output")
-e [--extensions] [STRING] Optional comma-separated list of extensions to parse, defaults to php, php3 and phtml
-i [--ignore] [STRING] Comma-separated list of file(s) and directories that will be ignored. Wildcards * and ? are supported
-m [--markers] [STRING] Comma-separated list of markers/tags to filter, (optional, defaults to: "TODO,FIXME")
-v [--verbose] Provides additional information during parsing, usually only needed for debugging purposes
--title [STRING] Sets the title for this project; default is the DocBlox logo
--template [STRING] Sets the template to use when generating the output
--force Forces a full build of the documentation, does not increment existing documentation
--validate Validates every processed file using PHP Lint, costs a lot of performance
--parseprivate Whether to parse DocBlocks tagged with #internal
--visibility [STRING] Specifies the parse visibility that should be displayed in the documentation (comma seperated e.g. "public,protected")
--defaultpackagename [STRING] name to use for the default package. If not specified, uses "default"
--sourcecode Whether to include syntax highlighted source code
-p [--progressbar] Whether to show a progress bar; will automatically quiet logging to stdout
I have chmoded the target directory to 0777, but still no joy.
Has anybody got any ideas what's going wrong here? I'm running OSX Lion, Netbeans 7.1RC2 and DocBlox 0.17.2 installed via PEAR
Short version
it appears you need to modify the phpdoc batch file of NetBeans as described here: https://github.com/docblox/docblox/issues/195
Explanation
the problem is probably caused by Netbeans passing a title using the shortcut notation (-ti) of phpDocumentor. I am assuming your project is called Reefknot and Netbeans tries to add -ti Reefknot as last argument.
Since DocBlox is unable to handle the double character shortcut notation it will interpret -ti as being -t and as such cause Docblox to try and write to a folder 'Reefknot'.