Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • CoreConfigRequirement
  • DatabaseForm
  • DatabaseOperation
  • DocumentDecorator
  • InstallForm
  • InstallOperation
  • InstallRequirements
  • LanguageElement
  • Operation
  • PanelDecorator
  • PanelForm
  • PDODriversRequirement
  • RepositoryRequirement
  • Requirement
  • Requirements
  • RequirementsOperation
  • SiteForm
  • SiteOperation
  • StepsController
  • TellMeMore
  • UserConfigRequirement
  • UserForm
  • UserOperation
  • WelcomePanel
  • WelcomeRequirements

Functions

  • t
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee/Installer package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Installer;
13 
14 use ICanBoogie\Errors;
15 
16 /**
17  * Requirements for the "core" config.
18  */
19 class CoreConfigRequirement extends Requirement
20 {
21     public function __construct()
22     {
23         $this->title = t('requirement.core_config.title');
24         $this->description = t
25         (
26             'requirement.core_config.description', array
27             (
28                 'action' => new TellMeMore('core_config'),
29                 'data' => '<textarea class="span8" readonly="readonly">' . \ICanBoogie\escape($this->get_data()) . '</textarea>'
30             )
31         );
32     }
33 
34     /**
35      * Checks that the "core" config exists or can be created.
36      */
37     public function __invoke(Errors $errors)
38     {
39         $pathname = WEBSITE_CONFIG_DIR . 'core.php';
40 
41         if (file_exists($pathname))
42         {
43             return;
44         }
45 
46         if (is_writable($pathname))
47         {
48             file_put_contents($pathname, $data);
49 
50             return;
51         }
52 
53         $errors['core_config'] = t('requirement.core_config.error.not_writable', array('pathname' => \ICanBoogie\strip_root($pathname)));
54     }
55 
56     public function get_data()
57     {
58         global $core;
59 
60         $options = $core->session->install['database'];
61 
62         $name = $options['name'];
63         $host = $options['host'] ?: 'localhost';
64         $username = $options['username'];
65         $password = $options['password'];
66         $prefix = $options['prefix'];
67 
68         return <<<EOT
69 <?php
70 
71 return array
72 (
73     'connections' => array
74     (
75         'primary' => array
76         (
77             'dsn' => 'mysql:dbname=$name;host=$host',
78             'username' => '$username',
79             'password' => '$password',
80             '#timezone' => '+00.00',
81             '#table_name_prefix' => '$prefix'
82         )
83     ),
84 
85     'modules paths' => array
86     (
87         \$path . 'modules'
88     )
89 );
90 EOT;
91     }
92 }
Autodoc API documentation generated by ApiGen 2.8.0