智慧圖卡教具系列 - 匯趣坊圖書有限公司

文章推薦指數: 80 %
投票人數:10人

前因後果-T01: 圖卡和學習寶典計有80種不同的遊戲概念,學習寶典「遊戲123」內容有:圖形觀察、看圖說故事、語言認知、語言表達、邏輯思考、順序排列、順序推理、分類 ... set('load',$loader); //Config $config=newConfig(); $registry->set('config',$config); //Database $db=newDB(DB_DRIVER,DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE); $registry->set('db',$db); //Store if(isset($_SERVER['HTTPS'])&&(($_SERVER['HTTPS']=='on')||($_SERVER['HTTPS']=='1'))){ $store_query=$db->query("SELECT*FROM".DB_PREFIX."storeWHEREREPLACE(`ssl`,'www.','')='".$db->escape('https://'.str_replace('www.','',$_SERVER['HTTP_HOST']).rtrim(dirname($_SERVER['PHP_SELF']),'/.\\').'/')."'"); }else{ $store_query=$db->query("SELECT*FROM".DB_PREFIX."storeWHEREREPLACE(`url`,'www.','')='".$db->escape('http://'.str_replace('www.','',$_SERVER['HTTP_HOST']).rtrim(dirname($_SERVER['PHP_SELF']),'/.\\').'/')."'"); } if($store_query->num_rows){ $config->set('config_store_id',$store_query->row['store_id']); }else{ $config->set('config_store_id',0); } //Settings $query=$db->query("SELECT*FROM".DB_PREFIX."settingWHEREstore_id='0'ORstore_id='".(int)$config->get('config_store_id')."'ORDERBYstore_idASC"); foreach($query->rowsas$setting){ if(!$setting['serialized']){ $config->set($setting['key'],$setting['value']); }else{ $config->set($setting['key'],unserialize($setting['value'])); } } if(!$store_query->num_rows){ $config->set('config_url',HTTP_SERVER); $config->set('config_ssl',HTTPS_SERVER); } //Url $url=newUrl($config->get('config_url'),$config->get('config_secure')?$config->get('config_ssl'):$config->get('config_url')); $registry->set('url',$url); //Log $log=newLog($config->get('config_error_filename')); $registry->set('log',$log); functionerror_handler($errno,$errstr,$errfile,$errline){ global$log,$config; switch($errno){ caseE_NOTICE: caseE_USER_NOTICE: $error='Notice'; break; caseE_WARNING: caseE_USER_WARNING: $error='Warning'; break; caseE_ERROR: caseE_USER_ERROR: $error='FatalError'; break; default: $error='Unknown'; break; } if($config->get('config_error_display')){ echo''.$error.':'.$errstr.'in'.$errfile.'online'.$errline.''; } if($config->get('config_error_log')){ $log->write('PHP'.$error.':'.$errstr.'in'.$errfile.'online'.$errline); } returntrue; } //ErrorHandler set_error_handler('error_handler'); //Request $request=newRequest(); $registry->set('request',$request); //Response $response=newResponse(); $response->addHeader('Content-Type:text/html;charset=utf-8'); $response->setCompression($config->get('config_compression')); $registry->set('response',$response); //Cache $cache=newCache(); $registry->set('cache',$cache); //Session $session=newSession(); $registry->set('session',$session); //LanguageDetection $languages=array(); $query=$db->query("SELECT*FROM`".DB_PREFIX."language`WHEREstatus='1'"); foreach($query->rowsas$result){ $languages[$result['code']]=$result; } $detect=''; if(isset($request->server['HTTP_ACCEPT_LANGUAGE'])&&$request->server['HTTP_ACCEPT_LANGUAGE']){ $browser_languages=explode(',',$request->server['HTTP_ACCEPT_LANGUAGE']); foreach($browser_languagesas$browser_language){ foreach($languagesas$key=>$value){ if($value['status']){ $locale=explode(',',$value['locale']); if(in_array($browser_language,$locale)){ $detect=$key; } } } } } if(isset($session->data['language'])&&array_key_exists($session->data['language'],$languages)&&$languages[$session->data['language']]['status']){ $code=$session->data['language']; }elseif(isset($request->cookie['language'])&&array_key_exists($request->cookie['language'],$languages)&&$languages[$request->cookie['language']]['status']){ $code=$request->cookie['language']; }elseif($detect){ $code=$detect; }else{ $code=$config->get('config_language'); } if(!isset($session->data['language'])||$session->data['language']!=$code){ $session->data['language']=$code; } if(!isset($request->cookie['language'])||$request->cookie['language']!=$code){ setcookie('language',$code,time()+60*60*24*30,'/',$request->server['HTTP_HOST']); } $config->set('config_language_id',$languages[$code]['language_id']); $config->set('config_language',$languages[$code]['code']); //Language $language=newLanguage($languages[$code]['directory']); $language->load($languages[$code]['filename']); $registry->set('language',$language); //Document $registry->set('document',newDocument()); //Customer $registry->set('customer',newCustomer($registry)); //Affiliate $registry->set('affiliate',newAffiliate($registry)); if(isset($request->get['tracking'])){ setcookie('tracking',$request->get['tracking'],time()+3600*24*1000,'/'); } //Currency $registry->set('currency',newCurrency($registry)); //Tax $registry->set('tax',newTax($registry)); //Weight $registry->set('weight',newWeight($registry)); //Length $registry->set('length',newLength($registry)); //Cart $registry->set('cart',newCart($registry)); //OpenBayPro $registry->set('openbay',newOpenbay($registry)); //Encryption $registry->set('encryption',newEncryption($config->get('config_encryption'))); //FrontController $controller=newFront($registry); //MaintenanceMode $controller->addPreAction(newAction('common/maintenance')); //SEOURL's $controller->addPreAction(newAction('common/seo_url')); //Router if(isset($request->get['route'])){ $action=newAction($request->get['route']); }else{ $action=newAction('common/home'); } //Dispatch $controller->dispatch($action,newAction('error/not_found')); //Output $response->output(); ?>



請為這篇文章評分?


延伸文章資訊