I have a Problem with PHP and SVN. See here...
Using FUSE would be one option, but after a first look, it seems very complicated.
Is there any option to prevent an NTFS filesystem, WIN2003Server, to hide directories completely from a useraccount (I can setup apache to run under this account).
It is not as easy as it seems, given the following restrictions:
It must be a pattern match, I do not know in advance which SVN folders will be created
I cant deny the access to the whole parent folder, the .SVN and the content lay side by side
Simply hiding does not work, PHP does not care for hidden flag
Any ideas (or comments)?
I'm afraid the answer is no: Permissions in NTSF do not allow hiding of folders.
Here is a list of all permissions you can grant/revoke in NTFS:
Full Control (includes everything from below)
Traverse Folder
List Folder
Read Attributes
Read Extended Attributes
Create Files
Create Folders
Write Attributes
Write Extended Attributes
Delete
Read Permissions
Change Permissions
Take Ownership
Ignoring single files/directories is what the hidden attribute is for. If the program (typo3, right?) ignores the flag, your best bet is to see if you can configure it to
handle it. (But that would be a new question on SO).
Related
I use symbolic links in my web project. There is a source folder and an additional folder for an email task which is executed by a service.
Both the website and the task are written in PHP and use my util.php, sql_functions.php and config.php files.
Rather than hardcoding the locations of these three files, I created symbolic links to these three utility files and some directories so that they are available from each of my subdirectories. The code works.
I also created a batch file which automatically creates these links and documented the installation procedure.
Below you can find a screenshot of the folder that contains my email task. sql_functions.php loads the configuration data and is being used by email.php to access the SQL Server. The symlink to the sql folder also helps.
All of these folders are in the same repository, so there is no real risk that any dependencies might not be loaded.
It just feels like dirty programming.
Although symbolic links by themselves shouldn't be harmful to the understanding and maintaining of the codebase, your case in kind of brutal. Puting a symlink in everyone of your files looks like overkill there. There are more options than just choosing betwen hardcodes paths and such a violent solution.
For example, you could set the path of these files in a constant that is loaded at the begining of each files through a require(), or many others solutions. In the end, it depends on the way your website works, but I doubt your solution is the most flexible you could come up with.
I find it difficult to form my question properly, so apologies in advance.
I'm currently building a small web app where users can sign up, log in and upload pictures. These pictures are stored in different directories. I want to be able to lock these directories, so people cannot simply view the entire directory (because it features a picture contest and submissions should remain secret). But I also want the contents to be viewable. I intend to create long filenames within the directory automatically to keep them "safe".
Any thoughts?
Thanks in advance,
Lenny
To disable directory browsing of your files, the simplest way is to add a line to an .htaccess file (if you're using Apache) in a common directory:
Options -Indexes
Source
Alternatively you can add this also to a <Directory> or <Location> section of a vhost entry, but would apply to the entire vhost rather than just a given directory tree.
I am brand new at sub-versioning, so please bear with me.
I use CollabNet's Subversion Edge to manage a repository for a PHP/ActionScript based project I am building in the Eclipse IDE. In my project's root folder, Eclipse included several configuration files that aren't directly related to the project. How can I set up my repository to ignore these files/folders via CollabNet? Would it be through the "Repository Access Rules"?
Thank you for your time.
The "Chapter 3. Advanced Topics 'Ignoring Unversioned Items'" seems appropriate for your setup:
Extract:
[...] But these not-to-be-versioned files and directories can cause some annoyance for Subversion users.
For example, because the svn add and svn import commands act recursively by default, and don't know which files in a given tree you do and don't wish to version, it's easy to accidentally add stuff to version control that you didn't mean to.
And because svn status reports, by default, every item of interest in a working copy–including unversioned files and directories–its output can get quite noisy where many of these things exist.
So Subversion provides two ways for telling it which files you would prefer that it simply disregard.
One of the ways involves the use of Subversion's runtime configuration system (see the section called “Runtime Configuration Area”), and therefore applies to all the Subversion operations which make use of that runtime configuration, generally those performed on a particular computer, or by a particular user of a computer.
The other way makes use of Subversion's directory property support, is more tightly bound to the versioned tree itself, and therefore affects everyone who has a working copy of that tree. Both of the mechanisms use file patterns.
The Subversion runtime configuration system provides an option, global-ignores, whose value is a whitespace-delimited collection of file patterns (also known as globs).
The Subversion client checks these patterns against the names of the files which are candidates for addition to version control, as well as to unversioned files which the svn status command notices.
If any file's name matches one of the patterns, Subversion will basically act as if the file didn't exist at all.
This is really useful for the kinds of files that you almost never want to version, such as editor backup files like Emacs' *~ and .*~ files
I am creating a custom magento module and cant decide the best place to store some config files i require with the module?
Anyone out there suggest the best place for this? Should it be in the root of the module or in with the helpers maybe?
Edit:
Along the same lines as this question: is it acceptable to have a folder in the root of the namespace for the modules for includes that will be shared amongst the modules?
If these files are for configuration, they belong in etc. Think of the etc folder the same way you would a unix/linux/bsd system's etc folder. It's where you put configuration information. Convention is that you should use an XML file to hold your config data, and then load it with
Mage::getConfig()->loadModulesConfiguration('your-xml-name-here.xml')
When you use the loadModulesConfiguration method to load your configuration values, Magento combines XML files for ALL modules in the system into one big tree. This allows other modules you'll write (or others would write) to share the configuration information.
You don't need to do this, but etc is definitely the defined place for any configuration files you want to include with your module. Also, whatever method you're choosing, I'd pick a unique file name (packagename_modulename.xml, packagename_modulename.inc, etc.) to ensure against the slim possibility that someone at Magento might pick your name to use in a future version.
Along the same lines as this question: is it acceptable to have a folder in the root of the namespace for the modules for includes that will be shared amongst the modules?
No, that would not be acceptable. If you want a shared configuration, use the method I mentioned above. If modules need to share other information with each other, they should either do so directly (one module instantiates another module's model) or you should define a central "broker" module that handles all inter-module communication. If you're interested more in the topic, I'd recommend the first few chapters of Meyer's Object-oriented Software Construction. If you can get past the whole "how to implement low level data structures" aspected of old programming books, its a great introduction to what CS people when they say "module".
(it's also worth mentioning that if there are simple configuration values, learning how to use the Magento System Config Admin section is worth it.)
You could probably get away with this, but you're purposely avoiding Magento to do so. Inside a module, make a directory called etc and put an XML config file in it called config.xml. That file will be read and included in the Magento configuration, which means you won't have to try to escape the framework to grab your configuration data. Take a look at the existing files for some examples.
The other benefit to this approach is that the conversion from config XML files to user configuration options (in the admin panel) isn't too difficult (requires minor refactoring), so you can later change your configuration method with ease.
Hope that helps!
Thanks,
Joe
I run multiple websites all running off of a single installation of CodeIgniter on my server (separate application directories and a single system directory). This has been working fabulously and I don't see any reason to change it at this point.
I find myself writing library classes to extend/override CI all of the time and many times if I find a bug or improve effeciency I have to go back to several websites to make the same adjustments at risk of a typo that breaks one of the websites. Because of this it requires that I change each file and then test that site for bugs.
I have been pondering a solution of using a single libraries directory in a central location and symlinking all of my websites to that central directory. Then when I make a file change it will immediately propagate to all of the downstream websites. It will still require that I test each one for errors, but I won't have to make the changes multiple times. Anything that is specific to a single website will either be a non-shared file (still in the linked directory just not used elsewhere) or can be put in a local helper.
Also, I keep separate 'system' directories by CI version so I can migrate my websites independently if necessary--this central libraries file would be attached to a specific version to reduce possible breaks.
Does anyone see potential issues or pitfalls from taking this approach? Has anyone accomplished this in another direction that I should consider?
Thanks in advance!
I think this actually makes sense :] Go for it. Even on official CodeIgniter page, they mention it's possible.
Also, I don't see one reason why there should be any problem.
Edit: they touch the problem of multiple sites here: http://codeigniter.com/user_guide/general/managing_apps.html
also:
http://codeigniter.com/wiki/Multiple_Applications/
http://www.exclusivetutorials.com/setting-multiple-websites-in-codeigniter-installation/
How to Handle Multiple Projects in CodeIgniter?
http://codeigniter.com/forums/viewthread/56436/
I have a single system directory and separate application directories for my CI apps. In order to share libraries and some view templates between my apps, I have created a "Common" directory, in the same folder as the CI system and with the same structure as a regular app folder and used symlinks, but you can modify the Loader class so that it looks in the Common folder too. My setup looks something like this:
/var/CodeIgniter/
/var/Common/
/var/Common/config/
/var/Common/controllers/
...
/var/Common/libraries/
...
/var/www/someapp/
/var/www/someotherapp/
...
I'm not sure how you handle publishing your sites (assuming you actually do any of that), but I'd look into version control. For example, in SVN you can make external to another svn directory (or file) and then just update the current svn directory which grabs the external file. This approach gains one benefit from the others, which is when you modify the common library, the others aren't immediately affected. This prevents unwanted breaks before you have time to go test all the sites using the common library. You can then just update each site's folder whenever you are ready to test the changes. This is "more work", but it prevents code duplication AND unwanted breaks.
I wrote a MY_Loader to do exactly that.
http://ellislab.com/forums/viewthread/136321/