06-20-2012
Extract function names and directories from php files
I need a script that extracts function names from php files together with their location (path and file in which they are defined).
The php files are located in several directories under a base directory.
Ideally the output should be something like:
"Path/FileName/FunctionName" for a function "FunctionName" which is defined in file "FileName.php" and FileName.php is located in Path.
Should be pretty simple, but I haven't done any scripting for years, so hopefully somebody can help. Any scripting language is fine.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I do not know much about shell scripting and need to create a script and I am at a loss. If someone can help me, that would be great!!
I have two directories:
/dir1
/dir2
I need to get the sequence number which is part of the filename in /dir1 and delete all files in /dir2 that are... (4 Replies)
Discussion started by: stky13
4 Replies
2. Shell Programming and Scripting
hi,
i am a newbie and have to write a rather complicated script. Assume that i have a variable called x and a C source code file say file1.c (these are the inputs of the script) and i need to find the names of all the functions in the C file containing x.Take the following code as an example:
... (2 Replies)
Discussion started by: samantha grace
2 Replies
3. Solaris
Hello all.
I have a tar file that contains a number of files that are stored in different directories.
If I extract this tar file with -xvf , the directories get created.
Is there a way to extract all of the files into one directory without creating the directories stored in the tar file. (9 Replies)
Discussion started by: gkb
9 Replies
4. UNIX for Dummies Questions & Answers
Hi There,
I'm a competent computer user that is learning basic unix commands.
This is a slightly hypothetical question (for now at least!) but I can see a need for doing something like this in the near future.
So I recently learned this command mkdir foo{1..100} which of course create's... (4 Replies)
Discussion started by: lookslikejames
4 Replies
5. Shell Programming and Scripting
Hi,
I have got a requirement for which i need your help. The following problem is required to get solved in PERL SCRIPT. Here is the requirement.
There are 4 folders say SRC_DIR1, SRC_DIR2 and TGT_DIR_1,TGT_DIR_2
(Note: both path of SRC_DIR1 & SRC_DIR2 are different but both path of... (1 Reply)
Discussion started by: shadow_fawkes
1 Replies
6. Shell Programming and Scripting
Hi,
I have got a requirement for which i need your help. The following problem is required to get solved in PERL SCRIPT. Here is the requirement.
There are 4 folders say SRC_DIR1, SRC_DIR2 and TGT_DIR_1,TGT_DIR_2
(Note: both path of SRC_DIR1 & SRC_DIR2 are different but both path of... (4 Replies)
Discussion started by: shadow_fawkes
4 Replies
7. Shell Programming and Scripting
Dear All,
I have some list of directories names 1 2 3 .... n.
Number can vary each time when I run some software to create these folders.
When ever I wanted to run new case I have to remove all the sub-directories named 1 2 3 4 .... in case directory.
How can I do it using rm -r command?
... (4 Replies)
Discussion started by: linuxUser_
4 Replies
8. Shell Programming and Scripting
Hi,
I have a requirement to compare files in different directories with different names. The files have a datestamp in their name (It might not be a sequential datetimestamp).
This is for Redhat Linux. I have more than 5 directories and more than 10 file in each directory to be compared.
... (4 Replies)
Discussion started by: GosarJunk
4 Replies
9. Shell Programming and Scripting
OS : Fedora Linux 26
Shell : bash
I have a file with around 5000 lines like below.
file /usr/share/icons/Papirus/16x16/actions/papirus-icon-theme-20180501-1.noarch conflicts with file ...
file /usr/share/icons/Papirus/16x16/actions/align-horizontal-left-to-anchor.svg conflicts between... (7 Replies)
Discussion started by: John K
7 Replies
LEARN ABOUT PHP
apc_delete_file
APC_DELETE_FILE(3) 1 APC_DELETE_FILE(3)
apc_delete_file - Deletes files from the opcode cache
SYNOPSIS
mixed apc_delete_file (mixed $keys)
DESCRIPTION
Deletes the given files from the opcode cache.
PARAMETERS
o $keys
- The files to be deleted. Accepts a string, array of strings, or an APCIterator object.
RETURN VALUES
Returns TRUE on success or FALSE on failure. Or if $keys is an array, then an empty array is returned on success, or an array of failed
files is returned.
EXAMPLES
Example #1
apc_delete_file(3) example
<?php
$filename = 'file.php';
if (apc_compile_file($filename)) {
if (apc_delete_file($filename)) {
echo "Successfully deleted file $filename from APC cache.", PHP_EOL;
}
}
if (apc_compile_file($filename)) {
if ($good = apc_delete_file(array($filename, 'donotexist.php'))) {
var_dump($good);
}
}
$bad = apc_delete_file('donotexist.php');
var_dump($bad);
?>
The above example will output something similar to:
Successfully deleted file file.php from APC cache.
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 13.
array(1) {
[0]=>
string(14) "donotexist.php"
}
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 18.
bool(false)
SEE ALSO
apc_clear_cache(3), apc_delete(3), apc_exists(3).
PHP Documentation Group APC_DELETE_FILE(3)