Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Safe Mode Fix 1/2 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

CodeCow
Copy link

@CodeCow CodeCow commented Nov 30, 2013

This prevents the presskit(); installation from breaking the webpage if PHP_SAFE_MODE is enabled. I'm not sure if it's the most elegant fix to do so, but it solves the problem. It does not carry out the whole installation process(I am still working on this), however the functionality to connect to a FTP server (creating directories / deleting and creating files) has been established.

@Dearon
Copy link
Contributor

Dearon commented Dec 1, 2013

Hmm, does this add a significant enough advantage versus someone uploading the archive themselves through FTP (they already had to upload the install.php and need to edit the data.xml so they have a connection open anyway)?

Plus from my quick browsing (feel free to correct me if I am wrong) it will always throw the FTP page at a user due to "if( true )" and you've commented out the downloading of the stylesheet. Those are two issues I spotted when looking through it a little bit.

@CodeCow
Copy link
Author

CodeCow commented Dec 2, 2013

@Dearon Reason I made it true every-time is that my version of PHP does not support safe_mode. It was deprecated as of PHP 5.3.0 and was removed of as of PHP 5.4.0. I didn't feel like downloading an older version of PHP just for the sake of testing so I made it always throw it at the user. The reason I commented out the downloading of the style sheet is that the URL it pulls it from has an outdated version of the style sheet, and it would overwrite my changes. I corrected the problem of it throwing the ftp connection at the user every-time in my second commit to the branch.

Presskit()'s installation and update process includes the creation directories, the download of remote files, and the renaming of files. Would you want to upload archive.zip(and unzip it) manually every single time you had to update presskit() or for that matter, install it? The main advantage of this fix is automation.

@ramiismail
Copy link
Owner

The single file install is inspired by Steam, which allows for super rapid installation, moving and updating. I like how elegant it is.

As soon as I merge this pull request and prepare for updating, I can update the .css and archive.zip on my own server.

@CodeCow
Copy link
Author

CodeCow commented Dec 2, 2013

@ramiismail or we can do this:

    $randVar = file_put_contents("master.zip", 
    file_get_contents("https://github.com/ramiismail/dopresskit/archive/master.zip")

    //unzip routine

I'm thinking pull updates from GitHub, use your server as backup(in case GitHub is down), this way you'd only need to update the repo(which is easier).

@ramiismail
Copy link
Owner

I'd be OK with that if that works. make it dopresskit/master/archive.zip
though.

On Mon, Dec 2, 2013 at 7:24 PM, Code_Assassin notifications@github.comwrote:

@ramiismail https://github.com/ramiismail or we can do this:

$randVar = file_put_contents("master.zip",
file_get_contents("https://github.com/ramiismail/dopresskit/archive/master.zip")

//unzip routine

I'm thinking pull updates from GitHub, use your server as backup(in case
GitHub is down), this way you'd only need to update the repo(which is
easier).


Reply to this email directly or view it on GitHubhttps://github.com//pull/6#issuecomment-29643409
.

@CodeCow
Copy link
Author

CodeCow commented Dec 2, 2013

@ramiismail Okay, after I complete the other half to the PHP_SAFE_MODE fix I'll work on the Updating Presskit() issue.

@Dearon
Copy link
Contributor

Dearon commented Dec 2, 2013

@CodeCow Yeah I get that it's useful in development. But the master branch on this repo should always be stable and as bug-free as possible, if only due to the fact that every big project on Github does things that way. So any code being merged into it should always be production ready, thus my comment on that :)

And yeah, I do think that entering your FTP credentials and so forth into the page is barely any better than unzipping the zip yourself and uploading, but that can just be me (or, in other words, if Rami is happy with it then I am not going to complain).

@CodeCow
Copy link
Author

CodeCow commented Dec 2, 2013

@Dearon You are right, but thanks to modern browser sophistication and _SESSION variables you can make the browser remember your credentials ;)

@ramiismail
Copy link
Owner

