Remove Unused Files From PHP Project

Dec 12, 2007

Do you know a tool that can scan a tree of PHP files (but also web-related files such as HTML or CSS, anything that can include other files - I want to emphasize that the tool must be able to recursively scan a directory and be aware of include, require, @import, <x src> and other known including directives) and tell what files are independent.

More exactly, I want a tool to find old unused files in my PHP projects so I can zap them.

ADVERTISEMENT

Remove Error Warnings Made By Tpl Files In Eclipse Project?

Mar 25, 2010

i installed eclipse 3.5.2 with php support and when i created my php project all tpl files appeared with errors, seem to be searching zend_debugger, how do i remove that errors for the sake of keep my code flow normal with no red warns everywhere?

View 1 Replies View Related

A Trick To Find Unused Files (Drupal Template Files)?

Aug 5, 2010

I am looking for a trick to find included files that are not in use. Preferrably not by going trough them by hand. This project has over 400 of such files, 100 are probably unused by now.They are Drupal template files (tpl.php) and were placed in the theme/template during development and -as always- were never removed when obsoleted.

Things I have thought of:

* maintain a register in the database or a log, and spider the site. All files that don't appear in the log are candidates for removal, and need manual checking.

* use a file-profiling tool such as cachegrind to render call-stacks: the files should appear in there somehow. I have no idea, however, how to get this done.

Problem in Drupal templates, is that they are very dynamic, so simply grepping for include_once() and the likes does not work.

View 1 Replies View Related

Identify Unused Functions (and Files)?

Mar 5, 2011

I'm using NetBeans, but would be grateful for any FOSS tool which identifies functions that are never called (plus files which contain only such functions, or files which are never included and never a form action (i.e. never used)).

I might try using PHPdoc to identify such cases, but just wondered if there are any specialized tools (especially for use with NetBeans).

View 1 Replies View Related

Keeping Track Of Links Or References To Image Files And Deleting Unused Ones (Database)?

Jun 7, 2010

