Cli::prompt('Your name:', true), 'login' => Cli::prompt('Username:', true), 'pwd' => Cli::prompt('Password:', true, StringUtil::genPassword()), ); define('PLX_ROOT', $this->destination.DIRECTORY_SEPARATOR.'pluxml'.DIRECTORY_SEPARATOR); define('PLX_CORE', PLX_ROOT.'core'.DIRECTORY_SEPARATOR); define('PLX_CONF', PLX_ROOT.'data'.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR.'parametres.xml'); require_once PLX_ROOT.DIRECTORY_SEPARATOR.'config.php'; $lang = DEFAULT_LANG; loadLang(PLX_CORE.'lang/'.$lang.DIRECTORY_SEPARATOR.'install.php'); loadLang(PLX_CORE.'lang/'.$lang.DIRECTORY_SEPARATOR.'core.php'); require_once PLX_CORE.'lib'.DIRECTORY_SEPARATOR.'class.plx.glob.php'; require_once PLX_CORE.'lib'.DIRECTORY_SEPARATOR.'class.plx.utils.php'; if(!is_dir($dir=$this->destination.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'images')) { @mkdir($dir, 0755); } if(!is_dir($dir=$this->destination.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'documents')) { @mkdir($dir, 0755); } $version = trim(file_get_contents(PLX_ROOT.'version')); $config = array('title'=>'PluXml', 'description'=>plxUtils::strRevCheck(L_SITE_DESCRIPTION), 'meta_description'=>'', 'meta_keywords'=>'', 'racine'=>$racine, 'delta'=>'+00:00', 'allow_com'=>1, 'mod_com'=>0, 'mod_art'=>0, 'capcha'=>1, 'style'=>'defaut', 'clef'=>plxUtils::charAleatoire(15), 'bypage'=>5, 'bypage_archives'=>5, 'bypage_admin'=>10, 'bypage_admin_coms'=>10, 'bypage_feed'=>8, 'tri'=>'desc', 'tri_coms'=>'asc', 'images_l'=>800, 'images_h'=>600, 'miniatures_l'=>200, 'miniatures_h'=>100, 'images'=>'data/images/', 'documents'=>'data/documents/', 'racine_articles'=>'data/articles/', 'racine_commentaires'=>'data/commentaires/', 'racine_statiques'=>'data/statiques/', 'racine_themes'=>'themes/', 'racine_plugins'=>'plugins/', 'statiques'=>'data/configuration/statiques.xml', 'categories'=>'data/configuration/categories.xml', 'users'=>'data/configuration/users.xml', 'tags'=>'data/configuration/tags.xml', 'plugins'=>'data/configuration/plugins.xml', 'homestatic'=>'', 'urlrewriting'=>0, 'gzip'=>0, 'feed_chapo'=>0, 'feed_footer'=>'', 'version'=>$version, 'default_lang'=>$lang, 'userfolders'=>0, ); $this->install($content, $config); Cli::printNotice('Finished', 'You can now use the Pluxml.'); } private function install($content, $config) { # Création du fichier de configuration $xml = ''."\n"; $xml .= ''."\n"; foreach($config as $k=>$v) { if(is_numeric($v)) $xml .= "\t".$v."\n"; else $xml .= "\t\n"; } $xml .= ''; plxUtils::write($xml,PLX_CONF); # Création du fichier des utilisateurs $salt = plxUtils::charAleatoire(10); $xml = ''."\n"; $xml .= "\n"; $xml .= "\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\t".''."\n"; $xml .= "\t\n"; $xml .= ""; plxUtils::write($xml,PLX_ROOT.$config['users']); # Création du fichier des categories $xml = ''."\n"; $xml .= ''."\n"; $xml .= "\t".''."\n"; $xml .= ''; plxUtils::write($xml,PLX_ROOT.$config['categories']); # Création du fichier des pages statiques $xml = ''."\n"; $xml .= ''."\n"; $xml .= "\t".''."\n"; $xml .= ''; plxUtils::write($xml,PLX_ROOT.$config['statiques']); $cs = '

'; plxUtils::write($cs,PLX_ROOT.$config['racine_statiques'].'001.'.L_DEFAULT_STATIC_URL.'.php'); # Création du premier article $xml = ''."\n"; $xml .= ' <![CDATA['.plxUtils::strRevCheck(L_DEFAULT_ARTICLE_TITLE).']]> 1 '.plxUtils::strRevCheck(L_DEFAULT_ARTICLE_CONTENT).'

]]>
'; plxUtils::write($xml,PLX_ROOT.$config['racine_articles'].'0001.001.001.'.@date('YmdHi').'.'.L_DEFAULT_ARTICLE_URL.'.xml'); # Création du fichier des tags servant de cache $xml = ''."\n"; $xml .= ''."\n"; $xml .= "\t".'
'."\n"; $xml .= '
'; plxUtils::write($xml,PLX_ROOT.$config['tags']); # Création du fichier des plugins $xml = ''."\n"; $xml .= ''."\n"; $xml .= ''; plxUtils::write($xml,PLX_ROOT.$config['plugins']); # Création du premier commentaire $xml = ''."\n"; $xml .= ' normal 127.0.0.1 '; plxUtils::write($xml,PLX_ROOT.$config['racine_commentaires'].'0001.'.@date('U').'-1.xml'); } }