I have a CMS project that I reuse in several sites.
Is it possible to add this project as Library for other PHP projects?
For development, I have the files of my CMS included in one site and not in the others. Then, from that only copy I upload the files through every site. I want to improve this.
I read Configuring a Project's PHP Build Path and Configuring a Project's PHP Include Path. However, I don't see how the project' files will be included in the site if I test it locally.
I use WampServer to test my sites, but all the files need to be in the site folder in order to run. So, how can I develop the CMS in one Project and avoid having the CMS files duplicate through all my sites?
I don't know if I was clear. Lets asume I have WordPress as a project and I'm developing multiple WordPress sites. How can I include the WordPress project in the sites and test them locally?
Related
I just inherited an application that is Magento with an Angular frontend. The Angular code is wholly contained within a single subdirectory of the Magento application. I can set up a PHP project in NetBeans and I get PHP autocomplete and other goodies, but no love for the Angular .js files. The goal is to have both PHP development goodies and angular development goodies. All the code is in one git repo (else this would not be an issue, I could just have two separate directory trees).
NetBeans will not let you create a project within a project. I've tried stitching the codebases together with a symlink both directions, and either git doesn't like it (refusing to treat the symlink as a directory), or NetBeans doesn't like it (still seeing the Angular files as residing with the already existent PHP project).
Anybody have any ideas? Changing the repo structure (like using a git submodule) is not an option currently.
You cannot make "a project inside a project", that is correct. :)
In your project, check if in Remote Files (next to Source Files in the Projects tab) you have the necessary JS files. If not, you have to link to them in your project.
Also what version of Netbeans are you using? It should work in the latest ones (8.1 and up) but may not work in earlier (8.0 and below).
I am wanting to locally develop a suite of WordPress plugins and widgets. My development environment consists of Windows v8.1, Netbeans v8.0.2 and XAMPP v5.6.3.
I've configured Netbeans and PHP to use XDebug. I've spent the entire weekend watching and reading various tutorials on setting up Netbeans IDE for developing a WordPress plugins/widgets.
Everything seems to be working at this point - I've been able to create new Netbeans projects by opening existing/installed plugins of my WordPress install. I am able to set breakpoints and trace through code. All seems to be working well, but I am puzzled regarding the 'proper' way to setup a new project.
Should a plugin/widget project somehow include the WordPress core files starting at .\htdocs, or should the root of the project be .\htdocs\wp-content\plugins\myplugin? In other words, should I be able to see .\wp-admin and .\wp-includes in my project tree?
My thinking is that Netbeans needs to somehow be able to read the core WordPress files to provide function reference during development of the plugin/widget and this would require including the WordPress core in my project, somehow.
Maybe my question is best asked this way:
What should the root project folder be set to for developing/debugging a plugin named MyPlugin?
and/or:
How are WordPress core files included/referenced in the MyPlugin project?
Anyone have a good step-by-step reference that would enlighten me on this?
I'm searching for this too, but here's how I set it up. I'm developing a theme (plugin would be analogous) so I have the theme source and NetBeans project files in a separate folder outside of WordPress folder, and outside of the xampp/htdocs actually. Then, I set the root of my PHP project to this theme source folder, and then using the Project Properties -> Include Path facility to allow NetBeans to include the WordPress folder, it will appear under Include Path in Project Explorer, enabling 'IntelliSense' etc. This way you can start a new NetBeans project per plugin/theme, basically, just including the WordPress core in each. Furthermore, I have NetBeans set up to copy the source files to the xampp\htdocs\mysite2\wp-content\themes\ folder on save and project load (set up in preferences). Here's a pic: NetBeans WordPress Setup
The best way I've found so far is to use a hardlink.
If I keep the files in Netbeans' project directory everything works. But Wordpress sometimes does not recognize that the theme is there. I.e. in some wp-admin menu's. But I'm able to display a Theme just fine.
I create the project as a php project in Netbeans.
Then link my (pubic html) folder from the Netbeans directory.
mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder
Use " quotes if your path has spaces
I use:
mklink /J "C:\xampp\htdocs\wptheme\wp-content\themes\themename"
"C:\Users\Probook 1\Documents\NetBeansProjects\projectname\public_html"
Then I setup the netbeans project to load an external page when I run the project. (See File => Project Properties=>Run Configuration)
I'll be looking into doing the same with plugins soon. Practically I can't see a reason this won't work for plugins too.
I want to try and see if Netbeans copes with the hardlink better than Apache does. (I.e. if I setup the project first then move the files to Xampp and create a hardlink in Netbeans' project directory. I.e. Projectname\public_html
(If anyone does it first let me know how it goes)
It's more important to me that Netbeans can backup and function. As long as I can display what I'm developing realtime.
AFAIK Netbeans can intergrate with Xampp to run it's debugging (Xdebug)
I have a web hosting which hold a website I run.
I'm learning CodeIgniter so I would like to upload it a file in that web hosting and run some test and learn, CodeIgniter just for test, and keep using the website normally for users.
Is there any related or known issues or problem by running both ? I don't want the website to get frozen or act weird wit this.
Install codeigniter in it's own folder in a subdirectory instead of in the web root directory.
You will have to modify your config:
Installing a CodeIgniter application in a subfolder
Create a New Folder for your CodeIgniter Learning and Upload all CI files there including System folder and other.
If you Upload the the files with current website files folder it may create some issue.
I have a PHP project in Aptana which files I want to share with others projects. I can do this by properties project -> resources -> linked resources. But I want to deploy on the server this project in all the projects that share this.
For example: Project 1) CMS library (/cms), Project 1 Web Site (w/eb1), Project 2 another web site (/web2).
On the server I need: web/cms and web2/cms without need to copy manually cms folder into web1 and web2.
It's that possible?
Yes. If you using linux then just make links to your needed folders.
If you using windows try making shortcuts to that folder. I think that should work.
EDIT:
This will help you: Windows XP vs Vista: NTFS Junction points
Basically I've got various projects all version controlled using subversion. This is for many reasons: backup of files in case of bugs/issues in the future; backup of files in case of local system failure etc; collaboration from others in the company; etc..
One of the systems we work with is Wordpress which does updates and installs plugins through its administration panel and such, plus on installing it the system creates various files (including a wp-config.php file and a .htaccess file). This means that on install there are files on the server integral to the running of the system which aren't on the local systems and aren't in svn. Plus any installed plugins and updates aren't mirrored in version control or the local copy.
Plus it feels wrong (specifically when you compare with data normalisation in databases and such) to be working with two copies of the same code - one in version control and one on the server.
So my question is am I using the tools in the right way? Is there any way that the public_html folder from the server can "point" to the latest version in the repo? Or can SVN be configured to read from the public_html folder and automatically add+commit any files created/edited on the server?
Or do people just literally download anything that gets changed/created and add them to SVN manually? Or do people not care? Maybe I've misinterpreted what SVN is for? I'm using it for backup effectively.
Thanks
Tom
I only have versioned my own wordpress theme. All the other stuff including the data is live on the server and solely backuped from there.
The code of wordpress and the plugins used are developed elsewhere, they have their own repositories, and i do not mess mine with code I never will touch.
The question is how to deal with configurations. I am currently running a wiki where I document all the plugins installed live and what configuration properties I have set up.
A sync of live to local then goes like this:
Update wordpress version and plugins to the versions written in the wiki
Setting all configuration options as written in the wiki.
Importing the data base (except wp_options). Converting the static URL of wp_content files to the local scheme.
Syncronisation of the wp_content directory
In many cases your hosting provides regular backup. But is you use VPS you have more freedom to do whatever you want. I have made my public_html folder under version control and created a small script to commit every night. So I can have a complete version history of my site with changes traced. You can also create a script just to copy this folder elsewhere. There may be other better solutions for enterprises, but this may be enough for small project.