I need a way to remove "unused" images from my filesystem, i.e. images that are never accessed from any point in my website (doesn't matter if I break external links. I might disable external hotlinking altogether). What's the best way of going about this?Regular users can add multiple attachments to topics/posts and content contributers can bulk upload large numbers of images which can be used in articles or image galleries.The problem is that the images could be referenced in any of the following ways:From user content (text/html, possibly Markdown or BBCode) stored in the databaseHardcoded into an HTML pageHardcoded into a PHP fileHardcoded into a CSS fileAs an "attachment" field in a database table, usually containing only the filename itself with no path, because the application assumes that it would be in a certain folder.And to top it off, the path of the image could be an absolute or relative HTTP or PHP path and may or may not be built with string concatenation in PHP.

So obviously find/replace or regexing the database or filesystem is out of the question.But luckily for you and me, this system isn't fully implemented yet and I don't need anything that deals with an existing hoard of images. I just need to set up some efficient structure that will allow this in the future.Some ideas I've thought of:Intercepting the HTTP request for the image with PHP, and keeping track of the HTTP_REFERER. The problem with this is that just because no one has clicked on a link at the time of checking this doesn't mean the link doesn't exist.Use extreme database normalization - i.e. make a table for images and use foreign keys for anything that references it. However this would result in making a metric craptonne of many-to-many relationships (and the crosstables) in addition to being impractical for any regular user to use.Backup all the images and delete them, and check every single 404 request and run a script each time that attempts to find the image from the backup folder and puts it in the "real" folder. The problem is that this cache would have to be purged every so often and the server might be strained when rebuilding the cache.Ideas/suggestions? Is this just something you have to ignore and live with even if you're making a site with a ridiculous amount of images? Even if it's not worth it, how would something work just for proof-of-concept (I added the garbage-collection tag just because this might be going into that area conceptually).

View 1 Replies View Related

Remove A Whole Project From SVN Synchronization?

Sep 16, 2010

I have a project i no longer want synchronised to SVN (as this is just a copy and i have another project synchronised)... How in the life do i remove it from SVN using Eclipse, or anything basically?

View 2 Replies View Related

Remove Script Extension From Symfony Project?

May 13, 2011

I have created two applications in my symfony project, but my second application i can only access using .php extension. example [URL] I want to remove the .php extension from the backend project, is possible?

View 2 Replies View Related

Remove Model Using Command Line From CakePHP Project

Jun 21, 2011

I have an annoying model that I accidentally created that keeps interfering with my cake schema run update command. how can I destroy this model?

ok, I believe it is just easier to remove model file. I was just curious about cakephp-scripts implementation but it's not really necessary.

View 2 Replies View Related

Linked Files In Project

Jul 17, 2005

How do I find all files (php, html, gif, jpg,) NOT used, starting from index.php, out of a project containing about 200 files without having to read every line of every file looking for includes or links etc.?

View 1 Replies View Related

Project, Files And Directories Organisation

Jul 17, 2005

I am searching a kind of software engineering document about PHP. This
document should give advices about PHP project organisation (structure
of files, directories, names). Shall I organize hierachically and how
(a main directory, a directory for php files, for html files ...)? How
to use "base" request in HTML under PHP and that sort of things.

View 1 Replies View Related

Can't Save Project Files In Htdocs Folder?

Sep 21, 2010

I used the Netbeans, and I tried to save my files in the folder 'htdocs' of apache server. However, it seems that the permission needs to be changed for that folder or something because I could not be able to save them there. Could you tell me what sould I do?

View 5 Replies View Related

Filter The Files And Project View In Netbeans?

Oct 19, 2010

Use Netbeans for PHP development, get in Netbeans a selection from a list of files quickly.Suppose there are different folders for MVC pattern and edit 1 section of it.The 3 files that I work with only now.Want to get files from all folders that ends in:"_suffix.php".

View 1 Replies View Related

Dynamically Controll Paths In Static CSS Files With MVC Code Igniter Project?

Jul 8, 2011

I'm creating a website/codeigniter-project that uses views which link to external CSS files.Everywhere throughout my project/web-page's views I can control the url paths of images, links, etc by constructing them from the 'base_url' setting variable. I don't have any control over static, linked external css files. This means that whenever my base url path changes for my site I have to go through my css files and do global search/replaces to update all my paths.

To solve this I thought about creating a controller just to load css/javascript files and treating the actual files like views with hooks but I was talked out of this by @Wesley Murch in this question: Using a controller to handle returning customized css & javascript files with codeigniterHow can I dynamically assign base-paths to my css assets so I don't have to do global search and replaces every time I update the base path of my site?

View 1 Replies View Related

Get E Text Editor To Upload Local Copy Of Project Files To Server?

Jul 11, 2009

I have a project saved locally on my computer, that replicates a folder saved on my server. When I use my php IDE (PhpEd) and save a change to the locally saved file, it automatically updates the respective file on my server. Can I customize E Text Editor to do this also? It would save lots of time!

View 1 Replies View Related

Unused Variables

Mar 1, 2007

I was wondering: is there a way in PHP to get some messages from the VM if a code includes unused or wrongly named variables? I find it helpful in finding coding mistakes when using other programming language.

View 3 Replies View Related

Encryption - File Verification System Project Or Licence Checking The Configuration Files?

Dec 28, 2010

My colleague asked me a question like "license check to config file".

when i searched i got this

(URL)

and in the result i got this (URL) but could not grasp much of its idea.

Here is my thoughts...

Our project is written in codeigniter. The project owner is providing it to their customer. The owner is a business partner with that concept. Besides, the owner needs control of the project code so that the customer will not break rules with him like changing the code or moving it go another server or validity.

So the owner needs a system to enable disable the site. Let me give an example...

(URL) will have an admin panel where he can either disable or enable the (URL)

when he disables the client.com should display a custom message instead of loading the files.

(URL) is written i a way that i will process requests from (URL) and also the other way round.

so, here i want a list of the concepts with which we can implement the ownership and control over (URL)

any suggestions, links, references, answers will be helpful.

If i am missing something in my question i will update my question according to your comments if any so that the users can give in their idea without confusing of what i had asked.

View 3 Replies View Related

Keeping Track Of File Dependencies Across Multiple Files In A Medium-size Project?

Apr 1, 2010

My PHP code is split between many files, and often I find myself using code like this this:

require_once( "$preIP/functions.php" );

The problem is that I have to keep using this a lot, and sometimes these statements are becoming redundant.What kind of system do yo use/would recommend for keeping track of all the inter-dependencies in all the PHP files?

View 2 Replies View Related

Finding Unused Variables

Oct 11, 2005

Is there a PHP script that can find unused variables? I'd like to
'clean up' my scripts.

View 7 Replies View Related

Finding Unused Ids Using Query?

Feb 12, 2009

I am having one column which contains unique ids and if user deletes that id then that id is removed. Now what I want is that if I provide a range to a query then it should give me that ids that i have deleted. For example I am having 10 records in table & I want 5 records from it and if record number 4 is deleted then it should give me output as 4. How can I do this using single query?

View 14 Replies View Related

Is Loading Unused Constants A Bad Thing?

Oct 23, 2006

I'm creating a language system for my script, and I was wondering:

When I look at large scripts like PHP-Nuke, or phpBB, I see that they're calling a file with 100's, if not thousands of lang constants in it, to load a page that may only use 20 of the definitions.

Does the script only load the definitions it needs? Is there any ill impact at all when loading a page that large just to use a couple of them?

I'm considering using separate lang files(like I've seen in Zen-Cart) so the lang file being loaded is smaller. My script is pretty tiny to begin with, but I'm trying to do these things to learn how to code smart.

