array('/full/path/to/plugins/', '/next/full/path/to/plugins/'), * 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'), * 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'), * 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'), * 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'), * 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'), * 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'), * 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'), * 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), * 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') * )); * */ /** * As of 1.3, additional rules for the inflector are added below * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ if (file_exists(CONFIGS.DS.'configuration.xml')) { $config = Configure::getInstance(); //Interpret the configuration XML file into an object if (!$mXML = simplexml_load_file(CONFIGS.DS.'configuration.xml')) { echo "Couldn't parse the XML file: ". CONFIGS.DS.'configuration.xml'; exit; } else { foreach ($mXML->option as $option) { $optionName = $option->name; $optionSetting = $option->setting; $config->$optionName = $optionSetting; } } } function mosMakePassword($length) { $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $len = strlen($salt); $makepass=""; mt_srand(10000000*(double)microtime()); for ($i = 0; $i < $length; $i++) $makepass .= $salt[mt_rand(0,$len - 1)]; return $makepass; } /** * Chmods files and directories recursivel to given permissions * @param path The starting file or directory (no trailing slash) * @param filemode Integer value to chmod files. NULL = dont chmod files. * @param dirmode Integer value to chmod directories. NULL = dont chmod directories. * @return TRUE=all succeeded FALSE=one or more chmods failed */ function mosChmodRecursive($path, $filemode=NULL, $dirmode=NULL) { $ret = TRUE; if (is_dir($path)) { $dh = opendir($path); while ($file = readdir($dh)) { if ($file != '.' && $file != '..') { $fullpath = $path.'/'.$file; if (is_dir($fullpath)) { if (!mosChmodRecursive($fullpath, $filemode, $dirmode)) $ret = FALSE; } else { if (isset($filemode)) if (!@chmod($fullpath, $filemode)) $ret = FALSE; } // if } // if } // while closedir($dh); if (isset($dirmode)) if (!@chmod($path, $dirmode)) $ret = FALSE; } else { if (isset($filemode)) $ret = @chmod($path, $filemode); } // if return $ret; } // mosChmodRecursive function get_php_setting($val) { $r = (ini_get($val) == '1' ? 1 : 0); return $r ? 'ON' : 'OFF'; } function writableCell($folder) { echo "