Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

how does silverstripe find all the new files added ti a directory automaticaly?


Go to End


3 Posts   1687 Views

Avatar
vancouverWill

Community Member, 121 Posts

6 January 2012 at 3:28pm

how does silverstripe find all the new files added? other frameworks and cms's generally need to be passed xml files containing the details of new files. I know it's not like a compiled language where new files are automatically included but I can't see how it does recognize all new files without adding includes everywhere. Anyone know this offhand?

thanks

Will

Avatar
swaiba

Forum Moderator, 1899 Posts

7 January 2012 at 12:33am

Yep - this is the dev/build thing - it creates a manifest (list of files where the class mathes the filename) and then it auto loads those requried

Avatar
vancouverWill

Community Member, 121 Posts

13 January 2012 at 8:52am

thanks Swaiba for the quick reply, very much appreciated. It all makes a lot more sense now I searched for manifest.

For anyone else who comes across this I'll explain what I found, for each class ManifestBuilder.php stores in cache a file name manifestClassParse-ExamplePage_php-66d4f5ee00b281254d01a3dc361b71f4 where ExamplePage.php is a class I created. Inside is an array showing how this class is related to another class for example I have pasted Page.php manifest file below. While this doesn't need to be known for daily SS running I find it really interesting how they have built the foundations. Props to the development team

<?php
				$classes = array (
  0 => 
  array (
    'className' => 'Page',
    'extends' => 'SiteTree',
  ),
  1 => 
  array (
    'className' => 'Page_Controller',
    'extends' => 'ContentController',
  ),
);
				$interfaces = array (
);