CakePHP and Dynamically-Related Files in Dreamweaver - cakephp

It took me forever to figure out how to customize my Dreamweaver setup so that it would recognize the .ctp file extension (if you're trying to figure it out, there's a second Extensions.txt file under /Users/yourname/Library/ ...)
Now I'm trying to set up Dynamically-Related files on Dreamweaver with CakePHP, and it won't work. I'm assuming that this is because Cake is using those weird .htaccess files to prevent Dreamweaver from seeing the same directory that it is expecting.
Has anyone done this / can anyone help? All of the other q's have been left unanswered!
Thanks

"Not seeing"? I guess you're talking about mod rewrite. Also .htaccess files are nothing weird but something pretty normal in the web. Also see the CakePHP book page about mod rewrite and .htaccess. So either disable it or configure it properly.
I have no clue how dreamweaver is effected by this anyways. Does it come with a webserver?
However the best advice I can give you is simply to throw Dreamweaver away. Even after it became somewhat capable of doing non table based layouts it is still a lot faster to write the HTML/CSS manually or even faster with an editor that simply provides code/tag completion instead of this crutch Dreamweaver.
A sersious php + html/css editor is in my opinion phpstorm, if you want something free... uhm... Try Aptana or Eclipse PDT or pspad.

Related

Codename One Reverse Engineer Android Package

I have an android app on Google Play, from which I have lost the original files. I had everything on my computer, and usually I backup everything, but somehow I lost the project.
So, I have downloaded the APK from my Google Play Console, but the contents inside don't resemble in any way the structure of the original project. There is a Classes.dex file/ folder inside the package, which I can't seem to be able to open.
Is there a - relatively - easy way to reverse engineer the package and get the original projeckt back?
Many thanks in advance.
While there are tools to reverse engineer an Android project you won't have much to salvage. You can see some of that discussion here: decompiling DEX into Java sourcecode
But here are a few things about Codename One. I'll start with the good news: The res file will be intact.
If you didn't use CSS you can just take the res file "as is" and it should work just fine.
The bad news is that everything else is obfuscated by default. That means that all classes will be named with names such as a. So would all the methods etc. You might be able to salvage some code from that but not much.

theme.res Won't Open in Codename One Application

Very weird issue I've come across. Is there anything I can do?
I have not made any changes to my computer since the last time it worked.
It seems to be an "issue" with the ResourceEditorApp, as no theme.res files are working (from other projects).
It could be the file just got corrupted for some reason. Did you look at its size? We now have new XML team support in the designer (its still experimental though) which should allow better versioning and reliability as we move along.
If the file is not 0 length and isn't working at all just send it to us and I will try to recover it.

CakePHP from localhost to remote server - blank page

i am trying to figure this out for a long time now, but so far no luck, maybe somebody can help me.
I have a 2.2.2 cakephp installed on my computer (localhost) and everything works perfectly. But now i want that same project to be online on remote server. I upload everything, set mysql path but i get a blank page when trying to access the site.
If i upload a fresh cakephp it works, but my project doesnt. The debug is set to default, think that should be 2? I also deleted files in cache/tmp, but still no errors or anything, just blank page.
Any info would be helpful, thank you.
I hate when that happens :). Usually it does if there is an error somewhere and you can't see it because the errors are turned off, so you should call phpinfo() and see if display_errors is on. Changing the debug mode doesn't work every time since display_errors is set from php.ini.
Unfortunately, if this is the problem and you don't have access to edit the php.ini file, you might need to ask the hosting provider to change it and restart the php service.
You can also try this: error_reporting(E_ALL)
I uploaded changes to my cakephp website and discovered that all actions for a particular controller returned a blank page. I discovered what the error was and was able to reproduce it with another controller.
The problem was that in the first line of my controller file I had a space before the opening php tag.
One space cost me hours.
Just uploading all files won't cut it. Make sure you work through this checklist:
First and foremost, check the error log file located under app/tmp/logs/error.log, this usually holds some very good pointers as to what is wrong.
Make sure you have uploaded the app/Config/database.php file with the proper details. Local installs usually have user root without password. Online servers (obviously) do not!
To that extent, also make sure you actually have a database with your hosting provider (either your host sent you the info or you need to create it yourself using their control panel).
Make sure you also uploaded all .htaccess files (the one under the root directory and /app and /app/webroot), some FTP programs don't show this "hidden" file by default.
If all else fails, contact your hosting provider for further support as they usually have access to more verbose server logs that can also hold clues.
The real problem was only the coding I used in notepad++. All my files were encoded with UTF-8, but they should have been UTF-8 without BOM. After I changed it to UTF-8 withot BOM, everything started to work perfectly.

cakephp slow because of mod_rewrite?

I have a web made with CakePHP 1.3.10. This web seems to get slower every time new folders/pages are added to it (which happens pretty often).
I believe reading somewhere that the mod_rewrite found in the 3 .htaccess files may have something to do with it.
Is it true?
I'm trying to get it to work without the htaccess files, but all my links are messed up. Is there any way to avoid having to edit all the links in the website? Now it seems that I have to add /app/webroot/ before every file I'm linking (css, js, etc) and add /index.php before every link in the website.
Is this the only way?
Have you measured how much time is spent in mod_rewrite and how much in PHP? In my experience the most likely problem is the time Cake spends looking for files in the file system, which gets progressively worse when you add files and directories.
You can use Xdebug to profile the application, or just add calls to print the time in appropriate places in the framework to see how much time has passed since the beginning of the request.
This doesn't sound like a mod_rewrite issue. The time it takes to transform an URL like http://example.com/wiki/Page_title to something like http://example.com/wiki/index.php?title=Page_title is more or less constant, and doesn't grow with the number of files/directories as they are irrelevant for the rewriting process.

SSRS css messing up?

So the last couple of days my dev webpage for ssrs has been looking really weird, as if it's not getting styled by css at all. I'm not the only person that is seeing it like this. We just rebooted the server and it didn't have any effect. If you know what it causing this, please help.
another symptom is that i can't modify security settings now.
If I were you, I would view the page using FF (firebug), and take a look in the head to see whether the CSS is being imported.
If it is, make sure the path is correct.
A couple of general things come to mind...
Make sure your IIS application/virtual directory settings are correct especially if you are using SSRS2005. The default IIS applications are "Reports" and "ReportServer"
Make sure the NTFS rights are correct for Local path. For example the default location for ReportServer is "c:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer"
In my experience when strange things like this are happening there are user rights/access issues. Especially when you can't modify security settings.
HTH
Well it kinda seems to have fixed itself.
This may be a bit naive, but have you tried an offline version of the code?
Get the generated HTML via "view source" in your browser of choice, then get the stylesheet by accessing it directly from the same browser, using whatever the path is from the html (I recommend Google Chrome, as the view source provides clickable hyperlinks within the source). Put them both on your desktop, making sure the relative paths are preserved, and see what it looks like offline.
I'm sure that the server/Microsoft produce all of this code and so it's SUPPOSED to work, so a missing closing tag or misplaced semi-colon is probably not the answer, but I have found more than once that pulling my output off the server and onto my desktop has made the problem go from mysterious to "Oh! Duh! /styles/style.css, not /Styles/style.css" etc etc.
The problem can only be with your server if www doesn't have read/execute access to all of the right folders. I find this really unlikely, but it's easy to check by simply trying to view the source code of the CSS. If you can, the problem is post-server output.

Resources