Git: problems creating a repository - wordpress

I'm attempting to incorporate a WordPress website into Git.
I've created a local repository through GitHub for Mac, and I've edited the "Primary remote repository" to the HTTPS URL under the Settings tab, after which I've then applied some ignore patterns.
So far this has worked.
However, when I look at the items under the Changes tab, I'm seeing entries for the ".gitignore" file and everything in the "wp-content" folder but nothing above it.
I don't think it's the ignore patterns because some of the default WordPress templates are in there, and a load of OS items, each of which have been ignored, but I understand the ignore patterns won't be applied until after a commit.
At the bottom of the list of entries to commit, the path is correct and not within the "wp-content" folder.
So why are things like "wp-admin" and "wp-config.php" — or any other root item — missing?
Is there a maximum length to the number of items GitHub for Mac can show, but if so, why show "wp-content" when other items precede it in alphabetical order?
I'm a bit confused as to what's happening. At this point, nothing has been committed, and I'm hesitant to do so if part of the website is missing.

This is the section that's causing it:
#===================================#
# WP Core, except content #
#===================================#
/*
!.gitignore
!wp-content/
# !media/
!favicon.ico
!favicon.png
!robots.txt
!humans.txt
Notice the leading /*. This means that it's ignoring EVERYTHING by default. From the documentation:
A leading slash matches the beginning of the pathname.
The wildcard * then tells it to match everything in that path.
The exclamation point ! then refers to items which explicitly should NOT be ignored.

Related

Translation files of my plugin are not being loaded or work incorrect

I need to translate some parts of text to French.
Things I've tried so far:
I created fr.po and fr.mo files in my plugin's /languages directory. I used Poedit for this purpose. I've tried different variants like fr_FR - didn't help.
I added the following to my plugin's main file along with its name and other information:
* Text Domain: pluginname
* Domain Path: /languages
Plugin name does not contain any special characters or underscores/dashes - it's a single word.
Also, tried to use load_plugin_textdomain() function instead (or even along with) to make this work.
Also, tried to add this to my wp-config.php file:
define ('WPLANG', 'fr_FR');
Tried to use any combinations of described actions as well.
I have a string to be translated:
__('Recently', 'pluginname')
The word "Recently" is being displayed correctly but it is not being translated if I change site language. I tried both changing in WP admin panel and adding into config file (mentioned above)
I tried to use get_locale() to check if this was actually changed. This returns 'fr_FR' which is exactly the same with my .po/.mo file names.
**P.S.: ** Checked all these questions and tried all suggested solutions - didn't help:
Wordpress - Plugin translation not working
WordPress plugin translation issue
Wordpress plugins translation
Update: load_plugin_textdomain() returns false if I try to var_dump() result right after function execution.
Actually, the problem was in the names of files. Other than locale name it should also consist of the plugin name, e.g. pluginname-fr_FR.po/pluginname-fr_FR.mo for my case. Yes, this is described in the codex, I should read this more attentively :)

What is proper syntax for wildcard driven filter rules file for rsync?

I am trying to use a filter rules file that uses wildcards for include/exclude lines to drive what gets included and excluded for running rsync to backup a server.
I am using the command line like:
rsync -avzh --filter="merge rsync_backup_filter" / user#backupserver:/backup-data
where rsync_backup_filter is currently something like
+ /var
+ /var/www
+ /var/www/webapp1/***
+ /var/www/webapp2/***
- /var/www/*/repo
+ /home/***
+ /etc/***
- *
but that filter rule syntax above is not quite right because the results don't actually match what I am intending. The repo sub folder is not excluded as I am trying to achieve.
I want to be able to use something like the last entry to say exclude anything not explicitly (using wildcards) included in the rules above
I want to be able to include certain paths (in the example above including webapp paths) and indicate that all files and folders below that point should be included but also be able to add exclusions within that previous wildcard (in the example above I want to exclude the repo subdir in any webapp path, so essentially saying "all except" in certain paths
Above is just a snippet and the longer version of the file would be a full backup strategy for the server from the root on
What is correct way to do structure the filter rules file and proper way to use wildcards to achieve what I've described?
Filter rules constitute an ordered set and evaluation continues until the first match occurs. So, all repo folders will be excluded, if you move the exclude rule up - at least to line #3.

changing file names, how to?

I've created some forms following this approach:
iron g:template cars/create_car
and the following files were created:
create_car.css
create_car.html
create_car.js
Easy question - if I want to change the name of the files where else do I have to update to keep my changes in sync with the rest of the application?
Thank you!
Mark
You won't be out of sync by changing file's name.
The only things which would change is the file load order, according to the documentation:
HTML template files are always loaded before everything else.
Files beginning with main. are loaded last
Files inside any lib/ directory are loaded next
Files with deeper paths are loaded next
Files are then loaded in alphabetical order of the entire path
On your case It's wouldn't probably cause any issue, feel free to test.

Crucible tried to anchor your patch, but there was conflicting content

I'm trying to use Crucible with CVS for precommit review. When I upload the patch, it says
Crucible tried to anchor your patch, but there was conflicting content
Apparently this is a common problem. hits in jira.
All my files have keyword tag $Log: NameOfTheFile.java,v $ and this seems to be the culprit. If I remove the tag and commit, the problem goes away -- I can upload precommit patches to Crucible. However I do not want to remove all the keyword tags from my files.
Is there any other work-around? One page says I can manually edit the diff. How??
The problem is that CVS expands the keyword during checkout. Therefore the copy of the file in CVS has the unexpanded tag, but the copy on your PC has the expanded tag. This is what causes the anchor to fail. In the case of $Log$ the expansion adds three lines after the tag. To make the anchor work you have to edit the patch such that those three lines disappear. You have two options
generate the patch with all lines, cvs diff -u100000, and then edit the patch to remove the three lines after the $Log$, or
generate the patch with limited context, cvs diff -u, and then edit the patch to subtract 3 from all the "##" lines. For instance if the patch contains "## -116,63 +109,50 ##" you will need to change it to "## -113,63 +106,50 ##"
This is related to the off by one bug when you look at the log in the CVS file.

Why can't Xcode 4 find my .h files during a build?

I have a project that won't build because the compiler (?) can't seem to find the .h files. I have tried using the full path, relative path and setting the Project Search Paths (both Header and User Header) and nothing seems to work. What I find very strange is even with the full path it gives an error: No such file or directory (the file does indeed exist in the specified path).
What could be the problem?
import statements:
#import <Foundation/Foundation.h>
#import <zxing/common/Counted.h>
#import <zxing/Result.h>
#import <zxing/BinaryBitmap.h>
#import <zxing/Reader.h>
#import <zxing/ResultPointCallback.h>
Headers are located in:
/Users/rolfmarsh/iPhoneCodeLibrary/BarcodeLibrary/zxing-1.6/cpp/core/src/zxing
Header search path is:
$(inherited)
"$(SRCROOT)/zxing/common"
and
/Users/rolfmarsh/iPhoneCodeLibrary/BarcodeLibrary/zxing-1.6/cpp/core/src
Full path of the include files:
/Users/rolfmarsh/iPhoneCodeLibrary/BarcodeLibrary/zxing-1.6/cpp/core/src/zxing/Result.h
I also had quite a bit of pain with ZXing's dependencies. Here's some tips that will hopefully be of assistance to others with similar issues.
This line does an import:
#import <zxing/common/Counted.h>
For the compiler to find Counted.h, the header search path must be specified.
Now, because the import statement will look for Counted.h relative to two subfolders zxing/common, we need to give it the parent folder of zxing.
In this case, the parent folder is going to be something like:
/ .. my full path here ../cpp/core/src/
So, under the src directory you'll find zxing.
How do we configure this in Xcode? Best to do it relatively. Otherwise, the project will fail on a different user's machine.
To do this, we specify a path relative to the project directory. As follows:
$(PROJECT_DIR)/../cpp/core/src
That goes in the Header Search Path of Build Settings for the ZXingWidget target.
The crucial thing with this header path stuff is to specify the relative directory to search from. In our case, we specify search relative to $(PROJECT_DIR). That variable specifies the directory of our subproject ZXingWidget.
Other caveats. Be careful to specify these in the build settings of your target. If you do it at project level you'll still need to specify it at target level using the $(inherited) variable.
Also, don't forget that the build transcript can be very useful. Look at the header paths included with the -I flag.
As a general debugging technique, I like to specify the absolute path in my settings. That gives a clean build and I know that the files can be included, and where they definitely are. Having done that I then use the $(PROJECT_DIR) to specify a relative path.
I am posting this in order to make things simple for newbies like me that are integrating zxing qr reader in their projects and to bring closure to a couple of threads related to zxing integration.
1.
Main thing - Be absolutely sure you have the latest version.
http://zxing.googlecode.com/svn/trunk/
[By now, January 18th, you will have no more issues with that zxing/common/ folder. Easiest fix for this: get the latest code!]
2.
Go to zxing -> iphone -> ZXingWidget.
Drag ZXingWidget.xcodeproj file and drop it onto the root of your Xcode project's "Groups and Files" sidebar.
[you should now have ZXingWidget.xcodeproj listed there and it has to drop down and list it's content]
3.
In the same place, project navigator, select:
Your project file - > Targets -> 'your project name' -> Build phases -> Link binary with libraries.
You should find a folder named 'Workspace'. Add 'libZXingWidget.a' from within.
4.
Still in Build phases, expand Target Dependencies and add ZXingWidget.
5.
Select Build Settings and search for Header Search Paths.
You need to add 2 records to Header Search Paths. You do not need to associate values to User Header Search Paths. You achieve this by double clicking the column on the right. A small popover window will apear. Use the + button to add the first record. Add:
../zxing/iphone/ZXingWidget/Classes
Now use the + button to add the second record. Add:
../zxing/cpp/core/src
These are the values I use. These values work because I use the same folder to host both my project and the zxing folder.
[Be sure to refer your folder properly in case you decide to have a different file structure.]
6.
Go back to Build Phases and add the following ios frameworks required:
AVFoundation
AudioToolbox
CoreVideo
CoreMedia
libiconv
AddressBook
AddressBookUI
7.
Create a set of files (.h&.m) and change it's .m extension to .mm
8.
Test the integration by including the following in the file previously created:
#import <ZXingWidgetController.h>
#import <QRCodeReader.h>
At this point you should run into missing files only if you are not running the latest version. Hope this helps.
Some things to check:
- file permissions
- can you build from the command line using xcodebuild?
I went over many blog posts on how to fix this. This one helped me well.
http://alwawee.com/wordpress/2011/12/01/zxingwidgetcontroller-h-not-found-zxing-installation-problem-solution/
The problem was that header search paths were not properly defined.
So I...
1) Downloaded zxing 2.1
2) From the download I copied: iphone, cpp, objc and readme and pasted in a folder names "zxing"
3) I added the new folder "zxing" to my project (on my mac) not to the xcode app.
4) From the created folder zxing I dragged the zxingwidget.xproje to my xcode project
5) I followed all the steps you find in all the blogs
KEY TO SOLVE THIS
6) I followed this steps for xcode errors https://stackoverflow.com/a/14703794/1881577
7) I followed this steps for header path file errors http://alwawee.com/wordpress/2011/12/01/zxingwidgetcontroller-h-not-found-zxing-installation-problem-solution/
IMPORTANT NOTE: I had to do follow step 7) twice, I had to select the project target and assign header paths, and I had to select the project project and assign header paths.
8) Build zxingwidget project (from the scheme select options)
9) Build Run the project.
Hope this helps other people as well.

Resources