*/
public static function encryptFile( $source, $target, $key='') {
$handleread = fopen($source, "rb");
- if($handleread!=FALSE) {
+ if($handleread!=false) {
$handlewrite = fopen($target, "wb");
while (!feof($handleread)) {
$content = fread($handleread, 8192);
*/
public static function decryptFile( $source, $target, $key='') {
$handleread = fopen($source, "rb");
- if($handleread!=FALSE) {
+ if($handleread!=false) {
$handlewrite = fopen($target, "wb");
while (!feof($handleread)) {
$content = fread($handleread, 8192);
require_once '../../lib/base.php';
// don't load apps or filesystem for this task
-$RUNTIME_NOAPPS = TRUE;
-$RUNTIME_NOSETUPFS = TRUE;
+$RUNTIME_NOAPPS = true;
+$RUNTIME_NOSETUPFS = true;
// Sanity checks
// using OCP\JSON::callCheck() below protects the token refreshing itself.
* See the COPYING-README file.
*/
-$RUNTIME_NOAPPS = TRUE; //no apps
+$RUNTIME_NOAPPS = true; //no apps
require_once '../../lib/base.php';
* See the COPYING-README file.
*/
-$RUNTIME_NOAPPS = TRUE; //no apps
+$RUNTIME_NOAPPS = true; //no apps
require_once '../../lib/base.php';
// Someone wants to reset their password:
set_time_limit(0);
$zip = new ZipArchive();
$filename = OC_Helper::tmpFile('.zip');
- if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) {
+ if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
foreach($files as $file) {
set_time_limit(0);
$zip = new ZipArchive();
$filename = OC_Helper::tmpFile('.zip');
- if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) {
+ if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
$file=$dir.'/'.$files;
$setting = 'php_value '.$key.' '.$size;
$hasReplaced = 0;
$content = preg_replace($pattern, $setting, $htaccess, 1, $hasReplaced);
- if($content !== NULL) {
+ if($content !== null) {
$htaccess = $content;
}
if($hasReplaced == 0) {
if($file != '.' && $file != '..') {
$fullpath = $path.'/'.$file;
if(is_link($fullpath))
- return FALSE;
+ return false;
elseif(!is_dir($fullpath) && !@chmod($fullpath, $filemode))
- return FALSE;
+ return false;
elseif(!self::chmodr($fullpath, $filemode))
- return FALSE;
+ return false;
}
}
closedir($dh);
if(@chmod($path, $filemode))
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
/**
OC_Log::write( 'migration', 'Zip not found', OC_Log::ERROR );
return false;
}
- if ( self::$zip->open( $path ) != TRUE ) {
+ if ( self::$zip->open( $path ) != true ) {
OC_Log::write( 'migration', "Failed to open zip file", OC_Log::ERROR );
return false;
}
OC_Log::write('migration', 'createZip() called but $zip and/or $zippath have not been set', OC_Log::ERROR);
return false;
}
- if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== TRUE ) {
+ if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== true ) {
OC_Log::write('migration', 'Failed to create the zip with error: '.self::$zip->getStatusString(), OC_Log::ERROR);
return false;
} else {
*/
public static function getCategories() {
if(OC_Config::getValue('appstoreenabled', true)==false) {
- return NULL;
+ return null;
}
$url=OC_OCSClient::getAppStoreURL().'/content/categories';
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==FALSE) {
- return NULL;
+ return null;
}
$data=simplexml_load_string($xml);
*/
public static function getApplication($id) {
if(OC_Config::getValue('appstoreenabled', true)==false) {
- return NULL;
+ return null;
}
$url=OC_OCSClient::getAppStoreURL().'/content/data/'.urlencode($id);
$xml=OC_OCSClient::getOCSresponse($url);
- if($xml==FALSE) {
+ if($xml==false) {
OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
- return NULL;
+ return null;
}
$data=simplexml_load_string($xml);
*/
public static function getApplicationDownload($id,$item) {
if(OC_Config::getValue('appstoreenabled', true)==false) {
- return NULL;
+ return null;
}
$url=OC_OCSClient::getAppStoreURL().'/content/download/'.urlencode($id).'/'.urlencode($item);
$xml=OC_OCSClient::getOCSresponse($url);
- if($xml==FALSE) {
+ if($xml==false) {
OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
- return NULL;
+ return null;
}
$data=simplexml_load_string($xml);
$kbe=array();
$xml=OC_OCSClient::getOCSresponse($url);
- if($xml==FALSE) {
+ if($xml==false) {
OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL);
- return NULL;
+ return null;
}
$data=simplexml_load_string($xml);
)
);
$xml=@file_get_contents($url, 0, $ctx);
- if($xml==FALSE) {
+ if($xml==false) {
return array();
}
$data=@simplexml_load_string($xml);
unset($_COOKIE["oc_username"]);
unset($_COOKIE["oc_token"]);
unset($_COOKIE["oc_remember_login"]);
- setcookie("oc_username", NULL, -1);
- setcookie("oc_token", NULL, -1);
- setcookie("oc_remember_login", NULL, -1);
+ setcookie("oc_username", null, -1);
+ setcookie("oc_token", null, -1);
+ setcookie("oc_remember_login", null, -1);
}
}
// Try to use openssl_random_pseudo_bytes
if(function_exists('openssl_random_pseudo_bytes')) {
$pseudo_byte = bin2hex(openssl_random_pseudo_bytes($length, $strong));
- if($strong == TRUE) {
+ if($strong == true) {
return substr($pseudo_byte, 0, $length); // Truncate it to match the length
}
}
// Try to use /dev/urandom
$fp = @file_get_contents('/dev/urandom', false, null, 0, $length);
- if ($fp !== FALSE) {
+ if ($fp !== false) {
$string = substr(bin2hex($fp), 0, $length);
return $string;
}
// Check openssl_random_pseudo_bytes
if(function_exists('openssl_random_pseudo_bytes')) {
openssl_random_pseudo_bytes(1, $strong);
- if($strong == TRUE) {
+ if($strong == true) {
return true;
}
}
// Check /dev/urandom
$fp = @file_get_contents('/dev/urandom', false, null, 0, 1);
- if ($fp !== FALSE) {
+ if ($fp !== false) {
return true;
}
<?php
-$RUNTIME_NOAPPS = TRUE;
+$RUNTIME_NOAPPS = true;
require_once 'lib/base.php';
if (!isset($_GET['service'])) {
header('HTTP/1.0 404 Not Found');
<?php
-$RUNTIME_NOAPPS = TRUE;
+$RUNTIME_NOAPPS = true;
require_once 'lib/base.php';
$path_info = OC_Request::getPathInfo();
if ($path_info === false || $path_info === '') {
*
*/
-$RUNTIME_NOAPPS = TRUE; //no apps, yet
+$RUNTIME_NOAPPS = true; //no apps, yet
require_once 'lib/base.php';