@CodeCow Is your code ready to be merged into the master branch?

@CodeCow
Copy link
Author

CodeCow commented Dec 10, 2013

@ramiismail No not yet. I haven't worked on the second part to the fix in a while, due to finals :(

If someone is able to pick up my slack, I'd appreciate it.

@ramiismail
Copy link
Owner

If not, that's not a problem. I'd appreciate it if you'd have some time
after those are over to wrap this one up.

Success with your finals!

On Tue, Dec 10, 2013 at 6:15 AM, Code_Assassin notifications@github.comwrote:

@ramiismail https://github.com/ramiismail No not yet. I haven't worked
on the second part to the fix in a while, due to finals :(

If someone is able to pick up my slack, I'd appreciate it.


Reply to this email directly or view it on GitHubhttps://github.com//pull/6#issuecomment-30200303
.

@Wikzo
Copy link

Wikzo commented Feb 18, 2014

Did this ever get completed? I just bought a website and would love to install presskit(). However, I am unable to turn off PHP safe mode and can't figure out how to install presskit() because of that :(

@Dearon
Copy link
Contributor

Dearon commented Feb 18, 2014

@Wikzo No, but what you can do is upload everything inside of the archive directory and it should work without a problem. The only downside is that you can't use the single-file setup for installing/updating.

@Wikzo
Copy link

Wikzo commented Feb 18, 2014

I am pretty new to this thing. I have taken the all the files inside the archive folder and uploaded it via FTP.

What am I supposed to do then? When I try to go to my website, I just get the "Server Environment Check Failed: PHP Safe Mode Enabled" text. E.g. http://tunnelvisiongames.com/press/archive/index.php

What page/file am I supposed to go to next?

I have read the manual. I even tried CodeCow's fix. With this I am able to get to the install page and insert the server/password, but when I hit enter nothing happens.

@Dearon
Copy link
Contributor

Dearon commented Feb 18, 2014

@Wikzo, Hmm, I thought those checks weren't there. Anyway, replace the content of install.php with https://gist.github.com/Dearon/9078530. You'll also want to create a directory called "images" and one called "trailers" in the same dir as the install.php file. Hopefully it will work at that point (also sorry for the trouble, it is a bit cumbersome like this).

@Wikzo
Copy link

Wikzo commented Feb 18, 2014

Thanks a lot!

@Dearon
Copy link
Contributor

Dearon commented Feb 18, 2014

@Wikzo Does it work that way? Might be able to change the code a bit so that it at least offers a manual way of installing for people without safe mode enabled

@Wikzo
Copy link

Wikzo commented Feb 18, 2014

Yep, it worked! I now have http://tunnelvisiongames.com up and running :)

@Dearon
Copy link
Contributor

Dearon commented Feb 18, 2014

Awesome! Good to see it worked out

@Wikzo
Copy link

Wikzo commented Mar 13, 2014

Sorry for being a complete website newbie here, but how do I create a simple clickable URL link inside my main text?

Sorry about the poor formatting, but here is what I am trying to do (see attached image). What am I doing wrong? Also, I know this is not the right place to ask questions like this, but I don't know where else to go.

url

@Dearon
Copy link
Contributor

Dearon commented Mar 13, 2014

@Wikzo It's probably much easier to tackle this through chat, are you on any IRC networks or use Skype or such?

@Wikzo
Copy link

Wikzo commented Mar 13, 2014

I am Wikzodk on Skype.

Again, sorry for using GitHub as a support forum.

So far, I found a solution of writing the following:
g

@juliettef
Copy link

@Wikzo it works for me too, thanks for the tip!

@Dearon
Copy link
Contributor

Dearon commented Mar 13, 2014

@Wikzo Aah of course, that's exactly how you should do it since XML. Glad you found a solution!

@Wikzo
Copy link

Wikzo commented Mar 13, 2014

Ah, cool. Thanks. I think this would be nice to include in the standard _data.xml example in the future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants