在某些框架中,你可以把某个项目的文件放在单独的app和lib目录中。Solar是面向类库和命名空间的,所以非Solar系统文件将被放在同一个地方,就像Solar本身一样,只不过要把它们放在不同的“工作区”。在这个演示教程中,我们把这里的“工作区”命名为Acme。
在命令行环境下,进入SYSTEM目录,输入make-vendor命令。你将会看到类似下面这种输出:
$ ./script/solar make-vendor Acme Making vendor source directories. Creating SYSTEM/source/acme/config. Creating SYSTEM/source/acme/docs. Creating SYSTEM/source/acme/script. Creating SYSTEM/source/acme/tests. Creating SYSTEM/source/acme/tests/Mock. Creating SYSTEM/source/acme/tests/Mock/Acme. Creating SYSTEM/source/acme/tests/Test. Creating SYSTEM/source/acme/tests/Test/Acme. Creating SYSTEM/source/acme/Acme/Cli/Help. Creating SYSTEM/source/acme/Acme/Cli/Help/Info. Creating SYSTEM/source/acme/Acme/Cli/Help/Locale. Creating SYSTEM/source/acme/Acme/Controller/Bread/Locale. Creating SYSTEM/source/acme/Acme/Controller/Bread/Public. Creating SYSTEM/source/acme/Acme/Controller/Bread/View. Creating SYSTEM/source/acme/Acme/Controller/Command/Info. Creating SYSTEM/source/acme/Acme/Controller/Command/Locale. Creating SYSTEM/source/acme/Acme/Controller/Page/Layout. Creating SYSTEM/source/acme/Acme/Controller/Page/Locale. Creating SYSTEM/source/acme/Acme/Controller/Page/Public. Creating SYSTEM/source/acme/Acme/Controller/Page/View. Creating SYSTEM/source/acme/Acme/Model. Writing SYSTEM/source/acme/Acme/Cli/Help.php ... done. Writing SYSTEM/source/acme/Acme/Cli/Help/Info/options.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/Locale/en_US.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/_item.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/_list.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/add.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/browse.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/delete.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/edit.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/read.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Bread/View/search.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Command.php ... done. Writing SYSTEM/source/acme/Acme/Controller/Page.php ... done. Writing SYSTEM/source/acme/Acme/Filter.php ... done. Making directory SYSTEM/source/acme/Acme/Sql ... done. Writing SYSTEM/source/acme/Acme/Sql/Model.php ... done. Making directory SYSTEM/source/acme/Acme/Sql/Model ... done. Writing SYSTEM/source/acme/Acme/Sql/Model/Collection.php ... done. Writing SYSTEM/source/acme/Acme/Sql/Model/Metadata.php ... done. Writing SYSTEM/source/acme/Acme/Sql/Model/Record.php ... done. Writing SYSTEM/source/acme/config/default.php ... done. Writing SYSTEM/source/acme/config/run-tests.php ... done. Writing SYSTEM/source/acme/Acme/Cli/Help/Info/help.txt ... done. Making links for vendor 'Acme' ... Making link 'include/Acme' ... done. Making link 'include/Test/Acme' ... done. Making link 'include/Mock/Acme' ... done. Making link 'script/acme' ... done. ... done. Making public symlinks for 'Acme' ... Making public directory docroot/public/Acme/Controller ... done. Making public symlink for Acme_Controller_Bread ... done. Making public symlink for Acme_Controller_Page ... done. ... done. Remember to add 'Acme_App' to the ['Solar_Controller_Front']['classes'] element in your config file so that it finds your apps. Remember to add 'Acme_Model' to the ['Solar_Sql_Model_Catalog']['classes'] element in your config file so that it finds your models. $
Note | |
---|---|
上面发生的事情是:Solar创建source/acme目录、生成基本的模型和控制器类库并创建视图帮助、数据过滤、共享、文档及测试等子目录。接着Solar创建include/Acme链接指向源文件。这样,你就可以在source目录中存放非类库文件,但是include路径中却只包含类库文件。 |