Welcome Guest, Not a member yet? Register   Sign In
CI 2.0.2 weird behaviour
#1

[eluser]runrun[/eluser]
Code:
write_file("html/".basename($htmlfile), $str);

That is what I've always used to write files to the folder html in my root. Now with CI 2.0.2. that code will still work, but the code below will not.

Code:
write_file("new_html/".basename($htmlfile), $str);

You can see I changed the folder name to new_html, the code will not write anything to that folder. but if I change back to html the code works again.
#2

[eluser]InsiteFX[/eluser]
Code:
Note: The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index.

InsiteFX
#3

[eluser]runrun[/eluser]
html and new_html folder is on the same directory.

In CI 2.0.2:

Code:
write_file("html/".basename($htmlfile), $str); // will work

write_file("new_html/".basename($htmlfile), $str); // will not work

In CI 1.7.2:

Both codes will work.
#4

[eluser]Ken Verhaegen[/eluser]
My guess is that the '_' (Underscore) is blocked?
#5

[eluser]John_Betong_002[/eluser]
Try this:

Code:
// DEBUG;
error_reporting(-1); // added
ini_set('display_errors',1); // added
echo '<br />before: ' ."html/".basename($htmlfile);  
echo '<br />after:  ' .getcwd() ."/" .basename($htmlfile);

write_file(getcwd() . "/" .basename($htmlfile), $str); // will work
&nbsp;
&nbsp;
#6

[eluser]sblaas[/eluser]
[quote author="runrun" date="1304346448"]html and new_html folder is on the same directory.

In CI 2.0.2:

Code:
write_file("html/".basename($htmlfile), $str); // will work

write_file("new_html/".basename($htmlfile), $str); // will not work

In CI 1.7.2:

Both codes will work.[/quote]

Also both on the same directory structure ?

My best guess: in your 2.x environment the "new_html" isn't writable..
#7

[eluser]InsiteFX[/eluser]
What OS are you running?

InsiteFX
#8

[eluser]runrun[/eluser]
windows 7 32bit.
#9

[eluser]InsiteFX[/eluser]
Right click on the directory name, then properties if the read only checkbox is blue click on it until it goe's blank!

You should be logged in as administrator also.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB