move images and thumbs to data/
This commit is contained in:
		
							parent
							
								
									f0c1baa3ed
								
							
						
					
					
						commit
						65d2172ede
					
				| @ -17,8 +17,8 @@ | |||||||
| 	# rather than link to images/ha/hash and have an ugly filename, | 	# rather than link to images/ha/hash and have an ugly filename, | ||||||
| 	# we link to images/hash/tags.ext; mod_rewrite splits things so | 	# we link to images/hash/tags.ext; mod_rewrite splits things so | ||||||
| 	# that shimmie sees hash and the user sees tags.ext | 	# that shimmie sees hash and the user sees tags.ext | ||||||
| 	RewriteRule ^_images/([0-9a-f]{2})([0-9a-f]{30}).*$  images/$1/$1$2 [L] | 	RewriteRule ^_images/([0-9a-f]{2})([0-9a-f]{30}).*$  data/images/$1/$1$2 [L] | ||||||
| 	RewriteRule ^_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$  thumbs/$1/$1$2 [L] | 	RewriteRule ^_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$  data/thumbs/$1/$1$2 [L] | ||||||
| 
 | 
 | ||||||
| 	# any requests for files which don't physically exist should be handled by index.php | 	# any requests for files which don't physically exist should be handled by index.php | ||||||
| 	RewriteCond %{REQUEST_FILENAME} !-f | 	RewriteCond %{REQUEST_FILENAME} !-f | ||||||
|  | |||||||
| @ -360,29 +360,22 @@ function insert_defaults() { // {{{ | |||||||
| function build_dirs() { // {{{
 | function build_dirs() { // {{{
 | ||||||
| 	// *try* and make default dirs. Ignore any errors --
 | 	// *try* and make default dirs. Ignore any errors --
 | ||||||
| 	// if something is amiss, we'll tell the user later
 | 	// if something is amiss, we'll tell the user later
 | ||||||
| 	if(!file_exists("images")) @mkdir("images"); | 	if(!file_exists("data")) @mkdir("data"); | ||||||
| 	if(!file_exists("thumbs")) @mkdir("thumbs"); | 	if(!is_writable("data")) @chmod("data", 0755); | ||||||
| 	if(!file_exists("data")  ) @mkdir("data"); |  | ||||||
| 	if(!is_writable("images")) @chmod("images", 0755); |  | ||||||
| 	if(!is_writable("thumbs")) @chmod("thumbs", 0755); |  | ||||||
| 	if(!is_writable("data")  ) @chmod("data", 0755); |  | ||||||
| 
 | 
 | ||||||
| 	// Clear file status cache before checking again.
 | 	// Clear file status cache before checking again.
 | ||||||
| 	clearstatcache(); | 	clearstatcache(); | ||||||
| 
 | 
 | ||||||
| 	if( | 	if(!file_exists("data") || !is_writable("data")) { | ||||||
| 		!file_exists("images") || !file_exists("thumbs") || !file_exists("data") || |  | ||||||
| 		!is_writable("images") || !is_writable("thumbs") || !is_writable("data") |  | ||||||
| 	) { |  | ||||||
| 		print " | 		print " | ||||||
| 		<div id='installer'> | 		<div id='installer'> | ||||||
| 			<h1>Shimmie Installer</h1> | 			<h1>Shimmie Installer</h1> | ||||||
| 			<h3>Directory Permissions Error:</h3> | 			<h3>Directory Permissions Error:</h3> | ||||||
| 			<div class='container'> | 			<div class='container'> | ||||||
| 				<p>Shimmie needs to make three folders in it's directory, '<i>images</i>', '<i>thumbs</i>', and '<i>data</i>', and they need to be writable by the PHP user.</p> | 				<p>Shimmie needs to have a 'data' folder in its directory, writable by the PHP user.</p> | ||||||
| 				<p>If you see this error, if probably means the folders are owned by you, and they need to be writable by the web server.</p> | 				<p>If you see this error, if probably means the folder is owned by you, and it needs to be writable by the web server.</p> | ||||||
| 				<p>PHP reports that it is currently running as user: ".$_ENV["USER"]." (". $_SERVER["USER"] .")</p> | 				<p>PHP reports that it is currently running as user: ".$_ENV["USER"]." (". $_SERVER["USER"] .")</p> | ||||||
| 				<p>Once you have created these folders and / or changed the ownership of the shimmie folder, hit 'refresh' to continue.</p> | 				<p>Once you have created this folder and / or changed the ownership of the shimmie folder, hit 'refresh' to continue.</p> | ||||||
| 				<br/><br/> | 				<br/><br/> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|  | |||||||
| @ -182,10 +182,10 @@ function warehouse_path(string $base, string $hash, bool $create=true): string { | |||||||
| 	$ab = substr($hash, 0, 2); | 	$ab = substr($hash, 0, 2); | ||||||
| 	$cd = substr($hash, 2, 2); | 	$cd = substr($hash, 2, 2); | ||||||
| 	if(WH_SPLITS == 2) { | 	if(WH_SPLITS == 2) { | ||||||
| 		$pa = $base.'/'.$ab.'/'.$cd.'/'.$hash; | 		$pa = 'data/'.$base.'/'.$ab.'/'.$cd.'/'.$hash; | ||||||
| 	} | 	} | ||||||
| 	else { | 	else { | ||||||
| 		$pa = $base.'/'.$ab.'/'.$hash; | 		$pa = 'data/'.$base.'/'.$ab.'/'.$hash; | ||||||
| 	} | 	} | ||||||
| 	if($create && !file_exists(dirname($pa))) mkdir(dirname($pa), 0755, true); | 	if($create && !file_exists(dirname($pa))) mkdir(dirname($pa), 0755, true); | ||||||
| 	return $pa; | 	return $pa; | ||||||
|  | |||||||
| @ -48,6 +48,10 @@ if(!file_exists("data/config/shimmie.conf.php")) { | |||||||
| 	exit; | 	exit; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | if(file_exists("images") && !file_exists("data/images")) { | ||||||
|  | 	die("As of Shimmie 2.7 images and thumbs should be moved to data/images and data/thumbs"); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| if(!file_exists("vendor/")) { | if(!file_exists("vendor/")) { | ||||||
| 	//CHECK: Should we just point to install.php instead? Seems unsafe though.
 | 	//CHECK: Should we just point to install.php instead? Seems unsafe though.
 | ||||||
| 	print <<<EOD | 	print <<<EOD | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user