View 5 Replies View Related

Important Is To Not Load Unused Scripts?

Nov 16, 2008

On a site where 90% of the pages use the same libraries, should you just load the libraries all the time or only load them when needed? The other pages would be ajax or simple pages that don't have any real functionality. Also, should you only load the code when needed? If part way down a page you need a library, should you load it then or just load it at the top. Maybe it's possible it may never get there before of an error or wrong data. (Loading at the top makes it somewhat easier to understand, but may result in extra code not needed.)

I'm also wondering if I should make the libraries more specific so I'm not say loading the code to edit at the same time as viewing? Basically, how much should I worry about loading code or not loading code?

View 4 Replies View Related

Eclipse - Identifying Unused Variables?

Jul 14, 2010

I have seen the bellow question and was wondering if there is something like it for eclipse.

Also how can I make sure that this kind of errors get's thrown into my trigger error function so that I can write it to a log.

[URL]

View 4 Replies View Related

Avoid Loading Unused Classes For A Non-oo App?

Aug 17, 2010

My application uses a 'central' page controller that grabs a bunch of files (I hesitate to say libraries) each containing a few related classes, using require_once, before fetching the request. As in:

require_once (dir_lib . 'db.php');
require_once (dir_lib . 'uuid.php');
require_once (dir_lib . 'data.php');
require_once (dir_lib . 'token.php');
require_once (dir_lib . 'logs.php');
require_once (dir_lib . 'time.php');
etc...

I haven't bothered to check memory usage until recently installing the (awesome, but gigantic) 'HTML Purifier' library and glancing at its autoloader. Apparently, autoloader on not, each script instance now weighs in at a whopping (sweet jesus!) 5376 kilobytes memory usage. (I have no idea what the built-in autoloader is for if that's the end result, but I digress) Without the HTML Purifier, most instances still weight in at over a megabyte.

Reading about the PHP autoload functions I'm getting the impression that the autoloader is meant strictly for OOP. With the exception of the purifier library, I'm using very little object-oriented code. Am I just misunderstanding the concept? Is there any other practical way to avoid blindly loading a bunch of classes that may not be needed for each request? Am I just being lazy for trying to include them all up-front?

Repeating this comment up up here to clarify what I meant by non-oo, if that makes much difference:

I am basically using classes in lieu of namespaces without using (hardly) any actual OOP. That is to say, the "DBFunctions" class may contain, for example, the functions "execute" and "getRow". The functions are invoked with a static method call such as "dbFunctions::execute($sql)."

View 3 Replies View Related

Converting A Frozen Production Symfony Project Back To Development Project?

Jul 9, 2009

converting a production version of a symfony project which is in frozen state back to a development state so I can work on the project locally. I need to do this because I'm having to download the latest working copy from the server down onto my personal macbook so that I can work on some files over this evening and the SVN is currently not to the latest revision and I don't have the latest copy on here!

View 1 Replies View Related

Purging Unused Keys From A MyIsam Table.....

Aug 24, 2005

somewhere, somehow, my host decided to remove INNODB tables from the list of allowed table types and this has given me some problems. In order to reclaim unused keys I used to do a simple 'ALTER TABLE $table TYPE=INNODB'

and I would be able to re-use purged keys. Somehow, this wont work. Well, the query succeeds apperently, but the deleted keys still exist and the next autoindex is way to high.

A OPTIME query doesnt work either. #*$! am I doing wrong, or what can I do to fix this?

View 1 Replies View Related

Delete Unused And Unneeded Images From A Folder?

Apr 2, 2005

i need to know if there is by a way by any chance to delete unused images from my virtual directory or wwwroot folder dunamically on the user request using php ?

View 7 Replies View Related

Delete Drupal's Unused Core Modules Correctly?

May 3, 2010

I want to delete the unused drupal modules like ( blog, Forum, taxonomy ...) but I'm worried if I delete the modules from the modules directory I might cause an error (now or in the future) .is it safe? and if I deleted the corresponding tables what will happen?the reason for this is because I want to deliver the site to my client, and teach him how to use the admin page, but I want to make as easy as possible for him..

View 4 Replies View Related

Change Project Resource Location In A Project?

Jan 12, 2011

I use Eclipse PDT and have setup some PHP projects. The resources for one project had to be moved into a different folder. Can I change the resource location without deleting the project an setting up a new one?

Via "Projects -> Properties" I can only see the location path, but I can't change it.

View 3 Replies View Related

Remove Files From Bazaar?

Apr 15, 2010

I'm using Bazaar (bzr) to keep source code for a website updated, but we've ran into a problem when we remove files from version control. The files we are removing are ones we never intended to version to begin with.When this happens we use bzr rm --keep to remove the file from version control, but keep the file in the file system. Doing a bzr push or bzr pull results in the removed file(s) being removed on the other branches (other sites that use our code)We need a way to make sure that a bzr push or bzr pull doesn't actually remove those from the working copy.

View 1 Replies View Related

Remove Files That End With %enlarged.jpg

Sep 26, 2007

I'm trying to modify this script to remove files that end with %enlarged.jpg or %enlarged.gif or %enlarged.png, can someone help with the if statement, I've tried several things, of which, nothing is working: Code:

View 2 Replies View Related

How To Remove Files From Previous Php Install

Jun 5, 2003

Anyone know an easy way to get rid of all the php installed files left behind from an install gone bad? I'm looking to try an install with a php version I used before, but don't want any mix ups with this newer (crappier) version's leftovers.

View 6 Replies View Related

How To Add My Codeigniter Project To A New Project In Eclipse?

Oct 8, 2010

I am new to using eclipse for php and am struglling with something that should be very simple.

I use codeigniter - how can i add my codeigniter project to a new project in eclipse?

View 2 Replies View Related

Antivirus - Remove Iframe Virus From All Of Files On Website?

May 9, 2010

I have a problem about removing a virus code from my php files. There is more then 1200 php file in my server and every single php file has been infected by an virus. Virus code adding this line to html output

<script src="[URL]

This is the code of virus

[CODE....]

Above code in every single php file. How can i remove this virus code from every php file? Is there a quick way for doing it?

View 6 Replies View Related

Remove Directory Tree Along With Its Children Directories And Files?

Sep 11, 2009

I need to delete a directory along with its children directories and files. The following has always worked for me in the past. Recently, I used it with a directory which had a child directory named _thumbs, and I received the following error: Quote: Warning: rmdir(C:Program FilesApache Software

FoundationApache2.2wwwimages\_thumbs) [function.rmdir]: Permission denied in C:Program FilesApache Software FoundationApache2.2applicationclasseslibrary.php on line 396

I believe it has something to do with the underscore.

PHP Code:

