当前位置: 首页>>代码示例>>PHP>>正文


PHP D::error方法代码示例

本文整理汇总了PHP中D::error方法的典型用法代码示例。如果您正苦于以下问题:PHP D::error方法的具体用法?PHP D::error怎么用?PHP D::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在D的用法示例。


在下文中一共展示了D::error方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadApp

	function loadApp($appSettingName, $mainApp=false) {
	
		$appInfo = $this->libs->Config->get('SweetFramework', $appSettingName); //get the current app's settings
		
	//	D::show($this->libs->Config->get('SweetFramework'), 'sweet-framework settings');
		
		
		
		foreach($appInfo['paths'] as $k => $v) {
			if(!is_array(self::$paths[$k])) {
				self::$paths[$k] = array();
			}
			//add in the applications folders to the frameworks file loader
			self::$paths[$k][] = '/' . $appInfo['folder'] . '/' . $v .'/';
			//self::$paths[$k][] = join('/', array(LOC, $appInfo['folder'], $v)) .'/'; @todo A/B test these two.
		}
		if($mainApp == true && !defined('APP_FOLDER')) {
			define('APP_NAME', $appInfo['folder']);
			define('APP_FOLDER', LOC . '/' . APP_NAME);
			
			//$this->lib();
			$this->lib(array('Uri', 'Theme', $this->libs->Config->get('site', 'autoload')) );
			
			if(!$this->libs->Theme->set($this->libs->Config->get('site', 'theme'))) {
				D::error('Theme could not be found. Debug: $Config->getSetting(\'Site\', \'defaultTheme\') = ' . $this->libs->Config->get('site', 'defaultTheme'));
			}
			
		}
		return $this;
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:30,代码来源:SweetFramework.php

示例2: set

	function set($name) {
		//@todo rename this to just set
		$newPlace = 'app/themes/' . $name;
		D::log(LOC . '/' . $newPlace, 'new Place');
		if(is_dir(LOC . '/' . $newPlace)) {
			if(substr(URL, -1) == '?') {
				T::$url = $this->themeUrl = substr(URL, 0, -1) . $newPlace;
			} else {
				T::$url = $this->themeUrl = URL . $newPlace;
			}
			T::$loc = LOC . '/' . $newPlace;
			//$this->libs->Config->set('site', 'theme', $newPlace);
			return true;
		} else {
			D::error('Theme doesn\'t exist');
		}
	}
开发者ID:ajcates,项目名称:Sweet-Framework-old,代码行数:17,代码来源:Theme.php

示例3: set

	function set($name) {
		//@todo rename this to just set
		$newPlace = 'themes/' . $name;
		D::log($name, 'Theme Set');
	//	D::log(URL, 'URL');
		if(is_dir(APP_FOLDER . '/' . $newPlace)) {
			if(defined('URL')) {
				if(substr(URL, -1) == '?') {
					T::$url = $this->themeUrl = substr(URL, 0, -1) . APP_NAME . '/' . $newPlace . '/';
				} else {
					T::$url = $this->themeUrl = URL . APP_NAME . '/' . $newPlace . '/';
				}
			}			
			T::$loc =  $this->themeLoc = APP_FOLDER . '/' . $newPlace;
			//$this->libs->Config->set('site', 'theme', $newPlace);
			return true;
		} else {
			D::error('Theme doesn\'t exist');
		}
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:20,代码来源:Theme.php

示例4: loadController

 function loadController($controller = null)
 {
     if (isset($controller)) {
         $this->contorllerFile = $controller;
     }
     $class = SweetFramework::className($this->contorllerFile);
     if (!SweetFramework::loadFileType('controller', $class)) {
         D::error('No Controller Found');
     }
     $page = $this->loadUrl($class::$urlPattern, $this->count);
     if (is_array(f_last($page))) {
         if (is_array(f_first(f_last($page)))) {
             return $this->loadController(f_first(f_first(f_last($page))), $this->count += 1);
         }
         $page[$this->count] = f_first(f_last($page));
         //D::log($page[$part], 'page o parts');
     }
     D::log($page, 'Initing Controller…');
     $this->controller = new $class();
     //$this->controller->getLibrary('Databases/Query.php');
     /*@todo make "shortcuts" more dynamic */
     //$this->controller->template =& $this->controller->lib->Template;
     if (empty($page[$this->count])) {
         return f_callable(array($this->controller, 'index'));
     } else {
         if (method_exists($class, $page[$this->count])) {
             return f_callable(array($this->controller, $page[$this->count]));
         }
     }
     if (method_exists($class, '__DudeWheresMyCar')) {
         return f_callable(array($this->controller, '__DudeWheresMyCar'));
     }
     return function () {
         header("HTTP/1.0 404 Not Found");
         echo '<h1>404 error</h1>';
         //todo check for some sort of custom 404…
         return false;
     };
 }
开发者ID:ajcates,项目名称:Sweet-Framework-old,代码行数:39,代码来源:Uri.php

示例5: loadController

	function loadController($controller=null) {
		if(isset($controller)) {
			$this->contorllerFile = $controller;
		}
		if(empty($this->contorllerFile)) {
			$this->contorllerFile = $this->lib('Config')->get('site', 'mainController');
		}
		
		$class = SweetFramework::className($this->contorllerFile);
		D::log($class, 'Controller Loaded');
		
		if(!SweetFramework::loadFileType('controller', $this->contorllerFile)) {
			D::error('No Controller Found');
		}
		if(!empty($class::$urlPattern)) {
			$page = $this->loadUrl($class::$urlPattern);
		} else {
			$page = $this->loadUrl(array());
		}
		
		D::log($this->count, 'COUNT');
		D::log($page, 'page');
		
		if(is_array(f_last($page))) {
			if(is_array( f_first(f_last($page)) )) {
				$this->request = f_first($page);
				D::log($this->request, 'Request Reduced');
				if(method_exists($class, 'enRoute')) {
					$class::enRoute();
				}
				return $this->loadController(f_first(f_first(f_last($page))) );
			}
			$page[$this->count] = f_first(f_last($page));
		}
		
		$fpage = f_first($page);
		$this->controller = new $class();
		if(empty($fpage)) {
			return f_callable(array($this->controller, D::log('index', 'Controller Function')));
		} else {
			if(method_exists($class, $fpage)) {
				return f_callable(array($this->controller, D::log($fpage, 'Controller Function')));
			}
		}
		
		//D::show($class, 'controller');
		if(method_exists($class, '__DudeWheresMyCar')) {
			return f_callable(array(
				$this->controller,
				'__DudeWheresMyCar'
			));
		}
		//@todo find a way to check for __DudeWheresMyCar functions higher up the controller tree.
		
		return function() {
			header('HTTP/1.0 404 Not Found');
			echo '<h1>404 error</h1>'; //todo check for some sort of custom 404…
			return false;
		};
	}
开发者ID:noblejay,项目名称:Sweet-Framework,代码行数:60,代码来源:Uri.php


注:本文中的D::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。