Exemplo n.º 1
0
 /**
  * Construct the controller
  */
 public function __construct()
 {
     parent::__construct();
     $this->oOrderModel = Factory::model('ORder', 'nailsapp/module-order-payment');
 }
Exemplo n.º 2
0
Factory::helper('date');
Factory::helper('tools');
Factory::helper('debug');
Factory::helper('language');
Factory::helper('text');
Factory::helper('exception');
Factory::helper('log');
// --------------------------------------------------------------------------
//  Set Common and App locations
$aAppLocations = array(array(FCPATH . 'vendor/nailsapp/common/src/Common/Console/Command/', 'Nails\\Common\\Console\\Command'), array(FCPATH . 'src/Console/Command/', 'App\\Console\\Command'));
//  Look for apps provided by the modules
$aModules = _NAILS_GET_MODULES();
foreach ($aModules as $oModule) {
    $aAppLocations[] = array($oModule->path . 'src/Console/Command', $oModule->namespace . 'Console\\Command');
}
Factory::helper('directory');
$aApps = array();
foreach ($aAppLocations as $aLocation) {
    list($sPath, $sNamespace) = $aLocation;
    $aDirMap = directory_map($sPath);
    if (!empty($aDirMap)) {
        foreach ($aDirMap as $sFile) {
            $aFileInfo = pathinfo($sFile);
            $sFileName = basename($sFile, '.' . $aFileInfo['extension']);
            $aApps[] = $sNamespace . '\\' . $sFileName;
        }
    }
}
//  Instantiate and run the application
$app = new Application();
foreach ($aApps as $sClass) {
Exemplo n.º 3
0
 public function create($url)
 {
     // If no a protocol in URL, assume its a CI link
     if (!preg_match('!^\\w+://! i', $url)) {
         \Nails\Factory::helper('url');
         $url = site_url($url);
     }
     $this->url = $url;
     $this->session = curl_init($this->url);
     return $this;
 }