staticpublicfunctiondeltree($dirname)
{
//Deletesdirectoryandallsubdirectoriesandfiles[code].....

View 2 Replies View Related

Capistrano: Remove Symlink 'current' And Rather Use: {deploy_to} For Accessing The Deployed Files?

Mar 9, 2011

I am using Capistrano to deploy my PHP applications. Now, I notice a strange thing here (or maybe this is something I do not understand).
Capistrano deploys application to releases folder and then, symlinks current to point to latest release. Now, when I access these files, I have to access them like this: [URL] Is there a way, I can tell capistrano (or make it work) so that I can rather use: [URL] to access these deployed files?

View 1 Replies View Related

Kohana - Remove Image Files From Server Uploaded/inserted By Fckeditor?

Sep 1, 2010

how to use php or Ko3 remove image files from server uploaded/inserted by HTML EDITER,such as fckeditor?is there any PHP class work for this?

View 1 Replies View Related

Netbeans - Difference Between "Source Files" And "Include Path" In Project?

Sep 16, 2010

what is the difference between "Source files" and "Include path" in php project.

View 1 Replies View Related

How Can I Remove Session Files In The "tmp" Directory?

Mar 18, 2003

How Can I Remove Session Files In The "tmp" Directory?

I have just started working with "sessions." A Unix server stores a temporary file in a "tmp" directory. The temporary files include a string of numbers for the sessions variable.

I need to devise a way to remove the temporary sessions files from the "tmp" directory on the server. If you would, please respond and indicate:

1). What is the best way to remove the sessions files from the "tmp" directory? or 2). What is the best way to handle the sessions files in the "tmp" directory?

View 3 Replies View Related

Jquery Remove Function / Remove The Support Button, And Fade In The Msg?

Oct 24, 2010

i have a problem with this jquery, in the success function call, its mean to remove the `support' button, and fade in the msg, this is my jquery code:

$('.stats').delegate('.against', 'click', function(e) {
//stop event
e.preventDefault();
// cache a reference to the previous <li> element
// since it is used more than once
code....

this jquery is meant to remove the support button, when clicked and the new score is meant to fade in!

View 2 Replies View Related

Use JQuery:remove() To Delete / Remove Form Elements Off Page

Mar 15, 2010

I'm trying to remove a form element generated through Ajax calls, but when I submit the form and var_dump the POST request, I can still see the form field key=>value. I need to be able to completely remove the field through jQuery in order to validate correctly.

View 2 Replies View Related

Remove Html Special Characters Remove Not Working?

Mar 14, 2011

I have a string examples’s and I am trying to remove ’ or replace with its HTML code but this code is not working for me:

html_entity_decode(htmlentities("examples’s"))

Output shows this examples� in browser.

View 4 Replies View Related

Remove Wrapping Array (remove Parent, Keep Children)?

Sep 3, 2009

I have a problem, i'd like to remove the containing array (key 80) but keep its children (with all the keys and structure unchanged, apart from the parent).

Array
(
[80] => Array
[code]....

View 2 Replies View Related

PHP Scripts Which Write And Remove Files Over "EMPTY" Folders And Only Accessed By These PHP Scripts.

Jan 30, 2006

I have programmed several PHP scripts which write and remove files over "EMPTY" folders and only accessed by these PHP scripts. I would like to know what is more secure:

1.- To enable permissions of these folders with chown nobody/nobody (how is running my PHP) and chmod 644 or .

2.- To enable permissions of these folders with chmod 777 and chown user_name/group_name (namely the default UID and GID of my site).

View 2 Replies View Related

Get All Files On Server Side / Specify File Input Name In Files Array Files['fileInputName']?

Sep 10, 2010

I am using uploadify plugin of jquery and have set multiple files upload to true. How do i retrieve these files on the server side?

We need to specify file input name in files array $_FILES['fileInputName']. But i have only 1 file input present on the form which is submitting multiple files. How do i retrieve them all?

View 2 Replies View Related

PHP/CRM Project

Jul 17, 2005

I'm embarking on a php crm project for my company. I've done a fair bit of
php programming.

I'm asking for advise on how to approach this. I want to do this project as
something I can sell afterwards.

Bascially I want to develop modules that talk to each other.

so index.php?module=whatever?action=whatever

Also I want to make an addon class so making an addon to this is rather
easy.

My main problem is, how do you make each module talk to each other. How do I
know what functions the clients module has?

How can I insert info into the client module from an addon class (on the
html page).

IE: I write the client module. Then someone writes a module that adds
pictures to clients. How can that clients module dislplay the picture
without knowledge of the addon class that the other person has made?

Make I make an array which passes the html from module to module and it
inserts it in?

View 2 Replies View Related

ADVERTISEMENT