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


PHP CRUD::topLevelClass方法代码示例

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


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

示例1: init

 /**
  * Método que dispara o projeto
  * - Fax a conexão como banco utilizando o array $connection
  * - Especifica o TablePrefix
  * - Especifica a topLevelClass
  * - Faz o tratamento da URL
  * - Exibe o tratamento chamando a URL
  *
  * @return void
  */
 public static function init()
 {
     define("PROTOCOLO", 'http://');
     self::$configurationArray = parse_ini_file(self::$globalConfiurationFile, true);
     if (!defined('WEB_DIR')) {
         define('WEB_DIR', self::$configurationArray['project']['directory']);
     }
     if (!defined("WEB_URL")) {
         define("WEB_URL", self::$configurationArray['project']['url']);
     }
     if (!defined("SMARTY_DIR")) {
         define("SMARTY_DIR", WEB_DIR . "classes/smarty/");
     }
     set_include_path(WEB_DIR . 'classes/smarty/' . PATH_SEPARATOR . WEB_DIR . 'classes/' . PATH_SEPARATOR . ".");
     /*******************************************************************************
      * AUTO_LOAD
      * define se o método mágico para autoload de classes esta ativo
      ******************************************************************************/
     if (Samus::$useAutoloadFunction) {
         require_once 'util/AutoRequire.php';
         function __autoload($className)
         {
             AutoRequire::showSugests();
             AutoRequire::requireClass($className);
         }
     }
     include_once 'samus/Samus_Keeper.php';
     require_once 'samus/Samus_Exception.php';
     require_once 'samus/Samus_Model.php';
     require_once 'samus/Samus_Filter.php';
     require_once 'CRUD/Properties.php';
     require_once 'CRUD/TableFactory.php';
     require_once 'samus/Samus_Object.php';
     require_once 'database/Connection.php';
     require_once 'CRUD/CRUDQuery.php';
     require_once 'database/ConnectionMySqli.php';
     ////////////////////////////////////////////////////////////////////////
     // CONFIGURAÇÃO DA CONEXÃO
     // faz a configuração da conexão a partir do global_configuration.ini
     ////////////////////////////////////////////////////////////////////////
     self::setConnection(self::$configurationArray['connection']);
     // lê arquivo de conexão e realiza a conexão
     CRUDQuery::setModo(self::$connection["queryMode"]);
     if (self::$connection["queryMode"] == CRUDQuery::QUERY_MODE_MYSQLI) {
         ConnectionMySqli::connect(self::$connection['name'], self::$connection['user'], self::$connection['password'], self::$connection['host'], self::$connection['charset'], self::$connection['engine']);
         CRUDQuery::setConn(ConnectionMySqli::getConn());
         // essalinha ta meio redundante verificar depois
         CRUD::setConn(ConnectionMySqli::getConn());
     } else {
         Connection::connect(self::$connection['adapter'], self::$connection['host'], self::$connection['name'], self::$connection['user'], self::$connection['password']);
         CRUDQuery::setConn(Connection::getConn());
         CRUD::setConn(Connection::getPdo());
     }
     self::$tablePrefix = self::$connection["table_prefix"];
     CRUD::$tablePrefix = self::getTablePrefix();
     CRUD::$topLevelClass = "Samus_Model";
     ////////////////////////////////////////////////////////////////////////
     // EXIBINDO AS PÁGINAS
     // aqui o fazendeiro exibe as páginas
     ////////////////////////////////////////////////////////////////////////
     self::setHttpHost($_GET['httpHost']);
     $samus_keeper = new Samus_Keeper($_GET['__cod'], $_GET['httpHost']);
     $samus_keeper->displayPage();
 }
开发者ID:laiello,项目名称:samusframework,代码行数:74,代码来源:Samus.php


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